Jump to content
  • 0
uDe

How to refine rentitem

Question

15 answers to this question

Recommended Posts

wew..been so long ..... if you still need this ...

 

Thanks @Emistry. But my problem was solved by @AnnieRuru long time ago by PM. Thanks again for remind me of this thread, I'm forgot already. But still I believe your new Refine Funtion script will be useful. FYI, for refine rentitem equipments, I've use your previous script from Post #4 and it's working perfectly.

 

And for de-refine without removing the rentitem durations, @AnnieRuru was helping me by edit the script from Post #6.

 

Here it is :

 

prontera,155,175,3	script	De-Refiner	85,{
	set [email protected]$,"[^0065DFThe Smith^000000]";
	mes [email protected]$;
	mes "Hello..";
	mes " ";
	mes "I can de-refine all your refined equipments.";
	mes "Please make sure you have equipped the items.";
	next;
//	the next line "setarray" is to store the item ID of the character. Because player with their own hexed client ( aka. hacker ) might change equipment during the talk to npc
	setarray @equip[1],getequipid(1),getequipid(2),getequipid(3),getequipid(4),getequipid(5),getequipid(6),getequipid(7),getequipid(8),getequipid(9),getequipid(10);
//	store the equipment placement so I can optimize the script
	setarray [email protected][1],256,16,32,2,4,64,8,128,512,1;
	select(getequipname(1),getequipname(2),getequipname(3),getequipname(4),getequipname(5),getequipname(6),getequipname(7),getequipname(8),getequipname(9),getequipname(10));
		if ( !getequipisequiped(@menu) ) {
			mes [email protected]$;
			mes "There's nothing equipped there...";
			close; }
		if (countitem(7539)<10) {
			mes [email protected]$;
			mes "You don't have enough Poring Coin to pay me to work with your equipment.";
			close; }
		if ( getequiprefinerycnt(@menu) > 10 || getequiprefinerycnt(@menu) == 0 ) {
			mes [email protected]$;
			mes "This item cannot be de-refine.";
			close; }
	//	now we make a check on them ... 
		if ( getequipid(@menu) != @equip[@menu] ) {
			mes [email protected]$;
			mes "Do you think I am that stupid?";
			mes "You have changed the equipment !!";
			mes "Get lost !!";
			close; }
//	atcommand "@refine "+ [email protected][@menu] +" -1";
	downrefitem @menu;
	delitem 7539,10;
	mes [email protected]$;
	mes "Your equipment has successfully de-refined.";
	close;
}
Edited by uDe
Link to comment
Share on other sites

As Emistry posted: rented items are marked as unrefinable and will fail the getequipisenableref() check on the official refiners. Otherwise successrefitem works fine on any equipment.

Link to comment
Share on other sites

I'm sorry, but how to apply that into your script?

hxyn0.png

//--- 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#normal",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,91,116,5	script	Perfect Refiner	63,{
callfunc( "RefineFunc#normal",7420,5,63,0,10,1,1,100 );
}


function	script	RefineFunc#normal	{

for( set [email protected],1; [email protected] <= 10; set [email protected],[email protected] + 1 )
set [email protected]$,[email protected]$ + (( getarg(2) & pow( 2,([email protected] ) ) && getequiprefinerycnt( [email protected] ) >= getarg(3) && getequiprefinerycnt( [email protected] ) < getarg(4) && getequipisequiped( [email protected]) )?"^FF0000+"+getequiprefinerycnt( [email protected] )+" ^0000FF"+getequipname( [email protected] )+" "+( getitemslots( getequipid( [email protected] ) )?"["+getitemslots( getequipid( [email protected] ) )+"]":"" )+"^000000":"" )+":";
set [email protected],select( [email protected]$ );
mes "Required ^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
if( getarg(5) == 1 && !getequipisenableref( [email protected] ) )
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( [email protected] ) < getarg(4) )
				successrefitem ( [email protected] );
		else
			successrefitem ( [email protected] );
	mes "You have refined : ";
	mes "^FF0000+"+getequiprefinerycnt( [email protected] )+" ^0000FF"+getequipname( [email protected] )+"^000000";
	}else{
		failedrefitem ( [email protected] );
		mes "Sorry, Failed in Refine and Equipment...Destroyed.";
	}
}
close;
}

That's your script right? I'm forget already.. /oops

Edited by uDe
Link to comment
Share on other sites

// .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );

//  6. CheckEquip -> Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]

set to 0 to disable checking for the equipments can be refine or cant be refine

  • Upvote 1
Link to comment
Share on other sites

As Emistry posted: rented items are marked as unrefinable and will fail the getequipisenableref() check on the official refiners. Otherwise successrefitem works fine on any equipment.

I'm so slow. Sorry..

So, I need to replace

!getequipisenableref( [email protected] )

to successrefitem( [email protected] ) ?

// .....callfunc( "RefineFunc",<itemID>,<Amount>,<BitMasks>,<MinRefine>,<MaxRefine>,<CheckEquip>,<RefineMode>,<Percent> );

//  6. CheckEquip -> Check Equipments is Refineable or not. [ 0 = Disable / 1 = Enable ]

set to 0 to disable checking for the equipments can be refine or cant be refine

Sorry, I missed that... /shy

FnDoj.png

How about de-refine? If I use this de-refiner NPC. The timer will gone..

turbo_room,107,119,3	script	De-Refiner	85,{
setarray [email protected][0],7539,100;
mes "[^0065DFThe Smith^000000]";
mes "Hello..";
mes "I can de-refine all your refined equipments.";
mes "But remember, each services cost ^FF0000"[email protected][1]+" x "+getitemname([email protected][0])+"^000000";
mes "and make sure you have equipped the items.";
next;
mes "[^0065DFThe Smith^000000]";
mes "Which equipments do you want to de-refine?";
if( countitem( [email protected][0] ) >= [email protected][1] ){
next;
for( set [email protected],1; [email protected] <= 10; set [email protected],[email protected] + 1 )
	set [email protected]$,[email protected]$ + (( getequipid([email protected]) > 0 && getequiprefinerycnt([email protected]) )? getitemname(getequipid([email protected])):"" )+":";
	set [email protected],select([email protected]$);
	next;
	setarray [email protected][0],getequipid([email protected]),getequipcardid([email protected],0),getequipcardid([email protected],1),getequipcardid([email protected],2),getequipcardid([email protected],3);
	failedrefitem [email protected];
	delitem [email protected][0],[email protected][1];
	getitem2 [email protected][0],1,1,0,0,[email protected][1],[email protected][2],[email protected][3],[email protected][4];
	equip [email protected][0];
	next;
	mes "[^0065DFThe Smith^000000]";
	mes "Done.";
	specialeffect 154;
}
close;
}

Instead of using

   	 delitem [email protected][0],[email protected][1];
	getitem2 [email protected][0],1,1,0,0,[email protected][1],[email protected][2],[email protected][3],[email protected][4];

can it be used by @refine -? Or anything else.. So the rentitem won't dissapear..

Edited by uDe
Link to comment
Share on other sites

*downrefitem <equipment slot>;

This command will downgrade an item by - 1 in the specified equipment slot of the

invoking character. So the item will not be destroyed unlike in the failedrefitem script command.

This will also display a 'refine failure' effect on the character and put appropriate

messages into their chat window.

Link to comment
Share on other sites

*downrefitem <equipment slot>;

This command will downgrade an item by - 1 in the specified equipment slot of the

invoking character. So the item will not be destroyed unlike in the failedrefitem script command.

This will also display a 'refine failure' effect on the character and put appropriate

messages into their chat window.

Can you please help me to edit the script Euphy?

Link to comment
Share on other sites

turbo_room,107,119,3	script	De-Refiner	85,{
setarray [email protected][0],7539,100;
mes "[^0065DFThe Smith^000000]";
mes "Hello..";
mes "I can de-refine all your refined equipments.";
mes "But remember, each services cost ^FF0000"[email protected][1]+" x "+getitemname([email protected][0])+"^000000";
mes "and make sure you have equipped the items.";
next;
mes "[^0065DFThe Smith^000000]";
mes "Which equipments do you want to de-refine?";
if( countitem( [email protected][0] ) >= [email protected][1] ){
next;
for( set [email protected],1; [email protected] <= 10; set [email protected],[email protected] + 1 )
	set [email protected]$,[email protected]$ + (( getequipid([email protected]) > 0 && getequiprefinerycnt([email protected]) )? getitemname(getequipid([email protected])):"" )+":";
	set [email protected],select([email protected]$);
	next;
	setarray [email protected][0],getequipid([email protected]),getequipcardid([email protected],0),getequipcardid([email protected],1),getequipcardid([email protected],2),getequipcardid([email protected],3);
	downrefitem [email protected];
	delitem [email protected][0],[email protected][1];
	getitem2 [email protected][0],1,1,0,0,[email protected][1],[email protected][2],[email protected][3],[email protected][4];
	equip [email protected][0];
	next;
	mes "[^0065DFThe Smith^000000]";
	mes "Done.";
	specialeffect 154;
}
close;
}

Like that?

Result, still same. No more timer..

Edited by uDe
Link to comment
Share on other sites

hmm...seem like downrefitem will remove the time i guess .....

if you use rentitem2 to create item...still required some work to calculation the remaining rental time ( with source mod made by Brian should be no problem )

Link to comment
Share on other sites

I'm just use rentitem, then the eq refined by your script. Because I want players freely to refine or de-refine their rentitem eq.

How about the atcommand @refine - ?

Link to comment
Share on other sites

Looks like for this one, you'll have to set a variable that stores the rent time then pause it when they logout rinse and repeat. Then when they refine/down refine just use the variables as the rent time. Only issue I see with this is... The need to add a timer every time they login so that you can delete the variables.

Link to comment
Share on other sites

I'm just use rentitem, then the eq refined by your script. Because I want players freely to refine or de-refine their rentitem eq.

How about the atcommand @refine - ?

BUMP for today.

wew..been so long ..... if you still need this ...

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



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.