[Bug Fix] Fix issue where #advnpcspawn addspawn does not add spawn sometimes. (#2247)

* [Bug Fix] Fix issue where #advnpcspawn addspawn does not add spawn sometimes.
- Cleanup where std::stoi should be std::stoul.
- Cleanup ShowStats message to show NPC stats at bottom as well.

* Update advnpcspawn.cpp
This commit is contained in:
Kinglykrab 2022-06-06 23:24:45 -04:00 committed by GitHub
parent 2910073373
commit ec4d228dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 203 additions and 206 deletions

View File

@ -91,20 +91,20 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
return; return;
} }
auto spawngroup_id = std::stoi(sep->arg[2]); auto spawngroup_id = std::stoul(sep->arg[2]);
auto npc_id = std::stoi(sep->arg[2]); auto npc_id = std::stoul(sep->arg[3]);
auto spawn_chance = std::stoi(sep->arg[2]); auto spawn_chance = std::stoul(sep->arg[4]);
std::string query = fmt::format( auto query = fmt::format(
SQL( SQL(
INSERT INTO spawnentry(spawngroupID, npcID, chance) INSERT INTO spawnentry (spawngroupID, npcID, chance)
VALUES({}, {}, {}) VALUES ({}, {}, {})
), ),
spawngroup_id, spawngroup_id,
npc_id, npc_id,
spawn_chance spawn_chance
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to add entry to Spawngroup."); c->Message(Chat::White, "Failed to add entry to Spawngroup.");
return; return;
@ -121,36 +121,37 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
).c_str() ).c_str()
); );
return; return;
} } else if (is_add_spawn) {
else if (is_add_spawn) { if (
content_db.NPCSpawnDB( content_db.NPCSpawnDB(
NPCSpawnTypes::AddSpawnFromSpawngroup, NPCSpawnTypes::AddSpawnFromSpawngroup,
zone->GetShortName(), zone->GetShortName(),
zone->GetInstanceVersion(), zone->GetInstanceVersion(),
c, c,
0, 0,
std::stoi(sep->arg[2]) std::stoul(sep->arg[2])
); )
c->Message( ) {
Chat::White, c->Message(
fmt::format( Chat::White,
"Spawn Added | Added spawn from Spawngroup ID {}.", fmt::format(
std::stoi(sep->arg[2]) "Spawn Added | Added spawn from Spawngroup ID {}.",
).c_str() std::stoul(sep->arg[2])
); ).c_str()
);
}
return; return;
} } else if (is_clear_box) {
else if (is_clear_box) {
if (arguments != 2 || !sep->IsNumber(2)) { if (arguments != 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Usage: #advnpcspawn clearbox [Spawngroup ID]"); c->Message(Chat::White, "Usage: #advnpcspawn clearbox [Spawngroup ID]");
return; return;
} }
std::string query = fmt::format( auto query = fmt::format(
"UPDATE spawngroup SET dist = 0, min_x = 0, max_x = 0, min_y = 0, max_y = 0, delay = 0 WHERE id = {}", "UPDATE spawngroup SET dist = 0, min_x = 0, max_x = 0, min_y = 0, max_y = 0, delay = 0 WHERE id = {}",
std::stoi(sep->arg[2]) std::stoul(sep->arg[2])
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to clear Spawngroup box."); c->Message(Chat::White, "Failed to clear Spawngroup box.");
return; return;
@ -160,44 +161,45 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
Chat::White, Chat::White,
fmt::format( fmt::format(
"Spawngroup {} Roambox Cleared | Delay: 0 Distance: 0.00", "Spawngroup {} Roambox Cleared | Delay: 0 Distance: 0.00",
std::stoi(sep->arg[2]) std::stoul(sep->arg[2])
).c_str() ).c_str()
); );
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Spawngroup {} Roambox Cleared | Minimum X: 0.00 Maximum X: 0.00", "Spawngroup {} Roambox Cleared | Minimum X: 0.00 Maximum X: 0.00",
std::stoi(sep->arg[2]) std::stoul(sep->arg[2])
).c_str() ).c_str()
); );
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Spawngroup {} Roambox Cleared | Minimum Y: 0.00 Maximum Y: 0.00", "Spawngroup {} Roambox Cleared | Minimum Y: 0.00 Maximum Y: 0.00",
std::stoi(sep->arg[2]) std::stoul(sep->arg[2])
).c_str() ).c_str()
); );
return; return;
} } else if (is_delete_spawn) {
else if (is_delete_spawn) {
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command."); c->Message(Chat::White, "You must target an NPC to use this command.");
return; return;
} }
NPC *target = c->GetTarget()->CastToNPC(); auto target = c->GetTarget()->CastToNPC();
Spawn2 *spawn2 = target->respawn2; auto spawn2 = target->respawn2;
if (!spawn2) { if (!spawn2) {
c->Message(Chat::White, "Failed to delete spawn because NPC has no Spawn2."); c->Message(Chat::White, "Failed to delete spawn because NPC has no Spawn2.");
return; return;
} }
auto spawn2_id = spawn2->GetID(); auto spawn2_id = spawn2->GetID();
std::string query = fmt::format( auto query = fmt::format(
"DELETE FROM spawn2 WHERE id = {}", "DELETE FROM spawn2 WHERE id = {}",
spawn2_id spawn2_id
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to delete spawn."); c->Message(Chat::White, "Failed to delete spawn.");
return; return;
@ -207,13 +209,13 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
Chat::White, Chat::White,
fmt::format( fmt::format(
"Spawn2 {} Deleted | Name: {}", "Spawn2 {} Deleted | Name: {}",
spawn2_id,c->GetTargetDescription(target) spawn2_id,
c->GetTargetDescription(target)
).c_str() ).c_str()
); );
target->Depop(false); target->Depop(false);
return; return;
} } else if (is_edit_box) {
else if (is_edit_box) {
if ( if (
arguments != 8 || arguments != 8 ||
!sep->IsNumber(3) || !sep->IsNumber(3) ||
@ -222,22 +224,22 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
!sep->IsNumber(6) || !sep->IsNumber(6) ||
!sep->IsNumber(7) || !sep->IsNumber(7) ||
!sep->IsNumber(8) !sep->IsNumber(8)
) { ) {
c->Message( c->Message(
Chat::White, Chat::White,
"Usage: #advnpcspawn editbox [Spawngroup ID] [Distance] [Minimum X] [Maximum X] [Minimum Y] [Maximum Y] [Delay]" "Usage: #advnpcspawn editbox [Spawngroup ID] [Distance] [Minimum X] [Maximum X] [Minimum Y] [Maximum Y] [Delay]"
); );
return; return;
} }
auto spawngroup_id = std::stoi(sep->arg[2]); auto spawngroup_id = std::stoul(sep->arg[2]);
auto distance = std::stof(sep->arg[3]); auto distance = std::stof(sep->arg[3]);
auto minimum_x = std::stof(sep->arg[4]); auto minimum_x = std::stof(sep->arg[4]);
auto maximum_x = std::stof(sep->arg[5]); auto maximum_x = std::stof(sep->arg[5]);
auto minimum_y = std::stof(sep->arg[6]); auto minimum_y = std::stof(sep->arg[6]);
auto maximum_y = std::stof(sep->arg[7]); auto maximum_y = std::stof(sep->arg[7]);
auto delay = std::stoi(sep->arg[8]); auto delay = std::stoi(sep->arg[8]);
std::string query = fmt::format( auto query = fmt::format(
"UPDATE spawngroup SET dist = {:.2f}, min_x = {:.2f}, max_x = {:.2f}, max_y = {:.2f}, min_y = {:.2f}, delay = {} WHERE id = {}", "UPDATE spawngroup SET dist = {:.2f}, min_x = {:.2f}, max_x = {:.2f}, max_y = {:.2f}, min_y = {:.2f}, delay = {} WHERE id = {}",
distance, distance,
minimum_x, minimum_x,
@ -247,7 +249,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
delay, delay,
spawngroup_id spawngroup_id
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to edit Spawngroup box."); c->Message(Chat::White, "Failed to edit Spawngroup box.");
return; return;
@ -262,6 +264,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
distance distance
).c_str() ).c_str()
); );
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
@ -271,6 +274,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
maximum_x maximum_x
).c_str() ).c_str()
); );
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
@ -281,8 +285,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
).c_str() ).c_str()
); );
return; return;
} } else if (is_edit_respawn) {
else if (is_edit_respawn) {
if (arguments < 2 || !sep->IsNumber(2)) { if (arguments < 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Usage: #advnpcspawn editrespawn [Respawn Timer] [Variance]"); c->Message(Chat::White, "Usage: #advnpcspawn editrespawn [Respawn Timer] [Variance]");
return; return;
@ -293,27 +296,24 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
return; return;
} }
NPC *target = c->GetTarget()->CastToNPC(); auto target = c->GetTarget()->CastToNPC();
Spawn2 *spawn2 = target->respawn2; auto spawn2 = target->respawn2;
if (!spawn2) { if (!spawn2) {
c->Message(Chat::White, "Failed to edit respawn because NPC has no Spawn2."); c->Message(Chat::White, "Failed to edit respawn because NPC has no Spawn2.");
return; return;
} }
auto spawn2_id = spawn2->GetID(); auto spawn2_id = spawn2->GetID();
uint32 respawn_timer = std::stoi(sep->arg[2]); auto respawn_timer = std::stoul(sep->arg[2]);
uint32 variance = ( auto variance = sep->IsNumber(3) ? std::stoul(sep->arg[3]) : spawn2->GetVariance();
sep->IsNumber(3) ?
std::stoi(sep->arg[3]) : auto query = fmt::format(
spawn2->GetVariance()
);
std::string query = fmt::format(
"UPDATE spawn2 SET respawntime = {}, variance = {} WHERE id = {}", "UPDATE spawn2 SET respawntime = {}, variance = {} WHERE id = {}",
respawn_timer, respawn_timer,
variance, variance,
spawn2_id spawn2_id
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to edit respawn."); c->Message(Chat::White, "Failed to edit respawn.");
return; return;
@ -329,37 +329,29 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
variance variance
).c_str() ).c_str()
); );
spawn2->SetRespawnTimer(respawn_timer); spawn2->SetRespawnTimer(respawn_timer);
spawn2->SetVariance(variance); spawn2->SetVariance(variance);
return; return;
} } else if (is_make_group) {
else if (is_make_group) { if (arguments < 2) {
if (
arguments != 9 ||
!sep->IsNumber(3) ||
!sep->IsNumber(4) ||
!sep->IsNumber(5) ||
!sep->IsNumber(6) ||
!sep->IsNumber(7) ||
!sep->IsNumber(8) ||
!sep->IsNumber(9)
) {
c->Message( c->Message(
Chat::White, Chat::White,
"Usage: #advncspawn makegroup [Spawn Group Name] [Spawn Limit] [Distance] [Minimum X] [Maximum X] [Minimum Y] [Maximum Y] [Delay]" "Usage: #advncspawn makegroup [Spawn Group Name] [Spawn Limit] [Distance] [Minimum X] [Maximum X] [Minimum Y] [Maximum Y] [Delay]"
); );
return; return;
} }
std::string spawngroup_name = sep->arg[2];
auto spawn_limit = std::stoi(sep->arg[3]);
auto distance = std::stof(sep->arg[4]);
auto minimum_x = std::stof(sep->arg[5]);
auto maximum_x = std::stof(sep->arg[6]);
auto minimum_y = std::stof(sep->arg[7]);
auto maximum_y = std::stof(sep->arg[8]);
auto delay = std::stoi(sep->arg[9]);
std::string query = fmt::format( std::string spawngroup_name = sep->arg[2];
auto spawn_limit = sep->IsNumber(3) ? std::stoi(sep->arg[3]) : 0;
auto distance = sep->IsNumber(4) ? std::stof(sep->arg[4]) : 0.0f;
auto minimum_x = sep->IsNumber(5) ? std::stof(sep->arg[5]) : 0.0f;
auto maximum_x = sep->IsNumber(6) ? std::stof(sep->arg[6]) : 0.0f;
auto minimum_y = sep->IsNumber(7) ? std::stof(sep->arg[7]) : 0.0f;
auto maximum_y = sep->IsNumber(8) ? std::stof(sep->arg[8]) : 0.0f;
auto delay = sep->IsNumber(9) ? std::stoi(sep->arg[9]) : 0;
auto query = fmt::format(
"INSERT INTO spawngroup" "INSERT INTO spawngroup"
"(name, spawn_limit, dist, min_x, max_x, min_y, max_y, delay)" "(name, spawn_limit, dist, min_x, max_x, min_y, max_y, delay)"
"VALUES ('{}', {}, {:.2f}, {:.2f}, {:.2f}, {:.2f}, {:.2f}, {})", "VALUES ('{}', {}, {:.2f}, {:.2f}, {:.2f}, {:.2f}, {:.2f}, {})",
@ -372,7 +364,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
maximum_y, maximum_y,
delay delay
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to make Spawngroup."); c->Message(Chat::White, "Failed to make Spawngroup.");
return; return;
@ -416,39 +408,42 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
).c_str() ).c_str()
); );
return; return;
} } else if (is_make_npc) {
else if (is_make_npc) {
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command."); c->Message(Chat::White, "You must target an NPC to use this command.");
return; return;
} }
NPC *target = c->GetTarget()->CastToNPC(); if (
content_db.NPCSpawnDB( content_db.NPCSpawnDB(
NPCSpawnTypes::CreateNewNPC, NPCSpawnTypes::CreateNewNPC,
zone->GetShortName(), zone->GetShortName(),
zone->GetInstanceVersion(), zone->GetInstanceVersion(),
c, c,
target c->GetTarget()->CastToNPC()
); )
) {
c->Message(Chat::White, "Created a new NPC.");
}
return; return;
} } else if (is_move_spawn) {
else if (is_move_spawn) {
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command."); c->Message(Chat::White, "You must target an NPC to use this command.");
return; return;
} }
NPC *target = c->GetTarget()->CastToNPC(); auto target = c->GetTarget()->CastToNPC();
Spawn2 *spawn2 = target->respawn2; auto spawn2 = target->respawn2;
if (!spawn2) { if (!spawn2) {
c->Message(Chat::White, "Failed to move spawn because NPC has no Spawn2."); c->Message(Chat::White, "Failed to move spawn because NPC has no Spawn2.");
return; return;
} }
auto client_position = c->GetPosition(); auto client_position = c->GetPosition();
auto spawn2_id = spawn2->GetID(); auto spawn2_id = spawn2->GetID();
std::string query = fmt::format(
auto query = fmt::format(
"UPDATE spawn2 SET x = {:.2f}, y = {:.2f}, z = {:.2f}, heading = {:.2f} WHERE id = {}", "UPDATE spawn2 SET x = {:.2f}, y = {:.2f}, z = {:.2f}, heading = {:.2f} WHERE id = {}",
client_position.x, client_position.x,
client_position.y, client_position.y,
@ -456,7 +451,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
client_position.w, client_position.w,
spawn2_id spawn2_id
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to move spawn."); c->Message(Chat::White, "Failed to move spawn.");
return; return;
@ -470,6 +465,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
c->GetTargetDescription(target) c->GetTargetDescription(target)
).c_str() ).c_str()
); );
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
@ -481,6 +477,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
client_position.w client_position.w
).c_str() ).c_str()
); );
target->GMMove( target->GMMove(
client_position.x, client_position.x,
client_position.y, client_position.y,
@ -488,8 +485,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
client_position.w client_position.w
); );
return; return;
} } else if (is_set_version) {
else if (is_set_version) {
if (arguments != 2 || !sep->IsNumber(2)) { if (arguments != 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Usage: #advnpcspawn setversion [Version]"); c->Message(Chat::White, "Usage: #advnpcspawn setversion [Version]");
return; return;
@ -500,14 +496,15 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
return; return;
} }
NPC *target = c->GetTarget()->CastToNPC(); auto target = c->GetTarget()->CastToNPC();
auto version = std::stoi(sep->arg[2]); auto version = std::stoul(sep->arg[2]);
std::string query = fmt::format(
auto query = fmt::format(
"UPDATE spawn2 SET version = {} WHERE spawngroupID = {}", "UPDATE spawn2 SET version = {} WHERE spawngroupID = {}",
version, version,
target->GetSpawnGroupId() target->GetSpawnGroupId()
); );
auto results = content_db.QueryDatabase(query); auto results = content_db.QueryDatabase(query);
if (!results.Success()) { if (!results.Success()) {
c->Message(Chat::White, "Failed to set version."); c->Message(Chat::White, "Failed to set version.");
return; return;

View File

@ -1682,101 +1682,6 @@ void Mob::ShowStats(Client* client)
target->GetCharmedMinDamage() != 0 target->GetCharmedMinDamage() != 0
); );
// Spawn Data
if (
target->GetGrid() ||
target->GetSpawnGroupId() ||
target->GetSpawnPointID()
) {
client->Message(
Chat::White,
fmt::format(
"Spawn | Group: {} Point: {} Grid: {}",
target->GetSpawnGroupId(),
target->GetSpawnPointID(),
target->GetGrid()
).c_str()
);
}
client->Message(
Chat::White,
fmt::format(
"Spawn | Raid: {} Rare: {}",
target->IsRaidTarget() ? "Yes" : "No",
target->IsRareSpawn() ? "Yes" : "No",
target->GetSkipGlobalLoot() ? "Yes" : "No"
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Skip Global Loot: {} Ignore Despawn: {}",
target->GetSkipGlobalLoot() ? "Yes" : "No",
target->GetIgnoreDespawn() ? "Yes" : "No"
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Findable: {} Trackable: {} Underwater: {}",
target->IsFindable() ? "Yes" : "No",
target->IsTrackable() ? "Yes" : "No",
target->IsUnderwaterOnly() ? "Yes" : "No"
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Stuck Behavior: {} Fly Mode: {}",
target->GetStuckBehavior(),
static_cast<int>(target->GetFlyMode())
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Aggro NPCs: {} Always Aggro: {}",
target->GetNPCAggro() ? "Yes" : "No",
target->GetAlwaysAggro() ? "Yes" : "No"
).c_str()
);
// NPC
client->Message(
Chat::White,
fmt::format(
"NPC | ID: {} Entity ID: {} Name: {}{} Level: {}",
target->GetNPCTypeID(),
target->GetID(),
target_name,
(
!target_last_name.empty() ?
fmt::format(" ({})", target_last_name) :
""
),
target->GetLevel()
).c_str()
);
// Race / Class / Gender
client->Message(
Chat::White,
fmt::format(
"Race: {} ({}) Class: {} ({}) Gender: {} ({})",
GetRaceIDName(target->GetRace()),
target->GetRace(),
GetClassIDName(target->GetClass()),
target->GetClass(),
GetGenderName(target->GetGender()),
target->GetGender()
).c_str()
);
// Faction // Faction
if (target->GetNPCFactionID()) { if (target->GetNPCFactionID()) {
auto faction_id = target->GetNPCFactionID(); auto faction_id = target->GetNPCFactionID();
@ -2310,6 +2215,101 @@ void Mob::ShowStats(Client* client)
).c_str() ).c_str()
); );
} }
// Spawn Data
if (
target->GetGrid() ||
target->GetSpawnGroupId() ||
target->GetSpawnPointID()
) {
client->Message(
Chat::White,
fmt::format(
"Spawn | Group: {} Point: {} Grid: {}",
target->GetSpawnGroupId(),
target->GetSpawnPointID(),
target->GetGrid()
).c_str()
);
}
client->Message(
Chat::White,
fmt::format(
"Spawn | Raid: {} Rare: {}",
target->IsRaidTarget() ? "Yes" : "No",
target->IsRareSpawn() ? "Yes" : "No",
target->GetSkipGlobalLoot() ? "Yes" : "No"
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Skip Global Loot: {} Ignore Despawn: {}",
target->GetSkipGlobalLoot() ? "Yes" : "No",
target->GetIgnoreDespawn() ? "Yes" : "No"
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Findable: {} Trackable: {} Underwater: {}",
target->IsFindable() ? "Yes" : "No",
target->IsTrackable() ? "Yes" : "No",
target->IsUnderwaterOnly() ? "Yes" : "No"
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Stuck Behavior: {} Fly Mode: {}",
target->GetStuckBehavior(),
static_cast<int>(target->GetFlyMode())
).c_str()
);
client->Message(
Chat::White,
fmt::format(
"Spawn | Aggro NPCs: {} Always Aggro: {}",
target->GetNPCAggro() ? "Yes" : "No",
target->GetAlwaysAggro() ? "Yes" : "No"
).c_str()
);
// Race / Class / Gender
client->Message(
Chat::White,
fmt::format(
"Race: {} ({}) Class: {} ({}) Gender: {} ({})",
GetRaceIDName(target->GetRace()),
target->GetRace(),
GetClassIDName(target->GetClass()),
target->GetClass(),
GetGenderName(target->GetGender()),
target->GetGender()
).c_str()
);
// NPC
client->Message(
Chat::White,
fmt::format(
"NPC | ID: {} Entity ID: {} Name: {}{} Level: {}",
target->GetNPCTypeID(),
target->GetID(),
target_name,
(
!target_last_name.empty() ?
fmt::format(" ({})", target_last_name) :
""
),
target->GetLevel()
).c_str()
);
} }
} }