Browse Source

added case staement for "ITEM"

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

18
src/engine/loot/LootManager.java

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

Loading…
Cancel
Save