* Cleanup redundant usage of getarg() in scripts

* `npc:enchan_mal.txt`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
This commit is contained in:
Cydh Ramdh 2015-12-06 12:03:12 +07:00
parent 8b3b32e000
commit 36d85277b4

View File

@ -327,13 +327,15 @@ L_Socket:
mes "^0000ff"+.@equip_name$+"^000000! Do you want to enchant this equipment? How will you pay for this?"; mes "^0000ff"+.@equip_name$+"^000000! Do you want to enchant this equipment? How will you pay for this?";
next; next;
.@enclimit = getarg(1);
.@enccost = getarg(1);
setarray .@coin[0],6422,6421,6420,6419,6418,6423; // Payment ID setarray .@coin[0],6422,6421,6420,6419,6418,6423; // Payment ID
setarray .@cost[0], 15, 10, 6, 3, 2, 1; // Payment multiplier setarray .@cost[0], 15, 10, 6, 3, 2, 1; // Payment multiplier
set .@menu$, "Stop:"; set .@menu$, "Stop:";
for(set .@i,0; .@i<getarraysize(.@coin); set .@i,.@i+1) { for(set .@i,0; .@i<getarraysize(.@coin); set .@i,.@i+1) {
set .@count[.@i], countitem(.@coin[.@i]); set .@count[.@i], countitem(.@coin[.@i]);
set .@total[.@i], getarg(0)*.@cost[.@i]; set .@total[.@i], .@enccost*.@cost[.@i];
if (.@count[.@i] < .@total[.@i]) if (.@count[.@i] < .@total[.@i])
set .@menu$, .@menu$+"^999999"+getitemname(.@coin[.@i])+" (missing "+(.@total[.@i]-.@count[.@i])+")^000000:"; set .@menu$, .@menu$+"^999999"+getitemname(.@coin[.@i])+" (missing "+(.@total[.@i]-.@count[.@i])+")^000000:";
else else
@ -384,10 +386,10 @@ L_Socket:
} }
break; break;
} }
if (.@equip_card[3] == 0 && getarg(1) < 4) { if (.@equip_card[3] == 0 && .@enclimit < 4) {
set .@socket,4; set .@socket,4;
set .@str$,"1st"; set .@str$,"1st";
} else if (.@equip_card[2] == 0 && getarg(1) < 3) { } else if (.@equip_card[2] == 0 && .@enclimit < 3) {
set .@socket,3; set .@socket,3;
set .@str$,"2nd"; set .@str$,"2nd";
} else { } else {
@ -575,10 +577,10 @@ L_Socket:
callfunc("F_IsEquipCardHack", EQI_HAND_R, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3])) callfunc("F_IsEquipCardHack", EQI_HAND_R, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3]))
close; close;
if (.@equip_card[3] == 0 && getarg(1) < 4) set .@equip_card[3],.@enchant; if (.@equip_card[3] == 0 && .@enclimit < 4) set .@equip_card[3],.@enchant;
else if (.@equip_card[2] == 0 && getarg(1) < 3) set .@equip_card[2],.@enchant; else if (.@equip_card[2] == 0 && .@enclimit < 3) set .@equip_card[2],.@enchant;
else if (.@equip_card[1] == 0 && getarg(1) < 2) set .@equip_card[1],.@enchant; else if (.@equip_card[1] == 0 && .@enclimit < 2) set .@equip_card[1],.@enchant;
else if (.@equip_card[0] == 0 && getarg(1) < 1) set .@equip_card[0],.@enchant; else if (.@equip_card[0] == 0 && .@enclimit < 1) set .@equip_card[0],.@enchant;
else { else {
mes "[Mayomayo]"; mes "[Mayomayo]";
mes "This equipment is at the end of enchant. I provide enchant for two times maximum."; mes "This equipment is at the end of enchant. I provide enchant for two times maximum.";