Browse Source

drops no longer announce on mob death && config drop rate used for mob equipment drop chance

master
FatBoy-DOTC 2 years ago
parent
commit
718fe56cda
  1. 18
      src/engine/loot/LootManager.java

18
src/engine/loot/LootManager.java

@ -60,13 +60,15 @@ public class LootManager {
RunBootySet(NPCManager._bootySetMap.get(mob.bootySet), mob, multiplier, inHotzone, fromDeath); RunBootySet(NPCManager._bootySetMap.get(mob.bootySet), mob, multiplier, inHotzone, fromDeath);
} }
//lastly, check mobs inventory for godly or disc runes to send a server announcement //lastly, check mobs inventory for godly or disc runes to send a server announcement
for (Item it : mob.getInventory()) { if(!fromDeath) {
ItemBase ib = it.getItemBase(); for (Item it : mob.getInventory()) {
if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) { ItemBase ib = it.getItemBase();
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?"); if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) {
chatMsg.setMessageType(10); ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?");
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); chatMsg.setMessageType(10);
DispatchMessage.dispatchMsgToAll(chatMsg); chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
}
} }
} }
} }
@ -79,7 +81,7 @@ public class LootManager {
continue; continue;
float equipmentRoll = ThreadLocalRandom.current().nextFloat(); float equipmentRoll = ThreadLocalRandom.current().nextFloat();
float dropChance = me.getDropChance(); float dropChance = me.getDropChance();
if (equipmentRoll < dropChance){ if (equipmentRoll < dropChance * multiplier){
MobLoot ml = new MobLoot(mob, me.getItemBase(), false); MobLoot ml = new MobLoot(mob, me.getItemBase(), false);
mob.getCharItemManager().addItemToInventory(ml); mob.getCharItemManager().addItemToInventory(ml);
} }

Loading…
Cancel
Save