Port commit 56186319bdd41dd26b6cc14f84e6e41eef5d953b (6.x branch)

Core/Spells: Cooldown updates

Updates #14418
This commit is contained in:
ariel- committed 2015-04-13 12:13:46 -03:00
1 parent 61aa5ec412
commit e707905764
35 files changed
+1043 -1093

No files matched your search

+9 -8
View File
@@ -24,6 +24,7 @@
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellHistory.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "SkillDiscovery.h"
@@ -1349,7 +1350,7 @@ class spell_item_red_rider_air_rifle : public SpellScriptLoader
caster->CastSpell(caster, SPELL_AIR_RIFLE_HOLD_VISUAL, true);
// needed because this spell shares GCD with its triggered spells (which must not be cast with triggered flag)
if (Player* player = caster->ToPlayer())
player->GetGlobalCooldownMgr().CancelGlobalCooldown(GetSpellInfo());
player->GetSpellHistory()->CancelGlobalCooldown(GetSpellInfo());
if (urand(0, 4))
caster->CastSpell(target, SPELL_AIR_RIFLE_SHOOT, false);
else
@@ -2368,7 +2369,7 @@ class spell_item_rocket_boots : public SpellScriptLoader
if (Battleground* bg = caster->GetBattleground())
bg->EventPlayerDroppedFlag(caster);
caster->RemoveSpellCooldown(SPELL_ROCKET_BOOTS_PROC);
caster->GetSpellHistory()->ResetCooldown(SPELL_ROCKET_BOOTS_PROC);
caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL);
}
@@ -2548,14 +2549,14 @@ class spell_item_refocus : public SpellScriptLoader
if (!caster || caster->getClass() != CLASS_HUNTER)
return;
if (caster->HasSpellCooldown(SPELL_AIMED_SHOT))
caster->RemoveSpellCooldown(SPELL_AIMED_SHOT, true);
if (caster->GetSpellHistory()->HasCooldown(SPELL_AIMED_SHOT))
caster->GetSpellHistory()->ResetCooldown(SPELL_AIMED_SHOT, true);
if (caster->HasSpellCooldown(SPELL_MULTISHOT))
caster->RemoveSpellCooldown(SPELL_MULTISHOT, true);
if (caster->GetSpellHistory()->HasCooldown(SPELL_MULTISHOT))
caster->GetSpellHistory()->ResetCooldown(SPELL_MULTISHOT, true);
if (caster->HasSpellCooldown(SPELL_VOLLEY))
caster->RemoveSpellCooldown(SPELL_VOLLEY, true);
if (caster->GetSpellHistory()->HasCooldown(SPELL_VOLLEY))
caster->GetSpellHistory()->ResetCooldown(SPELL_VOLLEY, true);
}
void Register() override