summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-17 22:18:01 +0000
committermc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-17 22:18:01 +0000
commitf70528b42e8781b3c50613c2de0204be890a5bb1 (patch)
tree7661b9d085d7c90369d88b0565fb71835ffa8640
parent7811a40eaed7c2364156b82fedbb7af02a653630 (diff)
downloadhercules-f70528b42e8781b3c50613c2de0204be890a5bb1.tar.gz
hercules-f70528b42e8781b3c50613c2de0204be890a5bb1.tar.bz2
hercules-f70528b42e8781b3c50613c2de0204be890a5bb1.tar.xz
hercules-f70528b42e8781b3c50613c2de0204be890a5bb1.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@598 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt1
-rw-r--r--conf-tmpl/atcommand_athena.conf3
-rw-r--r--conf-tmpl/charcommand_athena.conf3
-rw-r--r--src/map/atcommand.c88
-rw-r--r--src/map/atcommand.h2
-rw-r--r--src/map/charcommand.c87
-rw-r--r--src/map/charcommand.h1
7 files changed, 93 insertions, 92 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 135de68d0..22ea619b4 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,6 @@
Date Added
12/17
+ * Added #storagelist, removed @charstoragelist [MC Cameri]
* db.c: Fixed probs with OnInit, OnTime, and etc NPC probs
Just reverted it back. [Lupus]
* Fixed warning message in db.c line 445 [MC Cameri]
diff --git a/conf-tmpl/atcommand_athena.conf b/conf-tmpl/atcommand_athena.conf
index cb2121245..149c1fac5 100644
--- a/conf-tmpl/atcommand_athena.conf
+++ b/conf-tmpl/atcommand_athena.conf
@@ -260,9 +260,6 @@ save: 40
// Do some visual effect on your character
effect: 40
-// Display all items of a player's storage
-charstoragelist: 40
-
// Display all items of a player's cart
charcartlist: 40
diff --git a/conf-tmpl/charcommand_athena.conf b/conf-tmpl/charcommand_athena.conf
index 9815f669b..4fd8a7c20 100644
--- a/conf-tmpl/charcommand_athena.conf
+++ b/conf-tmpl/charcommand_athena.conf
@@ -18,4 +18,5 @@ save: 60
statsall: 40
spiritball: 60
itemlist: 40
-effect: 40 \ No newline at end of file
+effect: 40
+storagelist: 40 \ No newline at end of file
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index fcd6812f6..aa4577891 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -176,7 +176,6 @@ ACMD_FUNC(chardisguise); // Kalaspuff
ACMD_FUNC(charundisguise); // Kalaspuff
ACMD_FUNC(email); // by Yor
ACMD_FUNC(effect);//by Apple
-ACMD_FUNC(character_storage_list); // by Yor
ACMD_FUNC(character_cart_list); // by Yor
ACMD_FUNC(addwarp); // by MouseJstr
ACMD_FUNC(follow); // by MouseJstr
@@ -422,7 +421,7 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_EMail, "@email", 0, atcommand_email }, // by Yor
{ AtCommand_Effect, "@effect", 40, atcommand_effect }, // by Apple
// { AtCommand_Char_Item_List, "@charitemlist", 40, atcommand_character_item_list }, // by Yor, now #itemlist
- { AtCommand_Char_Storage_List, "@charstoragelist", 40, atcommand_character_storage_list }, // by Yor
+// { AtCommand_Char_Storage_List, "@charstoragelist", 40, atcommand_character_storage_list }, // by Yor, now #storagelist
{ AtCommand_Char_Cart_List, "@charcartlist", 40, atcommand_character_cart_list }, // by Yor
{ AtCommand_Follow, "@follow", 10, atcommand_follow }, // by MouseJstr
{ AtCommand_AddWarp, "@addwarp", 20, atcommand_addwarp }, // by MouseJstr
@@ -6735,91 +6734,6 @@ int atcommand_effect(
}
/*==========================================
- * @charstoragelist <character>: Displays the items list of a player's storage.
- *------------------------------------------
- */
-int
-atcommand_character_storage_list(
- const int fd, struct map_session_data* sd,
- const char* command, const char* message)
-{
- struct storage *stor;
- struct map_session_data *pl_sd;
- struct item_data *item_data, *item_temp;
- int i, j, count, counter, counter2;
- char character[100], output[200], outputtmp[200];
- nullpo_retr(-1, sd);
-
- memset(character, '\0', sizeof(character));
- memset(output, '\0', sizeof(output));
- memset(outputtmp, '\0', sizeof(outputtmp));
-
- if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) {
- clif_displaymessage(fd, "Please, enter a player name (usage: @charitemlist <char name>).");
- return -1;
- }
-
- if ((pl_sd = map_nick2sd(character)) != NULL) {
- if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can look items only lower or same level
- if((stor = account2storage2(pl_sd->status.account_id)) != NULL) {
- counter = 0;
- count = 0;
- for (i = 0; i < MAX_STORAGE; i++) {
- if (stor->storage[i].nameid > 0 && (item_data = itemdb_search(stor->storage[i].nameid)) != NULL) {
- counter = counter + stor->storage[i].amount;
- count++;
- if (count == 1) {
- sprintf(output, "------ Storage items list of '%s' ------", pl_sd->status.name);
- clif_displaymessage(fd, output);
- }
- if (stor->storage[i].refine)
- sprintf(output, "%d %s %+d (%s %+d, id: %d)", stor->storage[i].amount, item_data->name, stor->storage[i].refine, item_data->jname, stor->storage[i].refine, stor->storage[i].nameid);
- else
- sprintf(output, "%d %s (%s, id: %d)", stor->storage[i].amount, item_data->name, item_data->jname, stor->storage[i].nameid);
- clif_displaymessage(fd, output);
- memset(output, '\0', sizeof(output));
- counter2 = 0;
- for (j = 0; j < item_data->slot; j++) {
- if (stor->storage[i].card[j]) {
- if ((item_temp = itemdb_search(stor->storage[i].card[j])) != NULL) {
- if (output[0] == '\0')
- sprintf(outputtmp, " -> (card(s): #%d %s (%s), ", ++counter2, item_temp->name, item_temp->jname);
- else
- sprintf(outputtmp, "#%d %s (%s), ", ++counter2, item_temp->name, item_temp->jname);
- strcat(output, outputtmp);
- }
- }
- }
- if (output[0] != '\0') {
- output[strlen(output) - 2] = ')';
- output[strlen(output) - 1] = '\0';
- clif_displaymessage(fd, output);
- }
- }
- }
- if (count == 0)
- clif_displaymessage(fd, "No item found in the storage of this player.");
- else {
- sprintf(output, "%d item(s) found in %d kind(s) of items.", counter, count);
- clif_displaymessage(fd, output);
- }
- } else {
- clif_displaymessage(fd, "This player has no storage.");
- return 0;
- }
- } else {
- clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player.
- return -1;
- }
- } else {
- clif_displaymessage(fd, msg_table[3]); // Character not found.
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
* @charcartlist <character>: Displays the items list of a player's cart.
*------------------------------------------
*/
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index c1fede0ba..696e391e6 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -158,7 +158,7 @@ enum AtCommandType {
AtCommand_Hatch,
AtCommand_Effect, // by Apple
// AtCommand_Char_Item_List, // by Yor, now #itemlist
- AtCommand_Char_Storage_List, // by Yor
+// AtCommand_Char_Storage_List, // by Yor, now #storagelist
AtCommand_Char_Cart_List, // by Yor
AtCommand_AddWarp, // by MouseJstr
AtCommand_Follow, // by MouseJstr
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index 277c9ebfd..7ed86b299 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -45,6 +45,7 @@ CCMD_FUNC(reset);
CCMD_FUNC(spiritball);
CCMD_FUNC(itemlist);
CCMD_FUNC(effect);
+CCMD_FUNC(storagelist);
#ifdef TXT_ONLY
/* TXT_ONLY */
@@ -76,6 +77,7 @@ static CharCommandInfo charcommand_info[] = {
{ CharCommandSpiritball, "#spiritball", 40, charcommand_spiritball },
{ CharCommandItemList, "#itemlist", 40, charcommand_itemlist },
{ CharCommandEffect, "#effect", 40, charcommand_effect },
+ { CharCommandStorageList, "#storagelist", 40, charcommand_storagelist },
#ifdef TXT_ONLY
/* TXT_ONLY */
@@ -895,3 +897,88 @@ charcommand_effect(const int fd, struct map_session_data* sd,
return 0;
}
+
+/*==========================================
+ * #storagelist <character>: Displays the items list of a player's storage.
+ *------------------------------------------
+ */
+int
+charcommand_storage_list(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ struct storage *stor;
+ struct map_session_data *pl_sd;
+ struct item_data *item_data, *item_temp;
+ int i, j, count, counter, counter2;
+ char character[100], output[200], outputtmp[200];
+ nullpo_retr(-1, sd);
+
+ memset(character, '\0', sizeof(character));
+ memset(output, '\0', sizeof(output));
+ memset(outputtmp, '\0', sizeof(outputtmp));
+
+ if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) {
+ clif_displaymessage(fd, "Please, enter a player name (usage: #itemlist <char name>).");
+ return -1;
+ }
+
+ if ((pl_sd = map_nick2sd(character)) != NULL) {
+ if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can look items only lower or same level
+ if((stor = account2storage2(pl_sd->status.account_id)) != NULL) {
+ counter = 0;
+ count = 0;
+ for (i = 0; i < MAX_STORAGE; i++) {
+ if (stor->storage[i].nameid > 0 && (item_data = itemdb_search(stor->storage[i].nameid)) != NULL) {
+ counter = counter + stor->storage[i].amount;
+ count++;
+ if (count == 1) {
+ sprintf(output, "------ Storage items list of '%s' ------", pl_sd->status.name);
+ clif_displaymessage(fd, output);
+ }
+ if (stor->storage[i].refine)
+ sprintf(output, "%d %s %+d (%s %+d, id: %d)", stor->storage[i].amount, item_data->name, stor->storage[i].refine, item_data->jname, stor->storage[i].refine, stor->storage[i].nameid);
+ else
+ sprintf(output, "%d %s (%s, id: %d)", stor->storage[i].amount, item_data->name, item_data->jname, stor->storage[i].nameid);
+ clif_displaymessage(fd, output);
+ memset(output, '\0', sizeof(output));
+ counter2 = 0;
+ for (j = 0; j < item_data->slot; j++) {
+ if (stor->storage[i].card[j]) {
+ if ((item_temp = itemdb_search(stor->storage[i].card[j])) != NULL) {
+ if (output[0] == '\0')
+ sprintf(outputtmp, " -> (card(s): #%d %s (%s), ", ++counter2, item_temp->name, item_temp->jname);
+ else
+ sprintf(outputtmp, "#%d %s (%s), ", ++counter2, item_temp->name, item_temp->jname);
+ strcat(output, outputtmp);
+ }
+ }
+ }
+ if (output[0] != '\0') {
+ output[strlen(output) - 2] = ')';
+ output[strlen(output) - 1] = '\0';
+ clif_displaymessage(fd, output);
+ }
+ }
+ }
+ if (count == 0)
+ clif_displaymessage(fd, "No item found in the storage of this player.");
+ else {
+ sprintf(output, "%d item(s) found in %d kind(s) of items.", counter, count);
+ clif_displaymessage(fd, output);
+ }
+ } else {
+ clif_displaymessage(fd, "This player has no storage.");
+ return 0;
+ }
+ } else {
+ clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player.
+ return -1;
+ }
+ } else {
+ clif_displaymessage(fd, msg_table[3]); // Character not found.
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/src/map/charcommand.h b/src/map/charcommand.h
index 215e13e05..b83f2b6e6 100644
--- a/src/map/charcommand.h
+++ b/src/map/charcommand.h
@@ -14,6 +14,7 @@ enum CharCommandType {
CharCommandSpiritball,
CharCommandItemList,
CharCommandEffect,
+ CharCommandStorageList,
#ifdef TXT_ONLY
/* TXT_ONLY */