|
|
|
@ -117,43 +117,43 @@ public enum LootManager {
@@ -117,43 +117,43 @@ public enum LootManager {
|
|
|
|
|
|
|
|
|
|
float dropRate = NORMAL_DROP_RATE; |
|
|
|
|
//roll the geenric world drop table
|
|
|
|
|
GenerateLootDrop(mob, 1300); |
|
|
|
|
if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) { |
|
|
|
|
MobLoot extraLoot = rollForGlass(mob); |
|
|
|
|
if (extraLoot != null) { |
|
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
|
if(mob.parentZone.getSafeZone() == 0) { |
|
|
|
|
GenerateLootDrop(mob, 1300); |
|
|
|
|
if(ThreadLocalRandom.current().nextInt(1, 10000) == 5000) { |
|
|
|
|
MobLoot extraLoot = rollForGlass(mob); |
|
|
|
|
if (extraLoot != null) { |
|
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Iterate all entries in this bootySet and process accordingly
|
|
|
|
|
boolean hasExtraRolled = false; |
|
|
|
|
for (BootySetEntry bse : entries) { |
|
|
|
|
|
|
|
|
|
switch (bse.bootyType) { |
|
|
|
|
case "GOLD": |
|
|
|
|
GenerateGoldDrop(mob, bse); |
|
|
|
|
break; |
|
|
|
|
case "LOOT": |
|
|
|
|
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) |
|
|
|
|
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
|
|
|
|
|
if(mob.parentZone.getSafeZone() == 0) { |
|
|
|
|
if (hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 10000) < 5 * dropRate) { |
|
|
|
|
int roll = ThreadLocalRandom.current().nextInt(1, 101); |
|
|
|
|
MobLoot extraLoot = null; |
|
|
|
|
if (roll >= 1 && roll <= 50) { |
|
|
|
|
extraLoot = rollForContract(bse.genTable, mob); |
|
|
|
|
} |
|
|
|
|
if (roll >= 51 && roll <= 94) { |
|
|
|
|
extraLoot = rollForRune(bse.genTable, mob); |
|
|
|
|
} |
|
|
|
|
//if (roll >= 95) {
|
|
|
|
|
// extraLoot = rollForGlass(mob);
|
|
|
|
|
//}
|
|
|
|
|
if (extraLoot != null) { |
|
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
|
} |
|
|
|
|
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) |
|
|
|
|
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
|
|
|
|
|
if (mob.parentZone.getSafeZone() == 0 && hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 10000) < 5 * dropRate) { |
|
|
|
|
int roll = ThreadLocalRandom.current().nextInt(1, 101); |
|
|
|
|
MobLoot extraLoot = null; |
|
|
|
|
if (roll >= 1 && roll <= 50) { |
|
|
|
|
extraLoot = rollForContract(bse.genTable, mob); |
|
|
|
|
} |
|
|
|
|
if (roll >= 51 && roll <= 94) { |
|
|
|
|
extraLoot = rollForRune(bse.genTable, mob); |
|
|
|
|
} |
|
|
|
|
//if (roll >= 95) {
|
|
|
|
|
// extraLoot = rollForGlass(mob);
|
|
|
|
|
//}
|
|
|
|
|
if (extraLoot != null) { |
|
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
|
} |
|
|
|
|
hasExtraRolled = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "ITEM": |
|
|
|
|
GenerateInventoryDrop(mob, bse); |
|
|
|
@ -338,7 +338,9 @@ public enum LootManager {
@@ -338,7 +338,9 @@ public enum LootManager {
|
|
|
|
|
public static void GenerateLootDrop(Mob mob, int tableID) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
if(mob.parentZone.getSafeZone() == 1) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
MobLoot toAdd = getGenTableItem(tableID, mob); |
|
|
|
|
if(toAdd.getItemBase().getType().equals(Enum.ItemType.CONTRACT) || toAdd.getItemBase().getType().equals(Enum.ItemType.RUNE)) |
|
|
|
|
return;//block all contracts and runes that drop outside the confines of the new system
|
|
|
|
@ -354,6 +356,10 @@ public enum LootManager {
@@ -354,6 +356,10 @@ public enum LootManager {
|
|
|
|
|
|
|
|
|
|
public static void GenerateEquipmentDrop(Mob mob) { |
|
|
|
|
|
|
|
|
|
if(mob.parentZone.getSafeZone() == 1) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//do equipment here
|
|
|
|
|
int dropCount = 0; |
|
|
|
|
if (mob.getEquip() != null) |
|
|
|
@ -403,6 +409,10 @@ public enum LootManager {
@@ -403,6 +409,10 @@ public enum LootManager {
|
|
|
|
|
|
|
|
|
|
public static void GenerateInventoryDrop(Mob mob, BootySetEntry bse) { |
|
|
|
|
|
|
|
|
|
if(mob.parentZone.getSafeZone() == 1) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int chanceRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1); |
|
|
|
|
|
|
|
|
|
//early exit, failed to hit minimum chance roll
|
|
|
|
@ -501,6 +511,7 @@ public enum LootManager {
@@ -501,6 +511,7 @@ public enum LootManager {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static MobLoot rollForContract(int table, Mob mob){ |
|
|
|
|
|
|
|
|
|
int roll = 99; |
|
|
|
|
if (table == 1900 || table == 1500) |
|
|
|
|
roll = 73; |
|
|
|
|