diff options
author | treeston <treeston.mmoc@gmail.com> | 2017-06-28 17:25:49 +0200 |
---|---|---|
committer | treeston <treeston.mmoc@gmail.com> | 2017-06-28 17:27:34 +0200 |
commit | e35092c6a164e929f9684b350093b2beefee5d86 (patch) | |
tree | ab3c412ccacf1ca3bd03e51788550109ed0886f8 /src | |
parent | 7a558e538a256b6ce705096028b09f155a1a4600 (diff) |
Combat/threat rewrite prep - merge RBAC/DB changes.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Accounts/RBAC.h | 2 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 44 |
3 files changed, 34 insertions, 16 deletions
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index cb547216841..8fc5f220d43 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -214,7 +214,7 @@ enum RBACPermissions RBAC_PERM_COMMAND_DEBUG_GETITEMSTATE = 306, RBAC_PERM_COMMAND_DEBUG_GETITEMVALUE = 307, RBAC_PERM_COMMAND_DEBUG_GETVALUE = 308, - RBAC_PERM_COMMAND_DEBUG_HOSTIL = 309, + RBAC_PERM_COMMAND_DEBUG_COMBAT = 309, RBAC_PERM_COMMAND_DEBUG_ITEMEXPIRE = 310, RBAC_PERM_COMMAND_DEBUG_LOOTRECIPIENT = 311, RBAC_PERM_COMMAND_DEBUG_LOS = 312, diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index c7319760bc7..ea9024a30a3 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -72,7 +72,7 @@ public: { { "setbit", rbac::RBAC_PERM_COMMAND_DEBUG_SETBIT, false, &HandleDebugSet32BitCommand, "" }, { "threat", rbac::RBAC_PERM_COMMAND_DEBUG_THREAT, false, &HandleDebugThreatListCommand, "" }, - { "hostil", rbac::RBAC_PERM_COMMAND_DEBUG_HOSTIL, false, &HandleDebugHostileRefListCommand, "" }, + { "combat", rbac::RBAC_PERM_COMMAND_DEBUG_COMBAT, false, &HandleDebugCombatListCommand, "" }, { "anim", rbac::RBAC_PERM_COMMAND_DEBUG_ANIM, false, &HandleDebugAnimCommand, "" }, { "arena", rbac::RBAC_PERM_COMMAND_DEBUG_ARENA, true, &HandleDebugArenaCommand, "" }, { "bg", rbac::RBAC_PERM_COMMAND_DEBUG_BG, true, &HandleDebugBattlegroundCommand, "" }, @@ -862,7 +862,7 @@ public: return true; } - static bool HandleDebugHostileRefListCommand(ChatHandler* handler, char const* /*args*/) + static bool HandleDebugCombatListCommand(ChatHandler* handler, char const* /*args*/) { Unit* target = handler->getSelectedUnit(); if (!target) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index c9a428e722e..4c859f5c8bc 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -1058,17 +1058,6 @@ class spell_warr_vigilance : public SpellScriptLoader target->CastSpell(caster, SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT, true); } - void HandleAfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - //! WORKAROUND - //! this glyph is a proc - if (Unit* caster = GetCaster()) - { - if (AuraEffect const* glyph = caster->GetAuraEffect(SPELL_WARRIOR_GLYPH_OF_VIGILANCE, EFFECT_0)) - GetTarget()->ModifyRedirectThreat(glyph->GetAmount()); - } - } - void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); @@ -1098,7 +1087,6 @@ class spell_warr_vigilance : public SpellScriptLoader void Register() override { OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - AfterEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::HandleAfterApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); DoCheckProc += AuraCheckProcFn(spell_warr_vigilance_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_warr_vigilance_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); @@ -1113,7 +1101,36 @@ class spell_warr_vigilance : public SpellScriptLoader } }; -// 50725 - Vigilance +// 59665 - Vigilance (Redirect Threat) +class spell_warr_vigilance_redirect_threat : public SpellScriptLoader +{ + public: + spell_warr_vigilance_redirect_threat() : SpellScriptLoader("spell_warr_vigilance_redirect_threat") { } + + class spell_warr_vigilance_redirect_threat_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_vigilance_redirect_threat_SpellScript); + + void CheckGlyph(SpellEffIndex /*effIndex*/) + { + if (Unit* warrior = GetHitUnit()) + if (AuraEffect const* glyph = warrior->GetAuraEffect(SPELL_WARRIOR_GLYPH_OF_VIGILANCE, EFFECT_0)) + SetEffectValue(GetEffectValue() + glyph->GetAmount()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_warr_vigilance_redirect_threat_SpellScript::CheckGlyph, EFFECT_0, SPELL_EFFECT_REDIRECT_THREAT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_warr_vigilance_redirect_threat_SpellScript(); + } +}; + +// 50725 - Vigilance (Reset Taunt Cooldown) class spell_warr_vigilance_trigger : public SpellScriptLoader { public: @@ -1171,5 +1188,6 @@ void AddSC_warrior_spell_scripts() new spell_warr_sword_and_board(); new spell_warr_t3_prot_8p_bonus(); new spell_warr_vigilance(); + new spell_warr_vigilance_redirect_threat(); new spell_warr_vigilance_trigger(); } |