// johndoe @ gooeymud #include inherit DAEMON ; #define SYNTAX "Usage: getinv\n" int disp(string str); string itemstatus(object items); int f_coins(string pawn); int weight(string pawn); int cmd_getinv(string str,int x, int i,object *usrs) { if(!str||str=="")return 0; usrs = users(); x=1; for(i = 0; i <= sizeof(users())-1; i++) { string name = usrs[i]->query("name"); if(name==str) { disp(str); return 1; } else { x++; if(sizeof(users()) < x) write("No such user: "+str+"\n"); } } return 1; } int disp(string str,int x,int m,int i,object *items, string pawn, string mod) { sscanf(str,"%s",pawn); items = all_inventory(get_object(pawn)); write("\tInventory of player: "+str+"\n"); write("\t--------------------"); for (i = 0; i <= sizeof(str);i++)write("-"); write("\n"); for (i = 0,x = 1, m= sizeof(items); iquery("short")) { mod = itemstatus(items[i]); write("\t"+x+". "+items[i]->query("short")+" "+mod+"\n"); x++; } } f_coins(pawn); weight(pawn); return 1; } int f_coins(string pawn) { object tp = this_player(); write("\n\tPlatinum: "+get_object(pawn)->query("wealth/platinum")+", "); write("Gold "+get_object(pawn)->query("wealth/gold")+", "); write("Silver "+get_object(pawn)->query("wealth/silver")+", "); write("Copper "+get_object(pawn)->query("wealth/copper")+"\n"); } int weight(string pawn,int cap, int vol) { cap = 5000 - get_object(pawn)->query("capacity") - get_object(pawn)->coins_carried(); vol = 500 - get_object(pawn)->query("volume"); write("\tWeight: "+cap+"\n"); write("\tBulk: "+vol+"\n"); return 1; } string itemstatus(object items,string mod) { mod = ""; if (items->query("wielded") && items->query("second")) mod = mod + "(wielded, off-hand)" ; if (items->query("wielded") && !items->query("second")) mod = mod + " (wielded)" ; if (items->query("equipped")) mod = mod + " (equipped)" ; if (items->query("invisible")) mod = mod + " (invisible)" ; return mod; }