/*==========================================
* @dropequip [FE]
* Drop spesific equipment to the ground
*------------------------------------------*/
ACMD_FUNC(dropequip)
{
int i;
unsigned short pos;
nullpo_retr(-1, sd);
if (!message || !*message) {
clif_displaymessage(fd, "Please enter equip location: @dropequip <equip_location>");
clif_displaymessage(fd, " 1: Head Low 2: Hand Right 4: Garment 8: Acc Left");
clif_displaymessage(fd, " 16: Armor 32: Hand Left 64: Shoes 128: Acc Right");
clif_displaymessage(fd, "256: Head Top 512: Head Mid");
return -1;
}
pos = atoi(message);
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount && sd->inventory_data[i]->equip&pos) {
if(sd->status.inventory[i].equip&pos) {
pc_unequipitem(sd, i, 3);
pc_dropitem(sd, i, sd->status.inventory[i].amount);
}
//-Delete code below if you only want to drop an equipped item---
else if (!sd->status.inventory[i].equip)
pc_dropitem(sd, i, sd->status.inventory[i].amount);
//---------------------------------------------------------------
}
}
return 0;
}
Could someone help transform this code from 2012 atcommand to work in atcommand.cpp from rathena 2019? Thanks a lot the errors are related to ''status.inventory'' and status.inventory[i] equip%pos it looks like it has changed over time.
Question
kronobr
Could someone help transform this code from 2012 atcommand to work in atcommand.cpp from rathena 2019? Thanks a lot
the errors are related to ''status.inventory'' and status.inventory[i] equip%pos it looks like it has changed over time.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.