Get rid of monster movement flags, since it's really spline flags.

Thanks to Ralek for research.
This commit is contained in:
tomrus88 2010-02-07 14:53:09 +03:00
parent 4a3081e7d5
commit db547a008a
20 changed files with 206 additions and 182 deletions

View file

@ -71,7 +71,7 @@ template<>
void void
ConfusedMovementGenerator<Creature>::_InitSpecific(Creature &creature, bool &is_water_ok, bool &is_land_ok) ConfusedMovementGenerator<Creature>::_InitSpecific(Creature &creature, bool &is_water_ok, bool &is_land_ok)
{ {
creature.RemoveMonsterMoveFlag(MONSTER_MOVE_WALK); creature.RemoveSplineFlag(SPLINEFLAG_WALKMODE);
is_water_ok = creature.canSwim(); is_water_ok = creature.canSwim();
is_land_ok = creature.canWalk(); is_land_ok = creature.canWalk();
@ -158,7 +158,7 @@ template<>
void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit) void ConfusedMovementGenerator<Creature>::Finalize(Creature &unit)
{ {
unit.clearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); unit.clearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE);
unit.AddMonsterMoveFlag(MONSTER_MOVE_WALK); unit.AddSplineFlag(SPLINEFLAG_WALKMODE);
} }
template void ConfusedMovementGenerator<Player>::Initialize(Player &player); template void ConfusedMovementGenerator<Player>::Initialize(Player &player);

View file

@ -119,7 +119,7 @@ m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_resp
m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0),
m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false),
m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
m_creatureInfo(NULL), m_isActiveObject(false), m_monsterMoveFlags(MONSTER_MOVE_WALK) m_creatureInfo(NULL), m_isActiveObject(false), m_splineFlags(SPLINEFLAG_WALKMODE)
{ {
m_regenTimer = 200; m_regenTimer = 200;
m_valuesCount = UNIT_END; m_valuesCount = UNIT_END;
@ -131,7 +131,7 @@ m_creatureInfo(NULL), m_isActiveObject(false), m_monsterMoveFlags(MONSTER_MOVE_W
m_CreatureCategoryCooldowns.clear(); m_CreatureCategoryCooldowns.clear();
m_GlobalCooldown = 0; m_GlobalCooldown = 0;
m_monsterMoveFlags = MONSTER_MOVE_WALK; m_splineFlags = SPLINEFLAG_WALKMODE;
} }
Creature::~Creature() Creature::~Creature()
@ -749,7 +749,7 @@ bool Creature::isCanTrainingAndResetTalentsOf(Player* pPlayer) const
&& pPlayer->getClass() == GetCreatureInfo()->trainer_class; && pPlayer->getClass() == GetCreatureInfo()->trainer_class;
} }
void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, MonsterMovementFlags flags, uint8 type) void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, SplineFlags flags, uint8 type)
{ {
/* uint32 timeElap = getMSTime(); /* uint32 timeElap = getMSTime();
if ((timeElap - m_startMove) < m_moveTime) if ((timeElap - m_startMove) < m_moveTime)
@ -1257,7 +1257,7 @@ void Creature::setDeathState(DeathState s)
CreatureInfo const *cinfo = GetCreatureInfo(); CreatureInfo const *cinfo = GetCreatureInfo();
SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
AddMonsterMoveFlag(MONSTER_MOVE_WALK); AddSplineFlag(SPLINEFLAG_WALKMODE);
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
Unit::setDeathState(ALIVE); Unit::setDeathState(ALIVE);
clearUnitState(UNIT_STAT_ALL_STATE); clearUnitState(UNIT_STAT_ALL_STATE);
@ -1692,7 +1692,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote); SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote);
if (cainfo->move_flags != 0) if (cainfo->move_flags != 0)
SetMonsterMoveFlags(MonsterMovementFlags(cainfo->move_flags)); SetSplineFlags(SplineFlags(cainfo->move_flags));
if(cainfo->auras) if(cainfo->auras)
{ {
@ -2058,7 +2058,7 @@ void Creature::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transi
} }
} }
//float orientation = (float)atan2((double)dy, (double)dx); //float orientation = (float)atan2((double)dy, (double)dx);
SendMonsterMove(x, y, z, 0, GetMonsterMoveFlags(), transitTime, player); SendMonsterMove(x, y, z, 0, GetSplineFlags(), transitTime, player);
} }
void Creature::SendAreaSpiritHealerQueryOpcode(Player *pl) void Creature::SendAreaSpiritHealerQueryOpcode(Player *pl)

View file

@ -438,29 +438,29 @@ class MANGOS_DLL_SPEC Creature : public Unit
bool AIM_Initialize(); bool AIM_Initialize();
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, MonsterMovementFlags MovementFlags, uint8 type); void AI_SendMoveToPacket(float x, float y, float z, uint32 time, SplineFlags MovementFlags, uint8 type);
CreatureAI* AI() { return i_AI; } CreatureAI* AI() { return i_AI; }
void AddMonsterMoveFlag(MonsterMovementFlags f) void AddSplineFlag(SplineFlags f)
{ {
bool need_walk_sync = (f & MONSTER_MOVE_WALK) != (m_monsterMoveFlags & MONSTER_MOVE_WALK); bool need_walk_sync = (f & SPLINEFLAG_WALKMODE) != (m_splineFlags & SPLINEFLAG_WALKMODE);
m_monsterMoveFlags = MonsterMovementFlags(m_monsterMoveFlags | f); m_splineFlags = SplineFlags(m_splineFlags | f);
if (need_walk_sync) if (need_walk_sync)
UpdateWalkMode(this, false); UpdateWalkMode(this, false);
} }
void RemoveMonsterMoveFlag(MonsterMovementFlags f) void RemoveSplineFlag(SplineFlags f)
{ {
bool need_walk_sync = (f & MONSTER_MOVE_WALK) != (m_monsterMoveFlags & MONSTER_MOVE_WALK); bool need_walk_sync = (f & SPLINEFLAG_WALKMODE) != (m_splineFlags & SPLINEFLAG_WALKMODE);
m_monsterMoveFlags = MonsterMovementFlags(m_monsterMoveFlags & ~f); m_splineFlags = SplineFlags(m_splineFlags & ~f);
if (need_walk_sync) if (need_walk_sync)
UpdateWalkMode(this, false); UpdateWalkMode(this, false);
} }
bool HasMonsterMoveFlag(MonsterMovementFlags f) const { return m_monsterMoveFlags & f; } bool HasSplineFlag(SplineFlags f) const { return m_splineFlags & f; }
MonsterMovementFlags GetMonsterMoveFlags() const { return m_monsterMoveFlags; } SplineFlags GetSplineFlags() const { return m_splineFlags; }
void SetMonsterMoveFlags(MonsterMovementFlags f) void SetSplineFlags(SplineFlags f)
{ {
bool need_walk_sync = (f & MONSTER_MOVE_WALK) != (m_monsterMoveFlags & MONSTER_MOVE_WALK); bool need_walk_sync = (f & SPLINEFLAG_WALKMODE) != (m_splineFlags & SPLINEFLAG_WALKMODE);
m_monsterMoveFlags = f; // need set before m_splineFlags = f; // need set before
if (need_walk_sync) if (need_walk_sync)
UpdateWalkMode(this, false); UpdateWalkMode(this, false);
} }
@ -670,7 +670,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
GridReference<Creature> m_gridRef; GridReference<Creature> m_gridRef;
CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from ObjMgr::GetCreatureTemplate(GetEntry()) CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from ObjMgr::GetCreatureTemplate(GetEntry())
bool m_isActiveObject; bool m_isActiveObject;
MonsterMovementFlags m_monsterMoveFlags; SplineFlags m_splineFlags;
}; };
class AssistDelayEvent : public BasicEvent class AssistDelayEvent : public BasicEvent

View file

@ -310,7 +310,7 @@ template<>
void void
FleeingMovementGenerator<Creature>::_Init(Creature &owner) FleeingMovementGenerator<Creature>::_Init(Creature &owner)
{ {
owner.RemoveMonsterMoveFlag(MONSTER_MOVE_WALK); owner.RemoveSplineFlag(SPLINEFLAG_WALKMODE);
owner.SetTargetGUID(0); owner.SetTargetGUID(0);
is_water_ok = owner.canSwim(); is_water_ok = owner.canSwim();
is_land_ok = owner.canWalk(); is_land_ok = owner.canWalk();
@ -333,7 +333,7 @@ void FleeingMovementGenerator<Player>::Finalize(Player &owner)
template<> template<>
void FleeingMovementGenerator<Creature>::Finalize(Creature &owner) void FleeingMovementGenerator<Creature>::Finalize(Creature &owner)
{ {
owner.AddMonsterMoveFlag(MONSTER_MOVE_WALK); owner.AddSplineFlag(SPLINEFLAG_WALKMODE);
owner.clearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); owner.clearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE);
} }

View file

@ -27,7 +27,7 @@
void void
HomeMovementGenerator<Creature>::Initialize(Creature & owner) HomeMovementGenerator<Creature>::Initialize(Creature & owner)
{ {
owner.RemoveMonsterMoveFlag(MONSTER_MOVE_WALK); owner.RemoveSplineFlag(SPLINEFLAG_WALKMODE);
_setTargetLocation(owner); _setTargetLocation(owner);
} }
@ -63,7 +63,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
if (time_diff > i_travel_timer) if (time_diff > i_travel_timer)
{ {
owner.AddMonsterMoveFlag(MONSTER_MOVE_WALK); owner.AddSplineFlag(SPLINEFLAG_WALKMODE);
// restore orientation of not moving creature at returning to home // restore orientation of not moving creature at returning to home
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE) if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)

View file

@ -5897,7 +5897,7 @@ bool ChatHandler::HandleComeToMeCommand(const char *args)
uint32 newFlags = atoi(newFlagStr); uint32 newFlags = atoi(newFlagStr);
caster->SetMonsterMoveFlags(MonsterMovementFlags(newFlags)); caster->SetSplineFlags(SplineFlags(newFlags));
Player* pl = m_session->GetPlayer(); Player* pl = m_session->GetPlayer();

View file

@ -267,7 +267,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
if( GetPlayer()->isInCombat() || //...is in combat if( GetPlayer()->isInCombat() || //...is in combat
GetPlayer()->duel || //...is in Duel GetPlayer()->duel || //...is in Duel
//...is jumping ...is falling //...is jumping ...is falling
GetPlayer()->m_movementInfo.HasMovementFlag(MovementFlags(MOVEFLAG_JUMPING | MOVEFLAG_FALLING))) GetPlayer()->m_movementInfo.HasMovementFlag(MovementFlags(MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR)))
{ {
WorldPacket data( SMSG_LOGOUT_RESPONSE, (2+4) ) ; WorldPacket data( SMSG_LOGOUT_RESPONSE, (2+4) ) ;
data << (uint8)0xC; data << (uint8)0xC;

View file

@ -276,7 +276,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
if (!((Creature*)unit)->hasUnitState(UNIT_STAT_MOVING)) if (!((Creature*)unit)->hasUnitState(UNIT_STAT_MOVING))
{ {
// (ok) possibly some "hover" mode // (ok) possibly some "hover" mode
unit->m_movementInfo.AddMovementFlag(MOVEFLAG_FLY_UNK1); unit->m_movementInfo.AddMovementFlag(MOVEFLAG_ROOT);
} }
else else
{ {
@ -299,13 +299,13 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
player->m_movementInfo.RemoveMovementFlag(MOVEFLAG_ONTRANSPORT); player->m_movementInfo.RemoveMovementFlag(MOVEFLAG_ONTRANSPORT);
// remove unknown, unused etc flags for now // remove unknown, unused etc flags for now
player->m_movementInfo.RemoveMovementFlag(MOVEFLAG_SPLINE2); player->m_movementInfo.RemoveMovementFlag(MOVEFLAG_SPLINE_ENABLED);
if(player->isInFlight()) if(player->isInFlight())
{ {
ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE); ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
player->m_movementInfo.AddMovementFlag(MOVEFLAG_FORWARD); player->m_movementInfo.AddMovementFlag(MOVEFLAG_FORWARD);
player->m_movementInfo.AddMovementFlag(MOVEFLAG_SPLINE2); player->m_movementInfo.AddMovementFlag(MOVEFLAG_SPLINE_ENABLED);
} }
} }
break; break;
@ -328,11 +328,11 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
*data << float(unit->GetSpeed(MOVE_PITCH_RATE)); *data << float(unit->GetSpeed(MOVE_PITCH_RATE));
// 0x08000000 // 0x08000000
if(unit->m_movementInfo.GetMovementFlags() & MOVEFLAG_SPLINE2) if(unit->m_movementInfo.GetMovementFlags() & MOVEFLAG_SPLINE_ENABLED)
{ {
if(GetTypeId() != TYPEID_PLAYER) if(GetTypeId() != TYPEID_PLAYER)
{ {
sLog.outDebug("_BuildMovementUpdate: MOVEFLAG_SPLINE2 for non-player"); sLog.outDebug("_BuildMovementUpdate: MOVEFLAG_SPLINE_ENABLED for non-player");
return; return;
} }
@ -340,7 +340,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
if(!player->isInFlight()) if(!player->isInFlight())
{ {
sLog.outDebug("_BuildMovementUpdate: MOVEFLAG_SPLINE2 but not in flight"); sLog.outDebug("_BuildMovementUpdate: MOVEFLAG_SPLINE_ENABLED but not in flight");
return; return;
} }
@ -348,23 +348,23 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(player->GetMotionMaster()->top()); FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(player->GetMotionMaster()->top());
uint32 flags3 = MONSTER_MOVE_SPLINE_FLY; uint32 flags3 = SPLINEFLAG_WALKMODE | SPLINEFLAG_FLYING;
*data << uint32(flags3); // splines flag? *data << uint32(flags3); // splines flag?
if(flags3 & SPLINE_MOVE_FLAG_FACING) // may be orientation if(flags3 & SPLINEFLAG_FINALFACING) // may be orientation
{ {
*data << float(0); *data << float(0);
} }
else else
{ {
if(flags3 & SPLINE_MOVE_FLAG_GUID) // probably guid there if(flags3 & SPLINEFLAG_FINALTARGET) // probably guid there
{ {
*data << uint64(0); *data << uint64(0);
} }
else else
{ {
if(flags3 & SPLINE_MOVE_FLAG_POINT) // probably x,y,z coords there if(flags3 & SPLINEFLAG_FINALPOINT) // probably x,y,z coords there
{ {
*data << float(0); *data << float(0);
*data << float(0); *data << float(0);

View file

@ -844,10 +844,10 @@ void ObjectMgr::LoadCreatureAddons(SQLStorage& creatureaddons, char const* entry
if (!sEmotesStore.LookupEntry(addon->emote)) if (!sEmotesStore.LookupEntry(addon->emote))
sLog.outErrorDb("Creature (%s %u) have invalid emote (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->emote, creatureaddons.GetTableName()); sLog.outErrorDb("Creature (%s %u) have invalid emote (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->emote, creatureaddons.GetTableName());
if (addon->move_flags & (MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4)) if (addon->move_flags & (SPLINEFLAG_TRAJECTORY|SPLINEFLAG_UNKNOWN3))
{ {
sLog.outErrorDb("Creature (%s %u) movement flags mask defined in `%s` include forbidden flags (" I32FMT ") that can crash client, cleanup at load.", entryName, addon->guidOrEntry, creatureaddons.GetTableName(), (MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4)); sLog.outErrorDb("Creature (%s %u) movement flags mask defined in `%s` include forbidden flags (" I32FMT ") that can crash client, cleanup at load.", entryName, addon->guidOrEntry, creatureaddons.GetTableName(), (SPLINEFLAG_TRAJECTORY|SPLINEFLAG_UNKNOWN3));
const_cast<CreatureDataAddon*>(addon)->move_flags &= ~(MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4); const_cast<CreatureDataAddon*>(addon)->move_flags &= ~(SPLINEFLAG_TRAJECTORY|SPLINEFLAG_UNKNOWN3);
} }
ConvertCreatureAddonAuras(const_cast<CreatureDataAddon*>(addon), creatureaddons.GetTableName(), entryName); ConvertCreatureAddonAuras(const_cast<CreatureDataAddon*>(addon), creatureaddons.GetTableName(), entryName);

View file

@ -20219,8 +20219,8 @@ void Player::ExitVehicle(Vehicle *vehicle)
WorldPacket data(MSG_MOVE_TELEPORT_ACK, 30); WorldPacket data(MSG_MOVE_TELEPORT_ACK, 30);
data.append(GetPackGUID()); data.append(GetPackGUID());
data << uint32(0); // counter? data << uint32(0); // counter?
data << uint32(MOVEFLAG_FLY_UNK1); // fly unk data << uint32(MOVEFLAG_ROOT); // fly unk
data << uint16(0x40); // special flags data << uint16(MOVEFLAG2_UNK4); // special flags
data << uint32(getMSTime()); // time data << uint32(getMSTime()); // time
data << vehicle->GetPositionX(); // x data << vehicle->GetPositionX(); // x
data << vehicle->GetPositionY(); // y data << vehicle->GetPositionY(); // y

View file

@ -34,7 +34,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
i_destinationHolder.SetDestination(traveller, i_x, i_y, i_z); i_destinationHolder.SetDestination(traveller, i_x, i_y, i_z);
if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly()) if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly())
((Creature&)unit).AddMonsterMoveFlag(MONSTER_MOVE_FLY); ((Creature&)unit).AddSplineFlag(SPLINEFLAG_UNKNOWN7);
} }
template<class T> template<class T>

View file

@ -98,13 +98,13 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
if (is_air_ok) if (is_air_ok)
{ {
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY); creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
} }
//else if (is_water_ok) // Swimming mode to be done with more than this check //else if (is_water_ok) // Swimming mode to be done with more than this check
else else
{ {
i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(), 10000+i_destinationHolder.GetTotalTravelTime())); i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(), 10000+i_destinationHolder.GetTotalTravelTime()));
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK); creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
} }
} }
@ -115,9 +115,9 @@ void RandomMovementGenerator<Creature>::Initialize(Creature &creature)
return; return;
if (creature.canFly()) if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY); creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
else else
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK); creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
creature.addUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); creature.addUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE);
_setRandomLocation(creature); _setRandomLocation(creature);
@ -168,15 +168,15 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
if (i_nextMoveTime.Passed()) if (i_nextMoveTime.Passed())
{ {
if (creature.canFly()) if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY); creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
else else
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK); creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
_setRandomLocation(creature); _setRandomLocation(creature);
} }
else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f)) else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f))
{ {
creature.AddMonsterMoveFlag(MONSTER_MOVE_WALK); creature.AddSplineFlag(SPLINEFLAG_WALKMODE);
_setRandomLocation(creature); _setRandomLocation(creature);
} }
} }

View file

@ -2890,7 +2890,7 @@ void Spell::update(uint32 difftime)
// check if the player caster has moved before the spell finished // check if the player caster has moved before the spell finished
if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) &&
(m_castPositionX != m_caster->GetPositionX() || m_castPositionY != m_caster->GetPositionY() || m_castPositionZ != m_caster->GetPositionZ()) && (m_castPositionX != m_caster->GetPositionX() || m_castPositionY != m_caster->GetPositionY() || m_castPositionZ != m_caster->GetPositionZ()) &&
(m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK || !((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLING))) (m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK || !((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR)))
{ {
// always cancel for channeled spells // always cancel for channeled spells
if( m_spellState == SPELL_STATE_CASTING ) if( m_spellState == SPELL_STATE_CASTING )
@ -2922,7 +2922,7 @@ void Spell::update(uint32 difftime)
if( m_caster->GetTypeId() == TYPEID_PLAYER ) if( m_caster->GetTypeId() == TYPEID_PLAYER )
{ {
// check if player has jumped before the channeling finished // check if player has jumped before the channeling finished
if(((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_JUMPING)) if(((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLING))
cancel(); cancel();
// check for incapacitating player states // check for incapacitating player states
@ -4026,7 +4026,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if( m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->isMoving() ) if( m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->isMoving() )
{ {
// skip stuck spell to allow use it in falling case and apply spell limitations at movement // skip stuck spell to allow use it in falling case and apply spell limitations at movement
if( (!((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLING) || m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK) && if( (!((Player*)m_caster)->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLINGFAR) || m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK) &&
(IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0) ) (IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0) )
return SPELL_FAILED_MOVING; return SPELL_FAILED_MOVING;
} }

View file

@ -3618,7 +3618,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
{ {
pet->AttackStop(); pet->AttackStop();
pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
pet->AddMonsterMoveFlag(MONSTER_MOVE_WALK); pet->AddSplineFlag(SPLINEFLAG_WALKMODE);
} }
} }

View file

@ -6336,7 +6336,7 @@ void Spell::EffectCharge(uint32 /*i*/)
((Creature *)unitTarget)->StopMoving(); ((Creature *)unitTarget)->StopMoving();
// Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags // Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
m_caster->SendMonsterMove(x, y, z, 0, m_caster->GetTypeId()==TYPEID_PLAYER ? MONSTER_MOVE_WALK : ((Creature*)m_caster)->GetMonsterMoveFlags(), 1); m_caster->SendMonsterMove(x, y, z, 0, m_caster->GetTypeId() == TYPEID_PLAYER ? SPLINEFLAG_WALKMODE : ((Creature*)m_caster)->GetSplineFlags(), 1);
if (m_caster->GetTypeId() != TYPEID_PLAYER) if (m_caster->GetTypeId() != TYPEID_PLAYER)
m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, x, y, z, m_caster->GetOrientation()); m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, x, y, z, m_caster->GetOrientation());
@ -6364,7 +6364,7 @@ void Spell::EffectCharge2(uint32 /*i*/)
return; return;
// Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags // Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags
m_caster->SendMonsterMove(x, y, z, 0, m_caster->GetTypeId()==TYPEID_PLAYER ? MONSTER_MOVE_WALK : ((Creature*)m_caster)->GetMonsterMoveFlags(), 1); m_caster->SendMonsterMove(x, y, z, 0, m_caster->GetTypeId() == TYPEID_PLAYER ? SPLINEFLAG_WALKMODE : ((Creature*)m_caster)->GetSplineFlags(), 1);
if (m_caster->GetTypeId() != TYPEID_PLAYER) if (m_caster->GetTypeId() != TYPEID_PLAYER)
m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, x, y, z, m_caster->GetOrientation()); m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, x, y, z, m_caster->GetOrientation());

View file

@ -74,7 +74,7 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
D::_addUnitStateMove(owner); D::_addUnitStateMove(owner);
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
((Creature&)owner).AddMonsterMoveFlag(MONSTER_MOVE_FLY); ((Creature&)owner).AddSplineFlag(SPLINEFLAG_UNKNOWN7);
} }
template<> template<>
@ -141,7 +141,7 @@ bool TargetedMovementGeneratorMedium<T,D>::Update(T &owner, const uint32 & time_
{ {
D::_addUnitStateMove(owner); D::_addUnitStateMove(owner);
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
((Creature&)owner).AddMonsterMoveFlag(MONSTER_MOVE_FLY); ((Creature&)owner).AddSplineFlag(SPLINEFLAG_UNKNOWN7);
i_destinationHolder.StartTravel(traveller); i_destinationHolder.StartTravel(traveller);
return true; return true;
@ -199,10 +199,10 @@ template<>
void ChaseMovementGenerator<Creature>::Initialize(Creature &owner) void ChaseMovementGenerator<Creature>::Initialize(Creature &owner)
{ {
owner.addUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); owner.addUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE);
owner.RemoveMonsterMoveFlag(MONSTER_MOVE_WALK); owner.RemoveSplineFlag(SPLINEFLAG_WALKMODE);
if (((Creature*)&owner)->canFly()) if (((Creature*)&owner)->canFly())
owner.AddMonsterMoveFlag(MONSTER_MOVE_FLY); owner.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
_setTargetLocation(owner); _setTargetLocation(owner);
} }
@ -273,7 +273,7 @@ void FollowMovementGenerator<Creature>::Initialize(Creature &owner)
_updateSpeed(owner); _updateSpeed(owner);
if (((Creature*)&owner)->canFly()) if (((Creature*)&owner)->canFly())
owner.AddMonsterMoveFlag(MONSTER_MOVE_FLY); owner.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
_setTargetLocation(owner); _setTargetLocation(owner);
} }

View file

@ -71,9 +71,9 @@ inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z)
template<> template<>
inline float Traveller<Creature>::Speed() inline float Traveller<Creature>::Speed()
{ {
if(i_traveller.HasMonsterMoveFlag(MONSTER_MOVE_WALK)) if(i_traveller.HasSplineFlag(SPLINEFLAG_WALKMODE))
return i_traveller.GetSpeed(MOVE_WALK); return i_traveller.GetSpeed(MOVE_WALK);
else if(i_traveller.HasMonsterMoveFlag(MONSTER_MOVE_FLY)) else if(i_traveller.HasSplineFlag(SPLINEFLAG_UNKNOWN7))
return i_traveller.GetSpeed(MOVE_FLIGHT); return i_traveller.GetSpeed(MOVE_FLIGHT);
else else
return i_traveller.GetSpeed(MOVE_RUN); return i_traveller.GetSpeed(MOVE_RUN);
@ -102,7 +102,7 @@ inline float Traveller<Creature>::GetMoveDestinationTo(float x, float y, float z
template<> template<>
inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t) inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
{ {
i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetMonsterMoveFlags(), 0); i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetSplineFlags(), 0);
} }
// specialization for players // specialization for players
@ -137,8 +137,8 @@ inline void Traveller<Player>::Relocation(float x, float y, float z, float orien
template<> template<>
inline void Traveller<Player>::MoveTo(float x, float y, float z, uint32 t) inline void Traveller<Player>::MoveTo(float x, float y, float z, uint32 t)
{ {
//Only send MOVEFLAG_WALK_MODE, client has strange issues with other move flags //Only send SPLINEFLAG_WALKMODE, client has strange issues with other move flags
i_traveller.SendMonsterMove(x, y, z, 0, MONSTER_MOVE_WALK, t); i_traveller.SendMonsterMove(x, y, z, 0, SPLINEFLAG_WALKMODE, t);
} }
typedef Traveller<Creature> CreatureTraveller; typedef Traveller<Creature> CreatureTraveller;

View file

@ -124,7 +124,7 @@ void MovementInfo::Read(ByteBuffer &data)
data >> fallTime; data >> fallTime;
if(HasMovementFlag(MOVEFLAG_JUMPING)) if(HasMovementFlag(MOVEFLAG_FALLING))
{ {
data >> j_velocity; data >> j_velocity;
data >> j_sinAngle; data >> j_sinAngle;
@ -132,7 +132,7 @@ void MovementInfo::Read(ByteBuffer &data)
data >> j_xyspeed; data >> j_xyspeed;
} }
if(HasMovementFlag(MOVEFLAG_SPLINE)) if(HasMovementFlag(MOVEFLAG_SPLINE_ELEVATION))
{ {
data >> u_unk1; data >> u_unk1;
} }
@ -170,7 +170,7 @@ void MovementInfo::Write(ByteBuffer &data)
data << fallTime; data << fallTime;
if(HasMovementFlag(MOVEFLAG_JUMPING)) if(HasMovementFlag(MOVEFLAG_FALLING))
{ {
data << j_velocity; data << j_velocity;
data << j_sinAngle; data << j_sinAngle;
@ -178,7 +178,7 @@ void MovementInfo::Write(ByteBuffer &data)
data << j_xyspeed; data << j_xyspeed;
} }
if(HasMovementFlag(MOVEFLAG_SPLINE)) if(HasMovementFlag(MOVEFLAG_SPLINE_ELEVATION))
{ {
data << u_unk1; data << u_unk1;
} }
@ -362,7 +362,7 @@ bool Unit::haveOffhandWeapon() const
return false; return false;
} }
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, MonsterMovementFlags flags, uint32 Time, Player* player) void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, SplineFlags flags, uint32 Time, Player* player)
{ {
float moveTime = Time; float moveTime = Time;
@ -375,27 +375,27 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty
data << uint8(type); // unknown data << uint8(type); // unknown
switch(type) switch(type)
{ {
case 0: // normal packet case SPLINETYPE_NORMAL: // normal packet
break; break;
case 1: // stop packet (raw pos?) case SPLINETYPE_STOP: // stop packet (raw pos?)
SendMessageToSet( &data, true ); SendMessageToSet( &data, true );
return; return;
case 2: // facing spot, not used currently case SPLINETYPE_FACINGSPOT: // facing spot, not used currently
data << float(0); data << float(0);
data << float(0); data << float(0);
data << float(0); data << float(0);
break; break;
case 3: // not used currently case SPLINETYPE_FACINGTARGET: // not used currently
data << uint64(0); // probably target guid (facing target?) data << uint64(0); // probably target guid (facing target?)
break; break;
case 4: // not used currently case SPLINETYPE_FACINGANGLE: // not used currently
data << float(0); // facing angle data << float(0); // facing angle
break; break;
} }
data << uint32(flags); data << uint32(flags);
if(flags & MONSTER_MOVE_WALK) if(flags & SPLINEFLAG_WALKMODE)
moveTime *= 1.05f; moveTime *= 1.05f;
data << uint32(moveTime); // Time in between points data << uint32(moveTime); // Time in between points
@ -408,7 +408,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty
SendMessageToSet( &data, true ); SendMessageToSet( &data, true );
} }
void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, MonsterMovementFlags flags) void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, SplineFlags flags)
{ {
uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32); uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32);
@ -10578,17 +10578,17 @@ void Unit::UpdateWalkMode(Unit* source, bool self)
{ {
bool on = source->GetTypeId() == TYPEID_PLAYER bool on = source->GetTypeId() == TYPEID_PLAYER
? ((Player*)source)->HasMovementFlag(MOVEFLAG_WALK_MODE) ? ((Player*)source)->HasMovementFlag(MOVEFLAG_WALK_MODE)
: ((Creature*)source)->HasMonsterMoveFlag(MONSTER_MOVE_WALK); : ((Creature*)source)->HasSplineFlag(SPLINEFLAG_WALKMODE);
if (on) if (on)
{ {
if (((Creature*)this)->isPet() && hasUnitState(UNIT_STAT_FOLLOW)) if (((Creature*)this)->isPet() && hasUnitState(UNIT_STAT_FOLLOW))
((Creature*)this)->AddMonsterMoveFlag(MONSTER_MOVE_WALK); ((Creature*)this)->AddSplineFlag(SPLINEFLAG_WALKMODE);
} }
else else
{ {
if (((Creature*)this)->isPet()) if (((Creature*)this)->isPet())
((Creature*)this)->RemoveMonsterMoveFlag(MONSTER_MOVE_WALK); ((Creature*)this)->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
} }
} }
else else
@ -12449,8 +12449,8 @@ void Unit::StopMoving()
clearUnitState(UNIT_STAT_MOVING); clearUnitState(UNIT_STAT_MOVING);
// send explicit stop packet // send explicit stop packet
// player expected for correct work MONSTER_MOVE_WALK // player expected for correct work SPLINEFLAG_WALKMODE
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), 0, GetTypeId()==TYPEID_PLAYER ? MONSTER_MOVE_WALK : MONSTER_MOVE_NONE, 0); SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), 0, GetTypeId() == TYPEID_PLAYER ? SPLINEFLAG_WALKMODE : SPLINEFLAG_NONE, 0);
// update position and orientation for near players // update position and orientation for near players
WorldPacket data; WorldPacket data;

View file

@ -610,44 +610,7 @@ enum NPCFlags
UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100% UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100%
UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode
UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click), dynamic, set at loading and don't must be set in DB UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click), dynamic, set at loading and don't must be set in DB
UNIT_NPC_FLAG_GUARD = 0x10000000, // custom flag for guards UNIT_NPC_FLAG_GUARD = 0x10000000 // custom flag for guards
};
// used in SMSG_MONSTER_MOVE
enum MonsterMovementFlags
{
MONSTER_MOVE_NONE = 0x00000000,
MONSTER_MOVE_FORWARD = 0x00000001,
MONSTER_MOVE_BACKWARD = 0x00000002,
MONSTER_MOVE_STRAFE_LEFT = 0x00000004,
MONSTER_MOVE_STRAFE_RIGHT = 0x00000008,
MONSTER_MOVE_LEFT = 0x00000010, // turn
MONSTER_MOVE_RIGHT = 0x00000020, // turn
MONSTER_MOVE_PITCH_UP = 0x00000040,
MONSTER_MOVE_PITCH_DOWN = 0x00000080,
MONSTER_MOVE_TELEPORT = 0x00000100,
MONSTER_MOVE_TELEPORT2 = 0x00000200,
MONSTER_MOVE_LEVITATING = 0x00000400,
MONSTER_MOVE_UNK1 = 0x00000800, // float+uint32
MONSTER_MOVE_WALK = 0x00001000, // run2?
MONSTER_MOVE_SPLINE = 0x00002000, // spline n*(float x,y,z)
// 0x4000, 0x8000, 0x10000, 0x20000 run
MONSTER_MOVE_SPLINE2 = 0x00040000, // spline n*(float x,y,z)
MONSTER_MOVE_UNK2 = 0x00080000, // used for flying mobs
MONSTER_MOVE_UNK3 = 0x00100000, // used for flying mobs
MONSTER_MOVE_UNK4 = 0x00200000, // uint8+uint32
MONSTER_MOVE_UNK5 = 0x00400000, // run in place, then teleport to final point
MONSTER_MOVE_UNK6 = 0x00800000, // teleport
MONSTER_MOVE_UNK7 = 0x01000000, // run
MONSTER_MOVE_FLY = 0x02000000, // swimming/flying (depends on mob?)
MONSTER_MOVE_UNK9 = 0x04000000, // run
MONSTER_MOVE_UNK10 = 0x08000000, // run
MONSTER_MOVE_UNK11 = 0x10000000, // run
MONSTER_MOVE_UNK12 = 0x20000000, // run
MONSTER_MOVE_UNK13 = 0x40000000, // levitating
// masks
MONSTER_MOVE_SPLINE_FLY = 0x00003000, // fly by points
}; };
// used in most movement packets (send and received) // used in most movement packets (send and received)
@ -658,58 +621,119 @@ enum MovementFlags
MOVEFLAG_BACKWARD = 0x00000002, MOVEFLAG_BACKWARD = 0x00000002,
MOVEFLAG_STRAFE_LEFT = 0x00000004, MOVEFLAG_STRAFE_LEFT = 0x00000004,
MOVEFLAG_STRAFE_RIGHT = 0x00000008, MOVEFLAG_STRAFE_RIGHT = 0x00000008,
MOVEFLAG_LEFT = 0x00000010, MOVEFLAG_TURN_LEFT = 0x00000010,
MOVEFLAG_RIGHT = 0x00000020, MOVEFLAG_TURN_RIGHT = 0x00000020,
MOVEFLAG_PITCH_UP = 0x00000040, MOVEFLAG_PITCH_UP = 0x00000040,
MOVEFLAG_PITCH_DOWN = 0x00000080, MOVEFLAG_PITCH_DOWN = 0x00000080,
MOVEFLAG_WALK_MODE = 0x00000100, // Walking MOVEFLAG_WALK_MODE = 0x00000100, // Walking
MOVEFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures MOVEFLAG_ONTRANSPORT = 0x00000200,
MOVEFLAG_LEVITATING = 0x00000400, MOVEFLAG_LEVITATING = 0x00000400,
MOVEFLAG_FLY_UNK1 = 0x00000800, MOVEFLAG_ROOT = 0x00000800,
MOVEFLAG_JUMPING = 0x00001000, MOVEFLAG_FALLING = 0x00001000,
MOVEFLAG_FALLING = 0x00002000, MOVEFLAG_FALLINGFAR = 0x00002000,
MOVEFLAG_UNK4 = 0x00004000, MOVEFLAG_PENDINGSTOP = 0x00004000,
// 0x8000, 0x10000, 0x20000, 0x40000, 0x80000, 0x100000 MOVEFLAG_PENDINGSTRAFESTOP = 0x00008000,
MOVEFLAG_PENDINGFORWARD = 0x00010000,
MOVEFLAG_PENDINGBACKWARD = 0x00020000,
MOVEFLAG_PENDINGSTRAFELEFT = 0x00040000,
MOVEFLAG_PENDINGSTRAFERIGHT = 0x00080000,
MOVEFLAG_PENDINGROOT = 0x00100000,
MOVEFLAG_SWIMMING = 0x00200000, // appears with fly flag also MOVEFLAG_SWIMMING = 0x00200000, // appears with fly flag also
MOVEFLAG_FLY_UP = 0x00400000, // swim up also MOVEFLAG_ASCENDING = 0x00400000, // swim up also
MOVEFLAG_FLY_DOWN = 0x00800000, // swim down also MOVEFLAG_DESCENDING = 0x00800000, // swim down also
MOVEFLAG_CAN_FLY = 0x01000000, // can fly in 3.3? MOVEFLAG_CAN_FLY = 0x01000000, // can fly in 3.3?
MOVEFLAG_FLYING = 0x02000000, // Actual flying mode MOVEFLAG_FLYING = 0x02000000, // Actual flying mode
MOVEFLAG_SPLINE = 0x04000000, // used for flight paths MOVEFLAG_SPLINE_ELEVATION = 0x04000000, // used for flight paths
MOVEFLAG_SPLINE2 = 0x08000000, // used for flight paths MOVEFLAG_SPLINE_ENABLED = 0x08000000, // used for flight paths
MOVEFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water MOVEFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water
MOVEFLAG_SAFE_FALL = 0x20000000, // active rogue safe fall spell (passive) MOVEFLAG_SAFE_FALL = 0x20000000, // active rogue safe fall spell (passive)
MOVEFLAG_UNK3 = 0x40000000 MOVEFLAG_HOVER = 0x40000000
}; };
// flags that use in movement check for example at spell casting // flags that use in movement check for example at spell casting
MovementFlags const movementFlagsMask = MovementFlags( MovementFlags const movementFlagsMask = MovementFlags(
MOVEFLAG_FORWARD |MOVEFLAG_BACKWARD |MOVEFLAG_STRAFE_LEFT |MOVEFLAG_STRAFE_RIGHT| MOVEFLAG_FORWARD |MOVEFLAG_BACKWARD |MOVEFLAG_STRAFE_LEFT |MOVEFLAG_STRAFE_RIGHT|
MOVEFLAG_PITCH_UP|MOVEFLAG_PITCH_DOWN|MOVEFLAG_FLY_UNK1 | MOVEFLAG_PITCH_UP|MOVEFLAG_PITCH_DOWN|MOVEFLAG_ROOT |
MOVEFLAG_JUMPING |MOVEFLAG_FALLING |MOVEFLAG_FLY_UP | MOVEFLAG_FALLING |MOVEFLAG_FALLINGFAR|MOVEFLAG_ASCENDING |
MOVEFLAG_FLYING |MOVEFLAG_SPLINE MOVEFLAG_FLYING |MOVEFLAG_SPLINE_ELEVATION
); );
MovementFlags const movementOrTurningFlagsMask = MovementFlags( MovementFlags const movementOrTurningFlagsMask = MovementFlags(
movementFlagsMask | MOVEFLAG_LEFT | MOVEFLAG_RIGHT movementFlagsMask | MOVEFLAG_TURN_LEFT | MOVEFLAG_TURN_RIGHT
); );
enum MovementFlags2 enum MovementFlags2
{ {
MOVEFLAG2_NONE = 0x0000, MOVEFLAG2_NONE = 0x0000,
MOVEFLAG2_UNK1 = 0x0001,
MOVEFLAG2_UNK2 = 0x0002,
MOVEFLAG2_UNK3 = 0x0004,
MOVEFLAG2_FULLSPEEDTURNING = 0x0008,
MOVEFLAG2_FULLSPEEDPITCHING = 0x0010,
MOVEFLAG2_ALLOW_PITCHING = 0x0020, MOVEFLAG2_ALLOW_PITCHING = 0x0020,
MOVEFLAG2_UNK1 = 0x0400, MOVEFLAG2_UNK4 = 0x0040,
MOVEFLAG2_UNK2 = 0x0800, MOVEFLAG2_UNK5 = 0x0080,
MOVEFLAG2_UNK3 = 0x1000, MOVEFLAG2_UNK6 = 0x0100,
MOVEFLAG2_INTERP_MASK = MOVEFLAG2_UNK1 | MOVEFLAG2_UNK2 | MOVEFLAG2_UNK3, MOVEFLAG2_UNK7 = 0x0200,
MOVEFLAG2_INTERP_MOVEMENT = 0x0400,
MOVEFLAG2_INTERP_TURNING = 0x0800,
MOVEFLAG2_INTERP_PITCHING = 0x1000,
MOVEFLAG2_UNK8 = 0x2000,
MOVEFLAG2_UNK9 = 0x4000,
MOVEFLAG2_UNK10 = 0x8000,
MOVEFLAG2_INTERP_MASK = MOVEFLAG2_INTERP_MOVEMENT | MOVEFLAG2_INTERP_TURNING | MOVEFLAG2_INTERP_PITCHING
}; };
enum SplineMoveFlags // possibly exactly same as MonsterMovementFlags enum SplineFlags
{ {
SPLINE_MOVE_FLAG_NONE = 0x00000000, SPLINEFLAG_NONE = 0x00000000,
SPLINE_MOVE_FLAG_POINT = 0x00008000, SPLINEFLAG_FORWARD = 0x00000001,
SPLINE_MOVE_FLAG_GUID = 0x00010000, SPLINEFLAG_BACKWARD = 0x00000002,
SPLINE_MOVE_FLAG_FACING = 0x00020000, SPLINEFLAG_STRAFE_LEFT = 0x00000004,
SPLINEFLAG_STRAFE_RIGHT = 0x00000008,
SPLINEFLAG_LEFT = 0x00000010,
SPLINEFLAG_RIGHT = 0x00000020,
SPLINEFLAG_PITCH_UP = 0x00000040,
SPLINEFLAG_PITCH_DOWN = 0x00000080,
SPLINEFLAG_DONE = 0x00000100,
SPLINEFLAG_FALLING = 0x00000200,
SPLINEFLAG_NO_SPLINE = 0x00000400,
SPLINEFLAG_TRAJECTORY = 0x00000800,
SPLINEFLAG_WALKMODE = 0x00001000,
SPLINEFLAG_FLYING = 0x00002000,
SPLINEFLAG_KNOCKBACK = 0x00004000,
SPLINEFLAG_FINALPOINT = 0x00008000,
SPLINEFLAG_FINALTARGET = 0x00010000,
SPLINEFLAG_FINALFACING = 0x00020000,
SPLINEFLAG_CATMULLROM = 0x00040000,
SPLINEFLAG_UNKNOWN1 = 0x00080000,
SPLINEFLAG_UNKNOWN2 = 0x00100000,
SPLINEFLAG_UNKNOWN3 = 0x00200000,
SPLINEFLAG_UNKNOWN4 = 0x00400000,
SPLINEFLAG_UNKNOWN5 = 0x00800000,
SPLINEFLAG_UNKNOWN6 = 0x01000000,
SPLINEFLAG_UNKNOWN7 = 0x02000000,
SPLINEFLAG_UNKNOWN8 = 0x04000000,
SPLINEFLAG_UNKNOWN9 = 0x08000000,
SPLINEFLAG_UNKNOWN10 = 0x10000000,
SPLINEFLAG_UNKNOWN11 = 0x20000000,
SPLINEFLAG_UNKNOWN12 = 0x40000000
};
enum SplineMode
{
SPLINEMODE_LINEAR = 0,
SPLINEMODE_CATMULLROM = 1,
SPLINEMODE_BEZIER3 = 2
};
enum SplineType
{
SPLINETYPE_NORMAL = 0,
SPLINETYPE_STOP = 1,
SPLINETYPE_FACINGSPOT = 2,
SPLINETYPE_FACINGTARGET = 3,
SPLINETYPE_FACINGANGLE = 4
}; };
struct Position struct Position
@ -1333,8 +1357,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false);
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, MonsterMovementFlags flags, uint32 Time, Player* player = NULL); void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, SplineFlags flags, uint32 Time, Player* player = NULL);
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, MonsterMovementFlags flags); void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, SplineFlags flags);
void SendHighestThreatUpdate(HostileReference* pHostileReference); void SendHighestThreatUpdate(HostileReference* pHostileReference);
void SendThreatClear(); void SendThreatClear();

View file

@ -143,7 +143,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
creature.addUnitState(UNIT_STAT_ROAMING_MOVE); creature.addUnitState(UNIT_STAT_ROAMING_MOVE);
if (creature.canFly()) if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY); creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
// Now we re-set destination to same node and start travel // Now we re-set destination to same node and start travel
const WaypointNode &node = i_path->at(i_currentNode); const WaypointNode &node = i_path->at(i_currentNode);
@ -218,7 +218,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature &creature, const uint3
creature.addUnitState(UNIT_STAT_ROAMING_MOVE); creature.addUnitState(UNIT_STAT_ROAMING_MOVE);
if (creature.canFly()) if (creature.canFly())
creature.AddMonsterMoveFlag(MONSTER_MOVE_FLY); creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7);
const WaypointNode &node = i_path->at(i_currentNode); const WaypointNode &node = i_path->at(i_currentNode);
i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z);
@ -292,7 +292,7 @@ void FlightPathMovementGenerator::Initialize(Player &player)
// do not send movement, it was sent already // do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false); i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(),MONSTER_MOVE_SPLINE_FLY); player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(), SplineFlags(SPLINEFLAG_WALKMODE|SPLINEFLAG_FLYING));
} }
void FlightPathMovementGenerator::Finalize(Player & player) void FlightPathMovementGenerator::Finalize(Player & player)