Jump to content
  • 0

Item Description


Wise

Question


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

rentitem's src puts an expiration date on the item description.

I just wanted to know how to do that :o

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

You rent an item.. or you add an expiration date yourself in your itemdescription text file o_o

https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/src/map/script.c

This is how rentitem works:


/*==========================================
* rentitem <item id>,<seconds>
* rentitem "<item name>",<seconds>
*------------------------------------------*/
BUILDIN_FUNC(rentitem)
{
struct map_session_data *sd;
struct script_data *data;
struct item it;
int seconds;
int nameid = 0, flag;

data = script_getdata(st,2);
get_val(st,data);

if( (sd = script_rid2sd(st)) == NULL )
	return 0;

if( data_isstring(data) )
{
	const char *name = conv_str(st,data);
	struct item_data *itd = itemdb_searchname(name);
	if( itd == NULL )
	{
		ShowError("buildin_rentitem: Nonexistant item %s requested.\n", name);
		return 1;
	}
	nameid = itd->nameid;
}
else if( data_isint(data) )
{
	nameid = conv_num(st,data);
	if( nameid <= 0 || !itemdb_exists(nameid) )
	{
		ShowError("buildin_rentitem: Nonexistant item %d requested.\n", nameid);
		return 1;
	}
}
else
{
	ShowError("buildin_rentitem: invalid data type for argument #1 (%d).\n", data->type);
	return 1;
}

seconds = script_getnum(st,3);
memset(&it, 0, sizeof(it));
it.nameid = nameid;
it.identify = 1;
it.expire_time = (unsigned int)(time(NULL) + seconds);

if( (flag = pc_additem(sd, &it, 1, LOG_TYPE_SCRIPT)) )
{
	clif_additem(sd, 0, 0, flag);
	return 1;
}

return 0;
}

Edited by Mysterious
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

I meant the sentence "Expiration Date: 07/12 21:04" shown in the item's description when you rent an item.

Edited by Zeref
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

it is automatic, made by the hexed

Link to comment
Share on other sites

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.

×
×
  • Create New...