Jump to content
  • 0

Refine npc


lamnor

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  25
  • Reputation:   0
  • Joined:  03/08/16
  • Last Seen:  

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

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

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

 

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