Browse Source

random disc runes

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

Loading…
Cancel
Save