mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
feat(Core/SmartScripts) Implement SMART_TARGET_VEHICLE_PASSENGER (#3510)
This commit is contained in:
@@ -3855,6 +3855,17 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
delete units;
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_VEHICLE_PASSENGER:
|
||||
{
|
||||
if (me && me->IsVehicle())
|
||||
{
|
||||
if (Unit* target = me->GetVehicleKit()->GetPassenger(e.target.vehicle.seat))
|
||||
{
|
||||
l->push_back(target);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_NONE:
|
||||
case SMART_TARGET_POSITION:
|
||||
default:
|
||||
|
||||
@@ -402,7 +402,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
e.entryOrGuid, e.event_id, e.GetTargetType());
|
||||
return false;
|
||||
}
|
||||
if (e.target.type == SMART_TARGET_LOOT_RECIPIENTS || e.target.type == SMART_TARGET_VEHICLE_PASSENGER)
|
||||
if (e.target.type == SMART_TARGET_LOOT_RECIPIENTS)
|
||||
{
|
||||
sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has a target type that is not yet supported on AzerothCore (%u), skipped.",
|
||||
e.entryOrGuid, e.event_id, e.GetTargetType());
|
||||
|
||||
@@ -1307,7 +1307,7 @@ enum SMARTAI_TARGETS
|
||||
SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
|
||||
SMART_TARGET_LOOT_RECIPIENTS = 27, // TODO: NOT SUPPORTED YET
|
||||
SMART_TARGET_FARTHEST = 28, // maxDist, playerOnly, isInLos
|
||||
SMART_TARGET_VEHICLE_PASSENGER = 29, // TODO: NOT SUPPORTED YET
|
||||
SMART_TARGET_VEHICLE_PASSENGER = 29, // seat number (vehicle can target it's own accessory)
|
||||
|
||||
SMART_TARGET_TC_END = 30, // placeholder
|
||||
|
||||
@@ -1472,6 +1472,11 @@ struct SmartTarget
|
||||
uint32 param3;
|
||||
uint32 param4;
|
||||
} raw;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 seat;
|
||||
} vehicle;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user