diff --git a/src/game/Chat/Level3.cpp b/src/game/Chat/Level3.cpp index 45d5f3b2a5..db25095f6a 100644 --- a/src/game/Chat/Level3.cpp +++ b/src/game/Chat/Level3.cpp @@ -5448,12 +5448,11 @@ bool ChatHandler::HandleGMFlyCommand(char* args) if (!target) target = m_session->GetPlayer(); - // [-ZERO] Need reimplement in another way - { - SendSysMessage(LANG_USE_BOL); - return false; - } target->SetCanFly(value); + + if (value) + SendSysMessage("WARNING: Do not jump or flying mode will be removed."); + PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, GetNameLink(target).c_str(), args); return true; } diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index de78618f68..931bed61c1 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -18877,6 +18877,20 @@ void Player::ResurrectUsingRequestDataFinish() SpawnCorpseBones(); } +void Player::SetCanFly(bool enable) +{ + if (enable) + { + m_movementInfo.moveFlags = (MOVEFLAG_LEVITATING | MOVEFLAG_SWIMMING | MOVEFLAG_CAN_FLY | MOVEFLAG_FLYING); + } + else + { + m_movementInfo.moveFlags = (MOVEFLAG_NONE); + } + + SendHeartBeat(); +} + void Player::UpdateClientControl(Unit const* target, bool enabled, bool forced) const { if (target) diff --git a/src/game/Entities/Player.h b/src/game/Entities/Player.h index 04f14833cb..1b47848e15 100644 --- a/src/game/Entities/Player.h +++ b/src/game/Entities/Player.h @@ -2050,6 +2050,7 @@ class Player : public Unit bool IsFlying() const override { return false; } bool IsFreeFlying() const { return false; } bool IsSwimming() const { return m_movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING); } + void SetCanFly(bool enable) override; void UpdateClientControl(Unit const* target, bool enabled, bool forced = false) const; diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 57d6d5ca0c..1f1e7a4250 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -12259,7 +12259,16 @@ void Unit::SetSwim(bool enable) void Unit::SetCanFly(bool enable) { - // TBC+ + if (enable) + { + m_movementInfo.AddMovementFlag(MOVEFLAG_CAN_FLY); + m_movementInfo.AddMovementFlag(MOVEFLAG_FLYING_OLD); + } + else + { + m_movementInfo.RemoveMovementFlag(MOVEFLAG_CAN_FLY); + m_movementInfo.RemoveMovementFlag(MOVEFLAG_FLYING_OLD); + } } void Unit::SetFeatherFall(bool enable) diff --git a/src/game/Entities/Unit.h b/src/game/Entities/Unit.h index e405255e55..5d5123dda7 100644 --- a/src/game/Entities/Unit.h +++ b/src/game/Entities/Unit.h @@ -1780,7 +1780,7 @@ class Unit : public WorldObject void SetLevitate(bool enabled); void SetSwim(bool enabled); - void SetCanFly(bool enabled); + virtual void SetCanFly(bool enabled); void SetFeatherFall(bool enabled); void SetHover(bool enabled); void SetWaterWalk(bool enabled);