Map local guids 6.x -> 4.3.4
Ported the following commits: https://github.com/TrinityCore/TrinityCore/commit/ca83e14f8b141fab0a13e08f48fca6c1ace0c4c7 https://github.com/TrinityCore/TrinityCore/commit/ee1c1b97be4492ecabe8b15ea6323fc37e4eaa8c https://github.com/TrinityCore/TrinityCore/commit/18e4ab6911468b829b0fc768e532a770263c3717 https://github.com/TrinityCore/TrinityCore/commit/bf37446b3c2ed73b4d3aa9e227d3eff5c53b378b https://github.com/TrinityCore/TrinityCore/commit/cb854a2b7bb7bd96cf9c4d1daf3789f797bf4db8
This commit is contained in:
1 parent
694c89d76d
commit
b3ea9fbbe5
163 files changed
+2448
-2328
No files matched your search
@@ -262,7 +262,7 @@ public:
|
||||
|
||||
if (Transport* trans = chr->GetTransport())
|
||||
{
|
||||
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT);
|
||||
uint32 guid = map->GenerateLowGuid<HighGuid::Unit>();
|
||||
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
|
||||
data.id = id;
|
||||
data.phaseMask = chr->GetPhaseMask();
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
}
|
||||
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
if (!creature->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, chr->GetPhaseMask(), id, x, y, z, o))
|
||||
{
|
||||
delete creature;
|
||||
return false;
|
||||
@@ -292,7 +292,7 @@ public:
|
||||
|
||||
creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
|
||||
|
||||
uint32 db_guid = creature->GetDBTableGUIDLow();
|
||||
uint32 db_guid = creature->GetSpawnId();
|
||||
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells()
|
||||
// current "creature" variable is deleted and created fresh new, otherwise old values might trigger asserts or cause undefined behavior
|
||||
@@ -502,7 +502,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::Unit, cr_data->id, lowguid));
|
||||
}
|
||||
else
|
||||
unit = handler->getSelectedCreature();
|
||||
@@ -715,7 +715,7 @@ public:
|
||||
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
|
||||
std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true);
|
||||
|
||||
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetDBTableGUIDLow(), target->GetGUIDLow(), faction, npcflags, Entry, displayid, nativeid);
|
||||
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), faction, npcflags, Entry, displayid, nativeid);
|
||||
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
|
||||
@@ -833,7 +833,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
lowguid = creature->GetDBTableGUIDLow();
|
||||
lowguid = creature->GetSpawnId();
|
||||
}
|
||||
|
||||
float x = handler->GetSession()->GetPlayer()->GetPositionX();
|
||||
@@ -843,7 +843,7 @@ public:
|
||||
|
||||
if (creature)
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetDBTableGUIDLow()))
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetSpawnId()))
|
||||
{
|
||||
const_cast<CreatureData*>(data)->posX = x;
|
||||
const_cast<CreatureData*>(data)->posY = y;
|
||||
@@ -987,7 +987,7 @@ public:
|
||||
creature = handler->getSelectedCreature();
|
||||
if (!creature || creature->IsPet())
|
||||
return false;
|
||||
lowguid = creature->GetDBTableGUIDLow();
|
||||
lowguid = creature->GetSpawnId();
|
||||
}
|
||||
else // case .setmovetype #creature_guid $move_type (with selected creature)
|
||||
{
|
||||
@@ -995,7 +995,7 @@ public:
|
||||
|
||||
/* impossible without entry
|
||||
if (lowguid)
|
||||
creature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HIGHGUID_UNIT));
|
||||
creature = ObjectAccessor::GetCreature(*handler->GetSession()->GetPlayer(), MAKE_GUID(lowguid, HighGuid::Unit));
|
||||
*/
|
||||
|
||||
// attempt check creature existence by DB data
|
||||
@@ -1011,7 +1011,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
lowguid = creature->GetDBTableGUIDLow();
|
||||
lowguid = creature->GetSpawnId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1139,7 +1139,7 @@ public:
|
||||
uint32 guidLow = 0;
|
||||
|
||||
if (creature)
|
||||
guidLow = creature->GetDBTableGUIDLow();
|
||||
guidLow = creature->GetSpawnId();
|
||||
else
|
||||
return false;
|
||||
|
||||
@@ -1188,7 +1188,7 @@ public:
|
||||
uint32 guidLow = 0;
|
||||
|
||||
if (creature)
|
||||
guidLow = creature->GetDBTableGUIDLow();
|
||||
guidLow = creature->GetSpawnId();
|
||||
else
|
||||
return false;
|
||||
|
||||
@@ -1317,7 +1317,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectGuid receiver_guid(HIGHGUID_PLAYER, uint32(atoul(receiver_str)));
|
||||
ObjectGuid receiver_guid(HighGuid::Player, uint32(atoul(receiver_str)));
|
||||
|
||||
// check online security
|
||||
Player* receiver = ObjectAccessor::FindPlayer(receiver_guid);
|
||||
@@ -1452,14 +1452,14 @@ public:
|
||||
uint32 leaderGUID = (uint32) atoi((char*)args);
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
if (!creature || !creature->GetDBTableGUIDLow())
|
||||
if (!creature || !creature->GetSpawnId())
|
||||
{
|
||||
handler->SendSysMessage(LANG_SELECT_CREATURE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 lowguid = creature->GetDBTableGUIDLow();
|
||||
uint32 lowguid = creature->GetSpawnId();
|
||||
if (creature->GetFormation())
|
||||
{
|
||||
handler->PSendSysMessage("Selected creature is already member of group %u", creature->GetFormation()->GetId());
|
||||
@@ -1512,21 +1512,21 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!creature->GetDBTableGUIDLow())
|
||||
if (!creature->GetSpawnId())
|
||||
{
|
||||
handler->PSendSysMessage("Selected creature %u isn't in creature table", creature->GetGUIDLow());
|
||||
handler->PSendSysMessage("Selected creature %u isn't in creature table", creature->GetGUID().GetCounter());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sObjectMgr->SetCreatureLinkedRespawn(creature->GetDBTableGUIDLow(), linkguid))
|
||||
if (!sObjectMgr->SetCreatureLinkedRespawn(creature->GetSpawnId(), linkguid))
|
||||
{
|
||||
handler->PSendSysMessage("Selected creature can't link with guid '%u'", linkguid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage("LinkGUID '%u' added to creature with DBTableGUID: '%u'", linkguid, creature->GetDBTableGUIDLow());
|
||||
handler->PSendSysMessage("LinkGUID '%u' added to creature with DBTableGUID: '%u'", linkguid, creature->GetSpawnId());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user