Core/Movement: waypoint movement

Port From (https://github.com/TrinityCore/TrinityCore/commit/97585597f0b1aff93873fe4d757556731bc0c1b2)
This commit is contained in:
hondacrx
2020-08-24 17:02:02 -04:00
parent c9e535bb3a
commit 3d3fd0f55f
31 changed files with 960 additions and 950 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ namespace Game
return;
// Stop the npc if moving
unit.StopMoving();
unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
BattlegroundTypeId bgTypeId = Global.BattlegroundMgr.GetBattleMasterBG(unit.GetEntry());
+2 -2
View File
@@ -340,8 +340,8 @@ namespace Game
if (!seamlessTeleport)
{
// short preparations to continue flight
FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().Top();
flight.Initialize(GetPlayer());
IMovementGenerator movementGenerator = GetPlayer().GetMotionMaster().Top();
movementGenerator.Initialize(GetPlayer());
}
return;
}
+3 -5
View File
@@ -143,9 +143,8 @@ namespace Game
GetPlayer().RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Talk);
// and if he has pure gossip or is banker and moves or is tabard designer?
//if (unit->IsArmorer() || unit->IsCivilian() || unit->IsQuestGiver() || unit->IsServiceProvider() || unit->IsGuard())
unit.StopMoving();
// Stop the npc if moving
unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
// If spiritguide, no need for gossip menu, just put player into resurrect queue
if (unit.IsSpiritGuide())
@@ -464,8 +463,7 @@ namespace Game
GetPlayer().RemoveAurasByType(AuraType.FeignDeath);
// Stop the npc if moving
if (vendor.HasUnitState(UnitState.Moving))
vendor.StopMoving();
vendor.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
VendorItemData vendorItems = vendor.GetVendorItems();
int rawItemCount = vendorItems != null ? vendorItems.GetItemCount() : 0;
+2 -1
View File
@@ -71,8 +71,9 @@ namespace Game
// remove fake death
if (GetPlayer().HasUnitState(UnitState.Died))
GetPlayer().RemoveAurasByType(AuraType.FeignDeath);
// Stop the npc if moving
creature.StopMoving();
creature.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
_player.PlayerTalkClass.ClearMenus();
if (creature.GetAI().GossipHello(_player))
+1 -2
View File
@@ -130,8 +130,7 @@ namespace Game
if (GetPlayer().HasUnitState(UnitState.Died))
GetPlayer().RemoveAurasByType(AuraType.FeignDeath);
while (GetPlayer().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Flight)
GetPlayer().GetMotionMaster().MovementExpired(false);
GetPlayer().GetMotionMaster().Clear(MovementSlot.Controlled);
if (mountDisplayId != 0)
GetPlayer().Mount(mountDisplayId);