mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
feat(Core/Travel): Emit NODE_TELEPORT for teleport-spell edges; add HandleSpecialMovement consumer
This commit is contained in:
parent
a24e1b033c
commit
f8f3de001b
@ -3283,7 +3283,36 @@ bool MovementAction::HandleSpecialMovement(TravelPath& path)
|
||||
return bot->ActivateTaxiPathTo(route, flightMaster, 0);
|
||||
}
|
||||
|
||||
// NODE_TELEPORT consumer not yet re-added; falls through.
|
||||
case PathNodeType::NODE_TELEPORT:
|
||||
{
|
||||
if (!next.entry)
|
||||
return false;
|
||||
|
||||
// Can't cast while flying — let the bot land first.
|
||||
bool const canCastNow = !bot->IsFlying();
|
||||
|
||||
// Hearthstone (item 8690) — fire if available and not flying high.
|
||||
if (next.entry == 8690)
|
||||
{
|
||||
if (canCastNow)
|
||||
return botAI->DoSpecificAction("hearthstone",
|
||||
Event("move action"), true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Other teleport spells: dismount, drop shapeshift, queue cast.
|
||||
// Skipped while flying high — caller's next-tick walk handles
|
||||
// the descent.
|
||||
if (!canCastNow)
|
||||
return false;
|
||||
if (bot->IsMounted())
|
||||
bot->Dismount();
|
||||
botAI->RemoveShapeshift();
|
||||
return botAI->DoSpecificAction(
|
||||
"cast",
|
||||
Event("rpg action", std::to_string(next.entry)), true);
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1217,6 +1217,14 @@ TravelPath TravelNodeRoute::BuildPath(std::vector<WorldPosition> pathToStart, st
|
||||
// Full taxi waypoint route; same reasoning as transport.
|
||||
travelPath.addPath(nodePath->GetPath(), PathNodeType::NODE_FLIGHTPATH, nodePath->getPathObject());
|
||||
}
|
||||
else if (nodePath->getPathType() == TravelNodePathType::teleportSpell)
|
||||
{
|
||||
// Hearthstone or spell-cast teleport edge: emit a paired
|
||||
// NODE_TELEPORT (entry = exit) so HandleSpecialMovement can
|
||||
// dispatch the cast when the head reaches the entry point.
|
||||
travelPath.addPoint(*prevNode->getPosition(), PathNodeType::NODE_TELEPORT, nodePath->getPathObject());
|
||||
travelPath.addPoint(*node->getPosition(), PathNodeType::NODE_TELEPORT, nodePath->getPathObject());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<WorldPosition> path = nodePath->GetPath();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user