Mob equipment drops once more, including vorg with proper chance

This commit is contained in:
2023-04-23 22:07:54 -05:00
parent f24605735e
commit 620fad57fe
3 changed files with 23 additions and 16 deletions
+1 -1
View File
@@ -464,7 +464,7 @@ public class MobileFSM {
mob.setCombatTarget(null);
}
}
if (mob.getLoc().distanceSquared2D(mob.getBindLoc()) > sqr(2000)) {
if(MovementUtilities.inRangeOfBindLocation(mob) == false) {
PowersBase recall = PowersManager.getPowerByToken(-1994153779);
PowersManager.useMobPower(mob, mob, recall, 40);
mob.setCombatTarget(null);
+20 -14
View File
@@ -71,11 +71,27 @@ public class LootManager {
}
}
private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob, float multiplier, boolean inHotzone, boolean fromDeath) {
if(fromDeath){
//do equipment here
if (mob.getEquip() != null){
for (MobEquipment me : mob.getEquip().values()){
if (me.getDropChance() == 0)
continue;
float equipmentRoll = ThreadLocalRandom.current().nextFloat();
float dropChance = me.getDropChance();
if (equipmentRoll < dropChance){
MobLoot ml = new MobLoot(mob, me.getItemBase(), false);
mob.getCharItemManager().addItemToInventory(ml);
}
}
}
return;
}
for (BootySetEntry bse : entries) {
int roll = ThreadLocalRandom.current().nextInt(101);
int roll = ThreadLocalRandom.current().nextInt(100);
switch (bse.bootyType) {
case "GOLD":
if (roll > (bse.dropChance * multiplier) || fromDeath) {
if (roll > (bse.dropChance * multiplier)) {
//early exit, failed to hit minimum chance roll OR booty was generated from mob's death
break;
}
@@ -87,7 +103,7 @@ public class LootManager {
}
break;
case "LOOT":
if (roll > (bse.dropChance * multiplier) || fromDeath) {
if (roll > (bse.dropChance * multiplier)) {
//early exit, failed to hit minimum chance roll OR booty was generated from mob's death
break;
}
@@ -110,16 +126,6 @@ public class LootManager {
mob.getCharItemManager().addItemToInventory(disc);
break;
case "EQUIP":
if (roll > (bse.dropChance * multiplier) && fromDeath) {
//early exit, failed to hit minimum chance roll OR booty wasn't generated from mob's death
break;
}
MobLoot equipToAdd = new MobLoot(mob, ItemBase.getItemBase(bse.itemBase), true);
if (equipToAdd != null) {
mob.getCharItemManager().addItemToInventory(equipToAdd);
}
break;
}
}
}
@@ -128,7 +134,7 @@ public class LootManager {
return null;
}
MobLoot outItem;
int roll = new Random().nextInt(100);
int roll = new Random().nextInt(101);
GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(roll);
if(selectedRow == null) {
return null;
+2 -1
View File
@@ -1270,7 +1270,8 @@ public class Mob extends AbstractIntelligenceAgent {
//cleanup effects
playerAgroMap.clear();
if (!this.isPlayerGuard && this.equip != null) LootManager.GenerateMobLoot(this, true);
if (!this.isPlayerGuard && this.equip != null)
LootManager.GenerateMobLoot(this, true);
}
try {