diff --git a/src/game/MapPersistentStateMgr.cpp b/src/game/MapPersistentStateMgr.cpp index c5f28201d..9dcf59ec5 100644 --- a/src/game/MapPersistentStateMgr.cpp +++ b/src/game/MapPersistentStateMgr.cpp @@ -213,6 +213,7 @@ DungeonPersistentState::DungeonPersistentState(uint16 MapId, uint32 InstanceId, DungeonPersistentState::~DungeonPersistentState() { + DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId()); while (!m_playerList.empty()) { Player* player = *(m_playerList.begin()); diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 471ea1bfd..4f16a471e 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -420,6 +420,15 @@ void MotionMaster::MoveDistract(uint32 timer) Mutate(mgen); } +void MotionMaster::MoveFlyOrLand(uint32 id, float x, float y, float z, bool liftOff) +{ + if (m_owner->GetTypeId() != TYPEID_UNIT) + return; + + DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "%s targeted point for %s (Id: %u X: %f Y: %f Z: %f)", m_owner->GetGuidStr().c_str(), liftOff ? "liftoff" : "landing", id, x, y, z); + Mutate(new FlyOrLandMovementGenerator(id, x, y, z, liftOff)); +} + void MotionMaster::Mutate(MovementGenerator* m) { if (!empty()) diff --git a/src/game/MotionMaster.h b/src/game/MotionMaster.h index 040f51ae4..9d24818e9 100644 --- a/src/game/MotionMaster.h +++ b/src/game/MotionMaster.h @@ -110,6 +110,7 @@ class MANGOS_DLL_SPEC MotionMaster : private std::stack void MoveDistract(uint32 timeLimit); void MoveJump(float x, float y, float z, float horizontalSpeed, float max_height, uint32 id = 0); void MoveFall(); + void MoveFlyOrLand(uint32 id, float x, float y, float z, bool liftOff); MovementGeneratorType GetCurrentMovementGeneratorType() const; diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp index 95d6fb68b..4332538fd 100644 --- a/src/game/PointMovementGenerator.cpp +++ b/src/game/PointMovementGenerator.cpp @@ -141,3 +141,21 @@ void EffectMovementGenerator::Finalize(Unit& unit) unit.GetMotionMaster()->Initialize(); } } + +void FlyOrLandMovementGenerator::Initialize(Unit& unit) +{ + if (unit.hasUnitState(UNIT_STAT_CAN_NOT_REACT | UNIT_STAT_NOT_MOVE)) + return; + + if (!unit.IsStopped()) + unit.StopMoving(); + + float x, y, z; + GetDestination(x, y, z); + unit.addUnitState(UNIT_STAT_ROAMING | UNIT_STAT_ROAMING_MOVE); + Movement::MoveSplineInit init(unit); + init.SetFly(); + init.SetAnimation((m_liftOff ? Movement::FlyToGround : Movement::ToGround)); + init.MoveTo(x, y, z, false); + init.Launch(); +} diff --git a/src/game/PointMovementGenerator.h b/src/game/PointMovementGenerator.h index ded6fb965..31e999670 100644 --- a/src/game/PointMovementGenerator.h +++ b/src/game/PointMovementGenerator.h @@ -74,4 +74,16 @@ class EffectMovementGenerator : public MovementGenerator uint32 m_Id; }; +class MANGOS_DLL_SPEC FlyOrLandMovementGenerator : public PointMovementGenerator +{ + public: + FlyOrLandMovementGenerator(uint32 _id, float _x, float _y, float _z, bool liftOff) : + PointMovementGenerator(_id, _x, _y, _z, false), + m_liftOff(liftOff) {} + + void Initialize(Unit& unit) override; + private: + bool m_liftOff; +}; + #endif diff --git a/src/game/World.cpp b/src/game/World.cpp index 8120e80df..5c12071c1 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -614,7 +614,7 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID, "Instance.IgnoreRaid", false); setConfig(CONFIG_BOOL_CAST_UNSTUCK, "CastUnstuck", true); - setConfig(CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN, "MaxSpellCastsInChain", 10); + setConfig(CONFIG_UINT32_MAX_SPELL_CASTS_IN_CHAIN, "MaxSpellCastsInChain", 20); setConfig(CONFIG_UINT32_BIRTHDAY_TIME, "BirthdayTime", 1125180000); setConfig(CONFIG_UINT32_RABBIT_DAY, "RabbitDay", 0); diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 5a25e9e7c..c5851fd28 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -573,7 +573,7 @@ LogColors = "" # Max amount triggered spell casts in chain by one caster, prevent stack overflow crash # Too Low value will make some correct triggered casts fail # 0 (no limit) -# Default: 10 +# Default: 20 # # BirthdayTime # Set to birthday (date in unix time), By default 28th August 2005, when MaNGOS got it’s name @@ -793,7 +793,7 @@ DisableWaterBreath = 4 AllFlightPaths = 0 ActivateWeather = 1 CastUnstuck = 1 -MaxSpellCastsInChain = 10 +MaxSpellCastsInChain = 20 BirthdayTime = 1125180000 RabbitDay = 0 Instance.IgnoreLevel = 0 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bfec4fe40..54cf34cb0 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12616" + #define REVISION_NR "12617" #endif // __REVISION_NR_H__