|
|
@ -58,27 +58,35 @@ public class LootManager { |
|
|
|
//early exit, failed to hit minimum chance roll
|
|
|
|
//early exit, failed to hit minimum chance roll
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
if (bse.bootyType.equals("GOLD")) { |
|
|
|
switch(bse.bootyType){ |
|
|
|
//determine and add gold to mob inventory
|
|
|
|
case "GOLD": |
|
|
|
int gold = new Random().nextInt(bse.highGold - bse.lowGold) + bse.lowGold; |
|
|
|
//determine and add gold to mob inventory
|
|
|
|
if (gold > 0) { |
|
|
|
int gold = new Random().nextInt(bse.highGold - bse.lowGold) + bse.lowGold; |
|
|
|
MobLoot goldAmount = new MobLoot(mob, (int) (gold * multiplier)); |
|
|
|
if (gold > 0) { |
|
|
|
mob.getCharItemManager().addItemToInventory(goldAmount); |
|
|
|
MobLoot goldAmount = new MobLoot(mob, (int) (gold * multiplier)); |
|
|
|
} |
|
|
|
mob.getCharItemManager().addItemToInventory(goldAmount); |
|
|
|
} else if (bse.bootyType.equals("LOOT")) { |
|
|
|
} |
|
|
|
//iterate the booty tables and add items to mob inventory
|
|
|
|
break; |
|
|
|
Item toAdd = getGenTableItem(bse.lootTable, mob); |
|
|
|
case "LOOT": |
|
|
|
if(toAdd != null) { |
|
|
|
//iterate the booty tables and add items to mob inventory
|
|
|
|
mob.getCharItemManager().addItemToInventory(toAdd); |
|
|
|
Item toAdd = getGenTableItem(bse.lootTable, mob); |
|
|
|
} |
|
|
|
if(toAdd != null) { |
|
|
|
if (inHotzone) { |
|
|
|
mob.getCharItemManager().addItemToInventory(toAdd); |
|
|
|
Item toAddHZ = getGenTableItem(bse.lootTable + 1, mob); |
|
|
|
} |
|
|
|
mob.getCharItemManager().addItemToInventory(toAddHZ); |
|
|
|
if (inHotzone) { |
|
|
|
} |
|
|
|
Item toAddHZ = getGenTableItem(bse.lootTable + 1, mob); |
|
|
|
} else if(bse.bootyType.equals("ITEM")){ |
|
|
|
if(toAddHZ != null) { |
|
|
|
if(Item.getItem(bse.itemBase) != null) { |
|
|
|
mob.getCharItemManager().addItemToInventory(toAddHZ); |
|
|
|
mob.getCharItemManager().addItemToInventory(Item.getItem(bse.itemBase)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "ITEM": |
|
|
|
|
|
|
|
Item disc = Item.getItem(bse.itemBase); |
|
|
|
|
|
|
|
if(disc != null) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mob.getCharItemManager().addItemToInventory(disc); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//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
|
|
|
|