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:
Wyrserth
2019-06-02 21:40:55 +02:00
committed by Giacomo Pozzoni
parent 9b1dfe5e5e
commit d365dd9157
2 changed files with 11 additions and 2 deletions

View File

@@ -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();