mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-27 21:35:13 -06:00
simplified some, converted to contentAPI, general QA review, added camera angles/cutscene
This commit is contained in:
parent
e2baea400d
commit
373677f492
5 changed files with 372 additions and 353 deletions
|
|
@ -0,0 +1,89 @@
|
|||
package content.region.kandarin.seers.quest.elementalworkshop2
|
||||
|
||||
import content.data.Quests
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.EXTRACTOR_BAD
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.EXTRACTOR_BAD_GFX
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.EXTRACTOR_GOOD
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.EXTRACTOR_GOOD_GFX
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.EXTR_GUN
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.toInstance
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Session.Companion.EW2_REGION
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.ElementalWorkshop2.Companion.EW2ExtractorGun
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.ElementalWorkshop2.Companion.EW2StageVarbit
|
||||
import core.api.*
|
||||
import core.game.activity.Cutscene
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.update.flag.context.Animation
|
||||
import org.rs09.consts.Sounds
|
||||
|
||||
/**
|
||||
* The extractor hat cutscene in EW2
|
||||
*/
|
||||
|
||||
class EW2Cutscene(player: Player, good: Boolean) : Cutscene(player) {
|
||||
override fun setup() {
|
||||
setExit(toInstance(player, Location.create(1961, 5150, 0)))
|
||||
loadRegion(EW2_REGION)
|
||||
}
|
||||
|
||||
val successfulExtract = good
|
||||
|
||||
override fun runStage(stage: Int) {
|
||||
when(stage) {
|
||||
0 -> {
|
||||
teleport(player, 41, 30)
|
||||
moveCamera(37, 25, 350)
|
||||
rotateCamera(42, 29)
|
||||
timedUpdate(0)
|
||||
}
|
||||
|
||||
1 -> {
|
||||
face(player, player.location.transform(1, 0, 0))
|
||||
timedUpdate(0)
|
||||
}
|
||||
|
||||
2 -> {
|
||||
teleport(player, 42, 30)
|
||||
if (successfulExtract) {
|
||||
visualize(player, EXTRACTOR_GOOD, EXTRACTOR_GOOD_GFX)
|
||||
playAudio(player, Sounds.EW2_EXTRACTOR_OPERATION_3166)
|
||||
val gun = getScenery(base.transform(42, 28, 0))
|
||||
if (gun != null) animateScenery(gun, EXTR_GUN)
|
||||
timedUpdate(Animation(EXTRACTOR_GOOD).duration)
|
||||
} else {
|
||||
visualize(player, EXTRACTOR_BAD, EXTRACTOR_BAD_GFX)
|
||||
playAudio(player, Sounds.EW2_EXTRACTOR_ZAP_3173)
|
||||
timedUpdate(Animation(EXTRACTOR_BAD).duration)
|
||||
}
|
||||
}
|
||||
|
||||
3 -> {
|
||||
teleport(player, 41, 30)
|
||||
if (successfulExtract) {
|
||||
// make a mind bar
|
||||
setVarbit(player, EW2ExtractorGun, 2, true)
|
||||
|
||||
// drain magic
|
||||
adjustLevel(player, Skills.MAGIC, -20)
|
||||
sendMessage(player, "You feel magically weakened.")
|
||||
|
||||
// advance quest
|
||||
if (getQuestStage(player, Quests.ELEMENTAL_WORKSHOP_II) <= 9) {
|
||||
setQuestStage(player, Quests.ELEMENTAL_WORKSHOP_II, 10)
|
||||
setVarbit(player, EW2StageVarbit, 10, true)
|
||||
}
|
||||
} else {
|
||||
impact(player, 4)
|
||||
sendMessage(player, "The extractor hat shocks you!")
|
||||
}
|
||||
timedUpdate(1)
|
||||
}
|
||||
|
||||
4 -> {
|
||||
endWithoutFade { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -8,6 +8,7 @@ import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Compa
|
|||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.syncTank
|
||||
import content.region.kandarin.seers.quest.elementalworkshop2.EW2Listeners.Companion.syncTankDoor
|
||||
import core.api.*
|
||||
import core.game.interaction.QueueStrength
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.Location
|
||||
|
|
@ -20,6 +21,10 @@ import core.game.world.map.zone.ZoneBorders
|
|||
|
||||
class EW2Session(val player: Player? = null) : MapArea {
|
||||
|
||||
companion object {
|
||||
const val EW2_REGION = 7760
|
||||
}
|
||||
|
||||
lateinit var region: DynamicRegion
|
||||
lateinit var base: Location
|
||||
|
||||
|
|
@ -32,12 +37,11 @@ class EW2Session(val player: Player? = null) : MapArea {
|
|||
fun start() {
|
||||
val p = player ?: return
|
||||
|
||||
region = DynamicRegion.create(7760)
|
||||
region = DynamicRegion.create(EW2_REGION)
|
||||
base = region.baseLocation
|
||||
|
||||
zone.register(getRegionBorders(region.id))
|
||||
setAttribute(p, "ew2-session", this)
|
||||
teleport(p, base.transform(35, 35, 2))
|
||||
|
||||
// logout listener returns player to the EW1 workshop
|
||||
registerLogoutListener(p, "ew2-logout") {
|
||||
|
|
@ -55,6 +59,12 @@ class EW2Session(val player: Player? = null) : MapArea {
|
|||
syncTankDoor(p)
|
||||
syncFan(p)
|
||||
syncCogs(p)
|
||||
|
||||
// teleport in after the workshop is ready
|
||||
queueScript(player, 1, QueueStrength.SOFT) {
|
||||
teleport(p, base.transform(35, 35, 2))
|
||||
return@queueScript true
|
||||
}
|
||||
}
|
||||
|
||||
// clean up the instanced area
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ class ElementalWorkshop2 : Quest(Quests.ELEMENTAL_WORKSHOP_II, 53, 52, 1, EW2Sta
|
|||
line++
|
||||
}
|
||||
|
||||
// stage 8, went through the mind door
|
||||
// stage 8, went through the mind door. I skip using this due to lack of source
|
||||
/*
|
||||
if (stage >= 8) {
|
||||
line(player, "", line++, stage > 8)
|
||||
|
|
@ -238,11 +238,15 @@ class ElementalWorkshop2 : Quest(Quests.ELEMENTAL_WORKSHOP_II, 53, 52, 1, EW2Sta
|
|||
// these varps wipes all the varbits
|
||||
setVarp(player, EW2Varp1, 0, true)
|
||||
setVarp(player, EW2Varp2, 0, true)
|
||||
|
||||
// remove attributes
|
||||
removeAttribute(player, attrJigged)
|
||||
removeAttribute(player, attrDipped)
|
||||
removeAttribute(player, attrFlattened)
|
||||
removeAttribute(player, attrWatered)
|
||||
removeAttribute(player, attrWinded)
|
||||
|
||||
// sync the quest tab
|
||||
player.getQuestRepository().syncronizeTab(player)
|
||||
super.reset(player)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,21 +241,27 @@ class JunctionBoxInterface : InterfaceListener {
|
|||
1 -> when (endBtn) { // Top Left
|
||||
b4 -> 0; b5 -> 6; b6 -> 7; b2 -> 8; b3 -> 9; else -> -1
|
||||
}
|
||||
|
||||
2 -> when (endBtn) { // Top Mid
|
||||
b5 -> 1; b4 -> 10; b6 -> 11; b1 -> 8; b3 -> 12; else -> -1
|
||||
}
|
||||
|
||||
3 -> when (endBtn) { // Top Right
|
||||
b6 -> 2; b4 -> 13; b5 -> 14; b1 -> 9; b2 -> 12; else -> -1
|
||||
}
|
||||
|
||||
4 -> when (endBtn) { // Bottom Left
|
||||
b1 -> 0; b5 -> 3; b6 -> 4; b2 -> 10; b3 -> 13; else -> -1
|
||||
}
|
||||
|
||||
5 -> when (endBtn) { // Bottom Mid
|
||||
b2 -> 1; b4 -> 3; b6 -> 5; b1 -> 6; b3 -> 14; else -> -1
|
||||
}
|
||||
|
||||
6 -> when (endBtn) { // Bottom Right
|
||||
b3 -> 2; b4 -> 4; b5 -> 5; b1 -> 7; b2 -> 11; else -> -1
|
||||
}
|
||||
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue