From 341da2281a2e53cebe0ac30ff4481647e18289c9 Mon Sep 17 00:00:00 2001 From: Cahyadi Ramadhan Togihon Date: Sat, 26 Oct 2013 13:41:38 +0700 Subject: [PATCH] * Implemented modified @dropall by Xantara (discussion:http://rathena.org/board/topic/88250-suggestion-add-dropall-mod/) * Updated map_msg_idn.conf --- conf/help.txt | 2 +- conf/msg_conf/map_msg.conf | 5 ++++ conf/msg_conf/map_msg_idn.conf | 19 +++++++++++++++ doc/atcommands.txt | 20 ++++++++++++++-- src/map/atcommand.c | 43 +++++++++++++++++++++++++++------- 5 files changed, 78 insertions(+), 11 deletions(-) diff --git a/conf/help.txt b/conf/help.txt index 81f4638d0e5..33b6b585a89 100644 --- a/conf/help.txt +++ b/conf/help.txt @@ -136,7 +136,7 @@ hairstyle: "Params: \n" "Changes your hair style." haircolor: "Params \n" "Changes your hair color." speed: "Params: <1-1000>\n" "Changes you walking speed. 1 being the fastest and 1000 the slowest. Default is 150." effect: "Params: []\n" "Give an effect to your character." -dropall: "Throws all your possession on the ground." +dropall: "Params: []\n" "Throws all your possession on the ground. No type specified will drop all items." storeall: "Puts all your possessions in storage." killable: "Make your character killable." memo: "Params: [memo position]\n" "Set/change a memo location (no position: display memo points)." diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index b3efc1334ee..2d33a3ed266 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -1493,5 +1493,10 @@ 1490: Item types on your autoloottype list: 1491: Your autoloottype list has been reset. +// @dropall +1492: Usage: @dropall {} +1493: Type List: (default) all = -1, healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10 +1494: %d items are dropped! + //Custom translations //import: conf/msg_conf/import/map_msg_eng_conf.txt diff --git a/conf/msg_conf/map_msg_idn.conf b/conf/msg_conf/map_msg_idn.conf index ed2b36e24c3..cbef7ac4305 100644 --- a/conf/msg_conf/map_msg_idn.conf +++ b/conf/msg_conf/map_msg_idn.conf @@ -1478,5 +1478,24 @@ 1478: Jarak level dalam party share telah diubah dengan sukses. 1479: Gagal memperbaruhi pengaturan. Server karakter sedang offline. +// @autoloottype +1480: Tipe item tidak ditemukan. +1481: Kamu sudah meng-autoloot tipe item ini. +1482: Daftar autoloottype-mu sudah memiliki semua tipe. Kamu dapat menghilangkan beberapa tipe item dengan @autoloottype -. +1483: Meng-autoloot tipe item: '%s' {%d} +1484: Kamu sudah tidak meng-autoloot tipe item ini. +1485: Tipe item: '%s' {%d} dihilangkan dari daftar autoloottype-mu. +1486: Untuk menambahkan tipe item ke dalam daftar, gunakan "@aloottype +". Untuk menghilangkan sebuah tipe item, gunakan "@aloottype -". +1487: Daftar tipe: healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10 +1488: "@aloottype reset" akan membersihkan daftar autoloottype-mu. +1489: Dafatr autoloottype-mu kosong. +1490: Tipe item yang berada di daftar autoloottype-mu: +1491: Daftar autoloottype-mu telah direset. + +// @dropall +1492: Penggunaan: @dropall {} +1493: Daftar 'tipe': (default) all = -1, healing = 0, usable = 2, etc = 3, weapon = 4, armor = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10 +1494: %d item telah dijatuhkan! + //Bila ada terjemahan lain //import: conf/msg_conf/import/map_msg_idn_conf.txt diff --git a/doc/atcommands.txt b/doc/atcommands.txt index 440126428a5..b9c9dddcf79 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -705,9 +705,25 @@ Repairs all broken items in your inventory. --------------------------------------- -@dropall +@dropall {} + +Drops all items based on the item type. + +Valid item types: + -1 = All Items (default) + 0 = Healing Items + 2 = Useable Items + 3 = Etc Items + 4 = Weapons + 5 = Armors + 6 = Cards + 7 = Pet Eggs + 8 = Pet Armors + 10 = Ammunition Items -Drops all inventory and equipped items onto the floor. +Example: +To drop all weapons in inventory. +@dropall 4 --------------------------------------- diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 6aac5a898b9..c84f2ffdf23 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5273,20 +5273,47 @@ ACMD_FUNC(follow) /*========================================== - * @dropall by [MouseJstr] - * Drop all your possession on the ground + * @dropall by [MouseJstr] and [Xantara] + * Drops all your possession on the ground based on item type *------------------------------------------*/ ACMD_FUNC(dropall) { - int i; + int8 type = -1; + uint16 i, count = 0; + struct item_data *item_data = NULL; + nullpo_retr(-1, sd); - for (i = 0; i < MAX_INVENTORY; i++) { - if (sd->status.inventory[i].amount) { - if(sd->status.inventory[i].equip != 0) - pc_unequipitem(sd, i, 3); - pc_dropitem(sd, i, sd->status.inventory[i].amount); + + if( message[0] ) { + type = atoi(message); + if( type != -1 && type != IT_HEALING && type != IT_USABLE && type != IT_ETC && type != IT_WEAPON && + type != IT_ARMOR && type != IT_CARD && type != IT_PETEGG && type != IT_PETARMOR && type != IT_AMMO ) + { + clif_displaymessage(fd, msg_txt(sd,1492)); + clif_displaymessage(fd, msg_txt(sd,1493)); + return -1; + } + } + + for( i = 0; i < MAX_INVENTORY; i++ ) { + if( sd->status.inventory[i].amount ) { + if( (item_data = itemdb_exists(sd->status.inventory[i].nameid)) == NULL ) { + ShowDebug("Non-existant item %d on dropall list (account_id: %d, char_id: %d)\n", sd->status.inventory[i].nameid, sd->status.account_id, sd->status.char_id); + continue; + } + if( !pc_candrop(sd,&sd->status.inventory[i]) ) + continue; + + if( type == -1 || type == (uint8)item_data->type ) { + if( sd->status.inventory[i].equip != 0 ) + pc_unequipitem(sd, i, 3); + count += sd->status.inventory[i].amount; + pc_dropitem(sd, i, sd->status.inventory[i].amount); + } } } + sprintf(atcmd_output, msg_txt(sd,1494), count); // %d items are dropped! + clif_displaymessage(fd, atcmd_output); return 0; }