diff options
author | Haru <haru@dotalux.com> | 2017-06-03 18:43:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-03 18:43:44 +0200 |
commit | 3061bb8257578bc88b9873f1ecebb05f8508bd0f (patch) | |
tree | 2d2257b9c574f29896ae0baa71a224c3b4f53ecf /npc/re/merchants | |
parent | f795a6df2766348d2a7f43f48e392b3cf3008781 (diff) | |
parent | 6f2827cbf9282981a29abaa06236fb0cd6300057 (diff) | |
download | hercules-3061bb8257578bc88b9873f1ecebb05f8508bd0f.tar.gz hercules-3061bb8257578bc88b9873f1ecebb05f8508bd0f.tar.bz2 hercules-3061bb8257578bc88b9873f1ecebb05f8508bd0f.tar.xz hercules-3061bb8257578bc88b9873f1ecebb05f8508bd0f.zip |
Merge pull request #1684 from Smokexyz/refine-update
Enriched refine chance correction
Diffstat (limited to 'npc/re/merchants')
-rw-r--r-- | npc/re/merchants/advanced_refiner.txt | 4 | ||||
-rw-r--r-- | npc/re/merchants/shadow_refiner.txt | 167 |
2 files changed, 91 insertions, 80 deletions
diff --git a/npc/re/merchants/advanced_refiner.txt b/npc/re/merchants/advanced_refiner.txt index 1484d069c..5b3f69593 100644 --- a/npc/re/merchants/advanced_refiner.txt +++ b/npc/re/merchants/advanced_refiner.txt @@ -140,7 +140,7 @@ malangdo,221,174,6 script Holink#mal_cash 4_CAT_ADV1,{ mes "You don't belive in refine master Holink, meow?~"; close; } - if (getequippercentrefinery(.@part) < 100) { + if (getequippercentrefinery(.@part, REFINE_CHANCE_TYPE_ENRICHED) < 100) { mes "[Holink]"; mes "Meow!!"; if (.@type$ == "armor") @@ -177,7 +177,7 @@ malangdo,221,174,6 script Holink#mal_cash 4_CAT_ADV1,{ } delitem .@material,1; Zeny -= .@price; - if (getequippercentrefinery(.@part) > rand(100) || getequippercentrefinery(.@part) > rand(100)) { + if (getequippercentrefinery(.@part, REFINE_CHANCE_TYPE_ENRICHED) > rand(100)) { successrefitem .@part; mes "[Holink]"; mes "Me~ Me~ Meow! Fun fun refining~"; diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index 2f8984498..f03d348b2 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -9,8 +9,9 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2015 Hercules Dev Team -//= Copyright (C) Dastgir +//= Copyright (C) 2017 Hercules Dev Team +//= Copyright (C) Dastgir +//= Copyright (C) Smokexyz (v2.0) //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -29,148 +30,158 @@ //================= Description =========================================== //= Shadow item refiner //================= Current Version ======================================= -//= 1.0 +//= 2.0 //========================================================================= itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{ + + // Configuration + .@npc_name$ = "[Shadow Blacksmith]"; + .@zeny_cost = 20000; // Amount of zeny to be charged for refining. + disable_items; - mes "[Shadow Blacksmith]"; - mes "Do you want to refine a Shadow item?."; - mes "Please choose the part you want to refine."; + mesf("%s", .@npc_name$); + mes("Do you want to refine a Shadow item?"); + mes("Please choose the part you want to refine."); next; - setarray .@position$[0],"Armor","Weapon","Shield","Shoes","Earring","Pendant"; - for (.@i=EQI_SHADOW_ARMOR; .@i<=EQI_SHADOW_ACC_L; .@i++){ - .@menu$ = .@menu$+((getequipisequiped(.@i))?getequipname(.@i):"^8C8C8C"+.@position$[.@i-EQI_SHADOW_ARMOR]+" [Not Equipped]^000000")+":"; + setarray(.@position$[0],"Armor","Weapon","Shield","Shoes","Earring","Pendant"); + for (.@i=EQI_SHADOW_ARMOR; .@i <= EQI_SHADOW_ACC_L; .@i++){ + .@menu$ = .@menu$ + (getequipisequiped(.@i) ? getequipname(.@i) : ("^8C8C8C" + .@position$[.@i-EQI_SHADOW_ARMOR] + " [Not Equipped]^000000" + ":")); } - .@menu$ = .@menu$+"Refine Info"; - .@SelectedPart = select(.@menu$)+EQI_SHADOW_ARMOR-1; - if (.@SelectedPart == EQI_SHADOW_ACC_L+1){ // Refine Info - mes "[Shadow Blacksmith]"; - mes "Shadow item will gain extra bonus effect by the refine level, same as normal weapon/armour items."; + .@menu$ = .@menu$ + "Refine Info"; + .@SelectedPart = select(.@menu$) + EQI_SHADOW_ARMOR - 1; + if (.@SelectedPart == EQI_SHADOW_ACC_L + 1){ // Refine Info + mesf("%s", .@npc_name$); + mes("Shadow items gain extra bonus effects depending on their refine level, similar to normal weapon and armor items."); next; - mes "[Shadow Blacksmith]"; - mes "Following are refining effect for each Shadow item parts."; - mes "Weapon: ATK, MATK + 1 increase for each +1 refine success."; - mes "Etc: HP + 10 increase for each +1 refine success."; + mesf("%s", .@npc_name$); + mes("Refining effects for each Shadow item parts are -"); + mes("Weapon: ATK, MATK + 1 increase for each +1 refine success."); + mes("Etc: HP + 10 increase for each +1 refine success."); next; - mes "[Shadow Blacksmith]"; - mes "You need Oridecon and Elunium for Shadow item refine ingredient, along with refine fee 20000 zeny."; + mesf("%s", .@npc_name$); + mesf("You need %s and %s as the ingredient, along with a refine fee %d Zeny.", getitemname(Oridecon), getitemname(Elunium), .@zeny_cost); next; - mes "[Shadow Blacksmith]"; - mes "When +5 or higher refining Shadow item can be destroyed, please use Enriched or HD ingredient for the refinement."; + mesf("%s", .@npc_name$); + mes("When refining to +5 or higher, you risk breaking your Shadow item."); + mes("You may also use Enriched or HD ingredients for the refinement."); close; } - while(1){ - mes "[Shadow Blacksmith]"; - mes "20000 zeny will be spent as a refine fee."; - mes "Choose the ingredient and start refining."; + while(true) { + mesf("%s", .@npc_name$); + mesf("%d Zeny will be spent as a refine fee.", .@zeny_cost); + mes("Choose the ingredient and start refining."); next; .@index = 0; if (.@SelectedPart != EQI_SHADOW_WEAPON) .@index = 1; - setarray .@s_weapon1[0],Oridecon,Elunium; - setarray .@s_weapon2[0],Enriched_Oridecon,Enriched_Elunium; - setarray .@s_weapon3[0],HD_Oridecon,HD_Elunium; - if (countitem(.@s_weapon1[.@index])) - .@mate$[0] = getitemname(.@s_weapon1[.@index]); + setarray .@s_material1[0], Oridecon, Elunium; + setarray .@s_material2[0], Enriched_Oridecon, Enriched_Elunium; + setarray .@s_material3[0], HD_Oridecon, HD_Elunium; + .@refine_type = REFINE_CHANCE_TYPE_NORMAL; + if (countitem(.@s_material1[.@index])) + .@mate$[0] = getitemname(.@s_material1[.@index]); else{ - .@mate$[0] = "^8C8C8C"+ getitemname(.@s_weapon1[.@index]) +"^000000"; + .@mate$[0] = "^8C8C8C"+ getitemname(.@s_material1[.@index]) +"^000000"; .@miss[0] = 1; } - if (countitem(.@s_weapon2[.@index])) - .@mate$[1] = getitemname(.@s_weapon2[.@index]); + if (countitem(.@s_material2[.@index])) + .@mate$[1] = getitemname(.@s_material2[.@index]); else{ - .@mate$[1] = "^8C8C8C"+ getitemname(.@s_weapon2[.@index]) +"^000000"; + .@mate$[1] = "^8C8C8C"+ getitemname(.@s_material2[.@index]) +"^000000"; .@miss[1] = 1; } - if (getequiprefinerycnt(.@SelectedPart) > 6 && countitem(.@s_weapon3[.@index])) - .@mate$[2] = getitemname(.@s_weapon3[.@index]); + if (getequiprefinerycnt(.@SelectedPart) > 6 && countitem(.@s_material3[.@index])) + .@mate$[2] = getitemname(.@s_material3[.@index]); else { - .@mate$[2] = "^8C8C8C"+ getitemname(.@s_weapon3[.@index]) +"^000000"; + .@mate$[2] = "^8C8C8C"+ getitemname(.@s_material3[.@index]) +"^000000"; .@miss[2] = 1; } //----------------------------------------------------------------------------- - .@option = select("Cancel",.@mate$[0],.@mate$[1],.@mate$[2]); + .@option = select("Cancel", .@mate$[0], .@mate$[1], .@mate$[2]); if (.@option == 1){ - mes "[Shadow Blacksmith]"; - mes "You've cancelled refining."; + mesf("%s", .@npc_name$); + mes("You've cancelled refining."); close; } .@option -= 2; - if (.@option==2){ //HD + .@hoihoi = false; + if (.@option == 2){ //HD if (getequiprefinerycnt(.@SelectedPart) < 7){ - mes "[Shadow Blacksmith]"; - mes "HD ingredient is only possible to use for +7 or higher refine level items."; + mesf("%s", .@npc_name$); + mes("HD ingredients are only possible to be used when refining an item of quality +7 or higher."); close; } - .@hoihoi = 1; + .@hoihoi = true; + } else if (.@option == 1) { + .@refine_type = REFINE_CHANCE_TYPE_ENRICHED; } if (.@miss[.@option]){ - mes "[Shadow Blacksmith]"; - mes "You do not have proper ingredient for this refining."; + mesf("%s", .@npc_name$); + mes("You do not have the proper ingredient to proceed with refining."); close; } .@choose = getd(".@s_weapon"+(.@option+1)+"["+ .@index +"]"); if (Zeny < 20000) { - mes "[Shadow Blacksmith]"; - mes "You do not have enough refine fee."; + mesf("%s", .@npc_name$); + mes("You do not have enough Zeny to pay the refine fee."); close; } if (getequiprefinerycnt(.@SelectedPart) > 9) { - mes "[Shadow Blacksmith]"; - mes "Shadow item refining is only possible until +10 level."; + mesf("%s", .@npc_name$); + mes("Shadow item refining is only possible up to +10 level."); close; } if (!getequipisenableref(.@SelectedPart)) { - mes "[Shadow Blacksmith]"; - mes "This item cannot be refined."; + mesf("%s", .@npc_name$); + mes("This item cannot be refined."); close; } - if (getequippercentrefinery(.@SelectedPart) < 100) { - mes "[Shadow Blacksmith]"; - mes "Safety guaranteed refine limit for shadow item is until +4."; - if (!.@hoihoi) { - mes "If you try more refining, item might get broken when failed. Still want to refine?"; + if (getequippercentrefinery(.@SelectedPart, .@refine_type) < 100) { + mesf("%s", .@npc_name$); + mes("Safety guaranteed refine limit for shadow item is until +4."); + if (.@hoihoi == false) { + mes("If you try more refining, the item might break upon failing. Do you still want to refine?"); } else { - mes "If you try more refining, item refine level might go down when failed. Still want to refine?"; + mes("If you try more refining, the item refine level might go down when failed. Do you still want to refine?"); } next; if (select("Proceed","Cancel") == 2) { - mes "[Shadow Blacksmith]"; - mes "You've cancelled refining."; + mesf("%s", .@npc_name$); + mes("You've cancelled refining."); close; } } //----------------------------------------------------------------------------- - mes "[Shadow Blacksmith]"; - mes "Here we go--!!!"; + mesf("%s", .@npc_name$); + mes("Here we go--!!!"); next; if (Zeny < 20000) { - mes "[Shadow Blacksmith]"; - mes "You do not have enough refine fee."; + mesf("%s", .@npc_name$); + mes("You do not have enough Zeny to pay the refine fee."); close; } - if (!countitem(.@choose)) { - mes "[Shadow Blacksmith]"; - mes "You do not have enough "+ getitemname(.@choose) +"."; + if (countitem(.@choose) == 0) { + mesf("%s", .@npc_name$); + mes("You do not have enough "+ getitemname(.@choose) +"."); close; } - delitem .@choose,1; + delitem(.@choose, 1); Zeny -= 20000; - if (getequippercentrefinery(.@SelectedPart) > rand(100) || ( .@option == 1 && getequippercentrefinery(.@SelectedPart) > rand(100))) { - successrefitem .@SelectedPart; - mes "[Shadow Blacksmith]"; - mes "Refine was successful."; + if (getequippercentrefinery(.@SelectedPart, .@refine_type) > rand(100)) { + successrefitem(.@SelectedPart); + mesf("%s", .@npc_name$); + mes("Refine was successful."); next; } else { - if (.@hoihoi) - downrefitem .@SelectedPart; + if (.@hoihoi == true) + downrefitem(.@SelectedPart); else - failedrefitem .@SelectedPart; - mes "[Shadow Blacksmith]"; - mes "Oh no.. Refine was failed."; + failedrefitem(.@SelectedPart); + mesf("%s", .@npc_name$); + mes("Oh no.. Refine has failed."); close; } } |