the extractor chair area is no longer instanced

This commit is contained in:
aidan 2026-07-12 12:09:05 -05:00
parent d935f4ea72
commit 5ecb0e4fb4
2 changed files with 19 additions and 13 deletions

View file

@ -691,11 +691,8 @@ class EW2Listeners : InteractionListener {
on(Scenery.HATCH_18596, IntType.SCENERY, "climb-down") { player, _ ->
sendMessage(player, "You climb down the stairs.")
// this is the non-instanced area
//teleport(player, location(1955, 5155, 2))
// start the instanced workshop session
EW2Session(player).start()
EW2Session(player).start(Location.create(1955, 5155, 2))
// advance quest stage
if (getQuestStage(player, Quests.ELEMENTAL_WORKSHOP_II) == 4) {
@ -707,6 +704,7 @@ class EW2Listeners : InteractionListener {
// stairs back up to EW1
on(Scenery.STAIRS_18598, IntType.SCENERY, "climb-up") { player, _ ->
// non-instanced
teleport(player, location(2720, 9892, 0))
sendMessage(player, "You climb up the stairs.")
return@on true
@ -714,15 +712,19 @@ class EW2Listeners : InteractionListener {
// stairs to EW2 lower level
on(Scenery.STAIRWELL_18597, IntType.SCENERY, "climb-down") { player, _ ->
teleport(player, toInstance(player,location(1948, 5158, 0)))
// non-instanced
teleport(player, location(1948, 5158, 0))
sendMessage(player, "You climb down the stairs.")
return@on true
}
// stairs from EW2 lower level back up to EW2 main level
on(Scenery.STAIRS_18599, IntType.SCENERY, "climb-up") { player, _ ->
teleport(player, toInstance(player,location(1948, 5157, 2)))
sendMessage(player, "You climb up the stairs.")
// start the instanced workshop session
EW2Session(player).start(Location.create(1948, 5157, 2))
return@on true
}
@ -1332,7 +1334,8 @@ class EW2Listeners : InteractionListener {
syncFan(player)
syncCogs(player)
}
} else { // allCogs != 57, cogs are not correct todo Authentically there is an extra check where the fan can start backwards, but I'm simplifying it for my sanity. this would require reverse cog anims, too
} else { // allCogs != 57, cogs are not correct
// todo Authentically there is an extra check where the fan can start backwards, but I'm simplifying it for my sanity. this would require reverse cog anims, too
sendDialogue(player, "The machine starts up, but the fan does not blow.")
playAudio(player, Sounds.EW2_MACHINE_RUMBLE_3175)
}
@ -1344,7 +1347,7 @@ class EW2Listeners : InteractionListener {
* ------------------------- */
// use bar with extractor gun
onUseWith(IntType.SCENERY, Items.PRIMED_BAR_9727, EXTRACTOR_WRAPPER, Scenery.EXTRACTOR_GUN_18693) { player, used, _ ->
onUseWith(IntType.SCENERY, Items.PRIMED_BAR_9727, Scenery.EXTRACTOR_GUN_18693) { player, used, _ ->
if (removeItem(player, used as Item)) {
setVarbit(player, EW2ExtractorGun, 1, true)
sendItemDialogue(player, Items.PRIMED_BAR_9727, "You place the primed bar under the device.")
@ -1357,7 +1360,7 @@ class EW2Listeners : InteractionListener {
}
// take primed bar from the extractor gun
on(intArrayOf(EXTRACTOR_WRAPPER, Scenery.EXTRACTOR_GUN_18694), IntType.SCENERY, "take-from") { player, _ ->
on(intArrayOf(Scenery.EXTRACTOR_GUN_18694), IntType.SCENERY, "take-from") { player, _ ->
addItemOrDrop(player, Items.PRIMED_BAR_9727)
setVarbit(player, EW2ExtractorGun, 0, true)
sendItemDialogue(player, Items.PRIMED_BAR_9727, "You take the primed bar.")
@ -1365,7 +1368,7 @@ class EW2Listeners : InteractionListener {
}
// take mind bar from the extractor gun
on(intArrayOf(EXTRACTOR_WRAPPER, Scenery.EXTRACTOR_GUN_18695), IntType.SCENERY, "take-from") { player, _ ->
on(intArrayOf(Scenery.EXTRACTOR_GUN_18695), IntType.SCENERY, "take-from") { player, _ ->
addItemOrDrop(player, Items.ELEMENTAL_MIND_BAR_9728)
setVarbit(player, EW2ExtractorGun, 0, true)
sendItemDialogue(player, Items.ELEMENTAL_MIND_BAR_9728, "You take the elemental mind bar.")

View file

@ -7,6 +7,7 @@ import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Compa
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.syncSteamPress
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.syncTank
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.syncTankDoor
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.toInstance
import core.api.*
import core.game.interaction.QueueStrength
import core.game.node.entity.Entity
@ -33,8 +34,8 @@ class EW2Session(val player: Player? = null) : MapArea {
return emptyArray()
}
// start() is triggered by the listener for Scenery.HATCH_18596
fun start() {
// start() is triggered by the listener for Scenery.HATCH_18596 and Scenery.STAIRS_18599
fun start(loc: Location) {
val p = player ?: return
region = DynamicRegion.create(EW2_REGION)
@ -60,9 +61,11 @@ class EW2Session(val player: Player? = null) : MapArea {
syncFan(p)
syncCogs(p)
val startLoc = toInstance(player, loc)
// teleport in after the workshop is ready
queueScript(player, 1, QueueStrength.SOFT) {
teleport(p, base.transform(35, 35, 2))
teleport(p, startLoc)
return@queueScript true
}
}