Thread: Fight caves, Fight Pit and Inferno teleport loop

Results 1 to 9 of 9
  1. #1 Fight caves, Fight Pit and Inferno teleport loop 
    Registered Member
    Join Date
    Dec 2020
    Posts
    22
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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:
    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),
    Fight Cave enter:
    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 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>();
            }
        }
    When teleporting to the fight caves this is triggered as I see Wave! message pop up in the logs
    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;
                }
            },
    Reply With Quote  
     

  2. #2  
    Community Veteran


    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,833
    Thanks given
    187
    Thanks received
    306
    Discord
    View profile
    Rep Power
    770
    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?


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2020
    Posts
    22
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    979
    Thanks given
    474
    Thanks received
    293
    Rep Power
    881
    Check your FightCave.leaveCave(player, true); method, It seems to me your player is still be in the region instance or the action
    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);
                }
    is this being accessed?


    A creative man is motivated by the desire to achieve, not by the desire to beat others.”


    ― Ayn Rand
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Dec 2020
    Posts
    22
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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();
        }
    Reply With Quote  
     

  6. #6  
    Registered Member
    Melvin's Avatar
    Join Date
    Aug 2011
    Posts
    979
    Thanks given
    474
    Thanks received
    293
    Rep Power
    881
    Code:
     player.setRegionInstance(new RegionInstance(player, RegionInstance.RegionInstanceType.FIGHT_CAVE));
    because of this? Are you using the same enterCave method for each location?


    A creative man is motivated by the desire to achieve, not by the desire to beat others.”


    ― Ayn Rand
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2020
    Posts
    22
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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());
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Dec 2020
    Posts
    22
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    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.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Dec 2020
    Posts
    22
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Is there a fix for certain areas triggering instances when you go there?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 4
    Last Post: 01-08-2021, 03:15 PM
  2. 667/718 Fight caves & fight pits
    By TaterMater in forum Requests
    Replies: 3
    Last Post: 08-21-2013, 08:26 PM
  3. Replies: 17
    Last Post: 05-03-2012, 02:23 PM
  4. Fight Cave Npcs - Projectile Ids and GFX
    By Azurite in forum Help
    Replies: 1
    Last Post: 05-21-2011, 10:06 PM
  5. Replies: 5
    Last Post: 03-22-2009, 05:37 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •