From 6a78cfaf184ccd9b0b09569beb031b3e3ac51f9c Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Mon, 21 Aug 2023 16:01:05 -0400 Subject: [PATCH 01/10] lunar work --- .../global/skill/magic/lunar/LunarData.kt | 43 ++- .../skill/magic/lunar/LunarListeners.kt | 254 +++++++++++++----- .../global/skill/magic/spellconsts/Lunar.kt | 14 +- 3 files changed, 228 insertions(+), 83 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarData.kt b/Server/src/main/content/global/skill/magic/lunar/LunarData.kt index 4e9f6fdd4e..58612a43bf 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarData.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarData.kt @@ -3,7 +3,6 @@ package content.global.skill.magic.lunar import core.api.* import core.game.interaction.IntType import core.game.interaction.InteractionListener -import core.game.node.item.Item import core.game.world.update.flag.context.Animation import core.game.world.update.flag.context.Graphics import org.rs09.consts.Items @@ -34,7 +33,7 @@ val SUPERGLASS_MAKE_GFX = Graphics(729, 120) val FERTILE_SOIL_GFX = Graphics(724) val CURE_ME_GFX = Graphics(731, 90) val CURE_GROUP_GFX = Graphics(751, 130) -val CURE_OTHER_GFX = Graphics(738, 130) +val CURE_OTHER_GFX = Graphics(736, 130) val ENERGY_TRANSFER_GFX = Graphics(738, 90) val HUNTER_KIT_GFX = Graphics(1024) @@ -62,7 +61,7 @@ class HunterKitInteraction : InteractionListener { } } -enum class JewelleryString(val unstrung: Int, val strung: Int) { +enum class StringJewelleryItems(val unstrung: Int, val strung: Int) { GOLD(Items.GOLD_AMULET_1673, Items.GOLD_AMULET_1692), SAPPHIRE(Items.SAPPHIRE_AMULET_1675, Items.SAPPHIRE_AMULET_1694), EMERALD(Items.EMERALD_AMULET_1677, Items.EMERALD_AMULET_1696), @@ -74,8 +73,8 @@ enum class JewelleryString(val unstrung: Int, val strung: Int) { HOLY(Items.UNSTRUNG_SYMBOL_1714, Items.UNBLESSED_SYMBOL_1716), UNHOLY(Items.UNSTRUNG_EMBLEM_1720, Items.UNPOWERED_SYMBOL_1722); companion object { - val productOfString = values().associate { it.unstrung to it.strung } - fun forId(id : Int) : Int { + private val productOfString = values().associate { it.unstrung to it.strung } + fun forId(id: Int): Int { return productOfString[id]!! } @@ -85,3 +84,37 @@ enum class JewelleryString(val unstrung: Int, val strung: Int) { } } +enum class HumidifyItems(val empty: Int, val full: Int) { + VIAL(Items.VIAL_229, Items.VIAL_OF_WATER_227), + WATERSKIN0(Items.WATERSKIN0_1831, Items.WATERSKIN4_1823), + WATERSKIN1(Items.WATERSKIN1_1829, Items.WATERSKIN4_1823), + WATERSKIN2(Items.WATERSKIN2_1827, Items.WATERSKIN4_1823), + WATERSKIN3(Items.WATERSKIN3_1825, Items.WATERSKIN4_1823), + BUCKET(Items.BUCKET_1925, Items.BUCKET_OF_WATER_1929), + BOWL(Items.BOWL_1923, Items.BOWL_OF_WATER_1921), + JUG(Items.JUG_1935, Items.JUG_OF_WATER_1937), + WATERING_CAN0(Items.WATERING_CAN_5331, Items.WATERING_CAN8_5340), + WATERING_CAN1(Items.WATERING_CAN1_5333, Items.WATERING_CAN8_5340), + WATERING_CAN2(Items.WATERING_CAN2_5334, Items.WATERING_CAN8_5340), + WATERING_CAN3(Items.WATERING_CAN3_5335, Items.WATERING_CAN8_5340), + WATERING_CAN4(Items.WATERING_CAN4_5336, Items.WATERING_CAN8_5340), + WATERING_CAN5(Items.WATERING_CAN5_5337, Items.WATERING_CAN8_5340), + WATERING_CAN6(Items.WATERING_CAN6_5338, Items.WATERING_CAN8_5340), + WATERING_CAN7(Items.WATERING_CAN7_5339, Items.WATERING_CAN8_5340), + FISHBOWL(Items.FISHBOWL_6667, Items.FISHBOWL_6668), + KETTLE(Items.KETTLE_7688, Items.FULL_KETTLE_7690), + ENCHANTED_VIAL(Items.ENCHANTED_VIAL_731, Items.HOLY_WATER_732), + CUP(Items.EMPTY_CUP_1980, Items.CUP_OF_WATER_4458), + CLAY(Items.CLAY_434, Items.SOFT_CLAY_1761); + companion object { + private val productOfFill = values().associate { it.empty to it.full } + fun forId(id: Int): Int { + return productOfFill[id]!! + } + + fun emptyContains(id: Int): Boolean { + return productOfFill.contains(id) + } + } +} + diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 66a37b071f..400f28a0a7 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -31,167 +31,255 @@ import kotlin.math.floor class LunarListeners : SpellListener("lunar"), Commands { override fun defineListeners() { + // Level 0 onCast(Lunar.HOME_TELEPORT, NONE) { player, _ -> requires(player) player.teleporter.send(Location.create(2100, 3914, 0),TeleportManager.TeleportType.HOME) setDelay(player,true) } + // Level 65 + onCast(Lunar.BAKE_PIE, NONE) { player, _ -> + requires(player,65, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.FIRE_RUNE_554,5), Item(Items.WATER_RUNE_555,4))) + bakePie(player) + } + + // Level 66 + onCast(Lunar.CURE_PLANT, OBJECT) { player, node -> + requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.EARTH_RUNE_557,8))) + curePlant(player,node!!.asScenery()) + } + + // Level 66 + onCast(Lunar.MONSTER_EXAMINE, NPC) { player, node -> + requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.MIND_RUNE_558), Item(Items.COSMIC_RUNE_564))) + examineMonster(player,node!!.asNpc()) + } + + // Level 67 + onCast(Lunar.NPC_CONTACT, NONE) { player, _ -> + requires(player,67, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.COSMIC_RUNE_564), Item(Items.AIR_RUNE_556,2))) + player.interfaceManager.open(Component(429)) + player.setAttribute("contact-caller"){ + removeRunes(player) + addXP(player,63.0) + setDelay(player,false) + visualizeSpell(player, NPC_CONTACT_ANIM, NPC_CONTACT_GFX,3618) + } + } + + // Level 68 + onCast(Lunar.CURE_OTHER, PLAYER) { player, node -> + node?.let { cureOther(player, node) } + } + + // Level 68 + onCast(Lunar.HUMIDIFY, NONE) { player, _ -> + humidify(player) + } + + // Level 69 onCast(Lunar.MOONCLAN_TELEPORT, NONE) { player, _ -> requires(player,69, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,2))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,66.0, Location.create(2111, 3916, 0)) } - onCast(Lunar.MOONCLAN_GR_TELEPORT, NONE) { player, _ -> + // Level 70 + onCast(Lunar.MOONCLAN_GROUP_TELEPORT, NONE) { player, _ -> requires(player,70, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,4))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,67.0,"Moonclan Island",Location.create(2111, 3916, 0)) } + // Level 71 onCast(Lunar.OURANIA_TELEPORT, NONE) { player, _ -> - requires(player,71, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,6))) + requires( + player, + 71, + arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.EARTH_RUNE_557, 6)) + ) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) - sendTeleport(player,69.0, Location.create(2469, 3247, 0)) + sendTeleport(player, 69.0, Location.create(2469, 3247, 0)) + } + + // Level 71 + onCast(Lunar.CURE_ME, NONE) { player, _ -> + cureMe(player) } + // Level 71 + onCast(Lunar.HUNTER_KIT, NONE) { player, _ -> + if(freeSlots(player) == 0) sendMessage(player, "Not enough inventory space!").also { return@onCast } + hunterKit(player) + } + + // Level 72 onCast(Lunar.WATERBIRTH_TELEPORT, NONE){ player, _ -> requires(player,72, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,71.0, Location.create(2527, 3739, 0)) } - onCast(Lunar.WATERBIRTH_GR_TELEPORT, NONE) { player, _ -> + // Level 73 + onCast(Lunar.WATERBIRTH_GROUP_TELEPORT, NONE) { player, _ -> requires(player,73, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555,5))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,72.0,"Waterbirth Island", Location.create(2527, 3739, 0)) } + // Level 74 + onCast(Lunar.CURE_GROUP, NONE) { player, _ -> + cureGroup(player) + } + + // Level 75 + /** + * Stat Spy + */ + + // Level 75 onCast(Lunar.BARBARIAN_TELEPORT, NONE) { player, _ -> requires(player,75, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,3))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,76.0, Location.create(2544, 3572, 0)) } - onCast(Lunar.BARBARIAN_GR_TELEPORT, NONE) { player, _ -> + // Level 76 + onCast(Lunar.BARBARIAN_GROUP_TELEPORT, NONE) { player, _ -> requires(player,77, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,6))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,77.0,"Barbarian Outpost", Location.create(2544, 3572, 0)) } + // Level 77 + onCast(Lunar.SUPERGLASS_MAKE, NONE) { player, _ -> + requires(player, 77, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.FIRE_RUNE_554, 6), Item(Items.AIR_RUNE_556, 10))) + superglassMake(player) + } + + // Level 78 onCast(Lunar.KHAZARD_TELEPORT, NONE) { player, _ -> requires(player,78, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,4))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,80.0, Location.create(2656, 3157, 0)) } - onCast(Lunar.KHAZARD_GR_TELEPORT, NONE) { player, _ -> + // Level 79 + onCast(Lunar.KHAZARD_GROUP_TELEPORT, NONE) { player, _ -> requires(player,79, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,8))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,81.0, "Port Khazard", Location.create(2656, 3157, 0)) } + // Level 79 + /** + * Dream + */ + + // Level 80 + onCast(Lunar.STRING_JEWELLERY, NONE) { player, _ -> + requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5))) + stringJewellery(player) + } + + // Level 81 + /** + * Stat Restore Pot Share + */ + + // Level 82 + /** + * Magic Imbue + */ + + // Level 83 + onCast(Lunar.FERTILE_SOIL, OBJECT) { player, node -> + node?.let { fertileSoil(player, node.asScenery()) } + } + + // Level 84 + /** + * Boost Potion Share + */ + + // Level 85 onCast(Lunar.FISHING_GUILD_TELEPORT, NONE) { player, _ -> requires(player,85, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,89.0, Location.create(2611, 3393, 0)) } - onCast(Lunar.FISHING_GUILD_GR_TELEPORT, NONE) { player, _ -> + // Level 86 + onCast(Lunar.FISHING_GUILD_GROUP_TELEPORT, NONE) { player, _ -> requires(player,86, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,14))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,90.0,"Fishing Guild", Location.create(2611, 3393, 0)) } + // Level 86 + onCast(Lunar.PLANK_MAKE, ITEM) { player, node -> + requires(player, 86, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.NATURE_RUNE_561, 1), Item(Items.EARTH_RUNE_557, 15))) + plankMake(player, node!!.asItem()) + } + + // Level 87 onCast(Lunar.CATHERBY_TELEPORT, NONE) { player, _ -> requires(player,87, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,92.0, Location.create(2804, 3433, 0)) } - onCast(Lunar.CATHERBY_GR_TELEPORT, NONE) { player, _ -> + // Level 88 + onCast(Lunar.CATHERBY_GROUP_TELEPORT, NONE) { player, _ -> requires(player,88, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,15))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,93.0,"Catherby", Location.create(2804, 3433, 0)) } + // Level 89 onCast(Lunar.ICE_PLATEAU_TELEPORT, NONE) { player, _ -> requires(player,89, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,8))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendTeleport(player,96.0, Location.create(2972, 3873, 0)) } - onCast(Lunar.ICE_PLATEAU_GR_TELEPORT, NONE) { player, _ -> + // Level 90 + onCast(Lunar.ICE_PLATEAU_GROUP_TELEPORT, NONE) { player, _ -> requires(player,90, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,16))) if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200) sendGroupTeleport(player,99.0, "Ice Plateau", Location.create(2972, 3873, 0)) } - onCast(Lunar.BAKE_PIE, NONE) { player, _ -> - requires(player,65, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.FIRE_RUNE_554,5), Item(Items.WATER_RUNE_555,4))) - bakePie(player) - } - - onCast(Lunar.MONSTER_EXAMINE, NPC) { player, node -> - requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.MIND_RUNE_558), Item(Items.COSMIC_RUNE_564))) - examineMonster(player,node!!.asNpc()) - } - - onCast(Lunar.CURE_PLANT, OBJECT) { player, node -> - requires(player,66, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.EARTH_RUNE_557,8))) - curePlant(player,node!!.asScenery()) - } - - onCast(Lunar.NPC_CONTACT, NONE) { player, _ -> - requires(player,67, arrayOf(Item(Items.ASTRAL_RUNE_9075), Item(Items.COSMIC_RUNE_564), Item(Items.AIR_RUNE_556,2))) - player.interfaceManager.open(Component(429)) - player.setAttribute("contact-caller"){ - removeRunes(player) - addXP(player,63.0) - setDelay(player,false) - visualizeSpell(player, NPC_CONTACT_ANIM, NPC_CONTACT_GFX,3618) - } - } - - onCast(Lunar.PLANK_MAKE, ITEM) { player, node -> - requires(player, 86, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.NATURE_RUNE_561, 1), Item(Items.EARTH_RUNE_557, 15))) - plankMake(player, node!!.asItem()) - } - - onCast(Lunar.STRING_JEWELLERY, NONE) { player, _ -> - requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5))) - stringJewellery(player) - } - - onCast(Lunar.SUPERGLASS_MAKE, NONE) { player, _ -> - requires(player, 77, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.FIRE_RUNE_554, 6), Item(Items.AIR_RUNE_556, 10))) - superglassMake(player) + // Level 91 + onCast(Lunar.ENERGY_TRANSFER, PLAYER) { player, node -> + node?.let { energyTransfer(player, node) } } - onCast(Lunar.FERTILE_SOIL, OBJECT) { player, node -> - node?.let { fertileSoil(player, node.asScenery()) } - } + // Level 92 + /** + * Heal Other + */ - onCast(Lunar.CURE_ME, NONE) { player, _ -> - cureMe(player) - } + // Level 93 + /** + * Vengeance Other + */ - onCast(Lunar.CURE_GROUP, NONE) { player, _ -> - cureGroup(player) - } + // Level 94 + /** + * Vengeance + */ - onCast(Lunar.CURE_OTHER, PLAYER) { player, node -> - node?.let { cureOther(player, node) } - } + // Level 95 + /** + * Heal Group + */ - onCast(Lunar.ENERGY_TRANSFER, PLAYER) { player, node -> - node?.let { energyTransfer(player, node) } - } - - onCast(Lunar.HUNTER_KIT, NONE) { player, _ -> - if(freeSlots(player) == 0) sendMessage(player, "Not enough inventory space!").also { return@onCast } - hunterKit(player) - } + // Level 96 + /** + * Spellbook Swap + */ } // Lunar spellbook-related debug commands @@ -357,7 +445,7 @@ class LunarListeners : SpellListener("lunar"), Commands { private fun sendGroupTeleport(player: Player, xp: Double, destName: String, loc: Location){ RegionManager.getLocalPlayers(player,1).forEach { if(it == player) return@forEach - if(it.isTeleBlocked()) return@forEach + if(it.isTeleBlocked) return@forEach if(!it.isActive) return@forEach if(!it.settings.isAcceptAid) return@forEach if(it.ironmanManager.isIronman) return@forEach @@ -374,7 +462,7 @@ class LunarListeners : SpellListener("lunar"), Commands { for(item in player.inventory.toArray()) { if(item == null) continue - if(!JewelleryString.unstrungContains(item.id)) continue + if(!StringJewelleryItems.unstrungContains(item.id)) continue playerJewellery.add(item) } @@ -387,7 +475,7 @@ class LunarListeners : SpellListener("lunar"), Commands { requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5))) if(counter == 0) delay = animationDuration(STRING_JEWELLERY_ANIM) + 1 val item = playerJewellery[0] - val strung = JewelleryString.forId(item.id) + val strung = StringJewelleryItems.forId(item.id) setDelay(player,false) if(removeItem(player, item) && addItem(player, strung)) { removeRunes(player, true) @@ -595,6 +683,30 @@ class LunarListeners : SpellListener("lunar"), Commands { setDelay(player, 2) } } + + private fun humidify(player: Player) { + val playerEmpties = ArrayDeque<Item>() + + for(item in player.inventory.toArray()) { + if(item == null) continue + if(!HumidifyItems.emptyContains(item.id)) continue + playerEmpties.add(item) + } + + if(playerEmpties.isEmpty()) { + sendMessage(player, "You have nothing in your inventory that this spell can humidify.") + return + } + + queueScript(player) { + for(item in playerEmpties) { + val filled = HumidifyItems.forId(item.id) + if (removeItem(player, item.id) && addItem(player, filled)) + animate(player, ) + } + return@queueScript stopExecuting(player) + } + } } diff --git a/Server/src/main/content/global/skill/magic/spellconsts/Lunar.kt b/Server/src/main/content/global/skill/magic/spellconsts/Lunar.kt index acd6e54b90..69e0fa5e07 100644 --- a/Server/src/main/content/global/skill/magic/spellconsts/Lunar.kt +++ b/Server/src/main/content/global/skill/magic/spellconsts/Lunar.kt @@ -34,11 +34,11 @@ object Lunar { const val HEAL_GROUP = 30 const val OURANIA_TELEPORT = 31 const val CURE_PLANT = 32 - const val MOONCLAN_GR_TELEPORT = 33 - const val WATERBIRTH_GR_TELEPORT = 34 - const val BARBARIAN_GR_TELEPORT = 35 - const val KHAZARD_GR_TELEPORT = 36 - const val FISHING_GUILD_GR_TELEPORT = 37 - const val CATHERBY_GR_TELEPORT = 38 - const val ICE_PLATEAU_GR_TELEPORT = 39 + const val MOONCLAN_GROUP_TELEPORT = 33 + const val WATERBIRTH_GROUP_TELEPORT = 34 + const val BARBARIAN_GROUP_TELEPORT = 35 + const val KHAZARD_GROUP_TELEPORT = 36 + const val FISHING_GUILD_GROUP_TELEPORT = 37 + const val CATHERBY_GROUP_TELEPORT = 38 + const val ICE_PLATEAU_GROUP_TELEPORT = 39 } \ No newline at end of file -- GitLab From 9c7b3895a1dd798c3cd1c888dc91f72d5e6ce256 Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sat, 26 Aug 2023 18:55:30 -0400 Subject: [PATCH 02/10] Humidify --- .../global/skill/magic/SpellListener.kt | 12 +++- .../global/skill/magic/lunar/LunarData.kt | 32 ----------- .../skill/magic/lunar/LunarListeners.kt | 55 ++++++++++--------- 3 files changed, 38 insertions(+), 61 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/SpellListener.kt b/Server/src/main/content/global/skill/magic/SpellListener.kt index 61c5e31c25..1fefe3ebc8 100644 --- a/Server/src/main/content/global/skill/magic/SpellListener.kt +++ b/Server/src/main/content/global/skill/magic/SpellListener.kt @@ -73,9 +73,17 @@ abstract class SpellListener(val bookName: String) : Listener { player.skills.addExperience(Skills.MAGIC,amount) } - fun visualizeSpell(player: Player,anim:Animation,gfx: Graphics,soundID: Int = -1){ + fun visualizeSpell(player: Player, anim: Animation, gfx: Graphics, soundID: Int = -1){ if(player.getAttribute("tablet-spell",false)) return - player.visualize(anim,gfx) + player.visualize(anim, gfx) + if(soundID != -1){ + player.audioManager.send(soundID) + } + } + + fun visualizeSpell(player: Player, anim: Int, gfx: Int, soundID: Int = -1) { + if(player.getAttribute("tablet-spell",false)) return + player.visualize(Animation(anim), Graphics(gfx)) if(soundID != -1){ playAudio(player, soundID) } diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarData.kt b/Server/src/main/content/global/skill/magic/lunar/LunarData.kt index 58612a43bf..052749f22c 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarData.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarData.kt @@ -3,40 +3,8 @@ package content.global.skill.magic.lunar import core.api.* import core.game.interaction.IntType import core.game.interaction.InteractionListener -import core.game.world.update.flag.context.Animation -import core.game.world.update.flag.context.Graphics import org.rs09.consts.Items -// Animations -val BAKE_PIE_ANIM = Animation(4413) -val STATSPY_ANIM = Animation(6293) -val CURE_PLANT_ANIM = Animation(4409) -val NPC_CONTACT_ANIM = Animation(4413) -val PLANK_MAKE_ANIM = Animation(6298) -val STRING_JEWELLERY_ANIM = Animation(4412) -val SUPERGLASS_MAKE_ANIM = Animation(4413) -val FERTILE_SOIL_ANIM = Animation(4413) -val CURE_ME_ANIM = Animation(4411) -val CURE_GROUP_ANIM = Animation(4409) -val CURE_OTHER_ANIM = Animation(4411) -val ENERGY_TRANSFER_ANIM = Animation(4411) -val HUNTER_KIT_ANIM = Animation(6303) - -// Graphics -val BAKE_PIE_GFX = Graphics(746,75) -val STATSPY_GFX = Graphics(1059) -val CURE_PLANT_GFX = Graphics(742,100) -val NPC_CONTACT_GFX = Graphics(730,130) -val PLANK_MAKE_GFX = Graphics(1063, 120) -val STRING_JEWELLERY_GFX = Graphics(728, 100) -val SUPERGLASS_MAKE_GFX = Graphics(729, 120) -val FERTILE_SOIL_GFX = Graphics(724) -val CURE_ME_GFX = Graphics(731, 90) -val CURE_GROUP_GFX = Graphics(751, 130) -val CURE_OTHER_GFX = Graphics(736, 130) -val ENERGY_TRANSFER_GFX = Graphics(738, 90) -val HUNTER_KIT_GFX = Graphics(1024) - private val HunterKitContents = intArrayOf( Items.NOOSE_WAND_10150, Items.BUTTERFLY_NET_10010, diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 400f28a0a7..7f37230802 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -22,10 +22,9 @@ import core.game.system.task.Pulse import core.game.world.map.Location import core.game.world.map.RegionManager import core.game.world.repository.Repository +import core.game.world.update.flag.context.Animation import core.tools.RandomFunction -import org.rs09.consts.Components -import org.rs09.consts.Items -import org.rs09.consts.Sounds +import org.rs09.consts.* import kotlin.math.floor class LunarListeners : SpellListener("lunar"), Commands { @@ -64,7 +63,7 @@ class LunarListeners : SpellListener("lunar"), Commands { removeRunes(player) addXP(player,63.0) setDelay(player,false) - visualizeSpell(player, NPC_CONTACT_ANIM, NPC_CONTACT_GFX,3618) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_NPC_CONTACT_4413, Graphics.LUNAR_SPELLBOOK_NPC_CONTACT_728,3618) } } @@ -75,6 +74,7 @@ class LunarListeners : SpellListener("lunar"), Commands { // Level 68 onCast(Lunar.HUMIDIFY, NONE) { player, _ -> + requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.WATER_RUNE_555, 3), Item(Items.FIRE_RUNE_554, 1))) humidify(player) } @@ -317,7 +317,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } lock(player, 3) setDelay(player, false) - visualizeSpell(player, PLANK_MAKE_ANIM, PLANK_MAKE_GFX, 3617) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, 3617) removeRunes(player) replaceSlot(player, item.slot, plankType.plank) addXP(player, 90.0) @@ -369,7 +369,7 @@ class LunarListeners : SpellListener("lunar"), Commands { patch.cureDisease() removeRunes(player) addXP(player,60.0) - visualizeSpell(player, CURE_PLANT_ANIM, CURE_PLANT_GFX) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_PLANT_4409, Graphics.LUNAR_SPELLBOOK_CURE_PLANT_748) setDelay(player,false) } @@ -380,7 +380,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } player.faceLocation(npc.location) - visualizeSpell(player, STATSPY_ANIM, STATSPY_GFX,3620) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STATSPY_6293, Graphics.LUNAR_SPELLBOOK_STAT_SPY_OVER_PLAYER_1060,3620) removeRunes(player) addXP(player,66.0) setDelay(player,false) @@ -418,10 +418,10 @@ class LunarListeners : SpellListener("lunar"), Commands { var counter = 0 override fun pulse(): Boolean { if(playerPies.isEmpty()) return true - if(counter == 0) delay = BAKE_PIE_ANIM.definition.durationTicks + 1 + if(counter == 0) delay = Animation(Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413).definition.durationTicks + 1 val item = playerPies.get(0) val pie = CookableItems.forId(item.id) - visualizeSpell(player, BAKE_PIE_ANIM, BAKE_PIE_GFX, 2879) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413, Graphics.LUNAR_SPELLBOOK_BAKE_PIE_746, 2879) addXP(player,60.0) player.skills.addExperience(Skills.COOKING,pie.experience) setDelay(player,false) @@ -473,13 +473,13 @@ class LunarListeners : SpellListener("lunar"), Commands { if (playerJewellery.isEmpty()) return true requires(player, 80, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 10), Item(Items.WATER_RUNE_555, 5))) - if(counter == 0) delay = animationDuration(STRING_JEWELLERY_ANIM) + 1 + if(counter == 0) delay = animationDuration(Animation(Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412)) + 1 val item = playerJewellery[0] val strung = StringJewelleryItems.forId(item.id) setDelay(player,false) if(removeItem(player, item) && addItem(player, strung)) { removeRunes(player, true) - visualizeSpell(player, STRING_JEWELLERY_ANIM, STRING_JEWELLERY_GFX, 2903) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, 2903) rewardXP(player, Skills.CRAFTING, 4.0) addXP(player, 83.0) playerJewellery.remove(item) @@ -492,11 +492,11 @@ class LunarListeners : SpellListener("lunar"), Commands { } private fun superglassMake(player: Player) { - val GLASSWEED = hashSetOf(Items.SODA_ASH_1781, Items.SEAWEED_401, Items.SWAMP_WEED_10978) + val GLASS_WEEDS = hashSetOf(Items.SODA_ASH_1781, Items.SEAWEED_401, Items.SWAMP_WEED_10978) val inv = player.inventory.toArray() var playerWeed: Int = amountInInventory(player, Items.SODA_ASH_1781) + amountInInventory(player, Items.SEAWEED_401) + amountInInventory(player, Items.SWAMP_WEED_10978) var playerSand: Int = amountInInventory(player, Items.BUCKET_OF_SAND_1783) - var index: Int = 0 + var index = 0 fun addMolten(): Boolean { if(RandomFunction.randomDouble(1.0) < 0.3) { @@ -513,7 +513,7 @@ class LunarListeners : SpellListener("lunar"), Commands { for (item in inv) { if (item == null) continue if (index == size) break - if (GLASSWEED.contains(item.id)) { + if (GLASS_WEEDS.contains(item.id)) { if (removeItem(player, item) && removeItem(player, Items.BUCKET_OF_SAND_1783) && addMolten()) { index++ } else { @@ -527,7 +527,7 @@ class LunarListeners : SpellListener("lunar"), Commands { if(index == size && size != 0) { removeRunes(player, true) - visualizeSpell(player, SUPERGLASS_MAKE_ANIM, SUPERGLASS_MAKE_GFX, 2896) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, 2896) rewardXP(player, Skills.CRAFTING, 10.0) addXP(player, 78.0) } @@ -556,8 +556,8 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 83, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.NATURE_RUNE_561, 2), Item(Items.EARTH_RUNE_557, 15))) removeRunes(player, true) - animate(player, FERTILE_SOIL_ANIM) - sendGraphics(FERTILE_SOIL_GFX, target.location) + animate(player, Animations.LUNAR_SPELLBOOK_FERTILE_SOIL_4413) + sendGraphics(Graphics.LUNAR_SPELLBOOK_FERTILE_SOIL_724, target.location) playGlobalAudio(target.location, Sounds.LUNAR_FERTILIZE_2891) patch.compost = CompostType.SUPER sendMessage(player, "You fertilize the soil.") @@ -571,7 +571,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, CURE_ME_ANIM, CURE_ME_GFX, 2880) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, 2880) curePoison(player) addXP(player, 69.0) playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900) @@ -581,7 +581,7 @@ class LunarListeners : SpellListener("lunar"), Commands { private fun cureGroup(player: Player) { requires(player, 74, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 2), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, CURE_GROUP_ANIM, CURE_GROUP_GFX, 2882) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 2882) curePoison(player) for(acct in RegionManager.getLocalPlayers(player, 1)) { if(!acct.isActive || acct.locks.isInteractionLocked) { @@ -593,7 +593,7 @@ class LunarListeners : SpellListener("lunar"), Commands { curePoison(acct) sendMessage(acct, "You have been cured of poison.") playGlobalAudio(acct.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) - visualize(acct, -1, CURE_GROUP_GFX) + visualize(acct, -1, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744) } addXP(player, 74.0) } @@ -618,8 +618,8 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.LAW_RUNE_563), Item(Items.EARTH_RUNE_557, 10))) player.face(p) - visualizeSpell(player, CURE_OTHER_ANIM, CURE_OTHER_GFX, 2886) - visualize(p, -1, CURE_OTHER_GFX) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 2886) + visualize(p, -1, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736) playGlobalAudio(p.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) removeRunes(player, true) curePoison(p) @@ -647,8 +647,8 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 91, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.LAW_RUNE_563, 2), Item(Items.NATURE_RUNE_561, 1))) player.face(p) - visualizeSpell(player, ENERGY_TRANSFER_ANIM, ENERGY_TRANSFER_GFX, 2885) - visualize(p, -1, CURE_OTHER_GFX) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, 2885) + visualize(p, -1, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738) val hp = floor(player.skills.lifepoints * 0.10) var r = hp if(r > (100 - p.settings.runEnergy)) { @@ -678,7 +678,7 @@ class LunarListeners : SpellListener("lunar"), Commands { requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 2))) removeRunes(player, true) if(addItem(player, Items.HUNTER_KIT_11159)) { - visualizeSpell(player, HUNTER_KIT_ANIM, HUNTER_KIT_GFX, 3615) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUNTER_KIT_6303, Graphics.LUNAR_SPELLBOOK_HUNTER_KIT_1074, 3615) addXP(player, 70.0) setDelay(player, 2) } @@ -699,10 +699,11 @@ class LunarListeners : SpellListener("lunar"), Commands { } queueScript(player) { + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061) // TODO: Add sound for(item in playerEmpties) { val filled = HumidifyItems.forId(item.id) - if (removeItem(player, item.id) && addItem(player, filled)) - animate(player, ) + removeItem(player, item.id) && addItem(player, filled) + } return@queueScript stopExecuting(player) } -- GitLab From a6de7ac04537ccaa6bc3b45bd5d379f128bfb903 Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sat, 26 Aug 2023 19:19:34 -0400 Subject: [PATCH 03/10] Humidify --- .../global/skill/magic/SpellListener.kt | 11 ++- .../skill/magic/lunar/HumidifySpell.java | 93 ------------------- .../skill/magic/lunar/LunarListeners.kt | 17 +++- 3 files changed, 22 insertions(+), 99 deletions(-) delete mode 100644 Server/src/main/content/global/skill/magic/lunar/HumidifySpell.java diff --git a/Server/src/main/content/global/skill/magic/SpellListener.kt b/Server/src/main/content/global/skill/magic/SpellListener.kt index 1fefe3ebc8..ce691f9d3e 100644 --- a/Server/src/main/content/global/skill/magic/SpellListener.kt +++ b/Server/src/main/content/global/skill/magic/SpellListener.kt @@ -1,6 +1,7 @@ package content.global.skill.magic import core.api.playAudio +import core.api.playGlobalAudio import core.api.setAttribute import core.cache.def.impl.ItemDefinition import core.game.node.Node @@ -73,19 +74,21 @@ abstract class SpellListener(val bookName: String) : Listener { player.skills.addExperience(Skills.MAGIC,amount) } - fun visualizeSpell(player: Player, anim: Animation, gfx: Graphics, soundID: Int = -1){ + fun visualizeSpell(player: Player, anim: Animation, gfx: Graphics, soundID: Int = -1, delay: Int = 0, global: Boolean = true){ if(player.getAttribute("tablet-spell",false)) return player.visualize(anim, gfx) if(soundID != -1){ - player.audioManager.send(soundID) + if(global) playGlobalAudio(player.location, soundID, delay) + else playAudio(player, soundID, delay) } } - fun visualizeSpell(player: Player, anim: Int, gfx: Int, soundID: Int = -1) { + fun visualizeSpell(player: Player, anim: Int, gfx: Int, soundID: Int = -1, delay: Int = 0, global: Boolean = true) { if(player.getAttribute("tablet-spell",false)) return player.visualize(Animation(anim), Graphics(gfx)) if(soundID != -1){ - playAudio(player, soundID) + if(global) playGlobalAudio(player.location, soundID, delay) + else playAudio(player, soundID, delay) } } diff --git a/Server/src/main/content/global/skill/magic/lunar/HumidifySpell.java b/Server/src/main/content/global/skill/magic/lunar/HumidifySpell.java deleted file mode 100644 index 2dd389953e..0000000000 --- a/Server/src/main/content/global/skill/magic/lunar/HumidifySpell.java +++ /dev/null @@ -1,93 +0,0 @@ -package content.global.skill.magic.lunar; - -import core.game.node.entity.combat.spell.MagicSpell; -import core.game.node.entity.combat.spell.Runes; -import core.game.node.Node; -import core.game.node.entity.Entity; -import core.game.node.entity.combat.spell.SpellType; -import core.game.node.entity.player.Player; -import core.game.node.entity.player.link.SpellBookManager.SpellBook; -import core.game.node.item.Item; -import core.game.world.update.flag.context.Animation; -import core.game.world.update.flag.context.Graphics; -import core.plugin.Initializable; -import core.plugin.Plugin; -import org.rs09.consts.Sounds; - -import static core.api.ContentAPIKt.playGlobalAudio; - -/** - * Represents the humidify spell. - * @author 'Vexia - * @version 1.0 - */ -@Initializable -public final class HumidifySpell extends MagicSpell { - - /** - * Represents the animation of this graphics. - */ - private static final Animation ANIMATION = new Animation(6294); - - /** - * Repesents the graphick, next spells of this spell. - */ - private static final Graphics GRAPHIC = new Graphics(1061); - - /** - * Represents the empty vessels. - */ - private static final int[] EMPTY = { 229, 1831, 1829, 1827, 1825, 1925, 1923, 1935, 5331, 5332, 5333, 5334, 5335, 5337, 5338, 5339, 6667, 7688, 731, 1980, 434 }; - - /** - * Represents the full vessels. - */ - private static final int[] FULL = { 227, 1823, 1823, 1823, 1823, 1929, 1921, 1937, 5340, 5340, 5340, 5340, 5340, 5340, 5340, 5340, 6668, 7690, 732, 4458, 1761 }; - - /** - * Constructs a new {@code CureOtherSpell} {@code Object}. - */ - public HumidifySpell() { - super(SpellBook.LUNAR, 68, 65, ANIMATION, null, null, new Item[] { new Item(Runes.ASTRAL_RUNE.getId(), 1), new Item(Runes.WATER_RUNE.getId(), 3), new Item(Runes.FIRE_RUNE.getId(), 1) }); - } - - @Override - public Plugin<SpellType> newInstance(SpellType arg) throws Throwable { - SpellBook.LUNAR.register(7, this); - return this; - } - - @Override - public boolean cast(Entity entity, Node target) { - Player p = (Player) entity; - boolean good = false; - for (int i = 0; i < EMPTY.length; i++) { - if (p.getInventory().contains(EMPTY[i], 1)) { - good = true; - break; - } - } - if (!good) { - p.sendMessage("You need something which holds water in order to do this spell."); - return false; - } - if (!super.meetsRequirements(p, true, true)) { - return false; - } - p.lock(ANIMATION.getDuration() + 1); - p.animate(ANIMATION); - p.graphics(GRAPHIC); - playGlobalAudio(p.getLocation(), Sounds.LUNAR_HUMIDIFY_3614, 20); - for (int k = 0; k < 28; k++) { - for (int i = 0; i < 21; i++) { - if (p.getInventory().contains(EMPTY[i], 1)) { - if (p.getInventory().remove(new Item(EMPTY[i]))) { - p.getInventory().add(new Item(FULL[i])); - } - } - } - } - return true; - } - -} diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 7f37230802..870d4c4de8 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -303,6 +303,19 @@ class LunarListeners : SpellListener("lunar"), Commands { sendMessage(player, "::poison username damage") } } + define("humidifykit", privilege = Privilege.ADMIN) { player, _ -> + if(freeSlots(player) < 24) { + sendMessage(player, "Not enough free space.") + return@define + } else { + addItem(player, Items.ASTRAL_RUNE_9075, 100) + addItem(player, Items.WATER_RUNE_555, 300) + addItem(player, Items.FIRE_RUNE_554, 100) + for(item in HumidifyItems.values()) { + addItem(player, item.empty) + } + } + } } private fun plankMake(player: Player, item: Item) { @@ -699,15 +712,15 @@ class LunarListeners : SpellListener("lunar"), Commands { } queueScript(player) { - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061) // TODO: Add sound + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, Sounds.LUNAR_HUMIDIFY_3614, 20) for(item in playerEmpties) { val filled = HumidifyItems.forId(item.id) removeItem(player, item.id) && addItem(player, filled) - } return@queueScript stopExecuting(player) } } + } -- GitLab From d12d62e33a48d3186fbe2a664aa90ab1dc74cd6f Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sun, 27 Aug 2023 00:16:42 -0400 Subject: [PATCH 04/10] fix issue --- Server/src/main/content/global/skill/magic/lunar/LunarData.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarData.kt b/Server/src/main/content/global/skill/magic/lunar/LunarData.kt index 052749f22c..1d8c2522d8 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarData.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarData.kt @@ -72,8 +72,7 @@ enum class HumidifyItems(val empty: Int, val full: Int) { FISHBOWL(Items.FISHBOWL_6667, Items.FISHBOWL_6668), KETTLE(Items.KETTLE_7688, Items.FULL_KETTLE_7690), ENCHANTED_VIAL(Items.ENCHANTED_VIAL_731, Items.HOLY_WATER_732), - CUP(Items.EMPTY_CUP_1980, Items.CUP_OF_WATER_4458), - CLAY(Items.CLAY_434, Items.SOFT_CLAY_1761); + CUP(Items.EMPTY_CUP_1980, Items.CUP_OF_WATER_4458); companion object { private val productOfFill = values().associate { it.empty to it.full } fun forId(id: Int): Int { -- GitLab From 1aecff6731d9cb28c46417354fa6251e149f807d Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Mon, 28 Aug 2023 15:06:52 -0400 Subject: [PATCH 05/10] Literally unplayable 0/10 ign --- .../global/skill/magic/lunar/LunarListeners.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 870d4c4de8..0e5ceaf9d7 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -711,14 +711,18 @@ class LunarListeners : SpellListener("lunar"), Commands { return } + removeRunes(player) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, Sounds.LUNAR_HUMIDIFY_3614, 20) + for(item in playerEmpties) { + val filled = HumidifyItems.forId(item.id) + removeItem(player, item.id) && addItem(player, filled) + } + addXP(player, 65.0) + /** queueScript(player) { - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, Sounds.LUNAR_HUMIDIFY_3614, 20) - for(item in playerEmpties) { - val filled = HumidifyItems.forId(item.id) - removeItem(player, item.id) && addItem(player, filled) - } return@queueScript stopExecuting(player) } + */ } } -- GitLab From 09732a65c4d97615d6905391a12e9054875ab7aa Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Mon, 28 Aug 2023 17:38:52 -0400 Subject: [PATCH 06/10] delay the player by 3 ticks to lock --- .../src/main/content/global/skill/magic/lunar/LunarListeners.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 0e5ceaf9d7..8fc589ef3a 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -711,7 +711,9 @@ class LunarListeners : SpellListener("lunar"), Commands { return } + removeRunes(player) + delayEntity(player, 3) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, Sounds.LUNAR_HUMIDIFY_3614, 20) for(item in playerEmpties) { val filled = HumidifyItems.forId(item.id) -- GitLab From f9e430f5dbce5a58fc37d964e182e9231054a3ee Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sat, 2 Sep 2023 18:28:33 -0400 Subject: [PATCH 07/10] Fix graphics heights, add documentation --- .../global/skill/magic/SpellListener.kt | 21 +++++++++++++-- .../skill/magic/lunar/LunarListeners.kt | 26 +++++++++---------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/SpellListener.kt b/Server/src/main/content/global/skill/magic/SpellListener.kt index ce691f9d3e..e5938520c5 100644 --- a/Server/src/main/content/global/skill/magic/SpellListener.kt +++ b/Server/src/main/content/global/skill/magic/SpellListener.kt @@ -74,6 +74,14 @@ abstract class SpellListener(val bookName: String) : Listener { player.skills.addExperience(Skills.MAGIC,amount) } + /** + * @param player The player to visualize the spell on + * @param anim The animation object. I.e. Animation(Animations.LUNAR_SPELLBOOK_*) + * @param gfx The graphics object. I.e. Graphics(Graphics.LUNAR_SPELLBOOK_*, height in int) + * @param soundID The sound to play, either raw integer or from the Sounds ConstLib. Defaults to -1 (Nothing). + * @param delay The delay that should be applied before the sound plays, defaults to 0. + * @param global Whether the sound should be played globally instead of per-player. Defaults to true. + */ fun visualizeSpell(player: Player, anim: Animation, gfx: Graphics, soundID: Int = -1, delay: Int = 0, global: Boolean = true){ if(player.getAttribute("tablet-spell",false)) return player.visualize(anim, gfx) @@ -83,9 +91,18 @@ abstract class SpellListener(val bookName: String) : Listener { } } - fun visualizeSpell(player: Player, anim: Int, gfx: Int, soundID: Int = -1, delay: Int = 0, global: Boolean = true) { + /** + * @param player The player to visualize the spell on + * @param anim The integer ID of the animation, found in the Animations ConstLib. + * @param gfx The integer ID of the graphics to show, found in the Graphics ConstLib. + * @param height How high the graphics should display above the ground(?). Defaults to 100. + * @param soundID The sound to play, either raw integer or from the Sounds ConstLib. Defaults to -1 (Nothing). + * @param delay The delay that should be applied before the sound plays, defaults to 0. + * @param global Whether the sound should be played globally instead of per-player. Defaults to true. + */ + fun visualizeSpell(player: Player, anim: Int, gfx: Int, height: Int = 100, soundID: Int = -1, delay: Int = 0, global: Boolean = true) { if(player.getAttribute("tablet-spell",false)) return - player.visualize(Animation(anim), Graphics(gfx)) + player.visualize(Animation(anim), Graphics(gfx, height)) if(soundID != -1){ if(global) playGlobalAudio(player.location, soundID, delay) else playAudio(player, soundID, delay) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 8fc589ef3a..4ab73f5678 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -63,7 +63,7 @@ class LunarListeners : SpellListener("lunar"), Commands { removeRunes(player) addXP(player,63.0) setDelay(player,false) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_NPC_CONTACT_4413, Graphics.LUNAR_SPELLBOOK_NPC_CONTACT_728,3618) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_NPC_CONTACT_4413, Graphics.LUNAR_SPELLBOOK_NPC_CONTACT_728, 130,3618) } } @@ -330,7 +330,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } lock(player, 3) setDelay(player, false) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, 3617) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, 120, 3617) removeRunes(player) replaceSlot(player, item.slot, plankType.plank) addXP(player, 90.0) @@ -393,7 +393,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } player.faceLocation(npc.location) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STATSPY_6293, Graphics.LUNAR_SPELLBOOK_STAT_SPY_OVER_PLAYER_1060,3620) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STATSPY_6293, Graphics.LUNAR_SPELLBOOK_STAT_SPY_OVER_PLAYER_1060, soundID = 3620) removeRunes(player) addXP(player,66.0) setDelay(player,false) @@ -432,9 +432,9 @@ class LunarListeners : SpellListener("lunar"), Commands { override fun pulse(): Boolean { if(playerPies.isEmpty()) return true if(counter == 0) delay = Animation(Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413).definition.durationTicks + 1 - val item = playerPies.get(0) + val item = playerPies[0] val pie = CookableItems.forId(item.id) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413, Graphics.LUNAR_SPELLBOOK_BAKE_PIE_746, 2879) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413, Graphics.LUNAR_SPELLBOOK_BAKE_PIE_746, 75, 2879) addXP(player,60.0) player.skills.addExperience(Skills.COOKING,pie.experience) setDelay(player,false) @@ -492,7 +492,7 @@ class LunarListeners : SpellListener("lunar"), Commands { setDelay(player,false) if(removeItem(player, item) && addItem(player, strung)) { removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, 2903) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, soundID = 2903) rewardXP(player, Skills.CRAFTING, 4.0) addXP(player, 83.0) playerJewellery.remove(item) @@ -540,7 +540,7 @@ class LunarListeners : SpellListener("lunar"), Commands { if(index == size && size != 0) { removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, 2896) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, soundID = 2896) rewardXP(player, Skills.CRAFTING, 10.0) addXP(player, 78.0) } @@ -584,7 +584,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, 2880) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, soundID = 2880) curePoison(player) addXP(player, 69.0) playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900) @@ -594,7 +594,7 @@ class LunarListeners : SpellListener("lunar"), Commands { private fun cureGroup(player: Player) { requires(player, 74, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 2), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 2882) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, soundID = 2882) curePoison(player) for(acct in RegionManager.getLocalPlayers(player, 1)) { if(!acct.isActive || acct.locks.isInteractionLocked) { @@ -631,7 +631,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.LAW_RUNE_563), Item(Items.EARTH_RUNE_557, 10))) player.face(p) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 2886) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, soundID = 2886) visualize(p, -1, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736) playGlobalAudio(p.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) removeRunes(player, true) @@ -660,7 +660,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 91, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.LAW_RUNE_563, 2), Item(Items.NATURE_RUNE_561, 1))) player.face(p) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, 2885) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, soundID = 2885) visualize(p, -1, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738) val hp = floor(player.skills.lifepoints * 0.10) var r = hp @@ -691,7 +691,7 @@ class LunarListeners : SpellListener("lunar"), Commands { requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 2))) removeRunes(player, true) if(addItem(player, Items.HUNTER_KIT_11159)) { - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUNTER_KIT_6303, Graphics.LUNAR_SPELLBOOK_HUNTER_KIT_1074, 3615) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUNTER_KIT_6303, Graphics.LUNAR_SPELLBOOK_HUNTER_KIT_1074, soundID = 3615) addXP(player, 70.0) setDelay(player, 2) } @@ -713,7 +713,7 @@ class LunarListeners : SpellListener("lunar"), Commands { removeRunes(player) - delayEntity(player, 3) + delayEntity(player, Animation(Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294).duration) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, Sounds.LUNAR_HUMIDIFY_3614, 20) for(item in playerEmpties) { val filled = HumidifyItems.forId(item.id) -- GitLab From 07f204e94160d1720923f83c185e98b774e64dc7 Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sat, 2 Sep 2023 19:00:39 -0400 Subject: [PATCH 08/10] Add more heights --- .../content/global/skill/magic/SpellListener.kt | 4 ++-- .../global/skill/magic/lunar/LunarListeners.kt | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/SpellListener.kt b/Server/src/main/content/global/skill/magic/SpellListener.kt index e5938520c5..64383b0a75 100644 --- a/Server/src/main/content/global/skill/magic/SpellListener.kt +++ b/Server/src/main/content/global/skill/magic/SpellListener.kt @@ -95,12 +95,12 @@ abstract class SpellListener(val bookName: String) : Listener { * @param player The player to visualize the spell on * @param anim The integer ID of the animation, found in the Animations ConstLib. * @param gfx The integer ID of the graphics to show, found in the Graphics ConstLib. - * @param height How high the graphics should display above the ground(?). Defaults to 100. + * @param height How high the graphics should display above the ground(?). Defaults to 0. * @param soundID The sound to play, either raw integer or from the Sounds ConstLib. Defaults to -1 (Nothing). * @param delay The delay that should be applied before the sound plays, defaults to 0. * @param global Whether the sound should be played globally instead of per-player. Defaults to true. */ - fun visualizeSpell(player: Player, anim: Int, gfx: Int, height: Int = 100, soundID: Int = -1, delay: Int = 0, global: Boolean = true) { + fun visualizeSpell(player: Player, anim: Int, gfx: Int, height: Int = 0, soundID: Int = -1, delay: Int = 0, global: Boolean = true) { if(player.getAttribute("tablet-spell",false)) return player.visualize(Animation(anim), Graphics(gfx, height)) if(soundID != -1){ diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 4ab73f5678..17d45cf3ba 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -382,7 +382,7 @@ class LunarListeners : SpellListener("lunar"), Commands { patch.cureDisease() removeRunes(player) addXP(player,60.0) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_PLANT_4409, Graphics.LUNAR_SPELLBOOK_CURE_PLANT_748) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_PLANT_4409, Graphics.LUNAR_SPELLBOOK_CURE_PLANT_748, 100) setDelay(player,false) } @@ -492,7 +492,7 @@ class LunarListeners : SpellListener("lunar"), Commands { setDelay(player,false) if(removeItem(player, item) && addItem(player, strung)) { removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, soundID = 2903) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, 100, 2903) rewardXP(player, Skills.CRAFTING, 4.0) addXP(player, 83.0) playerJewellery.remove(item) @@ -540,7 +540,7 @@ class LunarListeners : SpellListener("lunar"), Commands { if(index == size && size != 0) { removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, soundID = 2896) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, 120, 2896) rewardXP(player, Skills.CRAFTING, 10.0) addXP(player, 78.0) } @@ -584,7 +584,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, soundID = 2880) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, 90, 2880) curePoison(player) addXP(player, 69.0) playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900) @@ -594,7 +594,7 @@ class LunarListeners : SpellListener("lunar"), Commands { private fun cureGroup(player: Player) { requires(player, 74, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 2), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, soundID = 2882) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 130, 2882) curePoison(player) for(acct in RegionManager.getLocalPlayers(player, 1)) { if(!acct.isActive || acct.locks.isInteractionLocked) { @@ -631,7 +631,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.LAW_RUNE_563), Item(Items.EARTH_RUNE_557, 10))) player.face(p) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, soundID = 2886) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 130, 2886) visualize(p, -1, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736) playGlobalAudio(p.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) removeRunes(player, true) @@ -660,7 +660,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 91, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.LAW_RUNE_563, 2), Item(Items.NATURE_RUNE_561, 1))) player.face(p) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, soundID = 2885) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, 90, 2885) visualize(p, -1, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738) val hp = floor(player.skills.lifepoints * 0.10) var r = hp @@ -714,7 +714,7 @@ class LunarListeners : SpellListener("lunar"), Commands { removeRunes(player) delayEntity(player, Animation(Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294).duration) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, Sounds.LUNAR_HUMIDIFY_3614, 20) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUMIDIFY_6294, Graphics.LUNAR_SPELLBOOK_HUMIDIFY_1061, 20, Sounds.LUNAR_HUMIDIFY_3614) for(item in playerEmpties) { val filled = HumidifyItems.forId(item.id) removeItem(player, item.id) && addItem(player, filled) -- GitLab From f1208293483256ac80ebbfba73dc65b42c2d9473 Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sun, 3 Sep 2023 16:23:46 -0400 Subject: [PATCH 09/10] Use the sounds from the constlib --- .../skill/magic/lunar/LunarListeners.kt | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 17d45cf3ba..04fe645ce3 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -330,7 +330,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } lock(player, 3) setDelay(player, false) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, 120, 3617) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, 120, Sounds.LUNAR_MAKE_PLANK_3617) removeRunes(player) replaceSlot(player, item.slot, plankType.plank) addXP(player, 90.0) @@ -382,7 +382,7 @@ class LunarListeners : SpellListener("lunar"), Commands { patch.cureDisease() removeRunes(player) addXP(player,60.0) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_PLANT_4409, Graphics.LUNAR_SPELLBOOK_CURE_PLANT_748, 100) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_PLANT_4409, Graphics.LUNAR_SPELLBOOK_CURE_PLANT_748, 100, Sounds.LUNAR_CURE_GROUP_2882) setDelay(player,false) } @@ -393,7 +393,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } player.faceLocation(npc.location) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STATSPY_6293, Graphics.LUNAR_SPELLBOOK_STAT_SPY_OVER_PLAYER_1060, soundID = 3620) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STATSPY_6293, Graphics.LUNAR_SPELLBOOK_STAT_SPY_OVER_PLAYER_1060, soundID = Sounds.LUNAR_STAT_SPY_3620) removeRunes(player) addXP(player,66.0) setDelay(player,false) @@ -434,7 +434,7 @@ class LunarListeners : SpellListener("lunar"), Commands { if(counter == 0) delay = Animation(Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413).definition.durationTicks + 1 val item = playerPies[0] val pie = CookableItems.forId(item.id) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413, Graphics.LUNAR_SPELLBOOK_BAKE_PIE_746, 75, 2879) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_BAKE_PIE_4413, Graphics.LUNAR_SPELLBOOK_BAKE_PIE_746, 75, Sounds.LUNAR_BAKE_PIE_2879) addXP(player,60.0) player.skills.addExperience(Skills.COOKING,pie.experience) setDelay(player,false) @@ -492,7 +492,7 @@ class LunarListeners : SpellListener("lunar"), Commands { setDelay(player,false) if(removeItem(player, item) && addItem(player, strung)) { removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, 100, 2903) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_STRING_JEWELLERY_4412, Graphics.LUNAR_SPELLBOOK_STRING_JEWELLERY_730, 100, Sounds.LUNAR_STRING_AMULET_2903) rewardXP(player, Skills.CRAFTING, 4.0) addXP(player, 83.0) playerJewellery.remove(item) @@ -540,7 +540,7 @@ class LunarListeners : SpellListener("lunar"), Commands { if(index == size && size != 0) { removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, 120, 2896) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_4413, Graphics.LUNAR_SPELLBOOK_SUPERGLASS_MAKE_729, 120, Sounds.LUNAR_HEATGLASS_2896) rewardXP(player, Skills.CRAFTING, 10.0) addXP(player, 78.0) } @@ -584,7 +584,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 1), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, 90, 2880) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_ME_4411, Graphics.LUNAR_SPELLBOOK_CURE_ME_742, 90, Sounds.LUNAR_CURE_2884) curePoison(player) addXP(player, 69.0) playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900) @@ -594,7 +594,7 @@ class LunarListeners : SpellListener("lunar"), Commands { private fun cureGroup(player: Player) { requires(player, 74, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.LAW_RUNE_563, 2), Item(Items.COSMIC_RUNE_564, 2))) removeRunes(player, true) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 130, 2882) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_GROUP_4409, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 130, Sounds.LUNAR_CURE_GROUP_2882) curePoison(player) for(acct in RegionManager.getLocalPlayers(player, 1)) { if(!acct.isActive || acct.locks.isInteractionLocked) { @@ -605,8 +605,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } curePoison(acct) sendMessage(acct, "You have been cured of poison.") - playGlobalAudio(acct.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) - visualize(acct, -1, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744) + visualizeSpell(acct, -1, Graphics.LUNAR_SPELLBOOK_CURE_GROUP_744, 130, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) } addXP(player, 74.0) } @@ -631,9 +630,8 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 68, arrayOf(Item(Items.ASTRAL_RUNE_9075, 1), Item(Items.LAW_RUNE_563), Item(Items.EARTH_RUNE_557, 10))) player.face(p) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 130, 2886) - visualize(p, -1, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736) - playGlobalAudio(p.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_CURE_OTHER_4411, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 130, Sounds.LUNAR_CURE_OTHER_2886) + visualizeSpell(p, -1, Graphics.LUNAR_SPELLBOOK_CURE_OTHER_736, 130, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889) removeRunes(player, true) curePoison(p) sendMessage(p, "You have been cured of poison.") @@ -660,7 +658,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } requires(player, 91, arrayOf(Item(Items.ASTRAL_RUNE_9075, 3), Item(Items.LAW_RUNE_563, 2), Item(Items.NATURE_RUNE_561, 1))) player.face(p) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, 90, 2885) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_ENERGY_TRANSFER_4411, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738, 90, Sounds.LUNAR_ENERGY_TRANSFER_2885) visualize(p, -1, Graphics.LUNAR_SPELLBOOK_ENERGY_TRANSFER_738) val hp = floor(player.skills.lifepoints * 0.10) var r = hp @@ -691,7 +689,7 @@ class LunarListeners : SpellListener("lunar"), Commands { requires(player, 71, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.EARTH_RUNE_557, 2))) removeRunes(player, true) if(addItem(player, Items.HUNTER_KIT_11159)) { - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUNTER_KIT_6303, Graphics.LUNAR_SPELLBOOK_HUNTER_KIT_1074, soundID = 3615) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_HUNTER_KIT_6303, Graphics.LUNAR_SPELLBOOK_HUNTER_KIT_1074, soundID = Sounds.LUNAR_HUNTER_KIT_3615) addXP(player, 70.0) setDelay(player, 2) } -- GitLab From 95367cf5f23465f17cb0aab9466a6dcca88d2155 Mon Sep 17 00:00:00 2001 From: bushtail <evannosich@icloud.com> Date: Sun, 3 Sep 2023 21:51:56 -0400 Subject: [PATCH 10/10] Anim -> Graphics plank make --- .../src/main/content/global/skill/magic/lunar/LunarListeners.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt index 04fe645ce3..5999c62072 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -330,7 +330,7 @@ class LunarListeners : SpellListener("lunar"), Commands { } lock(player, 3) setDelay(player, false) - visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, 120, Sounds.LUNAR_MAKE_PLANK_3617) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Graphics.LUNAR_SPELLBOOK_PLANK_MAKE_1063, 120, Sounds.LUNAR_MAKE_PLANK_3617) removeRunes(player) replaceSlot(player, item.slot, plankType.plank) addXP(player, 90.0) -- GitLab