diff options
author | Wyrserth <43747507+Wyrserth@users.noreply.github.com> | 2019-06-02 21:40:55 +0200 |
---|---|---|
committer | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-06-02 21:40:55 +0200 |
commit | d365dd915715d4608ae69fa54f094ab65f02e984 (patch) | |
tree | 65d78c9acfd998f5498def63806d185ec5b5a91b /src | |
parent | 9b1dfe5e5e968c6ee3a2682ae2106735daeccbd7 (diff) |
Core/SAI: add action_param3 to SMART_ACTION_REMOVEAURASFROMSPELL to allow it to remove only auras from spells that were cast by the entity itself. (#23345)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 12 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index d5b59d88272..cdd2a310349 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -863,13 +863,21 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.action.removeAura.spell) { + ObjectGuid casterGUID; + if (e.action.removeAura.onlyOwnedAuras) + { + if (!me) + break; + casterGUID = me->GetGUID(); + } + if (e.action.removeAura.charges) { - if (Aura* aur = target->ToUnit()->GetAura(e.action.removeAura.spell)) + if (Aura* aur = target->ToUnit()->GetAura(e.action.removeAura.spell, casterGUID)) aur->ModCharges(-static_cast<int32>(e.action.removeAura.charges), AURA_REMOVE_BY_EXPIRE); } else - target->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); + target->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell, casterGUID); } else target->ToUnit()->RemoveAllAuras(); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index f2e9d4b55de..729190e8928 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -721,6 +721,7 @@ struct SmartAction { uint32 spell; uint32 charges; + uint32 onlyOwnedAuras; } removeAura; struct |