A quick little patch for anyone interested in viewing a player's money.
It uses currently coded public client functions, but could be expounded upon if the need ever arises.
[MoneyPeek.patch]
Code:
Index: command.cpp
===================================================================
--- command.cpp (revision 2229)
+++ command.cpp (working copy)
@@ -263,7 +263,7 @@
command_add("appearance","[type] [value] - Send an appearance packet for you or your target",150,command_appearance) ||
command_add("charbackup","[list/restore] - Query or restore character backups",150,command_charbackup) ||
command_add("nukeitem","[itemid] - Remove itemid from your player target's inventory",150,command_nukeitem) ||
- command_add("peekinv","[worn/cursor/inv/bank/trade/trib/all] - Print out contents of your player target's inventory",100,command_peekinv) ||
+ command_add("peekinv","[money/worn/cursor/inv/bank/trade/trib/all] - Print out contents of your player target's inventory",100,command_peekinv) ||
command_add("findnpctype","[search criteria] - Search database NPC types",100,command_findnpctype) ||
command_add("findzone","[search criteria] - Search database zones",100,command_findzone) ||
command_add("fz",NULL,100,command_findzone) ||
@@ -3029,7 +3029,18 @@
Client* client = c->GetTarget()->CastToClient();
const Item_Struct* item = NULL;
c->Message(0, "Displaying inventory for %s...", client->GetName());
-
+
+ if (bAll || (strcasecmp(sep->arg[1], "money")==0)) {
+ // Money
+ bFound = true;
+ c->Message(0, "Total Money (in Copper): %i", client->GetAllMoney());
+ c->Message(0, "Carried Money (in Copper): %i", client->GetCarriedMoney());
+ c->Message(0, "Carried Platinum: %i", client->GetPlatinum());
+ c->Message(0, "Carried Gold: %i", client->GetGold());
+ c->Message(0, "Carried Silver: %i", client->GetSilver());
+ c->Message(0, "Carried Copper: %i", client->GetCopper());
+ }
+
if (bAll || (strcasecmp(sep->arg[1], "worn")==0)) {
// Worn items
bFound = true;
@@ -3331,7 +3342,7 @@
if (!bFound)
{
- c->Message(0, "Usage: #peekinv [worn|cursor|inv|bank|trade|trib|all]");
+ c->Message(0, "Usage: #peekinv [money|worn|cursor|inv|bank|trade|trib|all]");
c->Message(0, " Displays a portion of the targeted user's inventory");
c->Message(0, " Caution: 'all' is a lot of information!");
}