Add: JSON Monolith #1

This commit is contained in:
skelsoft
2021-10-13 02:05:56 +00:00
committed by Ceikry
parent c712cd50d7
commit f53dfc0fab
18 changed files with 2634 additions and 7233 deletions
@@ -1,5 +1,6 @@
package rs09.game.node.entity.skill.agility
import api.ContentAPI
import core.cache.def.impl.ItemDefinition
import core.cache.def.impl.NPCDefinition
import core.cache.def.impl.SceneryDefinition
@@ -61,14 +62,22 @@ class BarbarianOutpostCourse
player.packetDispatch.sendMessage("You cannot climb from this side.")
}
val flag = if (node.location == Location(2536, 3553, 0)) 4 else if (node.location == Location(2539, 3553, 0)) 5 else 6
player.packetDispatch.sendMessage("You climb the low wall...")
ContentAPI.sendMessage(player, "You climb the low wall...")
AgilityHandler.forceWalk(player, flag, node.location.transform(-1, 0, 0), node.location.transform(1, 0, 0), Animation.create(839), 10, 13.5, null)
}
455 -> player.barcrawlManager.read()
385 -> {
player.packetDispatch.sendMessage("The scorpion stings you!")
ContentAPI.sendMessage(player, "The scorpion stings you!")
player.impactHandler.manualHit(player, 3, HitsplatType.NORMAL)
}
386 -> {
ContentAPI.sendMessage(player, "The scorpion stings you!")
player.impactHandler.manualHit(player, 3, HitsplatType.NORMAL)
}
387 -> {
ContentAPI.sendMessage(player, "The scorpion stings you!")
player.impactHandler.manualHit(player, 3, HitsplatType.NORMAL)
}
}
return true
}
@@ -80,15 +89,15 @@ class BarbarianOutpostCourse
*/
private fun handleRopeSwing(player: Player, `object`: Scenery) {
if (player.location.y < 3554) {
player.packetDispatch.sendMessage("You cannot do that from here.")
ContentAPI.sendMessage(player, "You cannot do that from here.")
return
}
if (ropeDelay > GameWorld.ticks) {
player.packetDispatch.sendMessage("The rope is being used.")
ContentAPI.sendMessage(player, "The rope is being used.")
return
}
if (AgilityHandler.hasFailed(player, 1, 0.1)) {
AgilityHandler.fail(player, 0, Location.create(2549, 9951, 0), null, getHitAmount(player), "You slip and fall to the pit bellow.")
AgilityHandler.fail(player, 0, Location.create(2549, 9951, 0), null, getHitAmount(player), "You slip and fall to the pit below.")
return
}
ropeDelay = GameWorld.ticks + 2
@@ -104,7 +113,7 @@ class BarbarianOutpostCourse
private fun handleLogBalance(player: Player, `object`: Scenery) {
val failed = AgilityHandler.hasFailed(player, 1, 0.5)
val end = if (failed) Location.create(2545, 3546, 0) else Location.create(2541, 3546, 0)
player.packetDispatch.sendMessage("You walk carefully across the slippery log...")
ContentAPI.sendMessage(player, "You walk carefully across the slippery log...")
AgilityHandler.walk(player, if (failed) -1 else 1, Location.create(2551, 3546, 0), end, Animation.create(155), if (failed) 0.0 else 13.5, if (failed) null else "...You make it safely to the other side.")
if (failed) {
AgilityHandler.walk(player, -1, player.location, Location.create(2545, 3546, 0), Animation.create(155), 0.0, null)
@@ -152,9 +161,9 @@ class BarbarianOutpostCourse
val failed = AgilityHandler.hasFailed(player, 1, 0.3)
val end = if (failed) Location.create(2534, 3547, 1) else Location.create(2532, 3547, 1)
AgilityHandler.walk(player, if (failed) -1 else 3, Location.create(2536, 3547, 1), end, Animation.create(157), if (failed) 0.0 else 22.0, if (failed) null else "You skillfully edge across the gap.")
player.packetDispatch.sendMessage("You put your foot on the ledge and try to edge across..")
ContentAPI.sendMessage(player, "You put your foot on the ledge and try to edge across..")
if (failed) {
AgilityHandler.fail(player, 3, Location.create(2534, 3545, 0), Animation(760), getHitAmount(player), "You slip and fall to the pit bellow.")
AgilityHandler.fail(player, 3, Location.create(2534, 3545, 0), Animation(760), getHitAmount(player), "You slip and fall to the pit below.")
return
}
}
@@ -169,6 +178,8 @@ class BarbarianOutpostCourse
SceneryDefinition.forId(1948).handlers["option:climb-over"] = this
ItemDefinition.forId(455).handlers["option:read"] = this
NPCDefinition.forId(385).handlers["option:pick-up"] = this
NPCDefinition.forId(386).handlers["option:pick-up"] = this
NPCDefinition.forId(387).handlers["option:pick-up"] = this
PluginManager.definePlugin(BarbarianGuardDialogue())
}
@@ -226,7 +237,7 @@ class BarbarianOutpostCourse
}
1 -> when (buttonId) {
1 -> {
player("I want to come throught his gate.")
player("I want to come through this gate.")
stage = 5
}
2 -> {
@@ -1,5 +1,6 @@
package rs09.game.node.entity.skill.agility
import api.ContentAPI
import core.cache.def.impl.SceneryDefinition
import core.game.node.Node
import core.game.node.scenery.Scenery
@@ -34,41 +35,41 @@ class GnomeStrongholdCourse
when (`object`.id) {
2295 -> {
TRAINERS[0]!!.sendChat("Okay get over that log, quick quick!")
player.packetDispatch.sendMessage("You walk carefully across the slippery log...")
ContentAPI.sendMessage(player, "You walk carefully across the slippery log...")
AgilityHandler.walk(player, 0, Location.create(2474, 3436, 0), Location.create(2474, 3429, 0), Animation.create(155), 7.5, "...You make it safely to the other side.")
return true
}
2285 -> {
TRAINERS[1]!!.sendChat("Move it, move it, move it!")
player.packetDispatch.sendMessage("You climb the netting...")
ContentAPI.sendMessage(player, "You climb the netting...")
AgilityHandler.climb(player, 1, Animation.create(828), `object`.location.transform(0, -1, 1), 7.5, null)
return true
}
35970 -> {
TRAINERS[2]!!.sendChat("That's it - straight up.")
player.packetDispatch.sendMessage("You climb the tree..")
ContentAPI.sendMessage(player, "You climb the tree..")
AgilityHandler.climb(player, 2, Animation.create(828), Location.create(2473, 3420, 2), 5.0, "...To the platform above.")
return true
}
2312 -> {
TRAINERS[3]!!.sendChat("Come on scaredy cat, get across that rope!")
player.packetDispatch.sendMessage("You carefully cross the tightrope.")
ContentAPI.sendMessage(player, "You carefully cross the tightrope.")
AgilityHandler.walk(player, 3, Location.create(2477, 3420, 2), Location.create(2483, 3420, 2), Animation.create(155), 7.5, null)
return true
}
4059 -> {
player.packetDispatch.sendMessage("You can't do that from here.")
ContentAPI.sendMessage(player, "You can't do that from here.")
return true
}
2314, 2315 -> {
player.packetDispatch.sendMessage("You climb down the tree..")
ContentAPI.sendMessage(player, "You climb down the tree..")
AgilityHandler.climb(player, 4, Animation.create(828), Location.create(2487, 3420, 0), 5.0, "You land on the ground.")
return true
}
2286 -> {
TRAINERS[4]!!.sendChat("My Granny can move faster than you.")
player.faceLocation(player.location.transform(0, 2, 0))
player.packetDispatch.sendMessage("You climb the netting...")
ContentAPI.sendMessage(player, "You climb the netting...")
AgilityHandler.climb(player, 5, Animation.create(828), player.location.transform(0, 2, 0), 7.5, null)
return true
}
@@ -76,11 +77,11 @@ class GnomeStrongholdCourse
val index = if (`object`.id == 154) 0 else 1 //If the player clicks on the left pipe, set index to 0, otherwise 1
val x = 2484 + index * 3 //change the x coordinates for walking/animations depending on index multiplier
if (`object`.location.y == 3435) {
player.packetDispatch.sendMessage("You can't do that from here.")
ContentAPI.sendMessage(player, "You can't do that from here.")
return true
}
if (USED_PIPES[index] > GameWorld.ticks) {
player.packetDispatch.sendMessage("The pipe is being used.")
ContentAPI.sendMessage(player, "The pipe is being used.")
return true
}
USED_PIPES[index] = GameWorld.ticks + 10
@@ -76,8 +76,8 @@ class WildernessCourse
2 -> {
val end = if (fail) Location.create(2998, 3924, 0) else if (`object`.id < 2309) Location.create(2998, 3917, 0) else Location.create(2998, 3930, 0)
val start = if (`object`.id < 2309) player.location else Location.create(2998, 3917, 0)
player.packetDispatch.sendMessage("You go through the gate and try to edge over the ridge...")
AgilityHandler.walk(player, -1, start, end, Animation.create(155), if (fail) 0.0 else 15.00, if (fail) "You loose your footing and fail into the wolf pit." else "You skillfully balance across the ridge...")
ContentAPI.sendMessage(player, "You go through the gate and try to edge over the ridge...")
AgilityHandler.walk(player, -1, start, end, Animation.create(155), if (fail) 0.0 else 15.00, if (fail) "You lose your footing and fail into the wolf pit." else "You skillfully balance across the ridge...")
}
9 -> {
if (fail) {
@@ -104,7 +104,7 @@ class WildernessCourse
*/
private fun handlePipe(player: Player, `object`: Scenery) {
if (`object`.location.y == 3948) {
player.packetDispatch.sendMessage("You can't do that from here.")
ContentAPI.sendMessage(player, "You can't do that from here.")
return
}
if (player.skills.getLevel(Skills.AGILITY) < 49) {
@@ -153,15 +153,15 @@ class WildernessCourse
*/
private fun handleRopeSwing(player: Player, `object`: Scenery) {
if (player.location.y < 3554) {
player.packetDispatch.sendMessage("You cannot do that from here.")
ContentAPI.sendMessage(player, "You cannot do that from here.")
return
}
if (ropeDelay > GameWorld.ticks) {
player.packetDispatch.sendMessage("The rope is being used.")
ContentAPI.sendMessage(player, "The rope is being used.")
return
}
if (AgilityHandler.hasFailed(player, 1, 0.1)) {
AgilityHandler.fail(player, 0, Location.create(3005, 10357, 0), null, getHitAmount(player), "You slip and fall to the pit bellow.")
AgilityHandler.fail(player, 0, Location.create(3005, 10357, 0), null, getHitAmount(player), "You slip and fall to the pit below.")
return
}
ropeDelay = GameWorld.ticks + 2
@@ -206,7 +206,7 @@ class WildernessCourse
private fun handleLogBalance(player: Player, `object`: Scenery) {
val failed = AgilityHandler.hasFailed(player, 1, 0.5)
val end = if (failed) Location.create(2998, 3945, 0) else Location.create(2994, 3945, 0)
player.packetDispatch.sendMessage("You walk carefully across the slippery log...")
ContentAPI.sendMessage(player, "You walk carefully across the slippery log...")
AgilityHandler.walk(player, if (failed) -1 else 3, player.location, end, Animation.create(155), if (failed) 0.0 else 20.0, if (failed) null else "You skillfully edge across the gap.")
if (failed) {
GameWorld.Pulser.submit(object : Pulse(5, player) {