Merge branch 'first-resort-pools' into 'master'

Draft: Ooglog Pools

See merge request 2009scape/2009scape!2053
This commit is contained in:
Oven Bread 2025-11-30 03:00:03 +00:00
commit 88ed9bb2bd
2 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,4 @@
package content.region.kandarin.feldip.quest.asafirstresort
class AsAFirstResort {
}

View file

@ -0,0 +1,99 @@
package content.region.kandarin.feldip.quest.asafirstresort
import content.data.Quests
import core.api.*
import core.game.interaction.InteractionListener
import core.game.node.Node
import core.game.node.entity.impl.ForceMovement
import core.game.node.entity.player.Player
import core.game.world.map.Direction
import core.game.world.map.Location
import core.game.world.map.zone.ZoneBorders
import core.game.world.update.flag.context.Animation
import org.rs09.consts.Scenery
class AsAFirstResortListeners : InteractionListener, LoginListener {
companion object {
val poolRocks = intArrayOf(
// Bandos Pool Rocks
Scenery.ROCKS_29057,
Scenery.ROCKS_29058,
// Sulphur Spring Rocks
Scenery.ROCKS_29018,
// Salt-Water Spring Rocks
Scenery.ROCKS_29031,
Scenery.ROCKS_29032,
// Thermal Bath Rocks
Scenery.ROCKS_29044,
Scenery.ROCKS_29045,
// Mud Bath Rocks
Scenery.ROCKS_29004,
Scenery.ROCKS_29005,
)
val jumpIntoText = arrayOf(
"You jump into the limpid, salty waters."
)
val getOutText = arrayOf(
"You feel energised and hastened after your relaxing soak."
)
val bandosPoolArea: ZoneBorders = ZoneBorders(2522, 2842, 2527, 2848, 0)
val sulphurSpringArea: ZoneBorders = ZoneBorders(2533, 2853, 2542, 2856, 0)
val saltwaterSpringArea: ZoneBorders = ZoneBorders(2555, 2861, 2559, 2866, 0)
val thermalBathArea: ZoneBorders = ZoneBorders(2572, 2863, 2577, 2866, 0)
val mudBathArea: ZoneBorders = ZoneBorders(2592, 2859, 2600, 2862, 0)
val allPoolAreas = arrayOf(bandosPoolArea, sulphurSpringArea, saltwaterSpringArea, thermalBathArea, mudBathArea)
fun inBorders(player: Player): Boolean {
for (border in allPoolAreas) {
if (border.insideBorder(player)) {
return true
}
}
return false
}
fun animateTransition(player: Player, node: Node) {
lock(player, 3)
val newLoc = node.location.transform(Location.getDelta(player.location, node.location)) // 1 off from the NODE's LOCATION not from player location
val direction = Direction.getDirection(player.location, node.location)
if (inBorders(player)){
// Getting out.
ForceMovement.run(player, node.location, newLoc, Animation(8694), Animation(8694), direction, 8)
} else {
// Getting in.
ForceMovement.run(player, player.location, newLoc, Animation(8698), Animation(8698), direction, 13)
}
if (inBorders(player)) {
player.appearance.setDefaultAnimations()
player.appearance.sync()
} else {
player.appearance.setAnimations(Animation(1139)) // THIS WAS TRIAL AND ERROR AND WAS FUCKING HARD TO FIND
player.appearance.sync()
}
}
}
override fun login(player: Player) {
setVarbit(player, 4349, 3)
setVarbit(player, 4350, 3)
setVarbit(player, 4351, 3)
setVarbit(player, 4352, 3)
setVarbit(player, 4353, 3)
if (hasRequirement(player, Quests.AS_A_FIRST_RESORT, false)) {
}
}
override fun defineListeners() {
on(poolRocks, SCENERY, "climb-over") { player, node ->
animateTransition(player, node)
return@on true
}
}
}