mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
[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:
parent
2910073373
commit
ec4d228dd5
@ -91,11 +91,11 @@ 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 ({}, {}, {})
|
||||||
@ -121,34 +121,35 @@ 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(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Spawn Added | Added spawn from Spawngroup ID {}.",
|
"Spawn Added | Added spawn from Spawngroup ID {}.",
|
||||||
std::stoi(sep->arg[2])
|
std::stoul(sep->arg[2])
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (is_clear_box) {
|
return;
|
||||||
|
} 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()) {
|
||||||
@ -160,40 +161,41 @@ 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
|
||||||
);
|
);
|
||||||
@ -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) ||
|
||||||
@ -229,7 +231,7 @@ 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 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]);
|
||||||
@ -237,7 +239,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
|
|||||||
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,
|
||||||
@ -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,21 +296,18 @@ 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,
|
||||||
@ -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}, {})",
|
||||||
@ -416,31 +408,33 @@ 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()
|
||||||
);
|
)
|
||||||
return;
|
) {
|
||||||
|
c->Message(Chat::White, "Created a new NPC.");
|
||||||
}
|
}
|
||||||
else if (is_move_spawn) {
|
|
||||||
|
return;
|
||||||
|
} 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;
|
||||||
@ -448,7 +442,8 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
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,
|
||||||
@ -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,9 +496,10 @@ 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()
|
||||||
|
|||||||
190
zone/mob.cpp
190
zone/mob.cpp
@ -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()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user