alkku15 Posted May 15, 2018 Share Posted May 15, 2018 i noticed that the coordinates X n Y aren't stable when playing a minigame like pest control, i would like to make an area in the middle of these 4 towers https://imgur.com/a/O39tL4L i am making myself a pest control / killer / afker bot what would kill these enemies in that area? any help? Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 15, 2018 Share Posted May 15, 2018 It's an instance, which gets loaded in a random "instance slot" in the instance space; hence the changing coordinates. What you CAN do is create the area by looking at the 'Local coordinates' of the region that the instance is loaded in. Local coordinates are coordinates relative to the region base (the lower left corner of the currently loaded region). Even though the instance is loaded in different places, the local coordinates of objects, npcs and positions will be the same every time. At least until you wander far enough to trigger a new region load. So upon entering the instance you could make the Area with something like: Position southWestCorner = new Position(50, 50, 0).translate(getMap().getBaseX(), getMap().getBaseY()); Position northEastCorner = new Position(100, 100, 0).translate(getMap().getBaseX(), getMap().getBaseY()); Area fightArea = new Area(southWestCorner, northEastCorner); assuming the Area spans from x:50, y:50 to x:100, y:100 in the local region 2 Quote Link to comment Share on other sites More sharing options...
alkku15 Posted May 15, 2018 Author Share Posted May 15, 2018 26 minutes ago, FrostBug said: It's an instance, which gets loaded in a random "instance slot" in the instance space; hence the changing coordinates. What you CAN do is create the area by looking at the 'Local coordinates' of the region that the instance is loaded in. Local coordinates are coordinates relative to the region base (the lower left corner of the currently loaded region). Even though the instance is loaded in different places, the local coordinates of objects, npcs and positions will be the same every time. At least until you wander far enough to trigger a new region load. So upon entering the instance you could make the Area with something like: Position southWestCorner = new Position(50, 50, 0).translate(getMap().getBaseX(), getMap().getBaseY()); Position northEastCorner = new Position(100, 100, 0).translate(getMap().getBaseX(), getMap().getBaseY()); Area fightArea = new Area(southWestCorner, northEastCorner); assuming the Area spans from x:50, y:50 to x:100, y:100 in the local region yes exactly what i was looking for thank you very much! Quote Link to comment Share on other sites More sharing options...