|
|
|
@ -112,22 +112,9 @@ public enum LootManager {
@@ -112,22 +112,9 @@ public enum LootManager {
|
|
|
|
|
case "LOOT": |
|
|
|
|
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) |
|
|
|
|
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
|
|
|
|
|
int extraRoll = ThreadLocalRandom.current().nextInt(1,20000); |
|
|
|
|
if(extraRoll == 1000){//0.005% chance
|
|
|
|
|
MobLoot extraLoot = null; |
|
|
|
|
int extraItemRoll = ThreadLocalRandom.current().nextInt(1,101); |
|
|
|
|
if(extraItemRoll >= 1 && extraItemRoll <= 47){//0.00235% chance per mob killed or 1 in 425
|
|
|
|
|
extraLoot = tryForContract(bse.genTable,mob); |
|
|
|
|
} |
|
|
|
|
if(extraItemRoll >= 48 && extraItemRoll <= 94){//0.00235% chance per mob killed or 1 in 425
|
|
|
|
|
extraLoot = tryForStatRune(bse.genTable,mob); |
|
|
|
|
} |
|
|
|
|
if(extraItemRoll > 94){//0.0003% chance per mob killed or 1 in 3333
|
|
|
|
|
extraLoot = tryForGlass(mob); |
|
|
|
|
} |
|
|
|
|
if(extraLoot != null){ |
|
|
|
|
extraLoot.setIsID(true); |
|
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
|
if(ThreadLocalRandom.current().nextInt(1, 20000) < mob.level) { |
|
|
|
|
if (_genTables.containsKey(bse.genTable + 1) && ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) { |
|
|
|
|
GenerateLootDrop(mob, bse.genTable + 1); //generate loot drop from hotzone table
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
@ -327,6 +314,7 @@ public enum LootManager {
@@ -327,6 +314,7 @@ public enum LootManager {
|
|
|
|
|
public static void GenerateEquipmentDrop(Mob mob) { |
|
|
|
|
|
|
|
|
|
//do equipment here
|
|
|
|
|
int dropCount = 0; |
|
|
|
|
if (mob.getEquip() != null) |
|
|
|
|
for (MobEquipment me : mob.getEquip().values()) { |
|
|
|
|
|
|
|
|
@ -357,18 +345,12 @@ public enum LootManager {
@@ -357,18 +345,12 @@ public enum LootManager {
|
|
|
|
|
} |
|
|
|
|
MobLoot ml = new MobLoot(mob, genericIB, false); |
|
|
|
|
|
|
|
|
|
if (ml != null) { |
|
|
|
|
if (ml != null && dropCount < 1) { |
|
|
|
|
ml.setIsID(true); |
|
|
|
|
ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); |
|
|
|
|
|
|
|
|
|
if(ml.getItemBase().isVorg()) { |
|
|
|
|
ml.clearEnchantments(); |
|
|
|
|
for (String enchant : ml.getItemBase().getCustomEnchants()) |
|
|
|
|
ml.addPermanentEnchantment(enchant, 40); |
|
|
|
|
|
|
|
|
|
ml.setName(ml.getItemBase().getName()); |
|
|
|
|
} |
|
|
|
|
mob.getCharItemManager().addItemToInventory(ml); |
|
|
|
|
dropCount = 1; |
|
|
|
|
//break; // Exit on first successful roll.
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -471,86 +453,4 @@ public enum LootManager {
@@ -471,86 +453,4 @@ public enum LootManager {
|
|
|
|
|
itemMan.addItemToInventory(playerWinnings); |
|
|
|
|
itemMan.updateInventory(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static MobLoot tryForContract(int tableID, Mob mob){ |
|
|
|
|
GenTableEntry selectedRow = GenTableEntry.rollTable(tableID, 99, 1.0f); |
|
|
|
|
if (selectedRow == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
int itemTableId = selectedRow.itemTableID; |
|
|
|
|
|
|
|
|
|
if (_itemTables.containsKey(itemTableId) == false) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(190,321));// 1 in 425 mobs
|
|
|
|
|
|
|
|
|
|
MobLoot outItem = null; |
|
|
|
|
|
|
|
|
|
if (tableRow == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
int itemUUID = tableRow.cacheID; |
|
|
|
|
|
|
|
|
|
if (itemUUID == 0) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
|
if(outItem != null){ |
|
|
|
|
return outItem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
public static MobLoot tryForStatRune(int tableID, Mob mob){ |
|
|
|
|
GenTableEntry selectedRow = GenTableEntry.rollTable(tableID, 96, 1.0f); |
|
|
|
|
if (selectedRow == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
int itemTableId = selectedRow.itemTableID; |
|
|
|
|
|
|
|
|
|
if (_itemTables.containsKey(itemTableId) == false) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(1,321));//76.5% chance for stat rune or 1 in 750 mobs
|
|
|
|
|
|
|
|
|
|
MobLoot outItem = null; |
|
|
|
|
|
|
|
|
|
if (tableRow == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
int itemUUID = tableRow.cacheID; |
|
|
|
|
|
|
|
|
|
if (itemUUID == 0) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
|
if(outItem != null){ |
|
|
|
|
return outItem; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
public static MobLoot tryForGlass(Mob mob){ |
|
|
|
|
int itemTableId = 126; |
|
|
|
|
|
|
|
|
|
if (_itemTables.containsKey(itemTableId) == false) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(1,321));//30.9% chance to get glass or 1 in 4362 mobs
|
|
|
|
|
|
|
|
|
|
MobLoot outItem = null; |
|
|
|
|
|
|
|
|
|
if (tableRow == null) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
int itemUUID = tableRow.cacheID; |
|
|
|
|
|
|
|
|
|
if (itemUUID == 0) |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
|
if(outItem != null){ |
|
|
|
|
return outItem; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|