Is the leave method even being trigged when you teleport?
Do you have a method if you teleport away, because I do not see any?
|
|
This is being moved to this located as I must of posted it in the wrong section by mistake.
I can't find out why it is doing it but maybe someone could shed some light on it but when I teleport to the fight caves, fight pits or the inferno. It teleports me to the entrance of them but if I want to home or anywhere else it does the teleport but brings me back to the same location and it is an infinite loop unless I log out and set my coords to home or any other location.
I will update this post if people request to see parts of the code to help me out here and also the inferno does not start but kicks me out every time but that might be related to the same issue but I am not too sure.
The source I am using is Uthina source.
Teleport codes:
Fight Cave enter:Code:TELEPORT_3(new String[] { "Fight Caves", "None" }, new int[] { 2445, 5177, 0 }, false), TELEPORT_4(new String[] { "Fight Pits", "None" }, new int[] { 2399, 5177, 0 }, false), TELEPORT_11(new String[] { "Inferno", "None" }, new int[] { 2445, 5177, 0 }, false),
When teleporting to the fight caves this is triggered as I see Wave! message pop up in the logsCode:public static void enterCave(Player player) { player.moveTo(new Position(2413, 5117, player.getIndex() * 4)); DialogueManager.start(player, 36); player.setRegionInstance(new RegionInstance(player, RegionInstance.RegionInstanceType.FIGHT_CAVE)); spawnJad(player); } public RegionInstance(Player p, RegionInstanceType type) { this.owner = p; this.type = type; this.npcsList = new CopyOnWriteArrayList<NPC>(); if (type == RegionInstanceType.CONSTRUCTION_HOUSE) { this.playersList = new CopyOnWriteArrayList<Player>(); } }
Code:FIGHT_CAVES(new int[] { 2360, 2500 }, new int[] { 5045, 5200 }, true, true, false, false, false, false) { @Override public void process(Player player) { } @Override public boolean canTeleport(Player player) { return true; } @Override public void login(Player player) { } @Override public void enter(Player player) { System.err.println("Wave!"); player.getPacketSender().sendWalkableInterface(29050, true); player.getPacketSender().sendInteractionOption("Invite to party", 6, false); } @Override public void leave(Player player) { player.getCombatBuilder().reset(true); if (player.getRegionInstance() != null) { player.getRegionInstance().destruct(); } player.moveTo(new Position(2454, 5162)); player.getPacketSender().sendInteractionOption("null", 6, false); player.getPacketSender().sendWalkableInterface(29050, false); } @Override public void onDeath(Player player) { FightCave.leaveCave(player, true); } @Override public boolean handleKilledNPC(Player killer, NPC npc) { FightCave.handleJadDeath(killer, npc); return true; } },




Is the leave method even being trigged when you teleport?
Do you have a method if you teleport away, because I do not see any?
So when I teleport to the fight caves, fight pit or the inferno it triggers the fight cave instance and to the teleport coords named teleport_3, 4 and 11 as those three areas triggers the Wave! in the log soon as I teleport.
Is there away to not get it to trigger as I think that might be the key to stopping the loop.
When I use ::home or teleport to any other location it teleports me back to the leave coords and triggers the Wave! message again.
Check your FightCave.leaveCave(player, true); method, It seems to me your player is still be in the region instance or the actionis this being accessed?Code:public void leave(Player player) { player.getCombatBuilder().reset(true); if (player.getRegionInstance() != null) { player.getRegionInstance().destruct(); } player.moveTo(new Position(2454, 5162)); player.getPacketSender().sendInteractionOption("null", 6, false); player.getPacketSender().sendWalkableInterface(29050, false); }

This is the minigame fight caves but when I teleport to the city of the three minigames does not matter what you pick the locations.java fight caves enter is triggered
Code:public static void enterCave(Player player) { player.moveTo(new Position(2413, 5117, player.getIndex() * 4)); DialogueManager.start(player, 36); player.setRegionInstance(new RegionInstance(player, RegionInstance.RegionInstanceType.FIGHT_CAVE)); spawnJad(player); } public static void leaveCave(Player player, boolean resetStats) { Locations.Location.FIGHT_CAVES.leave(player); if (resetStats) player.restart(); }
because of this? Are you using the same enterCave method for each location?Code:player.setRegionInstance(new RegionInstance(player, RegionInstance.RegionInstanceType.FIGHT_CAVE));

No, when you teleport by using the interface it is using the teleport_x to teleport you.
Code:public class Teleporting { private static final int[][] LINE_IDS = { { 61250, 61300 }, { 61251, 61301 }, { 61252, 61302 }, { 61253, 61303 }, { 61254, 61304 }, { 61255, 61305 }, { 61256, 61306 }, { 61257, 61307 }, { 61258, 61308 }, { 61259, 61309 }, { 61260, 61310 }, { 61261, 61311 }, { 61262, 61312 }, { 61263, 61313 }, { 61264, 61314 }, { 61265, 61315 }, { 61266, 61316 }, { 61267, 61317 }, { 61268, 61318 }, { 61269, 61319 }, { 61270, 61320 }, { 61271, 61321 }, { 61272, 61322 }, { 61273, 61323 }, { 61274, 61324 }, { 61275, 61325 }, { 61276, 61326 }, { 61277, 61327 }, { 61278, 61328 }, { 61279, 61329 }, }; private static final int[] BUTTON_IDS = { -4286, -4285, -4284, -4283, -4282, -4281, -4280, -4279, -4278, -4277, -4276, -4275, -4274, -4273, -4272, -4271, -4270, -4269, -4268, -4267, -4266, -4265, -4264, -4263, -4262, -4261, -4260, -4259, -4258, -4255, -4255, -4255, -4254, -4253, -4252, -4251, -4250 }; private static final int[] TAB_IDS = { -4934, -4931, -4928, -4925, -4922, -4919 }; public static void teleport(Player player, int button) { for (int i = 0; i < BUTTON_IDS.length; i++) { if (button == BUTTON_IDS[i]) { player.destination = i; } } if (player.lastClickedTab == 1) teleportTraining(player, player.destination); else if (player.lastClickedTab == 2) teleportDungeons(player, player.destination); else if (player.lastClickedTab == 3) teleportBosses(player, player.destination); else if (player.lastClickedTab == 4) teleportWilderness(player, player.destination); else if (player.lastClickedTab == 5) teleportMinigames(player, player.destination); else if (player.lastClickedTab == 6) teleportSkilling(player, player.destination); } public static void teleportMinigames(Player player, int destination) { TeleportHandler.teleportPlayer(player, new Position(m.getCoordinates()[0], m.getCoordinates()[1]), player.getSpellbook().getTeleportType());
I have done testing but not sure how to fix it but it seems when you teleport to the Tzaar City it activates the fight cave instance.
From anywhere in the game using the fight caves teleport in the teleport menu and that is the teleport_3 code it is fine but when you go to the city itself that is the issue.
Is there a fix for certain areas triggering instances when you go there?
| « Ethos | Eek - Too many npcs | Help Setup Kronis osrs » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |