mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
fix(Core/SAI) Add missing parameters for SMART_ACTION_MOVE_TO_POS (#1813)
* Imported changes from TC Game/AI: Implement ContactDistance for ACTION_MOVE_TO_POS * Contactdistance * We don't have disablePathFinding * Update src/server/game/AI/SmartScripts/SmartScript.cpp Co-Authored-By: Pondaveia <43385840+Pondaveia@users.noreply.github.com> * Update src/server/game/AI/SmartScripts/SmartScript.cpp * Update SmartScriptMgr.h * Update src/server/game/AI/SmartScripts/SmartScript.cpp Co-Authored-By: Stoabrogga <38475780+Stoabrogga@users.noreply.github.com>
This commit is contained in:
@@ -1888,9 +1888,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else // Xinef: we can use dest.x, dest.y, dest.z to make offset :)
|
||||
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
|
||||
else // Xinef: we can use dest.x, dest.y, dest.z to make offset
|
||||
{
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
if (e.action.MoveToPos.ContactDistance > 0)
|
||||
target->GetContactPoint(me, x, y, z, e.action.MoveToPos.ContactDistance);
|
||||
me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, x + e.target.x, y + e.target.y, z + e.target.z, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_MOVE_TO_POS_TARGET:
|
||||
|
||||
@@ -499,7 +499,7 @@ enum SMART_ACTION
|
||||
SMART_ACTION_SET_ORIENTATION = 66, //
|
||||
SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance
|
||||
SMART_ACTION_PLAYMOVIE = 68, // entry
|
||||
SMART_ACTION_MOVE_TO_POS = 69, // PointId, xyz
|
||||
SMART_ACTION_MOVE_TO_POS = 69, // PointId (optional x,y,z offset), transport, controlled, ContactDistance
|
||||
SMART_ACTION_RESPAWN_TARGET = 70, // force / goRespawnTime
|
||||
SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set
|
||||
SMART_ACTION_CLOSE_GOSSIP = 72, // none
|
||||
@@ -1048,6 +1048,7 @@ struct SmartAction
|
||||
uint32 pointId;
|
||||
uint32 transport;
|
||||
uint32 controlled;
|
||||
uint32 ContactDistance;
|
||||
} MoveToPos;
|
||||
|
||||
struct
|
||||
|
||||
Reference in New Issue
Block a user