From 1e1f37ed856389355b542a3f9157dcabf27b4d11 Mon Sep 17 00:00:00 2001 From: downthecrop Date: Sun, 3 Oct 2021 01:21:46 +0000 Subject: [PATCH] Canoe Animations & Travel Interface --- .../game/content/dialogue/TarquinDialogue.java | 4 ++-- .../canoestation/CanoeInterfaceListeners.kt | 16 ++++++++++++---- .../object/canoestation/CanoeUtils.kt | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Server/src/main/java/core/game/content/dialogue/TarquinDialogue.java b/Server/src/main/java/core/game/content/dialogue/TarquinDialogue.java index 4561c7d50..24cf9d4fa 100644 --- a/Server/src/main/java/core/game/content/dialogue/TarquinDialogue.java +++ b/Server/src/main/java/core/game/content/dialogue/TarquinDialogue.java @@ -53,7 +53,7 @@ public class TarquinDialogue extends DialoguePlugin { stage = 11; break; case 11: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "I'd be suprised if you haven't already heard of me?"); + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "I'd be surprised if you haven't already heard of me?"); stage = 12; break; case 12: @@ -109,7 +109,7 @@ public class TarquinDialogue extends DialoguePlugin { stage = 26; break; case 26: - interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You look like you know your way around a tree, you can", "you can make many canoes."); + interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "You look like you know your way around a tree,", "you can make many canoes."); stage = 27; break; case 27: diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeInterfaceListeners.kt b/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeInterfaceListeners.kt index c5970e469..e45840c1c 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeInterfaceListeners.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeInterfaceListeners.kt @@ -1,5 +1,6 @@ package rs09.game.interaction.`object`.canoestation +import api.ContentAPI import core.cache.def.impl.VarbitDefinition import core.game.component.Component import core.game.content.global.travel.canoe.Canoe @@ -44,7 +45,7 @@ class CanoeInterfaceListeners : InterfaceListener() { } player.lock() - player.animate(axe.animation) + ContentAPI.animate(player,CanoeUtils.getShapeAnimation(axe)) player.pulseManager.run(object : Pulse(3) { override fun pulse(): Boolean { if (RandomFunction.random(if (canoe == Canoe.WAKA) 8 else 6) == 1) { @@ -56,7 +57,7 @@ class CanoeInterfaceListeners : InterfaceListener() { player.unlock() return true } - player.animate(axe.animation) + ContentAPI.animate(player,CanoeUtils.getShapeAnimation(axe)) return false } }) @@ -98,13 +99,20 @@ class CanoeInterfaceListeners : InterfaceListener() { var counter = 0 override fun pulse(): Boolean { when(counter++){ - 0 -> player.interfaceManager.openOverlay(Component(Components.FADE_TO_BLACK_120)) + 0 -> { + player.interfaceManager.openOverlay(Component(Components.FADE_TO_BLACK_120)) + player.interfaceManager.open(Component(Components.CANOE_TRAVEL_758)) + } 2 -> { PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 2)) player.interfaceManager.hideTabs(0, 1, 2, 3, 4, 5, 6, 11, 12) } 15 -> player.properties.teleportLocation = dest - 16 -> {player.interfaceManager.closeOverlay(); player.interfaceManager.openOverlay(Component(Components.FADE_FROM_BLACK_170))} + 16 -> { + player.interfaceManager.close(Component(Components.CANOE_TRAVEL_758)) + player.interfaceManager.closeOverlay() + player.interfaceManager.openOverlay(Component(Components.FADE_FROM_BLACK_170)) + } 18 -> { player.unlock() player.interfaceManager.restoreTabs() diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt b/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt index 8d6783ec0..8211302cc 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/canoestation/CanoeUtils.kt @@ -4,7 +4,10 @@ import core.cache.def.impl.VarbitDefinition import core.game.content.global.travel.canoe.Canoe import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills +import core.game.node.entity.skill.gather.SkillingTool import core.game.world.map.Location +import core.game.world.update.flag.context.Animation +import core.net.packet.out.SkillLevel import org.rs09.consts.Components object CanoeUtils { @@ -37,6 +40,20 @@ object CanoeUtils { } } + fun getShapeAnimation(axe: SkillingTool): Animation{ + when(axe){ + SkillingTool.BRONZE_AXE -> return Animation(6744); + SkillingTool.IRON_AXE -> return Animation(6743); + SkillingTool.STEEL_AXE -> return Animation(6742); + SkillingTool.BLACK_AXE -> return Animation(6741); + SkillingTool.MITHRIL_AXE -> return Animation(6740); + SkillingTool.ADAMANT_AXE -> return Animation(6739); + SkillingTool.RUNE_AXE -> return Animation(6738); + SkillingTool.DRAGON_AXE -> return Animation(6745); + } + return axe.animation; + } + fun getDestinationFromButtonID(buttonID: Int): Location { return when(buttonID){ 47 -> Location.create(3240, 3242, 0)