Core/SAI: If spell id in SMART_ACTION_REMOVEAURASFROMSPELL is 0, remove all auras instead

Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
Nay
2012-06-02 14:28:24 +01:00
parent adcd4e0a5d
commit cffcf633c3
3 changed files with 7 additions and 3 deletions

View File

@@ -789,7 +789,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsUnit((*itr)))
continue;
(*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell);
if (e.action.removeAura.spell == 0)
(*itr)->ToUnit()->RemoveAllAuras();
else
(*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell);
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u",
(*itr)->GetGUIDLow(), e.action.removeAura.spell);
}

View File

@@ -709,7 +709,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
break;
case SMART_ACTION_REMOVEAURASFROMSPELL:
if (!IsSpellValid(e, e.action.removeAura.spell))
if (e.action.removeAura.spell != 0 && !IsSpellValid(e, e.action.removeAura.spell))
return false;
break;
case SMART_ACTION_RANDOM_PHASE:

View File

@@ -398,7 +398,7 @@ enum SMART_ACTION
SMART_ACTION_FLEE_FOR_ASSIST = 25, // With Emote
SMART_ACTION_CALL_GROUPEVENTHAPPENS = 26, // QuestID
SMART_ACTION_CALL_CASTEDCREATUREORGO = 27, // CreatureId, SpellId
SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid
SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid, 0 removes all auras
SMART_ACTION_FOLLOW = 29, // Distance (0 = default), Angle (0 = default), EndCreatureEntry, credit, creditType (0monsterkill, 1event)
SMART_ACTION_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3...
SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax