diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-01-07 19:47:13 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-05-16 21:56:06 +0200 |
| commit | 8b7728f82e6e7c326b7945efd719218179e9767a (patch) | |
| tree | 6e70cddbfd2a1f4ad589eda6655a90e0f996b131 /src/server/scripts/Commands | |
| parent | 0f005c3686012e2c0403974e89cd1c3ba777450d (diff) | |
Core/Map: New Map::ForceRespawn to override objections and force a respawn (equivalent to force = true). Use this to fix various GM commands.
Scripts/Valithria: Fix an issue that could get the encounter stuck in an unloaded state.
(cherry picked from commit 3bb33e3108c65ba8a1c35b934526562aa542b63b)
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_gobject.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 49be3e5668e..fe9e8a16c16 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -350,7 +350,7 @@ public: Player const* const player = handler->GetSession()->GetPlayer(); // force respawn to make sure we find something - player->GetMap()->RemoveRespawnTime(SPAWN_TYPE_GAMEOBJECT, guidLow, true); + player->GetMap()->ForceRespawn(SPAWN_TYPE_GAMEOBJECT, guidLow); GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow); if (!object) { diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 375041d106a..9bc96553784 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -692,7 +692,7 @@ public: if (*args) range = atoi((char*)args); - RespawnVector respawns; + std::vector<RespawnInfo*> respawns; LocaleConstant locale = handler->GetSession()->GetSessionDbcLocale(); char const* stringOverdue = sObjectMgr->GetTrinityString(LANG_LIST_RESPAWNS_OVERDUE, locale); char const* stringCreature = sObjectMgr->GetTrinityString(LANG_LIST_RESPAWNS_CREATURES, locale); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index c8fe798fcaf..c70567b1746 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1990,14 +1990,14 @@ public: Cell::VisitGridObjects(player, worker, player->GetGridActivationRange()); // Now handle any that had despawned, but had respawn time logged. - RespawnVector data; + std::vector<RespawnInfo*> data; player->GetMap()->GetRespawnInfo(data, SPAWN_TYPEMASK_ALL, 0); if (!data.empty()) { uint32 const gridId = Trinity::ComputeGridCoord(player->GetPositionX(), player->GetPositionY()).GetId(); for (RespawnInfo* info : data) if (info->gridId == gridId) - player->GetMap()->RemoveRespawnTime(info, true); + player->GetMap()->ForceRespawn(info->type, info->spawnId); } return true; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 5fdfaf812b4..48c13f9bf8b 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -606,7 +606,7 @@ public: if (!lowguid) return false; // force respawn to make sure we find something - handler->GetSession()->GetPlayer()->GetMap()->RemoveRespawnTime(SPAWN_TYPE_CREATURE, lowguid, true); + handler->GetSession()->GetPlayer()->GetMap()->ForceRespawn(SPAWN_TYPE_CREATURE, lowguid); // then try to find it creature = handler->GetCreatureFromPlayerMapByDbGuid(lowguid); } @@ -822,7 +822,7 @@ public: uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask; uint32 displayid = target->GetDisplayId(); uint32 nativeid = target->GetNativeDisplayId(); - uint32 Entry = target->GetEntry(); + uint32 entry = target->GetEntry(); int64 curRespawnDelay = target->GetRespawnCompatibilityMode() ? target->GetRespawnTimeEx() - GameTime::GetGameTime() : target->GetMap()->GetCreatureRespawnTime(target->GetSpawnId()) - GameTime::GetGameTime(); @@ -831,7 +831,7 @@ public: std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true); std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true); - handler->PSendSysMessage(LANG_NPCINFO_CHAR, std::to_string(target->GetSpawnId()).c_str(), target->GetGUID().ToString().c_str(), faction, std::to_string(npcflags).c_str(), Entry, displayid, nativeid); + handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetName().c_str(), std::to_string(target->GetSpawnId()).c_str(), target->GetGUID().ToString().c_str(), entry, faction, std::to_string(npcflags).c_str(), displayid, nativeid); if (target->GetCreatureData() && target->GetCreatureData()->spawnGroupData->groupId) { SpawnGroupTemplateData const* const groupData = target->GetCreatureData()->spawnGroupData; @@ -877,7 +877,7 @@ public: if (cInfo->flags_extra & flagsExtra[i].Value) handler->PSendSysMessage("%s (0x%X)", flagsExtra[i].Name, flagsExtra[i].Value); - handler->PSendSysMessage(LANG_NPCINFO_NPC_FLAGS, npcflags); + handler->PSendSysMessage(LANG_NPCINFO_NPC_FLAGS, target->m_unitData->NpcFlags[0]); for (uint8 i = 0; i < NPC_FLAG_COUNT; i++) if (npcflags & npcFlagTexts[i].Value) handler->PSendSysMessage(npcFlagTexts[i].Name, npcFlagTexts[i].Value); |
