summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/other/Global_Functions.txt27
-rw-r--r--npc/re/merchants/shadow_refiner.txt146
-rw-r--r--npc/re/quests/quests_eclage.txt2
-rw-r--r--npc/re/scripts.conf1
4 files changed, 175 insertions, 1 deletions
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index 4e9060419..b88fa647a 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -39,10 +39,37 @@
//= 2.16 Added F_GetWeaponType, and F_GetArmorType. [L0ne_W0lf]
//= 2.17 Renamed 'F_RandMes' to 'F_Rand'. [Euphy]
//= 2.18 Removed useless 'getJobName' function. [Euphy]
+//= 2.19 Improved 'F_InsertComma' function. [Emistry]
//============================================================
//////////////////////////////////////////////////////////////////////////////////
+// Returns a number with commas based on precision of digits and custom separator.
+// -- callfunc "F_InsertComma",<number>{,<precision>,<separator>}
+// Examples:
+// callfunc("F_InsertComma",7777777{,<precision>,<separator>}) // returns "7,777,777"
+// callfunc("F_InsertComma",1000000000,3,","}) // returns "1,000,000,000"
+// callfunc("F_InsertComma",1000000000,3,"_"}) // returns "1_000_000_000"
+// callfunc("F_InsertComma",1000000000,4) // returns "10,0000,0000"
+//////////////////////////////////////////////////////////////////////////////////
+function script F_InsertComma {
+ .@value = getarg(0);
+ .@precision = getarg(1,3);
+ .@separator$ = getarg( 2,"," );
+
+ .@str$ = ""+.@value;
+ .@is_negative = ( .@value < 0 );
+
+ .@length = getstrlen( .@str$ ) - .@precision - .@is_negative;
+ while ( .@length > 0 ) {
+ .@str$ = insertchar( .@str$, .@separator$ , ( .@length + .@is_negative ) );
+ .@length -= .@precision;
+ }
+ return .@str$;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////
// Function that clears job quest variables
//////////////////////////////////////////////////////////////////////////////////
diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt
new file mode 100644
index 000000000..5bb888d87
--- /dev/null
+++ b/npc/re/merchants/shadow_refiner.txt
@@ -0,0 +1,146 @@
+//===== Hercules Script ======================================
+//= Shadow Refiner
+//===== By: ==================================================
+//= Dastgir
+//===== Current Version: =====================================
+//= 1.0
+//===== Description: =========================================
+//= [Aegis Conversion]
+//===== Additional Comments: =================================
+//= 1.0 First Version [Dastgir]
+//============================================================
+
+itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{
+ disable_items;
+ mes "[Shadow Blacksmith]";
+ 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")+":";
+ }
+ .@menu$ = .@menu$+"Refine Info";
+ .@SelectedPart = select(.@menu$);
+ if (.@SelectedPart == 7){
+ mes "[Shadow Blacksmith]";
+ mes "Shadow item will gain extra bonus effect by the refine level, same as normal weapon/armour 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.";
+ next;
+ mes "[Shadow Blacksmith]";
+ mes "You need Oridecon and Elunium for Shadow item refine ingredient, along with refine fee 20000 zeny.";
+ next;
+ mes "[Shadow Blacksmith]";
+ mes "When +5 or higher refining Shadow item can be destroyed, please use Enriched or HD ingredient for the refinement.";
+ close;
+ }
+ .@SelectedPart += EQI_SHADOW_ARMOR-1;
+ while(1){
+ mes "[Shadow Blacksmith]";
+ mes "20000 zeny will be spent as a refine fee.";
+ 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]);
+ else{
+ .@mate$[0] = "^8C8C8C"+ getitemname(.@s_weapon1[.@index]) +"^000000";
+ .@miss[0] = 1;
+ }
+ if (countitem(.@s_weapon2[.@index]))
+ .@mate$[1] = getitemname(.@s_weapon2[.@index]);
+ else{
+ .@mate$[1] = "^8C8C8C"+ getitemname(.@s_weapon2[.@index]) +"^000000";
+ .@miss[1] = 1;
+ }
+ if (getequiprefinerycnt(.@SelectedPart) > 6 && countitem(.@s_weapon3[.@index]))
+ .@mate$[2] = getitemname(.@s_weapon3[.@index]);
+ else {
+ .@mate$[2] = "^8C8C8C"+ getitemname(.@s_weapon3[.@index]) +"^000000";
+ .@miss[2] = 1;
+ }
+ //-----------------------------------------------------------------------------
+ .@option = select("Cancel",.@mate$[0],.@mate$[1],.@mate$[2]);
+ if (.@option == 1){
+ mes "[Shadow Blacksmith]";
+ mes "You've cancelled refining.";
+ close;
+ }
+ .@option -= 2;
+ 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.";
+ close;
+ }
+ .@hoihoi = 1;
+ }
+ if (.@miss[.@option]){
+ mes "[Shadow Blacksmith]";
+ mes "You do not have proper ingredient for this refining.";
+ close;
+ }
+ .@choose = getd(".@s_weapon"+(.@option+1)+"["+ .@index +"]");
+ if (Zeny < 20000) {
+ mes "[Shadow Blacksmith]";
+ mes "You do not have enough refine fee.";
+ close;
+ }
+ if (getequiprefinerycnt(.@SelectedPart) > 9) {
+ mes "[Shadow Blacksmith]";
+ mes "Shadow item refining is only possible until +10 level.";
+ close;
+ }
+ if (!getequipisenableref(.@SelectedPart)) {
+ mes "[Shadow Blacksmith]";
+ 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?";
+ }
+ else {
+ mes "If you try more refining, item refine level might go down when failed. Still want to refine?";
+ }
+ next;
+ if (select("Proceed","Cancel") == 2) {
+ mes "[Shadow Blacksmith]";
+ mes "You've cancelled refining.";
+ close;
+ }
+ }
+ //-----------------------------------------------------------------------------
+ mes "[Shadow Blacksmith]";
+ mes "Here we go--!!!";
+ next;
+ delitem .@choose,1;
+ Zeny -= 20000;
+ if (getequippercentrefinery(.@SelectedPart) > rand(100) || getequippercentrefinery(.@SelectedPart) > rand(100)) {
+ successrefitem .@SelectedPart;
+ mes "[Shadow Blacksmith]";
+ mes "Refine was successful.";
+ next;
+ }
+ else {
+ if (.@hoihoi)
+ downrefitem .@SelectedPart;
+ else
+ failedrefitem .@SelectedPart;
+ mes "[Shadow Blacksmith]";
+ mes "Oh no.. Refine was failed.";
+ close;
+ }
+ }
+} \ No newline at end of file
diff --git a/npc/re/quests/quests_eclage.txt b/npc/re/quests/quests_eclage.txt
index 164f66fad..4f85b42c8 100644
--- a/npc/re/quests/quests_eclage.txt
+++ b/npc/re/quests/quests_eclage.txt
@@ -18543,7 +18543,7 @@ ecl_tdun04,32,35,3 script Hisie#tlord 4_M_FARIY_HISIE,{
mes "[Hisie]";
mes "If you climbed all the way here out of curiosity, you'd better start going down now.";
mes "Professor has been under the weather nowadays.";
- close;
+ close2;
}
else if (ep14_2_mylord == 14) {
cutin "hisie01",0;
diff --git a/npc/re/scripts.conf b/npc/re/scripts.conf
index c6bebdb00..c4f7c23f4 100644
--- a/npc/re/scripts.conf
+++ b/npc/re/scripts.conf
@@ -92,6 +92,7 @@ npc: npc/re/merchants/shops.txt
//npc: npc/re/merchants/ticket_refiner.txt
//npc: npc/re/merchants/enchan_upg.txt
npc: npc/re/merchants/ninja_craftsman.txt
+npc: npc/re/merchants/shadow_refiner.txt
// --------------------------- Others ---------------------------
npc: npc/re/other/bulletin_boards.txt