diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 892cb4b0f3..b45b154b07 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1097,19 +1097,19 @@ Unit* Creature::SelectVictim() return nullptr; } -bool Creature::SetDisableGravity(bool disable, bool packetOnly /*= false*/, bool updateAnimationTier /*= true*/) +bool Creature::SetDisableGravity(bool disable, bool updateAnimTier /*= true*/) { - if (!Unit::SetDisableGravity(disable, packetOnly, updateAnimationTier)) + if (!Unit::SetDisableGravity(disable, updateAnimTier)) return false; - if (updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT)) + if (updateAnimTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT)) { if (IsGravityDisabled()) - SetAnimationTier(AnimationTier::Fly); + SetAnimTier(AnimTier::Fly); else if (IsHovering()) - SetAnimationTier(AnimationTier::Hover); + SetAnimTier(AnimTier::Hover); else - SetAnimationTier(AnimationTier::Ground); + SetAnimTier(AnimTier::Ground); } WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE); @@ -1119,27 +1119,27 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly /*= false*/, bool return true; } -bool Creature::SetHover(bool enable, bool packetOnly /*= false*/, bool updateAnimationTier /*= true*/) +bool Creature::SetHover(bool enable, bool updateAnimTier /*= true*/) { - if (!Unit::SetHover(enable, packetOnly, updateAnimationTier)) + if (!Unit::SetHover(enable, updateAnimTier)) return false; - if (updateAnimationTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT)) + if (updateAnimTier && IsAlive() && !HasUnitState(UNIT_STATE_ROOT)) { if (IsGravityDisabled()) - SetAnimationTier(AnimationTier::Fly); + SetAnimTier(AnimTier::Fly); else if (IsHovering()) - SetAnimationTier(AnimationTier::Hover); + SetAnimTier(AnimTier::Hover); else - SetAnimationTier(AnimationTier::Ground); + SetAnimTier(AnimTier::Ground); } return true; } -bool Creature::SetCanFly(bool enable, bool packetOnly /*= false*/) +bool Creature::SetCanFly(bool enable) { - if (!Unit::SetCanFly(enable, packetOnly)) + if (!Unit::SetCanFly(enable)) return false; WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_FLYING : SMSG_SPLINE_MOVE_UNSET_FLYING); @@ -2540,7 +2540,7 @@ bool Creature::LoadCreaturesAddon() // UNIT_FIELD_BYTES_1 values SetStandState(UnitStandStateType(creatureAddon->standState)); - SetAnimationTier(AnimationTier(creatureAddon->animTier)); + SetAnimTier(AnimTier(creatureAddon->animTier)); SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_VIS_FLAG, creatureAddon->visFlags); // UNIT_FIELD_BYTES_2 values diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index e0ce02e44c..f71d7ca2c0 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -129,9 +129,9 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma bool CanEnterWater() const override { return (CanSwim() || IsAmphibious()); }; bool CanFly() const override { return (IsFlying() || HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)); } - bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true) override; - bool SetHover(bool enable, bool packetOnly = false, bool updateAnimationTier = true) override; - bool SetCanFly(bool enable, bool packetOnly = false) override; + bool SetDisableGravity(bool disable, bool updateAnimTier = true) override; + bool SetHover(bool enable, bool updateAnimTier = true) override; + bool SetCanFly(bool enable) override; bool IsDungeonBoss() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS) != 0; } bool IsAffectedByDiminishingReturns() const override { return Unit::IsAffectedByDiminishingReturns() || (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) != 0; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 60288232f6..112e0a5296 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4066,7 +4066,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) setDeathState(ALIVE); - SetWaterWalking(false, true); + SetWaterWalking(false); if (!HasUnitState(UNIT_STATE_STUNNED)) SetRooted(false); @@ -23331,13 +23331,13 @@ void Player::SendAurasForTarget(Unit* target) const These movement packets are usually found in SMSG_COMPRESSED_MOVES */ if (target->HasAuraType(SPELL_AURA_FEATHER_FALL)) - target->SetFeatherFall(true, true); + target->SetFeatherFall(true); if (target->HasAuraType(SPELL_AURA_WATER_WALK)) - target->SetWaterWalking(true, true); + target->SetWaterWalking(true); if (target->HasAuraType(SPELL_AURA_HOVER)) - target->SetHover(true, true); + target->SetHover(true); Unit::VisibleAuraMap const* visibleAuras = target->GetVisibleAuras(); @@ -25338,7 +25338,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) } } -bool Player::SetDisableGravity(bool disable, bool /*packetOnly = false*/, bool /*updateAnimationTier = true*/) +bool Player::SetDisableGravity(bool disable, bool /*updateAnimTier = true*/) { if (disable == IsGravityDisabled()) return false; @@ -25346,12 +25346,12 @@ bool Player::SetDisableGravity(bool disable, bool /*packetOnly = false*/, bool / if (IsMovedByClient() && IsInWorld()) MovementPacketSender::SendMovementFlagChangeToMover(this, MOVEMENTFLAG_DISABLE_GRAVITY, disable); - Unit::SetDisableGravity(disable, false, false); + Unit::SetDisableGravity(disable, false); return true; } -bool Player::SetCanFly(bool enable, bool /*packetOnly = false*/) +bool Player::SetCanFly(bool enable) { if (enable == HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)) return false; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index f45a49e733..1ca4a53a55 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2176,8 +2176,8 @@ class TC_GAME_API Player : public Unit, public GridObject WorldObject* m_seer; void SetFallInformation(uint32 time, float z); void HandleFall(MovementInfo const& movementInfo); - bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true) override; - bool SetCanFly(bool enable, bool packetOnly = false) override; + bool SetDisableGravity(bool disable, bool updateAnimTier = true) override; + bool SetCanFly(bool enable) override; bool SetCanTransitionBetweenSwimAndFly(bool enable) override; void SendMovementSetCollisionHeight(float height, UpdateCollisionHeightReason reason); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aa2e3dfb0a..2fcc05eb85 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -376,6 +376,7 @@ Unit::Unit(bool isWorldObject) : _oldFactionId = 0; _isWalkingBeforeCharm = false; + _playHoverAnim = false; } //////////////////////////////////////////////////////////// @@ -550,8 +551,8 @@ void Unit::UpdateSplineMovement(uint32 t_diff) if (arrived) { DisableSpline(); - if (Optional animTier = movespline->GetAnimation()) - SetAnimationTier(*animTier); + if (Optional animTier = movespline->GetAnimation()) + SetAnimTier(*animTier); } UpdateSplinePosition(); @@ -10345,6 +10346,19 @@ void Unit::SetStandState(uint8 state) } } +void Unit::SetAnimTier(AnimTier animTier, bool notifyClient /*= true*/) +{ + SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, AsUnderlyingType(animTier)); + + if (notifyClient) + { + WorldPackets::Misc::SetAnimTier setAnimTier; + setAnimTier.Unit = GetGUID(); + setAnimTier.Tier = AsUnderlyingType(animTier); + SendMessageToSet(setAnimTier.Write(), true); + } +} + bool Unit::IsPolymorphed() const { uint32 transformId = getTransForm(); @@ -10358,17 +10372,6 @@ bool Unit::IsPolymorphed() const return spellInfo->GetSpellSpecific() == SPELL_SPECIFIC_MAGE_POLYMORPH; } -void Unit::SetAnimationTier(AnimationTier tier, bool immediate /* = true */) -{ - if (!IsCreature() || tier == GetAnimationTier()) - return; - - SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, static_cast(tier)); - - if (immediate) - SendMovementSetSplineAnim(tier); -} - void Unit::RecalculateObjectScale() { int32 scaleAuras = GetTotalAuraModifier(SPELL_AURA_MOD_SCALE) + GetTotalAuraModifier(SPELL_AURA_MOD_SCALE_2); @@ -12195,7 +12198,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) SendMoveKnockBack(GetGameClientMovingMe()->GetBasePlayer(), speedXY, -speedZ, vcos, vsin); if (HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || HasAuraType(SPELL_AURA_FLY)) - SetCanFly(true, false); + SetCanFly(true); } } @@ -13714,26 +13717,33 @@ bool Unit::SetWalk(bool enable) return true; } -bool Unit::SetDisableGravity(bool disable, bool packetOnly /*= false*/, bool /*updateAnimationTier = true*/) +bool Unit::SetDisableGravity(bool disable, bool /*updateAnimTier = true*/) { - if (!packetOnly) - { - if (disable == IsGravityDisabled()) - return false; + if (disable == IsGravityDisabled()) + return false; - if (disable) - { - AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); - RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_SPLINE_ELEVATION); - SetFall(false); - } - else - { - RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); - if (!HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)) - SetFall(true); - } + if (disable) + { + AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); + RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_SPLINE_ELEVATION); + SetFall(false); } + else + { + RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); + if (!HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)) + SetFall(true); + } + + if (IsAlive()) + { + if (IsGravityDisabled() || IsHovering()) + SetPlayHoverAnim(true); + else + SetPlayHoverAnim(false); + } + else if (IsPlayer()) // To update player who dies while flying/hovering + SetPlayHoverAnim(false, false); return true; } @@ -13772,25 +13782,22 @@ bool Unit::SetSwim(bool enable) return true; } -bool Unit::SetCanFly(bool enable, bool packetOnly) +bool Unit::SetCanFly(bool enable) { - if (!packetOnly) - { - if (enable == HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)) - return false; + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)) + return false; - if (enable) - { - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); - RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_SPLINE_ELEVATION); - SetFall(false); - } - else - { - if (IsFlying() && !IsGravityDisabled()) - SetFall(true); - RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_MASK_MOVING_FLY); - } + if (enable) + { + AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); + RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_SPLINE_ELEVATION); + SetFall(false); + } + else + { + if (IsFlying() && !IsGravityDisabled()) + SetFall(true); + RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_MASK_MOVING_FLY); } return true; @@ -13809,18 +13816,15 @@ bool Unit::SetCanTransitionBetweenSwimAndFly(bool enable) return true; } -bool Unit::SetWaterWalking(bool enable, bool packetOnly /*= false */) +bool Unit::SetWaterWalking(bool enable) { - if (!packetOnly) - { - if (enable == HasUnitMovementFlag(MOVEMENTFLAG_WATERWALKING)) - return false; + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_WATERWALKING)) + return false; - if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - else - RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); - } + if (enable) + AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); if (enable) Movement::PacketSender(this, SMSG_SPLINE_MOVE_SET_WATER_WALK, SMSG_MOVE_WATER_WALK).Send(); @@ -13830,18 +13834,15 @@ bool Unit::SetWaterWalking(bool enable, bool packetOnly /*= false */) return true; } -bool Unit::SetFeatherFall(bool enable, bool packetOnly /*= false */) +bool Unit::SetFeatherFall(bool enable) { - if (!packetOnly) - { - if (enable == HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW)) - return false; + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW)) + return false; - if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); - else - RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); - } + if (enable) + AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); if (enable) Movement::PacketSender(this, SMSG_SPLINE_MOVE_SET_FEATHER_FALL, SMSG_MOVE_FEATHER_FALL).Send(); @@ -13851,32 +13852,29 @@ bool Unit::SetFeatherFall(bool enable, bool packetOnly /*= false */) return true; } -bool Unit::SetHover(bool enable, bool packetOnly /*= false*/, bool /*updateAnimationTier = true*/) +bool Unit::SetHover(bool enable, bool /*updateAnimTier = true*/) { - if (!packetOnly) + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + return false; + + float hoverHeight = GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + + if (enable) { - if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) - return false; - - float hoverHeight = GetFloatValue(UNIT_FIELD_HOVERHEIGHT); - - if (enable) + //! No need to check height on ascent + AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + if (hoverHeight && GetPositionZ() - GetFloorZ() < hoverHeight) + UpdateHeight(GetPositionZ() + hoverHeight); + } + else + { + RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER); + //! Dying creatures will MoveFall from setDeathState + if (hoverHeight && (!isDying() || GetTypeId() != TYPEID_UNIT)) { - //! No need to check height on ascent - AddUnitMovementFlag(MOVEMENTFLAG_HOVER); - if (hoverHeight && GetPositionZ() - GetFloorZ() < hoverHeight) - UpdateHeight(GetPositionZ() + hoverHeight); - } - else - { - RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER); - //! Dying creatures will MoveFall from setDeathState - if (hoverHeight && (!isDying() || GetTypeId() != TYPEID_UNIT)) - { - float newZ = std::max(GetFloorZ(), GetPositionZ() - hoverHeight); - UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); - UpdateHeight(newZ); - } + float newZ = std::max(GetFloorZ(), GetPositionZ() - hoverHeight); + UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); + UpdateHeight(newZ); } } @@ -13885,7 +13883,15 @@ bool Unit::SetHover(bool enable, bool packetOnly /*= false*/, bool /*updateAnima else Movement::PacketSender(this, SMSG_SPLINE_MOVE_UNSET_HOVER, SMSG_MOVE_UNSET_HOVER).Send(); - SendSetPlayHoverAnim(enable); + if (IsAlive()) + { + if (IsGravityDisabled() || IsHovering()) + SetPlayHoverAnim(true); + else + SetPlayHoverAnim(false); + } + else if (IsPlayer()) // To update player who dies while flying/hovering + SetPlayHoverAnim(false, false); return true; } @@ -13898,20 +13904,20 @@ void Unit::SendSetVehicleRecId(uint32 vehicleId) SendMessageToSet(setVehicleRec.Write(), true); } -void Unit::SendSetPlayHoverAnim(bool enable) +void Unit::SetPlayHoverAnim(bool enable, bool sendUpdate /*= true*/) { + if (IsPlayingHoverAnim() == enable) + return; + + _playHoverAnim = enable; + + if (!sendUpdate) + return; + WorldPackets::Misc::SetPlayHoverAnim packet; packet.UnitGUID = GetGUID(); packet.PlayHoverAnim = enable; - SendMessageToSet(packet.Write(), IsPlayer()); -} - -void Unit::SendMovementSetSplineAnim(AnimationTier anim) -{ - WorldPackets::Misc::SetAnimTier packet; - packet.Unit = GetGUID(); - packet.Tier = AsUnderlyingType(anim); - SendMessageToSet(packet.Write(), false); + SendMessageToSet(packet.Write(), true); } bool Unit::IsSplineEnabled() const diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index ec3fb463d3..969895a31a 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -977,8 +977,8 @@ class TC_GAME_API Unit : public WorldObject bool IsStandState() const; void SetStandState(uint8 state); - void SetAnimationTier(AnimationTier tier, bool immediate = true); - AnimationTier GetAnimationTier() const { return static_cast(GetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER)); } + void SetAnimTier(AnimTier tier, bool immediate = true); + AnimTier GetAnimTier() const { return static_cast(GetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER)); } void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_VIS_FLAG, flags); } void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_VIS_FLAG, flags); } @@ -1166,21 +1166,21 @@ class TC_GAME_API Unit : public WorldObject void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false); - void SendSetPlayHoverAnim(bool enable); - void SendMovementSetSplineAnim(AnimationTier anim); + bool IsPlayingHoverAnim() const { return _playHoverAnim; } + void SetPlayHoverAnim(bool enable, bool sendUpdate = true); bool IsGravityDisabled() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); } bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); } bool IsHovering() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_HOVER); } bool SetWalk(bool enable); - virtual bool SetDisableGravity(bool disable, bool packetOnly = false, bool updateAnimationTier = true); + virtual bool SetDisableGravity(bool disable, bool updateAnimTier = true); bool SetFall(bool enable); bool SetSwim(bool enable); - virtual bool SetCanFly(bool enable, bool packetOnly = false); + virtual bool SetCanFly(bool enable); virtual bool SetCanTransitionBetweenSwimAndFly(bool enable); - bool SetWaterWalking(bool enable, bool packetOnly = false); - bool SetFeatherFall(bool enable, bool packetOnly = false); - virtual bool SetHover(bool enable, bool packetOnly = false, bool updateAnimationTier = true); + bool SetWaterWalking(bool enable); + bool SetFeatherFall(bool enable); + virtual bool SetHover(bool enable, bool updateAnimTier = true); void SendSetVehicleRecId(uint32 vehicleId); void SetOrientationTowards(WorldObject const* target); @@ -1920,6 +1920,8 @@ class TC_GAME_API Unit : public WorldObject uint32 _oldFactionId; ///< faction before charm bool _isWalkingBeforeCharm; ///< Are we walking before we were charmed? + bool _playHoverAnim; + std::unique_ptr m_spellHistory; PositionUpdateInfo _positionUpdateInfo; diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h index d42326ed74..403edddb81 100644 --- a/src/server/game/Entities/Unit/UnitDefines.h +++ b/src/server/game/Entities/Unit/UnitDefines.h @@ -80,7 +80,7 @@ enum UnitBytes2Offsets : uint8 }; // UNIT_FIELD_BYTES_1 (UNIT_BYTES_1_OFFSET_ANIM_TIER) -enum class AnimationTier : uint8 +enum class AnimTier : uint8 { 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 diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2c0fbdc97e..3ab13f6255 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -692,7 +692,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() creatureAddon.standState = 0; } - if (AnimationTier(creatureAddon.animTier) >= AnimationTier::Max) + if (AnimTier(creatureAddon.animTier) >= AnimTier::Max) { TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid animation tier (%u) defined in `creature_template_addon`. Truncated to 0.", entry, creatureAddon.animTier); creatureAddon.animTier = 0; @@ -1237,7 +1237,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.standState = 0; } - if (AnimationTier(creatureAddon.animTier) >= AnimationTier::Max) + if (AnimTier(creatureAddon.animTier) >= AnimTier::Max) { TC_LOG_ERROR("sql.sql", "Creature (GUID: %u) has invalid animation tier (%u) defined in `creature_addon`. Truncated to 0.", guid, creatureAddon.animTier); creatureAddon.animTier = 0; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 12e4a3aa85..0d46fdf35b 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -343,29 +343,29 @@ void MotionMaster::MoveCloserAndStop(uint32 id, Unit* target, float distance) } } -void MotionMaster::MoveLand(uint32 id, Position const& pos, Optional velocity /*= { }*/) +void MotionMaster::MoveLand(uint32 id, Position const& pos, Optional tierTransitionId /*= { }*/, Optional velocity /*= { }*/) { TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveLand: '%s', landing point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); Movement::MoveSplineInit init(_owner); init.MoveTo(PositionToVector3(pos), false); + init.SetAnimation(AnimTier::Ground, tierTransitionId.value_or(1)); init.SetSmooth(); init.SetFly(); - init.SetAnimation(AnimationTier::Ground); if (velocity) init.SetVelocity(velocity.value()); Mutate(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id), MOTION_SLOT_ACTIVE); } -void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, Optional velocity /*= { }*/) +void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, Optional tierTransitionId /*= { }*/, Optional velocity /*= { }*/) { TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveTakeoff: '%s', landing point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); Movement::MoveSplineInit init(_owner); init.MoveTo(PositionToVector3(pos), false); init.SetSmooth(); - init.SetFly(); - init.SetAnimation(AnimationTier::Hover); + init.SetAnimation(AnimTier::Fly, tierTransitionId.value_or(2)); + init.SetFly(); // ensure smooth animation even if gravity is disabled after calling this function if (velocity) init.SetVelocity(velocity.value()); Mutate(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id), MOTION_SLOT_ACTIVE); @@ -501,20 +501,15 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool init.Path().push_back(point); } + init.SetCyclic(); if (_owner->IsFlying()) { init.SetFly(); - init.SetCyclic(); - init.SetAnimation(AnimationTier::Hover); - init.SetUncompressed(); + init.SetAnimation(AnimTier::Hover); } else - { init.SetWalk(true); - init.SetCyclic(); - } - init.SetSmooth(); if (velocity > 0.f) init.SetVelocity(velocity); diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 505ce78e2d..df849a3c43 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -167,8 +167,8 @@ class TC_GAME_API MotionMaster void MoveCloserAndStop(uint32 id, Unit* target, float distance); // These two movement types should only be used with creatures having landing/takeoff animations - void MoveLand(uint32 id, Position const& pos, Optional velocity = { }); - void MoveTakeoff(uint32 id, Position const& pos, Optional velocity = { }); + void MoveLand(uint32 id, Position const& pos, Optional tierTransitionId = { }, Optional velocity = { }); + void MoveTakeoff(uint32 id, Position const& pos, Optional tierTransitionId = { }, Optional velocity = { }); void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, bool generatePath = false); void MoveCharge(PathGenerator const& path, float speed = SPEED_CHARGE); diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 48722ab264..e16a74c76a 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -218,10 +218,10 @@ void WaypointMovementGenerator::StartMove(Creature* creature, bool rel switch (waypoint.MoveType) { case WAYPOINT_MOVE_TYPE_LAND: - init.SetAnimation(AnimationTier::Ground); + init.SetAnimation(AnimTier::Ground); break; case WAYPOINT_MOVE_TYPE_TAKEOFF: - init.SetAnimation(AnimationTier::Hover); + 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 f03da7c77b..4dc8adcb6a 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -31,7 +31,7 @@ namespace WorldPackets } } -enum class AnimationTier : uint8; +enum class AnimTier : uint8; namespace Movement { @@ -82,7 +82,7 @@ namespace Movement int32 point_Idx; int32 point_Idx_offset; float velocity; - Optional anim_tier; + Optional anim_tier; void init_spline(MoveSplineInitArgs const& args); @@ -142,7 +142,7 @@ namespace Movement int32 MaxPathIdx() const { return spline.last() - 1; } bool HasStarted() const { return time_passed > 0; } - Optional GetAnimation() const { return anim_tier; } + Optional GetAnimation() const { return anim_tier ? anim_tier->AnimTier : Optional{}; } bool onTransport; bool splineIsFacingOnly; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index dafcf32c65..5b73c781b8 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -22,7 +22,7 @@ class Unit; -enum class AnimationTier : uint8; +enum class AnimTier : uint8; namespace Movement { @@ -75,7 +75,7 @@ namespace Movement /* Plays animation after movement done * can't be combined with parabolic movement */ - void SetAnimation(AnimationTier anim, Milliseconds transitionStartTime = 0ms); + void SetAnimation(AnimTier anim, uint32 tierTransitionId = 0, Milliseconds transitionStartTime = 0ms); /* Adds final facing animation * sets unit's facing to specified point/angle after all path done @@ -189,12 +189,15 @@ namespace Movement args.flags.Parabolic = true; } - inline void MoveSplineInit::SetAnimation(AnimationTier anim, Milliseconds transitionStartTime /*= 0ms*/) + inline void MoveSplineInit::SetAnimation(AnimTier anim, uint32 tierTransitionId /*= 0*/, Milliseconds transitionStartTime /*= 0ms*/) { args.effect_start_time_percent = 0.f; args.effect_start_time = transitionStartTime; - args.animTier = anim; - args.flags.Animation = true; + args.animTier.emplace(); + args.animTier->TierTransitionId = tierTransitionId; + args.animTier->AnimTier = anim; + if (!tierTransitionId) + args.flags.Animation = true; } inline void MoveSplineInit::DisableTransportPathTransformations() { args.TransformForTransport = false; } diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index bd188da6dc..23de560060 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -25,7 +25,7 @@ class Unit; -enum class AnimationTier : uint8; +enum class AnimTier : uint8; namespace Movement { @@ -45,6 +45,12 @@ namespace Movement FacingInfo() : angle(0.0f), type(MONSTER_MOVE_NORMAL) { f.x = f.y = f.z = 0.0f; } }; + struct AnimTierTransition + { + uint32 TierTransitionId = 0; + ::AnimTier AnimTier = ::AnimTier(0); + }; + struct MoveSplineInitArgs { explicit MoveSplineInitArgs(size_t path_capacity = 16); @@ -62,7 +68,7 @@ namespace Movement Milliseconds effect_start_time; // absolute value uint32 splineId; float initialOrientation; - Optional animTier; + Optional animTier; bool walk; bool HasVelocity; bool TransformForTransport; diff --git a/src/server/game/Server/Packets/MovementPackets.cpp b/src/server/game/Server/Packets/MovementPackets.cpp index 160d7e0901..9bd1f2be28 100644 --- a/src/server/game/Server/Packets/MovementPackets.cpp +++ b/src/server/game/Server/Packets/MovementPackets.cpp @@ -381,11 +381,11 @@ void WorldPackets::Movement::MonsterMove::InitializeSplineData(::Movement::MoveS movementSpline.FaceGUID = moveSpline.facing.target; movementSpline.FaceSpot = Position(moveSpline.facing.f.x, moveSpline.facing.f.y, moveSpline.facing.f.z); - if (splineFlags.Animation) + if (moveSpline.anim_tier) { movementSpline.Animation.emplace(); movementSpline.Animation->TierTransStartTime = moveSpline.effect_start_time; - movementSpline.Animation->AnimTier = AsUnderlyingType(*moveSpline.anim_tier); + movementSpline.Animation->AnimTier = AsUnderlyingType(moveSpline.anim_tier->AnimTier); } movementSpline.MoveTime = moveSpline.Duration(); diff --git a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_halfus_wyrmbreaker.cpp b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_halfus_wyrmbreaker.cpp index 5e55e9f803..186a81ecb7 100644 --- a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_halfus_wyrmbreaker.cpp +++ b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_halfus_wyrmbreaker.cpp @@ -397,7 +397,6 @@ struct npc_halfus_enslaved_dragon final : public ScriptedAI void JustDied(Unit* /*killer*/) override { me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); me->DespawnOrUnsummon(6s); if (Creature* protoBehemoth = _instance->GetCreature(DATA_PROTO_BEHEMOTH)) diff --git a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp index 083fabcf51..e9182956b8 100644 --- a/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp +++ b/src/server/scripts/EasternKingdoms/BastionOfTwilight/boss_theralion_and_valiona.cpp @@ -273,7 +273,6 @@ struct boss_theralion final : public BossAI { _EnterEvadeMode(); instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); - me->SendSetPlayHoverAnim(false); me->SetDisableGravity(false); summons.DespawnAll(); @@ -311,7 +310,6 @@ struct boss_theralion final : public BossAI me->SetReactState(REACT_PASSIVE); me->PlayOneShotAnimKitId(ANIM_KIT_LIFTOFF); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); _dazzlingDestructionCount = 0; events.SetPhase(PHASE_AIR); events.CancelEvent(EVENT_FABULOUS_FLAMES); @@ -355,7 +353,6 @@ struct boss_theralion final : public BossAI break; case POINT_LAND: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); events.ScheduleEvent(EVENT_ATTACK_PLAYERS, 2s); break; default: @@ -514,7 +511,6 @@ struct boss_valiona final : public BossAI { _EnterEvadeMode(); instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); - me->SendSetPlayHoverAnim(false); me->SetDisableGravity(false); summons.DespawnAll(); _DespawnAtEvade(); @@ -554,7 +550,6 @@ struct boss_valiona final : public BossAI events.CancelEvent(EVENT_DEVOURING_FLAMES); me->PlayOneShotAnimKitId(ANIM_KIT_LIFTOFF); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); _deepBreathCount = 0; events.ScheduleEvent(EVENT_FLY_TO_DESTINATION, 1s); events.ScheduleEvent(EVENT_DEEP_BREATH, 1min + 25s + 100ms); @@ -606,7 +601,6 @@ struct boss_valiona final : public BossAI break; case POINT_LAND: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); events.ScheduleEvent(EVENT_ATTACK_PLAYERS, 2s); events.ScheduleEvent(EVENT_BLACKOUT, 10s + 500ms); events.ScheduleEvent(EVENT_DEVOURING_FLAMES, 25s); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_atramedes.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_atramedes.cpp index ef51fb4fdf..926369f7fa 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_atramedes.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_atramedes.cpp @@ -367,7 +367,6 @@ struct boss_atramedes : public BossAI break; case POINT_LAND_INTRO: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); me->SetReactState(REACT_AGGRESSIVE); break; @@ -380,7 +379,6 @@ struct boss_atramedes : public BossAI break; case POINT_LAND: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); events.SetPhase(PHASE_GROUND); events.ScheduleEvent(EVENT_REENGAGE_PLAYERS, 800ms, 0, PHASE_GROUND); events.ScheduleEvent(EVENT_SONAR_PULSE, 14s, 0, PHASE_GROUND); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_maloriak.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_maloriak.cpp index a4532f9e68..a1bf8e3da3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_maloriak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_maloriak.cpp @@ -707,7 +707,6 @@ struct npc_maloriak_experiment : public ScriptedAI { case POINT_GROUND: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); DoZoneInCombat(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_nefarians_end.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_nefarians_end.cpp index fdbdc9341a..e80e843b2f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_nefarians_end.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/boss_nefarians_end.cpp @@ -400,14 +400,13 @@ struct boss_nefarians_end : public BossAI { events.ScheduleEvent(EVENT_CHAIN_ONYXIA, 1s, 0, PHASE_ONE); events.ScheduleEvent(EVENT_REMOVE_TRANSFORM_AURA, 26s + 700ms, 0, PHASE_ONE); - me->SendSetPlayHoverAnim(false); + me->SetDisableGravity(false); DoCastSelf(SPELL_INTRO_2_STALKER_TRANSFORM); DoCastSelf(SPELL_INTRO_3_SHRINK_AURA); } else { - me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); - me->SetAnimationTier(AnimationTier::Fly); + me->SetDisableGravity(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->GetMotionMaster()->MoveCyclicPath(NefarianCyclicRespawnPath, CyclicRespawnPathPoints, false, true, 14.0f); DoCastSelf(SPELL_INTRO_5A_START_FIGHT_PROC); @@ -634,7 +633,6 @@ struct boss_nefarians_end : public BossAI me->RemoveAurasDueToSpell(SPELL_INTRO_2_STALKER_TRANSFORM); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); events.ScheduleEvent(EVENT_LIFT_OFF, 2s, 0, PHASE_ONE); break; case EVENT_LIFT_OFF: @@ -666,7 +664,6 @@ struct boss_nefarians_end : public BossAI break; case EVENT_LANDED: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); if (events.IsInPhase(PHASE_ONE)) { @@ -735,7 +732,6 @@ struct boss_nefarians_end : public BossAI case EVENT_LIFTOFF_PHASE_TWO: DoCastSelf(SPELL_NEFARIAN_PHASE_2_HEALTH_AURA); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); me->GetMotionMaster()->MovePoint(POINT_NONE, NefarianElevatorLiftOffPosition); events.ScheduleEvent(EVENT_SUMMON_CHROMATIC_PROTOTYPES, 400ms, 0, PHASE_TWO); events.ScheduleEvent(EVENT_LOWER_ELEVATOR, 800ms, 0, PHASE_TWO); @@ -790,7 +786,6 @@ struct boss_nefarians_end : public BossAI instance->DoUpdateWorldState(WORLD_STATE_ID_KEEPING_IT_IN_THE_FAMILY, 0); me->RemoveAurasDueToSpell(SPELL_NEFARIAN_PHASE_2_HEALTH_AURA); - me->SendSetPlayHoverAnim(true); me->GetMotionMaster()->MoveLand(POINT_LAND, NefarianElevatorLandPhaseThreePosition); break; case EVENT_ELECTROCUTE: diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp index 61e6d3a0c7..fbe70f7b9e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingDescent/instance_blackwing_descent.cpp @@ -341,7 +341,6 @@ class instance_blackwing_descent : public InstanceMapScript atramedes->SetDisableGravity(true); atramedes->SetReactState(REACT_PASSIVE); - atramedes->SendSetPlayHoverAnim(true); if (atramedes->IsAIEnabled()) atramedes->AI()->DoAction(ACTION_START_ATRAMEDES_INTRO); diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp index e54281f00b..97a6e61131 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_glubtok.cpp @@ -274,7 +274,6 @@ struct boss_glubtok : public BossAI Talk(SAY_ARCANE_POWER); DoCastSelf(SPELL_ARCANE_POWER); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); Movement::MoveSplineInit init(me); init.MoveTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 2.0f, false); diff --git a/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp b/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp index 16ff1a145b..0e7237ea81 100644 --- a/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp +++ b/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp @@ -650,7 +650,7 @@ struct npc_gilnean_crow : public PassiveAI { case EVENT_APPLY_HOVER_BYTES: me->SetStandState(UNIT_STAND_STATE_SIT); - me->SetAnimationTier(AnimationTier::Submerged); + me->SetAnimTier(AnimTier::Submerged); _events.ScheduleEvent(EVENT_FLY_AWAY_1, 1s); break; case EVENT_FLY_AWAY_1: diff --git a/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp b/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp index 02b8aecefa..b564a73207 100644 --- a/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp +++ b/src/server/scripts/EasternKingdoms/GrimBatol/grim_batol.cpp @@ -187,8 +187,6 @@ struct npc_grim_batol_battered_red_drake: public VehicleAI me->RemoveAurasDueToSpell(SPELL_NET); DoCastSelf(SPELL_BOMBING_RUN_PROTECTION_TRIGGER); - // Yes, this is stupid. Don't argue. Confirmed by 2012 sniffs. - me->SetDisableGravity(true, false, false); summon->CastSpell(summon, SPELL_NET_SCRIPT); summon->DespawnOrUnsummon(3s); } @@ -221,7 +219,6 @@ struct npc_grim_batol_battered_red_drake: public VehicleAI _instance->SetData(DATA_START_BATTERED_RED_DRAKE_DESPAWN_EVENT, IN_PROGRESS); me->SetControlled(true, UNIT_STATE_ROOT); me->PlayOneShotAnimKitId(ANIM_KIT_ID_LIFTOFF); - me->SetAnimationTier(AnimationTier::Fly); _playerGuid = player->GetGUID(); diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp index c56f3be1c5..911e2efbb8 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp @@ -129,7 +129,6 @@ class PrepareDelayedAttackEvent : public BasicEvent { _owner->RemoveAurasDueToSpell(SPELL_WATER_JUMP_THROUGH_WINDOW_VISUAL); _owner->SetDisableGravity(false); - _owner->SendSetPlayHoverAnim(false); _owner->SetMovementAnimKitId(0); _owner->m_Events.AddEvent(new DelayedAttackEvent(_owner), _owner->m_Events.CalculateTime(1000)); return true; @@ -281,7 +280,6 @@ struct boss_lady_nazjar : public BossAI { invader->SetReactState(REACT_PASSIVE); invader->SetDisableGravity(true); - invader->SendSetPlayHoverAnim(true); invader->SetMovementAnimKitId(3); invader->CastSpell(invader, SPELL_WATER_WINDOW_BREAK_VISUAL); invader->GetMotionMaster()->MoveJump(LadyNazjarAddJumpPositions[i], 16.0f, 11.0f); diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp index 56090a366b..50f98a8033 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_ozumat.cpp @@ -473,14 +473,12 @@ struct npc_ozumat_neptulon : public ScriptedAI case NPC_UNYIELDING_BEHEMOTH: summon->SetReactState(REACT_PASSIVE); summon->SetDisableGravity(true); - summon->SendSetPlayHoverAnim(true); summon->SetCorpseDelay(4); summon->m_Events.AddEvent(new ChargeToWindowEvent(summon), summon->m_Events.CalculateTime(2 * IN_MILLISECONDS)); break; case NPC_BLIGHT_BEAST: summon->SetReactState(REACT_PASSIVE); summon->SetDisableGravity(true); - summon->SendSetPlayHoverAnim(true); summon->SetCorpseDelay(4); summon->m_Events.AddEvent(new ChargeToWindowEvent(summon), summon->m_Events.CalculateTime(2400)); break; @@ -671,7 +669,6 @@ struct npc_ozumat_unyielding_behemoth : public ScriptedAI me->AttackStop(); me->SetReactState(REACT_PASSIVE); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); DoCast(summon, SPELL_SHADOW_BLAST_RIDE_VEHICLE); _events.ScheduleEvent(EVENT_DISABLE_HOVER_ANIM, 400ms); _events.ScheduleEvent(EVENT_SHADOW_BLAST_VISUAL, 1s + 200ms); @@ -709,14 +706,13 @@ struct npc_ozumat_unyielding_behemoth : public ScriptedAI DoCastAOE(SPELL_SHADOW_BLAST); break; case EVENT_DISABLE_HOVER_ANIM: - me->SendSetPlayHoverAnim(false); + me->SetPlayHoverAnim(false); break; case EVENT_SHADOW_BLAST_VISUAL: DoCastAOE(SPELL_SHADOW_BLAST_VISUAL); break; case EVENT_FINISH_SHADOW_BLAST: me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); me->SetReactState(REACT_AGGRESSIVE); if (Unit* victim = me->GetVictim()) AttackStart(victim); @@ -773,7 +769,6 @@ class spell_ozumat_jump_to_ground : public SpellScript if (Unit* caster = GetCaster()) { caster->SetDisableGravity(false); - caster->SendSetPlayHoverAnim(false); } } @@ -821,7 +816,7 @@ class spell_ozumat_shadow_blast_AuraScript : public AuraScript { if (Unit* target = GetTarget()) { - target->SendSetPlayHoverAnim(true); + target->SetPlayHoverAnim(true); target->CastSpell(target, SPELL_SHADOW_BLAST_MISSILE); if (Vehicle* vehicle = target->GetVehicleKit()) diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_tides.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_tides.cpp index 2d3e5d803f..e6ab5fa090 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_tides.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_tides.cpp @@ -94,7 +94,6 @@ class FaceDirectionEvent : public BasicEvent { _owner->RemoveAurasDueToSpell(SPELL_WATER_JUMP_THROUGH_WINDOW_VISUAL); _owner->SetDisableGravity(false); - _owner->SendSetPlayHoverAnim(false); _owner->SetMovementAnimKitId(0); _owner->SetFacingTo(_facingAngle); _owner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); @@ -401,7 +400,6 @@ class instance_throne_of_the_tides : public InstanceMapScript { invader->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); invader->SetDisableGravity(true); - invader->SendSetPlayHoverAnim(true); invader->SetMovementAnimKitId(3); invader->SetReactState(REACT_PASSIVE); invader->GetMotionMaster()->MovePoint(0, TotTFirstInvaderInitialMovePositions[i], false); @@ -418,7 +416,6 @@ class instance_throne_of_the_tides : public InstanceMapScript { invader->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); invader->SetDisableGravity(true); - invader->SendSetPlayHoverAnim(true); invader->SetMovementAnimKitId(3); invader->SetReactState(REACT_PASSIVE); invader->GetMotionMaster()->MovePoint(0, TotTLadyNazjarInvaderInitialMovePositions[i], false); @@ -543,7 +540,7 @@ class instance_throne_of_the_tides : public InstanceMapScript break; default: break; - + } } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 617efee243..87c75a9483 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -563,7 +563,6 @@ class spell_akilzon_electrical_storm : public AuraScript { Unit* target = GetTarget(); target->SetDisableGravity(true); - target->SendSetPlayHoverAnim(true); target->SetControlled(true, UNIT_STATE_ROOT); target->CastSpell(target, SPELL_ELECTRICAL_STORM_AREA_AURA, true); target->CastSpell(target, SPELL_TELEPORT_SELF, true); @@ -575,7 +574,6 @@ class spell_akilzon_electrical_storm : public AuraScript target->SetDisableGravity(false); target->SetControlled(false, UNIT_STATE_ROOT); target->RemoveAurasDueToSpell(SPELL_ELECTRICAL_STORM_AREA_AURA); - target->SendSetPlayHoverAnim(false); target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_2].BasePoints); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_high_priestess_kilnara.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_high_priestess_kilnara.cpp index 9708464c71..40629213b4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_high_priestess_kilnara.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_high_priestess_kilnara.cpp @@ -122,7 +122,6 @@ struct boss_high_priestess_kilnara : public BossAI DoCastAOE(SPELL_CLEAR_ACHIEVEMENT_CREDITS); me->SetHover(false); - me->SendSetPlayHoverAnim(false); me->RemoveAurasDueToSpell(SPELL_KILNARA_HOVER_VISUAL_1); me->RemoveAurasDueToSpell(SPELL_KILNARA_HOVER_VISUAL_2); instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp index 4f9b229e16..7d30d97980 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp @@ -386,7 +386,6 @@ struct npc_zanzil_zanzili_berserker : public ScriptedAI me->SetAIAnimKitId(0); me->GetMotionMaster()->MoveFall(); me->SetDisableGravity(false); - me->SendSetPlayHoverAnim(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); DoZoneInCombat(); _events.ScheduleEvent(EVENT_PURSUIT, 2s); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DragonSoul/boss_madness_of_deathwing.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DragonSoul/boss_madness_of_deathwing.cpp index 0c4cc198f6..11aef378a7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DragonSoul/boss_madness_of_deathwing.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DragonSoul/boss_madness_of_deathwing.cpp @@ -1359,7 +1359,6 @@ struct npc_madness_of_deathwing_thrall : public ScriptedAI case ACTION_FIRE_DRAGON_SOUL: _events.Reset(); me->SetDisableGravity(true); - me->SendSetPlayHoverAnim(true); DoCastAOE(SPELL_FIRE_DRAGON_SOUL_ASPECTS); DoCastAOE(SPELL_TRIGGER_ASPECT_YELL); DoCastSelf(SPELL_ASTRAL_RECALL_OUTRO); @@ -1396,7 +1395,6 @@ struct npc_madness_of_deathwing_thrall : public ScriptedAI case EVENT_PLAY_MOVIE: DoCastAOE(SPELL_PLAY_MOVIE); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - me->SendSetPlayHoverAnim(false); me->SetDisableGravity(false); if (Creature* ysera = _instance->GetCreature(DATA_YSERA_MADNESS_OF_DEATHWING)) @@ -2142,14 +2140,14 @@ class spell_madness_of_deathwing_concentration : public AuraScript if (creature->IsAIEnabled()) creature->AI()->SetGUID(GetTarget()->GetGUID(), DATA_FOCUSED_LIMB); - GetTarget()->SetAnimationTier(AnimationTier::Fly); + GetTarget()->SetAnimTier(AnimTier::Fly); for (uint8 i = 0; i < 2; ++i) GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_COSMETIC_TENTACLE); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->SetAnimationTier(AnimationTier::Ground); + GetTarget()->SetAnimTier(AnimTier::Ground); } void Register() override diff --git a/src/server/scripts/Kalimdor/Firelands/boss_ragnaros_firelands.cpp b/src/server/scripts/Kalimdor/Firelands/boss_ragnaros_firelands.cpp index afedccf59e..3b2f050df5 100644 --- a/src/server/scripts/Kalimdor/Firelands/boss_ragnaros_firelands.cpp +++ b/src/server/scripts/Kalimdor/Firelands/boss_ragnaros_firelands.cpp @@ -783,8 +783,7 @@ struct boss_ragnaros_firelands : public BossAI if (GameObject* platform = instance->GetGameObject(DATA_RAGNAROS_PLATFORM)) platform->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED); me->RemoveAurasDueToSpell(SPELL_LEGS_SUBMERGE); - me->SendSetPlayHoverAnim(true); - me->SetAnimationTier(AnimationTier::Fly, false); + me->SetDisableGravity(true); me->SetControlled(false, UNIT_STATE_ROOT); me->PlayOneShotAnimKitId(ANIM_KIT_ID_EMERGE_HEROIC); instance->SetData(DATA_MAGMA_KNOCKBACK, 0); @@ -808,8 +807,6 @@ struct boss_ragnaros_firelands : public BossAI Talk(SAY_BREAK_FREE); DoCastSelf(SPELL_DREADFLAME_SUMMON_CONTROLLER); me->PlayOneShotAnimKitId(ANIM_KIT_ID_BREAK_FREE); - me->SendSetPlayHoverAnim(false); - me->SetAnimationTier(AnimationTier::Ground, false); me->SetDisableGravity(false); _canBeKilled = true; events.ScheduleEvent(EVENT_SET_AGGRESSIVE_REACT_STATE, 5s, 0, PHASE_FOUR); diff --git a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp index 5cdffa06cc..a91a5387bf 100644 --- a/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp +++ b/src/server/scripts/Kalimdor/ThroneOfTheFourWinds/boss_alakir.cpp @@ -973,7 +973,7 @@ class spell_alakir_wind_burst : public AuraScript { void HandlePeriodic(AuraEffect const* /*aurEff*/) { - GetTarget()->SetCanFly(true, true); + GetTarget()->SetCanFly(true); } void Register() override diff --git a/src/server/scripts/Kalimdor/zone_uldum.cpp b/src/server/scripts/Kalimdor/zone_uldum.cpp index 84de9d3dbc..237da75ebe 100644 --- a/src/server/scripts/Kalimdor/zone_uldum.cpp +++ b/src/server/scripts/Kalimdor/zone_uldum.cpp @@ -520,7 +520,6 @@ class spell_uldum_rescue_survivor : public SpellScript { creature->ExitVehicle(); creature->SetDisableGravity(false); - creature->SetAnimationTier(AnimationTier::Ground, false); creature->DespawnOrUnsummon(30s); Position dest = creature->GetPosition(); 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 e70b8c51d3..c0af5ecaa3 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 @@ -353,7 +353,7 @@ class boss_blood_queen_lana_thel : public CreatureScript break; } case EVENT_DELIRIOUS_SLASH: - if (_offtankGUID && me->GetAnimationTier() != AnimationTier::Fly) + if (_offtankGUID && me->GetAnimTier() != AnimTier::Fly) if (Player* _offtank = ObjectAccessor::GetPlayer(*me, _offtankGUID)) DoCast(_offtank, SPELL_DELIRIOUS_SLASH); events.ScheduleEvent(EVENT_DELIRIOUS_SLASH, urand(20000, 24000), EVENT_GROUP_NORMAL); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 2a3ec36672..6edd8c10fb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -300,9 +300,7 @@ class boss_sindragosa : public CreatureScript { BossAI::JustReachedHome(); instance->SetBossState(DATA_SINDRAGOSA, FAIL); - me->SetCanFly(false); me->SetDisableGravity(false); - me->SetAnimationTier(AnimationTier::Ground); me->SetReactState(REACT_DEFENSIVE); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index d77eac9f1f..76860e69f6 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -279,7 +279,7 @@ class npc_enslaved_proto_drake : public CreatureScript { if (type == WAYPOINT_MOTION_TYPE && id == POINT_LAST) { - me->SetAnimationTier(AnimationTier::Ground); + me->SetAnimTier(AnimTier::Ground); } } @@ -288,7 +288,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->SetAnimationTier(AnimationTier::Fly); + me->SetAnimTier(AnimTier::Fly); me->GetMotionMaster()->MovePath(PATH_PROTODRAKE, false); } }