mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core/Movement: Change MoveJump to use min/max height argument instead of vertical speed
This commit is contained in:
@@ -1930,7 +1930,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{}, false, nullptr, nullptr, std::move(actionResultSetter));
|
||||
}
|
||||
else
|
||||
me->GetMotionMaster()->MoveJump(pos, float(e.action.jump.SpeedXY), float(e.action.jump.SpeedZ), e.action.jump.PointId,
|
||||
me->GetMotionMaster()->MoveJump_OLD_DEPRECATED(pos, float(e.action.jump.SpeedXY), float(e.action.jump.SpeedZ), e.action.jump.PointId,
|
||||
{}, false, nullptr, nullptr, std::move(actionResultSetter));
|
||||
|
||||
mTimedActionWaitEvent = std::move(waitEvent);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "PathGenerator.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptSystem.h"
|
||||
#include "Types.h"
|
||||
#include <boost/container/static_vector.hpp>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
@@ -858,7 +859,7 @@ void MotionMaster::MoveKnockbackFrom(Position const& origin, float speedXY, floa
|
||||
Add(movement);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id /*= EVENT_JUMP*/, MovementFacingTarget const& facing /*= {}*/,
|
||||
void MotionMaster::MoveJump_OLD_DEPRECATED(Position const& pos, float speedXY, float speedZ, uint32 id /*= EVENT_JUMP*/, MovementFacingTarget const& facing /*= {}*/,
|
||||
bool orientationFixed /*= false*/, JumpArrivalCastArgs const* arrivalCast /*= nullptr*/, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/,
|
||||
Optional<Scripting::v2::ActionResultSetter<MovementStopReason>>&& scriptResult /*= {}*/)
|
||||
{
|
||||
@@ -899,6 +900,82 @@ void MotionMaster::MoveJump(Position const& pos, float speedXY, float speedZ, ui
|
||||
Add(movement);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveJump(uint32 id, Position const& pos, std::variant<std::monostate, float, Milliseconds> speedOrTime /*= {}*/,
|
||||
Optional<float> minHeight /*= {}*/, Optional<float> maxHeight /*= {}*/,
|
||||
MovementFacingTarget const& facing /*= {}*/, bool orientationFixed, bool unlimitedSpeed /*= false*/, Optional<float> speedMultiplier /*= {}*/,
|
||||
JumpArrivalCastArgs const* arrivalCast /*= nullptr*/, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/,
|
||||
Optional<Scripting::v2::ActionResultSetter<MovementStopReason>>&& scriptResult /*= {}*/)
|
||||
{
|
||||
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveJump: '{}', jumps to point Id: {} ({})", _owner->GetGUID(), id, pos.ToString());
|
||||
|
||||
float dist = _owner->GetExactDist(pos);
|
||||
|
||||
float speedXY = std::visit([owner = _owner, speedMultiplier = speedMultiplier.value_or(1.0f), dist]<typename T>(T speedOrTime) noexcept -> float
|
||||
{
|
||||
if constexpr (std::is_same_v<T, std::monostate>)
|
||||
{
|
||||
float baseSpeed = owner->IsControlledByPlayer() ? playerBaseMoveSpeed[MOVE_RUN] : baseMoveSpeed[MOVE_RUN];
|
||||
if (Creature* creature = owner->ToCreature())
|
||||
baseSpeed *= creature->GetCreatureTemplate()->speed_run;
|
||||
|
||||
return baseSpeed * 3.0f * speedMultiplier;
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, float>)
|
||||
{
|
||||
return speedOrTime;
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, Milliseconds>)
|
||||
{
|
||||
return dist / duration_cast<FloatSeconds>(speedOrTime).count();
|
||||
}
|
||||
else
|
||||
{
|
||||
static_assert(Trinity::dependant_false_v<T>, "Unhandled type");
|
||||
}
|
||||
}, speedOrTime);
|
||||
|
||||
if (!unlimitedSpeed)
|
||||
speedXY = std::min(speedXY, 50.0f);
|
||||
|
||||
if (speedXY < 0.01f)
|
||||
{
|
||||
if (scriptResult)
|
||||
scriptResult->SetResult(MovementStopReason::Interrupted);
|
||||
return;
|
||||
}
|
||||
|
||||
float duration = dist / speedXY;
|
||||
float durationSqr = duration * duration;
|
||||
float height = std::clamp(Movement::gravity * durationSqr / 8, minHeight.value_or(0.5f), maxHeight.value_or(1000.0f));
|
||||
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, effect = (spellEffectExtraData ? Optional<Movement::SpellEffectExtraData>(*spellEffectExtraData) : Optional<Movement::SpellEffectExtraData>())](Movement::MoveSplineInit& init)
|
||||
{
|
||||
init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false);
|
||||
init.SetParabolic(height, 0);
|
||||
init.SetVelocity(speedXY);
|
||||
std::visit(Movement::MoveSplineInitFacingVisitor(init), facing);
|
||||
init.SetJumpOrientationFixed(orientationFixed);
|
||||
if (unlimitedSpeed)
|
||||
init.SetUnlimitedSpeed();
|
||||
if (effect)
|
||||
init.SetSpellEffectExtraData(*effect);
|
||||
};
|
||||
|
||||
uint32 arrivalSpellId = 0;
|
||||
ObjectGuid arrivalSpellTargetGuid;
|
||||
if (arrivalCast)
|
||||
{
|
||||
arrivalSpellId = arrivalCast->SpellId;
|
||||
arrivalSpellTargetGuid = arrivalCast->Target;
|
||||
}
|
||||
|
||||
GenericMovementGenerator* movement = new GenericMovementGenerator(std::move(initializer), EFFECT_MOTION_TYPE, id,
|
||||
{ .ArrivalSpellId = arrivalSpellId, .ArrivalSpellTarget = arrivalSpellTargetGuid, .ScriptResult = std::move(scriptResult) });
|
||||
movement->Priority = MOTION_PRIORITY_HIGHEST;
|
||||
movement->BaseUnitState = UNIT_STATE_JUMPING;
|
||||
Add(movement);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveJumpWithGravity(Position const& pos, float speedXY, float gravity, uint32 id/* = EVENT_JUMP*/, MovementFacingTarget const& facing/* = {}*/,
|
||||
bool orientationFixed /*= false*/, JumpArrivalCastArgs const* arrivalCast /*= nullptr*/, Movement::SpellEffectExtraData const* spellEffectExtraData /*= nullptr*/,
|
||||
Optional<Scripting::v2::ActionResultSetter<MovementStopReason>>&& scriptResult /*= {}*/)
|
||||
@@ -1201,27 +1278,6 @@ void MotionMaster::LaunchMoveSpline(std::function<void(Movement::MoveSplineInit&
|
||||
Add(movement);
|
||||
}
|
||||
|
||||
void MotionMaster::CalculateJumpSpeeds(float dist, UnitMoveType moveType, float speedMultiplier, float minHeight, float maxHeight, float& speedXY, float& speedZ) const
|
||||
{
|
||||
float baseSpeed = _owner->IsControlledByPlayer() ? playerBaseMoveSpeed[moveType] : baseMoveSpeed[moveType];
|
||||
if (Creature* creature = _owner->ToCreature())
|
||||
baseSpeed *= creature->GetCreatureTemplate()->speed_run;
|
||||
|
||||
speedXY = std::min(baseSpeed * 3.0f * speedMultiplier, std::max(28.0f, _owner->GetSpeed(moveType) * 4.0f));
|
||||
|
||||
float duration = dist / speedXY;
|
||||
float durationSqr = duration * duration;
|
||||
float height;
|
||||
if (durationSqr < minHeight * 8 / Movement::gravity)
|
||||
height = minHeight;
|
||||
else if (durationSqr > maxHeight * 8 / Movement::gravity)
|
||||
height = maxHeight;
|
||||
else
|
||||
height = Movement::gravity * durationSqr / 8;
|
||||
|
||||
speedZ = std::sqrt(2 * Movement::gravity * height);
|
||||
}
|
||||
|
||||
/******************** Private methods ********************/
|
||||
|
||||
void MotionMaster::ResolveDelayedActions()
|
||||
|
||||
@@ -191,9 +191,14 @@ class TC_GAME_API MotionMaster
|
||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, bool generatePath = false, Unit const* target = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr);
|
||||
void MoveCharge(PathGenerator const& path, float speed = SPEED_CHARGE, Unit const* target = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr);
|
||||
void MoveKnockbackFrom(Position const& origin, float speedXY, float speedZ, float angle = M_PI, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr);
|
||||
void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = EVENT_JUMP, MovementFacingTarget const& facing = {},
|
||||
void MoveJump_OLD_DEPRECATED(Position const& pos, float speedXY, float speedZ, uint32 id = EVENT_JUMP, MovementFacingTarget const& facing = {},
|
||||
bool orientationFixed = false, JumpArrivalCastArgs const* arrivalCast = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr,
|
||||
Optional<Scripting::v2::ActionResultSetter<MovementStopReason>>&& scriptResult = {});
|
||||
void MoveJump(uint32 id, Position const& pos, std::variant<std::monostate, float, Milliseconds> speedOrTime = {},
|
||||
Optional<float> minHeight = {}, Optional<float> maxHeight = {},
|
||||
MovementFacingTarget const& facing = {}, bool orientationFixed = false, bool unlimitedSpeed = false, Optional<float> speedMultiplier = {},
|
||||
JumpArrivalCastArgs const* arrivalCast = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr,
|
||||
Optional<Scripting::v2::ActionResultSetter<MovementStopReason>>&& scriptResult = {});
|
||||
void MoveJumpWithGravity(Position const& pos, float speedXY, float gravity, uint32 id = EVENT_JUMP, MovementFacingTarget const& facing = {},
|
||||
bool orientationFixed = false, JumpArrivalCastArgs const* arrivalCast = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr,
|
||||
Optional<Scripting::v2::ActionResultSetter<MovementStopReason>>&& scriptResult = {});
|
||||
@@ -239,8 +244,6 @@ class TC_GAME_API MotionMaster
|
||||
|
||||
void LaunchMoveSpline(std::function<void(Movement::MoveSplineInit& init)>&& initializer, uint32 id = 0, MovementGeneratorPriority priority = MOTION_PRIORITY_NORMAL, MovementGeneratorType type = EFFECT_MOTION_TYPE);
|
||||
|
||||
void CalculateJumpSpeeds(float dist, UnitMoveType moveType, float speedMultiplier, float minHeight, float maxHeight, float& speedXY, float& speedZ) const;
|
||||
|
||||
private:
|
||||
typedef std::unique_ptr<MovementGenerator, MovementGeneratorDeleter> MovementGeneratorPointer;
|
||||
typedef std::multiset<MovementGenerator*, MovementGeneratorComparator> MotionMasterContainer;
|
||||
|
||||
@@ -951,7 +951,6 @@ class TC_GAME_API Spell
|
||||
|
||||
// effect helpers
|
||||
void SummonGuardian(SpellEffectInfo const* effect, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons, ObjectGuid privateObjectOwner);
|
||||
void CalculateJumpSpeeds(SpellEffectInfo const* effInfo, float dist, float& speedXY, float& speedZ);
|
||||
|
||||
void UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData& data);
|
||||
int32 GetSpellCastDataAmmo();
|
||||
|
||||
@@ -901,21 +901,6 @@ void Spell::EffectTriggerRitualOfSummoning()
|
||||
.SetTriggeringSpell(this));
|
||||
}
|
||||
|
||||
void Spell::CalculateJumpSpeeds(SpellEffectInfo const* effInfo, float dist, float& speedXY, float& speedZ)
|
||||
{
|
||||
Unit* unitCaster = GetUnitCasterForEffectHandlers();
|
||||
ASSERT(unitCaster);
|
||||
|
||||
float multiplier = effInfo->Amplitude;
|
||||
if (multiplier <= 0.0f)
|
||||
multiplier = 1.0f;
|
||||
|
||||
float minHeight = effInfo->MiscValue ? effInfo->MiscValue / 10.0f : 0.5f; // Lower bound is blizzlike
|
||||
float maxHeight = effInfo->MiscValueB ? effInfo->MiscValueB / 10.0f : 1000.0f; // Upper bound is unknown
|
||||
|
||||
unitCaster->GetMotionMaster()->CalculateJumpSpeeds(dist, MOVE_RUN, multiplier, minHeight, maxHeight, speedXY, speedZ);
|
||||
}
|
||||
|
||||
void Spell::EffectJump()
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
|
||||
@@ -931,8 +916,10 @@ void Spell::EffectJump()
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
float speedXY, speedZ;
|
||||
CalculateJumpSpeeds(effectInfo, unitCaster->GetExactDist2d(unitTarget), speedXY, speedZ);
|
||||
Optional<float> speedMultiplier = effectInfo->Amplitude > 0.0f ? Optional<float>(effectInfo->Amplitude) : std::nullopt;
|
||||
Optional<float> minHeight = effectInfo->MiscValue ? Optional<float>(effectInfo->MiscValue / 10.0f) : std::nullopt;
|
||||
Optional<float> maxHeight = effectInfo->MiscValueB ? Optional<float>(effectInfo->MiscValueB / 10.0f) : std::nullopt;
|
||||
|
||||
MovementFacingTarget facing;
|
||||
if (Unit const* target = m_targets.GetUnitTarget())
|
||||
{
|
||||
@@ -943,7 +930,9 @@ void Spell::EffectJump()
|
||||
JumpArrivalCastArgs arrivalCast;
|
||||
arrivalCast.SpellId = effectInfo->TriggerSpell;
|
||||
arrivalCast.Target = unitTarget->GetGUID();
|
||||
unitCaster->GetMotionMaster()->MoveJump(*unitTarget, speedXY, speedZ, EVENT_JUMP, facing, m_spellInfo->HasAttribute(SPELL_ATTR9_JUMPCHARGE__NO_FACING_CONTROL), &arrivalCast);
|
||||
unitCaster->GetMotionMaster()->MoveJump(EVENT_JUMP, *unitTarget, {}, minHeight, maxHeight,
|
||||
facing, m_spellInfo->HasAttribute(SPELL_ATTR9_JUMPCHARGE__NO_FACING_CONTROL),
|
||||
false, speedMultiplier, &arrivalCast);
|
||||
}
|
||||
|
||||
void Spell::EffectJumpDest()
|
||||
@@ -961,8 +950,10 @@ void Spell::EffectJumpDest()
|
||||
if (!m_targets.HasDst())
|
||||
return;
|
||||
|
||||
float speedXY, speedZ;
|
||||
CalculateJumpSpeeds(effectInfo, unitCaster->GetExactDist2d(destTarget), speedXY, speedZ);
|
||||
Optional<float> speedMultiplier = effectInfo->Amplitude > 0.0f ? Optional<float>(effectInfo->Amplitude) : std::nullopt;
|
||||
Optional<float> minHeight = effectInfo->MiscValue ? Optional<float>(effectInfo->MiscValue / 10.0f) : std::nullopt;
|
||||
Optional<float> maxHeight = effectInfo->MiscValueB ? Optional<float>(effectInfo->MiscValueB / 10.0f) : std::nullopt;
|
||||
|
||||
MovementFacingTarget facing;
|
||||
if (Unit const* target = m_targets.GetUnitTarget())
|
||||
{
|
||||
@@ -974,7 +965,9 @@ void Spell::EffectJumpDest()
|
||||
|
||||
JumpArrivalCastArgs arrivalCast;
|
||||
arrivalCast.SpellId = effectInfo->TriggerSpell;
|
||||
unitCaster->GetMotionMaster()->MoveJump(*destTarget, speedXY, speedZ, EVENT_JUMP, facing, m_spellInfo->HasAttribute(SPELL_ATTR9_JUMPCHARGE__NO_FACING_CONTROL), &arrivalCast);
|
||||
unitCaster->GetMotionMaster()->MoveJump(EVENT_JUMP, *destTarget, {}, minHeight, maxHeight,
|
||||
facing, m_spellInfo->HasAttribute(SPELL_ATTR9_JUMPCHARGE__NO_FACING_CONTROL),
|
||||
false, speedMultiplier, &arrivalCast);
|
||||
}
|
||||
|
||||
TeleportToOptions GetTeleportOptions(WorldObject const* caster, Unit const* unitTarget, SpellDestination const& targetDest)
|
||||
|
||||
@@ -286,7 +286,7 @@ struct boss_guarm : public BossAI
|
||||
events.CancelEvent(EVENT_LICK);
|
||||
me->GetMotionMaster()->Clear(); // remove ChaseMovementGen
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->MoveJump(BerserkerPair.JumpPos, 42.0f, 21.5f, POINT_BERSERK_JUMP);
|
||||
me->GetMotionMaster()->MoveJump(POINT_BERSERK_JUMP, BerserkerPair.JumpPos, {}, 12.0f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -642,7 +642,7 @@ class spell_headlong_charge_trigger : public SpellScript
|
||||
uint8 pairId = urand(0, 3);
|
||||
caster->GetMotionMaster()->Clear(); // remove ChaseMovementGen
|
||||
caster->SetReactState(REACT_PASSIVE);
|
||||
caster->GetMotionMaster()->MoveJump(HeadlongChargePairs[pairId].JumpPos, 42.0f, 21.5f, POINT_HEADLONG_CHARGE + pairId);
|
||||
caster->GetMotionMaster()->MoveJump(POINT_HEADLONG_CHARGE + pairId, HeadlongChargePairs[pairId].JumpPos, {}, 12.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -593,13 +593,7 @@ struct npc_valkyr_of_odyn : public ScriptedAI
|
||||
case POINT_JUMP:
|
||||
_scheduler.Schedule(250ms, [this](TaskContext /*context*/)
|
||||
{
|
||||
/*
|
||||
* (MovementMonsterSpline) (MovementSpline) MoveTime: 3111
|
||||
* (MovementMonsterSpline) (MovementSpline) JumpGravity: 19.2911 -> +-Movement::gravity
|
||||
* 1.4125f is guessed value. Which makes the JumpGravity way closer to the intended one. Not sure how to do it 100% blizzlike.
|
||||
* Also the MoveTime is not correct but I don't know how to set it here.
|
||||
*/
|
||||
me->GetMotionMaster()->MoveJump({ 1107.84f, 7222.57f, 38.9725f, me->GetOrientation() }, me->GetSpeed(MOVE_RUN), Movement::gravity * 1.4125f, POINT_DESPAWN_JUMP);
|
||||
me->GetMotionMaster()->MoveJump(POINT_DESPAWN_JUMP, { 1107.84f, 7222.57f, 38.9725f, me->GetOrientation() });
|
||||
});
|
||||
break;
|
||||
case POINT_DESPAWN:
|
||||
@@ -610,12 +604,13 @@ struct npc_valkyr_of_odyn : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 /*type*/, uint32 id) override
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case POINT_DESPAWN_JUMP:
|
||||
me->DespawnOrUnsummon();
|
||||
if (type == EFFECT_MOTION_TYPE)
|
||||
me->DespawnOrUnsummon();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -177,7 +177,7 @@ struct npc_koltira_deathweaver : public ScriptedAI
|
||||
_events.ScheduleEvent(EVENT_INTRO_2, 2s);
|
||||
break;
|
||||
case EVENT_INTRO_2:
|
||||
me->GetMotionMaster()->MoveJump(koltiraPos[0], 25.0f, 15.0f);
|
||||
me->GetMotionMaster()->MoveJump(EVENT_JUMP, koltiraPos[0], 12.0f, 1.0f);
|
||||
|
||||
_events.ScheduleEvent(EVENT_INTRO_3, 2s);
|
||||
break;
|
||||
|
||||
@@ -480,7 +480,7 @@ struct npc_silverpine_grand_executor_mortuus : public ScriptedAI
|
||||
{
|
||||
if (Creature* garrosh = ObjectAccessor::GetCreature(*me, _garroshGUID))
|
||||
{
|
||||
garrosh->GetMotionMaster()->MoveJump(GarroshJumpPos, 15.595897f, 15.595897f);
|
||||
garrosh->GetMotionMaster()->MoveJump(EVENT_JUMP, GarroshJumpPos, 16.0f);
|
||||
|
||||
_events.ScheduleEvent(EVENT_SCENE_TALK_COMETH + 3, 2s + 500ms);
|
||||
}
|
||||
|
||||
@@ -1519,7 +1519,7 @@ struct npc_murloc_spearhunter_watershaper_higher_ground : public ScriptedAI
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
me->GetMotionMaster()->MoveJump(who->GetPosition(), 16.0f, 6.2f);
|
||||
me->GetMotionMaster()->MoveJump(EVENT_JUMP, who->GetPosition(), 16.0f, 0.1f);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4423,7 +4423,7 @@ struct npc_briarpatch_prisoner : public ScriptedAI
|
||||
me->RemoveAllAuras();
|
||||
me->SetDisableGravity(false);
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->GetMotionMaster()->MoveJump(BriarpatchPrisonerJumpToPosition, 7.9894905f, 19.29110336303710937f);
|
||||
me->GetMotionMaster()->MoveJump(EVENT_JUMP, BriarpatchPrisonerJumpToPosition, 8.0f);
|
||||
Talk(SAY_GET_OUT_OF_HERE);
|
||||
_events.ScheduleEvent(EVENT_RUN_TO_PLAINS, 4s);
|
||||
}
|
||||
@@ -4778,7 +4778,7 @@ struct npc_gnome_goblin_plains_make_copter_private : public ScriptedAI
|
||||
}
|
||||
|
||||
if (Creature* copter = ObjectAccessor::GetCreature(*me, _copterGUID))
|
||||
copter->GetMotionMaster()->MoveJump(MiniChopperJumpPosition, 19.29f, 6.99f);
|
||||
copter->GetMotionMaster()->MoveJump(EVENT_JUMP, MiniChopperJumpPosition, 7.0f, 6.99f);
|
||||
|
||||
_events.ScheduleEvent(EVENT_RESIZE_COPTER_1, 6s);
|
||||
break;
|
||||
|
||||
@@ -221,7 +221,7 @@ class boss_high_priestess_azil : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INTRO_MOVE:
|
||||
me->GetMotionMaster()->MoveJump(GroundPos, me->GetSpeed(MOVE_FLIGHT), 1.918408f, POINT_INTRO_MOVE);
|
||||
me->GetMotionMaster()->MoveJump(POINT_INTRO_MOVE, GroundPos, 5.0f, {}, 3.0f);
|
||||
break;
|
||||
case EVENT_CURSE_OF_BLOOD:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
|
||||
|
||||
@@ -473,7 +473,7 @@ struct npc_anubarak_anub_ar_assassin : public npc_anubarak_pet_template
|
||||
do
|
||||
jumpTo = GetRandomPositionAround(anubarak);
|
||||
while (!CreatureAI::IsInBounds(*boundary, &jumpTo));
|
||||
me->GetMotionMaster()->MoveJump(jumpTo, 40.0f, 40.0f);
|
||||
me->GetMotionMaster()->MoveJump(EVENT_JUMP, jumpTo, 24.0f, 20.0f, 30.0f);
|
||||
DoCastSelf(SPELL_ASSASSIN_VISUAL, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ struct boss_icehowl : public boss_northrend_beastsAI
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->AttackStop();
|
||||
events.SetPhase(PHASE_CHARGE);
|
||||
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1], 20.0f, 20.0f, POINT_MIDDLE);
|
||||
me->GetMotionMaster()->MoveJump(POINT_MIDDLE, ToCCommonLoc[1], 50.0f, 2.0f);
|
||||
break;
|
||||
case EVENT_SELECT_CHARGE_TARGET:
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||
|
||||
@@ -221,9 +221,9 @@ struct boss_garfrost : public BossAI
|
||||
case EVENT_FORGE_JUMP:
|
||||
me->AttackStop();
|
||||
if (events.IsInPhase(PHASE_TWO))
|
||||
me->GetMotionMaster()->MoveJump(northForgePos, 25.0f, 15.0f, POINT_FORGE);
|
||||
me->GetMotionMaster()->MoveJump(POINT_FORGE, northForgePos, 40.0f);
|
||||
else if (events.IsInPhase(PHASE_THREE))
|
||||
me->GetMotionMaster()->MoveJump(southForgePos, 25.0f, 15.0f, POINT_FORGE);
|
||||
me->GetMotionMaster()->MoveJump(POINT_FORGE, southForgePos, 40.0f);
|
||||
break;
|
||||
case EVENT_RESUME_ATTACK:
|
||||
if (events.IsInPhase(PHASE_TWO))
|
||||
|
||||
@@ -1751,7 +1751,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader
|
||||
else
|
||||
{
|
||||
passenger->ExitVehicle();
|
||||
passenger->GetMotionMaster()->MoveJump(*targets.GetDstPos(), targets.GetSpeedXY(), targets.GetSpeedZ());
|
||||
passenger->GetMotionMaster()->MoveJump(EVENT_JUMP, *targets.GetDstPos(), targets.GetSpeedXY());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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->GetPositionWithOffset({ 10.0f, 0.0f }), 10.f, 5.f);
|
||||
me->GetMotionMaster()->MoveJump(EVENT_JUMP, me->GetPositionWithOffset({ 10.0f, 0.0f }), 10.f);
|
||||
events.ScheduleEvent(EVENT_OUTTRO_1, 7s);
|
||||
}
|
||||
|
||||
|
||||
@@ -701,7 +701,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 }, 30.0f, 20.0f);
|
||||
me->GetMotionMaster()->MoveJump(EVENT_JUMP, { 2134.8f, -263.056f, 419.983f }, {}, 5.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);
|
||||
|
||||
@@ -920,7 +920,7 @@ class instance_violet_hold : public InstanceMapScript
|
||||
task.Schedule(Seconds(6), [this](TaskContext task)
|
||||
{
|
||||
if (Creature* cyanigosa = GetCreature(DATA_CYANIGOSA))
|
||||
cyanigosa->GetMotionMaster()->MoveJump(CyanigosaJumpLocation, 10.0f, 27.44744f);
|
||||
cyanigosa->GetMotionMaster()->MoveJump(EVENT_JUMP, CyanigosaJumpLocation, {}, 8.0f);
|
||||
|
||||
task.Schedule(Seconds(7), [this](TaskContext /*task*/)
|
||||
{
|
||||
|
||||
@@ -1920,7 +1920,7 @@ class npc_train_wrecker : public CreatureScript
|
||||
{
|
||||
case EVENT_DO_JUMP:
|
||||
if (GameObject* target = VerifyTarget())
|
||||
me->GetMotionMaster()->MoveJump(*target, 5.0, 10.0, MOVEID_JUMP);
|
||||
me->GetMotionMaster()->MoveJump(MOVEID_JUMP, *target, 3.0f, 1.0f);
|
||||
_nextAction = 0;
|
||||
break;
|
||||
case EVENT_DO_WRECK:
|
||||
|
||||
Reference in New Issue
Block a user