Core/Movement: Replace MotionMaster::MoveJumpWithGravity with new jump height based MoveJump

This commit is contained in:
Shauren
2025-11-24 12:07:19 +01:00
parent ed599208ea
commit 95ca714824
13 changed files with 112 additions and 87 deletions

View File

@@ -246,7 +246,7 @@ struct boss_ymiron_the_fallen_king : public BossAI
me->RemoveAurasDueToSpell(SPELL_KNEELING);
scheduler.Schedule(2s, [this](TaskContext /*task*/)
{
me->GetMotionMaster()->MoveJumpWithGravity(YmironIntroJumpPos, 24.0f, 25.31545448303222656, EVENT_JUMP);
me->GetMotionMaster()->MoveJump(EVENT_JUMP, YmironIntroJumpPos, 24.0f, 2.0f);
});
}

View File

@@ -216,7 +216,7 @@ struct npc_kayn_sunfury_invasion_begins : public ScriptedAI
me->SendPlaySpellVisualKit(SPELL_VISUAL_KIT_KAYN_WINGS, 4, 3000);
me->PlayObjectSound(SOUND_SPELL_DOUBLE_JUMP, me->GetGUID(), summonerPlayer);
me->SendPlaySpellVisualKit(SPELL_VISUAL_KIT_KAYN_DOUBLE_JUMP, 0, 0);
me->GetMotionMaster()->MoveJumpWithGravity(KaynDoubleJumpPosition, 24.0, 0.9874f, POINT_KAYN_MOVE_TO_DEMON);
me->GetMotionMaster()->MoveJump(POINT_KAYN_MOVE_TO_DEMON, KaynDoubleJumpPosition, 24.0f, {}, 1.5f);
}
else if (pointId == POINT_KAYN_MOVE_TO_DEMON)
{
@@ -244,7 +244,7 @@ struct npc_jayce_darkweaver_invasion_begins : public ScriptedAI
if (pathId == PATH_JAYCE_INVASION_BEGINS)
{
me->CastSpell(nullptr, SPELL_DEMON_HUNTER_GLIDE_STATE, true);
me->GetMotionMaster()->MoveJumpWithGravity(JayceJumpPos, 12.0f, 15.2792f, POINT_ILLIDARI_LAND_POS);
me->GetMotionMaster()->MoveJump(POINT_ILLIDARI_LAND_POS, JayceJumpPos, 12.0f, {}, 5.0f);
}
else if (pathId == PATH_JAYCE_JUMP_INVASION_BEGINS)
me->DespawnOrUnsummon();
@@ -273,7 +273,7 @@ struct npc_allari_the_souleater_invasion_begins : public ScriptedAI
if (pathId == PATH_ALLARI_INVASION_BEGINS)
{
me->CastSpell(nullptr, SPELL_DEMON_HUNTER_GLIDE_STATE, true);
me->GetMotionMaster()->MoveJumpWithGravity(AllariJumpPos, 12.0f, 9.2722f, POINT_ILLIDARI_LAND_POS);
me->GetMotionMaster()->MoveJump(POINT_ILLIDARI_LAND_POS, AllariJumpPos, 12.0f, {}, 5.0f);
}
else if (pathId == PATH_ALLARI_JUMP_INVASION_BEGINS)
me->DespawnOrUnsummon();
@@ -302,7 +302,7 @@ struct npc_korvas_bloodthorn_invasion_begins : public ScriptedAI
if (pathId == PATH_KORVAS_INVASION_BEGINS)
{
me->SendPlaySpellVisualKit(SPELL_VISUAL_KIT_KORVAS_JUMP, 4, 2000);
me->GetMotionMaster()->MoveJumpWithGravity(KorvasJumpPos, 24.0f, 19.2911f, POINT_ILLIDARI_LAND_POS);
me->GetMotionMaster()->MoveJump(POINT_ILLIDARI_LAND_POS, KorvasJumpPos, 24.0f, {}, 5.0f);
}
else if (pathId == PATH_KORVAS_JUMP_INVASION_BEGINS)
me->DespawnOrUnsummon();
@@ -331,7 +331,7 @@ struct npc_sevis_brightflame_invasion_begins : public ScriptedAI
if (pathId == PATH_SEVIS_INVASION_BEGINS)
{
me->CastSpell(nullptr, SPELL_DEMON_HUNTER_GLIDE_STATE, true);
me->GetMotionMaster()->MoveJumpWithGravity(SevisJumpPos, 12.0f, 13.3033f, POINT_ILLIDARI_LAND_POS);
me->GetMotionMaster()->MoveJump(POINT_ILLIDARI_LAND_POS, SevisJumpPos, 12.0f, {}, 5.0f);
}
else if (pathId == PATH_SEVIS_JUMP_INVASION_BEGINS)
me->DespawnOrUnsummon();
@@ -360,7 +360,7 @@ struct npc_cyana_nightglaive_invasion_begins : public ScriptedAI
if (pathId == PATH_CYANA_INVASION_BEGINS)
{
me->CastSpell(nullptr, SPELL_DEMON_HUNTER_GLIDE_STATE, true);
me->GetMotionMaster()->MoveJumpWithGravity(CyanaJumpPos, 12.0f, 8.4555f, POINT_ILLIDARI_LAND_POS);
me->GetMotionMaster()->MoveJump(POINT_ILLIDARI_LAND_POS, CyanaJumpPos, 12.0f, {}, 5.0f);
}
else if (pathId == PATH_CYANA_JUMP_INVASION_BEGINS)
me->DespawnOrUnsummon();
@@ -501,7 +501,7 @@ public:
kaynClone->PlayObjectSound(SOUND_METAL_WEAPON_UNSHEATH, kaynClone->GetGUID(), player);
kaynClone->SendPlaySpellVisualKit(SPELL_VISUAL_KIT_KAYN_GLIDE, 4, 3000);
kaynClone->SendPlaySpellVisualKit(SPELL_VISUAL_KIT_KAYN_WINGS, 4, 4000);
kaynClone->GetMotionMaster()->MoveJumpWithGravity(KaynJumpPos, 20.5f, 396.3535f, POINT_KAYN_TRIGGER_DOUBLE_JUMP);
kaynClone->GetMotionMaster()->MoveJump(POINT_KAYN_TRIGGER_DOUBLE_JUMP, KaynJumpPos, 23.0f, 1.5f);
kaynClone->SetSheath(SHEATH_STATE_MELEE);
kaynClone->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
@@ -1850,7 +1850,7 @@ struct npc_jayce_darkweaver_cryptic_hollow_private : public ScriptedAI
return;
if (pointId == POINT_JAYCE_DARKWEAVER_PREPARE_JUMP)
me->GetMotionMaster()->MoveJumpWithGravity(JayceJumpPosition, 19.880844f, 32.78205f, POINT_JAYCE_DARKWEAVER_JUMP_TO_CAVE);
me->GetMotionMaster()->MoveJump(POINT_JAYCE_DARKWEAVER_JUMP_TO_CAVE, JayceJumpPosition, 20.0f, 4.0f);
else if (pointId == POINT_JAYCE_DARKWEAVER_JUMP_TO_CAVE)
{
me->GetMotionMaster()->MovePath(PATH_JAYCE_DARKWEAVER_RUN_INTO_CAVE, false);

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, GordothJumpPos.GetOrientation());
me->GetMotionMaster()->MoveJump(POINT_JUMP, GordothJumpPos, 50.0f, 4.0f);
scheduler.Schedule(30ms, [this](TaskContext /*task*/)
{
@@ -166,6 +166,7 @@ struct boss_lava_guard_gordoth : public BossAI
{
DoCast(SPELL_GROUND_SLAM);
me->SetHomePosition(GordothJumpPos);
me->SetFacingTo(GordothJumpPos.GetOrientation());
std::vector<GameObject*> labVialsList;
GetGameObjectListWithEntryInGrid(labVialsList, me, GO_LAB_VIAL, 25.0f);

View File

@@ -156,7 +156,7 @@ struct boss_lord_waycrest : public BossAI
void JustEngagedWith(Unit* /*who*/) override
{
DoCastSelf(SPELL_LORD_WAYCREST_DUMMY_ABSORB);
me->GetMotionMaster()->MoveJumpWithGravity(LordWaycrestCombatPosition, 20.0f, 15.1852f);
me->GetMotionMaster()->MoveJump(EVENT_JUMP, LordWaycrestCombatPosition, 20.0f, 5.0f);
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, IN_PROGRESS);
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);

View File

@@ -866,15 +866,15 @@ struct npc_aysa_cloudsinger_summon : public ScriptedAI
_scheduler.Schedule(3s, [this](TaskContext task)
{
me->GetMotionMaster()->MoveJumpWithGravity(aysaJumpPos[0], 12.0f, 17.4735f);
me->GetMotionMaster()->MoveJump(EVENT_JUMP, aysaJumpPos[0], 12.0f, {}, 5.0f);
task.Schedule(1700ms, [this](TaskContext task)
{
me->GetMotionMaster()->MoveJumpWithGravity(aysaJumpPos[1], 12.0f, 10.7163f);
me->GetMotionMaster()->MoveJump(EVENT_JUMP, aysaJumpPos[1], 12.0f, {}, 5.0f);
task.Schedule(2s, [this](TaskContext /*task*/)
{
me->GetMotionMaster()->MoveJumpWithGravity(aysaJumpPos[2], 12.0f, 14.6923f, POINT_JUMP);
me->GetMotionMaster()->MoveJump(POINT_JUMP, aysaJumpPos[2], 12.0f, {}, 5.0f);
});
});
});

View File

@@ -320,29 +320,6 @@ class spell_volkaal_toxic_leap_selector : public SpellScript
}
};
// 250258 - Toxic Leap
class spell_volkaal_toxic_leap : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_TOXIC_LEAP });
}
void HandleHit(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
float dist = GetCaster()->GetExactDist(GetHitDest());
float jumpGravity = 159500.0f / (dist * dist); // constant based on calculating avg of inverse from multiple leaps
GetCaster()->GetMotionMaster()->MoveJumpWithGravity(*GetHitDest(), 50, jumpGravity, EVENT_JUMP);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_volkaal_toxic_leap::HandleHit, EFFECT_1, SPELL_EFFECT_JUMP_CHARGE);
}
};
// 250229 - Soul Anchor
class spell_volkaal_soul_anchor : public SpellScript
{
@@ -448,7 +425,6 @@ void AddSC_boss_volkaal()
RegisterSpellScript(spell_volkaal_lingering_nausea);
RegisterSpellScript(spell_volkaal_noxious_stench);
RegisterSpellScript(spell_volkaal_toxic_leap_selector);
RegisterSpellScript(spell_volkaal_toxic_leap);
RegisterSpellScript(spell_volkaal_soul_anchor);
RegisterSpellScript(spell_volkaal_reanimate);
RegisterSpellScript(spell_volkaal_rapid_decay);