fix(premium): final grooming of OnBeforeTeleport
This commit is contained in:
@@ -41,16 +41,14 @@ local function IsPremium(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function OnPremiumPlayer(player)
|
local function OnPremiumPlayer(player)
|
||||||
if not IsPremium(player) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
player:SendAreaTriggerMessage(
|
player:SendAreaTriggerMessage(
|
||||||
'На вашем аккаунте активна подписка Premium! Благодарим за поддержку проекта MoonWell.')
|
'На вашем аккаунте активна подписка Premium! Благодарим за поддержку проекта MoonWell.')
|
||||||
|
|
||||||
player:LearnSpell(SUMMON_SQUIRE_SPELL_ID)
|
player:LearnSpell(SUMMON_SQUIRE_SPELL_ID)
|
||||||
player:SendBroadcastMessage("Милостью Элуны вам была выдана способность |cff71d5ff|Hspell:" ..
|
player:SendBroadcastMessage("Милостью Элуны вам была выдана способность |cff71d5ff|Hspell:" ..
|
||||||
SUMMON_SQUIRE_SPELL_ID .. "|h[" .. "Призыв Оруженосца]h|")
|
SUMMON_SQUIRE_SPELL_ID .. "|h[" .. "Призыв Оруженосца]h|")
|
||||||
|
|
||||||
|
player:RemoveSpellCooldown(HEARTHSTONE_SPELL_ID)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function RefreshPremiumStatus(player)
|
local function RefreshPremiumStatus(player)
|
||||||
@@ -189,8 +187,11 @@ end
|
|||||||
local function OnBeforeTeleport(event, player, mapid, x, y, z, orientation, options, target)
|
local function OnBeforeTeleport(event, player, mapid, x, y, z, orientation, options, target)
|
||||||
if not IsPremium(player) then return end
|
if not IsPremium(player) then return end
|
||||||
|
|
||||||
if player:FindCurrentSpellBySpellId(HEARTHSTONE_SPELL_ID) then
|
-- Get current channeled spell (SpellType 2)
|
||||||
player:ResetSpellCooldown(HEARTHSTONE_SPELL_ID, true)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user