diff --git a/Server/data/configs/object_configs.json b/Server/data/configs/object_configs.json index 5ab9f7575..6f7ff2f90 100644 --- a/Server/data/configs/object_configs.json +++ b/Server/data/configs/object_configs.json @@ -7377,7 +7377,7 @@ }, { "examine": "Seems to connect this level to the one above!", - "ids": "18705" + "ids": "18705,18598" }, { "examine": "Is that a shopping trolley?", diff --git a/Server/src/main/content/region/kandarin/seers/quest/elementalworkshop2/EW2Listeners.kt b/Server/src/main/content/region/kandarin/seers/quest/elementalworkshop2/EW2Listeners.kt index 66b3d6505..d2a6ef385 100644 --- a/Server/src/main/content/region/kandarin/seers/quest/elementalworkshop2/EW2Listeners.kt +++ b/Server/src/main/content/region/kandarin/seers/quest/elementalworkshop2/EW2Listeners.kt @@ -615,6 +615,8 @@ class EW2Listeners : InteractionListener { if (getQuestStage(player, Quests.ELEMENTAL_WORKSHOP_II) == 0) { setQuestStage(player, Quests.ELEMENTAL_WORKSHOP_II, 1) setVarbit(player, EW2StageVarbit, 1, true) + // the crane starts in this position per source + setVarbit(player, EW2CranePosVarbit, 3, true) } } else { sendMessage(player, "You search the books...") diff --git a/Server/src/main/core/game/system/command/sets/AnimationCommandSet.kt b/Server/src/main/core/game/system/command/sets/AnimationCommandSet.kt index d06258333..45e00387d 100644 --- a/Server/src/main/core/game/system/command/sets/AnimationCommandSet.kt +++ b/Server/src/main/core/game/system/command/sets/AnimationCommandSet.kt @@ -1,8 +1,11 @@ package core.game.system.command.sets +import core.api.addScenery import core.api.animate +import core.api.animateScenery import core.api.delayScript import core.api.queueScript +import core.api.sendMessage import core.api.stopExecuting import core.game.interaction.QueueStrength import core.game.node.entity.npc.NPC @@ -103,7 +106,6 @@ class AnimationCommandSet : CommandSet(Privilege.ADMIN) { } } - /** * Reset the player's render animation to default */ @@ -113,5 +115,46 @@ class AnimationCommandSet : CommandSet(Privilege.ADMIN) { player.appearance.setAnimations() player.appearance.sync() } + + /** + * Spawn object with given ID at the player's location and animate it + */ + define("objanim", usage = "::objanim [objectId] [animFrom] [(opt)animTo] [(opt)delay]", description = "Spawns an object and animates it with the provided anim ID. If a second ID is provided, it iterates through the anims.") { player, args -> + if (args.size < 3) { + sendMessage(player, "Usage: ::objanim [objectId] [animFrom] [(opt)animTo] [(opt)delay]") + return@define + } + + val objectId = args[1].toIntOrNull() + val animFrom = args[2].toIntOrNull() + var animTo = args.getOrNull(3)?.toIntOrNull() + val delay = args.getOrNull(4)?.toIntOrNull() ?: 3 + + if (objectId == null || animFrom == null) { + sendMessage(player, "Invalid arguments. Please use numbers.") + return@define + } + + // spawn the object + val obj = core.game.node.scenery.Scenery(objectId, player.location) + addScenery(obj) + + // set the range if it's just a single anim + if (animTo == null) animTo = animFrom + + // loop through the anims if it's a range + sendMessage(player, "Spawned object $objectId, playing anims $animFrom to $animTo.") + queueScript(player, 1, QueueStrength.STRONG) { stage: Int -> + val currentAnimId = animFrom + stage + animateScenery(player, obj, currentAnimId) + sendMessage(player, "Playing object animation $currentAnimId") + if (currentAnimId >= animTo) { + return@queueScript stopExecuting(player) + } + return@queueScript delayScript(player, delay) + } + + return@define + } } } diff --git a/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt b/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt index 987cc7b84..468bdaf96 100644 --- a/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt +++ b/Server/src/main/core/game/system/command/sets/SpawnCommandSet.kt @@ -1,14 +1,8 @@ package core.game.system.command.sets -import core.api.addScenery -import core.api.animateScenery -import core.api.delayScript import core.api.log -import core.api.queueScript import core.api.sendMessage -import core.api.stopExecuting import core.cache.Cache -import core.game.interaction.QueueStrength import core.game.node.scenery.Scenery import core.game.node.scenery.SceneryBuilder import core.game.node.entity.npc.NPC @@ -127,52 +121,6 @@ class SpawnCommandSet : CommandSet(Privilege.ADMIN){ log(this::class.java, Log.FINE, "object = $`object`") } - /** - * Spawn object with given ID at the player's location and animate it - */ - define("objanim", usage = "::objanim [objectId] [animFrom] [(opt)animTo] [(opt)delay]", description = "Spawns an object and animates it with the provided anim ID. If a second ID is provided, it iterates through the anims.") { player, args -> - if (args.size < 3) { - sendMessage(player, "Usage: ::objanim [objectId] [animFrom] [(opt)animTo] [(opt)delay]") - return@define - } - - val objectId = args[1].toIntOrNull() - val animFrom = args[2].toIntOrNull() - - val animTo = args.getOrNull(3)?.toIntOrNull() - val delay = args.getOrNull(4)?.toIntOrNull() ?: 3 - - if (objectId == null || animFrom == null) { - sendMessage(player, "Invalid arguments. Please use numbers.") - return@define - } - - // spawn the object - val obj = core.game.node.scenery.Scenery(objectId, player.location) - addScenery(obj) - - // animate a single anim - if (animTo == null) { - animateScenery(player, obj, animFrom) - sendMessage(player, "Spawned object $objectId and playing animation $animFrom.") - return@define - } - - // loop through the anims if it's a range - sendMessage(player, "Spawned object $objectId, playing anims $animFrom to $animTo.") - queueScript(player, 1, QueueStrength.STRONG) { stage: Int -> - val currentAnimId = animFrom + stage - animateScenery(player, obj, currentAnimId) - sendMessage(player, "Playing object animation $currentAnimId") - if (currentAnimId >= animTo) { - return@queueScript stopExecuting(player) - } - return@queueScript delayScript(player, delay) - } - - return@define - } - define("objectgrid", usage = "::objectgrid start-id end-id type rotation", description = "Spawns a 10-wide grid cycling through the given object id range.") { player, args -> if(args!!.size != 5) { reject(player, "Usage: objectgrid beginId endId type rotation")