feat(premium): zero cooldown hearthstone for premium players

This commit is contained in:
gasaichandesu
2026-08-22 19:15:00 +04:00
parent 86cb8811b1
commit 73c4349fa9
5 changed files with 317 additions and 314 deletions
+11
View File
@@ -2,11 +2,13 @@ local PLAYER_EVENT_ON_LOGIN = 3
local PLAYER_EVENT_ON_SPELL_CAST = 5
local PLAYER_EVENT_ON_LOGOUT = 4
local PLAYER_EVENT_ON_COMMAND = 42
local PLAYER_EVENT_ON_BEFORE_TELEPORT = 67
local ACCOUNT_FLAG_RECURRING_BILLING = 8192
local SUMMON_SQUIRE_SPELL_ID = 80000
local HEARTHSTONE_SPELL_ID = 8690
local SQUIRE_CREATURE_TEMPLATE_ID = 9000001
@@ -184,9 +186,18 @@ local function OnLogout(event, player)
squires_table[player:GetGUID()] = nil
end
local function OnBeforeTeleport(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)
end
end
RegisterCreatureGossipEvent(SQUIRE_CREATURE_TEMPLATE_ID, 1, OnGossipHello)
RegisterCreatureGossipEvent(SQUIRE_CREATURE_TEMPLATE_ID, 2, OnGossipSelect)
RegisterPlayerEvent(PLAYER_EVENT_ON_LOGIN, OnLogin)
RegisterPlayerEvent(PLAYER_EVENT_ON_LOGOUT, OnLogout)
RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, OnCommand)
RegisterPlayerEvent(PLAYER_EVENT_ON_SPELL_CAST, OnSpellCast)
RegisterPlayerEvent(PLAYER_EVENT_ON_BEFORE_TELEPORT, OnBeforeTeleport)