From 1df95daa5a5138bc0a622b58c72d6b64e40397f6 Mon Sep 17 00:00:00 2001 From: gasaichandesu Date: Sat, 22 Aug 2026 21:30:16 +0400 Subject: [PATCH] fix(premium): final grooming of OnBeforeTeleport --- lua_scripts/MWPremium/mwpremium.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lua_scripts/MWPremium/mwpremium.lua b/lua_scripts/MWPremium/mwpremium.lua index 7005181df..b9b494f48 100644 --- a/lua_scripts/MWPremium/mwpremium.lua +++ b/lua_scripts/MWPremium/mwpremium.lua @@ -41,16 +41,14 @@ local function IsPremium(player) end local function OnPremiumPlayer(player) - if not IsPremium(player) then - return - end - player:SendAreaTriggerMessage( 'На вашем аккаунте активна подписка Premium! Благодарим за поддержку проекта MoonWell.') player:LearnSpell(SUMMON_SQUIRE_SPELL_ID) player:SendBroadcastMessage("Милостью Элуны вам была выдана способность |cff71d5ff|Hspell:" .. SUMMON_SQUIRE_SPELL_ID .. "|h[" .. "Призыв Оруженосца]h|") + + player:RemoveSpellCooldown(HEARTHSTONE_SPELL_ID) end local function RefreshPremiumStatus(player) @@ -189,8 +187,11 @@ end local function OnBeforeTeleport(event, player, mapid, x, y, z, orientation, options, target) if not IsPremium(player) then return end - if player:FindCurrentSpellBySpellId(HEARTHSTONE_SPELL_ID) then - player:ResetSpellCooldown(HEARTHSTONE_SPELL_ID, true) + -- Get current channeled spell (SpellType 2) + local current_spell = player:GetCurrentSpell(2) + + if current_spell ~= nil and current_spell:GetEntry() == HEARTHSTONE_SPELL_ID then + player:ResetSpellCooldown(HEARTHSTONE_SPELL_ID) end end