diff options
author | NoName <322016+Faq@users.noreply.github.com> | 2020-09-08 18:12:52 +0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-05 15:40:31 +0100 |
commit | ee620856ad2918ae7ce91a37a980d9f2129a074a (patch) | |
tree | 119fcdb41718dc738fce784c149c913d60ea8f0b | |
parent | 358dc78e47a6276e9f511e6510e04865d2d87fd2 (diff) |
Core/Movement: Corrected Animation Tier handling (PR #24875)
Co-authored-by: Warpten <vertozor@gmail.com>
Co-authored-by: Ovahlord <dreadkiller@gmx.de>
Co-authored-by: Carbenium <carbenium@outlook.com>
(cherry picked from commit dad187615df603ad8614531a0ec84c1a5e136838)
29 files changed, 94 insertions, 88 deletions
diff --git a/sql/updates/world/master/2022_02_05_03_world_2020_09_08_00_world.sql b/sql/updates/world/master/2022_02_05_03_world_2020_09_08_00_world.sql new file mode 100644 index 00000000000..97bfb0b992d --- /dev/null +++ b/sql/updates/world/master/2022_02_05_03_world_2020_09_08_00_world.sql @@ -0,0 +1,15 @@ +-- Disable movement flag updates for Grauf and let script handle them +UPDATE `creature_template` SET `flags_extra` = `flags_extra`| 0x200 WHERE `entry`=26893; +-- Disable movement flag updates for Blood-Queen Lana'thel +UPDATE `creature_template_movement` SET `Ground`= 1, `Flight`= 0 WHERE `CreatureId` IN (37955, 38434, 38435, 38436); +UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x200 WHERE `entry` IN (37955, 38434, 38435, 38436); +-- Disable movement flag updates for Malygos +UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x200 WHERE `entry` IN (28859, 31734); +-- Disable movement flag updates for Razorscale +UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x200 WHERE `entry` IN (33186, 33724); +UPDATE `creature_template_movement` SET `Ground`= 1 WHERE `CreatureId` IN (33186, 33724); +-- Disable movement flag updates for Enslaved Proto-Drake +UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x200 WHERE `entry` IN (24083, 31669); +UPDATE `creature_template_movement` SET `Ground`= 1 WHERE `CreatureId` IN (24083, 31669); +-- Disable movement flag updates for Enslaved Netherwing Drake +UPDATE `creature_template` SET `flags_extra` = `flags_extra`| 0x200 WHERE `entry`=21722; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e613b418bfb..f4843715a33 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1888,9 +1888,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u target->ToUnit()->AddVisFlags(UnitVisFlags(e.action.setunitByte.byte1)); break; case 3: - // this is totally wrong to maintain compatibility with existing scripts - // TODO: fix with animtier overhaul - target->ToUnit()->SetAnimTier(UnitBytes1_Flags(target->ToUnit()->m_unitData->AnimTier | e.action.setunitByte.byte1), false); + target->ToUnit()->SetAnimTier(AnimTier(e.action.setunitByte.byte1)); break; } } @@ -1913,7 +1911,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u target->ToUnit()->RemoveVisFlags(UnitVisFlags(e.action.setunitByte.byte1)); break; case 3: - target->ToUnit()->SetAnimTier(UnitBytes1_Flags(target->ToUnit()->m_unitData->AnimTier & ~e.action.setunitByte.byte1), false); + target->ToUnit()->SetAnimTier(AnimTier::Ground); break; } } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 0ca2f5fc298..8688592fc0b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2100,6 +2100,7 @@ void Creature::setDeathState(DeathState s) uint32 respawnDelay = m_respawnDelay; if (uint32 scalingMode = sWorld->getIntConfig(CONFIG_RESPAWN_DYNAMICMODE)) GetMap()->ApplyDynamicModeRespawnScaling(this, m_spawnId, respawnDelay, scalingMode); + // @todo remove the boss respawn time hack in a dynspawn follow-up once we have creature groups in instances if (m_respawnCompatibilityMode) { @@ -2135,8 +2136,9 @@ void Creature::setDeathState(DeathState s) if (m_formation && m_formation->GetLeader() == this) m_formation->FormationReset(true); - bool needsFalling = IsFlying() || IsHovering(); - SetHover(false); + bool needsFalling = (IsFlying() || IsHovering()) && !IsUnderWater(); + SetHover(false, false); + SetDisableGravity(false, false); if (needsFalling) GetMotionMaster()->MoveFall(); @@ -2670,7 +2672,7 @@ bool Creature::LoadCreaturesAddon() SetStandState(UnitStandStateType(cainfo->bytes1 & 0xFF)); SetVisFlags(UnitVisFlags((cainfo->bytes1 >> 16) & 0xFF)); - SetAnimTier(UnitBytes1_Flags((cainfo->bytes1 >> 24) & 0xFF), false); + SetAnimTier(AnimTier((cainfo->bytes1 >> 24) & 0xFF), false); //! Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2: //! If no inhabittype_fly (if no MovementFlag_DisableGravity or MovementFlag_CanFly flag found in sniffs) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fcf87e12376..b782c3ad2dc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4294,9 +4294,6 @@ void Player::BuildPlayerRepop() StopMirrorTimers(); //disable timers(bars) - // set and clear other - SetAnimTier(UNIT_BYTE1_FLAG_ALWAYS_STAND, false); - // OnPlayerRepop hook sScriptMgr->OnPlayerRepop(this); } @@ -4310,7 +4307,6 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) // speed change, land walk // remove death flag + set aura - SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); RemovePlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS); // This must be called always even on Players with race != RACE_NIGHTELF in case of faction change diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 19c2e050bed..f9e66caa44d 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -534,8 +534,13 @@ void Unit::UpdateSplineMovement(uint32 t_diff) } if (arrived) + { DisableSpline(); + if (Optional<AnimTier> animTier = movespline->GetAnimation()) + SetAnimTier(*animTier); + } + UpdateSplinePosition(); } @@ -9925,15 +9930,15 @@ void Unit::SetStandState(UnitStandStateType state, uint32 animKitID /* = 0*/) } } -void Unit::SetAnimTier(UnitBytes1_Flags animTier, bool notifyClient) +void Unit::SetAnimTier(AnimTier animTier, bool notifyClient /*= true*/) { - SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::AnimTier), animTier); + SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::AnimTier), AsUnderlyingType(animTier)); if (notifyClient) { WorldPackets::Misc::SetAnimTier setAnimTier; setAnimTier.Unit = GetGUID(); - setAnimTier.Tier = animTier; + setAnimTier.Tier = AsUnderlyingType(animTier); SendMessageToSet(setAnimTier.Write(), true); } } @@ -12447,7 +12452,7 @@ bool Unit::SetWalk(bool enable) return true; } -bool Unit::SetDisableGravity(bool disable) +bool Unit::SetDisableGravity(bool disable, bool updateAnimationTier /*= true*/) { if (disable == IsGravityDisabled()) return false; @@ -12484,6 +12489,16 @@ bool Unit::SetDisableGravity(bool disable) SendMessageToSet(packet.Write(), true); } + if (IsCreature() && updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT) && !ToCreature()->GetMovementTemplate().IsRooted()) + { + if (IsGravityDisabled()) + SetAnimTier(AnimTier::Fly); + else if (IsHovering()) + SetAnimTier(AnimTier::Hover); + else + SetAnimTier(AnimTier::Ground); + } + return true; } @@ -12640,7 +12655,7 @@ bool Unit::SetFeatherFall(bool enable) return true; } -bool Unit::SetHover(bool enable) +bool Unit::SetHover(bool enable, bool updateAnimationTier /*= true*/) { if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) return false; @@ -12690,6 +12705,16 @@ bool Unit::SetHover(bool enable) SendMessageToSet(packet.Write(), true); } + if (IsCreature() && updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT) && !ToCreature()->GetMovementTemplate().IsRooted()) + { + if (IsGravityDisabled()) + SetAnimTier(AnimTier::Fly); + else if (IsHovering()) + SetAnimTier(AnimTier::Hover); + else + SetAnimTier(AnimTier::Ground); + } + return true; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 50e27c7f32b..b0438292d04 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -998,7 +998,8 @@ class TC_GAME_API Unit : public WorldObject void RemoveVisFlags(UnitVisFlags flags) { RemoveUpdateFieldFlagValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::VisFlags), flags); } void SetVisFlags(UnitVisFlags flags) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::VisFlags), flags); } - void SetAnimTier(UnitBytes1_Flags animTier, bool notifyClient); + AnimTier GetAnimTier() const { return AnimTier(*m_unitData->AnimTier); } + void SetAnimTier(AnimTier animTier, bool notifyClient = true); bool IsMounted() const { return HasUnitFlag(UNIT_FLAG_MOUNT); } uint32 GetMountDisplayId() const { return m_unitData->MountDisplayID; } @@ -1205,13 +1206,13 @@ class TC_GAME_API Unit : public WorldObject bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); } bool IsHovering() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_HOVER); } bool SetWalk(bool enable); - bool SetDisableGravity(bool disable); + bool SetDisableGravity(bool disable, bool updateAnimationTier = true); bool SetFall(bool enable); bool SetSwim(bool enable); bool SetCanFly(bool enable); bool SetWaterWalking(bool enable); bool SetFeatherFall(bool enable); - bool SetHover(bool enable); + bool SetHover(bool enable, bool updateAnimationTier = true); bool SetCollision(bool disable); bool SetCanTransitionBetweenSwimAndFly(bool enable); bool SetCanTurnWhileFalling(bool enable); diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h index f19ca62a94d..3e3d124dc28 100644 --- a/src/server/game/Entities/Unit/UnitDefines.h +++ b/src/server/game/Entities/Unit/UnitDefines.h @@ -56,14 +56,14 @@ enum UnitVisFlags : uint8 UNIT_VIS_FLAGS_ALL = 0xFF }; -// byte flags value (UNIT_FIELD_BYTES_1, 3) -enum UnitBytes1_Flags : uint8 +// UNIT_FIELD_BYTES_1 (UNIT_BYTES_1_OFFSET_ANIM_TIER) +enum class AnimTier : uint8 { - UNIT_BYTE1_FLAG_NONE = 0x00, - UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, - UNIT_BYTE1_FLAG_HOVER = 0x02, - UNIT_BYTE1_FLAG_UNK_3 = 0x04, - UNIT_BYTE1_FLAG_ALL = 0xFF + Ground = 0, // plays ground tier animations + Swim = 1, // falls back to ground tier animations, not handled by the client, should never appear in sniffs, will prevent tier change animations from playing correctly if used + Hover = 2, // plays flying tier animations or falls back to ground tier animations, automatically enables hover clientside when entering visibility with this value + Fly = 3, // plays flying tier animations + Submerged = 4 }; // low byte (0 from 0..3) of UNIT_FIELD_BYTES_2 diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index fc41d9138b7..24d81b84e1d 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -678,7 +678,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos) Movement::MoveSplineInit init(_owner); init.MoveTo(PositionToVector3(pos), false); - init.SetAnimation(Movement::ToGround); + init.SetAnimation(AnimTier::Ground); Add(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id)); } @@ -688,7 +688,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos) Movement::MoveSplineInit init(_owner); init.MoveTo(PositionToVector3(pos)); - init.SetAnimation(Movement::ToFly); + init.SetAnimation(AnimTier::Hover); Add(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id)); } @@ -881,7 +881,7 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool { init.SetFly(); init.SetCyclic(); - init.SetAnimation(Movement::ToFly); + init.SetAnimation(AnimTier::Hover); } else { diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index c24f207db6e..937339fbcc5 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -352,10 +352,10 @@ void WaypointMovementGenerator<Creature>::StartMove(Creature* owner, bool relaun switch (waypoint.moveType) { case WAYPOINT_MOVE_TYPE_LAND: - init.SetAnimation(Movement::ToGround); + init.SetAnimation(AnimTier::Ground); break; case WAYPOINT_MOVE_TYPE_TAKEOFF: - init.SetAnimation(Movement::ToFly); + init.SetAnimation(AnimTier::Hover); break; case WAYPOINT_MOVE_TYPE_RUN: init.SetWalk(false); diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index 3eab8984260..82678e7b188 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -22,6 +22,8 @@ #include "MoveSplineInitArgs.h" #include <G3D/Vector3.h> +enum class AnimTier : uint8; + namespace WorldPackets { namespace Movement @@ -139,6 +141,8 @@ namespace Movement Vector3 const& CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx + 1) : Vector3::zero(); } int32 currentPathIdx() const; + Optional<AnimTier> GetAnimation() const { return anim_tier ? anim_tier->AnimTier : Optional<AnimTier>{}; } + bool onTransport; bool splineIsFacingOnly; std::string ToString() const; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 49856a761e5..bec9b55959f 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -22,15 +22,10 @@ class Unit; +enum class AnimTier : uint8; + namespace Movement { - enum AnimType - { - ToGround = 0, // 460 = ToGround, index of AnimationData.dbc - FlyToFly = 1, // 461 = FlyToFly? - ToFly = 2, // 458 = ToFly - FlyToGround = 3 // 463 = FlyToGround - }; // Transforms coordinates from global to transport offsets class TC_GAME_API TransportPathTransform @@ -81,7 +76,7 @@ namespace Movement /* Plays animation after movement done * can't be combined with parabolic movement */ - void SetAnimation(AnimType anim); + void SetAnimation(AnimTier anim); /* Adds final facing animation * sets unit's facing to specified point/angle after all path done @@ -195,7 +190,7 @@ namespace Movement args.flags.EnableParabolic(); } - inline void MoveSplineInit::SetAnimation(AnimType anim) + inline void MoveSplineInit::SetAnimation(AnimTier anim) { args.time_perc = 0.f; args.animTier.emplace(); diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index 441aea04d71..f58d06cfc1a 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -24,6 +24,8 @@ class Unit; +enum class AnimTier : uint8; + namespace Movement { typedef std::vector<Vector3> PointsArray; @@ -53,7 +55,7 @@ namespace Movement struct AnimTierTransition { uint32 TierTransitionId = 0; - uint8 AnimTier = 0; + ::AnimTier AnimTier = ::AnimTier(0); }; struct MoveSplineInitArgs diff --git a/src/server/game/Server/Packets/MovementPackets.cpp b/src/server/game/Server/Packets/MovementPackets.cpp index f386fc9a245..266c99b4f08 100644 --- a/src/server/game/Server/Packets/MovementPackets.cpp +++ b/src/server/game/Server/Packets/MovementPackets.cpp @@ -495,7 +495,7 @@ void WorldPackets::Movement::MonsterMove::InitializeSplineData(::Movement::MoveS movementSpline.AnimTierTransition.emplace(); movementSpline.AnimTierTransition->TierTransitionID = moveSpline.anim_tier->TierTransitionId; movementSpline.AnimTierTransition->StartTime = moveSpline.effect_start_time; - movementSpline.AnimTierTransition->AnimTier = moveSpline.anim_tier->AnimTier; + movementSpline.AnimTierTransition->AnimTier = AsUnderlyingType(moveSpline.anim_tier->AnimTier); } movementSpline.MoveTime = moveSpline.Duration(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index b8cba4ac922..5c7482871ed 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -211,7 +211,7 @@ public: switch (pointId) { case POINT_INTRO_START: - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); + me->SetStandState(UNIT_STAND_STATE_STAND); events.ScheduleEvent(EVENT_START_INTRO_PATH, Milliseconds(1)); break; case POINT_INTRO_END: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp index 834190258fd..1e206366df3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp @@ -1476,7 +1476,7 @@ public: break; case RP5_EVENT_CHROMIE_LAND: if (Creature* chromie = me->FindNearestCreature(NPC_CHROMIE_3, 100.0f, true)) - chromie->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); + chromie->SetAnimTier(AnimTier::Ground, true); break; case RP5_EVENT_CHROMIE_TRANSFORM: if (Creature* chromie = me->FindNearestCreature(NPC_CHROMIE_3, 100.0f, true)) diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index ca2a8553974..114479343d6 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -230,7 +230,6 @@ public: case 9: me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); if (Creature* trigger = ObjectAccessor::GetCreature(*me, triggerGUID)) Unit::Kill(me, trigger); me->SetReactState(REACT_AGGRESSIVE); @@ -248,7 +247,6 @@ public: case 10: me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetFacingTo(me->GetOrientation() + float(M_PI)); if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN)) triggerGUID = trigger->GetGUID(); diff --git a/src/server/scripts/Maelstrom/Stonecore/boss_slabhide.cpp b/src/server/scripts/Maelstrom/Stonecore/boss_slabhide.cpp index a4b6b251195..3facde1d0b1 100644 --- a/src/server/scripts/Maelstrom/Stonecore/boss_slabhide.cpp +++ b/src/server/scripts/Maelstrom/Stonecore/boss_slabhide.cpp @@ -118,7 +118,6 @@ class boss_slabhide : public CreatureScript me->setActive(true); me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetReactState(REACT_PASSIVE); instance->SetData(DATA_SLABHIDE_INTRO, NOT_STARTED); _isFlying = false; @@ -134,7 +133,6 @@ class boss_slabhide : public CreatureScript me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetReactState(REACT_AGGRESSIVE); _isFlying = false; } @@ -197,7 +195,6 @@ class boss_slabhide : public CreatureScript case POINT_SLABHIDE_INTRO_LAND: me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHover(false); me->SetHomePosition(SlabhideIntroLandPos); me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); @@ -261,7 +258,6 @@ class boss_slabhide : public CreatureScript case EVENT_STALACTITE: me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetHover(true); DoCast(me, SPELL_STALACTITE_SUMMON); @@ -278,7 +274,6 @@ class boss_slabhide : public CreatureScript case EVENT_ATTACK: me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHover(false); events.ScheduleEvent(EVENT_LAVA_FISSURE, 6s, 8s); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 2815f56feb9..b9961ed76df 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -246,7 +246,7 @@ struct boss_jedoga_shadowseeker : public BossAI if (++_initiatesKilled == TWILIGHT_INITIATES_SIZE) { DoCastSelf(SPELL_HOVER_FALL_1); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); + me->SetAnimTier(AnimTier::Ground); events.ScheduleEvent(EVENT_START_FIGHT_1, Seconds(1)); } } @@ -318,7 +318,6 @@ struct boss_jedoga_shadowseeker : public BossAI case EVENT_START_FIGHT_2: summons.DespawnEntry(NPC_JEDOGA_CONTROLLER); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); me->GetMotionMaster()->MoveLand(POINT_GROUND, JedogaGroundPosition); break; case EVENT_START_PHASE_TWO: @@ -330,7 +329,6 @@ struct boss_jedoga_shadowseeker : public BossAI break; case EVENT_FLY_DELAY: me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), true); me->GetMotionMaster()->MoveTakeoff(POINT_PHASE_TWO_FLY, JedogaFlyPosition); break; case EVENT_CHOOSE_VOLUNTEER: @@ -364,7 +362,6 @@ struct boss_jedoga_shadowseeker : public BossAI summons.DespawnEntry(NPC_JEDOGA_CONTROLLER); DoCastSelf(SPELL_HOVER_FALL_2); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); me->GetMotionMaster()->MoveLand(POINT_GROUND, JedogaGroundPosition); break; case EVENT_CYCLONE_STRIKE: diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index b58e2b5a947..5c6167c210e 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -119,7 +119,6 @@ class boss_saviana_ragefire : public CreatureScript case POINT_LAND_GROUND: me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetReactState(REACT_AGGRESSIVE); events.ScheduleEvent(EVENT_ENRAGE, Seconds(1), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_FLAME_BREATH, Seconds(2), Seconds(4), EVENT_GROUP_LAND_PHASE); @@ -162,7 +161,6 @@ class boss_saviana_ragefire : public CreatureScript { me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetReactState(REACT_PASSIVE); me->AttackStop(); Position pos; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 3ed5a10b53b..e69c35019de 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -215,7 +215,7 @@ class boss_blood_queen_lana_thel : public CreatureScript if (Creature* minchar = me->FindNearestCreature(NPC_INFILTRATOR_MINCHAR_BQ, 200.0f)) { minchar->SetEmoteState(EMOTE_ONESHOT_NONE); - minchar->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); + minchar->SetAnimTier(AnimTier::Ground); minchar->SetCanFly(false); minchar->RemoveAllAuras(); minchar->GetMotionMaster()->MoveCharge(4629.3711f, 2782.6089f, 401.5301f, SPEED_CHARGE / 3.0f); @@ -247,7 +247,6 @@ class boss_blood_queen_lana_thel : public CreatureScript else { me->SetDisableGravity(true); - me->SetAnimTier(UNIT_BYTE1_FLAG_ALWAYS_STAND, true); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); } } @@ -262,7 +261,6 @@ class boss_blood_queen_lana_thel : public CreatureScript { _killMinchar = false; me->SetDisableGravity(true); - me->SetAnimTier(UNIT_BYTE1_FLAG_ALWAYS_STAND, true); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); } else @@ -276,7 +274,6 @@ class boss_blood_queen_lana_thel : public CreatureScript void JustReachedHome() override { me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); me->SetReactState(REACT_AGGRESSIVE); _JustReachedHome(); Talk(SAY_WIPE); @@ -326,7 +323,6 @@ class boss_blood_queen_lana_thel : public CreatureScript break; case POINT_GROUND: me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); me->SetReactState(REACT_AGGRESSIVE); if (Unit* victim = me->SelectVictim()) AttackStart(victim); @@ -408,7 +404,7 @@ class boss_blood_queen_lana_thel : public CreatureScript break; } case EVENT_DELIRIOUS_SLASH: - if (!_offtankGUID.IsEmpty() && !(*me->m_unitData->AnimTier & (UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER))) + if (!_offtankGUID.IsEmpty() && me->GetAnimTier() != AnimTier::Fly) if (Player* _offtank = ObjectAccessor::GetPlayer(*me, _offtankGUID)) DoCast(_offtank, SPELL_DELIRIOUS_SLASH); events.ScheduleEvent(EVENT_DELIRIOUS_SLASH, 20s, 24s, EVENT_GROUP_NORMAL); @@ -456,7 +452,6 @@ class boss_blood_queen_lana_thel : public CreatureScript break; case EVENT_AIR_START_FLYING: me->SetDisableGravity(true); - me->SetAnimTier(UNIT_BYTE1_FLAG_ALWAYS_STAND, true); me->GetMotionMaster()->MovePoint(POINT_AIR, airPos); break; case EVENT_AIR_FLY_DOWN: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 533a564170e..d925b242ac8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -299,7 +299,6 @@ struct boss_sindragosa : public BossAI instance->SetBossState(DATA_SINDRAGOSA, FAIL); me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetReactState(REACT_DEFENSIVE); } @@ -325,7 +324,6 @@ struct boss_sindragosa : public BossAI me->SetFarVisible(true); me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetSpeedRate(MOVE_FLIGHT, 4.0f); me->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE); Milliseconds moveTime = Milliseconds(uint64(me->GetExactDist(&SindragosaFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f))); @@ -360,7 +358,6 @@ struct boss_sindragosa : public BossAI me->SetFarVisible(false); me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHomePosition(SindragosaLandPos); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->SetSpeedRate(MOVE_FLIGHT, 2.5f); @@ -392,7 +389,6 @@ struct boss_sindragosa : public BossAI { me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetReactState(REACT_DEFENSIVE); _isInAirPhase = false; @@ -499,7 +495,6 @@ struct boss_sindragosa : public BossAI Talk(SAY_AIR_PHASE); me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetReactState(REACT_PASSIVE); me->AttackStop(); Position pos; @@ -720,7 +715,6 @@ struct npc_spinestalker : public ScriptedAI me->SetFarVisible(false); me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHomePosition(SpinestalkerLandPos); me->SetFacingTo(SpinestalkerLandPos.GetOrientation()); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); @@ -848,7 +842,6 @@ struct npc_rimefang_icc : public ScriptedAI me->SetFarVisible(false); me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->SetHomePosition(RimefangLandPos); me->SetFacingTo(RimefangLandPos.GetOrientation()); me->SetImmuneToPC(false); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 3f47a48ed46..12f051b540d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -528,7 +528,6 @@ struct boss_the_lich_king : public BossAI _JustDied(); DoCastAOE(SPELL_PLAY_MOVIE, false); me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); me->GetMotionMaster()->MoveFall(); if (Creature* frostmourne = me->FindNearestCreature(NPC_FROSTMOURNE_TRIGGER, 50.0f)) frostmourne->DespawnOrUnsummon(); @@ -1108,7 +1107,6 @@ struct boss_the_lich_king : public BossAI CreatureTextMgr::SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_2, OutroFlying); break; case EVENT_OUTRO_TALK_7: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 0dd7eaece13..27108645951 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -265,6 +265,11 @@ class instance_icecrown_citadel : public InstanceMapScript case NPC_BLOOD_QUEEN_LANA_THEL: BloodQueenLanaThelGUID = creature->GetGUID(); break; + case NPC_INFILTRATOR_MINCHAR_BQ: + // keep him in air + creature->SetEmoteState(EMOTE_ONESHOT_NONE); + creature->SetDisableGravity(true); + break; case NPC_CROK_SCOURGEBANE: CrokScourgebaneGUID = creature->GetGUID(); break; diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 4129145d937..2568c0eefd0 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -372,7 +372,6 @@ public: Initialize(); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); me->SetImmuneToAll(true); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); // TO DO: find what in core is making boss slower than in retail (when correct speed data) or find missing movement flag update or forced spline change diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 4f33c919154..39b7190e828 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -620,7 +620,6 @@ class boss_mimiron : public CreatureScript { if (Creature* aerial = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT))) { - aerial->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); aerial->CastSpell(vx001, SPELL_MOUNT_VX_001); aerial->CastSpell(aerial, SPELL_HALF_HEAL); } @@ -993,7 +992,7 @@ class boss_vx_001 : public CreatureScript me->SetImmuneToPC(false); me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); me->SetEmoteState(EMOTE_ONESHOT_NONE); // Remove emotestate. - //me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); Blizzard handles hover animation like this it seems. + //me->SetHover(true); // Blizzard handles hover animation like this it seems. DoCast(me, SPELL_HEAT_WAVE_AURA); events.SetPhase(PHASE_VX_001); @@ -1135,9 +1134,8 @@ class boss_aerial_command_unit : public CreatureScript damage = me->GetHealth() - 1; // Let creature fall to 1 hp, but do not let it die or damage itself with SetHealth(). me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_HOVER | UNIT_BYTE1_FLAG_ALWAYS_STAND), true); - me->SetHover(false); me->SetDisableGravity(true); + me->SetAnimTier(AnimTier::Ground); DoCastSelf(SPELL_VEHICLE_DAMAGED, true); @@ -1171,7 +1169,6 @@ class boss_aerial_command_unit : public CreatureScript events.ScheduleEvent(EVENT_SUMMON_FIRE_BOTS, 1s, 0, PHASE_AERIAL_COMMAND_UNIT); [[fallthrough]]; case DO_START_AERIAL: - me->SetAnimTier(UNIT_BYTE1_FLAG_HOVER, true); me->SetDisableGravity(false); me->SetHover(true); me->RemoveUnitFlag(UnitFlags(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 5f5104b2649..b363bd4ea8a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -310,7 +310,6 @@ struct boss_razorscale : public BossAI _permaGround = false; _flyCount = 0; me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), true); } void Reset() override @@ -360,7 +359,6 @@ struct boss_razorscale : public BossAI summons.DoAction(ACTION_START_FIGHT, DummyEntryCheckPredicate()); events.ScheduleEvent(EVENT_BERSERK, 15min); HandleMusic(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), true); } void ScheduleAirPhaseEvents() @@ -398,7 +396,6 @@ struct boss_razorscale : public BossAI case ACTION_START_PERMA_GROUND: { me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); me->RemoveAurasDueToSpell(SPELL_STUN_SELF); Talk(EMOTE_PERMA_GROUND); DoCastSelf(SPELL_WING_BUFFET); @@ -430,7 +427,6 @@ struct boss_razorscale : public BossAI break; case POINT_RAZORSCALE_GROUND: me->SetDisableGravity(false); - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, true); if (!_permaGround) { DoCastSelf(SPELL_STUN_SELF, true); @@ -626,7 +622,6 @@ struct boss_razorscale : public BossAI case EVENT_RESUME_AIR_PHASE: { me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), true); events.SetPhase(PHASE_AIR); me->SetReactState(REACT_PASSIVE); Position pos = me->GetPosition(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 5d13f148e5b..029e24396e2 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -283,7 +283,7 @@ class npc_enslaved_proto_drake : public CreatureScript { if (type == WAYPOINT_MOTION_TYPE && id == POINT_LAST) { - me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false); + me->SetAnimTier(AnimTier::Ground); } } @@ -292,7 +292,7 @@ class npc_enslaved_proto_drake : public CreatureScript if (type == TYPE_PROTODRAKE_AT && data == DATA_PROTODRAKE_MOVE && !_setData && me->GetDistance(protodrakeCheckPos) < 5.0f) { _setData = true; - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); + me->SetAnimTier(AnimTier::Fly); me->GetMotionMaster()->MovePath(PATH_PROTODRAKE, false); } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 9f3059fc043..acd4c27dc7c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -373,7 +373,6 @@ public: me->SetFarVisible(true); me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), false); _scheduler.Schedule(Seconds(2), [this](TaskContext /*context*/) { diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index e0339e8d9c3..d7c27b839eb 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -442,7 +442,6 @@ public: me->SetCanFly(true); me->SetDisableGravity(true); - me->SetAnimTier(UnitBytes1_Flags(UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER), true); me->GetMotionMaster()->MoveTakeoff(POINT_MOVE_UP, pos); } } |