forked from MagicBane/Server
added case staement for "ITEM"
This commit is contained in:
@@ -58,14 +58,16 @@ 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){
|
||||||
|
case "GOLD":
|
||||||
//determine and add gold to mob inventory
|
//determine and add gold to mob inventory
|
||||||
int gold = new Random().nextInt(bse.highGold - bse.lowGold) + bse.lowGold;
|
int gold = new Random().nextInt(bse.highGold - bse.lowGold) + bse.lowGold;
|
||||||
if (gold > 0) {
|
if (gold > 0) {
|
||||||
MobLoot goldAmount = new MobLoot(mob, (int) (gold * multiplier));
|
MobLoot goldAmount = new MobLoot(mob, (int) (gold * multiplier));
|
||||||
mob.getCharItemManager().addItemToInventory(goldAmount);
|
mob.getCharItemManager().addItemToInventory(goldAmount);
|
||||||
}
|
}
|
||||||
} else if (bse.bootyType.equals("LOOT")) {
|
break;
|
||||||
|
case "LOOT":
|
||||||
//iterate the booty tables and add items to mob inventory
|
//iterate the booty tables and add items to mob inventory
|
||||||
Item toAdd = getGenTableItem(bse.lootTable, mob);
|
Item toAdd = getGenTableItem(bse.lootTable, mob);
|
||||||
if(toAdd != null) {
|
if(toAdd != null) {
|
||||||
@@ -73,12 +75,18 @@ public class LootManager {
|
|||||||
}
|
}
|
||||||
if (inHotzone) {
|
if (inHotzone) {
|
||||||
Item toAddHZ = getGenTableItem(bse.lootTable + 1, mob);
|
Item toAddHZ = getGenTableItem(bse.lootTable + 1, mob);
|
||||||
|
if(toAddHZ != null) {
|
||||||
mob.getCharItemManager().addItemToInventory(toAddHZ);
|
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
|
//lastly, check mobs inventory for godly or disc runes to send a server announcement
|
||||||
|
|||||||
Reference in New Issue
Block a user