|
|
@ -1,21 +1,15 @@ |
|
|
|
package engine.devcmd.cmds; |
|
|
|
package engine.devcmd.cmds; |
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum; |
|
|
|
import engine.devcmd.AbstractDevCmd; |
|
|
|
import engine.devcmd.AbstractDevCmd; |
|
|
|
import engine.gameManager.*; |
|
|
|
import engine.gameManager.*; |
|
|
|
import engine.objects.*; |
|
|
|
import engine.objects.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.concurrent.ThreadLocalRandom; |
|
|
|
|
|
|
|
import static engine.loot.LootManager.getGenTableItem; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
public simulateBootyCmd() { |
|
|
|
public simulateBootyCmd() { |
|
|
|
super("simulatebooty"); |
|
|
|
super("simulatebooty"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void _doCmd(PlayerCharacter pc, String[] words, |
|
|
|
protected void _doCmd(PlayerCharacter pc, String[] words, AbstractGameObject target) { |
|
|
|
AbstractGameObject target) { |
|
|
|
|
|
|
|
// Arg Count Check
|
|
|
|
// Arg Count Check
|
|
|
|
if (words.length != 1) { |
|
|
|
if (words.length != 1) { |
|
|
|
this.sendUsage(pc); |
|
|
|
this.sendUsage(pc); |
|
|
@ -47,7 +41,6 @@ public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
target = b; |
|
|
|
target = b; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (target == null) { |
|
|
|
if (target == null) { |
|
|
|
throwbackError(pc, "Target is unknown or of an invalid type." |
|
|
|
throwbackError(pc, "Target is unknown or of an invalid type." |
|
|
|
+ newline + "Type ID: 0x" |
|
|
|
+ newline + "Type ID: 0x" |
|
|
@ -57,21 +50,14 @@ public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
} |
|
|
|
} |
|
|
|
Enum.GameObjectType objType = target.getObjectType(); |
|
|
|
Enum.GameObjectType objType = target.getObjectType(); |
|
|
|
String output; |
|
|
|
String output; |
|
|
|
|
|
|
|
|
|
|
|
output = "Booty Simulation:" + newline; |
|
|
|
output = "Booty Simulation:" + newline; |
|
|
|
|
|
|
|
|
|
|
|
switch (objType) { |
|
|
|
switch (objType) { |
|
|
|
case Building: |
|
|
|
case Building: |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case PlayerCharacter: |
|
|
|
case PlayerCharacter: |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case NPC: |
|
|
|
case NPC: |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
output += "Target is Not a Mob! Please Select a Mob to Simulate Booty" + newline; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case Mob: |
|
|
|
case Mob: |
|
|
|
Mob mob = (Mob) target; |
|
|
|
Mob mob = (Mob) target; |
|
|
|
ArrayList<Item> GlassItems = new ArrayList<Item>(); |
|
|
|
ArrayList<Item> GlassItems = new ArrayList<Item>(); |
|
|
@ -81,7 +67,6 @@ public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
ArrayList<Item> Offerings = new ArrayList<Item>(); |
|
|
|
ArrayList<Item> Offerings = new ArrayList<Item>(); |
|
|
|
ArrayList<Item> OtherDrops = new ArrayList<Item>(); |
|
|
|
ArrayList<Item> OtherDrops = new ArrayList<Item>(); |
|
|
|
int failures = 0; |
|
|
|
int failures = 0; |
|
|
|
//for(int i = 0; i < iterations; ++i) {
|
|
|
|
|
|
|
|
ArrayList<Item> simulatedBooty = new ArrayList<>(); |
|
|
|
ArrayList<Item> simulatedBooty = new ArrayList<>(); |
|
|
|
if(isZone == false){ |
|
|
|
if(isZone == false){ |
|
|
|
//simulate individual mob booty
|
|
|
|
//simulate individual mob booty
|
|
|
@ -120,42 +105,33 @@ public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
} catch (Exception ex) { |
|
|
|
} catch (Exception ex) { |
|
|
|
failures++; |
|
|
|
failures++; |
|
|
|
} |
|
|
|
} |
|
|
|
//}
|
|
|
|
output += "Glass Drops:" + GlassItems.size() + newline; |
|
|
|
output += "GLASS ITEMS DROPPED: " + GlassItems.size() + newline; |
|
|
|
|
|
|
|
output += "RESOURCE STACKS DROPPED: " + Resources.size() + newline; |
|
|
|
|
|
|
|
output += "RUNES DROPPED: " + Runes.size() + newline; |
|
|
|
|
|
|
|
output += "CONTRACTS DROPPED: " + Contracts.size() + newline; |
|
|
|
|
|
|
|
output += "OFFERINGS DROPPED: " + Offerings.size() + newline; |
|
|
|
|
|
|
|
output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline; |
|
|
|
|
|
|
|
output += "FAILED ROLLS: " + failures + newline; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output += "Glass Drops:" + newline; |
|
|
|
|
|
|
|
for(Item glassItem : GlassItems){ |
|
|
|
for(Item glassItem : GlassItems){ |
|
|
|
output += glassItem.getName() + newline; |
|
|
|
output += glassItem.getName() + newline; |
|
|
|
} |
|
|
|
} |
|
|
|
output += "Rune Drops:" + newline; |
|
|
|
output += "Rune Drops:" + Runes.size() + newline; |
|
|
|
for(Item runeItem : Runes){ |
|
|
|
for(Item runeItem : Runes){ |
|
|
|
output += runeItem.getName() + newline; |
|
|
|
output += runeItem.getName() + newline; |
|
|
|
} |
|
|
|
} |
|
|
|
output += "Contract Drops:" + newline; |
|
|
|
output += "Contract Drops:" + Contracts.size() + newline; |
|
|
|
for(Item contractItem : Contracts){ |
|
|
|
for(Item contractItem : Contracts){ |
|
|
|
output += contractItem.getName() + newline; |
|
|
|
output += contractItem.getName() + newline; |
|
|
|
} |
|
|
|
} |
|
|
|
output += "Resource Drops:" + newline; |
|
|
|
output += "Resource Drops:" + Resources.size() + newline; |
|
|
|
for(Item resourceItem : Contracts){ |
|
|
|
for(Item resourceItem : Contracts){ |
|
|
|
output += resourceItem.getName() + newline; |
|
|
|
output += resourceItem.getName() + newline; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
output += "OFFERINGS DROPPED: " + Offerings.size() + newline; |
|
|
|
|
|
|
|
output += "OTHER ITEMS DROPPED: " + OtherDrops.size() + newline; |
|
|
|
|
|
|
|
output += "FAILED ROLLS: " + failures + newline; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
throwbackInfo(pc, output); |
|
|
|
throwbackInfo(pc, output); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String _getHelpString() { |
|
|
|
protected String _getHelpString() { |
|
|
|
return "simulates mob loot X amount of times for mob or zone"; |
|
|
|
return "simulates mob loot X amount of times for mob or zone"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String _getUsageString() { |
|
|
|
protected String _getUsageString() { |
|
|
|
return "' ./simluatebooty <ITERATIONS> <zone or blank>"; |
|
|
|
return "' ./simluatebooty <ITERATIONS> <zone or blank>"; |
|
|
@ -182,4 +158,4 @@ public class simulateBootyCmd extends AbstractDevCmd { |
|
|
|
} |
|
|
|
} |
|
|
|
return producedBooty; |
|
|
|
return producedBooty; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |