From c3859e2b43ffd03c6e386f15e28bde7100a83665 Mon Sep 17 00:00:00 2001 From: hipsterfont Date: Wed, 19 Jun 2013 06:34:59 +0000 Subject: [PATCH] High upgrading (+11-20) updated to official success chances and behaviors: Suceess rates +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 armor 100 100 100 100 90 60 60 30 30 10 weapon lv1 100 100 100 100 100 100 100 90 60 20 weapon lv2 100 100 100 100 100 100 90 60 30 20 weapon lv3 100 100 100 100 100 90 75 30 30 20 weapon lv4 100 100 100 100 90 60 60 30 30 10 If refine fails, on official another random number 0-100 is rolled. If number > 80 item is broken, otherwise item is dropped a refine level (so in effect 20% chance to break on fail). git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17375 54d463be-8e91-2dee-dedb-b68131a5f0ec --- db/re/refine_db.txt | 10 +- npc/re/merchants/refine.txt | 244 +++++++++++------------------------- 2 files changed, 79 insertions(+), 175 deletions(-) diff --git a/db/re/refine_db.txt b/db/re/refine_db.txt index 421a1bdbc2..a9b7fedd19 100644 --- a/db/re/refine_db.txt +++ b/db/re/refine_db.txt @@ -30,12 +30,12 @@ // Note: Chances for +11 and higher are not verified - 10% is a rumor from iRO wiki. // A note about renewal Armors, there may or may not be another bonus, according to iRO wiki: Every upgrade gives floor[( 3 + current upgrade ) / 4] equipment DEF) -0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,50:300,30:300,30:400,20:400,10:400,10:400,10:500,10:500,10:500,10:500 +0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,100:300,100:300,100:400,100:400,90:400,60:400,60:500,30:500,30:500,10:500 // Level 1 weapons -1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,70:0,70:0,50:0,50:0,30:0,30:300,20:300,20:300,10:300,10:300 +1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,100:0,100:0,100:0,100:0,100:0,100:300,100:300,90:300,60:300,20:300 // Level 2 weapons -2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,70:0,50:0,50:0,30:0,30:0,20:600,20:600,10:600,10:600,10:600 +2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,100:0,100:0,100:0,100:0,100:0,100:600,90:600,60:600,30:600,20:600 // Level 3 weapons -3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,50:0,50:0,30:0,30:0,20:0,20:900,10:900,10:900,10:900,10:900 +3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,100:0,100:0,100:0,100:0,100:0,90:900,75:900,30:900,30:900,20:900 // Level 4 weapons -4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,50:0,30:0,30:0,20:0,20:0,10:1200,10:1200,10:1200,10:1200,10:1200 +4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,100:0,100:0,100:0,100:0,90:0,60:1200,60:1200,30:1200,30:1200,10:1200 diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt index efe5754805..229c1eec56 100644 --- a/npc/re/merchants/refine.txt +++ b/npc/re/merchants/refine.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= rAthena Dev Team //===== Current Version: ===================================== -//= 1.1 +//= 1.2 //===== Compatible With: ===================================== //= rAthena SVN //===== Description: ========================================= @@ -12,20 +12,22 @@ //= 1.0 Moved some scripts to Renewal file, optimized "Austry" NPC. [Euphy] //= 1.0a Added 'disable_items' command. [Euphy] //= 1.1 Added Malangdo Refiner "Clink". [Euphy] +//= 1.2 Added official success calculation, thanks to Helvetica. +//= The safe/multiple refine feature is now functional. [Euphy] //============================================================ // +11 and above Refiners //============================================================ prt_in,90,72,5 script Bestry#prt 826,{ - callfunc "refinenew","Bestry",0,0; + callfunc "refinenew","Bestry",0; end; } morocc_in,64,41,5 script Bestry#moc 826,{ - callfunc "refinenew","Bestry",0,0; + callfunc "refinenew","Bestry",0; end; } payon_in01,18,132,3 script Bestry#pay 826,{ - callfunc "refinenew","Bestry",0,0; + callfunc "refinenew","Bestry",0; end; } @@ -37,10 +39,8 @@ payon_in01,18,132,3 script Bestry#pay 826,{ //= If you enable this function, be sure to edit the value of //= .@safe to the max safe refine in refine_db.txt as well. //= -//= The official script uses a command which seems to generate a -//= random result upon refining: success, downgrade, or failure. -//= To enable that feature, set the third argument to '1' in the -//= function call. Otherwise, the chance in refine_db.txt is used. +//= On official servers, if an item is unsuccessfully refined +//= it will break at a 20% rate and downgrade at an 80% rate. //============================================================ function script refinenew { disable_items; @@ -95,7 +95,12 @@ function script refinenew { if ((getequipweaponlv(.@part) >= 1) && (getequipweaponlv(.@part) <= 4)) { set .@material,6224; set .@price,100000; - set .@safe,10; + switch(getequipweaponlv(.@part)) { + case 1: set .@safe,17; break; + case 2: set .@safe,16; break; + case 3: set .@safe,15; break; + case 4: set .@safe,14; break; + } mes "["+ getarg(0) +"]"; mes "Hmm a weapon, is that ok?"; mes "If you want to refine this weapon,"; @@ -104,7 +109,7 @@ function script refinenew { } else { set .@material,6223; set .@price,100000; - set .@safe,10; + set .@safe,14; mes "["+ getarg(0) +"]"; mes "Hmm an armor, is that ok?"; mes "If you want to refine this armor,"; @@ -170,19 +175,17 @@ function script refinenew { mes "You switched the item while I wasn't looking! Get out of here!"; close; } - if(getarg(2) == 1){ - set .@rand,rand(1,3); - if (.@rand == 1) { - mes "Clang! Clang! Clang! Clang!"; - successrefitem .@part; - next; - emotion e_no1; - mes "["+ getarg(0) +"]"; - mes "Good! Succes!!!"; - mes "I am the best Blacksmith."; - close; - } - if (.@rand == 2) { + if (getequippercentrefinery(.@part) > rand(100)) { + mes "Clang! Clang! Clang! Clang!"; + successrefitem .@part; + next; + emotion e_no1; + mes "["+ getarg(0) +"]"; + mes "Good! Succes!!!"; + mes "I am the best Blacksmith."; + close; + } else { + if (rand(100) < 80) { mes "["+ getarg(0) +"]"; mes "Clang! Clang! Clang! Clang!"; downrefitem .@part; @@ -200,72 +203,26 @@ function script refinenew { mes "["+ getarg(0) +"]"; mes "I will do a better job next time! Don't worry!"; close; + } else { + mes "["+ getarg(0) +"]"; + mes "Clang! Clang! Clang!"; + failedrefitem .@part; + next; + emotion (!rand(5))?e_cash:e_omg; + mes "["+ getarg(0) +"]"; + mes "Hmmm!"; + next; + mes "["+ getarg(0) +"]"; + mes "Oh my! I've failed to refine stuff..."; + mes "I didn't mean it!"; + mes "There could've been made an mistake even though I am the best ever."; + mes "It was out of my hands."; + next; + mes "["+ getarg(0) +"]"; + mes "I will do a better job next time! Don't worry!"; + close; } - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang!"; - failedrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "["+ getarg(0) +"]"; - mes "Hmmm!"; - next; - mes "["+ getarg(0) +"]"; - mes "Oh my! I've failed to refine stuff..."; - mes "I didn't mean it!"; - mes "There could've been made an mistake even though I am the best ever."; - mes "It was out of my hands."; - next; - mes "["+ getarg(0) +"]"; - mes "I will do a better job next time! Don't worry!"; - close; } - set .@rand,rand(100); - if (getequippercentrefinery(.@part) > .@rand) { - mes "Clang! Clang! Clang! Clang!"; - successrefitem .@part; - next; - emotion e_no1; - mes "["+ getarg(0) +"]"; - mes "Good! Succes!!!"; - mes "I am the best Blacksmith."; - close; - } - if (getequippercentrefinery(.@part) < .@rand) { - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang! Clang!"; - downrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "["+ getarg(0) +"]"; - mes "Ahhh!!!"; - next; - mes "["+ getarg(0) +"]"; - mes "Oh my!"; - mes "The upgrade level has dropped..."; - mes "There could've been made an mistake even though I am the best ever."; - mes "It was out of my hands."; - next; - mes "["+ getarg(0) +"]"; - mes "I will do a better job next time! Don't worry!"; - close; - } - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang!"; - failedrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "["+ getarg(0) +"]"; - mes "Hmmm!"; - next; - mes "["+ getarg(0) +"]"; - mes "Oh my! I've failed to refine stuff..."; - mes "I didn't mean it!"; - mes "There could've been made an mistake even though I am the best ever."; - mes "It was out of my hands."; - next; - mes "["+ getarg(0) +"]"; - mes "I will do a better job next time! Don't worry!"; - close; } // New +11 and above Refining Functions ======================== if(getequiprefinerycnt(.@part) < .@safe) { @@ -280,13 +237,12 @@ function script refinenew { set .@refinecnt,.@safe - getequiprefinerycnt(.@part); break; case 2: - next; mes "[" + getarg(0) + "]"; mes "How many times would you like me to refine your item?"; next; input .@refinecnt; set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part); - if (.@refinecnt < 1 || .@refinecheck > 10) { + if (.@refinecnt < 1 || .@refinecheck > 20) { mes "[" + getarg(0) + "]"; mes "I can't refine this item that many times."; close; @@ -304,7 +260,6 @@ function script refinenew { } break; case 3: - next; mes "[" + getarg(0) + "]"; mes "You said so... So be it."; close; @@ -338,20 +293,13 @@ function script refinenew { mes "Get out before I stun you with my Hammer!!"; close; } - if(getarg(2) == 1){ - set .@rand,rand(1,3); - if (.@rand == 1) { - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang! Clang!"; - successrefitem .@part; - next; - emotion e_no1; - mes "["+ getarg(0) +"]"; - mes "Good! Succes!!!"; - mes "I am the best Blacksmith."; - close; - } - if (.@rand == 2) { + if (getequippercentrefinery(.@part) > rand(100)) { + mes "Clang! Clang! Clang! Clang!"; + successrefitem .@part; + set .@refinecnt,.@refinecnt - 1; + next; + } else { + if (rand(100) < 80) { mes "["+ getarg(0) +"]"; mes "Clang! Clang! Clang! Clang!"; downrefitem .@part; @@ -369,75 +317,31 @@ function script refinenew { mes "["+ getarg(0) +"]"; mes "I will do a better job next time! Don't worry!"; close; + } else { + mes "["+ getarg(0) +"]"; + mes "Clang! Clang! Clang!"; + failedrefitem .@part; + next; + emotion (!rand(5))?e_cash:e_omg; + mes "["+ getarg(0) +"]"; + mes "Hmmm!"; + next; + mes "["+ getarg(0) +"]"; + mes "Oh my! I've failed to refine stuff..."; + mes "I didn't mean it!"; + mes "There could've been made an mistake even though I am the best ever."; + mes "It was out of my hands."; + next; + mes "["+ getarg(0) +"]"; + mes "I will do a better job next time! Don't worry!"; + close; } - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang!"; - failedrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "["+ getarg(0) +"]"; - mes "Hmmm!"; - next; - mes "["+ getarg(0) +"]"; - mes "Oh my! I've failed to refine stuff..."; - mes "I didn't mean it!"; - mes "There could've been made an mistake even though I am the best ever."; - mes "It was out of my hands."; - next; - mes "["+ getarg(0) +"]"; - mes "I will do a better job next time! Don't worry!"; - close; } - set .@rand,rand(100); - if (getequippercentrefinery(.@part) > .@rand) { - mes "Clang! Clang! Clang! Clang!"; - successrefitem .@part; - next; - emotion e_no1; - mes "["+ getarg(0) +"]"; - mes "Good! Succes!!!"; - mes "I am the best Blacksmith."; - close; - } - if (getequippercentrefinery(.@part) < .@rand) { - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang! Clang!"; - downrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "["+ getarg(0) +"]"; - mes "Ahhh!!!"; - next; - mes "["+ getarg(0) +"]"; - mes "Oh my!"; - mes "The upgrade level has dropped..."; - mes "There could've been made an mistake even though I am the best ever."; - mes "It was out of my hands."; - next; - mes "["+ getarg(0) +"]"; - mes "I will do a better job next time! Don't worry!"; - close; - } - mes "["+ getarg(0) +"]"; - mes "Clang! Clang! Clang!"; - failedrefitem .@part; - next; - emotion (!rand(5))?e_cash:e_omg; - mes "["+ getarg(0) +"]"; - mes "Hmmm!"; - next; - mes "["+ getarg(0) +"]"; - mes "Oh my! I've failed to refine stuff..."; - mes "I didn't mean it!"; - mes "There could've been made an mistake even though I am the best ever."; - mes "It was out of my hands."; - next; - mes "["+ getarg(0) +"]"; - mes "I will do a better job next time! Don't worry!"; - close; } - mes "[" + getarg(0) + "]"; - mes "All finished... Come again soon."; + emotion e_no1; + mes "["+ getarg(0) +"]"; + mes "Good! Succes!!!"; + mes "I am the best Blacksmith."; close; }