fix(premium): final grooming of OnBeforeTeleport
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user