Jump to content

Suggestion - Add *Equip2 and *Rentitem2 commands~


Recommended Posts

Posted (edited)

Hey guys, pretty small suggestion for the SVN here, basically I suggest adding the snippets for Equip2(Made by Xantara) and Rentitem2 (Made by Brian). The use of them is to the persons extent, but still its something not in rA and i think it needs to be !

Here are the related topics (Thanks to Brian for the links!)

Equip2: http://www.eathena.w...howtopic=278129

And

Rentitem2: http://www.eathena.w...1

^ The topic includes these two diffs:

rentitem2.diff and getequipexpiretick.diff

That's about it.

Edited by Truly
  • Upvote 2
Posted

+1 also if I may suggest one little addon of the same kind

/// Deletes items from the target/attached player.
/// [Lighta]
/// delitemequip emplacement,{accounID}
BUILDIN_FUNC(delitemequip)
{
TBL_PC *sd;
    struct item_data* id;
    struct item it;
int loc=0, i=0;
if( script_hasdata(st,3) )
{
 int account_id = script_getnum(st,3);
 sd = map_id2sd(account_id); // <account id>
 if( sd == NULL )
 {
  ShowError("script:delitemequip: player not found (AID=%d).n", account_id);
  st->state = END;
  return 1;
 }
}
else
{
 sd = script_rid2sd(st);// attached player
 if( sd == NULL )
  return 0;
}

loc = script_getnum(st,2) -1;
if( loc < 0 || loc >= ARRAYLENGTH(equip) )
{
 return 0;
}
// get inventory position of item
i = pc_checkequip(sd,equip[loc]);
if( i < 0 )
{
 return 0;
}
id = sd->inventory_data[i];
    it.nameid = id->nameid;

    pc_unequipitem(sd,i,3);
    if (pc_delitem(sd,i,1,0,3) == 0) //succes
  {// success
		    script_pushint(st,0);
 return 0;
}
ShowError("script:delitemequip: failed to delete item (AID=%d item_id=%d pos=%d name=%s).n", sd->status.account_id, it.nameid, loc, id->name);
st->state = END;
clif_scriptclose(sd, st->oid);
    script_pushint(st,-1);
return 1;
}

  • Upvote 1
  • 1 month later...
  • 9 months later...
  • 1 year later...
Posted

*equip2 is a must add

*getequipexpiretick can work around with *getinventorylist

-	script	kjdfkjsf	-1,{
OnInit:
	bindatcmd "qwer", strnpcinfo(0)+"::Onaaa";
	end;
Onaaa:
	rentitem "knife", 10;
	getinventorylist;
	for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {
		if ( @inventorylist_equip[.@i] )
			dispbottom getitemname( @inventorylist_id[.@i] ) +( ( @inventorylist_expire[.@i] )? " : expire in "+( @inventorylist_expire[.@i] - gettimetick(2) ) +" seconds" : "" );
	}
	end;
}
but this method kinda sux

though, its mostly use to list out which items has expiration

is there any practical use of getequipexpiretick ?

  • 6 months later...

Join the conversation

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

Guest
Reply to this topic...

×   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...