Core/SAI: Allow dropping a specific amount of aura charges using SMART_ACTION_REMOVEAURASFROMSPELL (action_param2).

This commit is contained in:
Discover-
2014-11-02 17:30:44 +01:00
parent 97692b4cc1
commit ed4feec276
2 changed files with 11 additions and 2 deletions

View File

@@ -778,7 +778,15 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
continue;
if (e.action.removeAura.spell)
(*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell);
{
if (e.action.removeAura.charges)
{
if (Aura* aur = (*itr)->ToUnit()->GetAura(e.action.removeAura.spell))
aur->ModCharges(-e.action.removeAura.charges, AURA_REMOVE_BY_EXPIRE);
}
else
(*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell);
}
else
(*itr)->ToUnit()->RemoveAllAuras();