Browse Source

equipment drops added to simulate booty command

master
FatBoy-DOTC 1 year ago
parent
commit
92cb741822
  1. 48
      src/engine/devcmd/cmds/simulateBootyCmd.java

48
src/engine/devcmd/cmds/simulateBootyCmd.java

@ -9,6 +9,7 @@ import engine.gameManager.ZoneManager; @@ -9,6 +9,7 @@ import engine.gameManager.ZoneManager;
import engine.objects.*;
import java.util.ArrayList;
import java.util.concurrent.ThreadLocalRandom;
public class simulateBootyCmd extends AbstractDevCmd {
public simulateBootyCmd() {
@ -50,32 +51,14 @@ public class simulateBootyCmd extends AbstractDevCmd { @@ -50,32 +51,14 @@ public class simulateBootyCmd extends AbstractDevCmd {
Enum.GameObjectType objType = target.getObjectType();
int objectUUID = target.getObjectUUID();
String output;
output = "Booty Simulation:" + newline;
switch (objType) {
case Building:
break;
case PlayerCharacter:
break;
case NPC:
break;
case Mob:
Mob mob = (Mob) target;
output += "Name: " + mob.getName() + newline;
int max = (int)(4.882 * mob.level + 127.0);
if(max > 320){
max = 320;
}
int min = (int)(4.469 * mob.level - 3.469);
output += "Roll Range: " + min + " - " + max + newline;
output += "Special Loot:" + newline;
if (mob.bootySet != 0) {
for (BootySetEntry entry : NPCManager._bootySetMap.get(mob.bootySet)) {
@ -91,6 +74,7 @@ public class simulateBootyCmd extends AbstractDevCmd { @@ -91,6 +74,7 @@ public class simulateBootyCmd extends AbstractDevCmd {
ArrayList<Item> Contracts = new ArrayList<Item>();
ArrayList<Item> Offerings = new ArrayList<Item>();
ArrayList<Item> OtherDrops = new ArrayList<Item>();
ArrayList<Item> EquipmentDrops = new ArrayList<Item>();
int failures = 0;
int goldAmount = 0;
for (int i = 0; i < 100; ++i) {
@ -128,10 +112,22 @@ public class simulateBootyCmd extends AbstractDevCmd { @@ -128,10 +112,22 @@ public class simulateBootyCmd extends AbstractDevCmd {
} catch (Exception ex) {
failures++;
}
if (mob.getEquip() != null) {
for (MobEquipment me : mob.getEquip().values()) {
if (me.getDropChance() == 0)
continue;
float equipmentRoll = ThreadLocalRandom.current().nextInt(99) + 1;
float dropChance = me.getDropChance() * 100;
if (equipmentRoll > (dropChance))
continue;
MobLoot ml = new MobLoot(mob, me.getItemBase(), false);
if (ml != null)
EquipmentDrops.add(ml);
}
}
int respawnTime = mob.getMobBase().getSpawnTime();
if (mob.spawnTime > 0) {
respawnTime = mob.spawnTime;
}
output += "MobBase BootySet: " + mob.getMobBase().bootySet + newline;
output += "Mob BootySet: " + mob.bootySet + newline;
@ -145,18 +141,18 @@ public class simulateBootyCmd extends AbstractDevCmd { @@ -145,18 +141,18 @@ public class simulateBootyCmd extends AbstractDevCmd {
output += "HOTZONE TABLE [" + entry.bootyType + "] " + entry.lootTable + 1 + newline;
}
}
output += "Time Required To Gain Simulated Booty: " + respawnTime * 100 + " Seconds" + newline;
output += "GLASS DROPS: " + GlassItems.size() + newline;
output += "RUNE DROPS: " + Runes.size() + newline;
output += "CONTRACTS DROPS: " + Contracts.size() + newline;
for (Item contract : Contracts){
output += contract.getName() + newline;
}
output += "RESOURCE DROPS: " + Resources.size() + newline;
output += "OFFERINGS DROPPED: " + Offerings.size() + newline;
output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline;
output += "ENCHANTED ITEMS DROPPED: " + OtherDrops.size() + newline;
output += "TOTAL GOLD DROPPED: " + goldAmount + newline;
output += "EQUIPMENT DROPPED: " + EquipmentDrops.size() + newline;
output += "FAILED ROLLS: " + failures + newline;
break;
default:
break;
}
throwbackInfo(pc, output);
}

Loading…
Cancel
Save