Jump to content
  • 0

Costume Item


Question

Posted

Hiya, everyone. Everytime I log off and then log back in, the costume item that is made by this custom command(Made by Greenbox) is always taken off.

This is the code for the command.

@costumeitem

// Costume Item System [GreenBox]
ACMD_FUNC(costumeitem)
{
struct item item_tmp;
struct item_data *item_data;
char item_name[100];
int item_id, number = 0;
int flag;
int loop, get_count, i;
nullpo_retr(-1, sd);

memset(item_name, '\0', sizeof(item_name));

if (!message || !*message || (
	sscanf(message, "\"%99[^\"]\" %", item_name, &number) < 1 &&
	sscanf(message, "%99s %d", item_name, &number) < 1
)) {
	clif_displaymessage(fd, "Please, at least enter an option. (usage: @costumeitem <item name or ID> <quantity>).");
	return -1;
}

if (number <= 0)
		number = 1;

item_id = 0;
if ((item_data = itemdb_searchname(item_name)) != NULL ||
	(item_data = itemdb_exists(atoi(item_name))) != NULL)
		item_id = item_data->nameid;

if (item_id > 500) {
	loop = 1;
	get_count = number;
	if (!(item_data->equip&EQP_HEAD_LOW) &&
			!(item_data->equip&EQP_COSTUME_HEAD_LOW) &&
			!(item_data->equip&EQP_HEAD_MID) &&
			!(item_data->equip&EQP_COSTUME_HEAD_MID) &&
			!(item_data->equip&EQP_HEAD_TOP) &&
			!(item_data->equip&EQP_COSTUME_HEAD_TOP)
			)
	{
		clif_displaymessage(fd, "This can't be a costume item.");
		return 1;
	}

	for (i = 0; i < loop; i++) {
		memset(&item_tmp, 0, sizeof(item_tmp));
		item_tmp.nameid = item_id;
		item_tmp.identify = 1;
		item_tmp.refine = 0;
		item_tmp.attribute = 5;
		item_tmp.card[0] = 0;
		item_tmp.card[1] = 0;
		item_tmp.card[2] = 0;
		item_tmp.card[3] = 0;
		if ((flag = pc_additem(sd, &item_tmp, get_count)))
			clif_additem(sd, 0, 0, flag);
	}

	//Logs (A)dmins items [Lupus]
	if(log_config.enable_logs&0x400)
		log_pick_pc(sd, "A", item_tmp.nameid, number, &item_tmp);

	clif_displaymessage(fd, msg_txt(18)); // Item criado.
} else {
	clif_displaymessage(fd, msg_txt(19)); // Nome/ID inválido.
	return -1;
}

return 0;
}

dytws6.jpg

oigmcx.jpg

2 answers to this question

Recommended Posts

Posted (edited)

Thanks for replying, Arcenciel. Yea, I knew that. You already told me on the other topic.

Well, it's weird, because on eAthena, 3ceam and ream I could use the full diff of costume items that I found on eA without experiencing the problem I've stated on my first post. But, on rAthena, there's no warning or error showing when I'm recompiling. Everytime I created a costume item with that command(256,512 and 1 as for their locations) server keeps on un-equipping it upon log-in.

EDIT:

Nvm. Fixed it.

Edited by Legato

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...