feat(Core/SAI): Implement SMART_ACTION_DISMOUNT (206) (#20899)

This commit is contained in:
Andrew
2024-12-12 02:11:42 -03:00
committed by GitHub
parent 4c54f7e171
commit d94dda9d93
4 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
--
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 23580);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(23580, 0, 0, 1, 2, 0, 100, 1, 30, 30, 0, 0, 0, 0, 11, 43274, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 30-30% Health - Cast \'Dismount Bear\' (No Repeat)'),
(23580, 0, 1, 2, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 0-19% Health - Set Flag Standstate Stand Up (No Repeat)'),
(23580, 0, 2, 3, 61, 0, 100, 3, 0, 0, 0, 0, 0, 0, 11, 40743, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 0-30% Health - Cast \'Frenzy\' (No Repeat)'),
(23580, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - Between 30-30% Health - Dismount'),
(23580, 0, 4, 0, 0, 0, 100, 2, 0, 0, 12000, 12000, 0, 0, 11, 43273, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - In Combat - Cast \'Cleave\' (No Repeat)'),
(23580, 0, 5, 0, 0, 0, 100, 2, 5000, 5000, 20000, 20000, 0, 0, 11, 42496, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Amani\'shi Warbringer - In Combat - Cast \'Furious Roar\' (No Repeat)');

View File

@@ -2605,6 +2605,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, nullptr, eventId);
break;
}
case SMART_ACTION_DISMOUNT:
{
for (WorldObject* const target : targets)
if (IsUnit(target))
target->ToUnit()->Dismount();
break;
}
case SMART_ACTION_SET_HOVER:
{
for (WorldObject* target : targets)

View File

@@ -2015,6 +2015,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_FLEE:
case SMART_ACTION_ADD_THREAT:
case SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT:
case SMART_ACTION_DISMOUNT:
case SMART_ACTION_SET_HOVER:
case SMART_ACTION_ADD_IMMUNITY:
case SMART_ACTION_REMOVE_IMMUNITY:

View File

@@ -705,7 +705,7 @@ enum SMART_ACTION
SMART_ACTION_EXIT_VEHICLE = 203, // none
SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS = 204, // flags
SMART_ACTION_SET_COMBAT_DISTANCE = 205, // combatDistance
// UNUSED = 206,
SMART_ACTION_DISMOUNT = 206,
SMART_ACTION_SET_HOVER = 207, // 0/1
SMART_ACTION_ADD_IMMUNITY = 208, // type, id, value
SMART_ACTION_REMOVE_IMMUNITY = 209, // type, id, value