mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Conditions: Allow to set SAI conditions to both the invoker and the object using ConditionTarget column.
ConditionTarget 0 = invoker ConditionTarget 1 = object Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
@@ -85,14 +85,9 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3
|
||||
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)*/)
|
||||
{
|
||||
bool meets = true;
|
||||
if (unit)
|
||||
{
|
||||
if (Player* player = unit->ToPlayer())
|
||||
{
|
||||
ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type);
|
||||
meets = sConditionMgr->IsObjectMeetToConditions(player, conds);
|
||||
}
|
||||
}
|
||||
ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type);
|
||||
ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject());
|
||||
meets = sConditionMgr->IsObjectMeetToConditionList(info, conds);
|
||||
|
||||
if (meets)
|
||||
ProcessEvent(*i, unit, var0, var1, bvar, spell, gob);
|
||||
|
||||
@@ -36,7 +36,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
// object not present, return false
|
||||
if (!object)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Condition object not found");
|
||||
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Condition object not found for condition (Entry: %u Type: %u Group: %u)", mSourceEntry, mSourceType, mSourceGroup);
|
||||
return false;
|
||||
}
|
||||
bool condMeets = false;
|
||||
@@ -334,6 +334,8 @@ uint32 Condition::GetMaxAvailableConditionTargets()
|
||||
{
|
||||
case CONDITION_SOURCE_TYPE_SPELL:
|
||||
return 2;
|
||||
case CONDITION_SOURCE_TYPE_SMART_EVENT:
|
||||
return 2;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user