Core/Entities: Updated HighGuid values

This commit is contained in:
Shauren
2014-10-27 12:03:35 +01:00
parent 8b75b7e638
commit 7afab9f783
65 changed files with 407 additions and 391 deletions

View File

@@ -133,7 +133,7 @@ public:
DeletedInfo info;
info.guid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt64());
info.guid = ObjectGuid(HighGuid::Player, fields[0].GetUInt64());
info.name = fields[1].GetString();
info.accountId = fields[2].GetUInt32();
@@ -921,7 +921,7 @@ public:
return false;
}
if (sObjectMgr->GetPlayerAccountIdByGUID(ObjectGuid(HIGHGUID_PLAYER, guid)))
if (sObjectMgr->GetPlayerAccountIdByGUID(ObjectGuid(HighGuid::Player, guid)))
{
handler->PSendSysMessage(LANG_CHARACTER_GUID_IN_USE, guid);
handler->SetSentErrorMessage(true);
@@ -969,7 +969,7 @@ public:
ObjectGuid guid;
// character name can't start from number
if (isNumeric(playerStr))
guid = ObjectGuid(HIGHGUID_PLAYER, strtoull(playerStr, nullptr, 10));
guid = ObjectGuid(HighGuid::Player, strtoull(playerStr, nullptr, 10));
else
{
std::string name = handler->extractPlayerNameFromLink(playerStr);

View File

@@ -928,7 +928,7 @@ public:
Map* map = handler->GetSession()->GetPlayer()->GetMap();
if (!v->Create(sObjectMgr->GetGenerator<HIGHGUID_VEHICLE>()->Generate(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, x, y, z, o, nullptr, id))
if (!v->Create(sObjectMgr->GetGenerator<HighGuid::Vehicle>()->Generate(), map, handler->GetSession()->GetPlayer()->GetPhaseMask(), entry, x, y, z, o, nullptr, id))
{
delete v;
return false;
@@ -990,7 +990,7 @@ public:
ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
uint32 index = (uint32)atoi(f);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
if (!i)
return false;
@@ -1021,7 +1021,7 @@ public:
uint32 index = (uint32)atoi(f);
uint32 value = (uint32)atoi(g);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
if (!i)
return false;
@@ -1045,7 +1045,7 @@ public:
ObjectGuid::LowType guid = strtoull(e, nullptr, 10);
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HighGuid::Item, guid));
if (!i)
return false;

View File

@@ -140,7 +140,7 @@ public:
Transport* transport = NULL;
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HIGHGUID_UNIT, id, guid), (Creature*)NULL))
if (Creature* creature = ObjectAccessor::GetObjectInWorld(ObjectGuid(HighGuid::Creature, id, guid), (Creature*)NULL))
{
x = creature->GetPositionX();
y = creature->GetPositionY();

View File

@@ -150,7 +150,7 @@ public:
Map* map = player->GetMap();
GameObject* object = new GameObject;
ObjectGuid::LowType guidLow = sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate();
ObjectGuid::LowType guidLow = sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate();
if (!object->Create(guidLow, objectInfo->entry, map, 0, x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{
@@ -328,7 +328,7 @@ public:
return false;
}
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, id, guidLow));
GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid(HighGuid::GameObject, id, guidLow));
handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phase);

View File

@@ -269,7 +269,7 @@ public:
const char* onlineState = "";
// Parse the guid to uint32...
ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
ObjectGuid parseGUID(HighGuid::Player, strtoull(args, nullptr, 10));
// ... and try to extract a player out of it.
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget))

View File

@@ -181,10 +181,10 @@ public:
do
{
Field* fields = result->Fetch();
ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64());
ObjectGuid itemGuid(HighGuid::Item, fields[0].GetUInt64());
uint32 itemBag = fields[1].GetUInt32();
uint8 itemSlot = fields[2].GetUInt8();
ObjectGuid ownerGuid(HIGHGUID_PLAYER, fields[3].GetUInt64());
ObjectGuid ownerGuid(HighGuid::Player, fields[3].GetUInt64());
uint32 ownerAccountId = fields[4].GetUInt32();
std::string ownerName = fields[5].GetString();
@@ -282,8 +282,8 @@ public:
do
{
Field* fields = result->Fetch();
ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64());
ObjectGuid owner(HIGHGUID_PLAYER, fields[1].GetUInt64());
ObjectGuid itemGuid(HighGuid::Item, fields[0].GetUInt64());
ObjectGuid owner(HighGuid::Player, fields[1].GetUInt64());
uint32 ownerAccountId = fields[2].GetUInt32();
std::string ownerName = fields[3].GetString();
@@ -314,8 +314,8 @@ public:
do
{
Field* fields = result->Fetch();
ObjectGuid itemGuid(HIGHGUID_ITEM, fields[0].GetUInt64());
ObjectGuid guildGuid(HIGHGUID_GUILD, fields[1].GetUInt64());
ObjectGuid itemGuid(HighGuid::Item, fields[0].GetUInt64());
ObjectGuid guildGuid(HighGuid::Guild, fields[1].GetUInt64());
std::string guildName = fields[2].GetString();
char const* itemPos = "[in guild bank]";
@@ -476,7 +476,7 @@ public:
if (!*args)
return false;
ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
ObjectGuid parseGUID(HighGuid::Player, strtoull(args, nullptr, 10));
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))
{

View File

@@ -1280,7 +1280,7 @@ public:
do
{
Field* characterFields = result2->Fetch();
ObjectGuid guid(HIGHGUID_PLAYER, characterFields[0].GetUInt64());
ObjectGuid guid(HighGuid::Player, characterFields[0].GetUInt64());
std::string name = characterFields[1].GetString();
handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid.ToString().c_str());

View File

@@ -1390,7 +1390,7 @@ public:
PreparedStatement* stmt = NULL;
// To make sure we get a target, we convert our guid to an omniversal...
ObjectGuid parseGUID(HIGHGUID_PLAYER, strtoull(args, nullptr, 10));
ObjectGuid parseGUID(HighGuid::Player, strtoull(args, nullptr, 10));
// ... and make sure we get a target, somehow.
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName))

View File

@@ -261,7 +261,7 @@ public:
if (Transport* trans = chr->GetTransport())
{
ObjectGuid::LowType guid = sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate();
ObjectGuid::LowType guid = sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate();
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
data.id = id;
data.phaseMask = chr->GetPhaseMask();
@@ -279,7 +279,7 @@ public:
}
Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
delete creature;
return false;
@@ -527,7 +527,7 @@ public:
return false;
if (CreatureData const* cr_data = sObjectMgr->GetCreatureData(lowguid))
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, cr_data->id, lowguid));
unit = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Creature, cr_data->id, lowguid));
}
else
unit = handler->getSelectedCreature();
@@ -1323,7 +1323,7 @@ public:
return false;
}
ObjectGuid receiver_guid(HIGHGUID_PLAYER, strtoull(receiver_str, nullptr, 10));
ObjectGuid receiver_guid(HighGuid::Player, strtoull(receiver_str, nullptr, 10));
// check online security
Player* receiver = ObjectAccessor::FindPlayer(receiver_guid);

View File

@@ -674,7 +674,7 @@ public:
}
// re-create
Creature* wpCreature2 = new Creature();
if (!wpCreature2->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
if (!wpCreature2->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@@ -850,7 +850,7 @@ public:
{
Field* fields = result2->Fetch();
ObjectGuid::LowType wpguid = fields[0].GetUInt64();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, wpguid));
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Creature, VISUAL_WAYPOINT, wpguid));
if (!creature)
{
@@ -894,7 +894,7 @@ public:
float o = chr->GetOrientation();
Creature* wpCreature = new Creature();
if (!wpCreature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
if (!wpCreature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
@@ -959,7 +959,7 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete creature;
@@ -1011,7 +1011,7 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GetGenerator<HIGHGUID_UNIT>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
if (!creature->Create(sObjectMgr->GetGenerator<HighGuid::Creature>()->Generate(), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete creature;
@@ -1055,7 +1055,7 @@ public:
{
Field* fields = result->Fetch();
ObjectGuid::LowType guid = fields[0].GetUInt64();
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, VISUAL_WAYPOINT, guid));
Creature* creature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HighGuid::Creature, VISUAL_WAYPOINT, guid));
if (!creature)
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);

View File

@@ -648,7 +648,7 @@ class npc_spinestalker : public CreatureScript
// Increase add count
if (!me->isDead())
{
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
Reset();
}
}
@@ -671,7 +671,7 @@ class npc_spinestalker : public CreatureScript
void JustRespawned() override
{
ScriptedAI::JustRespawned();
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
}
void JustDied(Unit* /*killer*/) override
@@ -784,7 +784,7 @@ class npc_rimefang : public CreatureScript
// Increase add count
if (!me->isDead())
{
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
Reset();
}
}
@@ -807,7 +807,7 @@ class npc_rimefang : public CreatureScript
void JustRespawned() override
{
ScriptedAI::JustRespawned();
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
_instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
}
void JustDied(Unit* /*killer*/) override
@@ -951,7 +951,7 @@ class npc_sindragosa_trash : public CreatureScript
if (!me->isDead())
{
if (me->GetEntry() == NPC_FROSTWING_WHELP)
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
Reset();
}
}
@@ -974,7 +974,7 @@ class npc_sindragosa_trash : public CreatureScript
// Increase add count
if (me->GetEntry() == NPC_FROSTWING_WHELP)
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HIGHGUID_UNIT, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
_instance->SetGuidData(_frostwyrmId, ObjectGuid(HighGuid::Creature, me->GetEntry(), me->GetDBTableGUIDLow())); // this cannot be in Reset because reset also happens on evade
}
void SetData(uint32 type, uint32 data) override

View File

@@ -74,7 +74,7 @@ public:
void SpawnGameObject(uint32 entry, Position& pos)
{
GameObject* go = new GameObject;
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), entry, instance,
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), entry, instance,
PHASEMASK_NORMAL, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(),
0, 0, 0, 0, 120, GO_STATE_READY))
{

View File

@@ -166,7 +166,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
return true;
}
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
{
delete go;
return true;
@@ -203,7 +203,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
return true;
}
if (!go->Create(sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
if (!go->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY))
{
delete go;
return true;