Core/SmartAI: implemented SMART_EVENT_EVENT_PHASE_CHANGE
- Use instead of Update + event_phase_mask when action needs to be synchronized
This commit is contained in:
1 parent
e05083ad4b
commit
206c82ead4
4 files changed
+72
-23
No files matched your search
@@ -675,6 +675,27 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
if (!IsTextValid(e, e.event.textOver.textGroupID))
|
||||
return false;
|
||||
break;
|
||||
case SMART_EVENT_EVENT_PHASE_CHANGE:
|
||||
{
|
||||
if (!e.event.eventPhaseChange.phasemask)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has no param set, event won't be executed!.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.event.eventPhaseChange.phasemask > SMART_EVENT_PHASE_ALL)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid phasemask %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.eventPhaseChange.phasemask);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.event.event_phase_mask && !(e.event.event_phase_mask & e.event.eventPhaseChange.phasemask))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses event phasemask %u and incompatible event_param1 %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.event_phase_mask, e.event.eventPhaseChange.phasemask);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_IS_BEHIND_TARGET:
|
||||
{
|
||||
if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax))
|
||||
|
||||
Reference in new issue
Block a user