mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-01 14:39:13 -06:00
altar stuff
This commit is contained in:
parent
7f3e4283cd
commit
50172d052c
1 changed files with 27 additions and 30 deletions
|
|
@ -1,29 +1,11 @@
|
|||
package content.region.misthalin.lumbridge.quest.therestlessghost;
|
||||
|
||||
import content.data.Quests
|
||||
import core.api.addItem
|
||||
import core.api.animate
|
||||
import core.api.finishQuest
|
||||
import core.api.freeSlots
|
||||
import core.api.getQuestStage
|
||||
import core.api.inBank
|
||||
import core.api.inEquipmentOrInventory
|
||||
import core.api.inInventory
|
||||
import core.api.isQuestComplete
|
||||
import core.api.lock
|
||||
import core.api.playGlobalAudio
|
||||
import core.api.queueScript
|
||||
import core.api.removeItem
|
||||
import core.api.sendDialogue
|
||||
import core.api.sendItemDialogue
|
||||
import core.api.sendMessage
|
||||
import core.api.setAttribute
|
||||
import core.api.setQuestStage
|
||||
import core.api.stopExecuting
|
||||
import core.api.visualize
|
||||
import core.api.*
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.combat.CombatStyle
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.scenery.SceneryBuilder
|
||||
|
|
@ -57,18 +39,30 @@ class RestlessGhostListeners : InteractionListener {
|
|||
return restlessGhostNPC
|
||||
}
|
||||
|
||||
//client side only visual, removes the skeleton on ground, resets in ~2mins
|
||||
private fun animSkeleAlive(player: Player, skeleScenery: core.game.node.scenery.Scenery) {
|
||||
|
||||
//Missing: find animation and maybe sfx
|
||||
|
||||
queueScript(player, 4) {_ ->
|
||||
SceneryBuilder.remove(skeleScenery, 200)
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createLevel13SkeletonNPC(player: Player) : NPC {
|
||||
val skele = NPC(NPCs.SKELETON_459, Location(3120, 9569, 0))
|
||||
val skele = NPC(NPCs.SKELETON_459, Location(3120, 9568, 0))
|
||||
skele.setAttribute("spawned:npc", true)
|
||||
skele.setAttribute("target", player)
|
||||
skele.isRespawn = false
|
||||
skele.init()
|
||||
skele.properties.combatPulse.style = CombatStyle.MELEE
|
||||
skele.attack(player)
|
||||
|
||||
return skele
|
||||
}
|
||||
|
||||
private fun toggleCoffinSceneryObj(player: Player, coffin: core.game.node.scenery.Scenery) {
|
||||
fun toggleCoffinSceneryObj(player: Player, coffin: core.game.node.scenery.Scenery) {
|
||||
|
||||
lock(player, 2)
|
||||
|
||||
|
|
@ -78,7 +72,7 @@ class RestlessGhostListeners : InteractionListener {
|
|||
INCOMPLETE_COFFIN_OPEN -> {
|
||||
//close it
|
||||
visualize(player, Animations_HUMAN_CLOSE_CHEST_535, -1)
|
||||
SceneryBuilder.replace(coffin, coffin.transform(CLOSED_COFFIN))
|
||||
SceneryBuilder.replace(coffin, coffin.transform(CLOSED_COFFIN), 200)
|
||||
}
|
||||
CLOSED_COFFIN -> {
|
||||
//open it
|
||||
|
|
@ -86,9 +80,9 @@ class RestlessGhostListeners : InteractionListener {
|
|||
|
||||
if (isQuestComplete(player, Quests.THE_RESTLESS_GHOST)) {
|
||||
//full skele with skull
|
||||
SceneryBuilder.replace(coffin, coffin.transform(COMPLETE_COFFIN_OPEN))
|
||||
SceneryBuilder.replace(coffin, coffin.transform(COMPLETE_COFFIN_OPEN), 200)
|
||||
} else {
|
||||
SceneryBuilder.replace(coffin, coffin.transform(INCOMPLETE_COFFIN_OPEN))
|
||||
SceneryBuilder.replace(coffin, coffin.transform(INCOMPLETE_COFFIN_OPEN), 200)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -117,7 +111,7 @@ class RestlessGhostListeners : InteractionListener {
|
|||
//despawn ghost after awhile and shut the coffin
|
||||
queueScript(player, 100) { _ ->
|
||||
ghost.clear()
|
||||
toggleCoffinSceneryObj(player, node)
|
||||
//toggleCoffinSceneryObj(player, node)
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
}
|
||||
|
|
@ -172,18 +166,21 @@ class RestlessGhostListeners : InteractionListener {
|
|||
return@onUseWith true
|
||||
}
|
||||
|
||||
on(Scenery.ALTAR_15051, IntType.SCENERY, "search") { player, node ->
|
||||
on(Scenery.ALTAR_15050, IntType.SCENERY, "search") { player, node ->
|
||||
|
||||
if (!inInventory(player, Items.GHOSTS_SKULL_553)) {
|
||||
if (getQuestStage(player, Quests.THE_RESTLESS_GHOST) < 30) {
|
||||
if (getQuestStage(player, Quests.THE_RESTLESS_GHOST) !in 30..40) {
|
||||
sendMessage(player, "You search the altar and find nothing.")
|
||||
} else {
|
||||
if (freeSlots(player) != 0) {
|
||||
if (freeSlots(player) >= 1) {
|
||||
if (addItem(player, Items.GHOSTS_SKULL_553)) {
|
||||
setQuestStage(player, Quests.THE_RESTLESS_GHOST, 40)
|
||||
sendMessage(player, "The skeleton in the corner suddenly comes to life!")
|
||||
|
||||
Location.create(3120, 9569, 0)
|
||||
//skele comes to live from scenery 15057 with an animation,
|
||||
//but idk how to query for it to at least remove it from the world briefly
|
||||
//animSkeleAlive(player, node as core.game.node.scenery.Scenery)
|
||||
|
||||
//spawn in skeleton
|
||||
val s = createLevel13SkeletonNPC(player)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue