Jump to content
  • 0

trying to use emistry refine callfunc item/NPC


Question

Posted (edited)

it seems selection dont show up heres the script

//--- Bitmasks ----
//	1	-	Top Headgear
//	2	-	Armor
//	4	-	Left Hand
//	8	-	Right Hand
//	16	-	Garment
//	32	-	Shoes
//	64	-	Left Accessory
//	128	-	Right Accessory
//	256	-	Middle Headgear
//	512	-	Lower Headgear

// .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );
//		1.	itemID		->	Item that will be used during Refine.
//		2.	Amount		->	Amount of Required Items.
//		3.	BitMask		->	Refer to above bitmask table.
//		4.	MinRefine	->	Required Min Refine to use.
//		5.	MaxRefine	->	What is the Max Refine. [ Can Bypass Default Server Max Refine ]
//		6.	CheckEquip	->	Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]
//		7.	RefineMode	->	+1 / Max Refine. [ 0 = +1 Refine / 1 = Max Refine ]
//		8.	Percent		->	Rate of Success to refine current Equipment.

// Notes : You can Customize it according to whatever way you want.
//	Different NPCs / Items with Different Settings.
//	It will consume the items that you defined to Refine  the Equipments according to your Settings.

//----------- If used this as Item Script -----------

// Example : Red Potion with 100% Refine Rate
//		501,Red_Potion,Red Potion,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",501,1,63,0,10,1,0,100 ); },{},{}
// Change Item Type to 11  and Amount Required to 1 ( Advised )

//----------- If used this as NPC Script ------------

// Example : 90% Success Rate Refiner.
//		turbo_room,108,112,5	script	Refiner	757,{
//			callfunc( "RefineFunc",3036,1,8,8,10,1,1,100);
//		}


function	script	RefineFunc	{

for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
	set .@Menu$,.@Menu$ + (( getarg(2) & pow( 2,(.@i-1 ) ) && getequiprefinerycnt( .@i ) >= getarg(3) && getequiprefinerycnt( .@i ) < getarg(4) && getequipisequiped( .@i) )?"^FF0000+"+getequiprefinerycnt( .@i )+" ^0000FF"+getequipname( .@i )+" "+( getitemslots( getequipid( .@i ) )?"["+getitemslots( getequipid( .@i ) )+"]":"" )+"^000000":"" )+":";
set .@Refine,select( .@Menu$ );
mes "Required ^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
	mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
else{
	if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;	
		if( countitem( getarg(0) ) < getarg(1) ) close;
			delitem getarg(0),getarg(1);
		if( rand(100) < getarg(7) ){
			if( getarg(6) ) 
				while( getequiprefinerycnt( .@Refine ) < getarg(4) )
					successrefitem ( .@Refine );
			else
				successrefitem ( .@Refine );
		mes "You have refined : ";
		mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
		}else{
			failedrefitem ( .@Refine );
			mes "Sorry, Failed in Refine and Equipment...Destroyed.";
		}
}
close;
}

this is the selection window

image.png.f479a1c82448bf77f9d6de7a04a12938.png

im using it as an useable item

3036,+9_Weapon_Refine_Deed,+9 Weapon Refine Deed,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",3036,1,8,8,10,1,1,100); },{},{}

thanks for the help @Emistry

Edited by AinsLord
more info

3 answers to this question

Recommended Posts

  • 0
Posted

may try this

//--- Bitmasks ----
//	1	-	Accessory 1
//	2	-	Accessory 2
//	4	-	Footgear(shoes, boots)
//	8	-	Garment(mufflers, hoods, manteaux)
//	16	-	Lower Headgear(beards, some masks)
//	32	-	Middle Headgear(masks, glasses)
//	64	-	Upper Headgear
//	128	-	Armor(jackets, robes)
//	256	-	Left hand(weapons, shields)
//	512	-	Right hand(weapons)
function	script	RefineFunc	{
	for (set .@i,EQI_ACC_L; .@i <= EQI_HAND_R; set .@i,.@i + 1)
		set .@Menu$,.@Menu$ +((getarg(2) & pow(2,(.@i-1)) && getequiprefinerycnt(.@i) >= getarg(3) && getequiprefinerycnt(.@i) < getarg(4) && getequipisequiped(.@i))?"^FF0000+"+getequiprefinerycnt(.@i)+" ^0000FF"+getequipname(.@i)+" "+(getitemslots(getequipid(.@i))?"["+getitemslots(getequipid(.@i))+"]":"")+"^000000":"")+":";
	set .@Refine,select(.@Menu$);
	mes "Required ^FF0000"+getarg(1)+" x "+getitemname(getarg(0))+"^000000";
	if (getarg(5) == 1 && !getequipisenableref(.@Refine))
		mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
	else{
		if (select("^FF0000Refine^000000:Cancel") == 2) close;	
			if (countitem(getarg(0)) < getarg(1)) close;
				delitem getarg(0),getarg(1);
			if (rand(100) < getarg(7)){
				if (getarg(6)) 
					while(getequiprefinerycnt(.@Refine) < getarg(4))
						successrefitem (.@Refine);
				else
					successrefitem (.@Refine);
			mes "You have refined : ";
			mes "^FF0000+"+getequiprefinerycnt(.@Refine)+" ^0000FF"+getequipname(.@Refine)+"^000000";
			} else {
				failedrefitem (.@Refine);
				mes "Sorry, Failed in Refine and Equipment...Destroyed.";
			}
	}
	close;
}

 

  • 0
Posted
On 6/19/2021 at 5:16 AM, AinsLord said:

it seems selection dont show up heres the script


//--- Bitmasks ----
//	1	-	Top Headgear
//	2	-	Armor
//	4	-	Left Hand
//	8	-	Right Hand
//	16	-	Garment
//	32	-	Shoes
//	64	-	Left Accessory
//	128	-	Right Accessory
//	256	-	Middle Headgear
//	512	-	Lower Headgear

// .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );
//		1.	itemID		->	Item that will be used during Refine.
//		2.	Amount		->	Amount of Required Items.
//		3.	BitMask		->	Refer to above bitmask table.
//		4.	MinRefine	->	Required Min Refine to use.
//		5.	MaxRefine	->	What is the Max Refine. [ Can Bypass Default Server Max Refine ]
//		6.	CheckEquip	->	Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]
//		7.	RefineMode	->	+1 / Max Refine. [ 0 = +1 Refine / 1 = Max Refine ]
//		8.	Percent		->	Rate of Success to refine current Equipment.

// Notes : You can Customize it according to whatever way you want.
//	Different NPCs / Items with Different Settings.
//	It will consume the items that you defined to Refine  the Equipments according to your Settings.

//----------- If used this as Item Script -----------

// Example : Red Potion with 100% Refine Rate
//		501,Red_Potion,Red Potion,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",501,1,63,0,10,1,0,100 ); },{},{}
// Change Item Type to 11  and Amount Required to 1 ( Advised )

//----------- If used this as NPC Script ------------

// Example : 90% Success Rate Refiner.
//		turbo_room,108,112,5	script	Refiner	757,{
//			callfunc( "RefineFunc",3036,1,8,8,10,1,1,100);
//		}


function	script	RefineFunc	{

for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
	set .@Menu$,.@Menu$ + (( getarg(2) & pow( 2,(.@i-1 ) ) && getequiprefinerycnt( .@i ) >= getarg(3) && getequiprefinerycnt( .@i ) < getarg(4) && getequipisequiped( .@i) )?"^FF0000+"+getequiprefinerycnt( .@i )+" ^0000FF"+getequipname( .@i )+" "+( getitemslots( getequipid( .@i ) )?"["+getitemslots( getequipid( .@i ) )+"]":"" )+"^000000":"" )+":";
set .@Refine,select( .@Menu$ );
mes "Required ^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
	mes "I cant refine this items. Because it is ^FF0000Un-Refineable^000000.";
else{
	if( select( "^FF0000Refine^000000:Cancel" ) == 2 ) close;	
		if( countitem( getarg(0) ) < getarg(1) ) close;
			delitem getarg(0),getarg(1);
		if( rand(100) < getarg(7) ){
			if( getarg(6) ) 
				while( getequiprefinerycnt( .@Refine ) < getarg(4) )
					successrefitem ( .@Refine );
			else
				successrefitem ( .@Refine );
		mes "You have refined : ";
		mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
		}else{
			failedrefitem ( .@Refine );
			mes "Sorry, Failed in Refine and Equipment...Destroyed.";
		}
}
close;
}

this is the selection window

image.png.f479a1c82448bf77f9d6de7a04a12938.png

im using it as an useable item


3036,+9_Weapon_Refine_Deed,+9 Weapon Refine Deed,11,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc( "RefineFunc",3036,1,8,8,10,1,1,100); },{},{}

thanks for the help @Emistry

try follow this : 
 

(2^0)        1 = Lower headgear (2^1)        2 = Right hand (2^2)        4 = Garment/Robe (2^3)        8 = Accessory 1 (2^4)       16 = Armor (2^5)       32 = Left hand (2^6)       64 = Shoes (2^7)      128 = Accessory 2 (2^8)      256 = Upper headgear (2^9)      512 = Middle headgear (2^10)    1024 = Costume Upper headgear (2^11)    2048 = Costume Middle headgear (2^12)    4096 = Costume Lower headgear (2^13)    8192 = Costume Garment/Robe (2^15)   32768 = Arrow (arrow-type items only) (2^16)   65536 = Shadow Armor (2^17)  131072 = Shadow Weapon (2^18)  262144 = Shadow Shield (2^18)  524288 = Shadow Shoes (2^20) 1048576 = Shadow Accessory 2 (2^21) 2097152 = Shadow Accessory 1

 

  • 0
Posted
On 7/21/2021 at 1:09 PM, shatowolf said:

try follow this : 
 


(2^0)        1 = Lower headgear (2^1)        2 = Right hand (2^2)        4 = Garment/Robe (2^3)        8 = Accessory 1 (2^4)       16 = Armor (2^5)       32 = Left hand (2^6)       64 = Shoes (2^7)      128 = Accessory 2 (2^8)      256 = Upper headgear (2^9)      512 = Middle headgear (2^10)    1024 = Costume Upper headgear (2^11)    2048 = Costume Middle headgear (2^12)    4096 = Costume Lower headgear (2^13)    8192 = Costume Garment/Robe (2^15)   32768 = Arrow (arrow-type items only) (2^16)   65536 = Shadow Armor (2^17)  131072 = Shadow Weapon (2^18)  262144 = Shadow Shield (2^18)  524288 = Shadow Shoes (2^20) 1048576 = Shadow Accessory 2 (2^21) 2097152 = Shadow Accessory 1

 

where do i put or insert this?

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