mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Commands] Cleanup #spawnstatus Command. (#2144)
* [Commands] Cleanup #spawnstatus Command. - Cleanup messages and logic. * Further cleanup and consolidation, add inline GetTimer() as timer is protected.
This commit is contained in:
@@ -2043,102 +2043,6 @@ bool ZoneDatabase::LoadStaticZonePoints(LinkedList<ZonePoint *> *zone_point_list
|
||||
return true;
|
||||
}
|
||||
|
||||
void Zone::SpawnStatus(Mob* client) {
|
||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
||||
|
||||
uint32 x = 0;
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF)
|
||||
client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ());
|
||||
else
|
||||
client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000);
|
||||
|
||||
x++;
|
||||
iterator.Advance();
|
||||
}
|
||||
client->Message(Chat::White, "%i spawns listed.", x);
|
||||
}
|
||||
|
||||
void Zone::ShowEnabledSpawnStatus(Mob* client)
|
||||
{
|
||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
||||
int x = 0;
|
||||
int iEnabledCount = 0;
|
||||
|
||||
iterator.Reset();
|
||||
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if (iterator.GetData()->timer.GetRemainingTime() != 0xFFFFFFFF)
|
||||
{
|
||||
client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000);
|
||||
iEnabledCount++;
|
||||
}
|
||||
|
||||
x++;
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
client->Message(Chat::White, "%i of %i spawns listed.", iEnabledCount, x);
|
||||
}
|
||||
|
||||
void Zone::ShowDisabledSpawnStatus(Mob* client)
|
||||
{
|
||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
||||
int x = 0;
|
||||
int iDisabledCount = 0;
|
||||
|
||||
iterator.Reset();
|
||||
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF)
|
||||
{
|
||||
client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ());
|
||||
iDisabledCount++;
|
||||
}
|
||||
|
||||
x++;
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
client->Message(Chat::White, "%i of %i spawns listed.", iDisabledCount, x);
|
||||
}
|
||||
|
||||
void Zone::ShowSpawnStatusByID(Mob* client, uint32 spawnid)
|
||||
{
|
||||
LinkedListIterator<Spawn2*> iterator(spawn2_list);
|
||||
int x = 0;
|
||||
int iSpawnIDCount = 0;
|
||||
|
||||
iterator.Reset();
|
||||
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if (iterator.GetData()->GetID() == spawnid)
|
||||
{
|
||||
if (iterator.GetData()->timer.GetRemainingTime() == 0xFFFFFFFF)
|
||||
client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: disabled", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ());
|
||||
else
|
||||
client->Message(Chat::White, " %d: %1.1f, %1.1f, %1.1f: %1.2f", iterator.GetData()->GetID(), iterator.GetData()->GetX(), iterator.GetData()->GetY(), iterator.GetData()->GetZ(), (float)iterator.GetData()->timer.GetRemainingTime() / 1000);
|
||||
|
||||
iSpawnIDCount++;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
x++;
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if(iSpawnIDCount > 0)
|
||||
client->Message(Chat::White, "%i of %i spawns listed.", iSpawnIDCount, x);
|
||||
else
|
||||
client->Message(Chat::White, "No matching spawn id was found in this zone.");
|
||||
}
|
||||
|
||||
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes)
|
||||
{
|
||||
const std::string query =
|
||||
|
||||
Reference in New Issue
Block a user