Jump to content
  • 0

Rental Items Problem


jharick

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

I have problem with rental items.

If the rental item have card on it. also the card will disappear when the rental item is expired.

Is theres anyway that the card wont disappear after the Rental Items expired.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

bump.

I see this at eathena. anyone know how to work this code in rathena?

void pc_inventory_rentals(struct map_session_data *sd)
{
int i, c = 0;
int counter,flag = 0;
unsigned int expire_tick, next_tick = UINT_MAX;
for( i = 0; i < MAX_INVENTORY; i++ )
{
if( sd->status.inventory[i].nameid == 0 )
continue; // Nothing here
if( sd->status.inventory[i].expire_time == 0 )
continue;
if( sd->status.inventory[i].expire_time <= time(NULL) )
{
clif_rental_expired(sd->fd, sd->status.inventory[i].nameid);
// loop through rental item cards (if it exists)
// then add it to user's inventory
for(counter=0;counter<4;counter++){
if(sd->status.inventory[i].card[counter]>0){
struct item card_it;
memset(&card_it,0,sizeof(card_it));
card_it.nameid=sd->status.inventory[i].card[counter];
card_it.identify=itemdb_isidentified(card_it.nameid);
if ((flag = pc_additem(sd, &card_it, 1)))
{
clif_additem(sd, 0, 0, flag);
if( pc_candrop(sd,&card_it) )
map_addflooritem(&card_it,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}
// delete rental item
pc_delitem(sd, i, sd->status.inventory[i].amount, 0);
}
else
{
expire_tick = (unsigned int)(sd->status.inventory[i].expire_time - time(NULL)) * 1000;
clif_rental_time(sd->fd, sd->status.inventory[i].nameid, (int)(expire_tick / 1000));
next_tick = min(expire_tick, next_tick);
c++;
}
}
if( c > 0 ) // min(next_tick,3600000) 1 hour each timer to keep announcing to the owner, and to avoid a but with rental time > 15 days
sd->rental_timer = add_timer(gettick() + min(next_tick,3600000), pc_inventory_rental_end, sd->bl.id, 0);
else
sd->rental_timer = INVALID_TIMER;
}

Edited by jharick
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...