Skip to content

Commit

Permalink
* Implemented modified @DropAll by Xantara (discussion:http://rathena…
Browse files Browse the repository at this point in the history
  • Loading branch information
cydh committed Oct 26, 2013
1 parent 75bc9cd commit 341da22
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conf/help.txt
Expand Up @@ -136,7 +136,7 @@ hairstyle: "Params: <hairstyle no.>\n" "Changes your hair style."
haircolor: "Params <hair palette no.>\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: <effect id> [<flag>]\n" "Give an effect to your character."
dropall: "Throws all your possession on the ground."
dropall: "Params: [<item type>]\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)."
Expand Down
5 changes: 5 additions & 0 deletions conf/msg_conf/map_msg.conf
Expand Up @@ -1493,5 +1493,10 @@
1490: Item types on your autoloottype list:
1491: Your autoloottype list has been reset.

// @dropall
1492: Usage: @dropall {<type>}
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
19 changes: 19 additions & 0 deletions conf/msg_conf/map_msg_idn.conf
Expand Up @@ -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 -<nama atau ID item>.
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 +<nama atau ID tipe>". Untuk menghilangkan sebuah tipe item, gunakan "@aloottype -<nama atau ID tipe>".
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 {<tipe>}
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
20 changes: 18 additions & 2 deletions doc/atcommands.txt
Expand Up @@ -705,9 +705,25 @@ Repairs all broken items in your inventory.

---------------------------------------

@dropall
@dropall {<item type>}

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

---------------------------------------

Expand Down
43 changes: 35 additions & 8 deletions src/map/atcommand.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 341da22

Please sign in to comment.