hotzone roll tweaks
This commit is contained in:
@@ -81,37 +81,57 @@ public class LootManager {
|
|||||||
DropEquipment(mob,multiplier);
|
DropEquipment(mob,multiplier);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Boolean hasRolledForGlass = false;
|
||||||
for (BootySetEntry bse : entries) {
|
for (BootySetEntry bse : entries) {
|
||||||
switch (bse.bootyType) {
|
switch (bse.bootyType) {
|
||||||
case "GOLD":
|
case "GOLD":
|
||||||
GenerateGoldDrop(mob,bse,multiplier);
|
GenerateGoldDrop(mob,bse,multiplier);
|
||||||
break;
|
break;
|
||||||
case "LOOT":
|
case "LOOT":
|
||||||
GenerateNormalLootDrop(mob,bse,multiplier);
|
GenerateNormalLootDrop(mob,bse,multiplier,inHotzone);
|
||||||
if (inHotzone && mob.level < 80) {
|
if (inHotzone && mob.level < 80) {
|
||||||
if (generalItemTables.containsKey(bse.lootTable + 1)) {
|
if (generalItemTables.containsKey(bse.lootTable + 1)) {
|
||||||
GenerateHotzoneLootDrop(mob, bse, multiplier);
|
GenerateHotzoneLootDrop(mob, bse, multiplier);
|
||||||
|
} else{
|
||||||
|
//if hotzone equivalent table doesn't exist, roll for glass
|
||||||
|
RollForGlass(mob);
|
||||||
|
hasRolledForGlass = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mob.level > 80){
|
if(mob.level > 80){
|
||||||
RollForGlass(mob);
|
RollForGlass(mob);
|
||||||
}
|
}
|
||||||
|
RollLootTableForHotzone(mob, bse);
|
||||||
break;
|
break;
|
||||||
case "ITEM":
|
case "ITEM":
|
||||||
GenerateItemLootDrop(mob,bse,multiplier);
|
GenerateItemLootDrop(mob,bse,multiplier);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(inHotzone){
|
if(inHotzone && hasRolledForGlass == false){
|
||||||
RollForGlass(mob);
|
RollForGlass(mob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static MobLoot getGenTableItem(int genTableID, Mob mob) {
|
public static void RollLootTableForHotzone(Mob mob, BootySetEntry bse){
|
||||||
|
MobLoot toAdd = getGenTableItem(bse.lootTable, mob,true);
|
||||||
|
if (toAdd != null) {
|
||||||
|
if(toAdd.getPrefix() == null && toAdd.getSuffix() == null){
|
||||||
|
toAdd.setIsID(true);
|
||||||
|
}
|
||||||
|
mob.getCharItemManager().addItemToInventory(toAdd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static MobLoot getGenTableItem(int genTableID, Mob mob, Boolean isHotzone) {
|
||||||
if (genTableID == 0 || mob == null || generalItemTables.containsKey(genTableID) == false) {
|
if (genTableID == 0 || mob == null || generalItemTables.containsKey(genTableID) == false) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
MobLoot outItem;
|
MobLoot outItem;
|
||||||
int genRoll = new Random().nextInt(100)+1;
|
int genRoll;
|
||||||
|
if(isHotzone){
|
||||||
|
genRoll = ThreadLocalRandom.current().nextInt(32) + 77;
|
||||||
|
} else {
|
||||||
|
genRoll = new Random().nextInt(100) + 1;
|
||||||
|
}
|
||||||
GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll);
|
GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll);
|
||||||
if (selectedRow == null) {
|
if (selectedRow == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -195,7 +215,7 @@ public class LootManager {
|
|||||||
mob.getCharItemManager().addItemToInventory(goldAmount);
|
mob.getCharItemManager().addItemToInventory(goldAmount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void GenerateNormalLootDrop(Mob mob, BootySetEntry bse,float multiplier){
|
public static void GenerateNormalLootDrop(Mob mob, BootySetEntry bse,float multiplier, Boolean inHotzone){
|
||||||
try{
|
try{
|
||||||
int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1;
|
int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1;
|
||||||
if (chanceRoll > bse.dropChance * multiplier) {
|
if (chanceRoll > bse.dropChance * multiplier) {
|
||||||
@@ -203,7 +223,7 @@ public class LootManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//iterate the booty tables and add items to mob inventory
|
//iterate the booty tables and add items to mob inventory
|
||||||
MobLoot toAdd = getGenTableItem(bse.lootTable, mob);
|
MobLoot toAdd = getGenTableItem(bse.lootTable, mob,inHotzone);
|
||||||
if (toAdd != null) {
|
if (toAdd != null) {
|
||||||
if(toAdd.getPrefix() == null && toAdd.getSuffix() == null){
|
if(toAdd.getPrefix() == null && toAdd.getSuffix() == null){
|
||||||
toAdd.setIsID(true);
|
toAdd.setIsID(true);
|
||||||
@@ -218,12 +238,13 @@ public class LootManager {
|
|||||||
}
|
}
|
||||||
public static void GenerateHotzoneLootDrop(Mob mob, BootySetEntry bse, float multiplier){
|
public static void GenerateHotzoneLootDrop(Mob mob, BootySetEntry bse, float multiplier){
|
||||||
int lootTableID = bse.lootTable + 1;
|
int lootTableID = bse.lootTable + 1;
|
||||||
int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1;
|
//hotzone roll will ignore chance from inherited table
|
||||||
if (chanceRoll > bse.dropChance * multiplier) {
|
//int chanceRoll = ThreadLocalRandom.current().nextInt(100) + 1;
|
||||||
//early exit, failed to hit minimum chance roll
|
//if (chanceRoll > bse.dropChance * multiplier) {
|
||||||
return;
|
// //early exit, failed to hit minimum chance roll
|
||||||
}
|
// return;
|
||||||
MobLoot toAdd = getGenTableItem(lootTableID, mob);
|
//}
|
||||||
|
MobLoot toAdd = getGenTableItem(lootTableID, mob, true);
|
||||||
if (toAdd != null) {
|
if (toAdd != null) {
|
||||||
if (toAdd.getPrefix() != null && toAdd.getPrefix().isEmpty() == true && toAdd.getSuffix() != null && toAdd.getSuffix().isEmpty() == true) {
|
if (toAdd.getPrefix() != null && toAdd.getPrefix().isEmpty() == true && toAdd.getSuffix() != null && toAdd.getSuffix().isEmpty() == true) {
|
||||||
toAdd.setIsID(true);
|
toAdd.setIsID(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user