Code:
public void dropLoot() {
if(this.inSWGame()) {
return;
}
if(this.inClanWars()) {
return;
}
if(this.inDuelArena()) {
return;
}
if(this.getLocation().getY() >= 4680 && this.getLocation().getY() <= 4730 && this.getLocation().getX() >= 2495 && this.getLocation().getX() <= 2520) {
return;
}
if(this.giveDrop == 0) {
System.out.println("Npc Killed him, so no drop");
return;
}
final Player p2 = World.getInstance().getPlayerList().get(this.giveDrop);
List<Item> itemsInHand = new ArrayList<Item>();
for(int i = 0; i < Inventory.SIZE; i++) {
Item item = this.getInventory().getContainer().get(i);
System.out.println("Nope, this bit works - 1");
if(item != null) {
itemsInHand.add(item);
}
}
for(int i = 0; i < Equipment.SIZE; i++) {
Item item = this.getEquipment().getContainer().get(i);
System.out.println("Nope, this bit works - 2");
if(item != null) {
itemsInHand.add(item);
}
}
this.getInventory().reset();
this.getEquipment().reset();
System.out.println("Nope, this bit works - 3");
int keep = 3;
if(this.PROTECTITEM == true) {
System.out.println("Nope, this bit works - 4");
keep = 4;
}
if(this.getHeadIcons().isSkulled()) {
System.out.println("Nope, this bit works - 5");
keep = 0;
if(this.PROTECTITEM == true) {
System.out.println("Nope, this bit works - 6");
keep = 1;
}
}
if(keep > 0) {
Collections.sort(itemsInHand, new Comparator<Item>() {
@Override
public int compare(Item arg0, Item arg1) {
int a0 = arg0.getDefinition().getPrice().getNormalPrice();
int a1 = arg1.getDefinition().getPrice().getNormalPrice();
System.out.println("Nope, this bit works - 7");
return a1 - a0;
}
});
List<Item> toRemove = new ArrayList<Item>();
for(int i = 0; i < itemsInHand.size(); i++) {
Item item = itemsInHand.get(i);
System.out.println("Nope, this bit works - 8");
if(item.getDefinition().isStackable() || item.getDefinition().isNoted()) {
System.out.println("Nope, this bit works - 9");
continue;
}
if(keep > 0) {
toRemove.add(item);
System.out.println("Nope, this bit works - 10");
keep--;
} else {
break;
}
}
for(Item i : toRemove) {
itemsInHand.remove(i);
this.getInventory().addItem(i.getId(), 1);
System.out.println("Nope, this bit works - 11");
}
}
for(Item i : itemsInHand) {
World.getInstance().getItemManager().createDropGroundItem(p2, this.getLocation(), new Item(i.getId(), i.getAmount()));
System.out.println("Nope, this bit works - 12");
}
}
public void dropLoot2() {
if(this.inSWGame()) {
return;
}
if(getLocation().getY() >= 4680 && getLocation().getY() <= 4730 && getLocation().getX() >= 2495 && getLocation().getX() <= 2520) {
return;
}
if(this.inClanWars()) {
return;
}
if(this.inDuelArena()) {
return;
}
if(this.giveDrop == 0) {
System.out.println("Npc Killed him, so no drop");
return;
}
final Player p2 = World.getInstance().getPlayerList().get(this.giveDrop);
Item Food = dropId(pvpDrops.Foods());
Item Low = dropId(pvpDrops.OtherItems());
Item Medium = dropId(pvpDrops.OtherItems2());
Item High = dropId(pvpDrops.OtherItems3());
Item PvpItems = dropId(pvpDrops.PvPItems());
Item PvpItems2 = dropId(pvpDrops.PvPItems());
Item TargetDrop = dropId(pvpDrops.TargetDrop());
List<Item> itemsInHand = new ArrayList<Item>();
List<Item> itemsInHand2 = new ArrayList<Item>();
List<Item> itemsInHand3 = new ArrayList<Item>();
List<Item> itemsInHand4 = new ArrayList<Item>();
List<Item> itemsInHand5 = new ArrayList<Item>();
List<Item> itemsInHand6 = new ArrayList<Item>();
List<Item> itemsInHand7 = new ArrayList<Item>();
if(Food != null || Low != null || Medium != null || High != null || PvpItems != null || TargetDrop != null) {
itemsInHand.add(Food);
itemsInHand2.add(Low);
itemsInHand3.add(Medium);
itemsInHand4.add(High);
itemsInHand5.add(PvpItems);
itemsInHand6.add(TargetDrop);
itemsInHand7.add(PvpItems2);
}
for(Item food : itemsInHand) {
for(Item low : itemsInHand2) {
for(Item medium : itemsInHand3) {
for(Item high : itemsInHand4) {
for(Item pvpitems : itemsInHand5) {
for(Item targetdrop : itemsInHand6) {
for(Item pvpitems2 : itemsInHand7) {
//if(p2.giveDrop == p2.bhTarget) {
if(p2.bhTarget == p2.giveDrop) {
p2.playerEp = p2.playerEp - Misc.random(5);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), targetdrop);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your target.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp <= 10) {
p2.playerEp = p2.playerEp - Misc.random(5);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), low);
actionSender.sendString("EP: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 11 && p2.playerEp <= 21) {
p2.playerEp = p2.playerEp - Misc.random(10);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), low);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 22 && p2.playerEp <= 32) {
p2.playerEp = p2.playerEp - Misc.random(15);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), low);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 33 && p2.playerEp <= 44) {
p2.playerEp = p2.playerEp - Misc.random(20);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), low);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), pvpitems);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 45 && p2.playerEp <= 55) {
p2.playerEp = p2.playerEp - Misc.random(30);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), low);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), pvpitems);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 56 && p2.playerEp <= 66) {
p2.playerEp = p2.playerEp - Misc.random(40);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), pvpitems);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 67 && p2.playerEp <= 77) {
p2.playerEp = p2.playerEp - Misc.random(50);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), pvpitems);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), high);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 78 && p2.playerEp <= 88) {
p2.playerEp = p2.playerEp - Misc.random(60);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), pvpitems2);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), high);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
if(p2.playerEp >= 89 && p2.playerEp <= 100) {
p2.playerEp = p2.playerEp - Misc.random(70);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), food);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), pvpitems2);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), high);
World.getInstance().getItemManager().createDropGroundItem(p2
, this.getLocation(), medium);
actionSender.sendString("Drop Potential: "+playerEp+"%", 591, 9);
actionSender.sendMessage("You killed your opponent.");
System.out.println("Nope, this bit works - 13");
p2.giveDrop = 0;
}
}}}}}}}
}