From 9295c91a7d3e08e89e4f35b50d5cdfe469dc94a4 Mon Sep 17 00:00:00 2001 From: randy Date: Mon, 4 Nov 2024 20:37:26 -0700 Subject: [PATCH] Plank Make now automatically recasts on matching logs --- .../skill/magic/lunar/LunarListeners.kt | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 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 ca302bfba..ba2483cc7 100644 --- a/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt +++ b/Server/src/main/content/global/skill/magic/lunar/LunarListeners.kt @@ -677,12 +677,28 @@ Max-hit:${npc.getSwingHandler(false).calculateHit(npc, player, 1.0)}""", Compone sendMessage(player, "You need to use this spell on logs.") return } - /* + player.pulseManager.run(object : Pulse() { + var counter = 0 + override fun pulse(): Boolean { + removeAttribute(player, "spell:runes") + if (amountInInventory(player, item.id) == 0 ) + return true + requires(player, 86, arrayOf(Item(Items.ASTRAL_RUNE_9075, 2), Item(Items.NATURE_RUNE_561, 1), Item(Items.EARTH_RUNE_557, 15))) + if(removeItem(player, item.id) && addItem(player, plankType.plank.id)) { + removeRunes(player, false) + if (counter % 6 == 0) + visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Graphics.LUNAR_SPELLBOOK_PLANK_MAKE_1063, 120, Sounds.LUNAR_MAKE_PLANK_3617) + addXP(player, 90.0) + } + counter++ + return false + } + }) + /* Vanilla Spell if (amountInInventory(player, Items.COINS_995) < plankType.price || !removeItem(player, Item(Items.COINS_995, plankType.price))) { sendMessage(player, "You need ${plankType.price} coins to convert that log into a plank.") return } - */ lock(player, 3) setDelay(player, false) visualizeSpell(player, Animations.LUNAR_SPELLBOOK_PLANK_MAKE_6298, Graphics.LUNAR_SPELLBOOK_PLANK_MAKE_1063, 120, Sounds.LUNAR_MAKE_PLANK_3617) @@ -690,6 +706,7 @@ Max-hit:${npc.getSwingHandler(false).calculateHit(npc, player, 1.0)}""", Compone replaceSlot(player, item.slot, plankType.plank) addXP(player, 90.0) showMagicTab(player) + */ } // Level 91