mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-22 02:45:10 -06:00
fix merge conflict
This commit is contained in:
parent
373677f492
commit
ed225eeacb
4 changed files with 47 additions and 54 deletions
|
|
@ -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?",
|
||||
|
|
|
|||
|
|
@ -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...")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 <lt>start-id<gt> <lt>end-id<gt> <lt>type<gt> <lt>rotation<gt>", 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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue