mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[9830] Implement taxi/transport event scripts support.
This commit is contained in:
parent
e54c919adb
commit
3f5eccd8a9
9 changed files with 77 additions and 32 deletions
|
|
@ -356,10 +356,14 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
|||
i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE);
|
||||
if (i_destinationHolder.HasArrived())
|
||||
{
|
||||
DoEventIfAny(player,(*i_path)[i_currentNode],false);
|
||||
|
||||
uint32 curMap = (*i_path)[i_currentNode].mapid;
|
||||
++i_currentNode;
|
||||
if (MovementInProgress())
|
||||
{
|
||||
DoEventIfAny(player,(*i_path)[i_currentNode],true);
|
||||
|
||||
DEBUG_LOG("loading node %u for player %s", i_currentNode, player.GetName());
|
||||
if ((*i_path)[i_currentNode].mapid == curMap)
|
||||
{
|
||||
|
|
@ -368,7 +372,6 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
//else HasArrived()
|
||||
}
|
||||
else
|
||||
return true;
|
||||
|
|
@ -398,6 +401,15 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
|
|||
}
|
||||
}
|
||||
|
||||
void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure)
|
||||
{
|
||||
if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID)
|
||||
{
|
||||
DEBUG_LOG("Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName());
|
||||
player.GetMap()->ScriptsStart(sEventScripts, eventid, &player, &player);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Unique1's ASTAR Pathfinding Code... For future use & reference...
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue