feat(Core/SmartAI): Add support for waypoint_data in SAI (#18706)

* Create rev_1712670662273633900.sql

* eol?

* doesn't like a comment at the end, ok, ok

* init

* mack

* Update SmartScript.cpp

* kurzel

* random paths and garg

* Update rev_1712889530436412200.sql

* brend & marge

* Update rev_1712889530436412200.sql

* movement actions

* Update SmartScriptMgr.h
This commit is contained in:
Gultask
2024-04-18 10:31:41 -03:00
committed by GitHub
parent 5386443388
commit 6f154d0a6b
6 changed files with 813 additions and 2 deletions

View File

@@ -634,6 +634,9 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data)
if (MovementType == POINT_MOTION_TYPE && Data == SMART_ESCORT_LAST_OOC_POINT)
me->ClearUnitState(UNIT_STATE_EVADE);
if (MovementType == WAYPOINT_MOTION_TYPE)
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_DATA_REACHED, nullptr, Data + 1); // Data + 1 to align smart_scripts and waypoint_data Id rows
GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, nullptr, MovementType, Data);
if (!HasEscortState(SMART_ESCORT_ESCORTING))
return;
@@ -1150,6 +1153,11 @@ void SmartAI::OnSpellClick(Unit* clicker, bool& /*result*/)
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);
}
void SmartAI::PathEndReached(uint32 pathId)
{
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_DATA_ENDED, nullptr, 0, me->GetWaypointPath());
}
void SmartGameObjectAI::SummonedCreatureDies(Creature* summon, Unit* /*killer*/)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SUMMONED_UNIT_DIES, summon);