fix(Scripts/BlackMorass): Adds should walk towards Medivh. (#14945)
This commit is contained in:
@@ -248,14 +248,14 @@ void MotionMaster::MoveRandom(float wanderDistance)
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MoveTargetedHome()
|
||||
void MotionMaster::MoveTargetedHome(bool walk /*= false*/)
|
||||
{
|
||||
Clear(false);
|
||||
|
||||
if (_owner->GetTypeId() == TYPEID_UNIT && !_owner->ToCreature()->GetCharmerOrOwnerGUID())
|
||||
{
|
||||
LOG_DEBUG("movement.motionmaster", "Creature ({}) targeted home", _owner->GetGUID().ToString());
|
||||
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
|
||||
Mutate(new HomeMovementGenerator<Creature>(walk), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else if (_owner->GetTypeId() == TYPEID_UNIT && _owner->ToCreature()->GetCharmerOrOwnerGUID())
|
||||
{
|
||||
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
}
|
||||
|
||||
void MoveIdle();
|
||||
void MoveTargetedHome();
|
||||
void MoveTargetedHome(bool walk = false);
|
||||
void MoveRandom(float wanderDistance = 0.0f);
|
||||
void MoveFollow(Unit* target, float dist, float angle, MovementSlot slot = MOTION_SLOT_ACTIVE);
|
||||
void MoveChase(Unit* target, std::optional<ChaseRange> dist = {}, std::optional<ChaseAngle> angle = {});
|
||||
|
||||
@@ -65,7 +65,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature* owner)
|
||||
|
||||
owner->UpdateAllowedPositionZ(x, y, z);
|
||||
init.MoveTo(x, y, z, DisableMgr::IsPathfindingEnabled(owner->FindMap()), true);
|
||||
init.SetWalk(false);
|
||||
init.SetWalk(_walk);
|
||||
init.Launch();
|
||||
|
||||
arrived = false;
|
||||
|
||||
@@ -29,7 +29,7 @@ template <>
|
||||
class HomeMovementGenerator<Creature> : public MovementGeneratorMedium< Creature, HomeMovementGenerator<Creature> >
|
||||
{
|
||||
public:
|
||||
HomeMovementGenerator() : arrived(false), i_recalculateTravel(false) {}
|
||||
HomeMovementGenerator(bool walk) : arrived(false), i_recalculateTravel(false), _walk(walk) {}
|
||||
~HomeMovementGenerator() {}
|
||||
|
||||
void DoInitialize(Creature*);
|
||||
@@ -43,5 +43,6 @@ private:
|
||||
void _setTargetLocation(Creature*);
|
||||
bool arrived : 1;
|
||||
bool i_recalculateTravel : 1;
|
||||
bool _walk;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user