From 39060ba43e55bac07c4bc6f165945e783675b7e3 Mon Sep 17 00:00:00 2001 From: ceikry Date: Fri, 23 Jul 2021 19:25:56 -0500 Subject: [PATCH] Added player-independent animateScenery method --- Server/src/main/kotlin/api/ContentAPI.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Server/src/main/kotlin/api/ContentAPI.kt b/Server/src/main/kotlin/api/ContentAPI.kt index 25b4921fa..1bbbb2b78 100644 --- a/Server/src/main/kotlin/api/ContentAPI.kt +++ b/Server/src/main/kotlin/api/ContentAPI.kt @@ -15,7 +15,6 @@ import core.game.node.entity.impl.ForceMovement import core.game.node.entity.impl.Projectile import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player -import core.game.node.entity.player.link.RunScript import core.game.node.entity.player.link.TeleportManager import core.game.node.entity.player.link.audio.Audio import core.game.node.entity.player.link.emote.Emotes @@ -27,13 +26,14 @@ import core.game.system.task.Pulse import core.game.world.map.Direction import core.game.world.map.Location import core.game.world.map.RegionManager +import core.game.world.map.RegionManager.getRegionChunk import core.game.world.map.path.Pathfinder import core.game.world.map.zone.MapZone import core.game.world.map.zone.ZoneBorders import core.game.world.map.zone.ZoneBuilder +import core.game.world.update.flag.chunk.AnimateObjectUpdateFlag import core.game.world.update.flag.context.Animation import core.game.world.update.flag.context.Graphics -import core.tools.RandomFunction import rs09.game.content.dialogue.DialogueFile import rs09.game.system.SystemLogger import rs09.game.world.GameWorld @@ -390,6 +390,16 @@ object ContentAPI { player.packetDispatch.sendSceneryAnimation(obj, getAnimation(animationId), global) } + /** + * Send an object animation independent of a player + */ + @JvmStatic + fun animateScenery(obj: Scenery, animationId: Int){ + val animation = Animation(animationId) + animation.setObject(obj) + getRegionChunk(obj.location).flag(AnimateObjectUpdateFlag(animation)) + } + /** * Produce a ground item owned by the player */