[c12617] Change a default config setting to more fitting

This commit is contained in:
Schmoozerd 2013-05-31 12:14:38 +01:00 committed by Antz
parent dc3de04d62
commit e0290b165a
8 changed files with 45 additions and 4 deletions

View file

@ -213,6 +213,7 @@ DungeonPersistentState::DungeonPersistentState(uint16 MapId, uint32 InstanceId,
DungeonPersistentState::~DungeonPersistentState() DungeonPersistentState::~DungeonPersistentState()
{ {
DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());
while (!m_playerList.empty()) while (!m_playerList.empty())
{ {
Player* player = *(m_playerList.begin()); Player* player = *(m_playerList.begin());

View file

@ -420,6 +420,15 @@ void MotionMaster::MoveDistract(uint32 timer)
Mutate(mgen); 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) void MotionMaster::Mutate(MovementGenerator* m)
{ {
if (!empty()) if (!empty())

View file

@ -110,6 +110,7 @@ class MANGOS_DLL_SPEC MotionMaster : private std::stack<MovementGenerator*>
void MoveDistract(uint32 timeLimit); void MoveDistract(uint32 timeLimit);
void MoveJump(float x, float y, float z, float horizontalSpeed, float max_height, uint32 id = 0); void MoveJump(float x, float y, float z, float horizontalSpeed, float max_height, uint32 id = 0);
void MoveFall(); void MoveFall();
void MoveFlyOrLand(uint32 id, float x, float y, float z, bool liftOff);
MovementGeneratorType GetCurrentMovementGeneratorType() const; MovementGeneratorType GetCurrentMovementGeneratorType() const;

View file

@ -141,3 +141,21 @@ void EffectMovementGenerator::Finalize(Unit& unit)
unit.GetMotionMaster()->Initialize(); 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();
}

View file

@ -74,4 +74,16 @@ class EffectMovementGenerator : public MovementGenerator
uint32 m_Id; uint32 m_Id;
}; };
class MANGOS_DLL_SPEC FlyOrLandMovementGenerator : public PointMovementGenerator<Creature>
{
public:
FlyOrLandMovementGenerator(uint32 _id, float _x, float _y, float _z, bool liftOff) :
PointMovementGenerator<Creature>(_id, _x, _y, _z, false),
m_liftOff(liftOff) {}
void Initialize(Unit& unit) override;
private:
bool m_liftOff;
};
#endif #endif

View file

@ -614,7 +614,7 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID, "Instance.IgnoreRaid", false); setConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID, "Instance.IgnoreRaid", false);
setConfig(CONFIG_BOOL_CAST_UNSTUCK, "CastUnstuck", true); 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_BIRTHDAY_TIME, "BirthdayTime", 1125180000);
setConfig(CONFIG_UINT32_RABBIT_DAY, "RabbitDay", 0); setConfig(CONFIG_UINT32_RABBIT_DAY, "RabbitDay", 0);

View file

@ -573,7 +573,7 @@ LogColors = ""
# Max amount triggered spell casts in chain by one caster, prevent stack overflow crash # Max amount triggered spell casts in chain by one caster, prevent stack overflow crash
# Too Low value will make some correct triggered casts fail # Too Low value will make some correct triggered casts fail
# 0 (no limit) # 0 (no limit)
# Default: 10 # Default: 20
# #
# BirthdayTime # BirthdayTime
# Set to birthday (date in unix time), By default 28th August 2005, when MaNGOS got its name # Set to birthday (date in unix time), By default 28th August 2005, when MaNGOS got its name
@ -793,7 +793,7 @@ DisableWaterBreath = 4
AllFlightPaths = 0 AllFlightPaths = 0
ActivateWeather = 1 ActivateWeather = 1
CastUnstuck = 1 CastUnstuck = 1
MaxSpellCastsInChain = 10 MaxSpellCastsInChain = 20
BirthdayTime = 1125180000 BirthdayTime = 1125180000
RabbitDay = 0 RabbitDay = 0
Instance.IgnoreLevel = 0 Instance.IgnoreLevel = 0

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12616" #define REVISION_NR "12617"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__