mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 04:02:53 -04:00
Core/Scripts: Extended SMART_ACTION_SET_INST_DATA to also set BossStates. (#16739)
Scripts/Dire Maul: Initialize boss states array so it may be called from SmartAI. (Ref #6429)
(cherry picked from commit d1d0c64ad1)
# Conflicts:
# src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
This commit is contained in:
@@ -1157,6 +1157,23 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_INST_DATA:
|
||||
{
|
||||
if (e.action.setInstanceData.type > 1)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Entry %u SourceType %u Event %u Action %u uses invalid data type %u (value range 0-1), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setInstanceData.type);
|
||||
return false;
|
||||
}
|
||||
else if (e.action.setInstanceData.type == 1)
|
||||
{
|
||||
if (e.action.setInstanceData.data > TO_BE_DECIDED)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Entry %u SourceType %u Event %u Action %u uses invalid boss state %u (value range 0-5), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setInstanceData.data);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_INGAME_PHASE_ID:
|
||||
{
|
||||
uint32 phaseId = e.action.ingamePhaseId.id;
|
||||
@@ -1210,7 +1227,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_ATTACK_START:
|
||||
case SMART_ACTION_THREAT_ALL_PCT:
|
||||
case SMART_ACTION_THREAT_SINGLE_PCT:
|
||||
case SMART_ACTION_SET_INST_DATA:
|
||||
case SMART_ACTION_SET_INST_DATA64:
|
||||
case SMART_ACTION_AUTO_ATTACK:
|
||||
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
|
||||
|
||||
Reference in New Issue
Block a user