Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.hyperion.rs2.model.content.misc;
- import org.hyperion.rs2.model.Item;
- import org.hyperion.rs2.model.ItemDefinition;
- import org.hyperion.rs2.model.Player;
- public class ItemSpawning {
- public static void spawnItem(Player player,int id, int amount){
- String message = allowedMessage(id);
- if(message.length() > 0 ){
- player.getActionSender().sendMessage(message);
- return;
- }
- player.getInventory().add(new Item(id,amount));
- }
- public static String allowedMessage(int id){
- String itemName = ItemDefinition.forId(id).getName().toLowerCase();
- /**
- * Donator Items. eg D claws
- */
- switch(id){
- case 14484:
- case 14485:
- return "This item can only be purchased in the donator shop.";
- }
- for(String forbiddenName : donatorNames){
- if(itemName.contains(forbiddenName))
- return "This item can only be purchased in the donator shop.";
- }
- /**
- * Point Items. eg Fighter Torso
- */
- switch(id){
- case 10551:
- case 10548:
- case 6570:
- case 10566:
- case 10637:
- return "This item can only be purchased in the RecklessPk points shop.";
- }
- for(String forbiddenName : rlpkNames){
- if(itemName.contains(forbiddenName))
- return "This item can only be purchased in the RecklessPk points shop.";
- }
- /**
- * Forbidden Items. eg Zaniks Crate
- */
- switch(id){
- case 0:
- return "This item cannot be spawned.";
- }
- for(String forbiddenName : forbiddenNames){
- if(itemName.contains(forbiddenName))
- return "This item cannot be spawned.";
- }
- return "";
- }
- public static String[] donatorNames = {
- "party","chaotic","h'ween","santa","primal","3rd","light","arcane"
- };
- public static String[] rlpkNames = {
- "void","defender","vesta","statius","morrigan","zuriel","spirit",
- };
- public static String[] forbiddenNames = {
- "zanik","crate"
- };
- }
Add Comment
Please, Sign In to add comment