int[] dpitems = { 2675, 2671, 2673, 2667, 2665, 2663, 2659, 2657, 2655, 4151, 4151 }; /* Add all of the item IDS here */
public int dpitems() {
return dpitems[(int) (Math.random() * dpitems.length)];
}
int count = 0;
public void dropparty() {
EventManager.getSingleton().addEvent(new Event() {
public void execute(EventContainer b) {
if(count == 30) { /* Change the amount of items to be dropped here, currently 30. */
b.stop();
sendMessage("The drop party is now over, hope everyone enjoyed!");
} else {
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client p1 = (Client)Server.playerHandler.players[j];
int d1 = 0;
d1 = Misc.random(8);
if(d1 == 0) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX-Misc.random(5), absY-Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 1) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX-Misc.random(5), absY-Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 2) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX+Misc.random(5), absY+Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 3) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX+Misc.random(5), absY+Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 4) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX-Misc.random(5), absY+Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 5) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX-Misc.random(5), absY+Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 6) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX+Misc.random(5), absY-Misc.random
(5), 1, j);
count += 1;
} else if(d1 == 7) {
Server.itemHandler.createGroundItem(p1, dpitems(), absX+Misc.random(5), absY-Misc.random
(5), 1, j);
count += 1;
}
}
}
}
}
},2500); //2.5 sec per item
};