[Commands] Consolidate #show commands into a singular #show command (#3478)

* [Cleanup] Consolidate #show commands into a singular #show command

# Notes
- All `#show` commands like `#showbuffs` are now subcommands of `#show`.
- All aliases like `#showbuffs` still function.

* Push up progress.

* Final push.

* Cleanup.

* Update ip_lookup.cpp

* emotes not emote

* Cleanup

* Update servertalk.h

* Update show.cpp

* Fix

* Final push.

* #aggro

* #who
This commit is contained in:
Alex King 2023-07-08 11:06:25 -04:00 committed by GitHub
parent d4962bb2ab
commit e55fb1cafd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
90 changed files with 2767 additions and 2591 deletions

View File

@ -1824,6 +1824,11 @@ struct ServerOOCMute_Struct {
bool is_muted; bool is_muted;
}; };
struct ServerZoneStatus_Struct {
char name[64];
int16 admin;
};
#pragma pack() #pragma pack()
#endif #endif

View File

@ -748,7 +748,8 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
} }
case ServerOP_ZoneStatus: { case ServerOP_ZoneStatus: {
if (pack->size >= 1) { if (pack->size >= 1) {
zoneserver_list.SendZoneStatus((char *)&pack->pBuffer[1], (uint8)pack->pBuffer[0], this); auto z = (ServerZoneStatus_Struct*) pack->pBuffer;
zoneserver_list.SendZoneStatus(z->name, z->admin, this);
} }
break; break;

View File

@ -6779,16 +6779,14 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
void Client::Handle_OP_GMServers(const EQApplicationPacket *app) void Client::Handle_OP_GMServers(const EQApplicationPacket *app)
{ {
if (!worldserver.Connected()) auto pack = new ServerPacket(ServerOP_ZoneStatus, sizeof(ServerZoneStatus_Struct));
Message(Chat::Red, "Error: World server disconnected");
else { auto z = (ServerZoneStatus_Struct *) pack->pBuffer;
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(GetName()) + 2); z->admin = Admin();
memset(pack->pBuffer, (uint8)admin, 1); strn0cpy(z->name, GetName(), sizeof(z->name));
strcpy((char *)&pack->pBuffer[1], GetName());
worldserver.SendPacket(pack); worldserver.SendPacket(pack);
safe_delete(pack); delete pack;
}
return;
} }
void Client::Handle_OP_GMSummon(const EQApplicationPacket *app) void Client::Handle_OP_GMSummon(const EQApplicationPacket *app)

View File

@ -86,7 +86,6 @@ int command_init(void)
if ( if (
command_add("acceptrules", "[acceptrules] - Accept the EQEmu Agreement", AccountStatus::Player, command_acceptrules) || command_add("acceptrules", "[acceptrules] - Accept the EQEmu Agreement", AccountStatus::Player, command_acceptrules) ||
command_add("advnpcspawn", "[maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]", AccountStatus::GMLeadAdmin, command_advnpcspawn) || command_add("advnpcspawn", "[maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]", AccountStatus::GMLeadAdmin, command_advnpcspawn) ||
command_add("aggro", "[Distance] [-v] - Display aggro information for all mobs 'Distance' distance from your target. (-v is verbose Faction Information)", AccountStatus::QuestTroupe, command_aggro) ||
command_add("aggrozone", "[aggro] - Aggro every mob in the zone with X aggro. Default is 0. Not recommend if you're not invulnerable.", AccountStatus::GMAdmin, command_aggrozone) || command_add("aggrozone", "[aggro] - Aggro every mob in the zone with X aggro. Default is 0. Not recommend if you're not invulnerable.", AccountStatus::GMAdmin, command_aggrozone) ||
command_add("ai", "[factionid/spellslist/con/guard/roambox/stop/start] - Modify AI on NPC target", AccountStatus::GMAdmin, command_ai) || command_add("ai", "[factionid/spellslist/con/guard/roambox/stop/start] - Modify AI on NPC target", AccountStatus::GMAdmin, command_ai) ||
command_add("appearance", "[type] [value] - Send an appearance packet for you or your target", AccountStatus::GMLeadAdmin, command_appearance) || command_add("appearance", "[type] [value] - Send an appearance packet for you or your target", AccountStatus::GMLeadAdmin, command_appearance) ||
@ -101,12 +100,10 @@ int command_init(void)
command_add("camerashake", "[Duration (Milliseconds)] [Intensity (1-10)] - Shakes the camera on everyone's screen globally.", AccountStatus::QuestTroupe, command_camerashake) || command_add("camerashake", "[Duration (Milliseconds)] [Intensity (1-10)] - Shakes the camera on everyone's screen globally.", AccountStatus::QuestTroupe, command_camerashake) ||
command_add("castspell", "[Spell ID] [Instant (0 = False, 1 = True, Default is 1 if Unused)] - Cast a spell", AccountStatus::Guide, command_castspell) || command_add("castspell", "[Spell ID] [Instant (0 = False, 1 = True, Default is 1 if Unused)] - Cast a spell", AccountStatus::Guide, command_castspell) ||
command_add("chat", "[Channel ID] [Message] - Send a channel message to all zones", AccountStatus::GMMgmt, command_chat) || command_add("chat", "[Channel ID] [Message] - Send a channel message to all zones", AccountStatus::GMMgmt, command_chat) ||
command_add("checklos", "Check for line of sight to your target", AccountStatus::Guide, command_checklos) ||
command_add("copycharacter", "[source_char_name] [dest_char_name] [dest_account_name] - Copies character to destination account", AccountStatus::GMImpossible, command_copycharacter) || command_add("copycharacter", "[source_char_name] [dest_char_name] [dest_account_name] - Copies character to destination account", AccountStatus::GMImpossible, command_copycharacter) ||
command_add("corpse", "Manipulate corpses, use with no arguments for help", AccountStatus::Guide, command_corpse) || command_add("corpse", "Manipulate corpses, use with no arguments for help", AccountStatus::Guide, command_corpse) ||
command_add("corpsefix", "Attempts to bring corpses from underneath the ground within close proximity of the player", AccountStatus::Player, command_corpsefix) || command_add("corpsefix", "Attempts to bring corpses from underneath the ground within close proximity of the player", AccountStatus::Player, command_corpsefix) ||
command_add("countitem", "[Item ID] - Counts the specified Item ID in your or your target's inventory", AccountStatus::GMLeadAdmin, command_countitem) || command_add("countitem", "[Item ID] - Counts the specified Item ID in your or your target's inventory", AccountStatus::GMLeadAdmin, command_countitem) ||
command_add("cvs", "Summary of client versions currently online.", AccountStatus::GMMgmt, command_cvs) ||
command_add("damage", "[Amount] - Damage yourself or your target", AccountStatus::GMAdmin, command_damage) || command_add("damage", "[Amount] - Damage yourself or your target", AccountStatus::GMAdmin, command_damage) ||
command_add("databuckets", "View|Delete [key] [limit]- View data buckets, limit 50 default or Delete databucket by key", AccountStatus::QuestTroupe, command_databuckets) || command_add("databuckets", "View|Delete [key] [limit]- View data buckets, limit 50 default or Delete databucket by key", AccountStatus::QuestTroupe, command_databuckets) ||
command_add("date", "[Year] [Month] [Day] [Hour] [Minute] - Set EQ time (Hour and Minute are optional)", AccountStatus::EQSupport, command_date) || command_add("date", "[Year] [Month] [Day] [Hour] [Minute] - Set EQ time (Hour and Minute are optional)", AccountStatus::EQSupport, command_date) ||
@ -118,7 +115,6 @@ int command_init(void)
command_add("devtools", "[Enable|Disable] - Manages Developer Tools (send no parameter for menu)", AccountStatus::GMMgmt, command_devtools) || command_add("devtools", "[Enable|Disable] - Manages Developer Tools (send no parameter for menu)", AccountStatus::GMMgmt, command_devtools) ||
command_add("disablerecipe", "[Recipe ID] - Disables a Recipe", AccountStatus::QuestTroupe, command_disablerecipe) || command_add("disablerecipe", "[Recipe ID] - Disables a Recipe", AccountStatus::QuestTroupe, command_disablerecipe) ||
command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) || command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) ||
command_add("distance", "Reports the distance between you and your target.", AccountStatus::QuestTroupe, command_distance) ||
command_add("door", "Door editing command", AccountStatus::QuestTroupe, command_door) || command_add("door", "Door editing command", AccountStatus::QuestTroupe, command_door) ||
command_add("doanim", "[Animation ID|Animation Name] [Speed] - Send an animation by ID or name at the specified speed to you or your target (Speed is optional)", AccountStatus::Guide, command_doanim) || command_add("doanim", "[Animation ID|Animation Name] [Speed] - Send an animation by ID or name at the specified speed to you or your target (Speed is optional)", AccountStatus::Guide, command_doanim) ||
command_add("dye", "[slot|'help'] [red] [green] [blue] [use_tint] - Dyes the specified armor slot to Red, Green, and Blue provided, allows you to bypass darkness limits.", AccountStatus::ApprenticeGuide, command_dye) || command_add("dye", "[slot|'help'] [red] [green] [blue] [use_tint] - Dyes the specified armor slot to Red, Green, and Blue provided, allows you to bypass darkness limits.", AccountStatus::ApprenticeGuide, command_dye) ||
@ -126,7 +122,6 @@ int command_init(void)
command_add("dzkickplayers", "Removes all players from current expedition. (/kickplayers alternative for pre-RoF clients)", AccountStatus::Player, command_dzkickplayers) || command_add("dzkickplayers", "Removes all players from current expedition. (/kickplayers alternative for pre-RoF clients)", AccountStatus::Player, command_dzkickplayers) ||
command_add("editmassrespawn", "[name-search] [second-value] - Mass (Zone wide) NPC respawn timer editing command", AccountStatus::GMAdmin, command_editmassrespawn) || command_add("editmassrespawn", "[name-search] [second-value] - Mass (Zone wide) NPC respawn timer editing command", AccountStatus::GMAdmin, command_editmassrespawn) ||
command_add("emote", "[Name|World|Zone] [type] [message] - Send an emote message by name, to the world, or to your zone (^ separator allows multiple messages to be sent at once)", AccountStatus::QuestTroupe, command_emote) || command_add("emote", "[Name|World|Zone] [type] [message] - Send an emote message by name, to the world, or to your zone (^ separator allows multiple messages to be sent at once)", AccountStatus::QuestTroupe, command_emote) ||
command_add("emoteview", "Lists all NPC Emotes", AccountStatus::QuestTroupe, command_emoteview) ||
command_add("emptyinventory", "Clears your or your target's entire inventory (Equipment, General, Bank, and Shared Bank)", AccountStatus::GMImpossible, command_emptyinventory) || command_add("emptyinventory", "Clears your or your target's entire inventory (Equipment, General, Bank, and Shared Bank)", AccountStatus::GMImpossible, command_emptyinventory) ||
command_add("enablerecipe", "[Recipe ID] - Enables a Recipe", AccountStatus::QuestTroupe, command_enablerecipe) || command_add("enablerecipe", "[Recipe ID] - Enables a Recipe", AccountStatus::QuestTroupe, command_enablerecipe) ||
command_add("endurance", "Restores your or your target's endurance.", AccountStatus::Guide, command_endurance) || command_add("endurance", "Restores your or your target's endurance.", AccountStatus::Guide, command_endurance) ||
@ -140,19 +135,13 @@ int command_init(void)
command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) || command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) ||
command_add("flag", "[Status] [Account Name] - Refresh your admin status, or set an account's Admin status if arguments provided", AccountStatus::Player, command_flag) || command_add("flag", "[Status] [Account Name] - Refresh your admin status, or set an account's Admin status if arguments provided", AccountStatus::Player, command_flag) ||
command_add("flagedit", "Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) || command_add("flagedit", "Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) ||
command_add("flags", "displays the Zone Flags of you or your target", AccountStatus::Player, command_flags) ||
command_add("flymode", "[0/1/2/3/4/5] - Set your or your player target's flymode to ground/flying/levitate/water/floating/levitate_running", AccountStatus::Guide, command_flymode) || command_add("flymode", "[0/1/2/3/4/5] - Set your or your player target's flymode to ground/flying/levitate/water/floating/levitate_running", AccountStatus::Guide, command_flymode) ||
command_add("fov", "Check wether you're behind or in your target's field of view", AccountStatus::QuestTroupe, command_fov) ||
command_add("freeze", "Freeze your target", AccountStatus::QuestTroupe, command_freeze) || command_add("freeze", "Freeze your target", AccountStatus::QuestTroupe, command_freeze) ||
command_add("gassign", "[Grid ID] - Assign targetted NPC to predefined wandering grid id", AccountStatus::GMAdmin, command_gassign) || command_add("gassign", "[Grid ID] - Assign targetted NPC to predefined wandering grid id", AccountStatus::GMAdmin, command_gassign) ||
command_add("gearup", "Developer tool to quickly equip yourself or your target", AccountStatus::GMMgmt, command_gearup) || command_add("gearup", "Developer tool to quickly equip yourself or your target", AccountStatus::GMMgmt, command_gearup) ||
command_add("gender", "[0/1/2] - Change your or your target's gender to male/female/neuter", AccountStatus::Guide, command_gender) || command_add("gender", "[0/1/2] - Change your or your target's gender to male/female/neuter", AccountStatus::Guide, command_gender) ||
command_add("getplayerburiedcorpsecount", "Get your or your target's total number of buried player corpses.", AccountStatus::GMAdmin, command_getplayerburiedcorpsecount) ||
command_add("getvariable", "[Variable Name] - Get the value of a variable from the database", AccountStatus::GMMgmt, command_getvariable) ||
command_add("ginfo", "get group info on target.", AccountStatus::ApprenticeGuide, command_ginfo) ||
command_add("giveitem", "[itemid] [charges] - Summon an item onto your target's cursor. Charges are optional.", AccountStatus::GMMgmt, command_giveitem) || command_add("giveitem", "[itemid] [charges] - Summon an item onto your target's cursor. Charges are optional.", AccountStatus::GMMgmt, command_giveitem) ||
command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) || command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) ||
command_add("globalview", "Lists all qglobals in cache if you were to do a quest with this target.", AccountStatus::QuestTroupe, command_globalview) ||
command_add("gm", "[On|Off] - Modify your or your target's GM Flag", AccountStatus::QuestTroupe, command_gm) || command_add("gm", "[On|Off] - Modify your or your target's GM Flag", AccountStatus::QuestTroupe, command_gm) ||
command_add("gmspeed", "[On|Off] - Turn GM Speed On or Off for you or your player target", AccountStatus::GMAdmin, command_gmspeed) || command_add("gmspeed", "[On|Off] - Turn GM Speed On or Off for you or your player target", AccountStatus::GMAdmin, command_gmspeed) ||
command_add("gmzone", "[Zone ID|Zone Short Name] [Version] [Instance Identifier] - Zones to a private GM instance (Version defaults to 0 and Instance Identifier defaults to 'gmzone' if not used)", AccountStatus::GMAdmin, command_gmzone) || command_add("gmzone", "[Zone ID|Zone Short Name] [Version] [Instance Identifier] - Zones to a private GM instance (Version defaults to 0 and Instance Identifier defaults to 'gmzone' if not used)", AccountStatus::GMAdmin, command_gmzone) ||
@ -161,7 +150,6 @@ int command_init(void)
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) || command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
command_add("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) || command_add("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) ||
command_add("haste", "[Percentage] - Set your or your target's GM Bonus Haste (100 is 100% more Attack Speed)", AccountStatus::GMAdmin, command_haste) || command_add("haste", "[Percentage] - Set your or your target's GM Bonus Haste (100 is 100% more Attack Speed)", AccountStatus::GMAdmin, command_haste) ||
command_add("hatelist", "Display hate list for NPC.", AccountStatus::QuestTroupe, command_hatelist) ||
command_add("heal", "Completely heal your target", AccountStatus::Steward, command_heal) || command_add("heal", "Completely heal your target", AccountStatus::Steward, command_heal) ||
command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) || command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) ||
command_add("heromodel", "[Hero Model] [Slot] - Set your or your target's appearance to a full set of Hero's Forge Armor, if slot is set, sends exact model just to slot.", AccountStatus::GMMgmt, command_heromodel) || command_add("heromodel", "[Hero Model] [Slot] - Set your or your target's appearance to a full set of Hero's Forge Armor, if slot is set, sends exact model just to slot.", AccountStatus::GMMgmt, command_heromodel) ||
@ -175,14 +163,12 @@ int command_init(void)
command_add("invsnapshot", "Manipulates inventory snapshots for your current target", AccountStatus::QuestTroupe, command_invsnapshot) || command_add("invsnapshot", "Manipulates inventory snapshots for your current target", AccountStatus::QuestTroupe, command_invsnapshot) ||
command_add("invul", "[On|Off]] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) || command_add("invul", "[On|Off]] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) ||
command_add("ipban", "[IP] - Ban IP", AccountStatus::GMMgmt, command_ipban) || command_add("ipban", "[IP] - Ban IP", AccountStatus::GMMgmt, command_ipban) ||
command_add("iplookup", "[charname] - Look up IP address of charname", AccountStatus::GMMgmt, command_iplookup) ||
command_add("kick", "[Character Name] - Disconnect a player by name", AccountStatus::GMLeadAdmin, command_kick) || command_add("kick", "[Character Name] - Disconnect a player by name", AccountStatus::GMLeadAdmin, command_kick) ||
command_add("kill", "Kill your target", AccountStatus::GMAdmin, command_kill) || command_add("kill", "Kill your target", AccountStatus::GMAdmin, command_kill) ||
command_add("killallnpcs", "[npc_name] - Kills all npcs by search name, leave blank for all attackable NPC's", AccountStatus::GMMgmt, command_killallnpcs) || command_add("killallnpcs", "[npc_name] - Kills all npcs by search name, leave blank for all attackable NPC's", AccountStatus::GMMgmt, command_killallnpcs) ||
command_add("lastname", "[Last Name] - Set your or your player target's last name (use \"-1\" to remove last name)", AccountStatus::Guide, command_lastname) || command_add("lastname", "[Last Name] - Set your or your player target's last name (use \"-1\" to remove last name)", AccountStatus::Guide, command_lastname) ||
command_add("level", "[Level] - Set your or your target's level", AccountStatus::Steward, command_level) || command_add("level", "[Level] - Set your or your target's level", AccountStatus::Steward, command_level) ||
command_add("list", "[npcs|players|corpses|doors|objects] [search] - Search entities", AccountStatus::ApprenticeGuide, command_list) || command_add("list", "[npcs|players|corpses|doors|objects] [search] - Search entities", AccountStatus::ApprenticeGuide, command_list) ||
command_add("listpetition", "List petitions", AccountStatus::Guide, command_listpetition) ||
command_add("lootsim", "[npc_type_id] [loottable_id] [iterations] - Runs benchmark simulations using real loot logic to report numbers and data", AccountStatus::GMImpossible, command_lootsim) || command_add("lootsim", "[npc_type_id] [loottable_id] [iterations] - Runs benchmark simulations using real loot logic to report numbers and data", AccountStatus::GMImpossible, command_lootsim) ||
command_add("load_shared_memory", "[shared_memory_name] - Reloads shared memory and uses the input as output", AccountStatus::GMImpossible, command_load_shared_memory) || command_add("load_shared_memory", "[shared_memory_name] - Reloads shared memory and uses the input as output", AccountStatus::GMImpossible, command_load_shared_memory) ||
command_add("loc", "Print out your or your target's current location and heading", AccountStatus::Player, command_loc) || command_add("loc", "Print out your or your target's current location and heading", AccountStatus::Player, command_loc) ||
@ -200,8 +186,6 @@ int command_init(void)
command_add("mysql", "[Help|Query] [SQL Query] - Mysql CLI, see 'Help' for options.", AccountStatus::GMImpossible, command_mysql) || command_add("mysql", "[Help|Query] [SQL Query] - Mysql CLI, see 'Help' for options.", AccountStatus::GMImpossible, command_mysql) ||
command_add("mystats", "Show details about you or your pet", AccountStatus::Guide, command_mystats) || command_add("mystats", "Show details about you or your pet", AccountStatus::Guide, command_mystats) ||
command_add("name", "[New Name] - Rename your player target", AccountStatus::GMLeadAdmin, command_name) || command_add("name", "[New Name] - Rename your player target", AccountStatus::GMLeadAdmin, command_name) ||
command_add("netstats", "Gets the network stats for a stream.", AccountStatus::GMMgmt, command_netstats) ||
command_add("network", "Admin commands for the udp network interface.", AccountStatus::GMImpossible, command_network) ||
command_add("npccast", "[targetname/entityid] [spellid] - Causes NPC target to cast spellid on targetname/entityid", AccountStatus::QuestTroupe, command_npccast) || command_add("npccast", "[targetname/entityid] [spellid] - Causes NPC target to cast spellid on targetname/entityid", AccountStatus::QuestTroupe, command_npccast) ||
command_add("npcedit", "[column] [value] - Mega NPC editing command", AccountStatus::GMAdmin, command_npcedit) || command_add("npcedit", "[column] [value] - Mega NPC editing command", AccountStatus::GMAdmin, command_npcedit) ||
command_add("npceditmass", "[name-search] [column] [value] - Mass (Zone wide) NPC data editing command", AccountStatus::GMAdmin, command_npceditmass) || command_add("npceditmass", "[name-search] [column] [value] - Mass (Zone wide) NPC data editing command", AccountStatus::GMAdmin, command_npceditmass) ||
@ -210,7 +194,6 @@ int command_init(void)
command_add("npcsay", "[Message] - Make your NPC target say a message.", AccountStatus::GMLeadAdmin, command_npcsay) || command_add("npcsay", "[Message] - Make your NPC target say a message.", AccountStatus::GMLeadAdmin, command_npcsay) ||
command_add("npcshout", "[Message] - Make your NPC target shout a message.", AccountStatus::GMLeadAdmin, command_npcshout) || command_add("npcshout", "[Message] - Make your NPC target shout a message.", AccountStatus::GMLeadAdmin, command_npcshout) ||
command_add("npcspawn", "[create/add/update/remove/delete] - Manipulate spawn DB", AccountStatus::GMAreas, command_npcspawn) || command_add("npcspawn", "[create/add/update/remove/delete] - Manipulate spawn DB", AccountStatus::GMAreas, command_npcspawn) ||
command_add("npcstats", "Show stats about target NPC", AccountStatus::QuestTroupe, command_npcstats) ||
command_add("npctypespawn", "[NPC ID] [Faction ID] - Spawn an NPC by ID from the database with an option of setting its Faction ID", AccountStatus::Steward, command_npctypespawn) || command_add("npctypespawn", "[NPC ID] [Faction ID] - Spawn an NPC by ID from the database with an option of setting its Faction ID", AccountStatus::Steward, command_npctypespawn) ||
command_add("nudge", "Nudge your target's current position by specific values", AccountStatus::QuestTroupe, command_nudge) || command_add("nudge", "Nudge your target's current position by specific values", AccountStatus::QuestTroupe, command_nudge) ||
command_add("nukebuffs", "[Beneficial|Detrimental|Help] - Strip all buffs by type on you or your target (no argument to remove all buffs)", AccountStatus::Guide, command_nukebuffs) || command_add("nukebuffs", "[Beneficial|Detrimental|Help] - Strip all buffs by type on you or your target (no argument to remove all buffs)", AccountStatus::Guide, command_nukebuffs) ||
@ -219,21 +202,16 @@ int command_init(void)
command_add("oocmute", "[0|1] - Enable or Disable Server OOC", AccountStatus::GMMgmt, command_oocmute) || command_add("oocmute", "[0|1] - Enable or Disable Server OOC", AccountStatus::GMMgmt, command_oocmute) ||
command_add("opcode", "Reloads all opcodes from server patch files", AccountStatus::GMMgmt, command_reload) || command_add("opcode", "Reloads all opcodes from server patch files", AccountStatus::GMMgmt, command_reload) ||
command_add("path", "view and edit pathing", AccountStatus::GMMgmt, command_path) || command_add("path", "view and edit pathing", AccountStatus::GMMgmt, command_path) ||
command_add("peekinv", "[equip/gen/cursor/poss/limbo/curlim/trib/bank/shbank/allbank/trade/world/all] - Print out contents of your player target's inventory", AccountStatus::GMAdmin, command_peekinv) ||
command_add("peqzone", "[Zone ID|Zone Short Name] - Teleports you to the specified zone if you meet the requirements.", AccountStatus::Player, command_peqzone) || command_add("peqzone", "[Zone ID|Zone Short Name] - Teleports you to the specified zone if you meet the requirements.", AccountStatus::Player, command_peqzone) ||
command_add("peqzone_flags", "displays the PEQZone Flags of you or your target", AccountStatus::Player, command_peqzone_flags) ||
command_add("permaclass", "[Class ID] - Change your or your player target's class, changed client is disconnected", AccountStatus::QuestTroupe, command_permaclass) || command_add("permaclass", "[Class ID] - Change your or your player target's class, changed client is disconnected", AccountStatus::QuestTroupe, command_permaclass) ||
command_add("permagender", "[Gender ID] - Change your or your player target's gender", AccountStatus::QuestTroupe, command_permagender) || command_add("permagender", "[Gender ID] - Change your or your player target's gender", AccountStatus::QuestTroupe, command_permagender) ||
command_add("permarace", "[Race ID] - Change your or your player target's race", AccountStatus::QuestTroupe, command_permarace) || command_add("permarace", "[Race ID] - Change your or your player target's race", AccountStatus::QuestTroupe, command_permarace) ||
command_add("petitems", "View your pet's items if you have one", AccountStatus::ApprenticeGuide, command_petitems) || command_add("petitems", "View your pet's items if you have one", AccountStatus::ApprenticeGuide, command_petitems) ||
command_add("petitioninfo", "[petition number] - Get info about a petition", AccountStatus::ApprenticeGuide, command_petitioninfo) ||
command_add("picklock", "Analog for ldon pick lock for the newer clients since we still don't have it working.", AccountStatus::Player, command_picklock) || command_add("picklock", "Analog for ldon pick lock for the newer clients since we still don't have it working.", AccountStatus::Player, command_picklock) ||
command_add("profanity", "Manage censored language.", AccountStatus::GMLeadAdmin, command_profanity) || command_add("profanity", "Manage censored language.", AccountStatus::GMLeadAdmin, command_profanity) ||
command_add("push", "[Back Push] [Up Push] - Lets you do spell push on an NPC", AccountStatus::GMLeadAdmin, command_push) || command_add("push", "[Back Push] [Up Push] - Lets you do spell push on an NPC", AccountStatus::GMLeadAdmin, command_push) ||
command_add("proximity", "Shows NPC proximity", AccountStatus::GMLeadAdmin, command_proximity) ||
command_add("pvp", "[On|Off] - Set you or your player target's PVP status", AccountStatus::GMAdmin, command_pvp) || command_add("pvp", "[On|Off] - Set you or your player target's PVP status", AccountStatus::GMAdmin, command_pvp) ||
command_add("qglobal", "[On|Off|View] - Toggles quest global functionality for your NPC target", AccountStatus::GMAdmin, command_qglobal) || command_add("qglobal", "[On|Off|View] - Toggles quest global functionality for your NPC target", AccountStatus::GMAdmin, command_qglobal) ||
command_add("questerrors", "Shows quest errors.", AccountStatus::GMAdmin, command_questerrors) ||
command_add("race", "[racenum] - Change your or your target's race. Use racenum 0 to return to normal", AccountStatus::Guide, command_race) || command_add("race", "[racenum] - Change your or your target's race. Use racenum 0 to return to normal", AccountStatus::Guide, command_race) ||
command_add("raidloot", "[All|GroupLeader|RaidLeader|Selected] - Sets your Raid Loot Type if you have permission to do so.", AccountStatus::Player, command_raidloot) || command_add("raidloot", "[All|GroupLeader|RaidLeader|Selected] - Sets your Raid Loot Type if you have permission to do so.", AccountStatus::Player, command_raidloot) ||
command_add("randomfeatures", "Temporarily randomizes the Facial Features of your target", AccountStatus::QuestTroupe, command_randomfeatures) || command_add("randomfeatures", "Temporarily randomizes the Facial Features of your target", AccountStatus::QuestTroupe, command_randomfeatures) ||
@ -255,7 +233,6 @@ int command_init(void)
command_add("scribespells", "[Max level] [Min level] - Scribe all spells for you or your player target that are usable by them, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_scribespells) || command_add("scribespells", "[Max level] [Min level] - Scribe all spells for you or your player target that are usable by them, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_scribespells) ||
command_add("sendzonespawns", "Refresh spawn list for all clients in zone", AccountStatus::GMLeadAdmin, command_sendzonespawns) || command_add("sendzonespawns", "Refresh spawn list for all clients in zone", AccountStatus::GMLeadAdmin, command_sendzonespawns) ||
command_add("sensetrap", "Analog for ldon sense trap for the newer clients since we still don't have it working.", AccountStatus::Player, command_sensetrap) || command_add("sensetrap", "Analog for ldon sense trap for the newer clients since we still don't have it working.", AccountStatus::Player, command_sensetrap) ||
command_add("serverinfo", "Get CPU, Operating System, and Process Information about the server", AccountStatus::GMMgmt, command_serverinfo) ||
command_add("serverlock", "[0|1] - Lock or Unlock the World Server (0 = Unlocked, 1 = Locked)", AccountStatus::GMLeadAdmin, command_serverlock) || command_add("serverlock", "[0|1] - Lock or Unlock the World Server (0 = Unlocked, 1 = Locked)", AccountStatus::GMLeadAdmin, command_serverlock) ||
command_add("serverrules", "Read this server's rules", AccountStatus::Player, command_serverrules) || command_add("serverrules", "Read this server's rules", AccountStatus::Player, command_serverrules) ||
command_add("setaapts", "[AA|Group|Raid] [AA Amount] - Set your or your player target's Available AA Points by Type", AccountStatus::GMAdmin, command_setaapts) || command_add("setaapts", "[AA|Group|Raid] [AA Amount] - Set your or your player target's Available AA Points by Type", AccountStatus::GMAdmin, command_setaapts) ||
@ -278,19 +255,11 @@ int command_init(void)
command_add("setstartzone", "[Zone ID|Zone Short Name] - Sets your or your target's starting zone (Use '0' or 'Reset' to allow the player use of /setstartcity)", AccountStatus::QuestTroupe, command_setstartzone) || command_add("setstartzone", "[Zone ID|Zone Short Name] - Sets your or your target's starting zone (Use '0' or 'Reset' to allow the player use of /setstartcity)", AccountStatus::QuestTroupe, command_setstartzone) ||
command_add("setstat", "Sets the stats to a specific value.", AccountStatus::Max, command_setstat) || command_add("setstat", "Sets the stats to a specific value.", AccountStatus::Max, command_setstat) ||
command_add("setxp", "[value] - Set your or your player target's experience", AccountStatus::GMAdmin, command_setxp) || command_add("setxp", "[value] - Set your or your player target's experience", AccountStatus::GMAdmin, command_setxp) ||
command_add("showbuffs", "List buffs active on your target or you if no target", AccountStatus::Guide, command_showbuffs) || command_add("show", "List command used to show various things", AccountStatus::Guide, command_show) ||
command_add("shownpcgloballoot", "Show global loot entries for your target NPC", AccountStatus::Guide, command_shownpcgloballoot) ||
command_add("showskills", "[Start Skill ID] [All] - Show the values of your or your player target's skills in a popup 50 at a time, use 'all' as second argument to show non-usable skill's values", AccountStatus::Guide, command_showskills) ||
command_add("showspells", "[disciplines|spells] - Show your or your target's memorized spells or learned disciplines", AccountStatus::GMAdmin, command_showspells) ||
command_add("showspellslist", "Shows spell list of targeted NPC", AccountStatus::GMAdmin, command_showspellslist) ||
command_add("showstats", "Show details about you or your target", AccountStatus::Guide, command_showstats) ||
command_add("showzonegloballoot", "Show global loot entries for your current zone", AccountStatus::Guide, command_showzonegloballoot) ||
command_add("showzonepoints", "Show zone points for current zone", AccountStatus::Guide, command_showzonepoints) ||
command_add("shutdown", "Shut this zone process down", AccountStatus::GMLeadAdmin, command_shutdown) || command_add("shutdown", "Shut this zone process down", AccountStatus::GMLeadAdmin, command_shutdown) ||
command_add("spawn", "[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC", AccountStatus::Steward, command_spawn) || command_add("spawn", "[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC", AccountStatus::Steward, command_spawn) ||
command_add("spawneditmass", "[Search Criteria] [Edit Option] [Edit Value] [Apply] Mass editing spawn command (Apply is optional, 0 = False, 1 = True, default is False)", AccountStatus::GMLeadAdmin, command_spawneditmass) || command_add("spawneditmass", "[Search Criteria] [Edit Option] [Edit Value] [Apply] Mass editing spawn command (Apply is optional, 0 = False, 1 = True, default is False)", AccountStatus::GMLeadAdmin, command_spawneditmass) ||
command_add("spawnfix", "Find targeted NPC in database based on its X/Y/heading and update the database to make it spawn at your current location/heading.", AccountStatus::GMAreas, command_spawnfix) || command_add("spawnfix", "Find targeted NPC in database based on its X/Y/heading and update the database to make it spawn at your current location/heading.", AccountStatus::GMAreas, command_spawnfix) ||
command_add("spawnstatus", "[All|Disabled|Enabled|Spawn ID] - Show respawn timer status", AccountStatus::GMAdmin, command_spawnstatus) ||
command_add("stun", "[duration] - Stuns you or your target for duration", AccountStatus::GMAdmin, command_stun) || command_add("stun", "[duration] - Stuns you or your target for duration", AccountStatus::GMAdmin, command_stun) ||
command_add("summon", "[Character Name] - Summons your corpse, NPC, or player target, or by character name if specified", AccountStatus::QuestTroupe, command_summon) || command_add("summon", "[Character Name] - Summons your corpse, NPC, or player target, or by character name if specified", AccountStatus::QuestTroupe, command_summon) ||
command_add("summonburiedplayercorpse", "Summons the target's oldest buried corpse, if any exist.", AccountStatus::GMAdmin, command_summonburiedplayercorpse) || command_add("summonburiedplayercorpse", "Summons the target's oldest buried corpse, if any exist.", AccountStatus::GMAdmin, command_summonburiedplayercorpse) ||
@ -302,12 +271,10 @@ int command_init(void)
command_add("petname", "[newname] - Temporarily renames your pet. Leave name blank to restore the original name.", AccountStatus::GMAdmin, command_petname) || command_add("petname", "[newname] - Temporarily renames your pet. Leave name blank to restore the original name.", AccountStatus::GMAdmin, command_petname) ||
command_add("texture", "[Texture] [Helmet Texture] - Change your or your target's texture (Helmet Texture defaults to 0 if not used)", AccountStatus::Steward, command_texture) || command_add("texture", "[Texture] [Helmet Texture] - Change your or your target's texture (Helmet Texture defaults to 0 if not used)", AccountStatus::Steward, command_texture) ||
command_add("time", "[Hour] [Minute] - Set world time to specified time", AccountStatus::EQSupport, command_time) || command_add("time", "[Hour] [Minute] - Set world time to specified time", AccountStatus::EQSupport, command_time) ||
command_add("timers", "Display persistent timers for target", AccountStatus::GMMgmt, command_timers) ||
command_add("timezone", "[Hour] [Minutes] - Set timezone (Minutes are optional)", AccountStatus::EQSupport, command_timezone) || command_add("timezone", "[Hour] [Minutes] - Set timezone (Minutes are optional)", AccountStatus::EQSupport, command_timezone) ||
command_add("title", "[Title] - Set your or your player target's title (use \"-1\" to remove title)", AccountStatus::Guide, command_title) || command_add("title", "[Title] - Set your or your player target's title (use \"-1\" to remove title)", AccountStatus::Guide, command_title) ||
command_add("titlesuffix", "[Title Suffix] - Set your or your player target's title suffix (use \"-1\" to remove title suffix)", AccountStatus::Guide, command_titlesuffix) || command_add("titlesuffix", "[Title Suffix] - Set your or your player target's title suffix (use \"-1\" to remove title suffix)", AccountStatus::Guide, command_titlesuffix) ||
command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_traindisc) || command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_traindisc) ||
command_add("trapinfo", "Gets infomation about the traps currently spawned in the zone.", AccountStatus::QuestTroupe, command_trapinfo) ||
command_add("tune", "Calculate statistical values related to combat.", AccountStatus::GMAdmin, command_tune) || command_add("tune", "Calculate statistical values related to combat.", AccountStatus::GMAdmin, command_tune) ||
command_add("undye", "Remove dye from all of your or your target's armor slots", AccountStatus::GMAdmin, command_undye) || command_add("undye", "Remove dye from all of your or your target's armor slots", AccountStatus::GMAdmin, command_undye) ||
command_add("unfreeze", "Unfreeze your target", AccountStatus::QuestTroupe, command_unfreeze) || command_add("unfreeze", "Unfreeze your target", AccountStatus::QuestTroupe, command_unfreeze) ||
@ -318,22 +285,12 @@ int command_init(void)
command_add("untraindisc", "[Spell ID] - Untrain your or your target's discipline by Spell ID", AccountStatus::GMCoder, command_untraindisc) || command_add("untraindisc", "[Spell ID] - Untrain your or your target's discipline by Spell ID", AccountStatus::GMCoder, command_untraindisc) ||
command_add("untraindiscs", "Untrains all disciplines from your target.", AccountStatus::GMCoder, command_untraindiscs) || command_add("untraindiscs", "Untrains all disciplines from your target.", AccountStatus::GMCoder, command_untraindiscs) ||
command_add("updatechecksum", "update client checksum", AccountStatus::GMImpossible, command_updatechecksum) || command_add("updatechecksum", "update client checksum", AccountStatus::GMImpossible, command_updatechecksum) ||
command_add("uptime", "[zone server id] - Get uptime of worldserver, or zone server if argument provided", AccountStatus::Steward, command_uptime) ||
command_add("version", "Display current version of EQEmu server", AccountStatus::Player, command_version) ||
command_add("viewcurrencies", "View your or your target's currencies", AccountStatus::GMAdmin, command_viewcurrencies) ||
command_add("viewnpctype", "[NPC ID] - Show stats for an NPC by NPC ID", AccountStatus::GMAdmin, command_viewnpctype) ||
command_add("viewpetition", "[petition number] - View a petition", AccountStatus::ApprenticeGuide, command_viewpetition) ||
command_add("viewrecipe", "[Recipe ID] - Show a recipe's entries", AccountStatus::GMAdmin, command_viewrecipe) ||
command_add("viewzoneloot", "[item id] - Allows you to search a zone's loot for a specific item ID. (0 shows all loot in the zone)", AccountStatus::QuestTroupe, command_viewzoneloot) ||
command_add("wc", "[Slot ID] [Material] [Hero Forge Model] [Elite Material] - Sets the specified slot for you or your target to a material, Hero Forge Model and Elite Material are optional", AccountStatus::GMMgmt, command_wc) || command_add("wc", "[Slot ID] [Material] [Hero Forge Model] [Elite Material] - Sets the specified slot for you or your target to a material, Hero Forge Model and Elite Material are optional", AccountStatus::GMMgmt, command_wc) ||
command_add("weather", "[0/1/2/3] (Off/Rain/Snow/Manual) - Change the weather", AccountStatus::QuestTroupe, command_weather) || command_add("weather", "[0/1/2/3] (Off/Rain/Snow/Manual) - Change the weather", AccountStatus::QuestTroupe, command_weather) ||
command_add("who", "[search]", AccountStatus::ApprenticeGuide, command_who) ||
command_add("worldshutdown", "Shut down world and all zones", AccountStatus::GMMgmt, command_worldshutdown) || command_add("worldshutdown", "Shut down world and all zones", AccountStatus::GMMgmt, command_worldshutdown) ||
command_add("wp", "[add|delete] [grid_id] [pause] [waypoint_id] [-h] - Add or delete a waypoint by grid ID. (-h to use current heading)", AccountStatus::GMAreas, command_wp) || command_add("wp", "[add|delete] [grid_id] [pause] [waypoint_id] [-h] - Add or delete a waypoint by grid ID. (-h to use current heading)", AccountStatus::GMAreas, command_wp) ||
command_add("wpadd", "[pause] [-h] - Add your current location as a waypoint to your NPC target's AI path. (-h to use current heading)", AccountStatus::GMAreas, command_wpadd) || command_add("wpadd", "[pause] [-h] - Add your current location as a waypoint to your NPC target's AI path. (-h to use current heading)", AccountStatus::GMAreas, command_wpadd) ||
command_add("wpinfo", "Show waypoint info about your NPC target", AccountStatus::GMAreas, command_wpinfo) ||
command_add("worldwide", "Performs world-wide GM functions such as cast (can be extended for other commands). Use caution", AccountStatus::GMImpossible, command_worldwide) || command_add("worldwide", "Performs world-wide GM functions such as cast (can be extended for other commands). Use caution", AccountStatus::GMImpossible, command_worldwide) ||
command_add("xtargets", "[New Max XTargets] - Show your or your target's XTargets and optionally set max XTargets.", AccountStatus::GMImpossible, command_xtargets) ||
command_add("zclip", "[Minimum Clip] [Maximum Clip] [Fog Minimum Clip] [Fog Maximum Clip] [Permanent (0 = False, 1 = True)] - Change zone clipping", AccountStatus::QuestTroupe, command_zclip) || command_add("zclip", "[Minimum Clip] [Maximum Clip] [Fog Minimum Clip] [Fog Maximum Clip] [Permanent (0 = False, 1 = True)] - Change zone clipping", AccountStatus::QuestTroupe, command_zclip) ||
command_add("zcolor", "[Red] [Green] [Blue] [Permanent (0 = False, 1 = True)] - Change sky color", AccountStatus::QuestTroupe, command_zcolor) || command_add("zcolor", "[Red] [Green] [Blue] [Permanent (0 = False, 1 = True)] - Change sky color", AccountStatus::QuestTroupe, command_zcolor) ||
command_add("zheader", "[Zone ID|Zone Short Name] [Version] - Load a zone header from the database", AccountStatus::QuestTroupe, command_zheader) || command_add("zheader", "[Zone ID|Zone Short Name] [Version] - Load a zone header from the database", AccountStatus::QuestTroupe, command_zheader) ||
@ -342,12 +299,10 @@ int command_init(void)
command_add("zoneinstance", "[Instance ID] [X] [Y] [Z] - Teleport to specified Instance by ID (coordinates are optional)", AccountStatus::Guide, command_zone_instance) || command_add("zoneinstance", "[Instance ID] [X] [Y] [Z] - Teleport to specified Instance by ID (coordinates are optional)", AccountStatus::Guide, command_zone_instance) ||
command_add("zonelock", "[List|Lock|Unlock] [Zone ID|Zone Short Name] - Set or get lock status of a Zone by ID or Short Name", AccountStatus::GMAdmin, command_zonelock) || command_add("zonelock", "[List|Lock|Unlock] [Zone ID|Zone Short Name] - Set or get lock status of a Zone by ID or Short Name", AccountStatus::GMAdmin, command_zonelock) ||
command_add("zoneshutdown", "[shortname] - Shut down a zone server", AccountStatus::GMLeadAdmin, command_zoneshutdown) || command_add("zoneshutdown", "[shortname] - Shut down a zone server", AccountStatus::GMLeadAdmin, command_zoneshutdown) ||
command_add("zonestatus", "Show connected zoneservers, synonymous with /servers", AccountStatus::GMLeadAdmin, command_zonestatus) ||
command_add("zopp", "Troubleshooting command - Sends a fake item packet to you. No server reference is created.", AccountStatus::GMImpossible, command_zopp) || command_add("zopp", "Troubleshooting command - Sends a fake item packet to you. No server reference is created.", AccountStatus::GMImpossible, command_zopp) ||
command_add("zsafecoords", "[X] [Y] [Z] [Heading] [Permanent (0 = False, 1 = True)] - Set the current zone's safe coordinates", AccountStatus::QuestTroupe, command_zsafecoords) || command_add("zsafecoords", "[X] [Y] [Z] [Heading] [Permanent (0 = False, 1 = True)] - Set the current zone's safe coordinates", AccountStatus::QuestTroupe, command_zsafecoords) ||
command_add("zsave", " Saves zheader to the database", AccountStatus::QuestTroupe, command_zsave) || command_add("zsave", " Saves zheader to the database", AccountStatus::QuestTroupe, command_zsave) ||
command_add("zsky", "[Sky Type] [Permanent (0 = False, 1 = True)] - Change zone sky type", AccountStatus::QuestTroupe, command_zsky) || command_add("zsky", "[Sky Type] [Permanent (0 = False, 1 = True)] - Change zone sky type", AccountStatus::QuestTroupe, command_zsky) ||
command_add("zstats", "Show info about zone header", AccountStatus::QuestTroupe, command_zstats) ||
command_add("zunderworld", "[Z] [Permanent (0 = False, 1 = True)] - Change zone underworld Z", AccountStatus::QuestTroupe, command_zunderworld) command_add("zunderworld", "[Z] [Permanent (0 = False, 1 = True)] - Change zone underworld Z", AccountStatus::QuestTroupe, command_zunderworld)
) { ) {
command_deinit(); command_deinit();
@ -393,6 +348,57 @@ int command_init(void)
"findzone", "findzone",
} }
}, },
{
.command = "show",
.aliases = {
"aggro",
"checklos",
"cvs",
"distance",
"emoteview",
"flags",
"fov",
"getplayerburiedcorpsecount",
"getvariable",
"ginfo",
"globalview",
"hatelist",
"iplookup",
"listpetition",
"network",
"netstats",
"npcstats",
"peekinv",
"petitioninfo",
"peqzone_flags",
"proximity",
"questerrors",
"serverinfo",
"showbuffs",
"shownpcgloballoot",
"showskills",
"showspells",
"showspellslist",
"showstats",
"showzonegloballoot",
"showzonepoints",
"spawnstatus",
"timers",
"trapinfo",
"uptime",
"version",
"viewcurrencies",
"viewnpctype",
"viewpetition",
"viewrecipe",
"viewzoneloot",
"who",
"wpinfo",
"xtargets",
"zonestatus",
"zstats"
}
},
}; };
// inject static aliases // inject static aliases
@ -963,7 +969,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/acceptrules.cpp" #include "gm_commands/acceptrules.cpp"
#include "gm_commands/advnpcspawn.cpp" #include "gm_commands/advnpcspawn.cpp"
#include "gm_commands/aggro.cpp"
#include "gm_commands/aggrozone.cpp" #include "gm_commands/aggrozone.cpp"
#include "gm_commands/ai.cpp" #include "gm_commands/ai.cpp"
#include "gm_commands/appearance.cpp" #include "gm_commands/appearance.cpp"
@ -976,12 +981,10 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/camerashake.cpp" #include "gm_commands/camerashake.cpp"
#include "gm_commands/castspell.cpp" #include "gm_commands/castspell.cpp"
#include "gm_commands/chat.cpp" #include "gm_commands/chat.cpp"
#include "gm_commands/checklos.cpp"
#include "gm_commands/copycharacter.cpp" #include "gm_commands/copycharacter.cpp"
#include "gm_commands/corpse.cpp" #include "gm_commands/corpse.cpp"
#include "gm_commands/corpsefix.cpp" #include "gm_commands/corpsefix.cpp"
#include "gm_commands/countitem.cpp" #include "gm_commands/countitem.cpp"
#include "gm_commands/cvs.cpp"
#include "gm_commands/damage.cpp" #include "gm_commands/damage.cpp"
#include "gm_commands/databuckets.cpp" #include "gm_commands/databuckets.cpp"
#include "gm_commands/date.cpp" #include "gm_commands/date.cpp"
@ -993,7 +996,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/devtools.cpp" #include "gm_commands/devtools.cpp"
#include "gm_commands/disablerecipe.cpp" #include "gm_commands/disablerecipe.cpp"
#include "gm_commands/disarmtrap.cpp" #include "gm_commands/disarmtrap.cpp"
#include "gm_commands/distance.cpp"
#include "gm_commands/doanim.cpp" #include "gm_commands/doanim.cpp"
#include "gm_commands/door.cpp" #include "gm_commands/door.cpp"
#include "gm_commands/door_manipulation.cpp" #include "gm_commands/door_manipulation.cpp"
@ -1002,7 +1004,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/dzkickplayers.cpp" #include "gm_commands/dzkickplayers.cpp"
#include "gm_commands/editmassrespawn.cpp" #include "gm_commands/editmassrespawn.cpp"
#include "gm_commands/emote.cpp" #include "gm_commands/emote.cpp"
#include "gm_commands/emoteview.cpp"
#include "gm_commands/emptyinventory.cpp" #include "gm_commands/emptyinventory.cpp"
#include "gm_commands/enablerecipe.cpp" #include "gm_commands/enablerecipe.cpp"
#include "gm_commands/endurance.cpp" #include "gm_commands/endurance.cpp"
@ -1014,19 +1015,13 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/fixmob.cpp" #include "gm_commands/fixmob.cpp"
#include "gm_commands/flag.cpp" #include "gm_commands/flag.cpp"
#include "gm_commands/flagedit.cpp" #include "gm_commands/flagedit.cpp"
#include "gm_commands/flags.cpp"
#include "gm_commands/flymode.cpp" #include "gm_commands/flymode.cpp"
#include "gm_commands/fov.cpp"
#include "gm_commands/freeze.cpp" #include "gm_commands/freeze.cpp"
#include "gm_commands/gassign.cpp" #include "gm_commands/gassign.cpp"
#include "gm_commands/gearup.cpp" #include "gm_commands/gearup.cpp"
#include "gm_commands/gender.cpp" #include "gm_commands/gender.cpp"
#include "gm_commands/getplayerburiedcorpsecount.cpp"
#include "gm_commands/getvariable.cpp"
#include "gm_commands/ginfo.cpp"
#include "gm_commands/giveitem.cpp" #include "gm_commands/giveitem.cpp"
#include "gm_commands/givemoney.cpp" #include "gm_commands/givemoney.cpp"
#include "gm_commands/globalview.cpp"
#include "gm_commands/gm.cpp" #include "gm_commands/gm.cpp"
#include "gm_commands/gmspeed.cpp" #include "gm_commands/gmspeed.cpp"
#include "gm_commands/gmzone.cpp" #include "gm_commands/gmzone.cpp"
@ -1035,7 +1030,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/grid.cpp" #include "gm_commands/grid.cpp"
#include "gm_commands/guild.cpp" #include "gm_commands/guild.cpp"
#include "gm_commands/haste.cpp" #include "gm_commands/haste.cpp"
#include "gm_commands/hatelist.cpp"
#include "gm_commands/heal.cpp" #include "gm_commands/heal.cpp"
#include "gm_commands/heromodel.cpp" #include "gm_commands/heromodel.cpp"
#include "gm_commands/hideme.cpp" #include "gm_commands/hideme.cpp"
@ -1047,14 +1041,12 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/invsnapshot.cpp" #include "gm_commands/invsnapshot.cpp"
#include "gm_commands/invul.cpp" #include "gm_commands/invul.cpp"
#include "gm_commands/ipban.cpp" #include "gm_commands/ipban.cpp"
#include "gm_commands/iplookup.cpp"
#include "gm_commands/kick.cpp" #include "gm_commands/kick.cpp"
#include "gm_commands/kill.cpp" #include "gm_commands/kill.cpp"
#include "gm_commands/killallnpcs.cpp" #include "gm_commands/killallnpcs.cpp"
#include "gm_commands/lastname.cpp" #include "gm_commands/lastname.cpp"
#include "gm_commands/level.cpp" #include "gm_commands/level.cpp"
#include "gm_commands/list.cpp" #include "gm_commands/list.cpp"
#include "gm_commands/listpetition.cpp"
#include "gm_commands/lootsim.cpp" #include "gm_commands/lootsim.cpp"
#include "gm_commands/loc.cpp" #include "gm_commands/loc.cpp"
#include "gm_commands/logs.cpp" #include "gm_commands/logs.cpp"
@ -1071,8 +1063,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/mysql.cpp" #include "gm_commands/mysql.cpp"
#include "gm_commands/mystats.cpp" #include "gm_commands/mystats.cpp"
#include "gm_commands/name.cpp" #include "gm_commands/name.cpp"
#include "gm_commands/netstats.cpp"
#include "gm_commands/network.cpp"
#include "gm_commands/npccast.cpp" #include "gm_commands/npccast.cpp"
#include "gm_commands/npcedit.cpp" #include "gm_commands/npcedit.cpp"
#include "gm_commands/npceditmass.cpp" #include "gm_commands/npceditmass.cpp"
@ -1081,7 +1071,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/npcsay.cpp" #include "gm_commands/npcsay.cpp"
#include "gm_commands/npcshout.cpp" #include "gm_commands/npcshout.cpp"
#include "gm_commands/npcspawn.cpp" #include "gm_commands/npcspawn.cpp"
#include "gm_commands/npcstats.cpp"
#include "gm_commands/npctypespawn.cpp" #include "gm_commands/npctypespawn.cpp"
#include "gm_commands/nudge.cpp" #include "gm_commands/nudge.cpp"
#include "gm_commands/nukebuffs.cpp" #include "gm_commands/nukebuffs.cpp"
@ -1089,22 +1078,17 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/object.cpp" #include "gm_commands/object.cpp"
#include "gm_commands/oocmute.cpp" #include "gm_commands/oocmute.cpp"
#include "gm_commands/path.cpp" #include "gm_commands/path.cpp"
#include "gm_commands/peekinv.cpp"
#include "gm_commands/peqzone.cpp" #include "gm_commands/peqzone.cpp"
#include "gm_commands/peqzone_flags.cpp"
#include "gm_commands/permaclass.cpp" #include "gm_commands/permaclass.cpp"
#include "gm_commands/permagender.cpp" #include "gm_commands/permagender.cpp"
#include "gm_commands/permarace.cpp" #include "gm_commands/permarace.cpp"
#include "gm_commands/petitems.cpp" #include "gm_commands/petitems.cpp"
#include "gm_commands/petitioninfo.cpp"
#include "gm_commands/petname.cpp" #include "gm_commands/petname.cpp"
#include "gm_commands/picklock.cpp" #include "gm_commands/picklock.cpp"
#include "gm_commands/profanity.cpp" #include "gm_commands/profanity.cpp"
#include "gm_commands/proximity.cpp"
#include "gm_commands/push.cpp" #include "gm_commands/push.cpp"
#include "gm_commands/pvp.cpp" #include "gm_commands/pvp.cpp"
#include "gm_commands/qglobal.cpp" #include "gm_commands/qglobal.cpp"
#include "gm_commands/questerrors.cpp"
#include "gm_commands/race.cpp" #include "gm_commands/race.cpp"
#include "gm_commands/raidloot.cpp" #include "gm_commands/raidloot.cpp"
#include "gm_commands/randomfeatures.cpp" #include "gm_commands/randomfeatures.cpp"
@ -1124,7 +1108,6 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/scribespells.cpp" #include "gm_commands/scribespells.cpp"
#include "gm_commands/sendzonespawns.cpp" #include "gm_commands/sendzonespawns.cpp"
#include "gm_commands/sensetrap.cpp" #include "gm_commands/sensetrap.cpp"
#include "gm_commands/serverinfo.cpp"
#include "gm_commands/serverlock.cpp" #include "gm_commands/serverlock.cpp"
#include "gm_commands/serverrules.cpp" #include "gm_commands/serverrules.cpp"
#include "gm_commands/set_adventure_points.cpp" #include "gm_commands/set_adventure_points.cpp"
@ -1147,19 +1130,11 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/setstartzone.cpp" #include "gm_commands/setstartzone.cpp"
#include "gm_commands/setstat.cpp" #include "gm_commands/setstat.cpp"
#include "gm_commands/setxp.cpp" #include "gm_commands/setxp.cpp"
#include "gm_commands/showbuffs.cpp" #include "gm_commands/show.cpp"
#include "gm_commands/shownpcgloballoot.cpp"
#include "gm_commands/showskills.cpp"
#include "gm_commands/showspells.cpp"
#include "gm_commands/showspellslist.cpp"
#include "gm_commands/showstats.cpp"
#include "gm_commands/showzonegloballoot.cpp"
#include "gm_commands/showzonepoints.cpp"
#include "gm_commands/shutdown.cpp" #include "gm_commands/shutdown.cpp"
#include "gm_commands/spawn.cpp" #include "gm_commands/spawn.cpp"
#include "gm_commands/spawneditmass.cpp" #include "gm_commands/spawneditmass.cpp"
#include "gm_commands/spawnfix.cpp" #include "gm_commands/spawnfix.cpp"
#include "gm_commands/spawnstatus.cpp"
#include "gm_commands/faction_association.cpp" #include "gm_commands/faction_association.cpp"
#include "gm_commands/stun.cpp" #include "gm_commands/stun.cpp"
#include "gm_commands/summon.cpp" #include "gm_commands/summon.cpp"
@ -1171,12 +1146,10 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/tempname.cpp" #include "gm_commands/tempname.cpp"
#include "gm_commands/texture.cpp" #include "gm_commands/texture.cpp"
#include "gm_commands/time.cpp" #include "gm_commands/time.cpp"
#include "gm_commands/timers.cpp"
#include "gm_commands/timezone.cpp" #include "gm_commands/timezone.cpp"
#include "gm_commands/title.cpp" #include "gm_commands/title.cpp"
#include "gm_commands/titlesuffix.cpp" #include "gm_commands/titlesuffix.cpp"
#include "gm_commands/traindisc.cpp" #include "gm_commands/traindisc.cpp"
#include "gm_commands/trapinfo.cpp"
#include "gm_commands/tune.cpp" #include "gm_commands/tune.cpp"
#include "gm_commands/undye.cpp" #include "gm_commands/undye.cpp"
#include "gm_commands/unfreeze.cpp" #include "gm_commands/unfreeze.cpp"
@ -1187,22 +1160,12 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/updatechecksum.cpp" #include "gm_commands/updatechecksum.cpp"
#include "gm_commands/untraindisc.cpp" #include "gm_commands/untraindisc.cpp"
#include "gm_commands/untraindiscs.cpp" #include "gm_commands/untraindiscs.cpp"
#include "gm_commands/uptime.cpp"
#include "gm_commands/version.cpp"
#include "gm_commands/viewcurrencies.cpp"
#include "gm_commands/viewnpctype.cpp"
#include "gm_commands/viewpetition.cpp"
#include "gm_commands/viewrecipe.cpp"
#include "gm_commands/viewzoneloot.cpp"
#include "gm_commands/wc.cpp" #include "gm_commands/wc.cpp"
#include "gm_commands/weather.cpp" #include "gm_commands/weather.cpp"
#include "gm_commands/who.cpp"
#include "gm_commands/worldshutdown.cpp" #include "gm_commands/worldshutdown.cpp"
#include "gm_commands/worldwide.cpp" #include "gm_commands/worldwide.cpp"
#include "gm_commands/wp.cpp" #include "gm_commands/wp.cpp"
#include "gm_commands/wpadd.cpp" #include "gm_commands/wpadd.cpp"
#include "gm_commands/wpinfo.cpp"
#include "gm_commands/xtargets.cpp"
#include "gm_commands/zclip.cpp" #include "gm_commands/zclip.cpp"
#include "gm_commands/zcolor.cpp" #include "gm_commands/zcolor.cpp"
#include "gm_commands/zheader.cpp" #include "gm_commands/zheader.cpp"
@ -1210,11 +1173,9 @@ void command_bot(Client *c, const Seperator *sep)
#include "gm_commands/zonebootup.cpp" #include "gm_commands/zonebootup.cpp"
#include "gm_commands/zonelock.cpp" #include "gm_commands/zonelock.cpp"
#include "gm_commands/zoneshutdown.cpp" #include "gm_commands/zoneshutdown.cpp"
#include "gm_commands/zonestatus.cpp"
#include "gm_commands/zone_instance.cpp" #include "gm_commands/zone_instance.cpp"
#include "gm_commands/zopp.cpp" #include "gm_commands/zopp.cpp"
#include "gm_commands/zsafecoords.cpp" #include "gm_commands/zsafecoords.cpp"
#include "gm_commands/zsave.cpp" #include "gm_commands/zsave.cpp"
#include "gm_commands/zsky.cpp" #include "gm_commands/zsky.cpp"
#include "gm_commands/zstats.cpp"
#include "gm_commands/zunderworld.cpp" #include "gm_commands/zunderworld.cpp"

View File

@ -33,12 +33,11 @@ std::string GetModifyNPCStatDescription(std::string stat);
void SendNPCEditSubCommands(Client *c); void SendNPCEditSubCommands(Client *c);
void SendRuleSubCommands(Client *c); void SendRuleSubCommands(Client *c);
void SendGuildSubCommands(Client *c); void SendGuildSubCommands(Client *c);
void SendPeekInvSubCommands(Client *c); void SendShowInventorySubCommands(Client *c);
// Commands // Commands
void command_acceptrules(Client *c, const Seperator *sep); void command_acceptrules(Client *c, const Seperator *sep);
void command_advnpcspawn(Client *c, const Seperator *sep); void command_advnpcspawn(Client *c, const Seperator *sep);
void command_aggro(Client *c, const Seperator *sep);
void command_aggrozone(Client *c, const Seperator *sep); void command_aggrozone(Client *c, const Seperator *sep);
void command_ai(Client *c, const Seperator *sep); void command_ai(Client *c, const Seperator *sep);
void command_appearance(Client *c, const Seperator *sep); void command_appearance(Client *c, const Seperator *sep);
@ -52,12 +51,10 @@ void command_bugs(Client *c, const Seperator *sep);
void command_camerashake(Client *c, const Seperator *sep); void command_camerashake(Client *c, const Seperator *sep);
void command_castspell(Client *c, const Seperator *sep); void command_castspell(Client *c, const Seperator *sep);
void command_chat(Client *c, const Seperator *sep); void command_chat(Client *c, const Seperator *sep);
void command_checklos(Client *c, const Seperator *sep);
void command_copycharacter(Client *c, const Seperator *sep); void command_copycharacter(Client *c, const Seperator *sep);
void command_corpse(Client *c, const Seperator *sep); void command_corpse(Client *c, const Seperator *sep);
void command_corpsefix(Client *c, const Seperator *sep); void command_corpsefix(Client *c, const Seperator *sep);
void command_countitem(Client *c, const Seperator *sep); void command_countitem(Client *c, const Seperator *sep);
void command_cvs(Client *c, const Seperator *sep);
void command_damage(Client *c, const Seperator *sep); void command_damage(Client *c, const Seperator *sep);
void command_databuckets(Client *c, const Seperator *sep); void command_databuckets(Client *c, const Seperator *sep);
void command_date(Client *c, const Seperator *sep); void command_date(Client *c, const Seperator *sep);
@ -70,14 +67,12 @@ void command_devtools(Client *c, const Seperator *sep);
void command_disablerecipe(Client *c, const Seperator *sep); void command_disablerecipe(Client *c, const Seperator *sep);
void command_disarmtrap(Client *c, const Seperator *sep); void command_disarmtrap(Client *c, const Seperator *sep);
void command_door(Client *c, const Seperator *sep); void command_door(Client *c, const Seperator *sep);
void command_distance(Client *c, const Seperator *sep);
void command_doanim(Client *c, const Seperator *sep); void command_doanim(Client *c, const Seperator *sep);
void command_dye(Client *c, const Seperator *sep); void command_dye(Client *c, const Seperator *sep);
void command_dz(Client *c, const Seperator *sep); void command_dz(Client *c, const Seperator *sep);
void command_dzkickplayers(Client *c, const Seperator *sep); void command_dzkickplayers(Client *c, const Seperator *sep);
void command_editmassrespawn(Client *c, const Seperator *sep); void command_editmassrespawn(Client *c, const Seperator *sep);
void command_emote(Client *c, const Seperator *sep); void command_emote(Client *c, const Seperator *sep);
void command_emoteview(Client *c, const Seperator *sep);
void command_emptyinventory(Client *c, const Seperator *sep); void command_emptyinventory(Client *c, const Seperator *sep);
void command_enablerecipe(Client *c, const Seperator *sep); void command_enablerecipe(Client *c, const Seperator *sep);
void command_endurance(Client *c, const Seperator *sep); void command_endurance(Client *c, const Seperator *sep);
@ -90,19 +85,13 @@ void command_find(Client *c, const Seperator *sep);
void command_fixmob(Client *c, const Seperator *sep); void command_fixmob(Client *c, const Seperator *sep);
void command_flag(Client *c, const Seperator *sep); void command_flag(Client *c, const Seperator *sep);
void command_flagedit(Client *c, const Seperator *sep); void command_flagedit(Client *c, const Seperator *sep);
void command_flags(Client *c, const Seperator *sep);
void command_flymode(Client *c, const Seperator *sep); void command_flymode(Client *c, const Seperator *sep);
void command_fov(Client *c, const Seperator *sep);
void command_freeze(Client *c, const Seperator *sep); void command_freeze(Client *c, const Seperator *sep);
void command_gassign(Client *c, const Seperator *sep); void command_gassign(Client *c, const Seperator *sep);
void command_gearup(Client *c, const Seperator *sep); void command_gearup(Client *c, const Seperator *sep);
void command_gender(Client *c, const Seperator *sep); void command_gender(Client *c, const Seperator *sep);
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep);
void command_getvariable(Client *c, const Seperator *sep);
void command_ginfo(Client *c, const Seperator *sep);
void command_giveitem(Client *c, const Seperator *sep); void command_giveitem(Client *c, const Seperator *sep);
void command_givemoney(Client *c, const Seperator *sep); void command_givemoney(Client *c, const Seperator *sep);
void command_globalview(Client *c, const Seperator *sep);
void command_gm(Client *c, const Seperator *sep); void command_gm(Client *c, const Seperator *sep);
void command_gmspeed(Client *c, const Seperator *sep); void command_gmspeed(Client *c, const Seperator *sep);
void command_gmzone(Client *c, const Seperator *sep); void command_gmzone(Client *c, const Seperator *sep);
@ -111,7 +100,6 @@ void command_goto(Client *c, const Seperator *sep);
void command_grid(Client *c, const Seperator *sep); void command_grid(Client *c, const Seperator *sep);
void command_guild(Client *c, const Seperator *sep); void command_guild(Client *c, const Seperator *sep);
void command_haste(Client *c, const Seperator *sep); void command_haste(Client *c, const Seperator *sep);
void command_hatelist(Client *c, const Seperator *sep);
void command_heal(Client *c, const Seperator *sep); void command_heal(Client *c, const Seperator *sep);
void command_help(Client *c, const Seperator *sep); void command_help(Client *c, const Seperator *sep);
void command_heromodel(Client *c, const Seperator *sep); void command_heromodel(Client *c, const Seperator *sep);
@ -125,14 +113,12 @@ void command_interrupt(Client *c, const Seperator *sep);
void command_invsnapshot(Client *c, const Seperator *sep); void command_invsnapshot(Client *c, const Seperator *sep);
void command_invul(Client *c, const Seperator *sep); void command_invul(Client *c, const Seperator *sep);
void command_ipban(Client *c, const Seperator *sep); void command_ipban(Client *c, const Seperator *sep);
void command_iplookup(Client *c, const Seperator *sep);
void command_kick(Client *c, const Seperator *sep); void command_kick(Client *c, const Seperator *sep);
void command_killallnpcs(Client *c, const Seperator *sep); void command_killallnpcs(Client *c, const Seperator *sep);
void command_kill(Client *c, const Seperator *sep); void command_kill(Client *c, const Seperator *sep);
void command_lastname(Client *c, const Seperator *sep); void command_lastname(Client *c, const Seperator *sep);
void command_level(Client *c, const Seperator *sep); void command_level(Client *c, const Seperator *sep);
void command_list(Client *c, const Seperator *sep); void command_list(Client *c, const Seperator *sep);
void command_listpetition(Client *c, const Seperator *sep);
void command_lootsim(Client *c, const Seperator *sep); void command_lootsim(Client *c, const Seperator *sep);
void command_load_shared_memory(Client *c, const Seperator *sep); void command_load_shared_memory(Client *c, const Seperator *sep);
void command_loc(Client *c, const Seperator *sep); void command_loc(Client *c, const Seperator *sep);
@ -150,8 +136,6 @@ void command_myskills(Client *c, const Seperator *sep);
void command_mysql(Client *c, const Seperator *sep); void command_mysql(Client *c, const Seperator *sep);
void command_mystats(Client *c, const Seperator *sep); void command_mystats(Client *c, const Seperator *sep);
void command_name(Client *c, const Seperator *sep); void command_name(Client *c, const Seperator *sep);
void command_netstats(Client *c, const Seperator *sep);
void command_network(Client *c, const Seperator *sep);
void command_npccast(Client *c, const Seperator *sep); void command_npccast(Client *c, const Seperator *sep);
void command_npcedit(Client *c, const Seperator *sep); void command_npcedit(Client *c, const Seperator *sep);
void command_npceditmass(Client *c, const Seperator *sep); void command_npceditmass(Client *c, const Seperator *sep);
@ -160,7 +144,6 @@ void command_npcloot(Client *c, const Seperator *sep);
void command_npcsay(Client *c, const Seperator *sep); void command_npcsay(Client *c, const Seperator *sep);
void command_npcshout(Client *c, const Seperator *sep); void command_npcshout(Client *c, const Seperator *sep);
void command_npcspawn(Client *c, const Seperator *sep); void command_npcspawn(Client *c, const Seperator *sep);
void command_npcstats(Client *c, const Seperator *sep);
void command_npctypespawn(Client *c, const Seperator *sep); void command_npctypespawn(Client *c, const Seperator *sep);
void command_nudge(Client *c, const Seperator *sep); void command_nudge(Client *c, const Seperator *sep);
void command_nukebuffs(Client *c, const Seperator *sep); void command_nukebuffs(Client *c, const Seperator *sep);
@ -168,21 +151,16 @@ void command_nukeitem(Client *c, const Seperator *sep);
void command_object(Client *c, const Seperator *sep); void command_object(Client *c, const Seperator *sep);
void command_oocmute(Client *c, const Seperator *sep); void command_oocmute(Client *c, const Seperator *sep);
void command_path(Client *c, const Seperator *sep); void command_path(Client *c, const Seperator *sep);
void command_peekinv(Client *c, const Seperator *sep);
void command_peqzone(Client *c, const Seperator *sep); void command_peqzone(Client *c, const Seperator *sep);
void command_peqzone_flags(Client *c, const Seperator *sep);
void command_permaclass(Client *c, const Seperator *sep); void command_permaclass(Client *c, const Seperator *sep);
void command_permagender(Client *c, const Seperator *sep); void command_permagender(Client *c, const Seperator *sep);
void command_permarace(Client *c, const Seperator *sep); void command_permarace(Client *c, const Seperator *sep);
void command_petitems(Client *c, const Seperator *sep); void command_petitems(Client *c, const Seperator *sep);
void command_petitioninfo(Client *c, const Seperator *sep);
void command_picklock(Client *c, const Seperator *sep); void command_picklock(Client *c, const Seperator *sep);
void command_profanity(Client *c, const Seperator *sep); void command_profanity(Client *c, const Seperator *sep);
void command_proximity(Client *c, const Seperator *sep);
void command_push(Client *c, const Seperator *sep); void command_push(Client *c, const Seperator *sep);
void command_pvp(Client *c, const Seperator *sep); void command_pvp(Client *c, const Seperator *sep);
void command_qglobal(Client *c, const Seperator *sep); void command_qglobal(Client *c, const Seperator *sep);
void command_questerrors(Client *c, const Seperator *sep);
void command_race(Client *c, const Seperator *sep); void command_race(Client *c, const Seperator *sep);
void command_raidloot(Client* c, const Seperator* sep); void command_raidloot(Client* c, const Seperator* sep);
void command_randomfeatures(Client *c, const Seperator *sep); void command_randomfeatures(Client *c, const Seperator *sep);
@ -203,7 +181,6 @@ void command_scribespell(Client *c, const Seperator *sep);
void command_scribespells(Client *c, const Seperator *sep); void command_scribespells(Client *c, const Seperator *sep);
void command_sendzonespawns(Client *c, const Seperator *sep); void command_sendzonespawns(Client *c, const Seperator *sep);
void command_sensetrap(Client *c, const Seperator *sep); void command_sensetrap(Client *c, const Seperator *sep);
void command_serverinfo(Client *c, const Seperator *sep);
void command_serverrules(Client *c, const Seperator *sep); void command_serverrules(Client *c, const Seperator *sep);
void command_set_adventure_points(Client *c, const Seperator *sep); void command_set_adventure_points(Client *c, const Seperator *sep);
void command_setaapts(Client *c, const Seperator *sep); void command_setaapts(Client *c, const Seperator *sep);
@ -225,19 +202,11 @@ void command_setskillall(Client *c, const Seperator *sep);
void command_setstartzone(Client *c, const Seperator *sep); void command_setstartzone(Client *c, const Seperator *sep);
void command_setstat(Client *c, const Seperator *sep); void command_setstat(Client *c, const Seperator *sep);
void command_setxp(Client *c, const Seperator *sep); void command_setxp(Client *c, const Seperator *sep);
void command_showbuffs(Client *c, const Seperator *sep); void command_show(Client *c, const Seperator *sep);
void command_shownpcgloballoot(Client *c, const Seperator *sep);
void command_showskills(Client *c, const Seperator *sep);
void command_showspells(Client *c, const Seperator *sep);
void command_showspellslist(Client *c, const Seperator *sep);
void command_showstats(Client *c, const Seperator *sep);
void command_showzonegloballoot(Client *c, const Seperator *sep);
void command_showzonepoints(Client *c, const Seperator *sep);
void command_shutdown(Client *c, const Seperator *sep); void command_shutdown(Client *c, const Seperator *sep);
void command_spawn(Client *c, const Seperator *sep); void command_spawn(Client *c, const Seperator *sep);
void command_spawneditmass(Client *c, const Seperator *sep); void command_spawneditmass(Client *c, const Seperator *sep);
void command_spawnfix(Client *c, const Seperator *sep); void command_spawnfix(Client *c, const Seperator *sep);
void command_spawnstatus(Client *c, const Seperator *sep);
void command_stun(Client *c, const Seperator *sep); void command_stun(Client *c, const Seperator *sep);
void command_summon(Client *c, const Seperator *sep); void command_summon(Client *c, const Seperator *sep);
void command_summonburiedplayercorpse(Client *c, const Seperator *sep); void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
@ -249,12 +218,10 @@ void command_tempname(Client *c, const Seperator *sep);
void command_petname(Client *c, const Seperator *sep); void command_petname(Client *c, const Seperator *sep);
void command_texture(Client *c, const Seperator *sep); void command_texture(Client *c, const Seperator *sep);
void command_time(Client *c, const Seperator *sep); void command_time(Client *c, const Seperator *sep);
void command_timers(Client *c, const Seperator *sep);
void command_timezone(Client *c, const Seperator *sep); void command_timezone(Client *c, const Seperator *sep);
void command_title(Client *c, const Seperator *sep); void command_title(Client *c, const Seperator *sep);
void command_titlesuffix(Client *c, const Seperator *sep); void command_titlesuffix(Client *c, const Seperator *sep);
void command_traindisc(Client *c, const Seperator *sep); void command_traindisc(Client *c, const Seperator *sep);
void command_trapinfo(Client *c, const Seperator *sep);
void command_tune(Client *c, const Seperator *sep); void command_tune(Client *c, const Seperator *sep);
void command_undye(Client *c, const Seperator *sep); void command_undye(Client *c, const Seperator *sep);
void command_unfreeze(Client *c, const Seperator *sep); void command_unfreeze(Client *c, const Seperator *sep);
@ -265,22 +232,12 @@ void command_unscribespells(Client *c, const Seperator *sep);
void command_untraindisc(Client *c, const Seperator *sep); void command_untraindisc(Client *c, const Seperator *sep);
void command_untraindiscs(Client *c, const Seperator *sep); void command_untraindiscs(Client *c, const Seperator *sep);
void command_updatechecksum(Client* c, const Seperator* sep); void command_updatechecksum(Client* c, const Seperator* sep);
void command_uptime(Client *c, const Seperator *sep);
void command_version(Client *c, const Seperator *sep);
void command_viewcurrencies(Client *c, const Seperator *sep);
void command_viewnpctype(Client *c, const Seperator *sep);
void command_viewpetition(Client *c, const Seperator *sep);
void command_viewrecipe(Client *c, const Seperator *sep);
void command_viewzoneloot(Client *c, const Seperator *sep);
void command_wc(Client *c, const Seperator *sep); void command_wc(Client *c, const Seperator *sep);
void command_weather(Client *c, const Seperator *sep); void command_weather(Client *c, const Seperator *sep);
void command_who(Client *c, const Seperator *sep);
void command_worldshutdown(Client *c, const Seperator *sep); void command_worldshutdown(Client *c, const Seperator *sep);
void command_wp(Client *c, const Seperator *sep); void command_wp(Client *c, const Seperator *sep);
void command_wpadd(Client *c, const Seperator *sep); void command_wpadd(Client *c, const Seperator *sep);
void command_wpinfo(Client *c, const Seperator *sep);
void command_worldwide(Client *c, const Seperator *sep); void command_worldwide(Client *c, const Seperator *sep);
void command_xtargets(Client *c, const Seperator *sep);
void command_zclip(Client *c, const Seperator *sep); void command_zclip(Client *c, const Seperator *sep);
void command_zcolor(Client *c, const Seperator *sep); void command_zcolor(Client *c, const Seperator *sep);
void command_zheader(Client *c, const Seperator *sep); void command_zheader(Client *c, const Seperator *sep);
@ -289,12 +246,10 @@ void command_zone_instance(Client *c, const Seperator *sep);
void command_zonebootup(Client *c, const Seperator *sep); void command_zonebootup(Client *c, const Seperator *sep);
void command_zonelock(Client *c, const Seperator *sep); void command_zonelock(Client *c, const Seperator *sep);
void command_zoneshutdown(Client *c, const Seperator *sep); void command_zoneshutdown(Client *c, const Seperator *sep);
void command_zonestatus(Client *c, const Seperator *sep);
void command_zopp(Client *c, const Seperator *sep); void command_zopp(Client *c, const Seperator *sep);
void command_zsafecoords(Client *c, const Seperator *sep); void command_zsafecoords(Client *c, const Seperator *sep);
void command_zsave(Client *c, const Seperator *sep); void command_zsave(Client *c, const Seperator *sep);
void command_zsky(Client *c, const Seperator *sep); void command_zsky(Client *c, const Seperator *sep);
void command_zstats(Client *c, const Seperator *sep);
void command_zunderworld(Client *c, const Seperator *sep); void command_zunderworld(Client *c, const Seperator *sep);
#include "bot.h" #include "bot.h"

View File

@ -553,7 +553,7 @@ public:
bool add_self_to_other_lists = false bool add_self_to_other_lists = false
); );
void GetTrapInfo(Client* client); void GetTrapInfo(Client* c);
bool IsTrapGroupSpawned(uint32 trap_id, uint8 group); bool IsTrapGroupSpawned(uint32 trap_id, uint8 group);
void UpdateAllTraps(bool respawn, bool repopnow = false); void UpdateAllTraps(bool respawn, bool repopnow = false);
void ClearTrapPointers(); void ClearTrapPointers();

View File

@ -1,28 +0,0 @@
#include "../client.h"
void command_aggro(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments || !sep->IsNumber(1)) {
c->Message(Chat::White, "Usage: #aggro [Distance] [-v] (-v is verbose Faction Information)");
return;
}
if (
!c->GetTarget() ||
(
c->GetTarget() &&
!c->GetTarget()->IsNPC()
)
) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
NPC* target = c->GetTarget()->CastToNPC();
float distance = Strings::ToFloat(sep->arg[1]);
bool verbose = !strcasecmp("-v", sep->arg[2]);
entity_list.DescribeAggro(c, target, distance, verbose);
}

View File

@ -1,23 +0,0 @@
#include "../client.h"
void command_checklos(Client *c, const Seperator *sep)
{
if (!c->GetTarget()) {
c->Message(Chat::White, "You must have a target to use this command.");
return;
}
auto target = c->GetTarget();
bool has_los = c->CheckLosFN(target);
c->Message(
Chat::White,
fmt::format(
"You {}have line of sight to {}.",
has_los ? "" : "do not ",
c->GetTargetDescription(target)
).c_str()
);
}

View File

@ -1,14 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_cvs(Client *c, const Seperator *sep)
{
auto pack = new ServerPacket(ServerOP_ClientVersionSummary, sizeof(ServerRequestClientVersionSummary_Struct));
auto srcvss = (ServerRequestClientVersionSummary_Struct *) pack->pBuffer;
strn0cpy(srcvss->Name, c->GetName(), sizeof(srcvss->Name));
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,22 +0,0 @@
#include "../client.h"
void command_distance(Client *c, const Seperator *sep)
{
if (c->GetTarget()) {
Mob *target = c->GetTarget();
if (c != target) {
c->Message(
Chat::White,
fmt::format(
"{} is {:.2f} units from you.",
c->GetTargetDescription(target),
Distance(
c->GetPosition(),
target->GetPosition()
)
).c_str()
);
}
}
}

View File

@ -1,17 +0,0 @@
#include "../client.h"
void command_flags(Client *c, const Seperator *sep)
{
Client *target = c;
if (
c->GetTarget() &&
c->GetTarget()->IsClient() &&
c->Admin() >= minStatusToSeeOthersZoneFlags
) {
target = c->GetTarget()->CastToClient();
}
target->SendZoneFlagInfo(c);
}

View File

@ -1,43 +0,0 @@
#include "../client.h"
void command_fov(Client *c, const Seperator *sep)
{
if (!c->GetTarget()) {
c->Message(Chat::White, "You must have a target to use this command.");
return;
}
auto target = c->GetTarget();
std::string behind_message = (
c->BehindMob(
target,
c->GetX(),
c->GetY()
) ?
"behind" :
"not behind"
);
std::string gender_message = (
target->GetGender() == MALE ?
"he" :
(
target->GetGender() == FEMALE ?
"she" :
"it"
)
);
c->Message(
Chat::White,
fmt::format(
"You are {} {}, {} has a heading of {}.",
behind_message,
c->GetTargetDescription(target),
gender_message,
target->GetHeading()
).c_str()
);
}

View File

@ -1,26 +0,0 @@
#include "../client.h"
#include "../corpse.h"
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep)
{
Client *target = c;
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
target = c->GetTarget()->CastToClient();
}
uint32 corpse_count = database.GetCharacterBuriedCorpseCount(target->CharacterID());
c->Message(
Chat::White,
fmt::format(
"{} {} {} buried corpse{}.",
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
c == target ? "have" : "has",
(
corpse_count ?
std::to_string(corpse_count) :
"no"
),
corpse_count != 1 ? "s" : ""
).c_str()
);
}

View File

@ -1,31 +0,0 @@
#include "../client.h"
void command_getvariable(Client *c, const Seperator *sep)
{
std::string variable = sep->argplus[1];
if (variable.empty()) {
c->Message(Chat::White, "Usage: #getvariable [Variable Name]");
return;
}
std::string message;
std::string value;
if (database.GetVariable(variable, value)) {
message = fmt::format(
"Variable {}: {}",
variable,
value
);
} else {
message = fmt::format(
"Variable '{}' does not exist.",
variable
);
}
c->Message(
Chat::White,
message.c_str()
);
}

View File

@ -1,78 +0,0 @@
#include "../client.h"
#include "../groups.h"
void command_ginfo(Client *c, const Seperator *sep)
{
Client *target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
}
auto target_group = target->GetGroup();
if (!target_group) {
c->Message(
Chat::White,
fmt::format(
"{} {} not in a group.",
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
c == target ? "are" : "is"
).c_str()
);
return;
}
std::string popup_title = fmt::format(
"Group Info for {}",
c->GetTargetDescription(target, TargetDescriptionType::UCSelf)
);
std::string popup_text = "<table>";
popup_text += fmt::format(
"<tr><td>Group ID</td><td>{}</td><td>Members</td><td>{}</td>",
target_group->GetID(),
target_group->GroupCount()
);
popup_text += "<br><br>";
popup_text += "<tr>";
popup_text += "<td>Index</td>";
popup_text += "<td>Name</td>";
popup_text += "<td>In Zone</td>";
popup_text += "<td>Assist</td>";
popup_text += "<td>Puller</td>";
popup_text += "<td>Tank</td>";
popup_text += "</tr>";
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
if (target_group->membername[group_member][0] == '\0') {
continue;
}
bool is_assist = target_group->MemberRoles[group_member] & RoleAssist;
bool is_puller = target_group->MemberRoles[group_member] & RolePuller;
bool is_tank = target_group->MemberRoles[group_member] & RoleTank;
popup_text += fmt::format(
"<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>",
group_member,
(
strcmp(target_group->membername[group_member], c->GetCleanName()) ?
target_group->membername[group_member] :
fmt::format(
"{} (You)",
target_group->membername[group_member]
)
),
target_group->members[group_member] ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
is_assist ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
is_puller ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
is_tank ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>"
);
}
popup_text += "</table>";
c->SendPopupToClient(
popup_title.c_str(),
popup_text.c_str()
);
}

View File

@ -1,80 +0,0 @@
#include "../client.h"
void command_globalview(Client *c, const Seperator *sep)
{
NPC *npcmob = nullptr;
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
npcmob = c->GetTarget()->CastToNPC();
QGlobalCache *npc_c = nullptr;
QGlobalCache *char_c = nullptr;
QGlobalCache *zone_c = nullptr;
if (npcmob) {
npc_c = npcmob->GetQGlobals();
}
char_c = c->GetQGlobals();
zone_c = zone->GetQGlobals();
std::list<QGlobal> globalMap;
uint32 ntype = 0;
if (npcmob) {
ntype = npcmob->GetNPCTypeID();
}
if (npc_c) {
QGlobalCache::Combine(globalMap, npc_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
}
if (char_c) {
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
}
if (zone_c) {
QGlobalCache::Combine(globalMap, zone_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
}
auto iter = globalMap.begin();
uint32 gcount = 0;
c->Message(Chat::White, "Name, Value");
while (iter != globalMap.end()) {
c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str());
++iter;
++gcount;
}
c->Message(Chat::White, "%u globals loaded.", gcount);
}
else {
QGlobalCache *char_c = nullptr;
QGlobalCache *zone_c = nullptr;
char_c = c->GetQGlobals();
zone_c = zone->GetQGlobals();
std::list<QGlobal> globalMap;
uint32 ntype = 0;
if (char_c) {
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
}
if (zone_c) {
QGlobalCache::Combine(globalMap, zone_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
}
auto iter = globalMap.begin();
uint32 gcount = 0;
c->Message(Chat::White, "Name, Value");
while (iter != globalMap.end()) {
c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str());
++iter;
++gcount;
}
c->Message(Chat::White, "%u globals loaded.", gcount);
}
}

View File

@ -1,23 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_iplookup(Client *c, const Seperator *sep)
{
auto pack =
new ServerPacket(
ServerOP_IPLookup,
sizeof(ServerGenericWorldQuery_Struct) +
strlen(sep->argplus[1]) + 1
);
ServerGenericWorldQuery_Struct *s = (ServerGenericWorldQuery_Struct *) pack->pBuffer;
strcpy(s->from, c->GetName());
s->admin = c->Admin();
if (sep->argplus[1][0] != 0) {
strcpy(s->query, sep->argplus[1]);
}
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -1,22 +0,0 @@
#include "../client.h"
void command_listpetition(Client *c, const Seperator *sep)
{
std::string query = "SELECT petid, charname, accountname FROM petitions ORDER BY petid";
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}
LogInfo("Petition list requested by [{}]", c->GetName());
if (results.RowCount() == 0) {
return;
}
c->Message(Chat::Red, " ID : Character Name , Account Name");
for (auto row = results.begin(); row != results.end(); ++row)
c->Message(Chat::Yellow, " %s: %s , %s ", row[0], row[1], row[2]);
}

View File

@ -1,169 +0,0 @@
#include "../client.h"
void command_netstats(Client *c, const Seperator *sep)
{
bool is_full = !strcasecmp(sep->arg[1], "full");
bool is_reset = !strcasecmp(sep->arg[1], "reset");
if (is_reset) {
auto connection = c->Connection();
c->Message(Chat::White, "Resetting client stats (packet loss will not read correctly after reset).");
connection->ResetStats();
return;
}
auto connection = c->Connection();
auto opts = connection->GetManager()->GetOptions();
auto eqs_stats = connection->GetStats();
auto &stats = eqs_stats.DaybreakStats;
auto now = EQ::Net::Clock::now();
auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
now - stats.created
).count();
std::string popup_text = "<table>";
popup_text += fmt::format(
"<tr><td>Sent Bytes</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.sent_bytes,
stats.sent_bytes / sec_since_stats_reset
);
popup_text += fmt::format(
"<tr><td>Received Bytes</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.recv_bytes,
stats.recv_bytes / sec_since_stats_reset
);
popup_text += "<br><br>";
popup_text += fmt::format(
"<tr><td>Bytes Before Encode (Sent)</td><td>{}</td><td>Compression Rate</td><td>{:.2f}%%</td></tr>",
stats.bytes_before_encode,
static_cast<double>(stats.bytes_before_encode - stats.sent_bytes) /
static_cast<double>(stats.bytes_before_encode) * 100.0
);
popup_text += fmt::format(
"<tr><td>Bytes After Decode (Received)</td><td>{}</td><td>Compression Rate</td><td>{:.2f}%%</td></tr>",
stats.bytes_after_decode,
static_cast<double>(stats.bytes_after_decode - stats.recv_bytes) /
static_cast<double>(stats.bytes_after_decode) * 100.0
);
popup_text += "<br><br>";
popup_text += fmt::format("<tr><td>Min Ping</td><td>{}</td></tr>", stats.min_ping);
popup_text += fmt::format("<tr><td>Max Ping</td><td>{}</td></tr>", stats.max_ping);
popup_text += fmt::format("<tr><td>Last Ping</td><td>{}</td></tr>", stats.last_ping);
popup_text += fmt::format("<tr><td>Average Ping</td><td>{}</td></tr>", stats.avg_ping);
popup_text += "<br><br>";
popup_text += fmt::format(
"<tr><td>(Realtime) Received Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.recv_packets,
stats.recv_packets / sec_since_stats_reset
);
popup_text += fmt::format(
"<tr><td>(Realtime) Sent Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.sent_packets,
stats.sent_packets / sec_since_stats_reset
);
popup_text += "<br><br>";
popup_text += fmt::format("<tr><td>(Sync) Received Packets</td><td>{}</td></tr>", stats.sync_recv_packets);
popup_text += fmt::format("<tr><td>(Sync) Sent Packets</td><td>{}</td></tr>", stats.sync_sent_packets);
popup_text += fmt::format("<tr><td>(Sync) Remote Received Packets</td><td>{}</td></tr>", stats.sync_remote_recv_packets);
popup_text += fmt::format("<tr><td>(Sync) Remote Sent Packets</td><td>{}</td></tr>", stats.sync_remote_sent_packets);
popup_text += "<br><br>";
popup_text += fmt::format(
"<tr><td>Packet Loss In</td><td>{:.2f}%%</td></tr>",
(100.0 * (1.0 - static_cast<double>(stats.sync_recv_packets) / static_cast<double>(stats.sync_remote_sent_packets)))
);
popup_text += fmt::format(
"<tr><td>Packet Loss Out</td><td>{:.2f}%%</td></tr>",
(100.0 * (1.0 - static_cast<double>(stats.sync_remote_recv_packets) / static_cast<double>(stats.sync_sent_packets)))
);
popup_text += "<br><br>";
popup_text += fmt::format(
"<tr><td>Resent Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.resent_packets,
stats.resent_packets / sec_since_stats_reset
);
popup_text += fmt::format(
"<tr><td>Resent Fragments</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.resent_fragments,
stats.resent_fragments / sec_since_stats_reset
);
popup_text += fmt::format(
"<tr><td>Resent Non-Fragments</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.resent_full,
stats.resent_full / sec_since_stats_reset
);
popup_text += "<br><br>";
popup_text += fmt::format(
"<tr><td>Dropped Datarate Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
stats.dropped_datarate_packets,
stats.dropped_datarate_packets / sec_since_stats_reset
);
if (opts.daybreak_options.outgoing_data_rate > 0.0) {
popup_text += fmt::format(
"<tr><td>Outgoing Link Saturation</td><td>{:.2f}%% ({:.2f}kb Per Second)</td></tr>",
(100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate))),
opts.daybreak_options.outgoing_data_rate
);
}
if (is_full) {
popup_text += "<br><br>";
popup_text += "<tr><td>Sent Packet Types</td></tr>";
for (auto i = 0; i < _maxEmuOpcode; ++i) {
auto cnt = eqs_stats.SentCount[i];
if (cnt > 0) {
popup_text += fmt::format(
"<tr><td>{}</td><td>{} ({:.2f} Per Second)</td></tr>",
OpcodeNames[i],
cnt,
cnt / sec_since_stats_reset
);
}
}
popup_text += "<br><br>";
popup_text += "<tr><td>Received Packet Types</td></tr>";
for (auto i = 0; i < _maxEmuOpcode; ++i) {
auto cnt = eqs_stats.RecvCount[i];
if (cnt > 0) {
popup_text += fmt::format(
"<tr><td>{}</td><td>{} ({:.2f} Per Second)</td></tr>",
OpcodeNames[i],
cnt,
cnt / sec_since_stats_reset
);
}
}
}
popup_text += "</table>";
c->SendPopupToClient(
"Network Statistics",
popup_text.c_str()
);
}

View File

@ -1,175 +0,0 @@
#include "../client.h"
void command_network(Client *c, const Seperator *sep)
{
if (!strcasecmp(sep->arg[1], "getopt")) {
auto eqsi = c->Connection();
auto manager = eqsi->GetManager();
auto opts = manager->GetOptions();
if (!strcasecmp(sep->arg[2], "all")) {
c->Message(Chat::White, "max_packet_size: %llu", (uint64_t) opts.daybreak_options.max_packet_size);
c->Message(
Chat::White,
"max_connection_count: %llu",
(uint64_t) opts.daybreak_options.max_connection_count
);
c->Message(Chat::White, "keepalive_delay_ms: %llu", (uint64_t) opts.daybreak_options.keepalive_delay_ms);
c->Message(Chat::White, "resend_delay_factor: %.2f", opts.daybreak_options.resend_delay_factor);
c->Message(Chat::White, "resend_delay_ms: %llu", (uint64_t) opts.daybreak_options.resend_delay_ms);
c->Message(Chat::White, "resend_delay_min: %llu", (uint64_t) opts.daybreak_options.resend_delay_min);
c->Message(Chat::White, "resend_delay_max: %llu", (uint64_t) opts.daybreak_options.resend_delay_max);
c->Message(Chat::White, "connect_delay_ms: %llu", (uint64_t) opts.daybreak_options.connect_delay_ms);
c->Message(Chat::White, "connect_stale_ms: %llu", (uint64_t) opts.daybreak_options.connect_stale_ms);
c->Message(Chat::White, "stale_connection_ms: %llu", (uint64_t) opts.daybreak_options.stale_connection_ms);
c->Message(Chat::White, "crc_length: %llu", (uint64_t) opts.daybreak_options.crc_length);
c->Message(Chat::White, "hold_size: %llu", (uint64_t) opts.daybreak_options.hold_size);
c->Message(Chat::White, "hold_length_ms: %llu", (uint64_t) opts.daybreak_options.hold_length_ms);
c->Message(
Chat::White,
"simulated_in_packet_loss: %llu",
(uint64_t) opts.daybreak_options.simulated_in_packet_loss
);
c->Message(
Chat::White,
"simulated_out_packet_loss: %llu",
(uint64_t) opts.daybreak_options.simulated_out_packet_loss
);
c->Message(Chat::White, "tic_rate_hertz: %.2f", opts.daybreak_options.tic_rate_hertz);
c->Message(Chat::White, "resend_timeout: %llu", (uint64_t) opts.daybreak_options.resend_timeout);
c->Message(
Chat::White,
"connection_close_time: %llu",
(uint64_t) opts.daybreak_options.connection_close_time
);
c->Message(Chat::White, "encode_passes[0]: %llu", (uint64_t) opts.daybreak_options.encode_passes[0]);
c->Message(Chat::White, "encode_passes[1]: %llu", (uint64_t) opts.daybreak_options.encode_passes[1]);
c->Message(Chat::White, "port: %llu", (uint64_t) opts.daybreak_options.port);
}
else {
c->Message(Chat::White, "Unknown get option: %s", sep->arg[2]);
c->Message(Chat::White, "Available options:");
//Todo the rest of these when im less lazy.
//c->Message(Chat::White, "max_packet_size");
//c->Message(Chat::White, "max_connection_count");
//c->Message(Chat::White, "keepalive_delay_ms");
//c->Message(Chat::White, "resend_delay_factor");
//c->Message(Chat::White, "resend_delay_ms");
//c->Message(Chat::White, "resend_delay_min");
//c->Message(Chat::White, "resend_delay_max");
//c->Message(Chat::White, "connect_delay_ms");
//c->Message(Chat::White, "connect_stale_ms");
//c->Message(Chat::White, "stale_connection_ms");
//c->Message(Chat::White, "crc_length");
//c->Message(Chat::White, "hold_size");
//c->Message(Chat::White, "hold_length_ms");
//c->Message(Chat::White, "simulated_in_packet_loss");
//c->Message(Chat::White, "simulated_out_packet_loss");
//c->Message(Chat::White, "tic_rate_hertz");
//c->Message(Chat::White, "resend_timeout");
//c->Message(Chat::White, "connection_close_time");
//c->Message(Chat::White, "encode_passes[0]");
//c->Message(Chat::White, "encode_passes[1]");
//c->Message(Chat::White, "port");
c->Message(Chat::White, "all");
}
}
else if (!strcasecmp(sep->arg[1], "setopt")) {
auto eqsi = c->Connection();
auto manager = eqsi->GetManager();
auto opts = manager->GetOptions();
if (!strcasecmp(sep->arg[3], "")) {
c->Message(Chat::White, "Missing value for set");
return;
}
std::string value = sep->arg[3];
if (!strcasecmp(sep->arg[2], "max_connection_count")) {
opts.daybreak_options.max_connection_count = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "keepalive_delay_ms")) {
opts.daybreak_options.keepalive_delay_ms = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "resend_delay_factor")) {
opts.daybreak_options.resend_delay_factor = std::stod(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "resend_delay_ms")) {
opts.daybreak_options.resend_delay_ms = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "resend_delay_min")) {
opts.daybreak_options.resend_delay_min = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "resend_delay_max")) {
opts.daybreak_options.resend_delay_max = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "connect_delay_ms")) {
opts.daybreak_options.connect_delay_ms = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "connect_stale_ms")) {
opts.daybreak_options.connect_stale_ms = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "stale_connection_ms")) {
opts.daybreak_options.stale_connection_ms = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "hold_size")) {
opts.daybreak_options.hold_size = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "hold_length_ms")) {
opts.daybreak_options.hold_length_ms = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "simulated_in_packet_loss")) {
opts.daybreak_options.simulated_in_packet_loss = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "simulated_out_packet_loss")) {
opts.daybreak_options.simulated_out_packet_loss = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "resend_timeout")) {
opts.daybreak_options.resend_timeout = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else if (!strcasecmp(sep->arg[2], "connection_close_time")) {
opts.daybreak_options.connection_close_time = Strings::ToUnsignedBigInt(value);
manager->SetOptions(opts);
}
else {
c->Message(Chat::White, "Unknown set option: %s", sep->arg[2]);
c->Message(Chat::White, "Available options:");
c->Message(Chat::White, "max_connection_count");
c->Message(Chat::White, "keepalive_delay_ms");
c->Message(Chat::White, "resend_delay_factor");
c->Message(Chat::White, "resend_delay_ms");
c->Message(Chat::White, "resend_delay_min");
c->Message(Chat::White, "resend_delay_max");
c->Message(Chat::White, "connect_delay_ms");
c->Message(Chat::White, "connect_stale_ms");
c->Message(Chat::White, "stale_connection_ms");
c->Message(Chat::White, "hold_size");
c->Message(Chat::White, "hold_length_ms");
c->Message(Chat::White, "simulated_in_packet_loss");
c->Message(Chat::White, "simulated_out_packet_loss");
c->Message(Chat::White, "resend_timeout");
c->Message(Chat::White, "connection_close_time");
}
}
else {
c->Message(Chat::White, "Unknown command: %s", sep->arg[1]);
c->Message(Chat::White, "Network commands avail:");
c->Message(Chat::White, "getopt optname - Retrieve the current option value set.");
c->Message(Chat::White, "setopt optname - Set the current option allowed.");
}
}

View File

@ -1,18 +0,0 @@
#include "../client.h"
void command_npcstats(Client *c, const Seperator *sep)
{
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
NPC *target = c->GetTarget()->CastToNPC();
// Stats
target->ShowStats(c);
// Loot Data
target->QueryLoot(c);
}
else {
c->Message(Chat::White, "You must target an NPC to use this command.");
}
}

View File

@ -1,17 +0,0 @@
#include "../client.h"
void command_peqzone_flags(Client *c, const Seperator *sep)
{
Client *target = c;
if (
c->GetTarget() &&
c->GetTarget()->IsClient() &&
c->Admin() >= minStatusToSeeOthersZoneFlags
) {
target = c->GetTarget()->CastToClient();
}
target->SendPEQZoneFlagInfo(c);
}

View File

@ -1,39 +0,0 @@
#include "../client.h"
void command_petitioninfo(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
c->Message(Chat::White, "Usage: #petitioninfo (petition number) Type #listpetition for a list");
return;
}
std::string query = "SELECT petid, charname, accountname, zone, charclass, charrace, charlevel FROM petitions ORDER BY petid";
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}
LogInfo("Petition information request from [{}], petition number:", c->GetName(), Strings::ToInt(sep->argplus[1]));
if (results.RowCount() == 0) {
c->Message(Chat::Red, "There was an error in your request: ID not found! Please check the Id and try again.");
return;
}
for (auto row = results.begin(); row != results.end(); ++row)
if (strcasecmp(row[0], sep->argplus[1]) == 0) {
c->Message(
Chat::Red,
" ID : %s Character Name: %s Account Name: %s Zone: %s Character Class: %s Character Race: %s Character Level: %s",
row[0],
row[1],
row[2],
row[3],
row[4],
row[5],
row[6]
);
}
}

View File

@ -1,74 +0,0 @@
#include "../client.h"
void command_proximity(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || (c->GetTarget() && !c->GetTarget()->IsNPC())) {
c->Message(Chat::White, "You must target an NPC");
return;
}
for (auto &iter : entity_list.GetNPCList()) {
auto npc = iter.second;
std::string name = npc->GetName();
if (name.find("Proximity") != std::string::npos) {
npc->Depop();
}
}
NPC *npc = c->GetTarget()->CastToNPC();
std::vector<FindPerson_Point> points;
FindPerson_Point p{};
if (npc->IsProximitySet()) {
glm::vec4 position;
position.w = npc->GetHeading();
position.x = npc->GetProximityMinX();
position.y = npc->GetProximityMinY();
position.z = npc->GetZ();
position.x = npc->GetProximityMinX();
position.y = npc->GetProximityMinY();
NPC::SpawnNodeNPC("Proximity", "", position);
position.x = npc->GetProximityMinX();
position.y = npc->GetProximityMaxY();
NPC::SpawnNodeNPC("Proximity", "", position);
position.x = npc->GetProximityMaxX();
position.y = npc->GetProximityMinY();
NPC::SpawnNodeNPC("Proximity", "", position);
position.x = npc->GetProximityMaxX();
position.y = npc->GetProximityMaxY();
NPC::SpawnNodeNPC("Proximity", "", position);
p.x = npc->GetProximityMinX();
p.y = npc->GetProximityMinY();
p.z = npc->GetZ();
points.push_back(p);
p.x = npc->GetProximityMinX();
p.y = npc->GetProximityMaxY();
points.push_back(p);
p.x = npc->GetProximityMaxX();
p.y = npc->GetProximityMaxY();
points.push_back(p);
p.x = npc->GetProximityMaxX();
p.y = npc->GetProximityMinY();
points.push_back(p);
p.x = npc->GetProximityMinX();
p.y = npc->GetProximityMinY();
points.push_back(p);
}
if (c->ClientVersion() >= EQ::versions::ClientVersion::RoF) {
c->SendPathPacket(points);
}
}

View File

@ -1,33 +0,0 @@
#include "../client.h"
#include "../quest_parser_collection.h"
void command_questerrors(Client *c, const Seperator *sep)
{
std::list<std::string> quest_errors;
parse->GetErrors(quest_errors);
if (quest_errors.size()) {
c->Message(Chat::White, "Quest errors currently are as follows:");
int error_index = 0;
for (auto quest_error : quest_errors) {
if (error_index >= RuleI(World, MaximumQuestErrors)) {
c->Message(
Chat::White,
fmt::format(
"Maximum of {} error{} shown.",
RuleI(World, MaximumQuestErrors),
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
).c_str()
);
break;
}
c->Message(Chat::White, quest_error.c_str());
error_index++;
}
} else {
c->Message(Chat::White, "There are no Quest errors currently.");
}
}

View File

@ -1,126 +0,0 @@
#include "../client.h"
#include "../dialogue_window.h"
#include "../../common/serverinfo.h"
void command_serverinfo(Client *c, const Seperator *sep)
{
auto os = EQ::GetOS();
auto cpus = EQ::GetCPUs();
auto process_id = EQ::GetPID();
auto rss = EQ::GetRSS() / 1048576.0;
auto uptime = static_cast<uint32>(EQ::GetUptime());
std::string popup_table;
auto popup_text = DialogueWindow::CenterMessage(
DialogueWindow::ColorMessage("green", "Operating System Information")
);
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("Machine") +
DialogueWindow::TableCell(os.machine)
).c_str()
);
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("System") +
DialogueWindow::TableCell(os.sysname)
).c_str()
);
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("Release") +
DialogueWindow::TableCell(os.release)
).c_str()
);
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("Uptime") +
DialogueWindow::TableCell(Strings::SecondsToTime(uptime))
).c_str()
);
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("Version") +
DialogueWindow::TableCell(os.version)
).c_str()
);
popup_text.append(DialogueWindow::Table(popup_table));
popup_table = std::string();
popup_text.append(DialogueWindow::Break());
popup_text.append(
DialogueWindow::CenterMessage(
DialogueWindow::ColorMessage("green", "CPU Information")
)
);
for (size_t cpu = 0; cpu < cpus.size(); ++cpu) {
auto &current_cpu = cpus[cpu];
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell(
fmt::format(
"CPU {}",
cpu
)
) +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f}GHz)",
current_cpu.model,
current_cpu.speed
)
)
)
);
}
popup_text.append(DialogueWindow::Table(popup_table));
popup_table = std::string();
popup_text.append(DialogueWindow::Break());
popup_text.append(
DialogueWindow::CenterMessage(
DialogueWindow::ColorMessage("green", "CPU Information")
)
);
popup_text.append("<table>");
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("Process ID") +
DialogueWindow::TableCell(std::to_string(process_id))
)
);
popup_table.append(
DialogueWindow::TableRow(
DialogueWindow::TableCell("RSS") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f} MB",
rss
)
)
)
);
popup_text.append(DialogueWindow::Table(popup_table));
c->SendPopupToClient(
"Server Information",
popup_text.c_str()
);
}

142
zone/gm_commands/show.cpp Executable file
View File

@ -0,0 +1,142 @@
#include "../client.h"
#include "show/aggro.cpp"
#include "show/buffs.cpp"
#include "show/buried_corpse_count.cpp"
#include "show/client_version_summary.cpp"
#include "show/currencies.cpp"
#include "show/distance.cpp"
#include "show/emotes.cpp"
#include "show/field_of_view.cpp"
#include "show/flags.cpp"
#include "show/group_info.cpp"
#include "show/hatelist.cpp"
#include "show/inventory.cpp"
#include "show/ip_lookup.cpp"
#include "show/line_of_sight.cpp"
#include "show/network.cpp"
#include "show/network_stats.cpp"
#include "show/npc_global_loot.cpp"
#include "show/npc_stats.cpp"
#include "show/npc_type.cpp"
#include "show/peqzone_flags.cpp"
#include "show/petition.cpp"
#include "show/petition_info.cpp"
#include "show/proximity.cpp"
#include "show/quest_errors.cpp"
#include "show/quest_globals.cpp"
#include "show/recipe.cpp"
#include "show/server_info.cpp"
#include "show/skills.cpp"
#include "show/spawn_status.cpp"
#include "show/spells.cpp"
#include "show/spells_list.cpp"
#include "show/stats.cpp"
#include "show/timers.cpp"
#include "show/traps.cpp"
#include "show/uptime.cpp"
#include "show/variable.cpp"
#include "show/version.cpp"
#include "show/waypoints.cpp"
#include "show/who.cpp"
#include "show/xtargets.cpp"
#include "show/zone_data.cpp"
#include "show/zone_global_loot.cpp"
#include "show/zone_loot.cpp"
#include "show/zone_points.cpp"
#include "show/zone_status.cpp"
void command_show(Client *c, const Seperator *sep)
{
struct Cmd {
std::string cmd{}; // command
std::string u{}; // usage
void (*fn)(Client *c, const Seperator *sep) = nullptr; // function
std::vector<std::string> a{}; // aliases
};
std::vector<Cmd> commands = {
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
Cmd{.cmd = "client_version_summary", .u = "client_version_summary", .fn = ShowClientVersionSummary, .a = {"#cvs"}},
Cmd{.cmd = "currencies", .u = "currencies", .fn = ShowCurrencies, .a = {"#viewcurrencies"}},
Cmd{.cmd = "distance", .u = "distance", .fn = ShowDistance, .a = {"#distance"}},
Cmd{.cmd = "emotes", .u = "emotes", .fn = ShowEmotes, .a = {"#emoteview"}},
Cmd{.cmd = "field_of_view", .u = "field_of_view", .fn = ShowFieldOfView, .a = {"#fov"}},
Cmd{.cmd = "flags", .u = "flags", .fn = ShowFlags, .a = {"#flags"}},
Cmd{.cmd = "group_info", .u = "group_info", .fn = ShowGroupInfo, .a = {"#ginfo"}},
Cmd{.cmd = "hatelist", .u = "hatelist", .fn = ShowHateList, .a = {"#hatelist"}},
Cmd{.cmd = "inventory", .u = "inventory", .fn = ShowInventory, .a = {"#peekinv"}},
Cmd{.cmd = "ip_lookup", .u = "ip_lookup", .fn = ShowIPLookup, .a = {"#iplookup"}},
Cmd{.cmd = "line_of_sight", .u = "line_of_sight", .fn = ShowLineOfSight, .a = {"#checklos"}},
Cmd{.cmd = "network", .u = "network", .fn = ShowNetwork, .a = {"#network"}},
Cmd{.cmd = "network_stats", .u = "network_stats", .fn = ShowNetworkStats, .a = {"#netstats"}},
Cmd{.cmd = "npc_global_loot", .u = "npc_global_loot", .fn = ShowNPCGlobalLoot, .a = {"#shownpcgloballoot"}},
Cmd{.cmd = "npc_stats", .u = "npc_stats", .fn = ShowNPCStats, .a = {"#npcstats"}},
Cmd{.cmd = "npc_type", .u = "npc_type [NPC ID]", .fn = ShowNPCType, .a = {"#viewnpctype"}},
Cmd{.cmd = "peqzone_flags", .u = "peqzone_flags", .fn = ShowPEQZoneFlags, .a = {"#peqzone_flags"}},
Cmd{.cmd = "petition", .u = "petition", .fn = ShowPetition, .a = {"#listpetition", "#viewpetition"}},
Cmd{.cmd = "petition_info", .u = "petition_info", .fn = ShowPetitionInfo, .a = {"#petitioninfo"}},
Cmd{.cmd = "proximity", .u = "proximity", .fn = ShowProximity, .a = {"#proximity"}},
Cmd{.cmd = "quest_errors", .u = "quest_errors", .fn = ShowQuestErrors, .a = {"#questerrors"}},
Cmd{.cmd = "quest_globals", .u = "quest_globals", .fn = ShowQuestGlobals, .a = {"#globalview"}},
Cmd{.cmd = "recipe", .u = "recipe [Recipe ID]", .fn = ShowRecipe, .a = {"#viewrecipe"}},
Cmd{.cmd = "server_info", .u = "server_info", .fn = ShowServerInfo, .a = {"#serverinfo"}},
Cmd{.cmd = "skills", .u = "skills", .fn = ShowSkills, .a = {"#showskills"}},
Cmd{.cmd = "spawn_status", .u = "spawn_status [all|disabled|enabled|Spawn ID]", .fn = ShowSpawnStatus, .a = {"#spawnstatus"}},
Cmd{.cmd = "spells", .u = "spells [disciplines|spells]", .fn = ShowSpells, .a = {"#showspells"}},
Cmd{.cmd = "spells_list", .u = "spells_list", .fn = ShowSpellsList, .a = {"#showspellslist"}},
Cmd{.cmd = "stats", .u = "stats", .fn = ShowStats, .a = {"#showstats"}},
Cmd{.cmd = "timers", .u = "timers", .fn = ShowTimers, .a = {"#timers"}},
Cmd{.cmd = "traps", .u = "traps", .fn = ShowTraps, .a = {"#trapinfo"}},
Cmd{.cmd = "uptime", .u = "uptime [Zone Server ID] (Zone Server ID is optional)", .fn = ShowUptime, .a = {"#uptime"}},
Cmd{.cmd = "variable", .u = "variable [Variable Name]", .fn = ShowVariable, .a = {"#getvariable"}},
Cmd{.cmd = "version", .u = "version", .fn = ShowVersion, .a = {"#version"}},
Cmd{.cmd = "waypoints", .u = "waypoints", .fn = ShowWaypoints, .a = {"#wpinfo"}},
Cmd{.cmd = "who", .u = "who [Search Criteria] (Search criteria is optional)", .fn = ShowWho, .a = {"#who"}},
Cmd{.cmd = "xtargets", .u = "xtargets [Amount] (Amount is optional)", .fn = ShowXTargets, .a = {"#xtargets"}},
Cmd{.cmd = "zone_data", .u = "zone_data", .fn = ShowZoneData, .a = {"#zstats"}},
Cmd{.cmd = "zone_global_loot", .u = "zone_global_loot", .fn = ShowZoneGlobalLoot, .a = {"#showzonegloballoot"}},
Cmd{.cmd = "zone_loot", .u = "zone_loot", .fn = ShowZoneLoot, .a = {"#viewzoneloot"}},
Cmd{.cmd = "zone_points", .u = "zone_points", .fn = ShowZonePoints, .a = {"#showzonepoints"}},
Cmd{.cmd = "zone_status", .u = "zone_status", .fn = ShowZoneStatus, .a = {"#zonestatus"}},
};
// Check for arguments
const auto arguments = sep->argnum;
// look for alias or command
for (const auto &cmd: commands) {
// Check for alias first
for (const auto &alias: cmd.a) {
if (!alias.empty() && Strings::EqualFold(alias, sep->arg[0])) {
// build string from sep args
std::vector<std::string> args = {};
// skip the first arg
for (auto i = 1; i <= arguments; i++) {
args.emplace_back(sep->arg[i]);
}
// build the rewrite string
const std::string& rewrite = fmt::format("#show {} {}", cmd.cmd, Strings::Join(args, " "));
// rewrite to #show <sub-command <args>
c->SendGMCommand(rewrite);
return;
}
}
// Check for command
if (cmd.cmd == Strings::ToLower(sep->arg[1])) {
cmd.fn(c, sep);
return;
}
}
// Command not found
c->Message(Chat::White, "Command not found. Usage: #show [command]");
for (const auto &cmd: commands) {
c->Message(Chat::White, fmt::format("Usage: #show {}", cmd.u).c_str());
}
}

22
zone/gm_commands/show/aggro.cpp Executable file
View File

@ -0,0 +1,22 @@
#include "../../client.h"
void ShowAggro(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (arguments < 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Usage: #show aggro [Distance] [-v] (-v is verbose Faction Information)");
return;
}
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
const auto t = c->GetTarget()->CastToNPC();
const float distance = Strings::ToFloat(sep->arg[2]);
const bool is_verbose = Strings::EqualFold(sep->arg[3], "-v");
entity_list.DescribeAggro(c, t, distance, is_verbose);
}

View File

@ -1,6 +1,6 @@
#include "../client.h" #include "../../client.h"
void command_showbuffs(Client *c, const Seperator *sep) void ShowBuffs(Client *c, const Seperator *sep)
{ {
Mob* t = c; Mob* t = c;
if (c->GetTarget()) { if (c->GetTarget()) {
@ -9,4 +9,3 @@ void command_showbuffs(Client *c, const Seperator *sep)
t->ShowBuffs(c); t->ShowBuffs(c);
} }

View File

@ -0,0 +1,23 @@
#include "../../client.h"
#include "../../corpse.h"
void ShowBuriedCorpseCount(Client *c, const Seperator *sep)
{
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
t = c->GetTarget()->CastToClient();
}
const uint32 corpse_count = database.GetCharacterBuriedCorpseCount(t->CharacterID());
c->Message(
Chat::White,
fmt::format(
"{} {} {} buried corpse{}.",
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
c == t ? "have" : "has",
corpse_count,
corpse_count != 1 ? "s" : ""
).c_str()
);
}

View File

@ -0,0 +1,16 @@
#include "../../client.h"
#include "../../worldserver.h"
extern WorldServer worldserver;
void ShowClientVersionSummary(Client *c, const Seperator *sep)
{
auto pack = new ServerPacket(ServerOP_ClientVersionSummary, sizeof(ServerRequestClientVersionSummary_Struct));
auto s = (ServerRequestClientVersionSummary_Struct *) pack->pBuffer;
strn0cpy(s->Name, c->GetName(), sizeof(s->Name));
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -0,0 +1,136 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowCurrencies(Client *c, const Seperator *sep)
{
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
const uint32 platinum = (
t->GetMoney(3, 0) +
t->GetMoney(3, 1) +
t->GetMoney(3, 2) +
t->GetMoney(3, 3)
);
const uint32 gold = (
t->GetMoney(2, 0) +
t->GetMoney(2, 1) +
t->GetMoney(2, 2)
);
const uint32 silver = (
t->GetMoney(1, 0) +
t->GetMoney(1, 1) +
t->GetMoney(1, 2)
);
const uint32 copper = (
t->GetMoney(0, 0) +
t->GetMoney(0, 1) +
t->GetMoney(0, 2)
);
std::string currency_table;
bool has_currency = false;
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Currency") +
DialogueWindow::TableCell("Amount")
);
if (
platinum ||
gold ||
silver ||
copper
) {
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Money") +
DialogueWindow::TableCell(Strings::Money(platinum, gold, silver, copper))
);
has_currency = true;
}
const uint32 ebon_crystals = t->GetEbonCrystals();
if (ebon_crystals) {
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Ebon Crystals") +
DialogueWindow::TableCell(Strings::Commify(ebon_crystals))
);
has_currency = true;
}
const uint32 radiant_crystals = t->GetRadiantCrystals();
if (radiant_crystals) {
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Radiant Crystals") +
DialogueWindow::TableCell(Strings::Commify(radiant_crystals))
);
has_currency = true;
}
for (const auto& a : zone->AlternateCurrencies) {
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
if (currency_value) {
const auto* d = database.GetItem(a.item_id);
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(d->Name) +
DialogueWindow::TableCell(Strings::Commify(currency_value))
);
has_currency = true;
}
}
for (const auto& l : EQ::constants::GetLDoNThemeMap()) {
const uint32 ldon_currency_value = t->GetLDoNPointsTheme(l.first);
if (ldon_currency_value) {
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(l.second) +
DialogueWindow::TableCell(Strings::Commify(ldon_currency_value))
);
has_currency = true;
}
}
const uint32 pvp_points = t->GetPVPPoints();
if (pvp_points) {
currency_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("PVP Points") +
DialogueWindow::TableCell(Strings::Commify(pvp_points))
);
has_currency = true;
}
currency_table = DialogueWindow::Table(currency_table);
if (!has_currency) {
c->Message(
Chat::White,
fmt::format(
"{} {} not have any currencies.",
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
c == t ? "do" : "does"
).c_str()
);
return;
}
c->SendPopupToClient(
fmt::format(
"Currency for {}",
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
).c_str(),
currency_table.c_str()
);
}

View File

@ -0,0 +1,23 @@
#include "../../client.h"
void ShowDistance(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || c->GetTarget() == c) {
c->Message(Chat::White, "You must have a target to use this command.");
return;
}
const auto t = c->GetTarget();
c->Message(
Chat::White,
fmt::format(
"{} is {:.2f} units from you.",
c->GetTargetDescription(t),
Distance(
c->GetPosition(),
t->GetPosition()
)
).c_str()
);
}

View File

@ -1,29 +1,27 @@
#include "../client.h" #include "../../client.h"
void command_emoteview(Client *c, const Seperator *sep) void ShowEmotes(Client *c, const Seperator *sep)
{ {
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to view their emotes."); c->Message(Chat::White, "You must target an NPC to view their emotes.");
return; return;
} }
auto target = c->GetTarget()->CastToNPC(); const auto t = c->GetTarget()->CastToNPC();
auto emote_count = 0; uint32 emote_count = 0;
auto emote_id = target->GetEmoteID(); const uint32 emote_id = t->GetEmoteID();
auto emote_number = 1;
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList); LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
iterator.Reset(); iterator.Reset();
while (iterator.MoreElements()) { while (iterator.MoreElements()) {
auto &e = iterator.GetData(); const auto& e = iterator.GetData();
if (emote_id == e->emoteid) { if (emote_id == e->emoteid) {
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Emote {} | Event: {} ({}) Type: {} ({})", "Emote {} | Event: {} ({}) Type: {} ({})",
emote_number, e->emoteid,
EQ::constants::GetEmoteEventTypeName(e->event_), EQ::constants::GetEmoteEventTypeName(e->event_),
e->event_, e->event_,
EQ::constants::GetEmoteTypeName(e->type), EQ::constants::GetEmoteTypeName(e->type),
@ -35,35 +33,22 @@ void command_emoteview(Client *c, const Seperator *sep)
Chat::White, Chat::White,
fmt::format( fmt::format(
"Emote {} | Text: {}", "Emote {} | Text: {}",
emote_number, e->emoteid,
e->text e->text
).c_str() ).c_str()
); );
emote_count++; emote_count++;
emote_number++;
} }
iterator.Advance(); iterator.Advance();
} }
if (!emote_count) {
c->Message(
Chat::White,
fmt::format(
"{} has no emotes on Emote ID {}.",
c->GetTargetDescription(target),
emote_id
).c_str()
);
return;
}
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"{} has {} emote{} on Emote ID {}.", "{} has {} emote{} on Emote ID {}.",
c->GetTargetDescription(target), c->GetTargetDescription(t),
emote_count, emote_count,
emote_count != 1 ? "s" : "", emote_count != 1 ? "s" : "",
emote_id emote_id

View File

@ -0,0 +1,23 @@
#include "../../client.h"
void ShowFieldOfView(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || c->GetTarget() == c) {
c->Message(Chat::White, "You must have a target to use this command.");
return;
}
const auto t = c->GetTarget();
const bool is_behind = c->BehindMob(t, c->GetX(), c->GetY());
c->Message(
Chat::White,
fmt::format(
"You are {}behind {}, they have a heading of {}.",
is_behind ? "" : "not ",
c->GetTargetDescription(t),
t->GetHeading()
).c_str()
);
}

View File

@ -0,0 +1,16 @@
#include "../../client.h"
void ShowFlags(Client *c, const Seperator *sep)
{
auto t = c;
if (
c->GetTarget() &&
c->GetTarget()->IsClient() &&
c->Admin() >= minStatusToSeeOthersZoneFlags
) {
t = c->GetTarget()->CastToClient();
}
t->SendZoneFlagInfo(c);
}

View File

@ -0,0 +1,89 @@
#include "../../client.h"
#include "../../dialogue_window.h"
#include "../../groups.h"
void ShowGroupInfo(Client *c, const Seperator *sep)
{
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
auto g = t->GetGroup();
if (!g) {
c->Message(
Chat::White,
fmt::format(
"{} {} not in a group.",
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
c == t ? "are" : "is"
).c_str()
);
return;
}
std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Group ID") +
DialogueWindow::TableCell(Strings::Commify(g->GetID()))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Members") +
DialogueWindow::TableCell(std::to_string(g->GroupCount()))
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Index") +
DialogueWindow::TableCell("Name") +
DialogueWindow::TableCell("In Zone") +
DialogueWindow::TableCell("Assist") +
DialogueWindow::TableCell("Puller") +
DialogueWindow::TableCell("Tank")
);
const std::string yes = DialogueWindow::ColorMessage("forest_green", "Y");
const std::string no = DialogueWindow::ColorMessage("red1", "N");
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
if (g->membername[group_member][0] == '\0') {
continue;
}
const bool is_assist = g->MemberRoles[group_member] & RoleAssist;
const bool is_puller = g->MemberRoles[group_member] & RolePuller;
const bool is_tank = g->MemberRoles[group_member] & RoleTank;
popup_table += DialogueWindow::TableRow(
fmt::format(
"{}{}{}{}{}{}",
group_member,
(
strcmp(g->membername[group_member], c->GetCleanName()) ?
g->membername[group_member] :
fmt::format(
"{} (You)",
g->membername[group_member]
)
),
g->members[group_member] ? yes : no,
is_assist ? yes : no,
is_puller ? yes : no,
is_tank ? yes : no
)
);
}
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient(
fmt::format(
"Group Info for {}",
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
).c_str(),
popup_table.c_str()
);
}

View File

@ -1,13 +1,13 @@
#include "../client.h" #include "../../client.h"
void command_hatelist(Client *c, const Seperator *sep) void ShowHateList(Client *c, const Seperator *sep)
{ {
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;
} }
auto target = c->GetTarget(); const auto t = c->GetTarget();
target->PrintHateListToClient(c); t->PrintHateListToClient(c);
} }

View File

@ -1,11 +1,11 @@
#include "../client.h" #include "../../client.h"
#include "../object.h" #include "../../object.h"
void command_peekinv(Client *c, const Seperator *sep) void ShowInventory(Client *c, const Seperator *sep)
{ {
auto arguments = sep->argnum; const auto arguments = sep->argnum;
if (!arguments) { if (arguments < 2) {
SendPeekInvSubCommands(c); SendShowInventorySubCommands(c);
return; return;
} }
@ -50,19 +50,19 @@ void command_peekinv(Client *c, const Seperator *sep)
int scope_mask = peekNone; int scope_mask = peekNone;
const bool is_all = !strcasecmp(sep->arg[1], "all"); const bool is_all = !strcasecmp(sep->arg[2], "all");
const bool is_all_bank = !strcasecmp(sep->arg[1], "allbank"); const bool is_all_bank = !strcasecmp(sep->arg[2], "allbank");
const bool is_bank = !strcasecmp(sep->arg[1], "bank"); const bool is_bank = !strcasecmp(sep->arg[2], "bank");
const bool is_cursor = !strcasecmp(sep->arg[1], "cursor"); const bool is_cursor = !strcasecmp(sep->arg[2], "cursor");
const bool is_cursor_limbo = !strcasecmp(sep->arg[1], "curlimbo"); const bool is_cursor_limbo = !strcasecmp(sep->arg[2], "curlimbo");
const bool is_equipment = !strcasecmp(sep->arg[1], "equip"); const bool is_equipment = !strcasecmp(sep->arg[2], "equip");
const bool is_general = !strcasecmp(sep->arg[1], "gen"); const bool is_general = !strcasecmp(sep->arg[2], "gen");
const bool is_limbo = !strcasecmp(sep->arg[1], "limbo"); const bool is_limbo = !strcasecmp(sep->arg[2], "limbo");
const bool is_possessions = !strcasecmp(sep->arg[1], "poss"); const bool is_possessions = !strcasecmp(sep->arg[2], "poss");
const bool is_shared_bank = !strcasecmp(sep->arg[1], "shbank"); const bool is_shared_bank = !strcasecmp(sep->arg[2], "shbank");
const bool is_trade = !strcasecmp(sep->arg[1], "trade"); const bool is_trade = !strcasecmp(sep->arg[2], "trade");
const bool is_tribute = !strcasecmp(sep->arg[1], "trib"); const bool is_tribute = !strcasecmp(sep->arg[2], "trib");
const bool is_world = !strcasecmp(sep->arg[1], "world"); const bool is_world = !strcasecmp(sep->arg[2], "world");
if (is_all) { if (is_all) {
scope_mask = (peekOutOfScope - 1); scope_mask = (peekOutOfScope - 1);
@ -91,7 +91,7 @@ void command_peekinv(Client *c, const Seperator *sep)
} else if (is_world) { } else if (is_world) {
scope_mask |= peekWorld; scope_mask |= peekWorld;
} else { } else {
SendPeekInvSubCommands(c); SendShowInventorySubCommands(c);
return; return;
} }
@ -433,18 +433,18 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
} }
void SendPeekInvSubCommands(Client* c) { void SendShowInventorySubCommands(Client* c) {
c->Message(Chat::White, "Usage: #peekinv equip - Shows items in Equipment slots"); c->Message(Chat::White, "Usage: #show inventory equip - Shows items in Equipment slots");
c->Message(Chat::White, "Usage: #peekinv gen - Shows items in General slots"); c->Message(Chat::White, "Usage: #show inventory gen - Shows items in General slots");
c->Message(Chat::White, "Usage: #peekinv cursor - Shows items in Cursor slots"); c->Message(Chat::White, "Usage: #show inventory cursor - Shows items in Cursor slots");
c->Message(Chat::White, "Usage: #peekinv poss - Shows items in Equipment, General, and Cursor slots"); c->Message(Chat::White, "Usage: #show inventory poss - Shows items in Equipment, General, and Cursor slots");
c->Message(Chat::White, "Usage: #peekinv limbo - Shows items in Limbo slots"); c->Message(Chat::White, "Usage: #show inventory limbo - Shows items in Limbo slots");
c->Message(Chat::White, "Usage: #peekinv curlim - Shows items in Cursor and Limbo slots"); c->Message(Chat::White, "Usage: #show inventory curlim - Shows items in Cursor and Limbo slots");
c->Message(Chat::White, "Usage: #peekinv trib - Shows items in Tribute slots"); c->Message(Chat::White, "Usage: #show inventory trib - Shows items in Tribute slots");
c->Message(Chat::White, "Usage: #peekinv bank - Shows items in Bank slots"); c->Message(Chat::White, "Usage: #show inventory bank - Shows items in Bank slots");
c->Message(Chat::White, "Usage: #peekinv shbank - Shows items in Shared Bank slots"); c->Message(Chat::White, "Usage: #show inventory shbank - Shows items in Shared Bank slots");
c->Message(Chat::White, "Usage: #peekinv allbank - Shows items in Bank and Shared Bank slots"); c->Message(Chat::White, "Usage: #show inventory allbank - Shows items in Bank and Shared Bank slots");
c->Message(Chat::White, "Usage: #peekinv trade - Shows items in Trade slots"); c->Message(Chat::White, "Usage: #show inventory trade - Shows items in Trade slots");
c->Message(Chat::White, "Usage: #peekinv world - Shows items in World slots"); c->Message(Chat::White, "Usage: #show inventory world - Shows items in World slots");
c->Message(Chat::White, "Usage: #peekinv all - Shows items in all slots"); c->Message(Chat::White, "Usage: #show inventory all - Shows items in all slots");
} }

View File

@ -0,0 +1,25 @@
#include "../../client.h"
#include "../../worldserver.h"
extern WorldServer worldserver;
void ShowIPLookup(Client *c, const Seperator *sep)
{
const uint32 ip_length = strlen(sep->argplus[2]);
auto pack = new ServerPacket(
ServerOP_IPLookup,
sizeof(ServerGenericWorldQuery_Struct) + ip_length + 1
);
auto s = (ServerGenericWorldQuery_Struct *) pack->pBuffer;
strn0cpy(s->from, c->GetName(), sizeof(s->from));
s->admin = c->Admin();
if (ip_length) {
strcpy(s->query, sep->argplus[2]);
}
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -0,0 +1,22 @@
#include "../../client.h"
void ShowLineOfSight(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || c->GetTarget() == c) {
c->Message(Chat::White, "You must have a target to use this command.");
return;
}
const auto t = c->GetTarget();
const bool has_los = c->CheckLosFN(t);
c->Message(
Chat::White,
fmt::format(
"You {}have line of sight to {}.",
has_los ? "" : "do not ",
c->GetTargetDescription(t)
).c_str()
);
}

View File

@ -0,0 +1,138 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowNetwork(Client *c, const Seperator *sep)
{
auto eqsi = c->Connection();
auto manager = eqsi->GetManager();
auto opts = manager->GetOptions();
std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Option") +
DialogueWindow::TableCell("Value")
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Max Packet Size") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.max_packet_size))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Max Connection Count") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.max_connection_count))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Keep Alive Delay") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.keepalive_delay_ms))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay Factor") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}",
opts.daybreak_options.resend_delay_factor
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_ms))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay Minimum") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_min))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Delay Maximum") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_delay_max))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Connect Delay") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connect_delay_ms))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Connect Stale") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connect_stale_ms))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Stale Connection") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.stale_connection_ms))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("CRC Length") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.crc_length))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Hold Size") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.hold_size))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Hold Length") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.hold_length_ms))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Simulated In Packet Loss") +
DialogueWindow::TableCell(std::to_string(opts.daybreak_options.simulated_in_packet_loss))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Simulated Out Packet Loss") +
DialogueWindow::TableCell(std::to_string(opts.daybreak_options.simulated_out_packet_loss))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Tic Rate (Hz)") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}",
opts.daybreak_options.tic_rate_hertz
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resend Timeout") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.resend_timeout))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Connection Close Time") +
DialogueWindow::TableCell(Strings::MillisecondsToTime(opts.daybreak_options.connection_close_time))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Encode Passes (1)") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.encode_passes[0]))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Encode Passes (2)") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.encode_passes[1]))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Port") +
DialogueWindow::TableCell(Strings::Commify(opts.daybreak_options.port))
);
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient(
"Network Information",
popup_table.c_str()
);
}

View File

@ -0,0 +1,297 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowNetworkStats(Client *c, const Seperator *sep)
{
const auto connection = c->Connection();
const auto opts = connection->GetManager()->GetOptions();
const auto eqs_stats = connection->GetStats();
const auto& stats = eqs_stats.DaybreakStats;
const auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
EQ::Net::Clock::now() - stats.created
).count();
std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sent Bytes") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.sent_bytes),
stats.sent_bytes / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Received Bytes") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.recv_bytes),
stats.recv_bytes / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sent Bytes Before Encode") +
DialogueWindow::TableCell(Strings::Commify(stats.bytes_before_encode)) +
DialogueWindow::TableCell("Compression Rate") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}%%",
static_cast<double>(stats.bytes_before_encode - stats.sent_bytes) /
static_cast<double>(stats.bytes_before_encode) * 100.0
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sent Bytes After Encode") +
DialogueWindow::TableCell(Strings::Commify(stats.bytes_after_decode)) +
DialogueWindow::TableCell("Compression Rate") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}%%",
static_cast<double>(stats.bytes_after_decode - stats.recv_bytes) /
static_cast<double>(stats.bytes_after_decode) * 100.0
)
)
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Minimum Ping") +
DialogueWindow::TableCell(Strings::Commify(stats.min_ping))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Maximum Ping") +
DialogueWindow::TableCell(Strings::Commify(stats.max_ping))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Last Ping") +
DialogueWindow::TableCell(Strings::Commify(stats.last_ping))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Average Ping") +
DialogueWindow::TableCell(Strings::Commify(stats.avg_ping))
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Real Time Received Packets") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.recv_packets),
stats.recv_packets / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Real Time Sent Packets") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.sent_packets),
stats.sent_packets / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sync Received Packets") +
DialogueWindow::TableCell(Strings::Commify(stats.sync_recv_packets))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sync Sent Packets") +
DialogueWindow::TableCell(Strings::Commify(stats.sync_sent_packets))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sync Remote Received Packets") +
DialogueWindow::TableCell(Strings::Commify(stats.sync_remote_recv_packets))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sync Remote Sent Packets") +
DialogueWindow::TableCell(Strings::Commify(stats.sync_remote_sent_packets))
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Packet Loss In") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}%%",
(
100.0 *
(
1.0 -
static_cast<double>(stats.sync_recv_packets) /
static_cast<double>(stats.sync_remote_sent_packets)
)
)
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Packet Loss Out") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}%%",
(
100.0 *
(
1.0 -
static_cast<double>(stats.sync_remote_recv_packets) /
static_cast<double>(stats.sync_sent_packets)
)
)
)
)
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resent Packets") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.resent_packets),
stats.resent_packets / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resent Fragments") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.resent_fragments),
stats.resent_fragments / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Resent Non-Fragments") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.resent_full),
stats.resent_full / sec_since_stats_reset
)
)
);
popup_table += DialogueWindow::Break(2);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Dropped Datarate Packets") +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(stats.dropped_datarate_packets),
stats.dropped_datarate_packets / sec_since_stats_reset
)
)
);
if (opts.daybreak_options.outgoing_data_rate > 0.0) {
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Outgoing Link Saturation") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}%% ({:.2f}kb Per Second)",
(
100.0 *
(
1.0 -
(
(
opts.daybreak_options.outgoing_data_rate -
stats.datarate_remaining
) /
opts.daybreak_options.outgoing_data_rate
)
)
),
opts.daybreak_options.outgoing_data_rate
)
)
);
}
popup_table += DialogueWindow::Break(2);
std::string sent_rows;
for (int i = 0; i < _maxEmuOpcode; ++i) {
const int count = eqs_stats.SentCount[i];
if (count) {
sent_rows += DialogueWindow::TableRow(
DialogueWindow::TableCell(OpcodeNames[i]) +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(count),
count / sec_since_stats_reset
)
)
);
}
}
std::string recv_rows;
for (int i = 0; i < _maxEmuOpcode; ++i) {
const int count = eqs_stats.RecvCount[i];
if (count) {
recv_rows += DialogueWindow::TableRow(
DialogueWindow::TableCell(OpcodeNames[i]) +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f} Per Second)",
Strings::Commify(count),
count / sec_since_stats_reset
)
)
);
}
}
popup_table += DialogueWindow::TableRow(DialogueWindow::TableCell("Sent Packet Types"));
popup_table += sent_rows;
popup_table += DialogueWindow::TableRow(DialogueWindow::TableCell("Received Packet Types"));
popup_table += recv_rows;
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient(
"Network Statistics",
popup_table.c_str()
);
}

View File

@ -1,6 +1,6 @@
#include "../client.h" #include "../../client.h"
void command_shownpcgloballoot(Client *c, const Seperator *sep) void ShowNPCGlobalLoot(Client *c, const Seperator *sep)
{ {
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.");
@ -11,4 +11,3 @@ void command_shownpcgloballoot(Client *c, const Seperator *sep)
zone->ShowNPCGlobalLoot(c, t); zone->ShowNPCGlobalLoot(c, t);
} }

View File

@ -0,0 +1,17 @@
#include "../../client.h"
void ShowNPCStats(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
const auto t = c->GetTarget()->CastToNPC();
// Stats
t->ShowStats(c);
// Loot Data
t->QueryLoot(c);
}

View File

@ -0,0 +1,35 @@
#include "../../client.h"
void ShowNPCType(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(2)) {
c->Message(Chat::White, "Usage: #show npc_type [NPC ID]");
return;
}
const uint32 npc_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto d = content_db.LoadNPCTypesData(npc_id);
if (!d) {
c->Message(
Chat::White,
fmt::format(
"NPC ID {} was not found.",
npc_id
).c_str()
);
return;
}
auto npc = new NPC(
d,
nullptr,
c->GetPosition(),
GravityBehavior::Water
);
npc->ShowStats(c);
safe_delete(npc);
}

View File

@ -0,0 +1,15 @@
#include "../../client.h"
void ShowPEQZoneFlags(Client *c, const Seperator *sep)
{
auto t = c;
if (
c->GetTarget() &&
c->GetTarget()->IsClient() &&
c->Admin() >= minStatusToSeeOthersZoneFlags
) {
t = c->GetTarget()->CastToClient();
}
t->SendPEQZoneFlagInfo(c);
}

View File

@ -0,0 +1,69 @@
#include "../../client.h"
#include "../../common/repositories/petitions_repository.h"
void ShowPetition(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(2)) {
const auto& l = PetitionsRepository::All(database);
uint32 found_count = 0;
for (const auto& e : l) {
c->Message(
Chat::White,
fmt::format(
"Petition {} | Name: {} Text: {}",
e.petid,
e.charname,
e.petitiontext
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(Chat::White, "50 Petitions found, max reached.");
}
c->Message(
Chat::White,
fmt::format(
"{} Petition{} found.",
found_count,
found_count != 1 ? "s" : ""
).c_str()
);
return;
}
const uint32 petition_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& l = PetitionsRepository::GetWhere(database, fmt::format("petition_id = {}", petition_id));
if (l.empty()) {
c->Message(
Chat::White,
fmt::format(
"Petition ID {} was not found.",
petition_id
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Petition {} | Name: {} Text: {}",
l[0].petid,
l[0].charname,
l[0].petitiontext
).c_str()
);
}

View File

@ -0,0 +1,79 @@
#include "../../client.h"
#include "../../common/repositories/petitions_repository.h"
void ShowPetitionInfo(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(2)) {
const auto& l = PetitionsRepository::All(database);
uint32 found_count = 0;
for (const auto& e : l) {
c->Message(
Chat::White,
fmt::format(
"Petition {} | Name: {} Text: {} Account: {} Zone: {} Class: {} Race: {} Level: {}",
e.petid,
e.charname,
e.petitiontext,
e.accountname,
e.zone,
GetClassIDName(static_cast<uint8>(e.charclass)),
GetRaceIDName(static_cast<uint16>(e.charrace)),
e.charlevel
).c_str()
);
found_count++;
if (found_count == 50) {
break;
}
}
if (found_count == 50) {
c->Message(Chat::White, "50 Petitions found, max reached.");
}
c->Message(
Chat::White,
fmt::format(
"{} Petition{} found.",
found_count,
found_count != 1 ? "s" : ""
).c_str()
);
return;
}
const uint32 petition_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& l = PetitionsRepository::GetWhere(database, fmt::format("petition_id = {}", petition_id));
if (l.empty()) {
c->Message(
Chat::White,
fmt::format(
"Petition ID {} was not found.",
petition_id
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Petition {} | Name: {} Text: {} Account: {} Zone: {} Class: {} Race: {} Level: {}",
l[0].petid,
l[0].charname,
l[0].petitiontext,
l[0].accountname,
l[0].zone,
GetClassIDName(static_cast<uint8>(l[0].charclass)),
GetRaceIDName(static_cast<uint16>(l[0].charrace)),
l[0].charlevel
).c_str()
);
}

View File

@ -0,0 +1,73 @@
#include "../../client.h"
void ShowProximity(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
for (const auto& n : entity_list.GetNPCList()) {
if (
n.second &&
Strings::Contains(n.second->GetName(), "Proximity")
) {
n.second->Depop();
}
}
const auto t = c->GetTarget()->CastToNPC();
std::vector<FindPerson_Point> v;
FindPerson_Point p {};
if (t->IsProximitySet()) {
glm::vec4 position;
position.w = t->GetHeading();
position.x = t->GetProximityMinX();
position.y = t->GetProximityMinY();
position.z = t->GetZ();
position.x = t->GetProximityMinX();
position.y = t->GetProximityMinY();
NPC::SpawnNodeNPC("Proximity", "", position);
position.x = t->GetProximityMinX();
position.y = t->GetProximityMaxY();
NPC::SpawnNodeNPC("Proximity", "", position);
position.x = t->GetProximityMaxX();
position.y = t->GetProximityMinY();
NPC::SpawnNodeNPC("Proximity", "", position);
position.x = t->GetProximityMaxX();
position.y = t->GetProximityMaxY();
NPC::SpawnNodeNPC("Proximity", "", position);
p.x = t->GetProximityMinX();
p.y = t->GetProximityMinY();
p.z = t->GetZ();
v.push_back(p);
p.x = t->GetProximityMinX();
p.y = t->GetProximityMaxY();
v.push_back(p);
p.x = t->GetProximityMaxX();
p.y = t->GetProximityMaxY();
v.push_back(p);
p.x = t->GetProximityMaxX();
p.y = t->GetProximityMinY();
v.push_back(p);
p.x = t->GetProximityMinX();
p.y = t->GetProximityMinY();
v.push_back(p);
}
if (c->ClientVersion() >= EQ::versions::ClientVersion::RoF) {
c->SendPathPacket(v);
}
}

View File

@ -0,0 +1,35 @@
#include "../../client.h"
#include "../../quest_parser_collection.h"
void ShowQuestErrors(Client *c, const Seperator *sep)
{
std::list<std::string> l;
parse->GetErrors(l);
if (!l.size()) {
c->Message(Chat::White, "There are no Quest errors currently.");
return;
}
c->Message(Chat::White, "Quest errors currently are as follows:");
uint32 error_count = 0;
for (const auto& e : l) {
if (error_count >= RuleI(World, MaximumQuestErrors)) {
c->Message(
Chat::White,
fmt::format(
"Maximum of {} error{} shown.",
RuleI(World, MaximumQuestErrors),
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
).c_str()
);
break;
}
c->Message(Chat::White, e.c_str());
error_count++;
}
}

View File

@ -0,0 +1,76 @@
#include "../../client.h"
void ShowQuestGlobals(Client *c, const Seperator *sep)
{
Mob* t = c;
if (c->GetTarget()) {
t = c->GetTarget();
}
QGlobalCache* char_cache = c->GetQGlobals();
QGlobalCache* npc_cache = t->IsNPC() ? t->CastToNPC()->GetQGlobals() : nullptr;
QGlobalCache* zone_cache = zone->GetQGlobals();
std::list<QGlobal> global_map;
uint32 character_id = c->CharacterID();
uint32 npc_id = t->IsNPC() ? t->CastToNPC()->GetNPCTypeID() : 0;
uint32 zone_id = zone->GetZoneID();
if (npc_cache) {
QGlobalCache::Combine(
global_map,
npc_cache->GetBucket(),
npc_id,
character_id,
zone_id
);
}
if (char_cache) {
QGlobalCache::Combine(
global_map,
char_cache->GetBucket(),
npc_id,
character_id,
zone_id
);
}
if (zone_cache) {
QGlobalCache::Combine(
global_map,
zone_cache->GetBucket(),
npc_id,
character_id,
zone_id
);
}
uint32 global_count = 0;
uint32 global_number = 1;
for (const auto& g : global_map) {
c->Message(
Chat::White,
fmt::format(
"Quest Global {} | Name: {} Value: {}",
global_number,
g.name,
g.value
).c_str()
);
global_count++;
global_number++;
}
c->Message(
Chat::White,
fmt::format(
"{} Quest Global{} found.",
global_count,
global_count != 1 ? "s" : ""
).c_str()
);
}

View File

@ -1,32 +1,33 @@
#include "../client.h" #include "../../client.h"
#include "../command.h" #include "../../command.h"
#include "../../common/repositories/tradeskill_recipe_repository.h" #include "../../common/repositories/tradeskill_recipe_repository.h"
#include "../../common/repositories/tradeskill_recipe_entries_repository.h" #include "../../common/repositories/tradeskill_recipe_entries_repository.h"
void command_viewrecipe(Client *c, const Seperator *sep) void ShowRecipe(Client *c, const Seperator *sep)
{ {
int arguments = sep->argnum; if (!sep->IsNumber(2)) {
if (!arguments || !sep->IsNumber(1)) { c->Message(Chat::White, "Command Syntax: #show recipe [Recipe ID]");
c->Message(Chat::White, "Command Syntax: #viewrecipe [Recipe ID]");
return; return;
} }
auto recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1])); const uint16 recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
auto re = TradeskillRecipeEntriesRepository::GetWhere(
const auto& re = TradeskillRecipeEntriesRepository::GetWhere(
database, database,
fmt::format("recipe_id = {} ORDER BY id ASC", recipe_id) fmt::format("recipe_id = {} ORDER BY id ASC", recipe_id)
); );
auto r = TradeskillRecipeRepository::GetWhere(
const auto& r = TradeskillRecipeRepository::GetWhere(
database, database,
fmt::format("id = {}", recipe_id) fmt::format("id = {}", recipe_id)
); );
if (re.empty() || r.empty() || !re[0].id || !r[0].id) { if (re.empty() || r.empty()) {
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Recipe ID {} has no entries or could not be found.", "Recipe ID {} has no entries or could not be found.",
Strings::Commify(std::to_string(recipe_id)) Strings::Commify(recipe_id)
).c_str() ).c_str()
); );
return; return;
@ -36,13 +37,13 @@ void command_viewrecipe(Client *c, const Seperator *sep)
Chat::White, Chat::White,
fmt::format( fmt::format(
"Recipe {} | {}", "Recipe {} | {}",
Strings::Commify(std::to_string(recipe_id)), Strings::Commify(recipe_id),
r[0].name r[0].name
).c_str() ).c_str()
); );
auto entry_number = 1; uint32 entry_number = 1;
bool can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem"); const bool can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
for (const auto& e : re) { for (const auto& e : re) {
c->Message( c->Message(
@ -51,8 +52,22 @@ void command_viewrecipe(Client *c, const Seperator *sep)
"Entry {}{} | {}{}", "Entry {}{} | {}{}",
entry_number, entry_number,
e.iscontainer > 0 ? " (Container)" : "", e.iscontainer > 0 ? " (Container)" : "",
e.item_id > 1000 ? database.CreateItemLink(e.item_id) : EQ::constants::GetObjectTypeName(e.item_id), (
can_summon_items && e.item_id > 1000 ? fmt::format(" | {}", Saylink::Silent(fmt::format("#si {}", e.item_id), "Summon")) : "" e.item_id > 1000 ?
database.CreateItemLink(e.item_id) :
EQ::constants::GetObjectTypeName(e.item_id)
),
(
can_summon_items && e.item_id > 1000 ?
fmt::format(
" | {}",
Saylink::Silent(
fmt::format("#si {}", e.item_id),
"Summon"
)
) :
""
)
).c_str() ).c_str()
); );
@ -117,4 +132,3 @@ void command_viewrecipe(Client *c, const Seperator *sep)
entry_number++; entry_number++;
} }
} }

View File

@ -0,0 +1,106 @@
#include "../../client.h"
#include "../../dialogue_window.h"
#include "../../common/serverinfo.h"
void ShowServerInfo(Client *c, const Seperator *sep)
{
auto os = EQ::GetOS();
auto cpus = EQ::GetCPUs();
const uint32 process_id = EQ::GetPID();
const double rss = EQ::GetRSS() / 1048576.0;
const uint32 uptime = static_cast<uint32>(EQ::GetUptime());
std::string popup_table;
std::string popup_text;
popup_text += DialogueWindow::CenterMessage(
DialogueWindow::ColorMessage("green", "Operating System Information")
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Machine") +
DialogueWindow::TableCell(os.machine)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("System") +
DialogueWindow::TableCell(os.sysname)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Release") +
DialogueWindow::TableCell(os.release)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Uptime") +
DialogueWindow::TableCell(Strings::SecondsToTime(uptime))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Version") +
DialogueWindow::TableCell(os.version)
);
popup_text += DialogueWindow::Table(popup_table);
popup_table = std::string();
popup_text += DialogueWindow::Break();
popup_text += DialogueWindow::CenterMessage(
DialogueWindow::ColorMessage("green", "CPU Information")
);
for (size_t cpu = 0; cpu < cpus.size(); ++cpu) {
auto &current_cpu = cpus[cpu];
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(
fmt::format(
"CPU {}",
cpu
)
) +
DialogueWindow::TableCell(
fmt::format(
"{} ({:.2f}GHz)",
current_cpu.model,
current_cpu.speed
)
)
);
}
popup_text += DialogueWindow::Table(popup_table);
popup_table = std::string();
popup_text += DialogueWindow::Break();
popup_text += DialogueWindow::CenterMessage(
DialogueWindow::ColorMessage("green", "CPU Information")
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Process ID") +
DialogueWindow::TableCell(Strings::Commify(process_id))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("RSS") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f} MB",
rss
)
)
);
popup_text += DialogueWindow::Table(popup_table);
c->SendPopupToClient(
"Server Information",
popup_text.c_str()
);
}

View File

@ -0,0 +1,42 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowSkills(Client *c, const Seperator *sep)
{
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("ID") +
DialogueWindow::TableCell("Name") +
DialogueWindow::TableCell("Current") +
DialogueWindow::TableCell("Max") +
DialogueWindow::TableCell("Raw")
);
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
if (t->CanHaveSkill(s.first) && t->MaxSkill(s.first)) {
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(std::to_string(s.first)) +
DialogueWindow::TableCell(s.second) +
DialogueWindow::TableCell(std::to_string(t->GetSkill(s.first))) +
DialogueWindow::TableCell(std::to_string(t->MaxSkill(s.first))) +
DialogueWindow::TableCell(std::to_string(t->GetRawSkill(s.first)))
);
}
}
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient(
fmt::format(
"Skills for {}",
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
).c_str(),
popup_table.c_str()
);
}

View File

@ -0,0 +1,147 @@
#include "../../client.h"
void ShowSpawnStatus(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (arguments < 2) {
c->Message(Chat::White, "Usage: #show spawn_status all - Show all spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #show spawn_status disabled - Show all disabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #show spawn_status enabled - Show all enabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #show spawn_status [Spawn ID] - Show spawn status by ID for your current zone");
return;
}
const bool is_all = !strcasecmp(sep->arg[2], "all");
const bool is_disabled = !strcasecmp(sep->arg[2], "disabled");
const bool is_enabled = !strcasecmp(sep->arg[2], "enabled");
const bool is_search = sep->IsNumber(2);
if (
!is_all &&
!is_disabled &&
!is_enabled &&
!is_search
) {
c->Message(Chat::White, "Usage: #show spawn_status all - Show all spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #show spawn_status disabled - Show all disabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #show spawn_status enabled - Show all enabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #show spawn_status [Spawn ID] - Show spawn status by ID for your current zone");
return;
}
std::string filter_type;
if (is_disabled) {
filter_type = "Disabled";
} else if (is_enabled) {
filter_type = "Enabled";
}
const uint32 spawn_id = (
is_search ?
Strings::ToUnsignedInt(sep->arg[2]) :
0
);
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
iterator.Reset();
uint32 filtered_count = 0;
uint32 spawn_count = 0;
uint32 spawn_number = 1;
while (iterator.MoreElements()) {
const auto& e = iterator.GetData();
const uint32 time_remaining = e->GetTimer().GetRemainingTime();
if (
is_all ||
(
is_disabled &&
time_remaining == UINT32_MAX
) ||
(
is_enabled &&
time_remaining != UINT32_MAX
) ||
(
is_search &&
e->GetID() == spawn_id
)
) {
c->Message(
Chat::White,
fmt::format(
"Spawn {} | ID: {} Coordinates: {:.2f}, {:.2f}, {:.2f}, {:.2f}",
spawn_number,
e->GetID(),
e->GetX(),
e->GetY(),
e->GetZ(),
e->GetHeading()
).c_str()
);
if (time_remaining != UINT32_MAX) {
const uint32 seconds_remaining = (time_remaining / 1000);
c->Message(
Chat::White,
fmt::format(
"Spawn {} | Respawn: {}",
spawn_number,
Strings::SecondsToTime(seconds_remaining)
).c_str()
);
}
filtered_count++;
spawn_number++;
}
spawn_count++;
iterator.Advance();
}
if (!spawn_count) {
c->Message(Chat::White, "No spawns were found.");
return;
}
if (
(is_disabled || is_enabled) &&
!filtered_count
) {
c->Message(
Chat::White,
fmt::format(
"No {} spawns were found.",
filter_type
).c_str()
);
return;
}
if (is_all) {
c->Message(
Chat::White,
fmt::format(
"{} Spawn{} found.",
spawn_count,
spawn_count != 1 ? "s" : ""
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} of {} spawn{} found.",
filtered_count,
spawn_count,
spawn_count != 1 ? "s" : ""
).c_str()
);
}

View File

@ -0,0 +1,30 @@
#include "../../client.h"
void ShowSpells(Client *c, const Seperator *sep)
{
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
const auto is_disciplines = !strcasecmp(sep->arg[2], "disciplines");
const auto is_spells = !strcasecmp(sep->arg[2], "spells");
if (
!is_disciplines &&
!is_spells
) {
c->Message(Chat::White, "Usages: #show spells disciplines - Show your or your target's learned disciplines");
c->Message(Chat::White, "Usages: #show spells spells - Show your or your target's memorized spells");
return;
}
ShowSpellType show_spell_type;
if (is_disciplines) {
show_spell_type = ShowSpellType::Disciplines;
} else if (is_spells) {
show_spell_type = ShowSpellType::Spells;
}
t->ShowSpells(c, show_spell_type);
}

View File

@ -0,0 +1,13 @@
#include "../../client.h"
void ShowSpellsList(Client *c, const Seperator *sep)
{
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
const auto t = c->GetTarget()->CastToNPC();
t->AISpellsList(c);
}

View File

@ -1,6 +1,6 @@
#include "../client.h" #include "../../client.h"
void command_showstats(Client *c, const Seperator *sep) void ShowStats(Client *c, const Seperator *sep)
{ {
Mob* t = c; Mob* t = c;
if (c->GetTarget()) { if (c->GetTarget()) {
@ -9,4 +9,3 @@ void command_showstats(Client *c, const Seperator *sep)
t->ShowStats(c); t->ShowStats(c);
} }

View File

@ -1,7 +1,7 @@
#include "../client.h" #include "../../client.h"
#include "../dialogue_window.h" #include "../../dialogue_window.h"
void command_timers(Client *c, const Seperator *sep) void ShowTimers(Client *c, const Seperator *sep)
{ {
auto t = c; auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) { if (c->GetTarget() && c->GetTarget()->IsClient()) {
@ -23,26 +23,30 @@ void command_timers(Client *c, const Seperator *sep)
return; return;
} }
auto m = DialogueWindow::TableRow( std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Timer ID") + DialogueWindow::TableCell("Timer ID") +
DialogueWindow::TableCell("Remaining Time") DialogueWindow::TableCell("Remaining Time")
); );
for (const auto& e : l) { for (const auto& e : l) {
auto r = e.second->GetRemainingTime(); const uint32 remaining_time = e.second->GetRemainingTime();
if (r) { if (remaining_time) {
m += DialogueWindow::TableRow( popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(std::to_string(e.first)) + DialogueWindow::TableCell(Strings::Commify(e.first)) +
DialogueWindow::TableCell(Strings::SecondsToTime(r)) DialogueWindow::TableCell(Strings::SecondsToTime(remaining_time))
); );
} }
} }
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient( c->SendPopupToClient(
fmt::format( fmt::format(
"Recast Timers for {}", "Recast Timers for {}",
c->GetTargetDescription(t, TargetDescriptionType::UCSelf) c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
).c_str(), ).c_str(),
DialogueWindow::Table(m).c_str() popup_table.c_str()
); );
} }

View File

@ -0,0 +1,6 @@
#include "../../client.h"
void ShowTraps(Client *c, const Seperator *sep)
{
entity_list.GetTrapInfo(c);
}

View File

@ -0,0 +1,19 @@
#include "../../client.h"
#include "../../worldserver.h"
extern WorldServer worldserver;
void ShowUptime(Client *c, const Seperator *sep)
{
auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct));
auto s = (ServerUptime_Struct *) pack->pBuffer;
strn0cpy(s->adminname, c->GetName(), sizeof(s->adminname));
if (sep->IsNumber(2) && Strings::ToUnsignedInt(sep->arg[2]) > 0) {
s->zoneserverid = Strings::ToUnsignedInt(sep->arg[2]);
}
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -0,0 +1,33 @@
#include "../../client.h"
void ShowVariable(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (arguments < 2) {
c->Message(Chat::White, "Usage: #show variable [Variable Name]");
return;
}
const std::string& variable = sep->argplus[2];
std::string value;
if (!database.GetVariable(variable, value)) {
c->Message(
Chat::White,
fmt::format(
"Variable '{}' was not found.",
variable
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Variable {} | {}",
variable,
value
).c_str()
);
}

View File

@ -0,0 +1,35 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowVersion(Client *c, const Seperator *sep)
{
std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Version") +
DialogueWindow::TableCell(CURRENT_VERSION)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Compiled") +
DialogueWindow::TableCell(
fmt::format(
"{} {}",
COMPILE_DATE,
COMPILE_TIME
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Last Modified") +
DialogueWindow::TableCell(LAST_MODIFIED)
);
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient(
"Server Version",
popup_table.c_str()
);
}

View File

@ -1,25 +1,25 @@
#include "../client.h" #include "../../client.h"
void command_wpinfo(Client *c, const Seperator *sep) void ShowWaypoints(Client *c, const Seperator *sep)
{ {
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;
} }
auto target = c->GetTarget()->CastToNPC(); auto t = c->GetTarget()->CastToNPC();
if (!target->GetGrid()) { if (!t->GetGrid()) {
c->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"{} is not a part of any grid.", "{} is not a part of any grid.",
c->GetTargetDescription(target) c->GetTargetDescription(t)
).c_str() ).c_str()
); );
return; return;
} }
target->DisplayWaypointInfo(c); t->DisplayWaypointInfo(c);
} }

235
zone/gm_commands/show/who.cpp Executable file
View File

@ -0,0 +1,235 @@
#include "../../client.h"
void ShowWho(Client *c, const Seperator *sep)
{
const std::string& query = SQL(
SELECT
character_data.name,
character_data.zone_id,
character_data.zone_instance,
COALESCE(
(
SELECT guilds.name FROM guilds WHERE id = (
(
SELECT guild_id FROM guild_members WHERE char_id = character_data.id
)
)
),
""
) AS guild_name,
character_data.level,
character_data.race,
character_data.class,
COALESCE(
(
SELECT account.status FROM account WHERE account.id = character_data.account_id LIMIT 1
),
0
) AS account_status,
COALESCE(
(
SELECT account.name FROM account WHERE account.id = character_data.account_id LIMIT 1
),
0
) AS account_name,
COALESCE(
(
SELECT account_ip.ip FROM account_ip WHERE account_ip.accid = character_data.account_id ORDER BY account_ip.lastused DESC LIMIT 1
),
""
) AS account_ip
FROM
character_data
WHERE
last_login > (UNIX_TIMESTAMP() - 600)
ORDER BY
character_data.name;
);
auto results = database.QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
return;
}
bool is_filtered = false;
std::string search_criteria;
if (sep->arg[2]) {
search_criteria = Strings::ToLower(sep->arg[2]);
}
uint32 found_count = 0;
c->Message(Chat::Who, "Players in EverQuest:");
c->Message(Chat::Who, "------------------------------");
for (auto row : results) {
const std::string& player_name = row[0];
const uint32 zone_id = Strings::ToUnsignedInt(row[1]);
const std::string& zone_short_name = ZoneName(zone_id);
const std::string& zone_long_name = ZoneLongName(zone_id);
const uint8 zone_instance = Strings::ToUnsignedInt(row[2]);
const std::string& guild_name = row[3];
const uint8 player_level = Strings::ToUnsignedInt(row[4]);
const uint16 player_race = Strings::ToUnsignedInt(row[5]);
const uint8 player_class = Strings::ToUnsignedInt(row[6]);
const uint8 account_status = Strings::ToUnsignedInt(row[7]);
const std::string& account_name = row[8];
const std::string& account_ip = row[9];
const std::string& base_class_name = GetClassIDName(player_class);
const std::string& displayed_race_name = GetRaceIDName(player_race);
if (!search_criteria.empty()) {
is_filtered = true;
const bool found = (
Strings::Contains(Strings::ToLower(player_name), search_criteria) ||
Strings::Contains(Strings::ToLower(zone_short_name), search_criteria) ||
Strings::Contains(Strings::ToLower(displayed_race_name), search_criteria) ||
Strings::Contains(Strings::ToLower(base_class_name), search_criteria) ||
Strings::Contains(Strings::ToLower(guild_name), search_criteria) ||
Strings::Contains(Strings::ToLower(account_name), search_criteria) ||
Strings::Contains(Strings::ToLower(account_ip), search_criteria)
);
if (!found) {
continue;
}
}
std::string displayed_guild_name;
if (!guild_name.empty()) {
displayed_guild_name = Saylink::Silent(
fmt::format(
"#who \"{}\"",
guild_name
),
fmt::format(
"<{}>",
guild_name
)
);
}
const std::string& goto_saylink = Saylink::Silent(
fmt::format(
"#goto {}",
player_name
),
"Goto"
);
const std::string& summon_saylink = Saylink::Silent(
fmt::format(
"#summon {}",
player_name
),
"Summon"
);
const std::string& display_class_name = GetClassIDName(player_class, player_level);
const std::string& class_saylink = Saylink::Silent(
fmt::format(
"#who {}",
base_class_name
),
display_class_name
);
const std::string& race_saylink = Saylink::Silent(
fmt::format(
"#who {}",
displayed_race_name
),
displayed_race_name
);
const std::string& zone_saylink = Saylink::Silent(
fmt::format(
"#who {}",
zone_short_name
),
zone_long_name
);
const std::string& account_saylink = Saylink::Silent(
fmt::format(
"#who {}",
account_name
),
account_name
);
const std::string& account_ip_saylink = Saylink::Silent(
fmt::format(
"#who {}",
account_ip
),
account_ip
);
const std::string& status_level = (
account_status ?
fmt::format(
"* {} * ",
EQ::constants::GetAccountStatusName(account_status)
) :
""
);
const std::string& version_string = (
zone_instance ?
fmt::format(
" ({})",
zone_instance
) :
""
);
c->Message(
Chat::Who,
fmt::format(
"{}[{} {} ({})] {} ({}) ({}) ({}) {} ZONE: {}{} ({} | {})",
status_level,
player_level,
class_saylink,
base_class_name,
player_name,
race_saylink,
account_saylink,
account_ip_saylink,
displayed_guild_name,
zone_saylink,
version_string,
goto_saylink,
summon_saylink
).c_str()
);
found_count++;
}
const std::string& filter_string = is_filtered ? " that match those filters" : "";
const std::string& message = (
found_count ?
fmt::format(
"There {} {} player{} in EverQuest{}.",
found_count != 1 ? "are" : "is",
found_count,
found_count != 1 ? "s" : "",
filter_string
) :
fmt::format(
"There are no players in EverQuest{}.",
filter_string
)
);
c->Message(
Chat::Who,
message.c_str()
);
}

View File

@ -1,20 +1,20 @@
#include "../client.h" #include "../../client.h"
#include "../../common/data_verification.h" #include "../../common/data_verification.h"
void command_xtargets(Client *c, const Seperator *sep) void ShowXTargets(Client *c, const Seperator *sep)
{ {
auto t = c; auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) { if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient(); t = c->GetTarget()->CastToClient();
} }
auto arguments = sep->argnum; const auto arguments = sep->argnum;
if (!arguments || !sep->IsNumber(1)) { if (arguments < 2 || !sep->IsNumber(2)) {
t->ShowXTargets(c); t->ShowXTargets(c);
return; return;
} }
const auto new_max = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[1])); const auto new_max = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[2]));
if (!EQ::ValueWithin(new_max, 5, XTARGET_HARDCAP)) { if (!EQ::ValueWithin(new_max, 5, XTARGET_HARDCAP)) {
c->Message( c->Message(

View File

@ -0,0 +1,276 @@
#include "../../client.h"
#include "../../dialogue_window.h"
void ShowZoneData(Client *c, const Seperator *sep)
{
std::string popup_table;
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Type") +
DialogueWindow::TableCell(std::to_string(zone->newzone_data.ztype))
);
for (uint8 fog_index = 0; fog_index < 4; fog_index++) {
const uint8 fog_number = (fog_index + 1);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(
fmt::format(
"Fog {} Colors",
fog_number
)
) +
DialogueWindow::TableCell(
fmt::format(
"{} {} {}",
DialogueWindow::ColorMessage(
"red1",
std::to_string(zone->newzone_data.fog_red[fog_index])
),
DialogueWindow::ColorMessage(
"forest_green",
std::to_string(zone->newzone_data.fog_green[fog_index])
),
DialogueWindow::ColorMessage(
"royal_blue",
std::to_string(zone->newzone_data.fog_blue[fog_index])
)
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(
fmt::format(
"Fog {} Clipping",
fog_number
)
) +
DialogueWindow::TableCell(
fmt::format(
"{} to {}",
zone->newzone_data.fog_minclip[fog_index],
zone->newzone_data.fog_maxclip[fog_index]
)
)
);
}
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Fog Density") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}",
zone->newzone_data.fog_density
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Gravity") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}",
zone->newzone_data.gravity
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Time Type") +
DialogueWindow::TableCell(std::to_string(zone->newzone_data.time_type))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Time Type") +
DialogueWindow::TableCell(std::to_string(zone->newzone_data.time_type))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Experience Multiplier") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}%%",
(zone->newzone_data.zone_exp_multiplier * 100)
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Safe Coordinates") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}, {:.2f}, {:.2f}",
zone->newzone_data.safe_x,
zone->newzone_data.safe_y,
zone->newzone_data.safe_z
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Max Z") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}",
zone->newzone_data.max_z
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Underworld Z") +
DialogueWindow::TableCell(
fmt::format(
"{:.2f}",
zone->newzone_data.underworld
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Clipping Distance") +
DialogueWindow::TableCell(
fmt::format(
"{} to {}",
zone->newzone_data.minclip,
zone->newzone_data.maxclip
)
)
);
// Weather Data
for (uint8 weather_index = 0; weather_index < 4; weather_index++) {
const uint8 weather_number = (weather_index + 1);
if (
zone->newzone_data.rain_chance[weather_index] ||
zone->newzone_data.rain_duration[weather_index]
) {
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(
fmt::format(
"Rain {}",
weather_number
)
) +
DialogueWindow::TableCell(
fmt::format(
"Chance: {}",
zone->newzone_data.rain_chance[weather_index]
)
) +
DialogueWindow::TableCell(
fmt::format(
"Duration: {}",
zone->newzone_data.rain_duration[weather_index]
)
)
);
}
if (
zone->newzone_data.snow_chance[weather_index] ||
zone->newzone_data.snow_duration[weather_index]
) {
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell(
fmt::format(
"Snow {}",
weather_number
)
) +
DialogueWindow::TableCell(
fmt::format(
"Chance: {}",
zone->newzone_data.snow_chance[weather_index]
)
) +
DialogueWindow::TableCell(
fmt::format(
"Duration: {}",
zone->newzone_data.snow_duration[weather_index]
)
)
);
}
}
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Sky") +
DialogueWindow::TableCell(std::to_string(zone->newzone_data.sky))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Suspend Buffs") +
DialogueWindow::TableCell(
zone->newzone_data.suspend_buffs ?
DialogueWindow::ColorMessage("forest_green", "Y") :
DialogueWindow::ColorMessage("red1", "N")
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Health Regen") +
DialogueWindow::TableCell(
fmt::format(
"{} ({})",
Strings::Commify(zone->newzone_data.fast_regen_hp),
Strings::SecondsToTime(zone->newzone_data.fast_regen_hp)
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Mana Regen") +
DialogueWindow::TableCell(
fmt::format(
"{} ({})",
Strings::Commify(zone->newzone_data.fast_regen_mana),
Strings::SecondsToTime(zone->newzone_data.fast_regen_mana)
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Endurance Regen") +
DialogueWindow::TableCell(
fmt::format(
"{} ({})",
Strings::Commify(zone->newzone_data.fast_regen_endurance),
Strings::SecondsToTime(zone->newzone_data.fast_regen_endurance)
)
)
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Maximum Aggro Distance") +
DialogueWindow::TableCell(Strings::Commify(zone->newzone_data.npc_aggro_max_dist))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Underworld Teleport Index") +
DialogueWindow::TableCell(Strings::Commify(zone->newzone_data.underworld_teleport_index))
);
popup_table += DialogueWindow::TableRow(
DialogueWindow::TableCell("Lava Damage") +
DialogueWindow::TableCell(
fmt::format(
"{} to {}",
Strings::Commify(zone->newzone_data.min_lava_damage),
Strings::Commify(zone->newzone_data.lava_damage)
)
)
);
popup_table = DialogueWindow::Table(popup_table);
c->SendPopupToClient(
fmt::format(
"Zone Data for {}",
zone->GetZoneDescription()
).c_str(),
popup_table.c_str()
);
}

View File

@ -0,0 +1,6 @@
#include "../../client.h"
void ShowZoneGlobalLoot(Client *c, const Seperator *sep)
{
zone->ShowZoneGlobalLoot(c);
}

View File

@ -0,0 +1,102 @@
#include "../../client.h"
void ShowZoneLoot(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(2)) {
c->Message(
Chat::White,
"Usage: #show zone_loot [Item ID]"
);
return;
}
const uint32 search_item_id = Strings::ToUnsignedInt(sep->arg[2]);
std::vector<std::pair<NPC *, ItemList>> v;
uint32 loot_count = 0;
uint32 loot_number = 1;
for (auto npc_entity: entity_list.GetNPCList()) {
auto il = npc_entity.second->GetItemList();
v.emplace_back(std::make_pair(npc_entity.second, il));
}
for (const auto &e: v) {
NPC *n = e.first;
const auto &l = e.second;
std::string npc_link;
if (n) {
const uint32 instance_id = zone->GetInstanceID();
const uint32 zone_id = zone->GetZoneID();
const std::string &command_link = Saylink::Silent(
fmt::format(
"#{} {} {} {} {}",
(instance_id != 0 ? "zoneinstance" : "zone"),
(instance_id != 0 ? instance_id : zone_id),
n->GetX(),
n->GetY(),
n->GetZ()
),
"Goto"
);
npc_link = fmt::format(
"NPC: {} (ID {}) [{}]",
n->GetCleanName(),
n->GetID(),
command_link
);
}
for (const auto &i: l) {
if (!search_item_id || i->item_id == search_item_id) {
EQ::SayLinkEngine linker;
linker.SetLinkType(EQ::saylink::SayLinkLootItem);
linker.SetLootData(i);
c->Message(
Chat::White,
fmt::format(
"{}. {} ({}) {}",
loot_number,
linker.GenerateLink(),
Strings::Commify(i->item_id),
npc_link
).c_str()
);
loot_number++;
loot_count++;
}
}
}
if (search_item_id) {
c->Message(
Chat::White,
fmt::format(
"{} ({}) is dropping in {} place{}.",
database.CreateItemLink(search_item_id),
Strings::Commify(search_item_id),
loot_count,
loot_count != 1 ? "s" : ""
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"{} Item {} {} dropping.",
loot_count,
loot_count != 1 ? "s" : "",
loot_count != 1 ? "are" : "is"
).c_str()
);
}

View File

@ -1,24 +1,24 @@
#include "../client.h" #include "../../client.h"
void command_showzonepoints(Client *c, const Seperator *sep) void ShowZonePoints(Client *c, const Seperator *sep)
{ {
auto &mob_list = entity_list.GetMobList(); for (const auto& m : entity_list.GetMobList()) {
for (auto itr : mob_list) { Mob* mob = m.second;
Mob *mob = itr.second;
if (mob->IsNPC() && mob->GetRace() == RACE_NODE_2254) { if (mob->IsNPC() && mob->GetRace() == RACE_NODE_2254) {
mob->Depop(); mob->Depop();
} }
} }
int found_zone_points = 0; uint32 found_count = 0;
c->Message(Chat::White, "Listing zone points..."); c->Message(Chat::White, "Listing zone points...");
c->SendChatLineBreak(); c->SendChatLineBreak();
for (auto &p : zone->virtual_zone_point_list) { for (auto &p : zone->virtual_zone_point_list) {
std::string zone_long_name = ZoneLongName(p.target_zone_id); const std::string& zone_long_name = ZoneLongName(p.target_zone_id);
std::string saylink = fmt::format( const std::string& saylink = fmt::format(
"#goto {:.0f} {:.0f} {:.0f}", "#goto {:.0f} {:.0f} {:.0f}",
p.x, p.x,
p.y, p.y,
@ -45,83 +45,92 @@ void command_showzonepoints(Client *c, const Seperator *sep)
).c_str() ).c_str()
); );
std::string node_name = fmt::format("ZonePoint To [{}]", zone_long_name); const std::string& node_name = fmt::format("ZonePoint To [{}]", zone_long_name);
float half_width = ((float) p.width / 2); float half_width = ((float) p.width / 2);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x + half_width, p.x + half_width,
(float) p.y + half_width, p.y + half_width,
p.z, p.z,
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x + half_width, p.x + half_width,
(float) p.y - half_width, p.y - half_width,
p.z, p.z,
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x - half_width, p.x - half_width,
(float) p.y - half_width, p.y - half_width,
p.z, p.z,
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x - half_width, p.x - half_width,
(float) p.y + half_width, p.y + half_width,
p.z, p.z,
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x + half_width, p.x + half_width,
(float) p.y + half_width, p.y + half_width,
(float) p.z + (float) p.height, p.z + static_cast<float>(p.height),
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x + half_width, p.x + half_width,
(float) p.y - half_width, p.y - half_width,
(float) p.z + (float) p.height, p.z + static_cast<float>(p.height),
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x - half_width, p.x - half_width,
(float) p.y - half_width, p.y - half_width,
(float) p.z + (float) p.height, p.z + static_cast<float>(p.height),
p.heading p.heading
)); )
);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
(float) p.x - half_width, p.x - half_width,
(float) p.y + half_width, p.y + half_width,
(float) p.z + (float) p.height, p.z + static_cast<float>(p.height),
p.heading p.heading
)); )
);
found_zone_points++; found_count++;
} }
LinkedListIterator<ZonePoint *> iterator(zone->zone_point_list); LinkedListIterator<ZonePoint *> iterator(zone->zone_point_list);
iterator.Reset(); iterator.Reset();
while (iterator.MoreElements()) { while (iterator.MoreElements()) {
ZonePoint *p = iterator.GetData(); const auto &p = iterator.GetData();
std::string zone_long_name = ZoneLongName(p->target_zone_id);
std::string node_name = fmt::format("ZonePoint To [{}]", zone_long_name); const std::string& zone_long_name = ZoneLongName(p->target_zone_id);
const std::string& node_name = fmt::format("ZonePoint To [{}]", zone_long_name);
NPC::SpawnZonePointNodeNPC( NPC::SpawnZonePointNodeNPC(
node_name, glm::vec4( node_name, glm::vec4(
@ -132,9 +141,7 @@ void command_showzonepoints(Client *c, const Seperator *sep)
) )
); );
// {:.0f} const std::string& saylink = fmt::format(
std::string saylink = fmt::format(
"#goto {:.0f} {:.0f} {:.0f}", "#goto {:.0f} {:.0f} {:.0f}",
p->x, p->x,
p->y, p->y,
@ -145,13 +152,13 @@ void command_showzonepoints(Client *c, const Seperator *sep)
Chat::White, Chat::White,
fmt::format( fmt::format(
"Client Side Zone Point [{}] x [{}] y [{}] z [{}] h [{}] number [{}] | To [{}] ({}) x [{}] y [{}] z [{}] h [{}]", "Client Side Zone Point [{}] x [{}] y [{}] z [{}] h [{}] number [{}] | To [{}] ({}) x [{}] y [{}] z [{}] h [{}]",
Saylink::Silent(saylink, "Goto").c_str(), Saylink::Silent(saylink, "Goto"),
p->x, p->x,
p->y, p->y,
p->z, p->z,
p->heading, p->heading,
p->number, p->number,
zone_long_name.c_str(), zone_long_name,
p->target_zone_id, p->target_zone_id,
p->target_x, p->target_x,
p->target_y, p->target_y,
@ -162,14 +169,12 @@ void command_showzonepoints(Client *c, const Seperator *sep)
iterator.Advance(); iterator.Advance();
found_zone_points++; found_count++;
} }
if (found_zone_points == 0) { if (!found_count) {
c->Message(Chat::White, "There were no zone points found..."); c->Message(Chat::White, "There were no zone points found.");
} }
c->SendChatLineBreak(); c->SendChatLineBreak();
} }

View File

@ -0,0 +1,16 @@
#include "../../client.h"
#include "../../worldserver.h"
extern WorldServer worldserver;
void ShowZoneStatus(Client *c, const Seperator *sep)
{
auto pack = new ServerPacket(ServerOP_ZoneStatus, sizeof(ServerZoneStatus_Struct));
auto z = (ServerZoneStatus_Struct *) pack->pBuffer;
z->admin = c->Admin();
strn0cpy(z->name, c->GetName(), sizeof(z->name));
worldserver.SendPacket(pack);
delete pack;
}

View File

@ -1,98 +0,0 @@
#include "../client.h"
void command_showskills(Client *c, const Seperator *sep)
{
auto target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
}
uint32 start_skill_id = 0;
if (sep->IsNumber(1)) {
start_skill_id = Strings::ToUnsignedInt(sep->arg[1]);
}
bool show_all = !strcasecmp(sep->arg[2], "all");
uint32 max_skill_id = (start_skill_id + 49);
std::string popup_text = "<table>";
popup_text += "<tr><td>ID</td><td>Name</td><td>Current</td><td>Max</td><td>Raw</td></tr>";
for (
EQ::skills::SkillType skill_id = (EQ::skills::SkillType) start_skill_id;
skill_id <= (EQ::skills::SkillType) max_skill_id;
skill_id = (EQ::skills::SkillType) (skill_id + 1)
) {
if ((EQ::skills::SkillType) skill_id >= EQ::skills::SkillCount) {
max_skill_id = (EQ::skills::SkillCount - 1);
break;
}
if (show_all || (target->CanHaveSkill(skill_id) && target->MaxSkill(skill_id))) {
popup_text += fmt::format(
"<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>",
skill_id,
EQ::skills::GetSkillName(skill_id),
target->GetSkill(skill_id),
target->MaxSkill(skill_id),
target->GetRawSkill(skill_id)
);
}
}
popup_text += "</table>";
std::string popup_title = fmt::format(
"Skills for {} [{} to {}]",
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
start_skill_id,
max_skill_id
);
c->SendPopupToClient(
popup_title.c_str(),
popup_text.c_str()
);
c->Message(
Chat::White,
fmt::format(
"Viewing skill levels from {} ({}) to {} ({}) for {}.",
EQ::skills::GetSkillName((EQ::skills::SkillType) start_skill_id),
start_skill_id,
EQ::skills::GetSkillName((EQ::skills::SkillType) max_skill_id),
max_skill_id,
c->GetTargetDescription(target)
).c_str()
);
int next_skill_id = (max_skill_id + 1);
if ((EQ::skills::SkillType) next_skill_id < EQ::skills::SkillCount) {
auto next_list_string = fmt::format(
"#showskills {}",
next_skill_id
);
auto next_list_link = Saylink::Silent(next_list_string, next_list_string);
auto next_list_all_string = fmt::format(
"#showskills {} all",
next_skill_id
);
auto next_list_all_link = Saylink::Silent(next_list_all_string, next_list_all_string);
c->Message(
Chat::White,
fmt::format(
"To view the next 50 skill levels, you can use {} or {} to show skills the player cannot normally have.",
next_list_link,
next_list_all_link
).c_str()
);
}
}

View File

@ -1,37 +0,0 @@
#include "../client.h"
void command_showspells(Client *c, const Seperator *sep)
{
const auto arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usages: #showspells disciplines - Show your or your target's learned disciplines");
c->Message(Chat::White, "Usages: #showspells spells - Show your or your target's memorized spells");
return;
}
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
const auto is_disciplines = !strcasecmp(sep->arg[1], "disciplines");
const auto is_spells = !strcasecmp(sep->arg[1], "spells");
if (
!is_disciplines &&
!is_spells
) {
c->Message(Chat::White, "Usages: #showspells disciplines - Show your or your target's learned disciplines");
c->Message(Chat::White, "Usages: #showspells spells - Show your or your target's memorized spells");
}
ShowSpellType show_spell_type;
if (is_disciplines) {
show_spell_type = ShowSpellType::Disciplines;
} else if (is_spells) {
show_spell_type = ShowSpellType::Spells;
}
t->ShowSpells(c, show_spell_type);
}

View File

@ -1,13 +0,0 @@
#include "../client.h"
void command_showspellslist(Client *c, const Seperator *sep)
{
Mob *target = c->GetTarget();
if (!target || !target->IsNPC()) {
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
target->CastToNPC()->AISpellsList(c);
return;
}

View File

@ -1,7 +0,0 @@
#include "../client.h"
void command_showzonegloballoot(Client *c, const Seperator *sep)
{
zone->ShowZoneGlobalLoot(c);
}

View File

@ -1,137 +0,0 @@
#include "../client.h"
void command_spawnstatus(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #spawnstatus all - Show all spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #spawnstatus disabled - Show all disabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #spawnstatus enabled - Show all enabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #spawnstatus [Spawn ID] - Show spawn status by ID for your current zone");
return;
}
bool is_all = !strcasecmp(sep->arg[1], "all");
bool is_disabled = !strcasecmp(sep->arg[1], "disabled");
bool is_enabled = !strcasecmp(sep->arg[1], "enabled");
bool is_search = sep->IsNumber(1);
if (
!is_all &&
!is_disabled &&
!is_enabled &&
!is_search
) {
c->Message(Chat::White, "Usage: #spawnstatus all - Show all spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #spawnstatus disabled - Show all disabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #spawnstatus enabled - Show all enabled spawn statuses for your current zone");
c->Message(Chat::White, "Usage: #spawnstatus [Spawn ID] - Show spawn status by ID for your current zone");
return;
}
std::string filter_type;
if (is_disabled) {
filter_type = "Disabled";
} else if (is_enabled) {
filter_type = "Enabled";
}
uint32 spawn_id = 0;
if (is_search) {
spawn_id = Strings::ToUnsignedInt(sep->arg[1]);
}
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
iterator.Reset();
uint32 filtered_count = 0;
uint32 spawn_count = 0;
uint32 spawn_number = 1;
while (iterator.MoreElements()) {
auto e = iterator.GetData();
auto time_remaining = e->GetTimer().GetRemainingTime();
if (
is_all ||
(
is_disabled &&
time_remaining == 0xFFFFFFFF
) ||
(
is_enabled &&
time_remaining != 0xFFFFFFFF
) ||
(
is_search &&
e->GetID() == spawn_id
)
) {
c->Message(
Chat::White,
fmt::format(
"Spawn {} | ID: {} Coordinates: {:.2f}, {:.2f}, {:.2f}, {:.2f}",
spawn_number,
e->GetID(),
e->GetX(),
e->GetY(),
e->GetZ(),
e->GetHeading()
).c_str()
);
if (time_remaining != 0xFFFFFFFF) {
auto seconds_remaining = (time_remaining / 1000);
c->Message(
Chat::White,
fmt::format(
"Spawn {} | Respawn: {} ({} Second{})",
spawn_number,
Strings::SecondsToTime(seconds_remaining),
seconds_remaining,
seconds_remaining != 1 ? "s" : ""
).c_str()
);
}
filtered_count++;
spawn_number++;
}
spawn_count++;
iterator.Advance();
}
if (!spawn_count) {
c->Message(Chat::White, "No spawns were found in this zone.");
return;
}
if (!is_all && !is_search && !filtered_count) {
c->Message(
Chat::White,
fmt::format(
"No {} spawns were found in this zone.",
filter_type
).c_str()
);
return;
}
if (is_all) {
c->Message(
Chat::White,
fmt::format(
"{} spawn{} listed.",
spawn_count,
spawn_count != 1 ? "s" : ""
).c_str()
);
} else {
c->Message(
Chat::White,
fmt::format(
"{} of {} spawn{} listed.",
filtered_count,
spawn_count,
spawn_count != 1 ? "s" : ""
).c_str()
);
}
}

View File

@ -1,7 +0,0 @@
#include "../client.h"
void command_trapinfo(Client *c, const Seperator *sep)
{
entity_list.GetTrapInfo(c);
}

View File

@ -1,22 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_uptime(Client *c, const Seperator *sep)
{
if (!worldserver.Connected()) {
c->Message(Chat::White, "Error: World server disconnected");
}
else {
auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct));
ServerUptime_Struct *sus = (ServerUptime_Struct *) pack->pBuffer;
strcpy(sus->adminname, c->GetName());
if (sep->IsNumber(1) && Strings::ToInt(sep->arg[1]) > 0) {
sus->zoneserverid = Strings::ToInt(sep->arg[1]);
}
worldserver.SendPacket(pack);
safe_delete(pack);
}
}

View File

@ -1,18 +0,0 @@
#include "../client.h"
void command_version(Client *c, const Seperator *sep)
{
std::string popup_text = "<table>";
popup_text += fmt::format("<tr><td>Version</td><td>{}</td></tr>", CURRENT_VERSION);
popup_text += fmt::format("<tr><td>Compiled</td><td>{} {}</td></tr>", COMPILE_DATE, COMPILE_TIME);
popup_text += fmt::format("<tr><td>Last Modified</td><td>{}</td></tr>", LAST_MODIFIED);
popup_text += "</table>";
c->SendPopupToClient(
"Server Version Information",
popup_text.c_str()
);
}

View File

@ -1,129 +0,0 @@
#include "../client.h"
void command_viewcurrencies(Client *c, const Seperator *sep)
{
auto t = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
const auto platinum = (
t->GetMoney(3, 0) +
t->GetMoney(3, 1) +
t->GetMoney(3, 2) +
t->GetMoney(3, 3)
);
const auto gold = (
t->GetMoney(2, 0) +
t->GetMoney(2, 1) +
t->GetMoney(2, 2)
);
const auto silver = (
t->GetMoney(1, 0) +
t->GetMoney(1, 1) +
t->GetMoney(1, 2)
);
const auto copper = (
t->GetMoney(0, 0) +
t->GetMoney(0, 1) +
t->GetMoney(0, 2)
);
std::string currency_table;
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell("Currency"),
DialogueWindow::TableCell("Amount")
)
);
if (
platinum ||
gold ||
silver ||
copper
) {
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell("Money"),
DialogueWindow::TableCell(Strings::Money(platinum, gold, silver, copper))
)
);
}
const auto ebon_crystals = t->GetEbonCrystals();
if (ebon_crystals) {
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell("Ebon Crystals"),
DialogueWindow::TableCell(Strings::Commify(ebon_crystals))
)
);
}
const auto radiant_crystals = t->GetRadiantCrystals();
if (radiant_crystals) {
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell("Radiant Crystals"),
DialogueWindow::TableCell(Strings::Commify(radiant_crystals))
)
);
}
for (const auto& a : zone->AlternateCurrencies) {
const auto currency_value = t->GetAlternateCurrencyValue(a.id);
if (currency_value) {
const auto* d = database.GetItem(a.item_id);
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell(d->Name),
DialogueWindow::TableCell(Strings::Commify(currency_value))
)
);
}
}
for (const auto& l : EQ::constants::GetLDoNThemeMap()) {
const auto ldon_currency_value = t->GetLDoNPointsTheme(l.first);
if (ldon_currency_value) {
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell(l.second),
DialogueWindow::TableCell(Strings::Commify(ldon_currency_value))
)
);
}
}
auto pvp_points = t->GetPVPPoints();
if (pvp_points) {
currency_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell("PVP Points"),
DialogueWindow::TableCell(Strings::Commify(pvp_points))
)
);
}
currency_table = DialogueWindow::Table(currency_table);
c->SendPopupToClient(
fmt::format(
"Currency for {}",
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
).c_str(),
currency_table.c_str()
);
}

View File

@ -1,32 +0,0 @@
#include "../client.h"
void command_viewnpctype(Client *c, const Seperator *sep)
{
if (sep->IsNumber(1)) {
uint32 npc_id = Strings::ToUnsignedInt(sep->arg[1]);
const NPCType *npc_type_data = content_db.LoadNPCTypesData(npc_id);
if (npc_type_data) {
auto npc = new NPC(
npc_type_data,
nullptr,
c->GetPosition(),
GravityBehavior::Water
);
npc->ShowStats(c);
safe_delete(npc);
}
else {
c->Message(
Chat::White,
fmt::format(
"NPC ID {} was not found.",
npc_id
).c_str()
);
}
}
else {
c->Message(Chat::White, "Usage: #viewnpctype [NPC ID]");
}
}

View File

@ -1,31 +0,0 @@
#include "../client.h"
void command_viewpetition(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
c->Message(Chat::White, "Usage: #viewpetition (petition number) Type #listpetition for a list");
return;
}
c->Message(Chat::Red, " ID : Character Name , Petition Text");
std::string query = "SELECT petid, charname, petitiontext FROM petitions ORDER BY petid";
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}
LogInfo("View petition request from [{}], petition number: [{}]", c->GetName(), Strings::ToInt(sep->argplus[1]));
if (results.RowCount() == 0) {
c->Message(Chat::Red, "There was an error in your request: ID not found! Please check the Id and try again.");
return;
}
for (auto row = results.begin(); row != results.end(); ++row)
if (strcasecmp(row[0], sep->argplus[1]) == 0) {
c->Message(Chat::Yellow, " %s: %s , %s ", row[0], row[1], row[2]);
}
}

View File

@ -1,116 +0,0 @@
#include "../client.h"
void command_viewzoneloot(Client *c, const Seperator *sep)
{
std::map<uint32, ItemList> zone_loot_list;
auto npc_list = entity_list.GetNPCList();
uint32 loot_amount = 0, loot_id = 1, search_item_id = 0;
if (sep->argnum == 1 && sep->IsNumber(1)) {
search_item_id = Strings::ToInt(sep->arg[1]);
}
else if (sep->argnum == 1 && !sep->IsNumber(1)) {
c->Message(
Chat::Yellow,
"Usage: #viewzoneloot [item id]"
);
return;
}
for (auto npc_entity : npc_list) {
auto current_npc_item_list = npc_entity.second->GetItemList();
zone_loot_list.insert({npc_entity.second->GetID(), current_npc_item_list});
}
for (auto loot_item : zone_loot_list) {
uint32 current_entity_id = loot_item.first;
auto current_item_list = loot_item.second;
auto current_npc = entity_list.GetNPCByID(current_entity_id);
std::string npc_link;
if (current_npc) {
std::string npc_name = current_npc->GetCleanName();
uint32 instance_id = zone->GetInstanceID();
uint32 zone_id = zone->GetZoneID();
std::string command_link = Saylink::Silent(
fmt::format(
"#{} {} {} {} {}",
(instance_id != 0 ? "zoneinstance" : "zone"),
(instance_id != 0 ? instance_id : zone_id),
current_npc->GetX(),
current_npc->GetY(),
current_npc->GetZ()
),
"Goto"
);
npc_link = fmt::format(
" NPC: {} (ID {}) [{}]",
npc_name,
current_entity_id,
command_link
);
}
for (auto current_item : current_item_list) {
if (search_item_id == 0 || current_item->item_id == search_item_id) {
EQ::SayLinkEngine linker;
linker.SetLinkType(EQ::saylink::SayLinkLootItem);
linker.SetLootData(current_item);
c->Message(
Chat::White,
fmt::format(
"{}. {} ({}){}",
loot_id,
linker.GenerateLink(),
current_item->item_id,
npc_link
).c_str()
);
loot_id++;
loot_amount++;
}
}
}
if (search_item_id != 0) {
std::string drop_string = (
loot_amount > 0 ?
fmt::format(
"dropping in {} {}",
loot_amount,
(loot_amount > 1 ? "places" : "place")
) :
"not dropping"
);
c->Message(
Chat::White,
fmt::format(
"{} ({}) is {}.",
database.CreateItemLink(search_item_id),
search_item_id,
drop_string
).c_str()
);
}
else {
std::string drop_string = (
loot_amount > 0 ?
fmt::format(
"{} {} dropping",
(loot_amount > 1 ? "items" : "item"),
(loot_amount > 1 ? "are" : "is")
) :
"items are dropping"
);
c->Message(
Chat::White,
fmt::format(
"{} {}.",
loot_amount,
drop_string
).c_str()
);
}
}

View File

@ -1,233 +0,0 @@
#include "../client.h"
void command_who(Client *c, const Seperator *sep)
{
std::string query = SQL(
SELECT
character_data.account_id,
character_data.name,
character_data.zone_id,
character_data.zone_instance,
COALESCE(
(
SELECT guilds.name FROM guilds WHERE id = (
(
SELECT guild_id FROM guild_members WHERE char_id = character_data.id
)
)
),
""
) AS guild_name,
character_data.level,
character_data.race,
character_data.class,
COALESCE(
(
SELECT account.status FROM account WHERE account.id = character_data.account_id LIMIT 1
),
0
) AS account_status,
COALESCE(
(
SELECT account.name FROM account WHERE account.id = character_data.account_id LIMIT 1
),
0
) AS account_name,
COALESCE(
(
SELECT account_ip.ip FROM account_ip WHERE account_ip.accid = character_data.account_id ORDER BY account_ip.lastused DESC LIMIT 1
),
""
) AS account_ip
FROM
character_data
WHERE
last_login > (UNIX_TIMESTAMP() - 600)
ORDER BY
character_data.name;
);
auto results = database.QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
return;
}
std::string search_string;
if (sep->arg[1]) {
search_string = Strings::ToLower(sep->arg[1]);
}
int found_count = 0;
c->Message(Chat::Who, "Players in EverQuest:");
c->Message(Chat::Who, "------------------------------");
for (auto row : results) {
auto account_id = Strings::ToUnsignedInt(row[0]);
std::string player_name = row[1];
auto zone_id = Strings::ToUnsignedInt(row[2]);
std::string zone_short_name = ZoneName(zone_id);
std::string zone_long_name = ZoneLongName(zone_id);
auto zone_instance = Strings::ToUnsignedInt(row[3]);
std::string guild_name = row[4];
auto player_level = Strings::ToUnsignedInt(row[5]);
auto player_race = Strings::ToUnsignedInt(row[6]);
auto player_class = Strings::ToUnsignedInt(row[7]);
auto account_status = Strings::ToUnsignedInt(row[8]);
std::string account_name = row[9];
std::string account_ip = row[10];
std::string base_class_name = GetClassIDName(static_cast<uint8>(player_class));
std::string displayed_race_name = GetRaceIDName(static_cast<uint16>(player_race));
if (search_string.length()) {
bool found_search_term = (
Strings::ToLower(player_name).find(search_string) != std::string::npos ||
Strings::ToLower(zone_short_name).find(search_string) != std::string::npos ||
Strings::ToLower(displayed_race_name).find(search_string) != std::string::npos ||
Strings::ToLower(base_class_name).find(search_string) != std::string::npos ||
Strings::ToLower(guild_name).find(search_string) != std::string::npos ||
Strings::ToLower(account_name).find(search_string) != std::string::npos ||
Strings::ToLower(account_ip).find(search_string) != std::string::npos
);
if (!found_search_term) {
continue;
}
}
std::string displayed_guild_name;
if (guild_name.length()) {
displayed_guild_name = Saylink::Silent(
fmt::format(
"#who \"{}\"",
guild_name
),
fmt::format(
"<{}>",
guild_name
)
);
}
auto goto_saylink = Saylink::Silent(
fmt::format(
"#goto {}",
player_name
),
"Goto"
);
auto summon_saylink = Saylink::Silent(
fmt::format(
"#summon {}",
player_name
),
"Summon"
);
std::string display_class_name = GetClassIDName(
static_cast<uint8>(player_class),
static_cast<uint8>(player_level)
);
auto class_saylink = Saylink::Silent(
fmt::format(
"#who {}",
base_class_name
),
display_class_name
);
auto race_saylink = Saylink::Silent(
fmt::format(
"#who %s",
displayed_race_name
),
displayed_race_name
);
auto zone_saylink = Saylink::Silent(
fmt::format(
"#who {}",
zone_short_name
),
zone_long_name
);
auto account_saylink = Saylink::Silent(
fmt::format(
"#who {}",
account_name
),
account_name
);
auto account_ip_saylink = Saylink::Silent(
fmt::format(
"#who {}",
account_ip
),
account_ip
);
auto status_level = (
account_status ?
fmt::format(
"* {} * ",
EQ::constants::GetAccountStatusName(account_status)
) :
""
);
auto version_string = (
zone_instance ?
fmt::format(
" ({})",
zone_instance
) :
""
);
c->Message(
Chat::Who,
fmt::format(
"{}[{} {} ({})] {} ({}) ({}) ({}) {} ZONE: {}{} ({} | {})",
status_level,
player_level,
class_saylink,
base_class_name,
player_name,
race_saylink,
account_saylink,
account_ip_saylink,
displayed_guild_name,
zone_saylink,
version_string,
goto_saylink,
summon_saylink
).c_str()
);
found_count++;
}
std::string count_string = found_count == 1 ? "is" : "are";
std::string message = (
found_count ?
fmt::format(
"There {} {} player{} in EverQuest.",
count_string,
found_count,
found_count > 1 ? "s" : ""
) :
"There are no players in EverQuest that match those filters."
);
c->Message(
Chat::Who,
message.c_str()
);
}

View File

@ -1,19 +0,0 @@
#include "../client.h"
#include "../worldserver.h"
extern WorldServer worldserver;
void command_zonestatus(Client *c, const Seperator *sep)
{
if (!worldserver.Connected()) {
c->Message(Chat::White, "Error: World server disconnected");
}
else {
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(c->GetName()) + 2);
memset(pack->pBuffer, (uint8) c->Admin(), 1);
strcpy((char *) &pack->pBuffer[1], c->GetName());
worldserver.SendPacket(pack);
delete pack;
}
}

View File

@ -1,205 +0,0 @@
#include "../client.h"
void command_zstats(Client *c, const Seperator *sep)
{
// Zone
c->Message(
Chat::White,
fmt::format(
"Zone | {}",
zone->GetZoneDescription()
).c_str()
);
// Type
c->Message(
Chat::White,
fmt::format(
"Type: {}",
zone->newzone_data.ztype
).c_str()
);
// Fog Data
for (int fog_index = 0; fog_index < 4; fog_index++) {
int fog_number = (fog_index + 1);
c->Message(
Chat::White,
fmt::format(
"Fog {} Colors | Red: {} Blue: {} Green: {} ",
fog_number,
zone->newzone_data.fog_red[fog_index],
zone->newzone_data.fog_green[fog_index],
zone->newzone_data.fog_blue[fog_index]
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"Fog {} Clipping Distance | Min: {} Max: {}",
fog_number,
zone->newzone_data.fog_minclip[fog_index],
zone->newzone_data.fog_maxclip[fog_index]
).c_str()
);
}
// Fog Density
c->Message(
Chat::White,
fmt::format(
"Fog Density: {}",
zone->newzone_data.fog_density
).c_str()
);
// Gravity
c->Message(
Chat::White,
fmt::format(
"Gravity: {}",
zone->newzone_data.gravity
).c_str()
);
// Time Type
c->Message(
Chat::White,
fmt::format(
"Time Type: {}",
zone->newzone_data.time_type
).c_str()
);
// Experience Multiplier
c->Message(
Chat::White,
fmt::format(
"Experience Multiplier: {}",
zone->newzone_data.zone_exp_multiplier
).c_str()
);
// Safe Coordinates
c->Message(
Chat::White,
fmt::format(
"Safe Coordinates: {}, {}, {}",
zone->newzone_data.safe_x,
zone->newzone_data.safe_y,
zone->newzone_data.safe_z
).c_str()
);
// Max Z
c->Message(
Chat::White,
fmt::format(
"Max Z: {}",
zone->newzone_data.max_z
).c_str()
);
// Underworld Z
c->Message(
Chat::White,
fmt::format(
"Underworld Z: {}",
zone->newzone_data.underworld
).c_str()
);
// Clipping Distance
c->Message(
Chat::White,
fmt::format(
"Clipping Distance | Min: {} Max: {}",
zone->newzone_data.minclip,
zone->newzone_data.maxclip
).c_str()
);
// Weather Data
for (int weather_index = 0; weather_index < 4; weather_index++) {
int weather_number = (weather_index + 1);
c->Message(
Chat::White,
fmt::format(
"Rain {} | Chance: {} Duration: {} ",
weather_number,
zone->newzone_data.rain_chance[weather_index],
zone->newzone_data.rain_duration[weather_index]
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"Snow {} | Chance: {} Duration: {}",
weather_number,
zone->newzone_data.snow_chance[weather_index],
zone->newzone_data.snow_duration[weather_index]
).c_str()
);
}
// Sky Type
c->Message(
Chat::White,
fmt::format(
"Sky Type: {}",
zone->newzone_data.sky
).c_str()
);
// Suspend Buffs
c->Message(
Chat::White,
fmt::format(
"Suspend Buffs: {}",
zone->newzone_data.suspend_buffs
).c_str()
);
// Regeneration Data
c->Message(
Chat::White,
fmt::format(
"Regen | Health: {} Mana: {} Endurance: {}",
zone->newzone_data.fast_regen_hp,
zone->newzone_data.fast_regen_mana,
zone->newzone_data.fast_regen_endurance
).c_str()
);
// NPC Max Aggro Distance
c->Message(
Chat::White,
fmt::format(
"NPC Max Aggro Distance: {}",
zone->newzone_data.npc_aggro_max_dist
).c_str()
);
// Underworld Teleport Index
c->Message(
Chat::White,
fmt::format(
"Underworld Teleport Index: {}",
zone->newzone_data.underworld_teleport_index
).c_str()
);
// Lava Damage
c->Message(
Chat::White,
fmt::format(
"Lava Damage | Min: {} Max: {}",
zone->newzone_data.min_lava_damage,
zone->newzone_data.lava_damage
).c_str()
);
}

View File

@ -1793,15 +1793,12 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
} }
regen_string += DialogueWindow::TableRow( regen_string += DialogueWindow::TableRow(
fmt::format( DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, regen_row_header)) +
"{}{}{}{}{}{}", DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, base_regen_field)) +
DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, regen_row_header)), DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, fmt::format("{} ({})", item_regen_field, cap_regen_field))) +
DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, base_regen_field)), DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, spell_regen_field)) +
DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, fmt::format("{} ({})", item_regen_field, cap_regen_field))), DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, aa_regen_field)) +
DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, spell_regen_field)),
DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, aa_regen_field)),
DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, total_regen_field)) DialogueWindow::TableCell(DialogueWindow::ColorMessage(regen_row_color, total_regen_field))
)
); );
} }
@ -1907,17 +1904,15 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
} }
stat_table += DialogueWindow::TableRow( stat_table += DialogueWindow::TableRow(
fmt::format( DialogueWindow::TableCell(a_stat_name) +
"{}{}{}{}",
DialogueWindow::TableCell(a_stat_name),
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format( fmt::format(
"{} {}", "{} {}",
a_stat, a_stat,
DialogueWindow::ColorMessage(heroic_color, fmt::format("+{}", h_stat)) DialogueWindow::ColorMessage(heroic_color, fmt::format("+{}", h_stat))
) )
), ) +
DialogueWindow::TableCell(a_resist_name), DialogueWindow::TableCell(a_resist_name) +
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format( fmt::format(
"{} {}", "{} {}",
@ -1925,7 +1920,6 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
DialogueWindow::ColorMessage(heroic_color, fmt::format("+{}", h_resist_field)) DialogueWindow::ColorMessage(heroic_color, fmt::format("+{}", h_resist_field))
) )
) )
)
); );
} }
@ -2026,8 +2020,6 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
} }
mod2_table += DialogueWindow::TableRow( mod2_table += DialogueWindow::TableRow(
fmt::format(
"{}{}",
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format( fmt::format(
"{}: {} / {}", "{}: {} / {}",
@ -2035,7 +2027,7 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
Strings::Commify(mod2a), Strings::Commify(mod2a),
Strings::Commify(mod2a_cap) Strings::Commify(mod2a_cap)
) )
), ) +
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format( fmt::format(
"{}: {} / {}", "{}: {} / {}",
@ -2044,7 +2036,6 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
Strings::Commify(mod2b_cap) Strings::Commify(mod2b_cap)
) )
) )
)
); );
} }
@ -2208,30 +2199,24 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
// Class, Level, and Race // Class, Level, and Race
final_string += DialogueWindow::Table( final_string += DialogueWindow::Table(
DialogueWindow::TableRow( DialogueWindow::TableRow(
fmt::format( DialogueWindow::TableCell(fmt::format("Race: {}", GetPlayerRaceAbbreviation(GetBaseRace()))) +
"{}{}{}", DialogueWindow::TableCell(fmt::format("Class: {}", GetPlayerClassAbbreviation(GetClass()))) +
DialogueWindow::TableCell(fmt::format("Race: {}", GetPlayerRaceAbbreviation(GetBaseRace()))),
DialogueWindow::TableCell(fmt::format("Class: {}", GetPlayerClassAbbreviation(GetClass()))),
DialogueWindow::TableCell(fmt::format("Level: {}", std::to_string(GetLevel()))) DialogueWindow::TableCell(fmt::format("Level: {}", std::to_string(GetLevel())))
) )
)
); );
// Runes // Runes
if (rune_number || magic_rune_number) { if (rune_number || magic_rune_number) {
final_string += DialogueWindow::Table( final_string += DialogueWindow::Table(
DialogueWindow::TableRow( DialogueWindow::TableRow(
fmt::format(
"{}{}{}",
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format("Rune: {}", rune_number) fmt::format("Rune: {}", rune_number)
), ) +
DialogueWindow::TableCell(""), DialogueWindow::TableCell("") +
DialogueWindow::TableCell( DialogueWindow::TableCell(
fmt::format("Spell Rune: {}", magic_rune_number) fmt::format("Spell Rune: {}", magic_rune_number)
) )
) )
)
); );
final_string += DialogueWindow::Break(1); final_string += DialogueWindow::Break(1);
@ -2313,21 +2298,21 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
fmt::format( fmt::format(
"{}{}", "{}{}",
DialogueWindow::TableRow( DialogueWindow::TableRow(
fmt::format( DialogueWindow::TableCell("Item") +
"{}{}{}{}", DialogueWindow::TableCell("Spell") +
DialogueWindow::TableCell("Item"), DialogueWindow::TableCell("Over") +
DialogueWindow::TableCell("Spell"),
DialogueWindow::TableCell("Over"),
DialogueWindow::TableCell("Total (Cap)") DialogueWindow::TableCell("Total (Cap)")
)
), ),
DialogueWindow::TableRow( DialogueWindow::TableRow(
DialogueWindow::TableCell(Strings::Commify(itembonuses.haste)) +
DialogueWindow::TableCell(Strings::Commify(spellbonuses.haste + spellbonuses.hastetype2)) +
DialogueWindow::TableCell(Strings::Commify(spellbonuses.hastetype3 + ExtraHaste)) +
DialogueWindow::TableCell(
fmt::format( fmt::format(
"{}{}{}{}", "{} ({})",
DialogueWindow::TableCell(Strings::Commify(itembonuses.haste)), Strings::Commify(GetHaste()),
DialogueWindow::TableCell(Strings::Commify(spellbonuses.haste + spellbonuses.hastetype2)), Strings::Commify(RuleI(Character, HasteCap))
DialogueWindow::TableCell(Strings::Commify(spellbonuses.hastetype3 + ExtraHaste)), )
DialogueWindow::TableCell(fmt::format("{} ({})", Strings::Commify(GetHaste()), Strings::Commify(RuleI(Character, HasteCap))))
) )
) )
) )
@ -2339,21 +2324,15 @@ void Mob::SendStatsWindow(Client* c, bool use_window)
final_string += DialogueWindow::CenterMessage("Regen"); final_string += DialogueWindow::CenterMessage("Regen");
const auto& regen_table = DialogueWindow::Table( const auto& regen_table = DialogueWindow::Table(
fmt::format(
"{}{}",
DialogueWindow::TableRow( DialogueWindow::TableRow(
fmt::format( DialogueWindow::TableCell("Type") +
"{}{}{}{}{}{}", DialogueWindow::TableCell("Base") +
DialogueWindow::TableCell("Type"), DialogueWindow::TableCell("Items (Cap)") +
DialogueWindow::TableCell("Base"), DialogueWindow::TableCell("Spell") +
DialogueWindow::TableCell("Items (Cap)"), DialogueWindow::TableCell("AAs") +
DialogueWindow::TableCell("Spell"),
DialogueWindow::TableCell("AAs"),
DialogueWindow::TableCell("Total") DialogueWindow::TableCell("Total")
) ) +
),
regen_string regen_string
)
); );
// Regen // Regen

View File

@ -360,7 +360,7 @@ void EntityList::UpdateAllTraps(bool respawn, bool repopnow)
Log(Logs::General, Logs::Traps, "All traps updated."); Log(Logs::General, Logs::Traps, "All traps updated.");
} }
void EntityList::GetTrapInfo(Client* client) void EntityList::GetTrapInfo(Client* c)
{ {
uint32 trap_count = 0; uint32 trap_count = 0;
uint32 trap_number = 1; uint32 trap_number = 1;
@ -368,9 +368,9 @@ void EntityList::GetTrapInfo(Client* client)
for (const auto& trap : trap_list) { for (const auto& trap : trap_list) {
auto t = trap.second; auto t = trap.second;
if (t->IsTrap()) { if (t->IsTrap()) {
bool is_set = (t->chkarea_timer.Enabled() && !t->reset_timer.Enabled()); const bool is_set = (t->chkarea_timer.Enabled() && !t->reset_timer.Enabled());
client->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Trap {} | ID: {} Active: {} Coordinates: {:.2f}, {:.2f}, {:.2f}", "Trap {} | ID: {} Active: {} Coordinates: {:.2f}, {:.2f}, {:.2f}",
@ -383,7 +383,7 @@ void EntityList::GetTrapInfo(Client* client)
).c_str() ).c_str()
); );
client->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Trap {} | Times Triggered: {} Group: {}", "Trap {} | Times Triggered: {} Group: {}",
@ -394,7 +394,7 @@ void EntityList::GetTrapInfo(Client* client)
); );
if (!t->message.empty()) { if (!t->message.empty()) {
client->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Trap {} | Message: {}", "Trap {} | Message: {}",
@ -410,14 +410,14 @@ void EntityList::GetTrapInfo(Client* client)
} }
if (!trap_count) { if (!trap_count) {
client->Message(Chat::White, "No traps were found in this zone."); c->Message(Chat::White, "No traps were found.");
return; return;
} }
client->Message( c->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"{} trap{} found.", "{} Trap{} found.",
trap_count, trap_count,
trap_count != 1 ? "s" : "" trap_count != 1 ? "s" : ""
).c_str() ).c_str()

View File

@ -1023,8 +1023,8 @@ void Client::SendZoneFlagInfo(Client *to) const {
to->Message( to->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"{} {} no Zone Flags.", "{} {} no zone flags.",
to == this ? "You" : GetName(), to->GetTargetDescription(const_cast<Mob*>(CastToMob()), TargetDescriptionType::UCYou),
to == this ? "have" : "has" to == this ? "have" : "has"
).c_str() ).c_str()
); );
@ -1034,32 +1034,29 @@ void Client::SendZoneFlagInfo(Client *to) const {
to->Message( to->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"{} {} the following Zone Flags:", "{} {} the following zone flags:",
to == this ? "You" : GetName(), to->GetTargetDescription(const_cast<Mob*>(CastToMob()), TargetDescriptionType::UCYou),
to == this ? "have" : "has" to == this ? "have" : "has"
).c_str() ).c_str()
); );
int flag_count = 0; uint32 flag_count = 0;
for (const auto& zone_id : zone_flags) {
int flag_number = (flag_count + 1); for (const auto& zone_id : zone_flags) {
const char* zone_short_name = ZoneName(zone_id, true); const uint32 flag_number = (flag_count + 1);
if (strncmp(zone_short_name, "UNKNOWN", strlen(zone_short_name)) != 0) {
std::string zone_long_name = ZoneLongName(zone_id); const auto& z = GetZone(zone_id);
std::string flag_name = "ERROR";
auto z = GetZone(zone_id);
if (z) { if (z) {
flag_name = z->flag_needed; const std::string& flag_name = z->flag_needed;
}
to->Message( to->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"Flag {} | Zone: {} ({}) ID: {}", "Flag {} | Zone: {} ({}) ID: {}{}",
flag_number, flag_number,
zone_long_name, z->long_name,
zone_short_name, z->short_name,
zone_id, zone_id,
( (
!flag_name.empty() ? !flag_name.empty() ?
@ -1078,10 +1075,10 @@ void Client::SendZoneFlagInfo(Client *to) const {
to->Message( to->Message(
Chat::White, Chat::White,
fmt::format( fmt::format(
"{} {} {} Zone Flags.", "{} Zone flag{} found for {}.",
to == this ? "You" : GetName(), flag_count,
to == this ? "have" : "has", flag_count != 1 ? "s" : "",
flag_count to->GetTargetDescription(const_cast<Mob*>(CastToMob()))
).c_str() ).c_str()
); );
} }