listener logic is now proper with no arios hacks. help me player name, you're my only hope.

This commit is contained in:
Aidan Schieuer 2026-04-25 02:31:03 -05:00 committed by aidan
parent 4424a6fc39
commit 94257a93c2

View file

@ -987,7 +987,6 @@ class EW2Listeners : InteractionListener {
return@on true
}
// todo see below, note that the pin 2 cannot be taken from because it overlaps with pin 1 and our limited engine can't find it.
// taking the cogs from the pins
on(cogRange, IntType.SCENERY, "take") { player, node ->
// determine what to take
@ -1045,24 +1044,7 @@ class EW2Listeners : InteractionListener {
return@onUseWith true
}
//todo Since Arios is shit (https://gitlab.com/2009scape/2009scape/-/issues/1841) we can't act directly with pin 2.
// I have commented out what would be the correct function below in case the issue ever gets fixed.
// As a hack, the player is only allowed to place the medium cog below the small cog.
// You can't remove the medium cog because it throws an exception (resetting the varbit will 'remove' the cog). kill me.
onUseWith(IntType.SCENERY, intArrayOf(Items.MEDIUM_COG_9725), 18673) { player, item, _ ->
when(item.id) {
Items.MEDIUM_COG_9725 -> {
setVarbit(player, EW2CogVarbit2, 2, true)
sendItemDialogue(player, item, "You put the medium cog onto the shaft.")
animate(player, 537)
removeItem(player, item)
}
}
return@onUseWith true
}
/*
// use cog with pin 2
// use cog with pin 2 // This listener brought to you by Player Name and his famous work with Arios RegionChunk fixing. Without that work it wouldn't have been possible to interact with this pin.
// pin 2: 2656: val 0 is scenery 18664 (pin). val 1 is scenery 18667 (small cog). val 2 is scenery 18668 (med cog). val 3 is scenery 18669 (large cog)
onUseWith(IntType.SCENERY, intArrayOf(Items.SMALL_COG_9726, Items.MEDIUM_COG_9725, Items.LARGE_COG_9724), Scenery.PIN_18664) { player, item, _ ->
when(item.id) {
@ -1087,7 +1069,6 @@ class EW2Listeners : InteractionListener {
}
return@onUseWith true
}
*/
// use cog with pin 3
// pin 3: 2657: val 0 is scenery 18666 (pin). val 1 is scenery 18670 (small cog). val 2 is scenery 18671 (med cog). val 3 is scenery 18672 (large cog)
@ -1320,9 +1301,13 @@ class EW2Listeners : InteractionListener {
return@setDest Location.create(1953, 5167, 3)
}
// the double stacked pins and the cogs on them. todo probably remove these later
//setDest(IntType.SCENERY, intArrayOf(Scenery.PIN_18665, Scenery.PIN_18666, Scenery.COG_18673, Scenery.COG_18674, Scenery.COG_18675, Scenery.COG_18667, Scenery.COG_18668, Scenery.COG_18669), "use") { _, _ ->
// return@setDest Location.create(1958, 5157, 2)
//}
// the double stacked pins and the cogs on them.
setDest(IntType.SCENERY, intArrayOf(
Scenery.PIN_18664, Scenery.PIN_18665,
Scenery.COG_18673, Scenery.COG_18674, Scenery.COG_18675,
Scenery.COG_18667, Scenery.COG_18668, Scenery.COG_18669
), "use","take") { _, _ ->
return@setDest Location.create(1958, 5157, 2)
}
}
}