mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Combat/threat rewrite prep - merge RBAC/DB changes.
This commit is contained in:
File diff suppressed because one or more lines are too long
2
sql/updates/auth/3.3.5/2017_06_28_00_auth.sql
Normal file
2
sql/updates/auth/3.3.5/2017_06_28_00_auth.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `rbac_permissions` SET `name`="Command: debug combat" WHERE `id`=309;
|
||||
10
sql/updates/world/3.3.5/2017_06_28_01_world.sql
Normal file
10
sql/updates/world/3.3.5/2017_06_28_01_world.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
--
|
||||
UPDATE `command` SET `name`="debug combat", `help`="Syntax: .debug combat
|
||||
|
||||
Lists the target's (or own) combat references." WHERE `name` IN ("debug hostil","debug combat");
|
||||
UPDATE `command` SET `help`="Syntax: .debug threat
|
||||
|
||||
Lists the units threatened by target (or self). If target has a threat list, lists that threat list, too." WHERE `name`="debug threat";
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_warr_vigilance_redirect_threat";
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (59665,"spell_warr_vigilance_redirect_threat");
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user