mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 04:32:35 -04:00
Core/Conditions: Implemented SAI conditions, only usable with events in which the invoker is a player.
sourceType = 22 sourceEntry = entryorguid sourceGroup = eventId + 1 sourceId = SAI sourceType (0 = creature, 1 = gameobject, etc) Also refactored some code Signed-off-by: Subv2112 <s.v.h21@hotmail.com>
This commit is contained in:
@@ -84,7 +84,20 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3
|
||||
continue;
|
||||
|
||||
if (eventType == e/* && (!(*i).event.event_phase_mask || IsInPhase((*i).event.event_phase_mask)) && !((*i).event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE && (*i).runOnce)*/)
|
||||
ProcessEvent(*i, unit, var0, var1, bvar, spell, gob);
|
||||
{
|
||||
bool meets = true;
|
||||
if (unit)
|
||||
{
|
||||
if (Player* player = unit->ToPlayer())
|
||||
{
|
||||
ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type);
|
||||
meets = sConditionMgr->IsPlayerMeetToConditions(player, conds);
|
||||
}
|
||||
}
|
||||
|
||||
if (meets)
|
||||
ProcessEvent(*i, unit, var0, var1, bvar, spell, gob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user