mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/SAI: implement SMART_ACTION_ATTACK_STOP
Unlike SMART_ACTION_AUTO_ATTACK, this action is actually stopping the entire attack procedure, rather than just hack-disabling auto-attacks. Keep in mind that this action requires a passive react state to prevent a immediate AttackStart ai reaction
This commit is contained in:
@@ -1164,6 +1164,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_ATTACK_STOP:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
if (Unit* unitTarget = target->ToUnit())
|
||||
unitTarget->AttackStop();
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_MOVE_OFFSET:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
|
||||
@@ -1595,6 +1595,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
|
||||
case SMART_ACTION_CALL_FOR_HELP:
|
||||
case SMART_ACTION_SET_DATA:
|
||||
case SMART_ACTION_ATTACK_STOP:
|
||||
case SMART_ACTION_SET_VISIBILITY:
|
||||
case SMART_ACTION_WP_PAUSE:
|
||||
case SMART_ACTION_SET_DISABLE_GRAVITY:
|
||||
|
||||
@@ -496,6 +496,7 @@ enum SMART_ACTION
|
||||
SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to dismount)
|
||||
SMART_ACTION_SET_INGAME_PHASE_MASK = 44, // mask
|
||||
SMART_ACTION_SET_DATA = 45, // Field, Data (only creature @todo)
|
||||
SMART_ACTION_ATTACK_STOP = 46, //
|
||||
SMART_ACTION_SET_VISIBILITY = 47, // on/off
|
||||
SMART_ACTION_SET_ACTIVE = 48, // on/off
|
||||
SMART_ACTION_ATTACK_START = 49, //
|
||||
|
||||
Reference in New Issue
Block a user