Jump to content
  • 0

How to refine rentitem


uDe

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

Hello guys..

I know that Emistry has released rentitem2 ( http://rathena.org/board/topic/59677-rentitem2/ ) patch.

But, here, I just need a mod for npc to able to refine rentitem equipments.

Thank you.

Link to comment
Share on other sites

15 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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 .@npc$,"[^0065DFThe Smith^000000]";
	mes .@npc$;
	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 .@a[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 .@npc$;
			mes "There's nothing equipped there...";
			close; }
		if (countitem(7539)<10) {
			mes .@npc$;
			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 .@npc$;
			mes "This item cannot be de-refine.";
			close; }
	//	now we make a check on them ... 
		if ( getequipid(@menu) != @equip[@menu] ) {
			mes .@npc$;
			mes "Do you think I am that stupid?";
			mes "You have changed the equipment !!";
			mes "Get lost !!";
			close; }
//	atcommand "@refine "+ .@a[@menu] +" -1";
	downrefitem @menu;
	delitem 7539,10;
	mes .@npc$;
	mes "Your equipment has successfully de-refined.";
	close;
}
Edited by uDe
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

ask the player equip the rental item and refine like normal equip at refiner npc..

refer successrefitem

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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 .@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;
}

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

Edited by uDe
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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( .@Refine )

to successrefitem( .@Refine ) ?

// .....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 .@ItemID[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"+.@ItemID[1]+" x "+getitemname(.@ItemID[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( .@ItemID[0] ) >= .@ItemID[1] ){
next;
for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
	set .@Menu$,.@Menu$ + (( getequipid(.@i) > 0 && getequiprefinerycnt(.@i) )? getitemname(getequipid(.@i)):"" )+":";
	set .@i,select(.@Menu$);
	next;
	setarray .@GetData[0],getequipid(.@i),getequipcardid(.@i,0),getequipcardid(.@i,1),getequipcardid(.@i,2),getequipcardid(.@i,3);
	failedrefitem .@i;
	delitem .@ItemID[0],.@ItemID[1];
	getitem2 .@GetData[0],1,1,0,0,.@GetData[1],.@GetData[2],.@GetData[3],.@GetData[4];
	equip .@GetData[0];
	next;
	mes "[^0065DFThe Smith^000000]";
	mes "Done.";
	specialeffect 154;
}
close;
}

Instead of using

   	 delitem .@ItemID[0],.@ItemID[1];
	getitem2 .@GetData[0],1,1,0,0,.@GetData[1],.@GetData[2],.@GetData[3],.@GetData[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


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

*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


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

*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


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

turbo_room,107,119,3	script	De-Refiner	85,{
setarray .@ItemID[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"+.@ItemID[1]+" x "+getitemname(.@ItemID[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( .@ItemID[0] ) >= .@ItemID[1] ){
next;
for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
	set .@Menu$,.@Menu$ + (( getequipid(.@i) > 0 && getequiprefinerycnt(.@i) )? getitemname(getequipid(.@i)):"" )+":";
	set .@i,select(.@Menu$);
	next;
	setarray .@GetData[0],getequipid(.@i),getequipcardid(.@i,0),getequipcardid(.@i,1),getequipcardid(.@i,2),getequipcardid(.@i,3);
	downrefitem .@i;
	delitem .@ItemID[0],.@ItemID[1];
	getitem2 .@GetData[0],1,1,0,0,.@GetData[1],.@GetData[2],.@GetData[3],.@GetData[4];
	equip .@GetData[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


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

BUMP for today.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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