Core/Movement: Allow setting position or object facing targets for jump movement

This commit is contained in:
Shauren
2024-06-21 15:35:12 +02:00
parent 721103c1c9
commit ac73edc268
14 changed files with 48 additions and 32 deletions

View File

@@ -258,7 +258,7 @@ class StartLaunchEvent : public BasicEvent
float dist = player->GetExactDist2d(&_pos);
player->ExitVehicle();
player->GetMotionMaster()->MoveJump(_pos, dist, speedZ, EVENT_JUMP, true);
player->GetMotionMaster()->MoveJump(_pos, dist, speedZ, EVENT_JUMP, _pos.GetOrientation());
return true;
}

View File

@@ -148,7 +148,7 @@ struct boss_lava_guard_gordoth : public BossAI
me->SetAIAnimKitId(ANIMKIT_GORDOTH_NONE);
DoCastSelf(SPELL_JAIL_BREAK);
me->GetMotionMaster()->MoveJumpWithGravity(GordothJumpPos, 50.0f, 55.5477f, POINT_JUMP, true);
me->GetMotionMaster()->MoveJumpWithGravity(GordothJumpPos, 50.0f, 55.5477f, POINT_JUMP, GordothJumpPos.GetOrientation());
scheduler.Schedule(30ms, [this](TaskContext /*task*/)
{

View File

@@ -488,7 +488,7 @@ struct boss_toc_champion_controller : public BossAI
else
{
champion->SetHomePosition((ToCCommonLoc[1].GetPositionX()*2)-vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 3);
champion->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), vChampionJumpTarget[pos].GetOrientation(), 20.0f, 20.0f);
champion->GetMotionMaster()->MoveJump((ToCCommonLoc[1].GetPositionX() * 2) - vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 20.0f, 20.0f);
champion->SetOrientation(3);
}
}

View File

@@ -451,7 +451,7 @@ class boss_mimiron : public CreatureScript
DoCastAOE(SPELL_DESPAWN_ASSAULT_BOTS);
me->ExitVehicle();
// ExitVehicle() offset position is not implemented, so we make up for that with MoveJump()...
me->GetMotionMaster()->MoveJump(me->GetPositionX() + (10.f * std::cos(me->GetOrientation())), me->GetPositionY() + (10.f * std::sin(me->GetOrientation())), me->GetPositionZ(), me->GetOrientation(), 10.f, 5.f);
me->GetMotionMaster()->MoveJump(me->GetPositionX() + (10.f * std::cos(me->GetOrientation())), me->GetPositionY() + (10.f * std::sin(me->GetOrientation())), me->GetPositionZ(), 10.f, 5.f);
events.ScheduleEvent(EVENT_OUTTRO_1, 7s);
}

View File

@@ -709,7 +709,7 @@ class boss_thorim : public CreatureScript
me->SetReactState(REACT_AGGRESSIVE);
me->SetDisableGravity(false);
me->SetControlled(false, UNIT_STATE_ROOT);
me->GetMotionMaster()->MoveJump(2134.8f, -263.056f, 419.983f, me->GetOrientation(), 30.0f, 20.0f);
me->GetMotionMaster()->MoveJump(2134.8f, -263.056f, 419.983f, 30.0f, 20.0f);
events.ScheduleEvent(EVENT_START_PERIODIC_CHARGE, 2s, 0, PHASE_2);
events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 15s, 0, PHASE_2);
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 20s, 0, PHASE_2);