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