Jump to content
  • 0

check if EQUIPPED Item is bounded or Rental


Question

Posted (edited)

I was checking if there is NPC script that can be used to check a player currently EQUIPPED ITEM if it is bounded or rental.

 

I found countbound(), However it only checks the inventory. Not the equipped item. May I ask if there is a way to check the EQUIPPED item if bounded or a rental.

		setarray .@indices[1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW;
		for (.@i = 1; .@i<=3; ++.@i) {
			if (getequipisequiped(.@indices[.@i])) {
				.@menu$ = .@menu$ + F_getpositionname(.@indices[.@i]) + "-[" + getequipname(.@indices[.@i]) + "]";
				.@equipped = 1;
			}
			.@menu$ = .@menu$ + ":";
		}
		if (.@equipped == 0) {
			mes "["+ .@npc_name$ +"]";
			mes "You need to wear headgears that I can costume...";
			close;
		}	
		if (countitem(50026) < 1){
		mes "You do not have the Costume Ticket from your inventory.";
		close;
		}
		mes "["+ .@npc_name$ +"]";
		mes "Please select what to convert.";
		mes "^FF0000 Take note: ^0000FF";
		mes "^0B27F3 I cannot convert items that has a refine OR a card inserted. ^0000FF";
		next;
		.@part = .@indices[ select(.@menu$) ];
		if (!getequipisequiped(.@part)) {
			mes "["+ .@npc_name$ +"]";
			mes "You're not wearing anything there...";
			close;
		}
		set .@equip_id,getequipid(.@Part);
		if( countbound() ){
			for( set .@i,0; .@i < getarraysize( @bound_items ); set .@i,.@i+1 )
				if( @bound_items[.@i] == .@equip_id ){
					mes "This is bounded items.";
					close;
				}
		}

 

Edited by glemor123

3 answers to this question

Recommended Posts

  • 1
Posted
prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	getinventorylist;
	for (.@i = 0; .@i < @inventorylist_count;. @i++) {
		if (@inventorylist_equip[.@i]) {
			mes "item is equipped.";
		}
		if (@inventorylist_expire[.@i]) {
			mes "item has expired time.";
		}
		if (@inventorylist_bound[.@i]) {
			mes "item is bounded.";
		}
	}
}

you can use getinventorylist to get all the information

  • Upvote 2
  • 1
Posted

Thanks!

				if (@inventorylist_bound[.@i] ) {
					if (@inventorylist_id[.@i] == getequipid(.@part)){
						mes "Your item ( ^FF0000"+ getitemname(getequipid(.@part)) + "^0000FF ) is bounded. I cannot convert this item";
						mes"";
					close;
					}				
				}

 

  • Upvote 1
  • 1
Posted
if (@inventorylist_id[.@i] == getequipid(.@part)){

change into this

if (@inventorylist_equip[.@i] > 0 && @inventorylist_id[.@i] == getequipid(.@part)){

 

  • Upvote 1
  • Love 1

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