Jump to content
  • 0
Sign in to follow this  
redevolutionX

how can i add roll option to me dice? 667 please view

Question

my inventoryoptionhandler.java
----------------------------
[code]package com.rs.net.decoders.handlers;

import java.util.List;

import com.rs.Settings;
import com.rs.cores.WorldThread;
import com.rs.game.ForceTalk;
import com.rs.game.Animation;
import com.rs.game.World;
import com.rs.game.WorldTile;
import com.rs.game.WorldObject;
import com.rs.game.item.Item;
import com.rs.game.npc.NPC;
import com.rs.game.player.controlers.Barrows;
import com.rs.game.npc.familiar.Familiar.SpecialAttack;
import com.rs.game.player.Equipment;
import com.rs.game.player.Inventory;
import com.rs.game.player.Pets;
import com.rs.game.player.Player;
import com.rs.game.player.actions.Firemaking;
import com.rs.game.player.actions.Fletching;
import com.rs.game.player.actions.Fletching.Fletch;
import com.rs.game.player.actions.GemCutting;
import com.rs.game.player.actions.GemCutting.Gem;
import com.rs.game.player.actions.HerbCleaning;
import com.rs.game.player.actions.Herblore;
import com.rs.game.player.actions.Hunter;
import com.rs.game.player.actions.Hunter.HunterEquipment;
import com.rs.game.player.actions.LeatherCrafting;
import com.rs.game.player.actions.Summoning;
import com.rs.game.player.actions.Summoning.Pouches;
import com.rs.game.player.content.AncientEffigies;
import com.rs.game.player.content.ArmourSets;
import com.rs.game.player.content.ArmourSets.Sets;
import com.rs.game.player.content.Burying;
import com.rs.game.player.content.Foods;
import com.rs.game.player.content.ItemOnItemHandler;
import com.rs.game.player.content.ItemOnItemHandler.ItemOnItem;
import com.rs.game.player.content.Magic;
import com.rs.game.player.content.Pots;
import com.rs.game.player.content.Runecrafting;
import com.rs.game.player.content.SkillCapeCustomizer;
import com.rs.game.player.controlers.Barrows;
import com.rs.game.player.content.Burying;
import com.rs.game.player.content.Burying.Bone;
import com.rs.game.tasks.WorldTask;
import com.rs.game.tasks.WorldTasksManager;
import com.rs.game.Graphics;
import com.rs.game.minigames.DiceGame;
import com.rs.io.InputStream;
import com.rs.utils.Logger;
import com.rs.utils.Utils;

public class InventoryOptionsHandler {

public static void handleItemOption2(final Player player, final int slotId,
final int itemId, Item item) {
if (Firemaking.isFiremaking(player, itemId))
return;
if (itemId >= 5509 && itemId <= 5514) {
int pouch = -1;
if (itemId == 5509)
pouch = 0;
if (itemId == 5510)
pouch = 1;
if (itemId == 5512)
pouch = 2;
if (itemId == 5514)
pouch = 3;
Runecrafting.emptyPouch(player, pouch);

} else if (itemId == 15098) {
DiceGame.rollDice8(player);
player.setNextAnimation(new Animation(11900));
player.setNextGraphics(new Graphics(2075));
return;
} else {
if (player.isEquipDisabled())
return;
long passedTime = Utils.currentTimeMillis()
- WorldThread.LAST_CYCLE_CTM;
WorldTasksManager.schedule(new WorldTask() {

@Override
public void run() {
List<Integer> slots = player.getSwitchItemCache();
int[] slot = new int[slots.size()];
for (int i = 0; i < slot.length; i++)
slot[i] = slots.get(i);
player.getSwitchItemCache().clear();
ButtonHandler.sendWear(player, slot);
player.stopAll(false);
}

}, passedTime >= 600 ? 0 : passedTime > 400 ? 1 : 0);// switching
// one item,
// if delay
// too close
// to next
// ticket,
// delay so
// wont
// instant

if (player.getSwitchItemCache().contains(slotId))
return;
player.getSwitchItemCache().add(slotId);
}
}

public static void handleItemOption1(Player player, final int slotId,
final int itemId, Item item) {
long time = Utils.currentTimeMillis();
if (player.getStopDelay() >= time
|| player.getEmotesManager().getNextEmoteEnd() >= time)
return;
player.stopAll(false);
if (Foods.eat(player, item, slotId))
return;
if (itemId == 15098) {
DiceGame.rollDice8(player);
player.setNextAnimation(new Animation(11900));
player.setNextGraphics(new Graphics(2075));
return;
};
if (Burying.bury(player, slotId))
return;
if (itemId == 15098) {
// DiceGame.handleItem(player, Rolls.PRIVATE_ROLL);
return;
}
if (itemId == 24143) {
player.sendMessage("<692E15>You have a Barrows Kill Count of " + player.getBarrowsKillCount() + ".");
return;
}
if (!player.getControlerManager().handleItemOption1(player, slotId, itemId, item))
return;
if (Pots.pot(player, item, slotId))
return;
if (itemId >= 5509 && itemId <= 5514) {
int pouch = -1;
if (itemId == 5509)
pouch = 0;
if (itemId == 5510)
pouch = 1;
if (itemId == 5512)
pouch = 2;
if (itemId == 5514)
pouch = 3;
Runecrafting.fillPouch(player, pouch);
return;
}
if (itemId == 952) {// spade
player.resetWalkSteps();
if (Barrows.digToBrother(player))
return;
player.setNextAnimation(new Animation(830));
player.getPackets().sendGameMessage("You find nothing.");
return;
}
if (itemId == 20718) {// confetti
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(1341));
return;
}
if (itemId == 19475) {// Nardah
player.setNextAnimation(new Animation(9597));
player.setNextGraphics(new Graphics(1680));
player.setNextWorldTile(new WorldTile(2582, 3481, 0));
player.getInventory().deleteItem(19475, 1);
return;
}
if (itemId == 19476) {// Bandit Camp
player.setNextAnimation(new Animation(9597));
player.setNextGraphics(new Graphics(1680));
player.setNextWorldTile(new WorldTile(3176, 2987, 0));
player.getInventory().deleteItem(19476, 1);
return;
}
if (itemId == 19477) {// Miscellania
player.setNextAnimation(new Animation(9597));
player.setNextGraphics(new Graphics(1680));
player.setNextWorldTile(new WorldTile(2509, 3845, 0));
player.getInventory().deleteItem(19477, 1);
return;
}
if (itemId == 19478) {// Phoenix Lair
player.setNextAnimation(new Animation(9597));
player.setNextGraphics(new Graphics(1680));
player.setNextWorldTile(new WorldTile(3359, 2910, 0));
player.getInventory().deleteItem(19478, 1);
return;
}
if (itemId == 19479) {// Tai Bwo Wannai
player.setNextAnimation(new Animation(9597));
player.setNextGraphics(new Graphics(1680));
player.setNextWorldTile(new WorldTile(2803, 3065, 0));
player.getInventory().deleteItem(19479, 1);
return;
}
if (itemId == 19480) {// Lumber Yard
player.setNextAnimation(new Animation(9597));
player.setNextGraphics(new Graphics(1680));
player.setNextWorldTile(new WorldTile(3308, 3491, 0));
player.getInventory().deleteItem(19480, 1);
return;
}
if (itemId == 22308) {// impious ashes
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(56));
player.getSkills().addXp(5, 2500);
player.getInventory().deleteItem(22308, 1);
player.getPackets().sendGameMessage("You spread the Impious Ashes.");
return;
}
if (itemId == 20264) {// impious ashes
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(56));
player.getSkills().addXp(5, 2500);
player.getInventory().deleteItem(20264, 1);
player.getPackets().sendGameMessage("You spread the Impious Ashes.");
return;
}
if (itemId == 22310) {// accursed ashes
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(47));
player.getSkills().addXp(5, 3700);
player.getInventory().deleteItem(22310, 1);
player.getPackets().sendGameMessage("You spread the Accursed Ashes.");
return;
}
if (itemId == 20266) {// accursed ashes
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(47));
player.getSkills().addXp(5, 3700);
player.getInventory().deleteItem(20266, 1);
player.getPackets().sendGameMessage("You spread the Accursed Ashes.");
return;
}
if (itemId == 22312) {// infernal ashes
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(40));
player.getSkills().addXp(5, 5000);
player.getInventory().deleteItem(22312, 1);
player.getPackets().sendGameMessage("You spread the Infernal Ashes.");
return;
}
if (itemId == 20268) {// infernal ashes
player.setNextAnimation(new Animation(10952));
player.setNextGraphics(new Graphics(40));
player.getSkills().addXp(5, 5000);
player.getInventory().deleteItem(20268, 1);
player.getPackets().sendGameMessage("You spread the Infernal Ashes.");
return;
}
if (itemId == 299) {
final WorldTile tile = new WorldTile(player);
if (!player.addWalkSteps(player.getX() - 1, player.getY(), 1))
if (!player.addWalkSteps(player.getX() + 1, player.getY(), 1))
if (!player.addWalkSteps(player.getX(), player.getY() + 1, 1))
player.addWalkSteps(player.getX(), player.getY() - 1, 1);
player.getInventory().deleteItem(299, 1);
//World.spawnObject(new WorldObject(Utils.random(2981, 2983), 10, -1, player.getX(), player.getY(), player.getPlane()), true);

World.spawnTempGroundObject(new WorldObject(Utils.random(2981, 2983),
10, 0, tile.getX(), tile.getY(), tile.getPlane()), 299,
35000);

}
if (itemId == 20721) {// firework
player.setNextAnimation(new Animation(2286));
return;
}
if (itemId == 20722) {// firecracker
player.setNextAnimation(new Animation(2286));
return;
}
if (itemId == 21250) {// pet rock
player.setNextAnimation(new Animation(1333));
return;
}
if (itemId == 21252) {// pet rock
player.setNextAnimation(new Animation(1333));
return;
}
if (itemId == 21254) {// pet rock
player.setNextAnimation(new Animation(1333));
return;
}
if (itemId == 21256) {// pet rock
player.setNextAnimation(new Animation(1333));
return;
}
if (itemId == 23745) {// small con lamp
player.getSkills().addXp(22, 50000);
player.getInventory().deleteItem(23745, 1);
return;
}
if (itemId == 23746) {// medium con lamp
player.getSkills().addXp(22, 75000);
player.getInventory().deleteItem(23746, 1);
return;
}
if (itemId == 23747) {// large con lamp
player.getSkills().addXp(22, 125000);
player.getInventory().deleteItem(23747, 1);
return;
}
if (itemId == 23748) {// huge con lamp
player.getSkills().addXp(22, 250000);
player.getInventory().deleteItem(23748, 1);
return;
}
if (itemId == 23778) {// small slayer lamp
player.getSkills().addXp(18, 50000);
player.getInventory().deleteItem(23778, 1);
return;
}
if (itemId == 23779) {// medium slayer lamp
player.getSkills().addXp(18, 75000);
player.getInventory().deleteItem(23779, 1);
return;
}
if (itemId == 23780) {// large slayer lamp
player.getSkills().addXp(18, 125000);
player.getInventory().deleteItem(23780, 1);
return;
}
if (itemId == 23781) {// huge slayer lamp
player.getSkills().addXp(18, 250000);
player.getInventory().deleteItem(23781, 1);
return;
}
if (itemId == 23810) {// small farming lamp
player.getSkills().addXp(19, 50000);
player.getInventory().deleteItem(23810, 1);
return;
}
if (itemId == 23811) {// medium farming lamp
player.getSkills().addXp(19, 75000);
player.getInventory().deleteItem(23811, 1);
return;
}
if (itemId == 23812) {// large farming lamp
player.getSkills().addXp(19, 125000);
player.getInventory().deleteItem(23812, 1);
return;
}
if (itemId == 23813) {// huge farming lamp
player.getSkills().addXp(19, 250000);
player.getInventory().deleteItem(23813, 1);
return;
}
if (itemId == 23814) {// small summoning lamp
player.getSkills().addXp(23, 50000);
player.getInventory().deleteItem(23814, 1);
return;
}
if (itemId == 23815) {// medium summoning lamp
player.getSkills().addXp(23, 75000);
player.getInventory().deleteItem(23815, 1);
return;
}
if (itemId == 23816) {// large summoning lamp
player.getSkills().addXp(23, 125000);
player.getInventory().deleteItem(23816, 1);
return;
}
if (itemId == 23817) {// huge summoning lamp
player.getSkills().addXp(23, 250000);
player.getInventory().deleteItem(23817, 1);
return;
}
if (itemId == 20667) {// Vecna skull
player.setNextAnimation(new Animation(725));
return;
}
if (itemId == 6199) {
int[] RandomItems = {11732, 4151, 11283, 385, 2347, 1712, 1712, 6585, 1712, 6585, 11732, 11732, 3105, 6918, 6920, 6922, 6924, 6570, 10828, 1079, 1127, 20072, 20072, 8850, 10551, 10548, 4087, 15332, 15332, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 6585, 5698, 1704, 7378, 7370, 7390, 6737, 6731, 6733, 11716, 6199, 6199, 7386, 7394, 11846, 11850, 11852, 2673, 2669, 2671, 6889, 6914, 2653, 2655, 2657, 1837, 10330, 11848, 11854, 11856, 10332, 10334, 10336, 542, 4087, 4585, 6568, 6568, 10338, 10340, 10342, 10344, 10346, 10348, 10350, 10352, 2581, 13736, 6916, 6918, 6920, 6922, 6924, 3481, 3483, 3486, 2577, 2665, 10452, 10454, 10456, 9470, 2661, 10450, 10446, 10448, 1037, 14595, 14603, 1050, 23679, 23680, 23681, 23682, 23683, 23684, 23685, 23686, 23687, 23688, 23689, 23690, 23691, 23692, 23693, 23694, 23695, 23696, 23697, 23698, 23699, 23700, 1040, 1042, 1044, 1046, 1048, 1050, 1053, 1055, 1057, 11732, 3105, 1712, 1704, 1706, 1079, 1127, 6585, 6570, }; //Other ids go in there as well
player.getInventory().deleteItem(6199, 1);
for (int i = 0; i < RandomItems.length; i++)
player.getInventory().addItem(RandomItems[i], 1);
player.getPackets().sendGameMessage("You've recieved an item from the Mystery Box!");
return;
}
if (itemId == 952) {// spade
player.resetWalkSteps();
if (Barrows.digToBrother(player))
return;
player.setNextAnimation(new Animation(830));
player.getPackets().sendGameMessage("You find nothing.");
return;
}
if (HerbCleaning.clean(player, item, slotId))
return;
Bone bone = Bone.forId(itemId);
if (bone != null) {
Bone.bury(player, slotId);
return;
}
if (Magic.useTabTeleport(player, itemId))
return;
if (itemId == AncientEffigies.SATED_ANCIENT_EFFIGY
|| itemId == AncientEffigies.GORGED_ANCIENT_EFFIGY
|| itemId == AncientEffigies.NOURISHED_ANCIENT_EFFIGY
|| itemId == AncientEffigies.STARVED_ANCIENT_EFFIGY)
player.getDialogueManager().startDialogue("AncientEffigiesD",
itemId);
else if (itemId == 4155)
player.getDialogueManager().startDialogue("EnchantedGemDialouge");
else if (itemId == 1856) {// Information Book
player.getInterfaceManager().sendInterface(275);
player.getPackets()
.sendIComponentText(275, 2, Settings.SERVER_NAME);
player.getPackets().sendIComponentText(275, 16,
"Welcome to " + Settings.SERVER_NAME + ".");
player.getPackets().sendIComponentText(275, 17,
"If want some an item use command ::item id.");
player.getPackets().sendIComponentText(275, 18,
"If you don't have an item list you can find ids");
player.getPackets().sendIComponentText(275, 19,
"at http://itemdb.biz");
player.getPackets().sendIComponentText(275, 20,
"You can change your prayers and spells at home.");
player.getPackets().sendIComponentText(275, 21,
"If you need any help, do ::ticket. (Don't abuse it)");
player.getPackets().sendIComponentText(275, 22,
"at start of your message on public chat.");
player.getPackets().sendIComponentText(275, 22,
"By the way you can compare your ::score with your mates.");
player.getPackets().sendIComponentText(275, 23,
"Oh and ye, don't forget to ::vote and respect rules.");
player.getPackets().sendIComponentText(275, 24, "");
player.getPackets().sendIComponentText(275, 25,
"Forums: " + Settings.WEBSITE_LINK);
player.getPackets().sendIComponentText(275, 26, "");
player.getPackets().sendIComponentText(275, 27,
"Enjoy your time on " + Settings.SERVER_NAME + ".");
player.getPackets().sendIComponentText(275, 28,
"<img=1> Staff Team");
player.getPackets().sendIComponentText(275, 29, "");
player.getPackets().sendIComponentText(275, 30, "");
player.getPackets().sendIComponentText(275, 14,
"<u>Visit Website</u>");
for (int i = 31; i < 300; i++)
player.getPackets().sendIComponentText(275, i, "");
} else if (itemId == HunterEquipment.BOX.getId()) // almost done
player.getActionManager().setSkill(new Hunter(HunterEquipment.BOX));
else if (itemId == HunterEquipment.BRID_SNARE.getId())
player.getActionManager().setSkill(
new Hunter(HunterEquipment.BRID_SNARE));
if (Settings.DEBUG)
Logger.log("ItemHandler", "Item Select:" + itemId + ", Slot Id:"
+ slotId);
}

/*
* returns the other
*/
public static Item contains(int id1, Item item1, Item item2) {
if (item1.getId() == id1)
return item2;
if (item2.getId() == id1)
return item1;
return null;
}

public static boolean contains(int id1, int id2, Item... items) {
boolean containsId1 = false;
boolean containsId2 = false;
for (Item item : items) {
if (item.getId() == id1)
containsId1 = true;
else if (item.getId() == id2)
containsId2 = true;
}
return containsId1 && containsId2;
}

public static void handleItemOnItem(final Player player, InputStream stream) {
int interfaceId = stream.readIntV1() >> 16;
int itemUsedId = stream.readUnsignedShort128();
int fromSlot = stream.readUnsignedShortLE128();
int interfaceId2 = stream.readIntV2() >> 16;
int itemUsedWithId = stream.readUnsignedShort128();
int toSlot = stream.readUnsignedShortLE();
if ((interfaceId2 == 747 || interfaceId2 == 662)
&& interfaceId == Inventory.INVENTORY_INTERFACE) {
if (player.getFamiliar() != null) {
player.getFamiliar().setSpecial(true);
if (player.getFamiliar().getSpecialAttack() == SpecialAttack.ITEM) {
if (player.getFamiliar().hasSpecialOn())
player.getFamiliar().submitSpecial(toSlot);
}
}
return;
}
if (interfaceId == Inventory.INVENTORY_INTERFACE
&& interfaceId == interfaceId2
&& !player.getInterfaceManager().containsInventoryInter()) {
if (toSlot >= 28 || fromSlot >= 28)
return;
Item usedWith = player.getInventory().getItem(toSlot);
Item itemUsed = player.getInventory().getItem(fromSlot);
if (itemUsed == null || usedWith == null
|| itemUsed.getId() != itemUsedId
|| usedWith.getId() != itemUsedWithId)
return;
player.stopAll();
if (!player.getControlerManager().canUseItemOnItem(itemUsed,
usedWith))
return;
Fletch fletch = Fletching.isFletching(usedWith, itemUsed);
if (fletch != null) {
player.getDialogueManager().startDialogue("FletchingD", fletch);
return;
}
int herblore = Herblore.isHerbloreSkill(itemUsed, usedWith);
if (herblore > -1) {
player.getDialogueManager().startDialogue("HerbloreD",
herblore, itemUsed, usedWith);
return;
}
if (itemUsed.getId() == LeatherCrafting.NEEDLE.getId()
|| usedWith.getId() == LeatherCrafting.NEEDLE.getId()) {
if (LeatherCrafting
.handleItemOnItem(player, itemUsed, usedWith)) {
return;
}
}
Sets set = ArmourSets.getArmourSet(itemUsedId, itemUsedWithId);
if (set != null) {
ArmourSets.exchangeSets(player, set);
return;
}
ItemOnItem itemOnItem = ItemOnItem.forId(itemUsedId);
if (itemOnItem != null) {
if (itemUsedWithId == itemOnItem.getItem2())
ItemOnItemHandler.handleItemOnItem(player, itemOnItem, usedWith.getId(), itemUsed.getId());
return;
}
if (Firemaking.isFiremaking(player, itemUsed, usedWith))
return;
else if (contains(1755, Gem.OPAL.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.OPAL);
else if (contains(1755, Gem.JADE.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.JADE);
else if (contains(1755, Gem.RED_TOPAZ.getUncut(), itemUsed,
usedWith))
GemCutting.cut(player, Gem.RED_TOPAZ);
else if (contains(1755, Gem.SAPPHIRE.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.SAPPHIRE);
else if (contains(1755, Gem.EMERALD.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.EMERALD);
else if (contains(1755, Gem.RUBY.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.RUBY);
else if (contains(1755, Gem.DIAMOND.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.DIAMOND);
else if (contains(1755, Gem.DRAGONSTONE.getUncut(), itemUsed,
usedWith))
GemCutting.cut(player, Gem.DRAGONSTONE);
else if (contains(1755, Gem.ONYX.getUncut(), itemUsed, usedWith))
GemCutting.cut(player, Gem.ONYX);
else
player.getPackets().sendGameMessage(
"Nothing interesting happens.");
if (Settings.DEBUG)
Logger.log("ItemHandler", "Used:" + itemUsed.getId()
+ ", With:" + usedWith.getId());
}
}

public static void handleItemOption3(Player player, int slotId, int itemId,
Item item) {
long time = Utils.currentTimeMillis();
if (player.getStopDelay() >= time
|| player.getEmotesManager().getNextEmoteEnd() >= time)
return;
player.stopAll(false);
if (itemId == 20767 || itemId == 20769 || itemId == 20771)
SkillCapeCustomizer.startCustomizing(player, itemId);
else if (Equipment.getItemSlot(itemId) == Equipment.SLOT_AURA)
player.getAuraManager().sendTimeRemaining(itemId);
}

public static void handleItemOption4(Player player, int slotId, int itemId,
Item item) {
System.out.println("Option 4");
}

public static void handleItemOption5(Player player, int slotId, int itemId,
Item item) {
System.out.println("Option 5");
}

public static void handleItemOption6(Player player, int slotId, int itemId,
Item item) {
long time = Utils.currentTimeMillis();
if (player.getStopDelay() >= time
|| player.getEmotesManager().getNextEmoteEnd() >= time)
return;
player.stopAll(false);
Pouches pouches = Pouches.forId(itemId);
if (pouches != null)
Summoning.spawnFamiliar(player, pouches);
else if (itemId == 1438)
Runecrafting.locate(player, 3127, 3405);
else if (itemId == 1440)
Runecrafting.locate(player, 3306, 3474);
else if (itemId == 1442)
Runecrafting.locate(player, 3313, 3255);
else if (itemId == 1444)
Runecrafting.locate(player, 3185, 3165);
else if (itemId == 1446)
Runecrafting.locate(player, 3053, 3445);
else if (itemId == 1448)
Runecrafting.locate(player, 2982, 3514);
else if (itemId <= 1712 && itemId >= 1706 || itemId >= 10354
&& itemId <= 10362)
player.getDialogueManager().startDialogue("Transportation",
"Edgeville", new WorldTile(3087, 3496, 0), "Karamja",
new WorldTile(2918, 3176, 0), "Draynor Village",
new WorldTile(3105, 3251, 0), "Al Kharid",
new WorldTile(3293, 3163, 0), itemId);
else if (itemId == 1704 || itemId == 10352)
player.getPackets()
.sendGameMessage(
"The amulet has ran out of charges. You need to recharge it if you wish it use it once more.");
else if (itemId >= 3853 && itemId <= 3867)
player.getDialogueManager().startDialogue("Transportation",
"Burthrope Games Room", new WorldTile(2880, 3559, 0),
"Barbarian Outpost", new WorldTile(2519, 3571, 0),
"Gamers' Grotto", new WorldTile(2970, 9679, 0),
"Corporeal Beast", new WorldTile(2886, 4377, 0), itemId);
}

public static void handleItemOption7(Player player, int slotId, int itemId,
Item item) {
long time = System.currentTimeMillis();
if (player.getStopDelay() >= time
|| player.getEmotesManager().getNextEmoteEnd() >= time)
return;
player.stopAll(false);
if (item.getDefinitions().isDestroyItem()) {
player.getDialogueManager().startDialogue("DestroyItemOption",
new Object[] { Integer.valueOf(slotId), item });
return;
}
if (player.getCharges().degradeCompletly(item)) {
return;
}
/**
* Pets
*/
switch (itemId) {
case 12196:// BullDog Puppy
if (player.getPet() != null) {
player.sendMessage("You already have a pet spawned, please dissmis it to spawn another.");
return;
}
player.setPetId(12196);
new Pets(6969, player, new WorldTile(player.getX() + 1,
player.getY() + 1, player.getPlane()), 0, false);
player.getInventory().deleteItem(slotId, item);
return;
case 21512:// Baby jad.
if (player.getPet() != null) {
player.sendMessage("You already have a pet spawned, please dissmis it to spawn another.");
return;
}
player.setPetId(21512);
new Pets(3604, player, new WorldTile(player.getX() + 1,
player.getY() + 1, player.getPlane()), 0, false);
player.getInventory().deleteItem(slotId, item);
return;
case 1555:// cat
if (player.getPet() != null) {
player.sendMessage("You already have a pet spawned, please dissmis it to spawn another.");
return;
}
player.setPetId(1555);
new Pets(3604, player, new WorldTile(player.getX() + 1,
player.getY() + 1, player.getPlane()), 0, false);
player.getInventory().deleteItem(slotId, item);
return;
case 22992:
if (!player.isDonator()) {
player.sendMessage("Only donators can use this pet, sorry!");
return;
}
player.setPetId(22992);
new Pets(14832, player, new WorldTile(player.getX() + 1,
player.getY() + 1, player.getPlane()), 0, false);
player.getInventory().deleteItem(slotId, item);
return;
default:
World.addGroundItem(item, new WorldTile(player), player, false,
180, true);
player.getInventory().deleteItem(slotId, item);
player.getPackets().sendSound(2739, 0, 1);
return;
}
}
}[/code]
-----------------------------------------------------------
1 help met out pls!1

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

Sign in to follow this  

×