Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Scripting/MapScripts.cpp
	src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
	src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
	src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
	src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
	src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
	src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
	src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
	src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
	src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
This commit is contained in:
Shauren
2014-09-16 21:50:01 +02:00
545 changed files with 6733 additions and 7486 deletions
+50 -31
View File
@@ -82,8 +82,6 @@ Object::Object() : m_PackGUID(sizeof(uint64)+1)
m_inWorld = false;
m_objectUpdated = false;
m_PackGUID.appendPackGUID(0);
}
WorldObject::~WorldObject()
@@ -93,8 +91,8 @@ WorldObject::~WorldObject()
{
if (GetTypeId() == TYPEID_CORPSE)
{
TC_LOG_FATAL("misc", "Object::~Object Corpse guid=" UI64FMTD ", type=%d, entry=%u deleted but still in map!!",
GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
TC_LOG_FATAL("misc", "Object::~Object Corpse type=%d deleted but still in map!!",
GetGUID().ToString().c_str(), ((Corpse*)this)->GetType());
ASSERT(false);
}
ResetMap();
@@ -105,7 +103,7 @@ Object::~Object()
{
if (IsInWorld())
{
TC_LOG_FATAL("misc", "Object::~Object - guid=" UI64FMTD ", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
TC_LOG_FATAL("misc", "Object::~Object %s but still in world!!", GetGUID().ToString().c_str());
if (isType(TYPEMASK_ITEM))
TC_LOG_FATAL("misc", "Item slot %u", ((Item*)this)->GetSlot());
ASSERT(false);
@@ -114,7 +112,7 @@ Object::~Object()
if (m_objectUpdated)
{
TC_LOG_FATAL("misc", "Object::~Object - guid=" UI64FMTD ", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
TC_LOG_FATAL("misc", "Object::~Object %s deleted but still in update list!!", GetGUID().ToString().c_str());
ASSERT(false);
sObjectAccessor->RemoveUpdateObject(this);
}
@@ -137,11 +135,10 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh)
{
if (!m_uint32Values) _InitValues();
uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh);
SetUInt64Value(OBJECT_FIELD_GUID, guid);
ObjectGuid guid(guidhigh, entry, guidlow);
SetGuidValue(OBJECT_FIELD_GUID, guid);
SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType);
m_PackGUID.wpos(0);
m_PackGUID.appendPackGUID(GetGUID());
m_PackGUID.Set(guid);
}
std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const
@@ -181,7 +178,7 @@ void Object::BuildMovementUpdateBlock(UpdateData* data, uint32 flags) const
ByteBuffer buf(500);
buf << uint8(UPDATETYPE_MOVEMENT);
buf.append(GetPackGUID());
buf << GetPackGUID();
BuildMovementUpdate(&buf, flags);
@@ -237,7 +234,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
ByteBuffer buf(500);
buf << uint8(updateType);
buf.append(GetPackGUID());
buf << GetPackGUID();
buf << uint8(m_objectTypeId);
BuildMovementUpdate(&buf, flags);
@@ -261,7 +258,7 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) c
ByteBuffer buf(500);
buf << uint8(UPDATETYPE_VALUES);
buf.append(GetPackGUID());
buf << GetPackGUID();
BuildValuesUpdate(UPDATETYPE_VALUES, &buf, target);
@@ -336,6 +333,12 @@ uint16 Object::GetUInt16Value(uint16 index, uint8 offset) const
return *(((uint16*)&m_uint32Values[index])+offset);
}
ObjectGuid Object::GetGuidValue(uint16 index) const
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, false));
return *((ObjectGuid*)&(m_uint32Values[index]));
}
void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
{
Unit const* unit = NULL;
@@ -376,7 +379,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
Transport* transport = object->GetTransport();
if (transport)
data->append(transport->GetPackGUID());
*data << transport->GetPackGUID();
else
*data << uint8(0);
@@ -465,7 +468,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
{
ASSERT(unit);
if (Unit* victim = unit->GetVictim())
data->append(victim->GetPackGUID());
*data << victim->GetPackGUID();
else
*data << uint8(0);
}
@@ -687,13 +690,12 @@ void Object::SetUInt64Value(uint16 index, uint64 value)
}
}
bool Object::AddUInt64Value(uint16 index, uint64 value)
bool Object::AddGuidValue(uint16 index, ObjectGuid value)
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
if (value && !*((uint64*)&(m_uint32Values[index])))
if (value && !*((ObjectGuid*)&(m_uint32Values[index])))
{
m_uint32Values[index] = PAIR64_LOPART(value);
m_uint32Values[index + 1] = PAIR64_HIPART(value);
*((ObjectGuid*)&(m_uint32Values[index])) = value;
_changesMask.SetBit(index);
_changesMask.SetBit(index + 1);
@@ -709,10 +711,10 @@ bool Object::AddUInt64Value(uint16 index, uint64 value)
return false;
}
bool Object::RemoveUInt64Value(uint16 index, uint64 value)
bool Object::RemoveGuidValue(uint16 index, ObjectGuid value)
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
if (value && *((uint64*)&(m_uint32Values[index])) == value)
if (value && *((ObjectGuid*)&(m_uint32Values[index])) == value)
{
m_uint32Values[index] = 0;
m_uint32Values[index + 1] = 0;
@@ -796,6 +798,23 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
}
}
void Object::SetGuidValue(uint16 index, ObjectGuid value)
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
if (*((ObjectGuid*)&(m_uint32Values[index])) != value)
{
*((ObjectGuid*)&(m_uint32Values[index])) = value;
_changesMask.SetBit(index);
_changesMask.SetBit(index + 1);
if (m_inWorld && !m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
void Object::SetStatFloatValue(uint16 index, float value)
{
if (value < 0)
@@ -1072,7 +1091,7 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st
void MovementInfo::OutDebug()
{
TC_LOG_INFO("misc", "MOVEMENT INFO");
TC_LOG_INFO("misc", "guid " UI64FMTD, guid);
TC_LOG_INFO("misc", "guid %s", guid.ToString().c_str());
TC_LOG_INFO("misc", "flags %u", flags);
TC_LOG_INFO("misc", "flags2 %u", flags2);
TC_LOG_INFO("misc", "time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
@@ -1080,7 +1099,7 @@ void MovementInfo::OutDebug()
if (flags & MOVEMENTFLAG_ONTRANSPORT)
{
TC_LOG_INFO("misc", "TRANSPORT:");
TC_LOG_INFO("misc", "guid: " UI64FMTD, transport.guid);
TC_LOG_INFO("misc", "guid: %s", transport.guid.ToString().c_str());
TC_LOG_INFO("misc", "position: `%s`", transport.pos.ToString().c_str());
TC_LOG_INFO("misc", "seat: %i", transport.seat);
TC_LOG_INFO("misc", "time: %u", transport.time);
@@ -1892,7 +1911,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
void Unit::BuildHeartBeatMsg(WorldPacket* data) const
{
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
data->append(GetPackGUID());
*data << GetPackGUID();
BuildMovementPacket(data);
}
@@ -1914,7 +1933,7 @@ void WorldObject::SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr
VisitNearbyWorldObject(GetVisibilityRange(), notifier);
}
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
void WorldObject::SendObjectDeSpawnAnim(ObjectGuid guid)
{
WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);
data << uint64(guid);
@@ -2611,7 +2630,7 @@ struct WorldObjectChangeAccumulator
{
UpdateDataMapType& i_updateDatas;
WorldObject& i_object;
std::set<uint64> plr_list;
GuidSet plr_list;
WorldObjectChangeAccumulator(WorldObject &obj, UpdateDataMapType &d) : i_updateDatas(d), i_object(obj) { }
void Visit(PlayerMapType &m)
{
@@ -2652,13 +2671,13 @@ struct WorldObjectChangeAccumulator
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
source = iter->GetSource();
uint64 guid = source->GetCasterGUID();
ObjectGuid guid = source->GetCasterGUID();
if (IS_PLAYER_GUID(guid))
if (guid.IsPlayer())
{
//Caster may be NULL if DynObj is in removelist
if (Player* caster = ObjectAccessor::FindPlayer(guid))
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == source->GetGUID())
if (caster->GetGuidValue(PLAYER_FARSIGHT) == source->GetGUID())
BuildPacket(caster);
}
}
@@ -2691,9 +2710,9 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map)
ClearUpdateMask(false);
}
uint64 WorldObject::GetTransGUID() const
ObjectGuid WorldObject::GetTransGUID() const
{
if (GetTransport())
return GetTransport()->GetGUID();
return 0;
return ObjectGuid::Empty;
}