DB/SpawnGroup: Instance spawn group data for Tempest Keep: The Eye and Hellfire Citadel: Ramparts.

(also some minor adjustments to command output for convenience)

(cherry picked from commit 51e28ae76a)
This commit is contained in:
Treeston
2018-01-25 13:45:11 +01:00
committed by Shauren
parent 7c0ac5b959
commit 7db3f7ca96
6 changed files with 376 additions and 7 deletions

View File

@@ -50,6 +50,8 @@ EndScriptData */
#include "WorldSession.h"
#include <fstream>
#include <limits>
#include <map>
#include <set>
#include <sstream>
class debug_commandscript : public CommandScript
@@ -1522,7 +1524,7 @@ public:
return false;
}
auto const& spawnGroups = *instance->_instanceSpawnGroups;
std::unordered_map<uint32, std::set<std::tuple<bool, uint8, uint8>>> store;
std::map<uint32, std::set<std::tuple<bool, uint8, uint8>>> store;
for (InstanceSpawnGroupInfo const& info : spawnGroups)
{
if (groupID && info.SpawnGroupId != groupID)
@@ -1579,7 +1581,7 @@ public:
}
}
else
handler->PSendSysMessage(" | |-- '%s' could've been %s if boss state %u matched mask %u; but it is %s -> %u, which does not match.",
handler->PSendSysMessage(" | |-- '%s' could've been %s if boss state %u matched mask 0x%02x; but it is %s -> 0x%02x, which does not match.",
groupData->name, isSpawn ? "allowed to spawn" : "blocked from spawning", bossStateId, std::get<2>(tuple), InstanceScript::GetBossStateName(actualState), (1 << actualState));
}
if (isBlocked)

View File

@@ -246,8 +246,6 @@ bool HandleNpcSpawnGroup(ChatHandler* handler, char const* args)
}
handler->PSendSysMessage(LANG_SPAWNGROUP_SPAWNCOUNT, creatureList.size());
for (WorldObject* obj : creatureList)
handler->PSendSysMessage("%s (%s)", obj->GetName(), obj->GetGUID().ToString().c_str());
return true;
}
@@ -278,12 +276,14 @@ bool HandleNpcDespawnGroup(ChatHandler* handler, char const* args)
Player* player = handler->GetSession()->GetPlayer();
if (!player->GetMap()->SpawnGroupDespawn(groupId, deleteRespawnTimes))
size_t n = 0;
if (!player->GetMap()->SpawnGroupDespawn(groupId, deleteRespawnTimes, &n))
{
handler->PSendSysMessage(LANG_SPAWNGROUP_BADGROUP, groupId);
handler->SetSentErrorMessage(true);
return false;
}
handler->PSendSysMessage("Despawned a total of %zu objects.", n);
return true;
}