Jump to content

Suggestion - Add *Equip2 and *Rentitem2 commands~


Truly

Recommended Posts


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  201
  • Reputation:   47
  • Joined:  11/17/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

+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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  201
  • Reputation:   47
  • Joined:  11/17/11
  • Last Seen:  

Oh hell yeah, thats a nice add too, been having to use delitem2 for a specific equip and its a bit of a pain. +1 to the add ^

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   13
  • Joined:  01/08/12
  • Last Seen:  

these are some cool commands and yes +1 for the add..

Link to comment
Share on other sites

  • 9 months later...

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

Can you share me the diff for this commands i really need it for my server and also the delitem2 ..

Thank you ..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   83
  • Joined:  01/05/12
  • Last Seen:  

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Rentitem2 was implemented in 339c0a8. Any opinions on 'equip2' and 'getequipexpiretick'?
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

go add them :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

*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 ?

Link to comment
Share on other sites

  • 6 months later...

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

-NecroPost-

http://rathena.org/board/files/file/2240-release-script-command-equip2/

 

This command does work. Tested on latest revision.

Just add it to script.inc and script_def.inc in src/custom folder.

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

×
×
  • Create New...