Port relevant cooldown category handling and Duel Cooldown reset script

Core/Spells: Cooldown updates
Core/Player: implement ResetCoolDownAfterDuel configurable feature
Core/Player rewritten duel CD reset system
Core/Spells: fixed some rare stealth/prowl visual bugs after duel cd reset
Core/Spells: Improved spell category cooldown handling

* Category cooldown is stored with the spell that started the cooldown (and only resetting cooldown on that spell will clear cooldowns on entire category - this fully mirrors client behavior)
* This significantly reduces the amount of data saved to database for cooldowns
* Spell casts from items that have a different category specified than on spell will now check for cooldown during the cast

Core/Misc: Warning fix
Scripts/DuelReset:

- impemented health and mana reset
- do not reset anything when duel is interrupted

Scripts/DuelReset:

- fixed druid mana restoration
- fixed bug when a player accepts duel with a spel on onHold true (like when stealth of rogue/druid is active)

Core/Spells: Fixed Raise Dead cooldown
Core/Spells: Fixed typo in ecbbcc8972
Core/Spell: fixed possible exploit in Duel Reset script

- thanks @Runico for reporting it

Scripts/DuelReset:

- do not reset when duel is fled
- minor improvement to SpellHistory::RestoreCooldonStateAfter duel method
This commit is contained in:
ariel- committed 2016-01-11 14:51:30 -03:00
1 parent e25514f0f8
commit 446cb1e5c5
19 files changed
+421 -172

No files matched your search

+10
View File
@@ -1331,6 +1331,15 @@ class spell_dk_raise_dead : public SpellScriptLoader
GetCaster()->CastSpell(targets, spellInfo, NULL, TRIGGERED_FULL_MASK);
}
void OverrideCooldown()
{
// Because the ghoul is summoned by one of triggered spells SendCooldownEvent is not sent for this spell
// but the client has locked it by itself so we need some link between this spell and the real spell summoning.
// Luckily such link already exists - spell category
// This starts infinite category cooldown which can later be used by SendCooldownEvent to send packet for this spell
GetCaster()->GetSpellHistory()->StartCooldown(GetSpellInfo(), 0, nullptr, true);
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_dk_raise_dead_SpellScript::CheckCast);
@@ -1339,6 +1348,7 @@ class spell_dk_raise_dead : public SpellScriptLoader
OnCast += SpellCastFn(spell_dk_raise_dead_SpellScript::ConsumeReagents);
OnEffectHitTarget += SpellEffectFn(spell_dk_raise_dead_SpellScript::HandleRaiseDead, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectHitTarget += SpellEffectFn(spell_dk_raise_dead_SpellScript::HandleRaiseDead, EFFECT_2, SPELL_EFFECT_DUMMY);
AfterCast += SpellCastFn(spell_dk_raise_dead_SpellScript::OverrideCooldown);
}
private: