Browse Source

* Implemented modified @dropall by Xantara (discussion:http://rathena.org/board/topic/88250-suggestion-add-dropall-mod/)
* Updated map_msg_idn.conf

Cahyadi Ramadhan Togihon 11 years ago
parent
commit
341da2281a
5 changed files with 78 additions and 11 deletions
  1. 1 1
      conf/help.txt
  2. 5 0
      conf/msg_conf/map_msg.conf
  3. 19 0
      conf/msg_conf/map_msg_idn.conf
  4. 18 2
      doc/atcommands.txt
  5. 35 8
      src/map/atcommand.c

+ 1 - 1
conf/help.txt

@@ -136,7 +136,7 @@ hairstyle: "Params: <hairstyle no.>\n" "Changes your hair style."
 haircolor: "Params <hair palette no.>\n" "Changes your hair color."
 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."
 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."
 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."
 storeall: "Puts all your possessions in storage."
 killable: "Make your character killable."
 killable: "Make your character killable."
 memo: "Params: [memo position]\n" "Set/change a memo location (no position: display memo points)."
 memo: "Params: [memo position]\n" "Set/change a memo location (no position: display memo points)."

+ 5 - 0
conf/msg_conf/map_msg.conf

@@ -1493,5 +1493,10 @@
 1490: Item types on your autoloottype list:
 1490: Item types on your autoloottype list:
 1491: Your autoloottype list has been reset.
 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
 //Custom translations
 //import: conf/msg_conf/import/map_msg_eng_conf.txt
 //import: conf/msg_conf/import/map_msg_eng_conf.txt

+ 19 - 0
conf/msg_conf/map_msg_idn.conf

@@ -1478,5 +1478,24 @@
 1478: Jarak level dalam party share telah diubah dengan sukses.
 1478: Jarak level dalam party share telah diubah dengan sukses.
 1479: Gagal memperbaruhi pengaturan. Server karakter sedang offline.
 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
 //Bila ada terjemahan lain
 //import: conf/msg_conf/import/map_msg_idn_conf.txt
 //import: conf/msg_conf/import/map_msg_idn_conf.txt

+ 18 - 2
doc/atcommands.txt

@@ -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
 
 
 ---------------------------------------
 ---------------------------------------
 
 

+ 35 - 8
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)
 ACMD_FUNC(dropall)
 {
 {
-	int i;
+	int8 type = -1;
+	uint16 i, count = 0;
+	struct item_data *item_data = NULL;
+
 	nullpo_retr(-1, sd);
 	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;
 	return 0;
 }
 }