Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -45909,11 +45909,138 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"default": [],
|
||||
"default": [
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "1.0",
|
||||
"id": "532",
|
||||
"maxAmount": "1"
|
||||
}
|
||||
],
|
||||
"charm": [],
|
||||
"ids": "5473,5521,5525",
|
||||
"description": "",
|
||||
"ids": "5473,5521,5525,5474,5522,5526,5475,5523,5527",
|
||||
"description": "first 3: ice troll runt, next 3: ice troll male, last 3: ice troll female",
|
||||
"main": [
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1119",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1339",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1141",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1341",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1181",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "1161",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "1357",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "1145",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "1345",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "1201",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "1347",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "3122",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "8",
|
||||
"weight": "50.0",
|
||||
"id": "557",
|
||||
"maxAmount": "60"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "561",
|
||||
"maxAmount": "8"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "563",
|
||||
"maxAmount": "8"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "384",
|
||||
"maxAmount": "8"
|
||||
},
|
||||
{
|
||||
"minAmount": "4",
|
||||
"weight": "50.0",
|
||||
"id": "402",
|
||||
"maxAmount": "10"
|
||||
},
|
||||
{
|
||||
"minAmount": "3",
|
||||
"weight": "25.0",
|
||||
"id": "454",
|
||||
"maxAmount": "3"
|
||||
},
|
||||
{
|
||||
"minAmount": "3",
|
||||
"weight": "25.0",
|
||||
"id": "354",
|
||||
"maxAmount": "3"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "1760",
|
||||
"maxAmount": "42"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
@@ -45934,243 +46061,201 @@
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"weight": "25.0",
|
||||
"id": "205",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "211",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "215",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"weight": "8.0",
|
||||
"id": "207",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "213",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"weight": "8.0",
|
||||
"id": "209",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"weight": "8.0",
|
||||
"id": "211",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "213",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "215",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "2485",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"weight": "8.0",
|
||||
"id": "217",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5104",
|
||||
"weight": "8.0",
|
||||
"id": "5100",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5311",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5321",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"weight": "8.0",
|
||||
"id": "5323",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5100",
|
||||
"maxAmount": "2"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5105",
|
||||
"weight": "25.0",
|
||||
"id": "5292",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5280",
|
||||
"weight": "8.0",
|
||||
"id": "5104",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5281",
|
||||
"weight": "8.0",
|
||||
"id": "5293",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "5106",
|
||||
"weight": "8.0",
|
||||
"id": "5311",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"weight": "8.0",
|
||||
"id": "5321",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5294",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"weight": "8.0",
|
||||
"id": "5295",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"id": "12176",
|
||||
"weight": "8.0",
|
||||
"id": "5105",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"weight": "8.0",
|
||||
"id": "5282",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5296",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5281",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5297",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5106",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5298",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5280",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5299",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "3138",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5300",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5301",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5302",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "8.0",
|
||||
"id": "5303",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1119",
|
||||
"weight": "8.0",
|
||||
"id": "5304",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "50.0",
|
||||
"id": "1141",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1339",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1343",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1345",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1181",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1161",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"id": "3122",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"id": "1347",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"id": "1127",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "10",
|
||||
"weight": "50.0",
|
||||
"id": "557",
|
||||
"maxAmount": "60"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "561",
|
||||
"maxAmount": "8"
|
||||
},
|
||||
{
|
||||
"minAmount": "2",
|
||||
"weight": "25.0",
|
||||
"id": "563",
|
||||
"maxAmount": "7"
|
||||
},
|
||||
{
|
||||
"minAmount": "35",
|
||||
"weight": "50.0",
|
||||
"weight": "100.0",
|
||||
"id": "995",
|
||||
"maxAmount": "352"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "384",
|
||||
"maxAmount": "8"
|
||||
},
|
||||
{
|
||||
"minAmount": "3",
|
||||
"weight": "25.0",
|
||||
"id": "354",
|
||||
"maxAmount": "3"
|
||||
},
|
||||
{
|
||||
"minAmount": "3",
|
||||
"weight": "25.0",
|
||||
"id": "454",
|
||||
"maxAmount": "3"
|
||||
},
|
||||
{
|
||||
"minAmount": "4",
|
||||
"weight": "25.0",
|
||||
"id": "402",
|
||||
"maxAmount": "10"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "25.0",
|
||||
"id": "1760",
|
||||
"maxAmount": "42"
|
||||
"maxAmount": "350"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
@@ -46180,15 +46265,21 @@
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"weight": "2.0",
|
||||
"id": "10977",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "5.0",
|
||||
"weight": "8.0",
|
||||
"id": "31",
|
||||
"maxAmount": "1"
|
||||
},
|
||||
{
|
||||
"minAmount": "1",
|
||||
"weight": "100.0",
|
||||
"id": "0",
|
||||
"maxAmount": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -46227,8 +46318,8 @@
|
||||
"maxAmount": "1"
|
||||
}
|
||||
],
|
||||
"ids": "5474,5522,5526",
|
||||
"description": "",
|
||||
"ids": "",
|
||||
"description": "moved ID's to runt",
|
||||
"main": [
|
||||
{
|
||||
"minAmount": "1",
|
||||
@@ -46591,8 +46682,8 @@
|
||||
"maxAmount": "1"
|
||||
}
|
||||
],
|
||||
"ids": "5475,5523,5527",
|
||||
"description": "",
|
||||
"ids": "",
|
||||
"description": "moved ID's to runt",
|
||||
"main": [
|
||||
{
|
||||
"minAmount": "1",
|
||||
@@ -63457,4 +63548,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
+73470
-45
File diff suppressed because it is too large
Load Diff
@@ -7637,7 +7637,7 @@
|
||||
},
|
||||
{
|
||||
"npc_id": "5488",
|
||||
"loc_data": "{2416,3800,0,0,0}"
|
||||
"loc_data": "{2416,3799,0,0,1}"
|
||||
},
|
||||
{
|
||||
"npc_id": "5489",
|
||||
|
||||
@@ -273,9 +273,6 @@ public final class DoorActionHandler {
|
||||
* closed again.
|
||||
*/
|
||||
public static void open(Scenery object, Scenery second, int replaceId, int secondReplaceId, boolean clip, int restoreTicks, boolean fence) {
|
||||
if(GameWorld.getSettings().getIncreased_door_time()){
|
||||
restoreTicks *= 5;
|
||||
}
|
||||
object = object.getWrapper();
|
||||
int mod = object.getType() == 9 ? -1 : 1;
|
||||
int firstDir = (object.getRotation() + ((mod + 4) % 4)) % 4;
|
||||
|
||||
@@ -21,6 +21,8 @@ public enum SpecialLadders implements LadderAchievementCheck {
|
||||
INTRO_LEAVE(Location.create(2522, 4999, 0),Location.create(3230, 3240, 0)),
|
||||
JATIZSO_MINE_UP(Location.create(2406,10188,0),Location.create(2397, 3811, 0)),
|
||||
JATIZSO_MINE_DOWN(Location.create(2397, 3812, 0), Location.create(2405, 10188, 0)),
|
||||
JATIZSO_TOWER_UP(Location.create(2373, 3800, 2),Location.create(2374, 3800, 0)),
|
||||
JATIZSO_TOWER_DOWN(Location.create(2373, 3800, 0),Location.create(2374, 3800, 2)),
|
||||
|
||||
DRAYNOR_SEWER_SOUTHEAST_DOWN(new Location(3118, 3244, 0), new Location(3118, 9643, 0)),
|
||||
DRAYNOR_SEWER_SOUTHEAST_UP(new Location(3118, 9643, 0), new Location(3118, 3243, 0)),
|
||||
|
||||
@@ -22,6 +22,7 @@ import core.game.node.item.GroundItem
|
||||
import core.game.node.item.GroundItemManager
|
||||
import core.game.node.item.Item
|
||||
import core.game.system.task.Pulse
|
||||
import core.game.world.map.Direction
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.RegionManager
|
||||
import core.game.world.map.path.Pathfinder
|
||||
@@ -254,13 +255,50 @@ object ContentAPI {
|
||||
* @param toReplace the GameObject instance we are replacing
|
||||
* @param with the ID of the GameObject we wish to replace toReplace with
|
||||
* @param for_ticks the number of ticks the object should be replaced for. Use -1 for permanent.
|
||||
* @param loc the location to move the new object to if necessary. Defaults to null.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun replaceScenery(toReplace: Scenery, with: Int, for_ticks: Int) {
|
||||
fun replaceScenery(toReplace: Scenery, with: Int, for_ticks: Int, loc: Location? = null) {
|
||||
val newLoc = when(loc){
|
||||
null -> toReplace.location
|
||||
else -> loc
|
||||
}
|
||||
if (for_ticks == -1) {
|
||||
SceneryBuilder.replace(toReplace, toReplace.transform(with))
|
||||
SceneryBuilder.replace(toReplace, toReplace.transform(with,toReplace.rotation,newLoc))
|
||||
} else {
|
||||
SceneryBuilder.replace(toReplace, toReplace.transform(with), for_ticks)
|
||||
SceneryBuilder.replace(toReplace, toReplace.transform(with,toReplace.rotation, newLoc), for_ticks)
|
||||
}
|
||||
toReplace.isActive = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace an object with the given revert timer with the given rotation
|
||||
* @param toReplace the GameObject instance we are replacing
|
||||
* @param with the ID of the GameObject we wish to replace toReplace with
|
||||
* @param for_ticks the number of ticks the object should be replaced for. Use -1 for permanent.
|
||||
* @Param rotation the Direction of the rotation it should use. Direction.NORTH, Direction.SOUTH, etc
|
||||
* @param loc the location to move the new object to if necessary. Defaults to null.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun replaceScenery(toReplace: Scenery, with: Int, for_ticks: Int, rotation: Direction, loc: Location? = null){
|
||||
val newLoc = when(loc){
|
||||
null -> toReplace.location
|
||||
else -> loc
|
||||
}
|
||||
val rot = when(rotation){
|
||||
Direction.NORTH_WEST -> 0
|
||||
Direction.NORTH -> 1
|
||||
Direction.NORTH_EAST -> 2
|
||||
Direction.EAST -> 4
|
||||
Direction.SOUTH_EAST -> 7
|
||||
Direction.SOUTH -> 6
|
||||
Direction.SOUTH_WEST -> 5
|
||||
Direction.WEST -> 3
|
||||
}
|
||||
if (for_ticks == -1) {
|
||||
SceneryBuilder.replace(toReplace, toReplace.transform(with,rot, newLoc))
|
||||
} else {
|
||||
SceneryBuilder.replace(toReplace, toReplace.transform(with,rot,newLoc), for_ticks)
|
||||
}
|
||||
toReplace.isActive = false
|
||||
}
|
||||
@@ -493,6 +531,26 @@ object ContentAPI {
|
||||
return Repository.findNPC(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the spawned scenery from the world map using the given coordinates
|
||||
* @param x the X coordinate to use
|
||||
* @param y the Y coordinate to use
|
||||
* @param z the Z coordinate to use
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getScenery(x: Int, y: Int, z: Int): Scenery?{
|
||||
return RegionManager.getObject(z,x,y)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the spawned scenery from the world map using the given Location object.
|
||||
* @param loc the Location object to use.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getScenery(loc: Location): Scenery?{
|
||||
return RegionManager.getObject(loc)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an NPC within render distance of the refLoc that matches the given ID
|
||||
* @param refLoc the Location to find the closes NPC to
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
package rs09.game.interaction.region
|
||||
|
||||
import api.ContentAPI
|
||||
import core.game.node.entity.player.link.audio.Audio
|
||||
import core.game.system.task.Pulse
|
||||
import core.game.world.map.Direction
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.zone.ZoneBorders
|
||||
import org.rs09.consts.NPCs
|
||||
import rs09.game.camerautils.PlayerCamera
|
||||
import rs09.game.interaction.InteractionListener
|
||||
|
||||
class JatizsoListeners : InteractionListener() {
|
||||
val GATES_CLOSED = intArrayOf(21403,21405)
|
||||
val NORTH_GATE_ZONE = ZoneBorders(2414,3822,2417,3825)
|
||||
val WEST_GATE_ZONE = ZoneBorders(2386,3797,2390,3801)
|
||||
val SOUTH_GAE_ZONE = ZoneBorders(2411,3795,2414,3799)
|
||||
val BELL = 21394
|
||||
val LINES = arrayOf(
|
||||
arrayOf(
|
||||
"YOU WOULDN'T KNOW HOW TO FIGHT A TROLL IF IT CAME UP AND BIT YER ARM OFF",
|
||||
"YAK LOVERS",
|
||||
"CALL THAT A TOWN? I'VE SEEN BETTER HAMLETS!",
|
||||
"AND YOUR FATHER SMELLED OF WINTERBERRIES!",
|
||||
"WOODEN BRIDGES ARE RUBBISH!",
|
||||
"OUR KING'S BETTER THAN YOUR BURGHER!",
|
||||
),
|
||||
arrayOf(
|
||||
"YOU WOULDN'T KNOW HOW TO SHAVE A YAK IF YOUR LIFE DEPENDED ON IT",
|
||||
"MISERABLE LOSERS",
|
||||
"YOUR MOTHER WAS A HAMSTER!",
|
||||
"AT LEAST WE HAVE SOMETHING OTHER THAN SMELLY FISH!",
|
||||
"AT LEAST WE CAN COOK!",
|
||||
)
|
||||
)
|
||||
override fun defineListeners() {
|
||||
on(GATES_CLOSED, SCENERY, "open"){player, node ->
|
||||
if(NORTH_GATE_ZONE.insideBorder(player)){
|
||||
if(node.id == GATES_CLOSED.first()){
|
||||
val other = ContentAPI.getScenery(node.location.transform(1, 0, 0)) ?: return@on true
|
||||
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.EAST)
|
||||
ContentAPI.replaceScenery(other.asScenery(), other.id - 1, -1, Direction.SOUTH)
|
||||
} else {
|
||||
val other = ContentAPI.getScenery(node.location.transform(-1, 0, 0)) ?: return@on true
|
||||
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.SOUTH)
|
||||
ContentAPI.replaceScenery(other.asScenery(), other.id, -1, Direction.EAST)
|
||||
}
|
||||
|
||||
ContentAPI.playAudio(player, ContentAPI.getAudio(81))
|
||||
} else if(WEST_GATE_ZONE.insideBorder(player)){
|
||||
if(node.id == GATES_CLOSED.first()){
|
||||
val other = ContentAPI.getScenery(node.location.transform(0, 1, 0)) ?: return@on true
|
||||
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.WEST)
|
||||
ContentAPI.replaceScenery(other.asScenery(), other.id + 1, -1, Direction.NORTH)
|
||||
} else {
|
||||
val other = ContentAPI.getScenery(node.location.transform(0, -1, 0)) ?: return@on true
|
||||
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.NORTH)
|
||||
ContentAPI.replaceScenery(other.asScenery(), other.id + 1, -1, Direction.WEST)
|
||||
}
|
||||
} else if(SOUTH_GAE_ZONE.insideBorder(player)){
|
||||
if(node.id == GATES_CLOSED.first()){
|
||||
val other = ContentAPI.getScenery(node.location.transform(-1, 0, 0)) ?: return@on true
|
||||
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.SOUTH)
|
||||
ContentAPI.replaceScenery(other.asScenery(), other.id - 1, -1, Direction.EAST)
|
||||
} else {
|
||||
val other = ContentAPI.getScenery(node.location.transform(1, 0, 0)) ?: return@on true
|
||||
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.EAST)
|
||||
ContentAPI.replaceScenery(other.asScenery(), other.id, -1, Direction.SOUTH)
|
||||
}
|
||||
}
|
||||
ContentAPI.playAudio(player, ContentAPI.getAudio(81))
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(NPCs.GUARD_5489, NPC, "watch-shouting"){player, node ->
|
||||
ContentAPI.lock(player, 200)
|
||||
ContentAPI.face(node.asNpc(), Location.create(2371, 3801, 2))
|
||||
node.asNpc().isRespawn = false
|
||||
ContentAPI.submitIndividualPulse(player, object : Pulse(4){
|
||||
var id = node.id
|
||||
var counter = 0
|
||||
val other = ContentAPI.findLocalNPC(player, getOther(node.id))
|
||||
|
||||
override fun start() {
|
||||
other?.isRespawn = false
|
||||
}
|
||||
|
||||
override fun pulse(): Boolean {
|
||||
val npc = ContentAPI.findLocalNPC(player, id) ?: return false
|
||||
val index = when(id){
|
||||
node.id -> 0
|
||||
else -> 1
|
||||
}
|
||||
if(index == 1 && counter == 5) return true
|
||||
ContentAPI.sendChat(npc, LINES[index][counter])
|
||||
if(npc.id != node.id) counter++
|
||||
id = getOther(id)
|
||||
return false
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
ContentAPI.unlock(player)
|
||||
other?.isRespawn = true
|
||||
node.asNpc().isRespawn = true
|
||||
super.stop()
|
||||
}
|
||||
|
||||
fun getOther(npc: Int): Int{
|
||||
return when(npc){
|
||||
NPCs.GUARD_5489 -> NPCs.GUARD_5490
|
||||
NPCs.GUARD_5490 -> NPCs.GUARD_5489
|
||||
else -> NPCs.GUARD_5489
|
||||
}
|
||||
}
|
||||
})
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(BELL, SCENERY, "ring-bell"){player, _ ->
|
||||
ContentAPI.playAudio(player, Audio(15))
|
||||
ContentAPI.sendMessage(player, "You ring the warning bell, but everyone ignores it!")
|
||||
return@on true
|
||||
}
|
||||
|
||||
setDest(NPC, NPCs.MAGNUS_GRAM_5488){_ ->
|
||||
return@setDest Location.create(2416, 3801, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package rs09.game.node.entity.npc.other
|
||||
|
||||
import api.ContentAPI
|
||||
import core.game.node.entity.npc.AbstractNPC
|
||||
import core.game.world.map.Location
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class FremennikGuards : AbstractNPC {
|
||||
//Constructor spaghetti because Arios I guess
|
||||
constructor() : super(NPCs.GUARD_5489, null, true) {}
|
||||
private constructor(id: Int, location: Location) : super(id, location) {}
|
||||
|
||||
override fun construct(id: Int, location: Location, vararg objects: Any?): AbstractNPC {
|
||||
return FremennikGuards(id, location)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.GUARD_5489, NPCs.GUARD_5490)
|
||||
}
|
||||
|
||||
override fun tick() {
|
||||
if(this.isRespawn) {
|
||||
when (id) {
|
||||
NPCs.GUARD_5489 -> if (ContentAPI.getWorldTicks() % 5 == 0) ContentAPI.sendChat(this, "JATIZSO!")
|
||||
NPCs.GUARD_5490 -> if (ContentAPI.getWorldTicks() % 8 == 0) ContentAPI.sendChat(this, "NEITIZNOT!")
|
||||
}
|
||||
}
|
||||
super.tick()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user