diff options
author | Haru <haru@dotalux.com> | 2014-10-26 04:26:34 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-11-02 01:36:51 +0100 |
commit | 46fbbaabefa29df1378ae68b7f063dbc64846042 (patch) | |
tree | 8a29abc6017e4dfbc9430e6484871ead9ab41c49 /npc/re/merchants/card_separation.txt | |
parent | d853cc9c0ccdafb8e23ddf6b3f18e7859af0a710 (diff) | |
download | hercules-46fbbaabefa29df1378ae68b7f063dbc64846042.tar.gz hercules-46fbbaabefa29df1378ae68b7f063dbc64846042.tar.bz2 hercules-46fbbaabefa29df1378ae68b7f063dbc64846042.tar.xz hercules-46fbbaabefa29df1378ae68b7f063dbc64846042.zip |
Replaced 'set' with direct assignment where applicable (re folder)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'npc/re/merchants/card_separation.txt')
-rw-r--r-- | npc/re/merchants/card_separation.txt | 138 |
1 files changed, 73 insertions, 65 deletions
diff --git a/npc/re/merchants/card_separation.txt b/npc/re/merchants/card_separation.txt index 9954476ca..fa64db4f0 100644 --- a/npc/re/merchants/card_separation.txt +++ b/npc/re/merchants/card_separation.txt @@ -23,8 +23,8 @@ close; } if (strnpcinfo(1) == "Jeremy") { - set .@Jeremy,1; - set .@n$, "[Jeremy]"; + .@Jeremy = 1; + .@n$ = "[Jeremy]"; setarray .@equip_name$[0], "Armor", "Shoes", "Garment", "Upper Hat"; setarray .@equip_slot[0], EQI_ARMOR,EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP; @@ -32,8 +32,8 @@ mes "Long time no see~"; mes "I have learned a new skill that separates cards from Armor, Shoes, Garment and Headgear. Do you want to try it?"; } else { - set .@Jeremy,0; - set .@n$, "[Richard]"; + .@Jeremy = 0; + .@n$ = "[Richard]"; setarray .@equip_name$[0], "Left hand", "Right hand"; setarray .@equip_slot[0], EQI_HAND_L, EQI_HAND_R; @@ -48,14 +48,14 @@ mes "There is a possibility of destroying them even using a special item. Also, ^ff0000the refine level might be lost^000000. Do you have any equipment to separate?"; next; - for(set .@i,0; .@i<getarraysize(.@equip_slot); set .@i,.@i+1) { + for(.@i = 0; .@i<getarraysize(.@equip_slot); ++.@i) { if (getequipisequiped(.@equip_slot[.@i])) - set .@menu$, .@menu$+getequipname(.@equip_slot[.@i])+":"; + .@menu$ += getequipname(.@equip_slot[.@i])+":"; else - set .@menu$, .@menu$+"^999999"+.@equip_name$[.@i]+" (empty)^000000:"; + .@menu$ += "^999999"+.@equip_name$[.@i]+" (empty)^000000:"; } - set .@i, select("Stop the work:"+((.@Jeremy)?"How is it possible?":"")+":"+.@menu$); + .@i = select("Stop the work:"+((.@Jeremy)?"How is it possible?":"")+":"+.@menu$); switch(.@i) { case 1: mes .@n$; @@ -91,7 +91,7 @@ mes "I'm not sure about the quality of success. Anyway, this is so cheap, right?"; close; default: - set .@equip_num, .@equip_slot[.@i-3]; + .@equip_num = .@equip_slot[.@i-3]; if (!getequipisequiped(.@equip_num)) { mes .@n$; if (.@Jeremy) @@ -103,33 +103,40 @@ break; } - setarray .@equip_card[0], getequipcardid(.@equip_num,0),getequipcardid(.@equip_num,1),getequipcardid(.@equip_num,2),getequipcardid(.@equip_num,3); - set .@mvp_list$, - "|4408|4128|4456|4168|4142"+ //Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card - "|4134|4137|4386|4407|4357"+ //Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card - "|4146|4132|4147|4372|4145"+ //Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card - "|4374|4352|4367|4236|4425"+ //Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card - "|4359|4123|4144|4135|4143"+ //B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card - "|4263|4131|4430|4276|4419"+ //Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card - "|4403|4399|4376|4441|4302"+ //Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card - "|4305|4148|4318|4121|4365"+ //Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card - "|4363|4324|4361|4330|4342|"; //B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card + setarray .@equip_card, getequipcardid(.@equip_num,0),getequipcardid(.@equip_num,1),getequipcardid(.@equip_num,2),getequipcardid(.@equip_num,3); + setarray .@mvp_list, Gloom_Under_Night_Card, Golden_Bug_Card, Nidhogg_Shadow_Card, Dark_Lord_Card, Doppelganger_Card, + Dracula_Card, Drake_Card, Detale_Card, Randgris_Card, B_Seyren_Card, + Maya_Card, Mistress_Card, Baphomet_Card, Bacsojin_Card, Berzebub_Card, + Apocalips_H_Card, B_Ygnizem_Card, B_Shecil_Card, Amon_Ra_Card, Atroce_Card, + B_Eremes_Card, Eddga_Card, Osiris_Card, Orc_Load_Card, Orc_Hero_Card, + Incant_Samurai_Card, Moonlight_Flower_Card, Ifrit_Card, Lord_Of_Death_Card, Ktullanux_Card, + Kiel_Card, Thanatos_Card, Lady_Tanee_Card, Fallen_Bishop_Card, Tao_Gunka_Card, + Turtle_General_Card, Pharaoh_Card, Knight_Windstorm_Card, Phreeoni_Card, B_Katrinn_Card, + B_Magaleta_Card, Garm_Card, B_Harword_Card, Dark_Snake_Lord_Card, Rsx_0806_Card; + .@boss_chk = false; if (.@Jeremy) { - for(set .@i,0; .@i<4; set .@i,.@i+1) { - if (.@equip_card[.@i] >= 4700) // Armor Enchant System - set .@equip_card[.@i],0; + .@cardcount = 4; + for (.@i = 0; .@i < 4; ++.@i) { + if (.@equip_card[.@i] >= 4700 // Armor Enchant System + || .@equip_card[.@i] == 0) { + .@equip_card[.@i] = 0; + --.@cardcount; + } } - if (!getarraysize(.@equip_card)) { + if (!.@cardcount) { mes .@n$; mes "The card is not equipped. Do you want to check again?"; close; } - if ((.@equip_card[0] && compare(.@mvp_list$,"|"+.@equip_card[0]+"|")) || - (.@equip_card[1] && compare(.@mvp_list$,"|"+.@equip_card[1]+"|")) || - (.@equip_card[2] && compare(.@mvp_list$,"|"+.@equip_card[2]+"|")) || - (.@equip_card[3] && compare(.@mvp_list$,"|"+.@equip_card[3]+"|"))) - set .@boss_chk,1; + for (.@i = 0; .@i < 4; ++.@i) { + if (.@equip_card[.@i] == 0) + continue; + for (.@j = 0; .@j < getarraysize(.@mvp_list); ++.@j) { + if (.@equip_card[.@i] == .@mvp_list[.@j]) + .@boss_chk = true; + } + } } else { // Official "Richard" script uses a hardcoded list including every possible item. //if (!getequipisequiped(.@equip_num)) { @@ -141,21 +148,21 @@ mes "[Richard]"; mes "Which number socket do you want to separate the card? From the left socket, they are sorted 1,2,3,4."; next; - set .@menu$,""; - for(set .@i,0; .@i<4; set .@i,.@i+1) { + .@menu$ = ""; + for(.@i = 0; .@i<4; ++.@i) { if (.@equip_card[.@i] && .@equip_card[.@i] < 4700) // Armor Enchant System - set .@menu$, .@menu$+"Socket "+(.@i+1)+" - "+getitemname(.@equip_card[.@i])+":"; + .@menu$ += "Socket "+(.@i+1)+" - "+getitemname(.@equip_card[.@i])+":"; else - set .@menu$, .@menu$+"^777777Socket "+(.@i+1)+" - No card^000000:"; + .@menu$ += "^777777Socket "+(.@i+1)+" - No card^000000:"; } - set .@i, select("Stop the work:"+.@menu$); + .@i = select("Stop the work:"+.@menu$); switch(.@i) { case 1: mes .@n$; mes "Whenever you need to work, please come to me."; close; default: - set .@slot, .@i-2; + .@slot = .@i-2; if (.@equip_card[.@slot] == 0 || .@equip_card[.@slot] >= 4700) { mes .@n$; mes "This socket is not equipped with any card. Why don't you check again?"; @@ -163,18 +170,19 @@ } break; } - if (compare(.@mvp_list$,"|"+.@equip_card[.@slot]+"|")) - set .@boss_chk,1; + for (.@i = 0; .@i < getarraysize(.@mvp_list); ++.@i) { + if (.@equip_card[.@slot] == .@mvp_list[.@i]) + .@boss_chk = true; + } } - if (.@boss_chk == 0) { + if (!.@boss_chk) { mes .@n$; if (.@Jeremy) mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:"; else mes "Please choose the working fee."; next; - set .@menu$, - "Next time...:"+ + .@menu$ = "Next time...:"+ ((Zeny >= 1000000)?"Use 1,000,000z (Do not use special item):":"^999999Use 1,000,000z (Insufficient)^000000:")+ ((countitem(6441))?"Use Premium Lubricant:":"^999999Premium Lubricant (Insufficient)^000000:")+ ((countitem(6440))?"Use Ordinary Lubricant":"^999999Ordinary Lubricant (Insufficient)^000000"); @@ -197,9 +205,9 @@ mes "Whenever you need the work, visit me here."; close; } - set .@sf_c_num,150; - set .@sf_r_num,150; - set .@sf_w_num,150; + .@sf_c_num = 150; + .@sf_r_num = 150; + .@sf_w_num = 150; Zeny -= 1000000; break; case 3: @@ -216,9 +224,9 @@ mes "Whenever you need the work, visit me here."; close; } - set .@sf_c_num,75; - set .@sf_r_num,75; - set .@sf_w_num,75; + .@sf_c_num = 75; + .@sf_r_num = 75; + .@sf_w_num = 75; delitem 6441,1; //High_RankLubricant break; case 4: @@ -235,13 +243,13 @@ mes "Whenever you need the work, visit me here."; close; } - set .@sf_c_num,75; - set .@sf_r_num,150; - set .@sf_w_num,150; + .@sf_c_num = 75; + .@sf_r_num = 150; + .@sf_w_num = 150; delitem 6440,1; //General_Lubricant break; } - } else if (.@boss_chk == 1) { + } else { mes .@n$; mes "This equipment contains a precious MVP card. This card can't be separated with lubricant. If you bring the super surfactant ^0000ffSillit Pong^000000, I will be able to work."; next; @@ -261,10 +269,10 @@ mes .@n$; if (.@Jeremy) { mes "Except cards, ^ff0000all enchanted effects will disappear.^000000 If you agree to this, please choose the work type:"; - set .@menu$,"Alright, let's do it!"; + .@menu$ = "Alright, let's do it!"; } else { mes "May I continue?"; - set .@menu$,"I got it. Just do it quickly!"; + .@menu$ = "I got it. Just do it quickly!"; } next; switch(select("Next time...:"+.@menu$)) { @@ -273,45 +281,45 @@ mes "Whenever you need the work, visit me here."; close; case 2: - set .@sf_c_num,60; - set .@sf_r_num,60; - set .@sf_w_num,60; + .@sf_c_num = 60; + .@sf_r_num = 60; + .@sf_w_num = 60; delitem 6443,1; //Sillit_Pong_Bottle break; } } - set .@equip_id, getequipid(.@equip_num); - set .@equip_refine, getequiprefinerycnt(.@equip_num); + .@equip_id = getequipid(.@equip_num); + .@equip_refine = getequiprefinerycnt(.@equip_num); delequip .@equip_num; // Chance of retaining refine level. if (rand(1,.@sf_r_num) >= 61) - set .@equip_refine,0; + .@equip_refine = 0; if (.@Jeremy) { // Chance of retaining equipment. if (rand(1,.@sf_w_num) < 61) { - set .@equip_safe,1; + .@equip_safe = 1; getitem2 .@equip_id,1,1,.@equip_refine,0,0,0,0,0; } // Chance of retaining cards. - for(set .@i,0; .@i<4; set .@i,.@i+1) { + for(.@i = 0; .@i<4; ++.@i) { if (.@equip_card[.@i]) { if (rand(1,.@sf_c_num) < 61) getitem .@equip_card[.@i],1; else - set .@card_break,1; + .@card_break = 1; } } } else { - set .@card, .@equip_card[.@slot]; - set .@equip_card[.@slot],0; + .@card = .@equip_card[.@slot]; + .@equip_card[.@slot] = 0; // Chance of retaining equipment. if (rand(1,.@sf_w_num) < 61) { - set .@equip_safe,1; + .@equip_safe = 1; getitem2 .@equip_id,1,1,.@equip_refine,0,.@equip_card[0],.@equip_card[1],.@equip_card[2],.@equip_card[3]; } @@ -319,7 +327,7 @@ if (rand(1,.@sf_c_num) < 61) getitem .@card,1; else - set .@card_break,1; + .@card_break = 1; } // Display corresponding effect. |