feat(Core/SmartScripts): SMART_ACTION_ATTACK_STOP #10053

This commit is contained in:
IntelligentQuantum
2022-01-07 10:49:32 +03:30
committed by GitHub
parent 3085f64e50
commit 2e6213d526
3 changed files with 20 additions and 1 deletions

View File

@@ -1475,6 +1475,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
break;
}
case SMART_ACTION_ATTACK_STOP:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
{
break;
}
for (auto const& target : *targets)
{
if (Unit* unitTarget = target->ToUnit())
{
unitTarget->AttackStop();
}
}
break;
}
case SMART_ACTION_SUMMON_CREATURE:
{
ObjectList* targets = GetTargets(e, unit);

View File

@@ -1300,6 +1300,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_CU_ENCOUNTER_START:
case SMART_ACTION_DO_ACTION:
case SMART_ACTION_SET_CORPSE_DELAY:
case SMART_ACTION_ATTACK_STOP:
break;
default:
LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);

View File

@@ -650,8 +650,9 @@ enum SMART_ACTION
SMART_ACTION_VORTEX_SUMMON = 221, // entry, duration (0 = perm), spiral scaling, spiral appearance, range max, phi_delta <-- yes confusing math, try it ingame and see, my lovely AC boys!
SMART_ACTION_CU_ENCOUNTER_START = 222, // Resets cooldowns on all targets and removes Heroism debuff(s)
SMART_ACTION_DO_ACTION = 223, // ActionId
SMART_ACTION_ATTACK_STOP = 224, //
SMART_ACTION_AC_END = 224, // placeholder
SMART_ACTION_AC_END = 225, // placeholder
};
struct SmartAction