Cydh

Release: Script command: itemlink to generate <ITEML>

Recommended Posts

Posted (edited)
 
To generate <ITEML> string by using itemlink. <ITEML> is string that auto-parsed by client that support item link feature, when user SHIFT+Click the item or equipment.
 
 
Quote

*itemlink(<item_id>{,<refine>,<card0>,<card1>,<card2>,<card3>});
*itemlink2(<item_id>,<refine>,<card0>,<card1>,<card2>,<card3>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>);

Generate <ITEML> string for an item and can be used for npctalk, message,
dispbottom, and broadcast commands. The result is clickable-item name just
like from SHIFT+Click from player's inventory/cart/equipment window. In mes
command is still usable but the item name is not clickable.

Examples:

    npctalk "Knife [3] : "+itemlink(1202)+"";
    npctalk "+16 Knife [3] : "+itemlink(1202,16)+"";
    npctalk "+13 BXB Bapho+VR+EA2+EA1 : "+itemlink(18110,13,4147,4407,4833,4832)+"";
    setarray [email protected]_ids[0],RDMOPT_VAR_ATKPERCENT,RDMOPT_VAR_ATKPERCENT,RDMOPT_VAR_ATTMPOWER,0,0;
    setarray [email protected]_values[0],3,5,20,0,0;
    setarray [email protected]_params[0],0,0,0,0,0;
    npctalk "+13 BXB Bapho+VR+EA2+EA1 + 3 Options : "+itemlink2(18110,13,4147,4407,4833,4832,[email protected]_ids,[email protected]_values,[email protected]_params)+"";


For RandomIDArray, RandomValueArray, and RandomParamArray only works if
client (& server is complied) with supporter Item Random Options feature is
PACKETVER >= 20150225. But using itemlink2, all command parameters must be
specified if PACKETVER is not supported, use dummy arrays to avoid errors!

 

 

Spoiler

 

Example usage but in different language

image.png.9272200871d5af5d08dcd046ba1b7795.png

 

 

Edited by Cydh
  • Upvote 3
  • Love 2
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

*itemlink(<item_id>{,<refine>,<card0>,<card1>,<card2>,<card3>});

compare with getitem2
*getitem2(<item id>, <amount>, <identify>, <refine>, <attribute>, <card1>, <card2>, <card3>, <card4>{, <account ID>})

what happen to the <identify> and <attribute> field ?

 

EDIT: ->

Testing ...
1. if the item is not identify ... I can't even get the shift-click to work ..
2. if the item is broken, shift-click it will display non-broken item ....

hmm ....
I think these guys have thought it out ...

nvm, disregard this post

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
2 hours ago, AnnieRuru said:

*itemlink(<item_id>{,<refine>,<card0>,<card1>,<card2>,<card3>});

compare with getitem2
*getitem2(<item id>, <amount>, <identify>, <refine>, <attribute>, <card1>, <card2>, <card3>, <card4>{, <account ID>})

what happen to the <identify> and <attribute> field ?

 

EDIT: ->

Testing ...
1. if the item is not identify ... I can't even get the shift-click to work ..
2. if the item is broken, shift-click it will display non-broken item ....

hmm ....
I think these guys have thought it out ...

nvm, disregard this post

amount and atribut is not needed by ITEML. we never talk about ITEML here, but you can found the info here

  • Love 1

Share this post


Link to post
Share on other sites

just took a crack on this
http://herc.ws/board/topic/16648-iteml-function/

it seems your script command missing to view the costumes

 

>>> this script is tested on rathena

function	script	F_ITEML	{
	.@id = getarg(0);
	.@itemid$ = callsub( S_Base62, .@id );

	.@itemtype = getiteminfo( .@id, 2 );
	if ( .@itemtype == IT_WEAPON || .@itemtype == IT_ARMOR )
		.@show_slot = true;
	.@equip_loc$ = callsub( S_Base62, getiteminfo( .@id, 5 ), 5 );
	.@viewid$ = "&"+ callsub( S_Base62, getiteminfo( .@id, 11 ) );
	return "<ITEML>"+ .@equip_loc$ + .@show_slot + .@itemid$ + .@viewid$ +"</ITEML>";
S_Base62:
	.@num = getarg(0);
	while ( .@num ) {
		.@base62_value$ = [email protected]$[ .@num % 62 ] + .@base62_value$;
		.@num /= 62;
	}
	.@default_zeroes = getarg(1, 2);
	while ( getstrlen(.@base62_value$) < .@default_zeroes )
		.@base62_value$ = insertchar( .@base62_value$, "0", 0 );
	return .@base62_value$;
}
-	script	ITEML	FAKE_NPC,{
OnInit:
	setarray [email protected]$,"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z";
	end;
}

prontera,155,185,3	script	itemlinktest#1	1_F_MARIA,{
	input .@a;
	npctalk itemlink(.@a);
	npctalk F_ITEML(.@a);
	debugmes itemlink(.@a);
	debugmes F_ITEML(.@a);
	end;
}

result in

[Debug]: script debug : 2000000 110000034 : <ITEML>0000011jZ</ITEML>
[Debug]: script debug : 2000000 110000034 : <ITEML>0004811jZ&2H</ITEML>

 

the difference is when input an item with costume enable

screen2019rAthena014.jpgscreen2019rAthena015.jpg

yours to the left, mine to the right

48 is convert as 256, which is EQP_HEAD_TOP
2H is 167, which is the ViewID

Share this post


Link to post
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.

Loading...