feat(Core/Creature): Allow 3 ids per spawn point. TESTING (#10169)

* feat(Core/Creature): Allow 3 ids per spawn point.

* Move GetRandomId to a function

* Update id to id1

* Fixed some errors crashing core and text

* Set ids to lowercase for GetRandomId function

* Update src/server/database/Database/Implementation/WorldDatabase.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

Co-authored-by: acidmanifesto <joshua.lee.betts@gmail.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Malcrom
2022-01-14 19:21:50 -04:00
committed by GitHub
parent cdca93aa7f
commit dfac47a562
17 changed files with 123 additions and 80 deletions

View File

@@ -223,7 +223,7 @@ public:
{
ObjectGuid::LowType guid = sObjectMgr->GenerateCreatureSpawnId();
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
data.id = id;
data.id1 = id;
data.phaseMask = chr->GetPhaseMaskForSpawn();
data.posX = chr->GetTransOffsetX();
data.posY = chr->GetTransOffsetY();
@@ -595,14 +595,14 @@ public:
uint32 displayid = target->GetDisplayId();
uint32 nativeid = target->GetNativeDisplayId();
uint32 entry = target->GetEntry();
uint32 creature_id1 = 0;
uint32 creature_id2 = 0;
float chance_id1 = 0.0f;
uint32 id1 = 0;
uint32 id2 = 0;
uint32 id3 = 0;
if (CreatureData const* cData = target->GetCreatureData())
{
creature_id1 = cData->id;
creature_id2 = cData->id2;
chance_id1 = cData->chance_id1;
id1 = cData->id1;
id2 = cData->id2;
id3 = cData->id3;
}
int64 curRespawnDelay = target->GetRespawnTimeEx() - time(nullptr);
@@ -611,7 +611,7 @@ public:
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true);
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), entry, creature_id1, creature_id2, chance_id1, displayid, nativeid, faction, npcflags);
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), entry, id1, id2, id3, displayid, nativeid, faction, npcflags);
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());