mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 20:22:23 -04:00
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)
This commit is contained in:
committed by
Giacomo Pozzoni
parent
9b1dfe5e5e
commit
d365dd9157
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user