Jump to content

Question

Posted

Hello, i need a npc script that using an item, the weapon will be refined whith 100% and armor 100% chance.

Item name - Ticket Refine

1 answer to this question

Recommended Posts

  • 0
Posted

you can use the advance_refiner npc from rAthena itself,

advanced_refiner.txt

then just add this part

	if (getequiprefinerycnt(.@part) >= 10) {
		mes "[Suhnbi]";
		mes "Hmm... someone perfected this already. I don't think I can work on it further.";
		close;
	}

+	if( (countitem(<item_db>) >= 1 ){
+		successrefitem .@part;
+		delitem <item_db>,1;
+		next;
+		mes "[Suhnbi]";
+		mes "Wow, you have an item that can refine 100% success rate.";
+		mext;
+		emotion ET_BEST;
+		mes "[Suhnbi]";
+		mes "There you go! It's done.";
+		mes "It's been a while since I've made such a fine "+((getequipweaponlv(.@part))?"weapon":"armor")+". You must be happy because it has become stronger!";
+		close;
+	}	
	.@refineitemid = getequipid(.@part); // save id of the item
	.@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
	.@price = getequiprefinecost(.@part, REFINE_COST_ENRICHED, REFINE_ZENY_COST);
	.@material = getequiprefinecost(.@part, REFINE_COST_ENRICHED, REFINE_MATERIAL_ID);

	// Make sure you have the necessary items and Zeny to refine your items
	// Determines chance of failure and verifies that you want to continue.
	callsub S_RefineValidate,getequipweaponlv(.@part),.@material,.@price,.@part,.@refineitemid,.@refinerycnt;

	mes "[Suhnbi]";
	mes "Clang! Clang! Clang!";
	if (getequippercentrefinery(.@part, true) > rand(100)) {
		successrefitem .@part;
		next;
		emotion ET_BEST;
		mes "[Suhnbi]";
		mes "There you go! It's done.";
		mes "It's been a while since I've made such a fine "+((getequipweaponlv(.@part))?"weapon":"armor")+". You must be happy because it has become stronger!";
		close;
	}

 

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