Jump to content
  • 0
missmini

Zenith source can't use some objects

Question

I'm trying to make some objects work when pressed. Normally that works, but with some objects I have had problems. For example bank booths doesn't work but deposit boxes does. I think problem may be in object.definitions? or on my cache? Anyway. It just says: "Nothing interesting happens." When I try to use object that's not working. And bank booths and deposit boxes got exactly same code the only difference is [CODE]objectDef.name.toLowerCase()[/CODE]Any advice? I can share the whole ObjectHandler.java if needed and as the title says it's Zenith source

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Thats probably because you need to make it work when clicked by using a case or if statement checking if the id pressed is correct then give it a command of what you want it to do for example:

[CODE]
if(id == /*someIdNumber*/)
{
//then write code to tele the player somewere
}

[/CODE]

Perhaps the other objects work because the original coder already set up those clicks and perhaps he did not set up the objects you want to add so you will have to give it a functions.

Share this post


Link to post
Share on other sites
  • 0
[quote name='plot']Thats probably because you need to make it work when clicked by using a case or if statement checking if the id pressed is correct then give it a command of what you want it to do for example:

[CODE]
if(id == /*someIdNumber*/)
{
//then write code to tele the player somewere
}

[/CODE]

Perhaps the other objects work because the original coder already set up those clicks and perhaps he did not set up the objects you want to add so you will have to give it a functions.[/QUOTE]

Actually that's exactly the thing I have been doing. I have given functions/commands to objects I'm trying to use and I do use case statement. So I still need help with this. :( Edited by missmini

Share this post


Link to post
Share on other sites
  • 0
Whatever.. I decided to post [CODE]public static void handleoption1(...)[/CODE] part of the ObjectHandler.java so maybe someone can help me better.. and see what the situation really is. :) [CODE]public static void handleOption1(final Player player, InputStream stream) {
if (!player.hasStarted() || !player.clientHasLoadedMapRegion()
|| player.isDead())
return;
long currentTime = Utils.currentTimeMillis();
if (player.getStopDelay() >= currentTime
// || player.getFreezeDelay() >= currentTime
|| player.getEmotesManager().getNextEmoteEnd() >= currentTime)
return;
[MENTION=19271]supp[/MENTION]ressWarnings("unused")
boolean junk = stream.readUnsignedByte128() == 1;
int x = stream.readUnsignedShort128();
final int id = stream.readInt();
int y = stream.readUnsignedShortLE();
final WorldTile tile = new WorldTile(x, y, player.getPlane());
final int regionId = tile.getRegionId();
int interfaceHash = stream.readIntV2();
int interfaceId = interfaceHash >> 16;
final int componentId = interfaceHash - (interfaceId << 16);
if (!player.getMapRegionsIds().contains(regionId))
return;
WorldObject mapObject = World.getRegion(regionId).getObject(id, tile);
if (mapObject == null || mapObject.getId() != id) { // temporary fixes
// fix
if (player.isAtDynamicRegion()
&& World.getRotation(player.getPlane(), x, y) != 0) {
ObjectDefinitions defs = ObjectDefinitions
.getObjectDefinitions(id);
if (defs.getSizeX() > 1 || defs.getSizeY() > 1) {
for (int xs = 0; xs < defs.getSizeX() + 1
&& (mapObject == null || mapObject.getId() != id); xs++) {
for (int ys = 0; ys < defs.getSizeY() + 1
&& (mapObject == null || mapObject.getId() != id); ys++) {
tile.setLocation(x + xs, y + ys, tile.getPlane());
mapObject = World.getRegion(regionId).getObject(id,
tile);
}
}
}
}
if (mapObject == null || mapObject.getId() != id)
return;
}
final WorldObject object = !player.isAtDynamicRegion() ? mapObject
: new WorldObject(id, mapObject.getType(),
mapObject.getRotation(), x, y, player.getPlane());
if (player.isAtDynamicRegion()) {
int rotation = object.getRotation();
rotation += World.getRotation(player.getPlane(), x, y);
if (rotation > 3)
rotation -= 4;
object.setRotation(rotation);
}
player.stopAll(false);
final ObjectDefinitions objectDef = object.getDefinitions();
player.setCoordsEvent(new CoordsEvent(tile, new Runnable() {
[MENTION=15855]Over[/MENTION]ride
public void run() {
player.stopAll();
player.setNextFaceWorldTile(new WorldTile(object.getCoordFaceX(
objectDef.getSizeX(), objectDef.getSizeY(),
object.getRotation()), object.getCoordFaceY(
objectDef.getSizeX(), objectDef.getSizeY(),
object.getRotation()), object.getPlane()));
if (!player.getControlerManager().processObjectClick1(object))
return;
if (CastleWars.handleObjects(player, id))
return;
/*if (!QuestHandler.handleObject(player, object))
return;*/
HunterNPC hunterNpc = HunterNPC.forObjectId(id);
if (hunterNpc != null) {
if (OwnedObjectManager.removeObject(player, object)) {
player.setNextAnimation(hunterNpc.getEquipment()
.getPickUpAnimation());
player.getInventory().addItem(hunterNpc.getItem(), 1);
player.getInventory().addItem(
hunterNpc.getEquipment().getId(), 1);
player.getSkills().addXp(Skills.HUNTER,
hunterNpc.getXp());
player.setTrapAmount(player.getTrapAmount() - 1);
} else {
player.getPackets().sendGameMessage(
"This isn't your trap.");
}

} else if (Farming.isPatch(id)){
Farming.Planter(id, player);
} else if (id == 28213) {

War war = player.getCurrentFriendChat().getWar();
if (war != null && war.getStage() == Stage.STARTED)
war.startControler(player);
else
player.getPackets().sendGameMessage("You can't go in atm.");

} else if (id == HunterEquipment.BOX.getObjectId()) {
if (OwnedObjectManager.removeObject(player, object)) {
player.setNextAnimation(new Animation(19192));
player.getInventory().addItem(
HunterEquipment.BOX.getId(), 1);
player.setTrapAmount(player.getTrapAmount() - 1);
} else
player.getPackets().sendGameMessage(
"This isn't your trap.");
} else if (id == 59463) { // works now
player.getDialogueManager().startDialogue("Crate");
//} else if (id == 66017){
//Barrows.processObjectClick1(object);
} else if (id == 41911){
if (World.QBD == true){
player.sm("Please stop clicking on this, there is already a qbd spawned!");
return;
}
World.QBD = true;
WorldTasksManager.schedule(new WorldTask() {
int loop;

[MENTION=15855]Over[/MENTION]ride
public void run() {
if (loop == 0) {
player.setFreezeDelay(8);
player.setNextWorldTile(new WorldTile(3534, 5202, 0));
player.setNextFaceWorldTile(new WorldTile(3535, 5203, 0));
player.setNextForceTalk(new ForceTalk("I wonder what this does! :O"));
} else if (loop == 2) {
player.setNextAnimation(new Animation(733));
player.setNextForceTalk(new ForceTalk("Lets see if its flammable!"));
} else if (loop == 7){
NPC n = new QBD(15507, new WorldTile(3533, 5199, 0), -1, true, true);
World.QBDN = n;
n.setNextAnimation(new Animation(16721));
player.setNextForceTalk(new ForceTalk("#@%$#%(U#$(^$&%#$&#$(R#$R(@#$"));
} else if (loop == 8){
player.setNextWorldTile(new WorldTile(3535, 5190, 0));
player.setNextFaceWorldTile(new WorldTile(3535, 5191, 0));
player.sm("You have now engaged in a fight with the QBD, have fun!");
World.sendWorldWideMessage(player.getDisplayName()+" Has decided to infuriate the QBD!");
stop();
}
loop++;
}
}, 0, 1);
} else if (id == 4277) {
//player.sendMessage("You successfully thieve from the stall");
player.addStopDelay(4);
player.getInventory().addItem(995, 1270);
player.setNextAnimation(new Animation(881));
player.getSkills().addXp(17, 100);
}
else if (id == 55313) {
player.getCutscenesManager().play("HomeCutScene");}

else if (id == 18663) { // lever zombie coral
int amountCoins = player.getInventory().getItems().getNumberOf(6306);
int timescoral = 0;

if (amountCoins < 300) {
player.getPackets().sendGameMessage("You don't have enough sticks.");}
else if (amountCoins >= 300 && timescoral < 1) {
player.getInterfaceManager().sendChatBoxInterface(94);
player.getPackets().sendIComponentText(94, 2,
"Are you sure you want to pull the lever?");
player.getPackets().sendIComponentText(94, 7,
"Price: 300");
if(componentId == 3){
player.setNextAnimation(new Animation(401));
World.removeObject(new WorldObject(12479, 10, 1, 2965, 9481, 0), true); //täältä
World.removeObject(new WorldObject(12479, 10, 1, 2966, 9481, 0), true); //eka ovi
World.removeObject(new WorldObject(12499, 10, 1, 2967, 9481, 0), true);
World.removeObject(new WorldObject(12479, 10, 1, 2968, 9481, 0), true); //Tänne
player.getInventory().deleteItem(6306, 300);
timescoral++;}
} else {
player.getPackets().sendGameMessage("Lever seems to be stuck!");
}
}
else if (id == 13291) { // random box
int amountCoins = player.getInventory().getItems().getNumberOf(6306);
if (amountCoins < 950) {player.getPackets().sendGameMessage("You don't have enough sticks.");}
if (player.getInventory().getFreeSlots() < 1) {
player.getPackets().sendGameMessage(
"Not enough space in your inventory.");}
if (amountCoins >= 950 && player.getInventory().getFreeSlots() >= 1){
player.getPackets().sendSound(4724, 0, 2);
getRandomItem(player);
player.getInventory().deleteItem(6306, 950);}
;}
else if (id == 2977) { // laiva ovi
int amountCoins = player.getInventory().getItems().getNumberOf(6306);
if (amountCoins < 3000) {player.getPackets().sendGameMessage("You don't have enough sticks.");}
if (amountCoins >= 3000) {
player.getPackets().sendSound(7235, 0, 2);
player.setNextAnimation(new Animation(1734));
World.removeObject(new WorldObject(43753, 10, 1, 2970, 9508, 0), true); //poistaa laivan
World.removeObject(new WorldObject(2977, 10, 1, 2971, 9507, 0), true); //poistaa maan
player.getInventory().deleteItem(6306, 3000);
player.getPackets().sendGameMessage(
"You push the ship away.");
}else {player.getPackets().sendGameMessage("There's nothing in here..");}
;}
else if (id == 49537) {// buying Zombie iron arrows
int amountCoins = player.getInventory().getItems().getNumberOf(6306);
int amountArrows = player.getInventory().getItems().getNumberOf(884);
if (amountCoins < 100) {player.getPackets().sendGameMessage("You don't have enough sticks.");}
if (player.getInventory().getFreeSlots() < 1){
if (amountArrows < 1) {
player.getPackets().sendGameMessage(
"Not enough space in your inventory.");}
player.getPackets().sendGameMessage(
"Not enough space in your inventory.");}
else {player.getInventory().addItem(884, 100);
player.getInventory().deleteItem(6306, 100);}}

else if (id == 2878) { // works now
player.getDialogueManager().startDialogue("Pool");
} else if (id == HunterEquipment.BRID_SNARE.getObjectId()) {
if (OwnedObjectManager.removeObject(player, object)) {
player.setNextAnimation(new Animation(19192));
World.getRegion(regionId).removeObject(object);
player.getInventory().addItem(
HunterEquipment.BRID_SNARE.getId(), 1);
player.setTrapAmount(player.getTrapAmount() - 1);
} else
player.getPackets().sendGameMessage(
"This isn't your trap.");


}else if (id == 48496){
new DungeonPartyManager(player);
player.dungtime = 800;
} else if (id == 46935 && object.getX() == 3090
&& object.getY() == 3498) {
TowersPkControler.enter(player);
} else if (object.getDefinitions().name.equalsIgnoreCase("Obelisk")) {
player.getControlerManager().startControler("ObeliskControler", object);
} else if (id == 2350
&& (object.getX() == 3352 && object.getY() == 3417 && object
.getPlane() == 0))
player.useStairs(832, new WorldTile(3177, 5731, 0), 1, 2);
else if (id == 2353
&& (object.getX() == 3177 && object.getY() == 5730 && object
.getPlane() == 0))
player.useStairs(828, new WorldTile(3353, 3416, 0), 1, 2);
else if (id == 10949 || id == 18994 || id == 18995
|| id == 18996 || id == 3038 || id == 3245
|| id == 11933 || id == 11934 || id == 11935
|| id == 11957 || id == 11958 || id == 11959)
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Tin_Ore));
else if (id == 37312 || id == 11952 || id == 37310) // gold ore
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Gold_Ore));
else if (id == 19000 || id == 19001 || id == 19002
|| id == 37309 || id == 37307 || id == 11954
|| id == 11955 || id == 11956) // iron ore
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Iron_Ore));
else if (id == 37306 || id == 2311 || id == 37304
|| id == 37305) // silver ore
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Silver_Ore));
else if (id == 10948 || id == 18997 || id == 18998
|| id == 18999 || id == 14850 || id == 14851
|| id == 3233 || id == 3032 || id == 11930
|| id == 11931 || id == 11932) // coal ore
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Coal_Ore));
else if (id == 18991 || id == 18992 || id == 18993
|| id == 3027 || id == 3229 || id == 11936
|| id == 11937 || id == 11938 || id == 11960
|| id == 11961 || id == 11962) // copper
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Copper_Ore));
else if (id == 3041 || id == 3280 || id == 11942 || id == 11944) // mithril
// ore
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Mithril_Ore));
else if (id == 3273 || id == 3040 || id == 11939 || id == 11941) // adamant
// ore
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Adamant_Ore));
else if (id == 14860 || id == 14861)
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Runite_Ore));
else if (id == 10947)
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Granite_Ore));
else if (id == 10946)
player.getActionManager().setSkill(
new Mining(object, RockDefinitions.Sandstone_Ore));
else if (id == 11554 || id == 11552)
player.getPackets().sendGameMessage(
"That rock is currently unavailable.");
else if (id == 2491)
player.getActionManager()
.setSkill(
new EssenceMining(
object,
player.getSkills().getLevel(
Skills.MINING) < 30 ? EssenceDefinitions.Rune_Essence
: EssenceDefinitions.Pure_Essence));
else if (id == 2478)
Runecrafting.craftEssence(player, 556, 1, 5, false, 11, 2,
22, 3, 34, 4, 44, 5, 55, 6, 66, 7, 77, 88, 9, 99,
10);
else if (id == 2479)
Runecrafting.craftEssence(player, 558, 2, 5.5, false, 14,
2, 28, 3, 42, 4, 56, 5, 70, 6, 84, 7, 98, 8);
else if (id == 2480)
Runecrafting.craftEssence(player, 555, 5, 6, false, 19, 2,
38, 3, 57, 4, 76, 5, 95, 6);
else if (id == 2481)
Runecrafting.craftEssence(player, 557, 9, 6.5, false, 26,
2, 52, 3, 78, 4);
else if (id == 2482)
Runecrafting.craftEssence(player, 554, 14, 7, false, 35, 2,
70, 3);
else if (id == 2483)
Runecrafting.craftEssence(player, 559, 20, 7.5, false, 46,
2, 92, 3);
else if (id == 2484)
Runecrafting.craftEssence(player, 564, 27, 8, true, 59, 2);
else if (id == 2487)
Runecrafting
.craftEssence(player, 562, 35, 8.5, true, 74, 2);
else if (id == 17010)
Runecrafting.craftEssence(player, 9075, 40, 8.7, true, 82,
2);
else if (id == 2486)
Runecrafting.craftEssence(player, 561, 45, 9, true, 91, 2);
else if (id == 2485)
Runecrafting.craftEssence(player, 563, 50, 9.5, true);
else if (id == 2488)
Runecrafting.craftEssence(player, 560, 65, 10, true);
else if (id == 30624)
Runecrafting.craftEssence(player, 565, 77, 10.5, true);
else if (id == 2452) {
int hatId = player.getEquipment().getHatId();
if (hatId == Runecrafting.AIR_TIARA
|| hatId == Runecrafting.OMNI_TIARA)
Runecrafting.enterAirAltar(player);
} else if (id == 2455) {
int hatId = player.getEquipment().getHatId();
if (hatId == Runecrafting.EARTH_TIARA
|| hatId == Runecrafting.OMNI_TIARA)
Runecrafting.enterEarthAltar(player);
} else if (id == 2456) {
int hatId = player.getEquipment().getHatId();
if (hatId == Runecrafting.FIRE_TIARA
|| hatId == Runecrafting.OMNI_TIARA)
Runecrafting.enterFireAltar(player);
} else if (id == 2454) {
int hatId = player.getEquipment().getHatId();
if (hatId == Runecrafting.WATER_TIARA
|| hatId == Runecrafting.OMNI_TIARA)
Runecrafting.enterWaterAltar(player);
} else if (id == 2457) {
int hatId = player.getEquipment().getHatId();
if (hatId == Runecrafting.BODY_TIARA
|| hatId == Runecrafting.OMNI_TIARA)
Runecrafting.enterBodyAltar(player);
} else if (id == 2453) {
int hatId = player.getEquipment().getHatId();
if (hatId == Runecrafting.MIND_TIARA
|| hatId == Runecrafting.OMNI_TIARA)
Runecrafting.enterMindAltar(player);
} else if (id == 36972) {
player.setNextAnimation(new Animation(712));
player.setNextGraphics(new com.rs.game.Graphics (624));
player.getPackets().sendGameMessage("You pray to the gods");
player.getInventory().deleteItem(536, 1);
// player.getSkills().addXp(Skills.PRAYER, 300);
} else if (id == 36972) {
player.setNextAnimation(new Animation(712));
player.setNextGraphics(new com.rs.game.Graphics (624));
player.getPackets().sendGameMessage("You pray to the gods");
player.getInventory().deleteItem(18830, 1);
//player.getSkills().addXp(Skills.PRAYER, 600);
} else if (id == 47120) { // zaros altar
// recharge if needed
if (player.getPrayer().getPrayerpoints() < player
.getSkills().getLevelForXp(Skills.PRAYER) * 10) {
player.addStopDelay(12);
player.setNextAnimation(new Animation(12563));
player.getPrayer().setPrayerpoints(
(int) ((player.getSkills().getLevelForXp(
Skills.PRAYER) * 10) * 1.15));
player.getPrayer().refreshPrayerPoints();
}
player.getDialogueManager().startDialogue("ZarosAltar");
}
/* else if (id == 9369) {
if (player.getX() == 2399 && player.getY() == 5177) {
FightPitsControler.enterWaitRoom(player);
player.getControlerManager().startControler("FightPitsControler");
} else if (player.getX() == 2399 && player.getY() == 5175)
player.addWalkSteps(2399, 5175, -1, false);
}*/
else if (id == 36786 || id == 25808 || id == 782 || id == 34752)
player.getDialogueManager().startDialogue("Banker", 4907);
else if (id == 42377 || id == 42378)
player.getDialogueManager().startDialogue("Banker", 2759);
else if (id == 42217 || id == 782 || id == 34752 || id == 4369)
player.getDialogueManager().startDialogue("Banker", 553);
/* else if (id == 57437)
player.getBank().openBank();
else if (id == 6084)
player.getBank().openBank();
else if (id == 22819)
player.getBank().openBank();
else if (id == 25808)
player.getBank().openBank();*/
else if (id == 42425 && object.getX() == 3220
&& object.getY() == 3222) { // zaros portal
player.useStairs(10256, new WorldTile(3353, 3416, 0), 4, 5,
"And you find yourself into a digsite.");
player.addWalkSteps(3222, 3223, -1, false);
player.getPackets().sendGameMessage(
"You examine portal and it aborves you...");
}/*
* else if (id ==
* HunterNPC.CRIMSON_SWIFT.getTransformObjectId()) {
* player.getInventory
* ().addItem(HunterNPC.CRIMSON_SWIFT.getItem(), 1);
* player.getInventory
* ().addItem(HunterEquipment.BRID_SNARE.getId(), 1);
* player.setNextAnimation
* (HunterEquipment.BRID_SNARE.getPickUpAnimation());
* player.getSkills().addXp(Skills.HUNTER,
* HunterNPC.CRIMSON_SWIFT.getXp());
* player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.CERULEAN_TWITCH.getTransformObjectId()) {
* player.getInventory
* ().addItem(HunterNPC.CERULEAN_TWITCH.getItem(), 1);
* player.getInventory
* ().addItem(HunterEquipment.BRID_SNARE.getId(), 1);
* player.setNextAnimation
* (HunterEquipment.BRID_SNARE.getPickUpAnimation());
* player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.COPPER_LONGTAIL.getTransformObjectId()) {
* player.getInventory
* ().addItem(HunterNPC.COPPER_LONGTAIL.getItem(), 1);
* player.getInventory
* ().addItem(HunterEquipment.BRID_SNARE.getId(), 1);
* player.setNextAnimation
* (HunterEquipment.BRID_SNARE.getPickUpAnimation());
* player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.FERRT.getTransformObjectId()) {
* player.getInventory().addItem(HunterNPC.FERRT.getItem(), 1);
* player.getInventory().addItem(HunterEquipment.BOX.getId(),
* 1);
* player.setNextAnimation(HunterEquipment.BOX.getPickUpAnimation
* ()); player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.GECKO.getTransformObjectId()) {
* player.getInventory().addItem(HunterNPC.GECKO.getItem(), 1);
* player.getInventory().addItem(HunterEquipment.BOX.getId(),
* 1);
* player.setNextAnimation(HunterEquipment.BOX.getPickUpAnimation
* ()); player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.GOLDEN_WARBLER.getTransformObjectId()) {
* player.getInventory().addItem(HunterNPC.FERRT.getItem(), 1);
* player
* .getInventory().addItem(HunterEquipment.BRID_SNARE.getId(),
* 1); player.setNextAnimation(HunterEquipment.BRID_SNARE.
* getPickUpAnimation());
* player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.MONKEY.getTransformObjectId()) {
* player.getInventory().addItem(HunterNPC.MONKEY.getItem(), 1);
* player.getInventory().addItem(HunterEquipment.BOX.getId(),
* 1);
* player.setNextAnimation(HunterEquipment.BOX.getPickUpAnimation
* ()); player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.RACCOON.getTransformObjectId()) {
* player.getInventory().addItem(HunterNPC.RACCOON.getItem(),
* 1);
* player.getInventory().addItem(HunterEquipment.BOX.getId(),
* 1);
* player.setNextAnimation(HunterEquipment.BOX.getPickUpAnimation
* ()); player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.TROPICAL_WAGTAIL.getTransformObjectId()) {
* player.getInventory
* ().addItem(HunterNPC.TROPICAL_WAGTAIL.getItem(), 1);
* player.getInventory
* ().addItem(HunterEquipment.BRID_SNARE.getId(), 1);
* player.setNextAnimation
* (HunterEquipment.BRID_SNARE.getPickUpAnimation());
* player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); } else if (id ==
* HunterNPC.WIMPY_BIRD.getTransformObjectId()) {
* player.getInventory().addItem(HunterNPC.WIMPY_BIRD.getItem(),
* 1);
* player.getInventory().addItem(HunterEquipment.BRID_SNARE.getId
* (), 1); player.setNextAnimation(HunterEquipment.BRID_SNARE.
* getPickUpAnimation());
* player.setTrampAmount(player.getTrampAmount() - 1);
* World.removeObject(object, true); }
*/else if (id == 46500 && object.getX() == 3351
&& object.getY() == 3415) { // zaros portal
player.useStairs(-1, new WorldTile(
Settings.RESPAWN_PLAYER_LOCATION.getX(),
Settings.RESPAWN_PLAYER_LOCATION.getY(),
Settings.RESPAWN_PLAYER_LOCATION.getPlane()), 2, 3,
"You found your way back to home.");
player.addWalkSteps(3351, 3415, -1, false);
} else if (id == 9293) {
if (player.getSkills().getLevel(Skills.AGILITY) < 70) {
player.getPackets()
.sendGameMessage(
"You need an agility level of 70 to use this obstacle.",
true);
return;
}
int x = player.getX() == 2886 ? 2892 : 2886;
WorldTasksManager.schedule(new WorldTask() {
int count = 0;

[MENTION=15855]Over[/MENTION]ride
public void run() {
player.setNextAnimation(new Animation(844));
if (count++ == 1)
stop();
}

}, 0, 0);
player.setNextForceMovement(new ForceMovement(
new WorldTile(x, 9799, 0), 3,
player.getX() == 2886 ? 1 : 3));
player.useStairs(-1, new WorldTile(x, 9799, 0), 3, 4);
} else if (id == 2295)
Agility.walkGnomeLog(player);
else if (id == 2285)
Agility.climbGnomeObstacleNet(player);
else if (id == 35970)
Agility.climbUpGnomeTreeBranch(player);
else if (id == 2312)
Agility.walkGnomeRope(player);
else if (id == 4059)
Agility.walkBackGnomeRope(player);
else if (id == 2314)
Agility.climbDownGnomeTreeBranch(player);
else if (id == 2286)
Agility.climbGnomeObstacleNet2(player);
else if (id == 12351 && player.getX() == 3176)
Agility.PkBoxBarrier(player);
else if (id == 12351 && player.getX() == 3174)
Agility.PkBoxBack(player);
else if (id == 43543 || id == 43544)
Agility.enterGnomePipe(player, object.getX(), object.getY());
else if (Wilderness.isDitch(id)) {// wild ditch
player.getDialogueManager().startDialogue(
"WildernessDitch", object);
} else if (id == 42611) {// Magic Portal
player.getDialogueManager().startDialogue("MagicPortal");
} else if (id == 27254) {// Edgeville portal
player.getPackets().sendGameMessage(
"You enter the portal...");
player.useStairs(10584, new WorldTile(3087, 3488, 0), 2, 3,
"..and are transported to Edgeville.");
player.addWalkSteps(1598, 4506, -1, false);
} else if (id == 15522) {// portal sign
if (player.withinDistance(new WorldTile(1598, 4504, 0), 1)) {// PORTAL
// 1
player.getInterfaceManager().sendInterface(327);
player.getPackets().sendIComponentText(327, 13,
"Edgeville");
player.getPackets()
.sendIComponentText(
327,
14,
"This portal will take you to edgeville. There "
+ "you can multi pk once past the wilderness ditch.");
}
if (player.withinDistance(new WorldTile(1598, 4508, 0), 1)) {// PORTAL
// 2
player.getInterfaceManager().sendInterface(327);
player.getPackets().sendIComponentText(327, 13,
"Mage Bank");
player.getPackets()
.sendIComponentText(
327,
14,
"This portal will take you to the mage bank. "
+ "The mage bank is a 1v1 deep wilderness area.");
}
if (player.withinDistance(new WorldTile(1598, 4513, 0), 1)) {// PORTAL
// 3
player.getInterfaceManager().sendInterface(327);
player.getPackets().sendIComponentText(327, 13,
"Magic's Portal");
player.getPackets()
.sendIComponentText(
327,
14,
"This portal will allow you to teleport to areas that "
+ "will allow you to change your magic spell book.");
}
}
else if (id == 37929) {// corp beast
if (object.getX() == 2971 && object.getY() == 4382
&& object.getPlane() == 0)
player.getInterfaceManager().sendInterface(650);
else if (object.getX() == 2918 && object.getY() == 4382
&& object.getPlane() == 0) {
player.stopAll();
player.setNextWorldTile(new WorldTile(
player.getX() == 2921 ? 2917 : 2921, player
.getY(), player.getPlane()));
}
} else if (id == 37928 && object.getX() == 2883
&& object.getY() == 4370 && object.getPlane() == 0) {
player.stopAll();
player.setNextWorldTile(new WorldTile(3214, 3782, 0));
player.getControlerManager().startControler("Wilderness");
} else if (id == 38815 && object.getX() == 3209
&& object.getY() == 3780 && object.getPlane() == 0) {
if (player.getSkills().getLevelForXp(Skills.WOODCUTTING) < 37
|| player.getSkills().getLevelForXp(Skills.MINING) < 45
|| player.getSkills().getLevelForXp(
Skills.SUMMONING) < 23
|| player.getSkills().getLevelForXp(
Skills.FIREMAKING) < 47
|| player.getSkills().getLevelForXp(Skills.PRAYER) < 55) {
player.getPackets()
.sendGameMessage(
"You need 23 Summoning, 37 Woodcutting, 45 Mining, 47 Firemaking and 55 Prayer to enter this dungeon.");
return;
}
player.stopAll();
player.setNextWorldTile(new WorldTile(2885, 4372, 0));
player.getControlerManager().forceStop();
// TODO all reqs, skills not added
} else if (id == 9369) {
player.getControlerManager().startControler("FightPits");
} else if (id == 50205){
Summoning.infusePouches(player);
} else if (id == 54019 || id == 54020 || id == 55301)
PkRank.showRanks(player);
else if (id == 1817 && object.getX() == 2273
&& object.getY() == 4680) { // kbd lever
Magic.pushLeverTeleport(player, new WorldTile(3067, 10254,
0));
} else if (id == 1816 && object.getX() == 3067
&& object.getY() == 10252) { // kbd out lever
Magic.pushLeverTeleport(player,
new WorldTile(2273, 4681, 0));
} else if (id == 9356) {
player.getDialogueManager().startDialogue("JadEnter");
} else if (id == 28779) {
player.getDialogueManager().startDialogue("BorkEnter");
} else if (id == 28698) {
player.getDialogueManager().startDialogue("LunarAltar");
} else if (id == 32015 && object.getX() == 3069
&& object.getY() == 10256) { // kbd stairs
player.useStairs(828, new WorldTile(3017, 3848, 0), 1, 2);
player.getControlerManager().startControler("Wilderness");
} else if (id == 1765 && object.getX() == 3017
&& object.getY() == 3849) { // kbd out stairs
player.stopAll();
player.setNextWorldTile(new WorldTile(3069, 10255, 0));
player.getControlerManager().forceStop();
} else if ((id == 14315) || (id == 14314)) {
player.setPestControl(new PestControl(player));
player.getPestControl().handleObjectClick1(player, object);
} else if (id == 5959) {
Magic.pushLeverTeleport(player,
new WorldTile(2539, 4712, 0));
} else if (id == 5960) {
Magic.pushLeverTeleport(player,
new WorldTile(3089, 3957, 0));
} else if (id == 62675)
player.getCutscenesManager().play("DTPreview");
else if (id == 62681)
player.getDominionTower().viewScoreBoard();
else if (id == 2273) {
player.setNextWorldTile(new WorldTile(2851,5933,0));
player.sm("Use your fire cape on the floating orb to bring out Har'Arken.");
player.sm("WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
player.sm("You will lose your fire cape and not be able to get it back, but gain the kiln cape if you win!");
} else if (id == 62678 || id == 62679)
player.getDominionTower().openModes();
else if (id == 62688)
player.getDialogueManager().startDialogue("DTClaimRewards");
else if (object.getDefinitions().name.contains("bank") || object.getDefinitions().name.contains("Bank"))
player.getBank().openBank();
else if (id == 62677)
player.getDominionTower().talkToFace();
else if (id == 62680)
player.getDominionTower().openBankChest();
else if (id == 62676) { // dominion exit
player.useStairs(-1, new WorldTile(3374, 3093, 0), 0, 1);
} else if (id == 62674) { // dominion entrance
player.useStairs(-1, new WorldTile(3744, 6405, 0), 0, 1);

} else {
switch (objectDef.name.toLowerCase()) {
case "web":
if (objectDef.containsOption(0, "Slash")) {
player.setNextAnimation(new Animation(PlayerCombat
.getWeaponAttackEmote(player.getEquipment()
.getWeaponId(), player
.getCombatDefinitions()
.getAttackStyle())));
slashWeb(player, object);
}
break;
[COLOR="#FF0000"] case "Bank booth":
case "bank booth":
player.getBank().openDepositBox();
break;[/COLOR]
case "bank chest":
if (objectDef.containsOption(0, "Use"))
player.getBank().openDepositBox();
[COLOR="#00FF00"] case "bank deposit box":
if (objectDef.containsOption(0, "Deposit"))
player.getBank().openDepositBox();
break;[/COLOR]
case "bank":
player.getBank().openDepositBox();
break;
case "Bank":
player.getBank().openDepositBox();
break;
//Fruits, berries, vegetables etc.
case "wheat":
if (objectDef.containsOption(0, "Pick"))
player.setNextAnimation(new Animation(827));
player.getInventory().addItem(1947, 1);
World.removeTemporaryObject(object, 60000, true);
break;
//Boxes, crates, sacks etc.
case "crate":
if (objectDef.containsOption(0, "Search")){
if (object.getId() == 46269){
player.setNextAnimation(new Animation(832));
player.getInventory().addItem(2347, 1);}
else {
player.setNextAnimation(new Animation(832));
player.getInventory().addItem(1734, 1);}}
else if (objectDef.containsOption(0, "Buy")){

if(player.getInventory().getItems().getNumberOf(995)<1){
player.getPackets().sendGameMessage("Even rotten food isn't free!");
return;}
if(player.getInventory().getFreeSlots() < 1) {
player.getPackets().sendGameMessage("Not enough space in your inventory.");}
if (player.getInventory().getItems().getNumberOf(995) >= 1 && player.getInventory().getFreeSlots() >= 1){
player.getInventory().addItem(2518, 1);
player.getInventory().deleteItem(995, 1);}}
;

//Bookcases, Drawers, etc.
// Woodcutting start
case "tree":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.NORMAL));
break;
case "dead tree":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.DEAD));
break;
case "jungle tree":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.JUNGLE));
break;
case "oak":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager()
.setSkill(
new Woodcutting(object,
TreeDefinitions.OAK));
break;
case "willow":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.WILLOW));
break;
case "maple tree":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.MAPLE));
break;
case "ivy":
if (objectDef.containsOption(0, "Chop"))
player.getActionManager()
.setSkill(
new Woodcutting(object,
TreeDefinitions.IVY));
break;
case "yew":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager()
.setSkill(
new Woodcutting(object,
TreeDefinitions.YEW));
break;
case "magic tree":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.MAGIC));
break;
case "cursed magic tree":
if (objectDef.containsOption(0, "Chop down"))
player.getActionManager().setSkill(
new Woodcutting(object,
TreeDefinitions.CURSED_MAGIC));
break;
// Woodcutting end

case "gate":
if (object.getType() == 0
&& objectDef.containsOption(0, "Open"))
handleFence(player, object);
break;
case "large door":
case "metal door":
if (object.getType() == 0
&& objectDef.containsOption(0, "Open"))
handleGate(player, object);
break;
case "door":
if (object.getType() == 0
&& (objectDef.containsOption(0, "Open") || objectDef
.containsOption(0, "Unlock")))
handleDoor(player, object);
break;
case "magic door":
if (object.getType() == 0
&& (objectDef.containsOption(0, "Open") || objectDef
.containsOption(0, "Unlock")))
handleDoor(player, object);
break;
case "Castle door":
if (object.getType() == 0
&& (objectDef.containsOption(0, "Open") || objectDef
.containsOption(0, "Unlock")))
handleDoor(player, object);
break;
case "ladder":
handleLadder(player, object, 1);
break;
case "bamboo ladder":
handleLadder(player, object, 1);
break;
case "staircase":
handleStaircases(player, object, 1);
break;
case "altar":
if (objectDef.containsOption(0, "Pray-at")) {
final int maxPrayer = player.getSkills()
.getLevelForXp(Skills.PRAYER) * 10;
if (player.getPrayer().getPrayerpoints() < maxPrayer) {
player.addStopDelay(5);
player.getPackets().sendGameMessage(
"You pray to the gods...", true);
player.setNextAnimation(new Animation(645));
WorldTasksManager.schedule(new WorldTask() {
[MENTION=15855]Over[/MENTION]ride
public void run() {
player.getPrayer().restorePrayer(
maxPrayer);
player.getPackets()
.sendGameMessage(
"...and recharged your prayer.",
true);
}
}, 2);
} else {
player.getPackets().sendGameMessage(
"You already have full prayer.", true);
}
if (id == 6552)
player.getDialogueManager().startDialogue(
"AncientAltar");
}
break;
default:
player.getPackets().sendGameMessage(
"Nothing interesting happens.");
break;
}
}
if (Settings.DEBUG)
Logger.log(
"ObjectHandler",
"cliked 1 at object id : " + id + ", "
+ object.getX() + ", " + object.getY()
+ ", " + object.getPlane() + ", "
+ object.getType() + ", "
+ object.getRotation() + ", "
+ object.getDefinitions().name);
}

}, objectDef.getSizeX(), Wilderness.isDitch(id) ? 4 : objectDef
.getSizeY(), object.getRotation()));
}[/CODE] The part I told you earlier is marked with green and red. [COLOR="#00FF00"]Green works[/COLOR][COLOR="#FF0000"] but red doesn't[/COLOR]. And no, it doesn't help to add [CODE]if (objectDef.containsOption(0, "Bank"))[/CODE] below case bank booth.. :D And the marked part isn't the only one with that kind of problems.. :/ It just shows well what it's really about I think?

Share this post


Link to post
Share on other sites
  • 0
Ohh, true.. :D I'm so stupid.. Fixed it :D It must be on handleOption2 instead of handleOption1.. ^ ^

Share this post


Link to post
Share on other sites

×