Jump to content
  • 0

getequipbound ######


Question

Posted (edited)

May I request this source coz I can't make it on my own.. gawi.gif  swt3.gif

 

getequipbound <equipment slot>;

 

It returns the bound type of the currently equipped item.

 

0 - Equipment is not bounded

1 - Account Bound

2 - Guild Bound

3 - Party Bound

4 - Character Bound

 

I will use this to my custom pvp room wherein when you killed a player you have a chance to steal his currently equipped item and I want the bound type to be the same.

OnPCDieEvent:
	for(.@i=0; .@i < 10; .@i++)
	{
		if( getequipisequiped(.@i) ) {
			.@itemid = getequipid(.@i);
			.@refine = getequiprefinerycnt(.@i);
			.@card1 = getequipcardid(.@i,0);
			.@card2 = getequipcardid(.@i,1);
			.@card3 = getequipcardid(.@i,2);
			.@card4 = getequipcardid(.@i,3);
			if( getequipbound(.@i) )
				.@bound = getequipbound(.@i);
				
			if( rand(1,100) <= 20 ) {
				delequip .@i;
				if ( .@bound )
					getitembound2 .@itemid,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,.@bound,killerrid;
				else
					getitem2 .@itemid,1,1,.@refine,0,.@card1,.@card2,.@card3,.@card4,killerrid;
			}
		}
	}
end;

Thanks in advance!

 

 

EDIT:

 

Ended up doing this on my own. Can anyone check if it has some glitches? LOL I'm not actually into source. but this script command is working fine with me.  /pat

BUILDIN_FUNC(getequipbound)
{
	int i, num, type;
	TBL_PC *sd;

	num=script_getnum(st,2);
	
	sd=script_rid2sd(st);
	if (num > 0 && num <= ARRAYLENGTH(equip))
		i=pc_checkequip(sd,equip[num-1]);
		
	type = sd->status.inventory[i].bound;
		
	if( i > 0 && type )
		script_pushint(st,type);
	else
		script_pushint(st,0);
	return SCRIPT_CMD_SUCCESS;
}
Edited by Lord Ganja

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...