diff options
author | Wyrserth <43747507+Wyrserth@users.noreply.github.com> | 2019-06-02 21:40:55 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-10 21:12:25 +0100 |
commit | d037c6b08634c5d0d4cc0462ae28e15baf8498bb (patch) | |
tree | 0ee584f48b6c67047f741d1943f15eb4c5309d8c /src | |
parent | 84010d23722498f84ea7aac481b69e28e4dbe39d (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)
(cherry picked from commit d365dd915715d4608ae69fa54f094ab65f02e984)
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 bc2ddfa8556..569f0bc2595 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -890,13 +890,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 d442dfd5469..62713df6331 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -752,6 +752,7 @@ struct SmartAction { uint32 spell; uint32 charges; + uint32 onlyOwnedAuras; } removeAura; struct |