Browse Source

random disc runes

birdbane
FatBoy-DOTC 10 months ago
parent
commit
fec0a05c46
  1. 26
      src/engine/gameManager/LootManager.java

26
src/engine/gameManager/LootManager.java

@ -98,15 +98,10 @@ public enum LootManager { @@ -98,15 +98,10 @@ public enum LootManager {
DispatchMessage.dispatchMsgToAll(chatMsg);
}
if(ib.isDiscRune()){
ItemBase newDisc = ItemBase.getItemBase(ThreadLocalRandom.current().nextInt(3001,3049));
if(newDisc != null){
mob.getInventory().remove(it);
mob.getInventory().add(new MobLoot(mob,newDisc,true));
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + newDisc.getName() + ". Are you tough enough to take it?");
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().getName() + " has found the " + ib.getName() + ". Are you tough enough to take it?");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
}
}
}
@ -401,18 +396,23 @@ public enum LootManager { @@ -401,18 +396,23 @@ public enum LootManager {
if (chanceRoll > bse.dropChance)
return;
ItemBase ib = ItemBase.getItemBase(bse.itemBase);
if (ib == null)
return;
if (ib.isDiscRune()) {
ItemBase newDisc = ItemBase.getItemBase(ThreadLocalRandom.current().nextInt(3001, 3049 + 1));
if (newDisc != null) {
//mob.getInventory().add(new MobLoot(mob, newDisc, true));
mob.getCharItemManager().addItemToInventory(new MobLoot(mob, newDisc, true));
return;
}
}
MobLoot lootItem = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true);
if (lootItem != null)
mob.getCharItemManager().addItemToInventory(lootItem);
if(inHotzone){
MobLoot lootItem2 = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true);
if (lootItem != null)
mob.getCharItemManager().addItemToInventory(lootItem2);
}
}
public static void peddleFate(PlayerCharacter playerCharacter, Item gift) {
//get table ID for the itembase ID

Loading…
Cancel
Save