fix(Core/Unit): rework Walk/Run mode (#22988)

Co-authored-by: sudlud <sudlud@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
killerwife
2025-10-14 22:54:19 +02:00
committed by GitHub
parent c28f635408
commit 10d5a3c553
104 changed files with 373 additions and 362 deletions

View File

@@ -521,7 +521,7 @@ public:
}
//pPlayer->ClearUnitState(UNIT_STATE_ONVEHICLE);
Movement::MoveSplineInit init(pPlayer);
Movement::MoveSplineInit init(pPlayer); // TODO: has to be removed and handled with vehicle exit and vehicle enter code
init.MoveTo(CenterPos.GetPositionX(), CenterPos.GetPositionY(), CenterPos.GetPositionZ());
init.SetFacing(pPlayer->GetOrientation());
init.SetTransportExit();
@@ -898,9 +898,9 @@ public:
{
Player* plr = pass->ToPlayer();
float speed = plr->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1.0f * 0.001f);
plr->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed);
plr->SetDisableGravity(false); // packet only would lead to issues elsewhere
plr->GetMotionMaster()->MoveCharge(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed);
plr->RemoveAura(SPELL_FREEZE_ANIM);
plr->SetDisableGravity(false, true);
plr->SetGuidValue(PLAYER_FARSIGHT, ObjectGuid::Empty);
sScriptMgr->AnticheatSetCanFlybyServer(plr, false);
@@ -998,7 +998,7 @@ public:
MoveTimer = 0;
me->GetMotionMaster()->MoveIdle();
me->DisableSpline();
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.05f, 7.0f);
me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.05f, FORCED_MOVEMENT_NONE, 7.0f);
break;
}
}
@@ -1013,8 +1013,7 @@ public:
MoveTimer = 0;
me->GetMotionMaster()->MoveIdle();
me->DisableSpline();
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), 100.0f);
me->SetPosition(me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), me->GetOrientation());
me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), CenterPos.GetPositionZ(), FORCED_MOVEMENT_NONE, 100.0f);
me->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->RemoveAura(SPELL_POWER_SPARK_VISUAL);
me->CastSpell(me, SPELL_POWER_SPARK_GROUND_BUFF, true);