package com.rs2hd.packethandler.commands;
import com.rs2hd.model.Player;
import com.rs2hd.content.PlayerDrops;
/**
*
* Item spawn command.
* @author Luke132
*/
public class Pickup implements Command {
@Override
public void execute(Player player, String command) {
String cmd[] = command.split(" ");
try {
if(!player.SafeZone()) {
player.sm("You must be in a Safe Zone to use this command.");
return;
}
for (int i = 0; i < PlayerDrops.PvPItems.length; i++) {
if (Integer.valueOf(cmd[1]) == PlayerDrops.PvPItems[i] && player.getRights() < 2) {
player.sm("You cannot pickup an item that has to be gotten from pking.");
return;
}
}
for (int i = 0; i < PlayerDrops.PvPANCIENT.length; i++) {
if (Integer.valueOf(cmd[1]) == PlayerDrops.PvPANCIENT[i] && player.getRights() < 2) {
player.sm("You cannot pickup an item that has to be gotten from pking.");
return;
}
}
for (int i = 0; i < PlayerDrops.Rings.length; i++) {
if (Integer.valueOf(cmd[1]) == PlayerDrops.Rings[i] && player.getRights() < 2) {
player.sm("You cannot pickup an item that has to be gotten from pking.");
return;
}
}
//if (Integer.valueOf(cmd[1]) == 14484 || Integer.valueOf(cmd[1]) == 7946 || Integer.valueOf(cmd[1]) == 391 && player.getRights() < 2) {
//player.sm("You cannot pickup Dragon Claws, go pk for them");
//return;
//}
if (Integer.valueOf(cmd[1]) == 995 && player.getRights() < 1) {
player.sm("You cannot pickup coins, it has been disabled until we get a shop");
return;
}
if (Integer.valueOf(cmd[1]) == 4178 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 11284 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 10566 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 4675 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 13867 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 10637 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1038 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1040 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1042 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1044 && player.getRights() < 1) {
player.sm("you cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1046 && player.getRights() < 1) {
player.sm("You cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1048 && player.getRights() < 1) {
player.sm("You cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 1050 && player.getRights() < 1) {
player.sm("You cannot pickup this item.");
return;
}
if (Integer.valueOf(cmd[1]) == 2422 && player.getRights() < 1) {
player.sm("You cannot pickup this item.");
return;
}
player.getInventory().addItem(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]));
} catch (Exception e) {
player.getActionSender().sendMessage("Invaild Characters, please try again.");
}
}
@Override
public int getRights() {
return 2;
}
}