fix(ICC/Sindragosa): add a cooldown to proccing Unchained Magic (#18901)
* add cooldown to proc * convert to spell and aurascript pair macro * remove no longer needed validate override * set cooldown with Cooldown field in table spell_proc_event
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
--
|
||||||
|
UPDATE `spell_proc_event` SET `Cooldown`=600 WHERE `entry`=69762;
|
||||||
@@ -869,14 +869,9 @@ private:
|
|||||||
bool _removeHealers;
|
bool _removeHealers;
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_sindragosa_unchained_magic : public SpellScriptLoader
|
class spell_sindragosa_unchained_magic : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_sindragosa_unchained_magic);
|
||||||
spell_sindragosa_unchained_magic() : SpellScriptLoader("spell_sindragosa_unchained_magic") { }
|
|
||||||
|
|
||||||
class spell_sindragosa_unchained_magic_SpellScript : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_sindragosa_unchained_magic_SpellScript);
|
|
||||||
|
|
||||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||||
{
|
{
|
||||||
@@ -896,58 +891,7 @@ public:
|
|||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_unchained_magic_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sindragosa_unchained_magic::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
|
||||||
return new spell_sindragosa_unchained_magic_SpellScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
class spell_sindragosa_unchained_magic_AuraScript : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_sindragosa_unchained_magic_AuraScript);
|
|
||||||
|
|
||||||
std::map<uint32, uint32> _lastMSTimeForSpell;
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
_lastMSTimeForSpell.clear();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CheckProc(ProcEventInfo& eventInfo)
|
|
||||||
{
|
|
||||||
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
|
|
||||||
if (!spellInfo)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
uint32 currMSTime = GameTime::GetGameTimeMS().count();
|
|
||||||
std::map<uint32, uint32>::iterator itr = _lastMSTimeForSpell.find(spellInfo->Id);
|
|
||||||
if (itr != _lastMSTimeForSpell.end())
|
|
||||||
{
|
|
||||||
uint32 lastMSTime = itr->second;
|
|
||||||
itr->second = currMSTime;
|
|
||||||
if (getMSTimeDiff(lastMSTime, currMSTime) < 600)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastMSTimeForSpell[spellInfo->Id] = currMSTime;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
DoCheckProc += AuraCheckProcFn(spell_sindragosa_unchained_magic_AuraScript::CheckProc);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
AuraScript* GetAuraScript() const override
|
|
||||||
{
|
|
||||||
return new spell_sindragosa_unchained_magic_AuraScript();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2012,7 +1956,7 @@ void AddSC_boss_sindragosa()
|
|||||||
new boss_sindragosa();
|
new boss_sindragosa();
|
||||||
new npc_ice_tomb();
|
new npc_ice_tomb();
|
||||||
new spell_sindragosa_s_fury();
|
new spell_sindragosa_s_fury();
|
||||||
new spell_sindragosa_unchained_magic();
|
RegisterSpellScript(spell_sindragosa_unchained_magic);
|
||||||
new spell_sindragosa_permeating_chill();
|
new spell_sindragosa_permeating_chill();
|
||||||
new spell_sindragosa_instability();
|
new spell_sindragosa_instability();
|
||||||
new spell_sindragosa_icy_grip();
|
new spell_sindragosa_icy_grip();
|
||||||
|
|||||||
Reference in New Issue
Block a user