Bläddra i källkod

* Cleanup redundant usage of `getarg()` in scripts
* `npc:enchan_mal.txt`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

Cydh Ramdh 9 år sedan
förälder
incheckning
36d85277b4
1 ändrade filer med 9 tillägg och 7 borttagningar
  1. 9 7
      npc/re/merchants/enchan_mal.txt

+ 9 - 7
npc/re/merchants/enchan_mal.txt

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