Atemo 9 rokov pred
rodič
commit
3a45dd97f9
55 zmenil súbory, kde vykonal 726 pridanie a 610 odobranie
  1. 20 20
      npc/airports/airships.txt
  2. 8 6
      npc/battleground/bg_common.txt
  3. 31 27
      npc/battleground/kvm/kvm_item_pay.txt
  4. 7 4
      npc/cities/aldebaran.txt
  5. 13 11
      npc/cities/einbroch.txt
  6. 26 23
      npc/events/nguild/nguild_managers.txt
  7. 11 9
      npc/events/nguild/nguild_treas.txt
  8. 9 8
      npc/guild2/agit_main_se.txt
  9. 17 13
      npc/jobs/2-2/rogue.txt
  10. 5 4
      npc/kafras/cool_event_corp.txt
  11. 35 26
      npc/kafras/functions_kafras.txt
  12. 9 7
      npc/merchants/advanced_refiner.txt
  13. 8 5
      npc/merchants/alchemist.txt
  14. 12 9
      npc/merchants/gemstone.txt
  15. 7 6
      npc/merchants/hair_style.txt
  16. 5 3
      npc/merchants/inn.txt
  17. 12 8
      npc/merchants/kunai_maker.txt
  18. 13 10
      npc/merchants/novice_exchange.txt
  19. 13 10
      npc/merchants/old_pharmacist.txt
  20. 17 13
      npc/merchants/quivers.txt
  21. 56 52
      npc/merchants/refine.txt
  22. 19 15
      npc/merchants/socket_enchant.txt
  23. 25 21
      npc/merchants/socket_enchant2.txt
  24. 7 5
      npc/other/arena/arena_point.txt
  25. 9 5
      npc/other/arena/arena_room.txt
  26. 3 2
      npc/other/auction.txt
  27. 7 6
      npc/other/hugel_bingo.txt
  28. 3 2
      npc/other/pvp.txt
  29. 4 2
      npc/other/turbo_track.txt
  30. 5 4
      npc/quests/bard_quest.txt
  31. 10 9
      npc/quests/cooking_quest.txt
  32. 4 3
      npc/quests/doomed_swords_quest.txt
  33. 6 5
      npc/quests/newgears/2006_headgears.txt
  34. 11 9
      npc/quests/quests_13_2.txt
  35. 35 34
      npc/quests/quests_juperos.txt
  36. 12 9
      npc/quests/quests_moscovia.txt
  37. 8 7
      npc/quests/quests_rachel.txt
  38. 19 18
      npc/quests/the_sign_quest.txt
  39. 16 15
      npc/re/guild/invest_main.txt
  40. 9 8
      npc/re/jobs/novice/academy.txt
  41. 6 5
      npc/re/merchants/bio4_reward.txt
  42. 15 14
      npc/re/merchants/coin_exchange.txt
  43. 12 10
      npc/re/merchants/enchan_mora.txt
  44. 11 9
      npc/re/merchants/quivers.txt
  45. 44 43
      npc/re/merchants/refine.txt
  46. 11 8
      npc/re/quests/eden/11-25.txt
  47. 9 7
      npc/re/quests/eden/26-40.txt
  48. 15 13
      npc/re/quests/eden/56-70.txt
  49. 3 2
      npc/re/quests/eden/86-90.txt
  50. 3 2
      npc/re/quests/eden/91-99.txt
  51. 5 4
      npc/re/quests/eden/eden_111_120.txt
  52. 19 18
      npc/re/quests/homun_s.txt
  53. 6 4
      npc/re/quests/magic_books.txt
  54. 4 3
      npc/re/quests/quests_dicastes.txt
  55. 17 15
      npc/re/quests/quests_malangdo.txt

+ 20 - 20
npc/airports/airships.txt

@@ -1248,10 +1248,10 @@ airplane_01,33,68,4	script	Clarice	74,{
 }
 
 function	script	applegamble	{
-
+	.@npc_name$ = getarg(0);
 	switch (select("Play Dice Game:Learn Dice Game Rules:Cancel")) {
 	case 3:
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I'm up for a game of";
 		mes "dice whenever you feel";
 		mes "like it. Just talk to me if";
@@ -1259,7 +1259,7 @@ function	script	applegamble	{
 		mes "sudden urge to gamble, kay?";
 		close;
 	case 2:
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "The rules for the Dice game";
 		mes "are pretty simple. First, you";
 		mes "place a bet by wagering Apples.";
@@ -1267,14 +1267,14 @@ function	script	applegamble	{
 		mes "Apples at a time. To keep things";
 		mes "legal, I can only accept Apples.";
 		next;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "But hey, if all that zeny";
 		mes "is burning a hole in your";
 		mes "pocket, head over to Fruitz";
 		mes "and you can buy as many";
 		mes "Apples as you want, playah~";
 		next;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Now, we begin with me";
 		mes "rolling two 6-sided dice.";
 		mes "When it's your turn, you'll";
@@ -1282,7 +1282,7 @@ function	script	applegamble	{
 		mes "that, both of us will have the";
 		mes "option of rolling a third die.";
 		next;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Now here's the important";
 		mes "thing. If your total is higher";
 		mes "than 12, you'll bust, meaning";
@@ -1290,14 +1290,14 @@ function	script	applegamble	{
 		mes "person with the higher total";
 		mes "is the winner. Got it?";
 		next;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Now, you'll be the first";
 		mes "to decide whether or not";
 		mes "you'll roll the third die. Then,";
 		mes "depending on your result, I'll";
 		mes "roll my third die... Or maybe not.";
 		next;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "When you win, you'll";
 		mes "receive twice as many";
 		mes "Apples as you wagered.";
@@ -1308,7 +1308,7 @@ function	script	applegamble	{
 	case 1:
 		break;
 	}
-	mes "["+getarg(0)+"]";
+	mes "["+ .@npc_name$ +"]";
 	mes "Ooh, so you'll play with";
 	mes "me? Great! How many";
 	mes "Apples would you like to bet?";
@@ -1319,14 +1319,14 @@ function	script	applegamble	{
 	while(1) {
 		input .@amount;
 		if (.@amount == 0) {
-			mes "["+getarg(0)+"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Changed your mind?";
 			mes "I understand. Well then,";
 			mes "I hope we can play sometime.";
 			close;
 		}
 		else if (.@amount < 1 || .@amount > 50) {
-			mes "["+getarg(0)+"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "You can't bet more than";
 			mes "50 Apples. Remember, we";
 			mes "need to keep these stakes";
@@ -1335,13 +1335,13 @@ function	script	applegamble	{
 			next;
 			continue;
 		}
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "So you'll be";
 		mes "betting ^FF0000"+.@amount+"^000000 Apples.";
 		mes "Is that right?";
 		next;
 		if (select("Yes:No") == 2) {
-			mes "["+getarg(0)+"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Mm, made a mistake?";
 			mes "Alright, please enter the";
 			mes "number of Apples you";
@@ -1359,7 +1359,7 @@ function	script	applegamble	{
 			continue;
 		}
 		delitem 512,.@amount;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Good!";
 		mes "Now we can start";
 		mes "this game! I'll roll first~";
@@ -1372,7 +1372,7 @@ function	script	applegamble	{
 	set .@table2, rand(1,6);
 	set .@tablesub, .@table1 + .@table2;
 	set .@tabletotal, .@tablesub;
-	mes "["+getarg(0)+"]";
+	mes "["+ .@npc_name$ +"]";
 	mes "I got a ^0000FF" + .@table1 + "^000000 and a ^0000FF" + .@table2 + "^000000.";
 	mes "That's a total of ^0000FF" + .@tablesub + "^000000.";
 	mes "^FF0000" + strcharinfo(0) + "^000000, now it's your turn.";
@@ -1389,10 +1389,10 @@ function	script	applegamble	{
 	}
 	set .@playertotal, .@playersub;
 	next;
-	mes "["+getarg(0)+"]";
+	mes "["+ .@npc_name$ +"]";
 	mes "^FF0000" + strcharinfo(0) + "^000000, you have ^FF0000" + .@player1 + "^000000 and ^FF0000" + .@player2 + "^000000. The total is ^FF0000" + .@playersub + "^000000 .";
 	next;
-	mes "["+getarg(0)+"]";
+	mes "["+ .@npc_name$ +"]";
 	if(.@playersub == .@tablesub) {
 		mes "Currently my total is ^0000FF" + .@tablesub + "^000000 and ^FF0000" + strcharinfo(0) + "^000000, your total is ^FF0000" + .@playersub + "^000000. We are making an even game. Would you like to cast dice again?";
 	} else if (.@playersub > .@tablesub) {
@@ -1407,7 +1407,7 @@ function	script	applegamble	{
 		set .@player3, rand(1,6);
 		set .@playertotal, .@playertotal + .@player3;
 		next;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		if (.@playertotal > 12) {
 			mes "^FF0000" + strcharinfo(0) + "^000000, you got ^FF0000" + .@player3 + "^000000 and the total is now ^FF0000" + .@playertotal + "^000000. You lost this game. I am sorry but please try again.";
 			close;
@@ -1429,7 +1429,7 @@ function	script	applegamble	{
 		}
 		break;
 	case 2:
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		if (.@playersub > .@tablesub) {
 			mes "I see, you don't want to take risk of losing the game. Okay, let me cast dice again.";
 		}
@@ -1457,7 +1457,7 @@ function	script	applegamble	{
 	set .@table3, rand(1,6);
 	set .@tabletotal, .@tabletotal + .@table3;
 	next;
-	mes "["+getarg(0)+"]";
+	mes "["+ .@npc_name$ +"]";
 	if (.@tabletotal > 12) {
 		mes "I got ^0000FF" + .@table3 + "^000000 and the total is now ^0000FF" + .@tabletotal + "^000000. I lost this game since my total exceeded 12. Let me give you my apples. Congratulations, that was a great game.";
 		close2;

+ 8 - 6
npc/battleground/bg_common.txt

@@ -567,12 +567,14 @@ bat_room,160,150,3	script	Erundek	109,{
 // Badge Reward Function
 //============================================================
 function	script	F_BG_Badge	{
+	.@team$ = getarg(1);
+	.@bg_type$ = getarg(2);
 
-	if (getarg(2) == "Tierra") {
+	if (.@bg_type$ == "Tierra") {
 		set .@badge,7828; //BF_Badge1
 		set .@amount_win,3;
 		set .@amount_lose,1;
-	} else if (getarg(2) == "Flavius") {
+	} else if (.@bg_type$ == "Flavius") {
 		set .@badge,7829; //BF_Badge2
 		set .@amount_win,9;
 		set .@amount_lose,3;
@@ -581,10 +583,10 @@ function	script	F_BG_Badge	{
 
 	if (getarg(0) == 1) {
 		set .@amount, .@amount_win;
-		if (getarg(1) == "Guillaume") {
+		if (.@team$ == "Guillaume") {
 			mes "[Axl Rose]";
 			mes "Blessed Guillaume!";
-		} else if (getarg(1) == "Croix") {
+		} else if (.@team$ == "Croix") {
 			mes "[Swandery]";
 			mes "Blessed Croix!";
 		}
@@ -592,12 +594,12 @@ function	script	F_BG_Badge	{
 		mes strcharinfo(0)+", it's a sign reflecting victory.";
 	} else {
 		set .@amount, .@amount_lose;
-		if (getarg(1) == "Guillaume") {
+		if (.@team$ == "Guillaume") {
 			mes "[Axl Rose]";
 			mes "You lost, but you're dedicated to this battle.";
 			mes "This is a reward for your great dedication by Guillaume Marollo!";
 			mes "Just take this defeat as a lesson, and next time you will definitely win.";
-		} else if (getarg(1) == "Croix") {
+		} else if (.@team$ == "Croix") {
 			mes "[Swandery]";
 			mes "Oh, "+strcharinfo(0)+" Don't be sad.";
 			mes "Even though we didn't win, we did our best.";

+ 31 - 27
npc/battleground/kvm/kvm_item_pay.txt

@@ -249,31 +249,35 @@ PurchaseItem:
 	// Pricing for Weapon, Suit1, Muffler1, Shoes1, Ring1m Suit2, Shoes2, Ring2, Suit3, Shoes3, Ring3
 	setarray .@prices[0],2000,840,630,580,1200,120,70,200,15,10,30;
 
+	.@item_id = getarg(0);
+	.@req_setting = getarg(1);
+	.@item_type = getarg(2);
+
 	mes "[Logistics]";
 
-	if (!getarg(2))
-		mes "You have selected ^ff0000"+getitemname(getarg(0))+"^000000.";
-	else if (getarg(2) == 1)
-		mes "There is only one "+callfunc("F_GetWeaponType",getarg(0))+": "+getitemname(getarg(0))+".";
-	else if (getarg(2) == 2) {
-		mes "You have selected '"+callfunc("F_GetArmorType",getarg(0))+"'.";
-		mes "The armor for one whose Lvl is more than 80 is: ^ff0000"+getitemname(getarg(0))+"^000000.";
+	if (!.@item_type)
+		mes "You have selected ^ff0000"+ getitemname(.@item_id) +"^000000.";
+	else if (.@item_type == 1)
+		mes "There is only one "+ callfunc("F_GetWeaponType",.@item_id) +": "+ getitemname(.@item_id) +".";
+	else if (.@item_type == 2) {
+		mes "You have selected '"+ callfunc("F_GetArmorType",.@item_id) +"'.";
+		mes "The armor for one whose Lvl is more than 80 is: ^ff0000"+ getitemname(.@item_id) +"^000000.";
 	}
-	else if (getarg(2) == 3) {
-		mes "You have selected 'Mass-Production "+callfunc("F_GetArmorType",getarg(0))+"'.";
-		mes "There is only one Mass-Production "+callfunc("F_GetArmorType",getarg(0))+": ^ff0000"+getitemname(getarg(0))+"^000000.";
+	else if (.@item_type == 3) {
+		mes "You have selected 'Mass-Production "+ callfunc("F_GetArmorType",.@item_id) +"'.";
+		mes "There is only one Mass-Production "+ callfunc("F_GetArmorType",.@item_id) +": ^ff0000"+ getitemname(.@item_id) +"^000000.";
 	}
-	else if (getarg(2) == 4) {
-		mes "You have selected 'Popularized "+callfunc("F_GetArmorType",getarg(0))+"'.";
-		mes "There is only one Popularized "+callfunc("F_GetArmorType",getarg(0))+": ^ff0000"+getitemname(getarg(0))+"^000000.";
+	else if (.@item_type == 4) {
+		mes "You have selected 'Popularized "+ callfunc("F_GetArmorType",.@item_id) +"'.";
+		mes "There is only one Popularized "+ callfunc("F_GetArmorType",.@item_id) +": ^ff0000"+ getitemname(.@item_id) +"^000000.";
 	}
 
-	if (!getarg(1))
+	if (!.@req_setting)
 		mes "It requires ^0000ff2,000^000000 KVM Points, and "+ .@name$ +", your points are: ^580080"+ kvm_point +"^000000.";
-	else if (getarg(1) == 4)
+	else if (.@req_setting == 4)
 		mes "It requires ^0000ff1,200^000000 KVM Points, and "+ .@name$ +", your points are: ^580080"+ kvm_point +"^000000.";
 	else
-		mes "It requires ^0000ff"+.@prices[getarg(1)]+"^000000 KVM Points, and "+ .@name$ +", your points are: ^580080"+ kvm_point +"^000000.";
+		mes "It requires ^0000ff"+ .@prices[.@req_setting] +"^000000 KVM Points, and "+ .@name$ +", your points are: ^580080"+ kvm_point +"^000000.";
 
 	mes "Are you sure you want this item?";
 	next;
@@ -284,26 +288,26 @@ PurchaseItem:
 		mes "When purchasing an item, please be careful there are no refunds.";
 		break;
 	case 2:
-		if (kvm_point >= .@prices[getarg(1)]) {
-			set kvm_point,kvm_point-.@prices[getarg(1)];
-			getitem getarg(0),1;
+		if (kvm_point >= .@prices[.@req_setting]) {
+			kvm_point = kvm_point -.@prices[.@req_setting];
+			getitem .@item_id,1;
 			mes "[Logistics]";
-			mes "You have purchased a "+getitemname(getarg(0))+".";
-			if (!getarg(1))
-				mes "Your KVM Points are reduced by ^0000ff"+getarg(1)+"^000000 points, your KVM Points are now ^580080"+kvm_point+"^000000.";
-			if (getarg(1) == 4)
+			mes "You have purchased a "+ getitemname(.@item_id) +".";
+			if (!.@req_setting)
+				mes "Your KVM Points are reduced by ^0000ff"+ .@req_setting +"^000000 points, your KVM Points are now ^580080"+kvm_point+"^000000.";
+			if (.@req_setting == 4)
 				mes "Your KVM Points are reduced by ^0000ff1,200^000000 points, your KVM Points are now ^580080"+kvm_point+"^000000.";
 			else
-				mes "Your KVM Points are reduced by ^0000ff"+.@prices[getarg(1)]+"^000000 points, your KVM Points are now ^580080"+kvm_point+"^000000.";
+				mes "Your KVM Points are reduced by ^0000ff"+ .@prices[.@req_setting] +"^000000 points, your KVM Points are now ^580080"+kvm_point+"^000000.";
 		}
 		else {
 			mes "[Logistics]";
-			if (!getarg(1))
+			if (!.@req_setting)
 				mes "You need ^0000ff2,000^000000 KVM Points to purchase this item.";
-			else if (getarg(1) == 4)
+			else if (.@req_setting == 4)
 				mes "You need ^0000ff1,200^000000 KVM Points to purchase this item.";
 			else
-				mes "You need ^0000ff"+.@prices[getarg(1)]+"^000000 KVM Points to purchase this item.";
+				mes "You need ^0000ff"+ .@prices[.@req_setting] +"^000000 KVM Points to purchase this item.";
 			mes "However, your KVM Points are now ^580080"+ kvm_point +"^000000.";
 			mes "Which are not enough to buy it.";
 			mes "When you get enough points, please come back again.";

+ 7 - 4
npc/cities/aldebaran.txt

@@ -1390,14 +1390,17 @@ alde_dun03,264,16,4	script	Gatekeeper#ct1	101,{
 }
 
 function	script	F_ClockTowerGate	{
+	.@floor = getarg(0);
+	.@item_req = getarg(1);
+
 	mes "[Gatekeeper Boy]";
 	mes "Welcome to";
 	mes "Kinase - Blue Gallino";
 	mes "The one of Local Speciality in Aldebaran.";
-	mes "You can't go through from "+getarg(0)+" Floor,";
+	mes "You can't go through from "+ .@floor +" Floor,";
 	mes "Please go back.";
 	next;
-	switch(select("About Clock Tower:About the "+getarg(0)+" Floor:Move to the "+getarg(0)+" Floor:End Dialogue")) {
+	switch(select("About Clock Tower:About the "+ .@floor +" Floor:Move to the "+ .@floor +" Floor:End Dialogue")) {
 	case 1:
 		mes "[Gatekeeper Boy]";
 		mes "Homeland of Alchemy,Aldebaran!";
@@ -1458,14 +1461,14 @@ function	script	F_ClockTowerGate	{
 		mes ". . . . .";
 		close;
 	case 3:
-		if (countitem(getarg(1)) > 0) {
+		if (countitem(.@item_req) > 0) {
 			mes "[Gatekeeper Boy]";
 			mes "Hmm! I already felt that you are not an Ordinary person,";
 			mes "Now it seems to be successful in Speculation.";
 			mes "Please,You may enter.";
 			mes "May God bless you ..";
 			close2;
-			delitem getarg(1),1; 
+			delitem .@item_req,1; 
 			warp getarg(2),getarg(3),getarg(4);
 			end;
 		}

+ 13 - 11
npc/cities/einbroch.txt

@@ -91,13 +91,15 @@ einbroch,176,172,5	script	Khemko#ein	855,{
 }
 
 function	script	EinTower	{
-	mes "[" + getarg(0) + "]";
+	.@npc_name$ = getarg(0);
+
+	mes "["+ .@npc_name$ +"]";
 	mes "Good day~";
-	mes "I'm " + getarg(0) + ", your";
+	mes "I'm "+ .@npc_name$ +", your";
 	mes "guide to exploring";
 	mes "the Einbroch Tower.";
 	next;
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "Einbroch Tower offers";
 	mes "the best view of our city";
 	mes "and it's a great place to";
@@ -105,7 +107,7 @@ function	script	EinTower	{
 	mes "a date. The Einbroch Tower";
 	mes "admission fee is 10 zeny.";
 	next;
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "Right now, we're offering";
 	mes "a special promotion called";
 	mes "the Apple Combo Set for only";
@@ -116,7 +118,7 @@ function	script	EinTower	{
 	switch(select("Tower Admission Only:Apple Combo Set:Cancel")) {
 	case 1:
 		if (Zeny < 10) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "I'm sorry, but you";
 			mes "don't have enough";
 			mes "zeny. The Einbroch";
@@ -125,7 +127,7 @@ function	script	EinTower	{
 			close;
 		}
 		else {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Thank you for";
 			mes "using our services.";
 			mes "Let me guide you to";
@@ -137,14 +139,14 @@ function	script	EinTower	{
 		}
 	case 2:
 		if (Zeny < 20) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "I'm sorry, but you don't";
 			mes "have enough zeny. The";
 			mes "Apple Combo Set is 20 zeny.";
 			close;
 		}
 		else {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Before I guide you to";
 			mes "the tower, let me check";
 			mes "your status to insure";
@@ -152,7 +154,7 @@ function	script	EinTower	{
 			mes "you the Apple Combo Set.";
 			next;
 			if (checkweight(512,1)) {
-				mes "[" + getarg(0) + "]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Thank you for";
 				mes "using our services.";
 				mes "Let me guide you to";
@@ -164,7 +166,7 @@ function	script	EinTower	{
 				end;
 			}
 			else {
-				mes "[" + getarg(0) + "]";
+				mes "["+ .@npc_name$ +"]";
 				mes "I'm sorry, but you're carrying";
 				mes "too many items with you. Please store some of your things in your Kafra Storage before purchasing";
 				mes "the Apple Combo Set.";
@@ -172,7 +174,7 @@ function	script	EinTower	{
 			}
 		}
 	case 3:
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I see.";
 		mes "Feel free to";
 		mes "come back any";

+ 26 - 23
npc/events/nguild/nguild_managers.txt

@@ -24,24 +24,27 @@
 
 //==============================================
 function	script	F_GldManager	{
+	.@npc_name$ = getarg(0);
+	.@map_name$ = getarg(1);
+	.@gid = getcastledata(.@map_name$,1);
+	.@gm_name$ = getguildmaster(.@gid);
 
-	set @GID, GetCastleData(getarg(1),1);
-	mes "[ "+getarg(0)+" ]";
-	if (@GID == 0){
+	mes "[ "+ .@npc_name$ +" ]";
+	if (.@gid == 0){
 		mes "I am waiting for my master.  Brave adventurer, follow your destiny!";
 		return;
 	}
-	if (getcharid(2) != @GID){
-		mes "I am here to follow ^5533FF" + getguildmaster(@GID) + "^000000's command! Hey! Your not even a part of the guild!!";
+	if (getcharid(2) != .@gid){
+		mes "I am here to follow ^5533FF" + getguildmaster(.@gid) + "^000000's command! Hey! Your not even a part of the guild!!";
 		mes "Where are the guardians? Destroy these intruders!";
 		return;
 	}
-	if (strcharinfo(0) != getguildmaster(@GID)){
-		mes "You're not ^5533FF" + getguildmaster(@GID) + "^000000! I am here to follow ^5533FF" + getguildmaster(@GID) + "^000000's command only";
+	if (strcharinfo(0) != getguildmaster(.@gid)){
+		mes "You're not ^5533FF" + getguildmaster(.@gid) + "^000000! I am here to follow ^5533FF" + getguildmaster(.@gid) + "^000000's command only";
 		return 0;
 	}
 
-	mes "Welcome Master ^5533FF" + getguildmaster(@GID) + "^000000 ! I will assist you in any way I can!";
+	mes "Welcome Master ^5533FF" + getguildmaster(.@gid) + "^000000 ! I will assist you in any way I can!";
 	next;
 
 	menu "Kafra Staff Employment / Dismissal",M_Kaf, "Enter Treasure Room",M_Treas, "Cancel",M_End;
@@ -49,9 +52,9 @@ function	script	F_GldManager	{
 	//===========================
 	M_Kaf:
 	//======
-		mes "[ "+getarg(0)+" ]";
-		if (GetCastleData(getarg(1),9) == 1) goto L_Dismiss;
-		if (getgdskilllv(@GID,10001) == 0){
+		mes "[ "+ .@npc_name$ +" ]";
+		if (GetCastleData(.@map_name$,9) == 1) goto L_Dismiss;
+		if (getgdskilllv(.@gid,10001) == 0){
 			mes "Master, you don't have a contract with the Kafra Staff Company.";
 			mes "In order to hire a Kafra, you must first learn the Guild skill ^5533FFContract With Kafra^000000.";
 			return;
@@ -62,14 +65,14 @@ function	script	F_GldManager	{
 			next;
 			menu "Employ Kafra.",-,"Cancel",sM_KafEnd;
 
-				mes "[ "+getarg(0)+" ]";
+				mes "[ "+ .@npc_name$ +" ]";
 				if (Zeny < 10000){
 					mes "Master, you do not have enough money to employ a Kafra. Employment has been cancelled.";
 					return;
 				}
 				set Zeny,Zeny-10000;
 				enablenpc "Kafra Staff#"+getarg(4);
-				SetCastleData getarg(1),9,1;
+				SetCastleData .@map_name$,9,1;
 				mes "You have created a contract with the Kafra Staff Company.";
 				next;
 				cutin "kafra_01",2;
@@ -77,13 +80,13 @@ function	script	F_GldManager	{
 				mes "How do you do? I'm here to provide you with helpful service! I'll do the best I can to serve you.";
 				next;
 				cutin "kafra_01",255;
-				mes "[ "+getarg(0)+" ]";
+				mes "[ "+ .@npc_name$ +" ]";
 				//mes "Your employment contract lasts ^5533FF1 month^000000.  After this term is over you will have to create a new contract.";
 				mes "I think the Kafra Staff will benefit our guild members.";
 				return;
 
 			sM_KafEnd:
-				mes "[ "+getarg(0)+" ]";
+				mes "[ "+ .@npc_name$ +" ]";
 				mes "As you wish Master.  But I suggest we get a Kafra as soon as possible!";
 				return;
 
@@ -102,9 +105,9 @@ function	script	F_GldManager	{
 					mes "It's unfortunate that I won't be able to serve your guild anymore....";
 					next;
 					disablenpc "Kafra Staff#"+getarg(4);
-					SetCastleData getarg(1),9,0;
+					SetCastleData .@map_name$,9,0;
 					cutin "kafra_01",255;
-					mes "[ "+getarg(0)+" ]";
+					mes "[ "+ .@npc_name$ +" ]";
 					mes "The Kafra has been dismissed.  But... we should really get a Kafra as soon as possible!";
 					return;
 				ssM_KafEnd2:
@@ -113,26 +116,26 @@ function	script	F_GldManager	{
 					cutin "kafra_01",255;
 					return;
 			sM_KafEnd2:
-				mes "[ "+getarg(0)+" ]";
+				mes "[ "+ .@npc_name$ +" ]";
 				mes "Master, I think you should keep the current Kafra Staff because she is already trying her best to serve us";
 				return;
 
 	//=========================
 	M_Treas:
 	//========
-		mes "[ "+getarg(0)+" ]";
+		mes "[ "+ .@npc_name$ +" ]";
 		mes "Would you to go to our Treasure Room? Only you, the Guild Master, are allowed to enter this room.";
 		next;
 		menu "Enter Treasure room.",-,"Cancel",sM_TresEnd;
 
-			mes "[ "+getarg(0)+" ]";
+			mes "[ "+ .@npc_name$ +" ]";
 			mes "Please follow me through the secret passage way.";
 			mes "You must pull down on the secret switch in order to get out.";
 			next;
-			warp getarg(1),getarg(2),getarg(3);
+			warp .@map_name$,getarg(2),getarg(3);
 			return;
 		sM_TresEnd:
-			mes "[ "+getarg(0)+" ]";
+			mes "[ "+ .@npc_name$ +" ]";
 			mes "The goods are produced everyday.";
 			mes "You should get them whenever you can because they might dissapear if you take them at the wrong time.";
 			return;
@@ -141,7 +144,7 @@ function	script	F_GldManager	{
 	//==========================
 	M_End:
 	//=======
-		mes "[ "+getarg(0)+" ]";
+		mes "[ "+ .@npc_name$ +" ]";
 		mes "As you wish, master.";
 		return;
 }

+ 11 - 9
npc/events/nguild/nguild_treas.txt

@@ -20,21 +20,23 @@
 // Treasure Spawning Function
 //================================================
 function	script	F_GldTreas	{
-	if(getarg(10) !=  1) {
-		setcastledata getarg(0),4,0;
-		setcastledata getarg(0),5,0;
+	.@map$ = getarg(0);
+
+	if(getarg(10) != 1) {
+		setcastledata .@map$,4,0;
+		setcastledata .@map$,5,0;
 
 		// Why on earth are we killing old treasure chest spawns?
-		//killmonster getarg(0),"Treasure_"+getarg(1)+"::OnDied";
+		//killmonster .@map$,"Treasure_"+getarg(1)+"::OnDied";
 
 		// Don't spawn treasures if Castle is empty, or Eco is greater than 100
-		if(GetCastleData(getarg(0),2) > 100 || GetCastleData(getarg(0),1) == 0) return;
+		if(getcastledata(.@map$,2) > 100 || getcastledata(.@map$,1) == 0) return;
 
 		// Only spawn one treasure chest for novice castles.
-		if (compare(getarg(0),"nguild"))
+		if (compare(.@map$,"nguild"))
 			set getarg(2),1;
 		else
-			set getarg(2),GetCastleData(getarg(0),2)/5+4;
+			set getarg(2),getcastledata(.@map$,2)/5+4;
 
 		if (getarg(2) <= 0) return;
 
@@ -44,13 +46,13 @@ function	script	F_GldTreas	{
 	for (set .@i,1; .@i <= getarg(3) ; set .@i,.@i+1) {
 		// set treasure box ID
 		set getarg(4), getarg(5) + (.@i+1) % 2;
-		areamonster getarg(0),getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+		areamonster .@map$,getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
 	}
 	return;
 }
 
 //==============================================================
-//  Treasure Room Switch 
+//  Treasure Room Switch
 //===============================================================
 function	script	F_GldTreasSw	{
 	mes " ";

+ 9 - 8
npc/guild2/agit_main_se.txt

@@ -1728,8 +1728,9 @@ function	script	LinkFlag	{
 // Return Flags (function)
 //============================================================
 function	script	ReturnFlag	{
+	.@map$ = getarg(0);
 	set .@str$, (compare(strnpcinfo(4),"aru"))?"Arunafeltz":"Schwaltzvalt";
-	set .@GID, getcastledata(getarg(0),1);
+	.@GID =  getcastledata(.@map$,1);
 	if (!.@GID) {
 		mes "[ "+.@str$+" Royal Edict ]";
 		mes "The Holy Kingdom of";
@@ -1746,18 +1747,18 @@ function	script	ReturnFlag	{
 		mes "do you wish to return";
 		mes "to your stronghold?";
 		next;
-		if(select("Return to the Stronghold:Cancel") == 1 && getcharid(2) == getcastledata(getarg(0),1)) {
-			if (compare(getarg(0),"arug")) {
-				if (getarg(0) == "arug_cas01") setarray .@i[0],67,193;
-				else if (getarg(0) == "arug_cas02") setarray .@i[0],43,256;
+		if(select("Return to the Stronghold:Cancel") == 1 && getcharid(2) == getcastledata(.@map$,1)) {
+			if (compare(.@map$,"arug")) {
+				if (.@map$ == "arug_cas01") setarray .@i[0],67,193;
+				else if (.@map$ == "arug_cas02") setarray .@i[0],43,256;
 				else setarray .@i[0],121,318;	// Castles 3,4,5 are identical.
 			}
 			else {
-				if (getarg(0) == "schg_cas02") setarray .@i[0],136,188;
-				else if (getarg(0) == "schg_cas03") setarray .@i[0],308,202;
+				if (.@map$ == "schg_cas02") setarray .@i[0],136,188;
+				else if (.@map$ == "schg_cas03") setarray .@i[0],308,202;
 				else setarray .@i[0],120,290;	// Castles 1,4,5 are identical.
 			}
-			warp getarg(0),.@i[0],.@i[1];
+			warp .@map$,.@i[0],.@i[1];
 		}
 		close;
 	}

+ 17 - 13
npc/jobs/2-2/rogue.txt

@@ -946,11 +946,12 @@ S_Req:
 	mes "^FF0000"+getarg(1)+"^000000,";
 	mes "^FF0000"+getarg(2)+"^000000 and";
 	mes "^FF0000"+getarg(3)+"^000000.";
-	set ROGUE_Q,getarg(4);
-	if(getarg(4) == 3) {
+	.@var = getarg(4);
+	ROGUE_Q = .@var;
+	if (.@var == 3) {
 		changequest 2017,2018;
 	}
-	else if(getarg(4) == 4) {
+	else if (.@var == 4) {
 		changequest 2017,2019;
 	}
 	else {
@@ -973,14 +974,17 @@ S_Req:
 
 
 S_CheckItems:
-	if (Zeny > 9999 && countitem(getarg(0)) >= getarg(1) && countitem(getarg(2)) >= getarg(3) && countitem(getarg(4)) >= getarg(5) && countitem(getarg(6)) >= getarg(7)) {
+	setarray .@item_req[0], getarg(0), getarg(2), getarg(4), getarg(6);
+	setarray .@amount[0], getarg(1), getarg(3), getarg(5), getarg(7);
+
+	if (Zeny > 9999 && countitem(.@item_req[0]) >= .@amount[0] && countitem(.@item_req[1]) >= .@amount[1] && countitem(.@item_req[2]) >= .@amount[2] && countitem(.@item_req[3]) >= .@amount[3]) {
 		mes "[Mr. Smith]";
-		mes "Okay, we've got the application fee, ^FF000010,000 zeny^000000, "+getarg(1)+" "+getitemname(getarg(0))+", "+getarg(3)+" "+getitemname(getarg(2))+", "+getarg(5)+" "+getitemname(getarg(4))+" and "+getarg(7)+" "+getitemname(getarg(6))+"...";
+		mes "Okay, we've got the application fee, ^FF000010,000 zeny^000000, "+ .@amount[0] +" "+ getitemname(.@item_req[0]) +", "+ .@amount[1] +" "+ getitemname(.@item_req[1]) +", "+ .@amount[2] +" "+ getitemname(.@item_req[2]) +" and "+ .@amount[3] +" "+ getitemname(.@item_req[3]) +"...";
 		set Zeny, Zeny-10000;
-		delitem getarg(0),getarg(1);
-		delitem getarg(2),getarg(3);
-		delitem getarg(4),getarg(5);
-		delitem getarg(6),getarg(7);
+		delitem .@item_req[0],.@amount[0];
+		delitem .@item_req[1],.@amount[1];
+		delitem .@item_req[2],.@amount[2];
+		delitem .@item_req[3],.@amount[3];
 		set ROGUE_Q,7;
 		next;
 		mes "[Mr. Smith]";
@@ -1003,10 +1007,10 @@ S_CheckItems:
 	mes "and the following items...";
 	next;
 	mes "[Mr. Smith]";
-	mes "^FF0000 "+getarg(1)+" "+getitemname(getarg(0))+"^000000,";
-	mes "^FF0000 "+getarg(3)+" "+getitemname(getarg(2))+"^000000,";
-	mes "^FF0000 "+getarg(5)+" "+getitemname(getarg(4))+"^000000,";
-	mes "^FF0000 "+getarg(7)+" "+getitemname(getarg(6))+"^000000,";
+	mes "^FF0000 "+ .@amount[0] +" "+ getitemname(.@item_req[0]) +"^000000,";
+	mes "^FF0000 "+ .@amount[1] +" "+ getitemname(.@item_req[1]) +"^000000,";
+	mes "^FF0000 "+ .@amount[2] +" "+ getitemname(.@item_req[2]) +"^000000,";
+	mes "^FF0000 "+ .@amount[3] +" "+ getitemname(.@item_req[3]) +"^000000,";
 	mes "You got it this time?";
 	close;
 }

+ 5 - 4
npc/kafras/cool_event_corp.txt

@@ -78,7 +78,8 @@ function	script	F_CoolEventCorp	{
 			set .@cost,4400;
 		else
 			set .@cost,2200;
-		if (select(getarg(5)+" -> "+.@cost+" z:Cancel") == 1) {
+		.@destination$ = getarg(5);
+		if (select(.@destination$ +" -> "+ .@cost +" z:Cancel") == 1) {
 			if ((countitem(7060) != 0) || (Zeny >= .@cost)) {
 				if (countitem(7060) != 0) {
 					delitem 7060,1; //Warp_Free_Ticket
@@ -86,8 +87,8 @@ function	script	F_CoolEventCorp	{
 				else {
 					set Zeny,Zeny-.@cost;
 				}
-				if (getarg(5) == "Veins") warp "veins",205,101;
-				else if (getarg(5) == "Rachel") warp "rachel",115,125;
+				if (.@destination$ == "Veins") warp "veins",205,101;
+				else if (.@destination$ == "Rachel") warp "rachel",115,125;
 				cutin "",255;
 				end;
 			}
@@ -96,7 +97,7 @@ function	script	F_CoolEventCorp	{
 				mes "I'm sorry, but you don't have";
 				mes "enough zeny for the Teleport";
 				mes "Service. The fee to teleport";
-				mes "to "+getarg(5)+" is "+.@cost+" zeny.";
+				mes "to "+ .@destination$ +" is "+.@cost+" zeny.";
 			}
 		}
 		close2;

+ 35 - 26
npc/kafras/functions_kafras.txt

@@ -74,8 +74,11 @@
 //==========================================================================
 function	script	F_Kafra	{
 	callfunc "F_ClearGarbage"; // Clear outdated, unused variables
+	.@welcome = getarg(0);
+	.@menu_num = getarg(1);
+
 	// Display Kafra Welcome Message
-	switch(getarg(0)){
+	switch(.@welcome){
 		default:
 		case 0:
 			// Default message (obsolete)
@@ -122,11 +125,11 @@ function	script	F_Kafra	{
 	next;
 	while (1) {
 		deletearray @K_Menu0$[0],getarraysize(@K_Menu0$);
-		if (getarg(0) == 2) {
+		if (.@welcome == 2) {
 			// Guild Kafra Menu override (free Teleport, free Storage, Free Cart)
 			setarray @K_Menu0$[0],"Use Storage","Use Guild Storage","Rent a Pushcart","Use Teleport Service","Cancel";
 		} else {
-			switch(getarg(1)){
+			switch(.@menu_num){
 				// Save and Storage only
 				case 1:	setarray @K_Menu0$[0],"Save","Use Storage","Cancel"; break;
 				// Storage only
@@ -158,14 +161,14 @@ function	script	F_Kafra	{
 			return;
 		} else if (@K_Menu0$[.@j] == "Use Storage") {
 			// Do not charge for Guild Storage
-			if(getarg(0) == 2) 
+			if(.@welcome == 2) 
 				callfunc "F_KafStor",2,0,0;
 			else 
-				callfunc "F_KafStor",0,getarg(3),getarg(0);
+				callfunc "F_KafStor",0,getarg(3),.@welcome;
 			next;
 		} else if (@K_Menu0$[.@j] == "Use Teleport Service") {
 			// Display Einbroch "No Teleport Service" notice.
-			if(getarg(1) != 4) callfunc "F_KafTele",getarg(0);
+			if(.@menu_num != 4) callfunc "F_KafTele",.@welcome;
 			else {
 				mes "[Kafra Employee]";
 				mes "Because of the ^FF0000Limited";
@@ -182,13 +185,13 @@ function	script	F_Kafra	{
 			}
 			next;
 		} else if (@K_Menu0$[.@j] == "Rent a Pushcart") {
-			if(callfunc("F_KafCart",getarg(0),getarg(4)) == 1) 
+			if(callfunc("F_KafCart",.@welcome,getarg(4)) == 1) 
 				next;
 		} else if (@K_Menu0$[.@j] == "Check Other Information") {
 			callfunc "F_KafInfo",getarg(2);
 			next;
 		} else if (@K_Menu0$[.@j] == "Cancel"){
-			callfunc "F_KafEnd",getarg(0),0;
+			callfunc "F_KafEnd",.@welcome,0;
 			end;
 		} else if (@K_Menu0$[.@j] == "Use Guild Storage") {
 			callfunc "F_KafStor",1,0;
@@ -201,8 +204,11 @@ function	script	F_Kafra	{
 // Storage Function
 //===================================================
 function	script	F_KafStor	{
+	.@type = getarg(0);
+	.@fee = getarg(1);
+
 	// Unable to access Guild Storage (Busy)
-	if(getarg(0) == 1){
+	if(.@type == 1){
 		if(guildopenstorage()){
 			mes "[Kafra Employee]";
 			mes "I'm sorry but another guild member is using the guild storage";
@@ -232,11 +238,11 @@ function	script	F_KafStor	{
 		return;
 	}
 	// Accessing Normal Storage (Skipped if accessing Storage from Guild castle)
-	if(getarg(0) != 2){
+	if(.@type != 2){
 		// Consume "Free Ticket for Kafra Storage" if available.
 		if(countitem(7059)) delitem 7059,1;
 		else {
-			if(Zeny<getarg(1)){
+			if(Zeny<.@fee){
 				mes "[Kafra Employee]";
 				// Niflheim Specific Message
 				if (getarg(2) == 1) {
@@ -251,16 +257,16 @@ function	script	F_KafStor	{
 				mes "I'm sorry, but you don't";
 				mes "have enough zeny to use";
 				mes "the Storage Service. Our";
-				mes "Storage access fee is "+getarg(1)+" zeny.";
+				mes "Storage access fee is "+.@fee+" zeny.";
 				return;
 			}
-			set Zeny, Zeny-getarg(1);
-			set RESRVPTS, RESRVPTS + (getarg(1)/5);
+			set Zeny, Zeny-.@fee;
+			set RESRVPTS, RESRVPTS + (.@fee/5);
 		}
 	}
 
 	// Surpress the "End" message if in guild castle.
-	if (getarg(0) != 2) {
+	if (.@type != 2) {
 		// Niflheim specific Message
 		if (getarg(2) == 1) {
 			percentheal 0,-10;
@@ -484,13 +490,16 @@ function	script	F_CheckKafCode	{
 // getarg(1): Company Name
 //=======================================================
 function	script	F_SetKafCode	{
-	mes getarg(0);
+	.@npc_name$ = getarg(0);
+	.@comp_name$ = getarg(1);
+
+	mes .@npc_name$;
 	if(#kafra_code) {
 		mes "Your storage is protected with a password. What would you do now?";
 		next;
 		switch (select("Change old password -> 5000z:Remove storage password -> 1000z:Cancel")) {
 			case 1:
-				mes getarg(0);
+				mes .@npc_name$;
 				mes "At first, please enter your ^0000FFold password^000000.";
 				set @code,callfunc("F_EntKafCode");
 				if(!@code || @code != #kafra_code) {
@@ -499,10 +508,10 @@ function	script	F_SetKafCode	{
 					break;
 				}
 				next;
-				callsub S_SET,getarg(0),getarg(1);
+				callsub S_SET,.@npc_name$,.@comp_name$;
 				break;
 			case 2:
-				mes getarg(0);
+				mes .@npc_name$;
 				mes "Please, enter your password before its removal.";
 				set @code,callfunc("F_EntKafCode");
 				if(!@code) {
@@ -511,7 +520,7 @@ function	script	F_SetKafCode	{
 					break;
 				}
 				next;
-				mes getarg(0);
+				mes .@npc_name$;
 				if(Zeny < 1000) {
 					mes "You don't have enough zeny.";
 					emotion e_cash;
@@ -521,7 +530,7 @@ function	script	F_SetKafCode	{
 				if(@code == #kafra_code) {
 					set #kafra_code,0;
 					mes "You've successfully cleared your storage password.";
-					mes "Thank you for using "+getarg(1)+".";
+					mes "Thank you for using "+.@comp_name$+".";
 					emotion e_thx;
 				} else {
 					mes "Wrong password. We won't return your 1000z.";
@@ -533,11 +542,11 @@ function	script	F_SetKafCode	{
 				break;
 		}
 	} else {
-		mes getarg(1)+" proudly presents you a new service:";
+		mes .@comp_name$+" proudly presents you a new service:";
 		mes "Additional storage protection with a password.";
 		next;
 		switch (select("Set new password -> 5000z:Cancel")) {
-			case 1: callsub S_SET,getarg(0),getarg(1); break;
+			case 1: callsub S_SET,.@npc_name$,.@comp_name$; break;
 			case 2: break;		
 		}
 	}
@@ -546,7 +555,7 @@ function	script	F_SetKafCode	{
 	end;
 
 S_SET:
-	mes getarg(0);
+	mes .@npc_name$;
 	mes "Now enter your ^FF0000new password^000000 to protect your storage from thieves.";
 	set @code,callfunc("F_EntKafCode");
 	if(!@code) {
@@ -555,7 +564,7 @@ S_SET:
 		return;
 	}
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	if(Zeny < 5000) {
 		mes "You don't have enough zeny.";
 		emotion e_cash;
@@ -564,7 +573,7 @@ S_SET:
 	set Zeny,Zeny-5000;
 	set #kafra_code,@code;
 	mes "You've protected your storage with a secret password.";
-	mes "Thank you for using "+getarg(1)+".";
+	mes "Thank you for using "+.@comp_name$+".";
 	emotion e_thx;
 	return;
 }

+ 9 - 7
npc/merchants/advanced_refiner.txt

@@ -101,11 +101,13 @@ payon,157,146,6	script	Suhnbi#cash	85,{
 	close;
 
 S_RefineValidate:
+	.@weapon_lvl = getarg(0);
+	.@item_req = getarg(1);
 	set .@price, getarg(2);
 
 	// If the VIP system is enabled, the prices for non-VIP players are considerably higher.
 	if (VIP_SCRIPT && !vip_status(1)) {
-		switch(getarg(0)){
+		switch(.@weapon_lvl){
 			case 0: set .@price, .@price * 10; break;
 			case 1: set .@price, .@price * 40; break;
 			case 2: set .@price, .@price * 50; break;
@@ -115,14 +117,14 @@ S_RefineValidate:
 	}
 
 	mes "[Suhnbi]";
-	if (getarg(0))
-		mes "You want to refine a level " + getarg(0) + " weapon?";
-	mes "To refine that, you'll need to have one ^ff9999" + getitemname(getarg(1)) + "^000000 and " + .@price + " zeny.";
+	if (.@weapon_lvl)
+		mes "You want to refine a level "+ .@weapon_lvl +" weapon?";
+	mes "To refine that, you'll need to have one ^ff9999"+ getitemname(.@item_req) +"^000000 and "+ .@price +" zeny.";
 	mes "Would you like to continue?";
 	next;
 	if(select("Yes:No") == 1) {
 		if (getequippercentrefinery(getarg(3)) < 100) {
-			if (getarg(0)) {
+			if (.@weapon_lvl) {
 				mes "[Suhnbi]";
 				mes "Wow!!";
 				mes "This weapon probably";
@@ -161,8 +163,8 @@ S_RefineValidate:
 				}
 			}
 		}
-		if (countitem(getarg(1)) > 0 && Zeny > .@price) {
-			delitem getarg(1),1;
+		if (countitem(.@item_req) > 0 && Zeny > .@price) {
+			delitem .@item_req,1;
 			set Zeny, Zeny - .@price;
 			return;
 		}

+ 8 - 5
npc/merchants/alchemist.txt

@@ -140,7 +140,10 @@ alde_alche,24,188,3	script	Guild Dealer	740,{
 	}
 
 S_SellManual:
-	if (Zeny < getarg(1)) {
+	.@item_id = getarg(0);
+	.@zeny_req = getarg(1);
+
+	if (Zeny < .@zeny_req) {
 		mes "[Gever Al Sharp]";
 		mes "You don't";
 		mes "have enough zeny.";
@@ -149,12 +152,12 @@ S_SellManual:
 		close;
 	}
 	mes "[Gever Al Sharp]";
-	mes ""+getitemname(getarg(0))+"?";
-	mes "That'll be "+getarg(1)+" zeny.";
+	mes getitemname(.@item_id) +"?";
+	mes "That'll be "+ .@zeny_req +" zeny.";
 	next;
 	if (select("Purchase.:Quit.") == 1) {
-		set Zeny, Zeny-getarg(1);
-		getitem getarg(0),1;
+		Zeny = Zeny - .@zeny_req;
+		getitem .@item_id,1;
 		mes "[Gever Al Sharp]";
 		mes "Thank you for";
 		mes "your patronage.";

+ 12 - 9
npc/merchants/gemstone.txt

@@ -38,29 +38,32 @@ payon,173,238,5	script	Jade#pay	754,{
 	}
 
 S_TradeGems:
-	if (countitem(getarg(0)) < 2) {
+	.@item_req = getarg(0);
+	.@item_id = getarg(1);
+
+	if (countitem(.@item_req) < 2) {
 		mes "[Jade]";
 		mes "Hah...!";
 		mes "You're kidding me, right?";
 		mes "I can't provide you with this";
 		mes "service if you don't";
 		mes "give me at least";
-		mes "2 "+getitemname(getarg(0))+"s!";
+		mes "2 "+ getitemname(.@item_req) +"s!";
 		close;
 	}
 	else {
-		set .@gems,countitem(getarg(0))/2;
+		.@gems = countitem(.@item_req) /2;
 		mes "[Jade]";
 		mes "I believe I can create";
-		mes "a total of " + .@gems + " " + getitemname(getarg(1)) + "s";
-		mes "using the "+getitemname(getarg(0))+"s";
+		mes "a total of "+ .@gems +" "+ getitemname(.@item_id) +"s";
+		mes "using the "+ getitemname(.@item_req) +"s";
 		mes "that you currently have.";
 		mes "What do you want to do?";
 		next;
 		switch(select("Give me as many as you can.:I want to set the amount.:I quit.")) {
 		case 1:
-			delitem getarg(0),.@gems * 2;
-			getitem getarg(1),.@gems;
+			delitem .@item_req,.@gems * 2;
+			getitem .@item_id,.@gems;
 			break;
 		case 2:
 			mes "[Jade]";
@@ -96,8 +99,8 @@ S_TradeGems:
 				}
 				else break;
 			}
-			delitem getarg(0),.@input * 2;
-			getitem getarg(1),.@input;
+			delitem .@item_req,.@input * 2;
+			getitem .@item_id,.@input;
 			break;
 		case 3:
 			mes "[Jade]";

+ 7 - 6
npc/merchants/hair_style.txt

@@ -508,16 +508,17 @@ alberta_in,55,142,7	script	Hair Dresser	91,{
 	}
 
 L_cutin:
+	.@num = getarg(0);
 	if(Sex == 1) {
-		if(getarg(0) < 10)
-			cutin "hair_m_0"+getarg(0),4;
+		if (.@num  < 10)
+			cutin "hair_m_0"+ .@num,4;
 		else
-			cutin "hair_m_"+getarg(0),4;
+			cutin "hair_m_"+ .@num,4;
 	} else {
-		if(getarg(0) < 10)
-			cutin "hair_f_0"+getarg(0),4;
+		if (.@num < 10)
+			cutin "hair_f_0"+ .@num,4;
 		else
-			cutin "hair_f_"+getarg(0),4;
+			cutin "hair_f_"+ .@num,4;
 	}
 	return;
 }

+ 5 - 3
npc/merchants/inn.txt

@@ -205,14 +205,16 @@ ve_in,157,219,5	script	Inn Master#Receptionist	709,{
 
 //======================= Inn Function ==============================
 function	script	F_InnMaid	{
-	mes getarg(0);
+	.@npc_name$ = getarg(0);
+
+	mes .@npc_name$;
 	mes "Welcome to";
 	mes getarg(1) + ".";
 	mes "How may I help you?";
 	next;
 	switch(select("Save:Take a Rest -> 5000 zeny:Cancel")) {
 	case 1:
-		mes getarg(0);
+		mes .@npc_name$;
 		mes "Your respawn point";
 		mes "has been saved.";
 		mes "Thank you,";
@@ -220,7 +222,7 @@ function	script	F_InnMaid	{
 		savepoint getarg(2),getarg(3),getarg(4);
 		close;
 	case 2:
-		mes getarg(0);
+		mes .@npc_name$;
 		if(Zeny < 5000){
 			mes "I'm sorry, but the service charge is 5,000 zeny. Please make sure that you have enough money to check in next time, okay?";
 			close;

+ 12 - 8
npc/merchants/kunai_maker.txt

@@ -53,11 +53,15 @@ que_ng,72,29,3	script	Kunai Merchant Kashin	83,{
 }
 
 function	script	Kunai_Trade	{
+	setarray .@item_req[0], getarg(0), getarg(2);
+	setarray .@req_amount[0], getarg(1), getarg(3);
+	.@item_id = getarg(4);
+
 	mes "[Kashin]";
 	mes "You can exchange";
-	mes ""+getarg(1)+" "+getitemname(getarg(0))+" and";
-	mes ""+getarg(3)+" "+getitemname(getarg(2))+" for every";
-	mes "set of 10 "+getitemname(getarg(4))+".";
+	mes .@req_amount[0] +" "+ getitemname(.@item_req[0]) +" and";
+	mes .@req_amount[1] +" "+ getitemname(.@item_req[1]) +" for every";
+	mes "set of 10 "+ getitemname(.@item_id) +".";
 	next;
 	mes "[Kashin]";
 	mes "I can only give you a maximum of 500 sets of Kunais at a time.";
@@ -73,7 +77,7 @@ function	script	Kunai_Trade	{
 		mes "enter a value less than 500.";
 		close;
 	}
-	if(countitem(getarg(0)) < .@amount*getarg(1) || countitem(getarg(2)) < .@amount*getarg(3)) {
+	if (countitem(.@item_req[0]) < .@amount*.@req_amount[0] || countitem(.@item_req[1]) < .@amount*.@req_amount[1]) {
 		mes "[Kashin]";
 		mes "Hmm, you don't have";
 		mes "enough items for this";
@@ -81,7 +85,7 @@ function	script	Kunai_Trade	{
 		mes "check your items again.";
 		close;
  	}
-	if(checkweight(getarg(4), .@amount*10) == 0) {
+	if (checkweight(.@item_id, .@amount*10) == 0) {
 		mes "[Kashin]";
 		mes "Hmm, it seems like your";
 		mes "Inventory doesn't have";
@@ -97,8 +101,8 @@ function	script	Kunai_Trade	{
 	mes "I'm sure that you'll be";
 	mes "quite satisfied with";
 	mes "these Kunais.";
-	delitem getarg(0),getarg(1)*.@amount;
-	delitem getarg(2),getarg(3)*.@amount;
-	getitem getarg(4),10*.@amount;
+	delitem .@item_req[0],.@req_amount[0]*.@amount;
+	delitem .@item_req[1],.@req_amount[1]*.@amount;
+	getitem .@item_id,10*.@amount;
 	close;
 }

+ 13 - 10
npc/merchants/novice_exchange.txt

@@ -297,25 +297,28 @@ geffen,173,88,5	script	Merchant#geff	85,{
 }
 
 function	script	F_PotExchange	{
-	if (countitem(getarg(0)) < getarg(1)) {
+	.@item_req = getarg(0);
+	.@req_amount = getarg(1);
+
+	if (countitem(.@item_req) < .@req_amount) {
 		mes "[Merchant]";
 		mes "Hey, where are";
-		mes "all those "+getitemname(getarg(0))+"";
+		mes "all those "+ getitemname(.@item_req) +"";
 		mes "that you promised?";
-		mes "Give me "+getitemname(getarg(0))+"!";
+		mes "Give me "+ getitemname(.@item_req) +"!";
 		close;
 	}
 	else {
 		mes "[Merchant]";
 		mes "Okay, let me check";
-		mes "how many "+getitemname(getarg(0))+" you";
+		mes "how many "+ getitemname(.@item_req) +" you";
 		mes "have on you. Hmm...";
 		next;
 		mes "[Merchant]";
 		mes "You have";
-		mes "a total of " + countitem(getarg(0)) + " "+getitemname(getarg(0))+".";
+		mes "a total of "+ countitem(.@item_req) +" "+ getitemname(.@item_req) +".";
 		mes "I can give you a total";
-		mes "of " + (countitem(getarg(0))/getarg(1)) + " Red Potions for those.";
+		mes "of "+ (countitem(.@item_req)/.@req_amount) +" Red Potions for those.";
 		next;
 		mes "[Merchant]";
 		mes "What do you say?";
@@ -326,7 +329,7 @@ function	script	F_PotExchange	{
 			mes "You know the exact";
 			mes "number of Red Potions";
 			mes "you want to receive for";
-			mes "those "+getitemname(getarg(0))+", don't you?";
+			mes "those "+ getitemname(.@item_req) +", don't you?";
 			next;
 			mes "[Merchant]";
 			mes "Now, I can trade you";
@@ -357,8 +360,8 @@ function	script	F_PotExchange	{
 					break;
 				}
 			}
-			set .@put_out_item,.@input * getarg(1);
-			if (countitem(getarg(0)) < .@put_out_item) {
+			.@put_out_item = .@input * .@req_amount;
+			if (countitem(.@item_req) < .@put_out_item) {
 				mes "[Merchant]";
 				mes "Uh oh, the number you entered doesn't seem right. You better check the number of Red Potions that you can trade for again.";
 				close;
@@ -367,7 +370,7 @@ function	script	F_PotExchange	{
 			mes "There you go!";
 			mes "Check how many Red Potions";
 			mes "I've given you, it should be good. Thanks, that was a good deal~";
-			delitem getarg(0),.@put_out_item; //Shell
+			delitem .@item_req,.@put_out_item; //Shell
 			getitem 501,.@input; //Red_Potion
 			close;
 		}

+ 13 - 10
npc/merchants/old_pharmacist.txt

@@ -185,14 +185,17 @@ alberta_in,16,28,4	script	Pharmacist	61,{
 	}
 	
 L_Making:
+	.@item_req = getarg(0);
+	.@req_amount = getarg(1);
+
 	next;
 	mes "[Old Pharmacist]";
-	if ((countitem(getarg(0))/2) < countitem(713)) {
-		set .@max,countitem(getarg(0))/2;
+	if ((countitem(.@item_req)/2) < countitem(713)) {
+		.@max = countitem(.@item_req) /2;
 	} else {
-		set .@max,countitem(713);
+		.@max = countitem(713);
 	}
-	if ((countitem(getarg(0)) < 2) || (countitem(713) == 0)) {
+	if (countitem(.@item_req) < 2 || countitem(713) == 0) {
 		mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
 		mes "Get lost!";
 		close;
@@ -206,13 +209,13 @@ L_Making:
 	switch(select("Make as many as I can.:I want to choose an amount.:Actually, I don't want anything.")) {
 	case 1:
 		next;
-		if ((countitem(getarg(0)) < .@max*2) || (countitem(713) < .@max) || (Zeny < .@max*getarg(1))) {
+		if ((countitem(.@item_req) < .@max*2) || countitem(713) < .@max || (Zeny < .@max*.@req_amount)) {
 			mes "[Old Pharmacist]";
 			mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
 			close;
 		}
-		set Zeny,Zeny-(.@max*getarg(1));
-		delitem getarg(0),.@max*2;
+		Zeny = Zeny - (.@max*.@req_amount);
+		delitem .@item_req,.@max*2;
 		delitem 713,.@max; //Empty_Bottle
 		getitem getarg(2),.@max; 
 		break;
@@ -232,13 +235,13 @@ L_Making:
 			mes "Are you deaf? I said less than 100!";
 			close;
 		}
-		if ((countitem(getarg(0)) < .@amount*2) || (countitem(713) < .@amount) || (Zeny < .@amount*getarg(1))) {
+		if ((countitem(.@item_req) < .@amount*2) || countitem(713) < .@amount || (Zeny < .@amount*.@req_amount)) {
 			mes "[Old Pharmacist]";
 			mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
 			close;
 		}
-		set Zeny,Zeny-(.@amount*getarg(1));
-		delitem getarg(0),.@amount*2;
+		Zeny = Zeny - (.@max*.@req_amount);
+		delitem .@item_req,.@amount*2;
 		delitem 713,.@amount; //Empty_Bottle
 		getitem getarg(2),.@amount; 
 		break;

+ 17 - 13
npc/merchants/quivers.txt

@@ -71,17 +71,21 @@ payon_in01,5,134,5	script	Inventor Jaax	89,{
 	//close;
 
 S_BuyQuiver:
-	if (countitem(getarg(0)) >= getarg(1)) {
+	.@item_id = getarg(0);
+	.@amount = getarg(1);
+	.@zeny_req = getarg(2);
+
+	if (countitem(.@item_id) >= .@amount) {
 		mes "[Inventor Jaax]";
 		mes "Excellent!";
-		mes "Are you carrying any Arrows with you? I'll provide you with a quiver that can carry "+getarg(1)+" of your "+getitemname(getarg(0))+"s for only ^FF3131"+getarg(2)+" Zeny^000000.";
+		mes "Are you carrying any Arrows with you? I'll provide you with a quiver that can carry "+ .@amount +" of your "+ getitemname(.@item_id) +"s for only ^FF3131"+ .@zeny_req +" Zeny^000000.";
 		next;
 		switch(select("Store as many Arrows in quivers as possible:Purchase 1 quiver:Cancel")) {
 		case 1:
-			set .@arrows,countitem(getarg(0));
-			set .@quiver,.@arrows / getarg(1);
-			set .@arrows_used,.@quiver * getarg(1);
-			set .@arrow_zeny01,.@quiver * getarg(2);
+			.@arrows = countitem(.@item_id);
+			set .@quiver,.@arrows / .@amount;
+			set .@arrows_used,.@quiver * .@amount;
+			.@arrow_zeny01 = .@quiver * .@zeny_req;
 			mes "Number of";
 			mes "Arrows: ^3131FF"+.@arrows+" ^000000";
 			mes "Maximum Number";
@@ -101,7 +105,7 @@ S_BuyQuiver:
 					mes "There you go!";
 					mes "Just remember, ^FF0000you won't be able to use the Quiver when your carried weight is 90% of your maximum weight limit^000000.";
 					set Zeny, Zeny-.@arrow_zeny01;
-					delitem getarg(0),.@arrows_used; //Arrow
+					delitem .@item_id,.@arrows_used;// Arrow
 					getitem getarg(3),.@quiver; //Quiver
 					next;
 					mes "[Inventor Jaax]";
@@ -126,12 +130,12 @@ S_BuyQuiver:
 			mes "a quiver is so close?";
 			close;
 		case 2:
-			if (Zeny > getarg(2)) {
+			if (Zeny > .@zeny_req) {
 				mes "[Inventor Jaax]";
 				mes "There you go!";
 				mes "Just remember, ^FF0000you won't be able to use the Quiver when your carried weight is 90% of your maximum weight limit^000000.";
-				set Zeny, Zeny-getarg(2);
-				delitem getarg(0),getarg(1); //Arrow
+				Zeny = Zeny -.@zeny_req;
+				delitem .@item_id,.@amount;// Arrow
 				getitem getarg(3),1; //Quiver
 				next;
 				mes "[Inventor Jaax]";
@@ -146,7 +150,7 @@ S_BuyQuiver:
 			else {
 				mes "[Inventor Jaax]";
 				mes "You don't even";
-				mes "have "+getarg(2)+" Zeny?";
+				mes "have "+ .@zeny_req +" Zeny?";
 				mes "I'm so sorry. I had no";
 				mes "idea that you were so...";
 				mes "^333333Destitute^000000.";
@@ -161,11 +165,11 @@ S_BuyQuiver:
 	}
 	else {
 		mes "[Inventor Jaax]";
-		mes "You can carry a maximum of "+getarg(1)+" Arrows within this quiver. It was made using my secret method,";
+		mes "You can carry a maximum of "+ .@amount +" Arrows within this quiver. It was made using my secret method,";
 		mes "so the total weight of the Arrows and Quiver is less than carrying the Arrows alone.";
 		next;
 		mes "[Inventor Jaax]";
-		mes "It's a miracle of science! One that you can experience for yourself if you bring me at least "+getarg(1)+" Arrows and "+getarg(2)+" Zeny for each Quiver.";
+		mes "It's a miracle of science! One that you can experience for yourself if you bring me at least "+ .@amount +" Arrows and "+ .@zeny_req +" Zeny for each Quiver.";
 		close;
 	}
 }

+ 56 - 52
npc/merchants/refine.txt

@@ -561,8 +561,9 @@ lhz_in02,282,20,7	script	Fulerr	869,{
 //============================================================
 function	script	refinemain	{
 	disable_items;
+	.@npc_name$ = getarg(0);
 	set .@features,getarg(1);
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "I'm the Armsmith.";
 	mes "I can refine all kinds of weapons, armor and equipment, so let me";
 	mes "know what you want me to refine.";
@@ -578,14 +579,14 @@ function	script	refinemain	{
 		set .@menu$, .@menu$ + ":";
 	}
 	if (.@equipped == 0) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I don't think I can refine any items you have...";
 		close;
 	}
 	set .@part, select(.@menu$);
 
 	if(!getequipisequiped(.@part)) { //custom check
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "You're not wearing";
 		mes "anything there that";
 		mes "I can refine.";
@@ -594,14 +595,14 @@ function	script	refinemain	{
 	}
 	//Check if the item is refinable...
 	if(!getequipisenableref(.@part)) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I don't think I can";
 		mes "refine this item at all...";
 		close;
 	}
 	//Check to see if the items is already +10
 	if(getequiprefinerycnt(.@part) >= 10) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I can't refine this";
 		mes "any more. This is as";
 		mes "refined as it gets!";
@@ -655,21 +656,21 @@ function	script	refinemain	{
 	}
 
 	if(.@features != 1) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "To refine this I need";
 		mes "one ^003366"+getitemname(.@material)+"^000000 and";
 		mes "a service fee of " + .@price + " Zeny.";
 		mes "Do you really wish to continue?";
 		next;
 		if(select("Yes:No") == 2){
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Yeah...";
 			mes "There's no need to";
 			mes "rush. Take your time.";
 			close;
 		}
 		if(getequippercentrefinery(.@part) < 100) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Oh no! If I continue to";
 			mes "refine this, there's a risk it could";
 			switch(.@material) {
@@ -691,14 +692,14 @@ function	script	refinemain	{
 			mes "Do you still want to refine?";
 			next;
 			if(select("Yes:No") == 2){
-				mes "[" + getarg(0) + "]";
+				mes "["+ .@npc_name$ +"]";
 				mes "I completely agree...";
 				mes "I might be a great refiner, but sometimes even I make mistakes.";
 				close;
 			}
 		}
 		if((countitem(.@material) < 1) || (Zeny < .@price)) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "You don't seem to have";
 			mes "enough Zeny or "+getitemname(.@material)+"...";
 			mes "Go get some more. I'll be";
@@ -711,7 +712,7 @@ function	script	refinemain	{
 		// anti-hack
 		if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) ||
 		    callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			emotion e_an;
 			mes "Wait a second...";
 			mes "Do you think I'm stupid?!";
@@ -721,7 +722,7 @@ function	script	refinemain	{
 
 		if(getequippercentrefinery(.@part) <= rand(100)) {
 			failedrefitem .@part;
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			emotion (!rand(5))?e_cash:e_omg;
 			set .@lose,rand(1,3);
 			if (.@lose == 1) {
@@ -768,7 +769,7 @@ function	script	refinemain	{
 
 // New Refining Functions ========================
 	if(getequiprefinerycnt(.@part) < .@safe) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I can refine this to the safe limit or a desired number of times. It's your choice.";
 		next;
 		set .@menu2,select("To the safe limit, please.","I'll decide how many times.","I've changed my mind...");
@@ -780,23 +781,23 @@ function	script	refinemain	{
 		break;
 	case 2:
 		next;
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "How many times would you like me to refine your item?";
 		next;
 		input .@refinecnt;
 		set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
 		if (.@refinecnt < 1 || .@refinecheck > 10) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "I can't refine this item that many times.";
 			close;
 		}
 		if(.@refinecheck > .@safe) {
 			set .@refinecheck,.@refinecheck - .@safe;
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
 			next;
 			if(select("Yes...","No...") == 2){
-				mes "[" + getarg(0) + "]";
+				mes "["+ .@npc_name$ +"]";
 				mes "You said so... So be it.";
 				close;
 			}
@@ -804,21 +805,21 @@ function	script	refinemain	{
 		break;
 	case 3:
 		next;
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "You said so... So be it.";
 		close;
 	}
 	set .@fullprice,.@price * .@refinecnt;
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
 	next;
 	if(select("Yes","No...") == 2){
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "You said so... So be it.";
 		close;
 	}
 	if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
 		close;
 	}
@@ -826,12 +827,12 @@ function	script	refinemain	{
 	delitem .@material,.@refinecnt;
 	while(.@refinecnt){
 		if (getequipisequiped(.@part) == 0) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Look here... you don't have any items on...";
 			close;
 		}
 		if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Clang... No, but did you imagine I could be so stupid?!";
 			mes "You changed it...";
 			mes "Get out before I stun you with my Hammer!!";
@@ -841,7 +842,7 @@ function	script	refinemain	{
 		if(.@menu2 == 2 && getequippercentrefinery(.@part) <= rand(100)) {
 			failedrefitem .@part;
 			emotion e_omg;
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
 			set .@refinecnt,.@refinecnt - 1;
 			if(.@refinecnt == 0) close;
@@ -856,7 +857,7 @@ function	script	refinemain	{
 		set .@refinecnt,.@refinecnt - 1;
 		next;
 	}
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "All finished... Come again soon.";
 	close;
 }
@@ -903,7 +904,8 @@ function	script	phramain	{
 		mes "- after you lose some weight. -";
 		close;
 	}
-	mes "[" + getarg(0) + "]";
+	.@npc_name$ = getarg(0);
+	mes "["+ .@npc_name$ +"]";
 	mes "I sell 2 kinds of Metal";
 	mes "for tempering weaponry.";
 	mes "I have ^007777Phracon^000000 for Level 1";
@@ -920,26 +922,26 @@ function	script	phramain	{
 		set .@price,1000;
 		break;
 	case 3:
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Other metals?";
 		mes "Well, you'll need special metals to upgrade higher level weapons, or any kind of armor. But you know, Oridecon and Elunium is really";
 		mes "hard to just find...";
 		close;
 	}
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "So how many do you wish to buy?";
 	mes "If you don't want any, please enter the number, '0.'";
 	next;
 	while(1) {
 		input .@input;
 		if (.@input == 0) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "The deal has";
 			mes "been cancelled.";
 			close;
 		}
 		else if (.@input < 0 || .@input > 500) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Alright, you can";
 			mes "puchase up to 500.";
 			mes "No more than that,";
@@ -952,7 +954,7 @@ function	script	phramain	{
 	}
 	set .@sell,.@input * .@price;
 	if (Zeny < .@sell) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Err...";
 		mes "You don't have";
 		mes "enough Zeny to buy";
@@ -960,14 +962,14 @@ function	script	phramain	{
 		close;
 	}
 	if (checkweight(.@material,.@input) == 0) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hmm...";
 		mes "I can't give you anything if you don't have enough room in your inventory. Why don't you put your extra things in Kafra Storage and try again?";
 		close;
 	}
 	getitem .@material,.@input;
 	set Zeny, Zeny-.@sell;
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "Here you are!";
 	mes "Thank you for";
 	mes "your patronage.";
@@ -1016,7 +1018,8 @@ function	script	orimain	{
 		mes "- after you lose some weight. -";
 		close;
 	}
-	mes "[" + getarg(0) + "]";
+	.@npc_name$ = getarg(0);
+	mes "["+ .@npc_name$ +"]";
 	mes "I can purify your";
 	mes "Rough Oridecons or";
 	mes "Rough Eluniums. I'll need";
@@ -1028,14 +1031,14 @@ function	script	orimain	{
 		if (countitem(756) > 4) {
 			delitem 756,5;  //Oridecon_Stone
 			getitem 984,1; // Oridecon
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Here's your Oridecon.";
 			mes "You're welcome to come";
 			mes "back whenever you want.";
 			close;
 		}
 		else {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "You're kidding me, right?";
 			mes "I just told you that I need 5 Rough Oridecons to make a pure Oridecon.";
 			close;
@@ -1044,31 +1047,31 @@ function	script	orimain	{
 		if (countitem(757) > 4) {
 			delitem 757,5;  //Elunium_Stone
 			getitem 985,1; // Elunium
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Here's your Elunium.";
 			mes "You're welcome to come";
 			mes "back whenever you want.";
 			close;
 		}
 		else {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "You're kidding me, right?";
 			mes "I just told you that I need 5 Rough Eluniums to make a pure Elunium.";
 			close;
 		}
 	case 3:
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Enchanted Stones...?";
 		mes "I've been a stonesmith for 20 years, so I've heard a lot about them. Supposedly, there are";
 		mes "four different kinds.";
 		next;
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Each Enchanted Stone possesses one of the following elemental properties: Earth, Wind, Water and Fire.";
 		next;
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "If someone combines a Enchanted Stone with a weapon while smithing, that weapon will possess the same property as the Stone.";
 		next;
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Needless to say, you need to have some smithing skill to produce this kind of elemental weapon.";
 		close;
 	}
@@ -1150,7 +1153,8 @@ sch_gld,340,80,7	script	Repairman#sch_gld	86,{
 //============================================================
 function	script	repairmain	{
 	set .@repairprice,5000;
-	mes "["+getarg(0)+"]";
+	.@npc_name$ = getarg(0);
+	mes "["+ .@npc_name$ +"]";
 	mes "Hey there!";
 	mes "Do you want me";
 	mes "to repair any items?";
@@ -1168,15 +1172,15 @@ function	script	repairmain	{
 		}
 		set .@checkitem,.@checkitem-1;
 		if (!.@checkitem) {
-			mes "["+getarg(0)+"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Oh wow, this is incredible!";
 			mes "You must take very good care of your things. None of your items are damaged!";
 			next;
-			mes "["+getarg(0)+"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "If everyone is like you, I'm going to be unemployed!! Haha~!";
 			close;
 		}
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hmm...";
 		mes "Let's see...";
 		mes "Out of all your items,";
@@ -1184,13 +1188,13 @@ function	script	repairmain	{
 		mes "Would you like to repair?";
 		next;
 		set .@totalcost,.@repairprice*.@checkitem;
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Each repair costs " + .@repairprice + " Zeny. So to repair all your damaged items would cost " + .@totalcost + " Zeny! Would you like to repair the items?";
 		next;
 		switch(select("Yes:No")) {
 		case 1:
 			if (Zeny < .@totalcost) {
-				mes "["+getarg(0)+"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Whoa whoa...";
 				mes "Check your wallet before you receive the repair bill! I can't repair anything because you don't have enough Zeny.";
 				close;
@@ -1209,22 +1213,22 @@ function	script	repairmain	{
 					repair(.@checkitem);
 					set .@checkitem,.@checkitem-1;
 				}
-				mes "["+getarg(0)+"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Okay! All done. Now, try to be a little more careful. Items have lives too you know.";
 				close;
 			}
 			else {
-				mes "["+getarg(0)+"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Mmm? Something's wrong. Wait... Equip the items you need to repair and then come back to me.";
 				close;
 			}
 		case 2:
-			mes "["+getarg(0)+"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Well, it's no skin off my nose, but it's not good to leave items damaged. You should get them repaired as soon as possible!";
 			close;
 		}
 	case 2:
-		mes "["+getarg(0)+"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hohoho...";
 		mes "You don't have";
 		mes "any business with me";

+ 19 - 15
npc/merchants/socket_enchant.txt

@@ -247,15 +247,19 @@
 }
 
 function	script	Func_Socket	{
+	.@item_id = getarg(0);
+	.@zeny_req = getarg(4);
+	setarray .@item_req[0], getarg(5), getarg(7,0);
+	setarray .@req_amount[0], getarg(6), getarg(8,0);
 
 	disable_items;
 	mes "[Seiyablem]";
-	mes "You want to add a Slot to a " + getitemname(getarg(0)) + "?";
-	mes "Alright, please bring me ^FF0000" + getarg(6) + " " + getitemname(getarg(5)) + (getarg(6) > 1 && getarg(5) != 999 ? "s":"") + "^000000, " + (getarg(7,0) != 0 && getarg(8,0) != 0 ? ("^FF0000" + getarg(8,0) + " " + getitemname(getarg(7,0)) + (getarg(8,0) > 1 && getarg(7,0) != 999 ? "s":"") + "^000000 ") : "") + "and my ^FF0000" + (getarg(4) >= 1000 ? (getarg(4)/1000 + ",000") : getarg(4)) + ",000 zeny^000000 service fee.";
-	mes "Ah, and don't forget to bring that " + getitemname(getarg(0)) + "!";
+	mes "You want to add a Slot to a "+ getitemname(.@item_id) +"?";
+	mes "Alright, please bring me ^FF0000"+ .@req_amount[0] +" "+ getitemname(.@item_req[0]) + (.@req_amount[0] > 1 && .@item_req[0] != 999 ? "s":"") +"^000000, "+ (.@item_req[1] != 0 && .@req_amount[1] != 0 ? ("^FF0000"+ .@req_amount[1] +" "+ getitemname(.@item_req[1]) + (.@req_amount[1] > 1 && .@item_req[1] != 999 ? "s":"") + "^000000 ") : "") + "and my ^FF0000" + (.@zeny_req >= 1000 ? (.@zeny_req /1000 +",000") : .@zeny_req) +",000 zeny^000000 service fee.";
+	mes "Ah, and don't forget to bring that "+ getitemname(.@item_id) +"!";
 	next;
 	mes "[Seiyablem]";
-	if (getiteminfo(getarg(0),5)&2) // EQP_HAND_R = 2, it's a weapon
+	if (getiteminfo(.@item_id,5) == 2) // EQP_HAND_R = 2, it's a weapon
 	{
 		mes "I can try to add a slot now if you have the required items and zeny.";
 		mes "However, you should know that there's a chance that I might fail.";
@@ -277,7 +281,7 @@ function	script	Func_Socket	{
 	switch(select("Attempt Slot Addition:Cancel"))
 	{
 		case 1:
-			if ((Zeny >= getarg(4)*1000) && (countitem(getarg(5)) >= getarg(6)) && (countitem(getarg(7,512)) >= getarg(8,0)) && (countitem(getarg(0)) > 0)) // if there's no getarg(7) and getarg(8) provided, check itemcount against 0 (we still need a valid item ID though)
+			if ((Zeny >= .@zeny_req*1000) && countitem(.@item_req[0]) >= .@req_amount[0] && countitem(getarg(7,512)) >= .@req_amount[1] && countitem(.@item_id) > 0)// if there's no getarg(7) and getarg(8) provided, check itemcount against 0 (we still need a valid item ID though)
 			{
 				mes "[Seiyablem]";
 				mes "Alright then, let the work begin!";
@@ -290,11 +294,11 @@ function	script	Func_Socket	{
 					mes "[Seiyablem]";
 					mes "Great, it seems to be successful.";
 					mes "It looks pretty well done. Congratulations!";
-					delitem getarg(0),1;
-					delitem getarg(5),getarg(6);
-					if (getarg(7,0) != 0 && getarg(8,0) != 0)
-						delitem getarg(7),getarg(8);
-					set Zeny, Zeny - getarg(4)*1000;
+					delitem .@item_id,1;
+					delitem .@item_req[0],.@req_amount[0];
+					if (.@item_req[1] != 0 && .@req_amount[1] != 0)
+						delitem .@item_req[1],.@req_amount[1];
+					Zeny = Zeny - .@zeny_req *1000;
 					getitem getarg(1),1;
 					next;
 					mes "[Seiyablem]";
@@ -309,11 +313,11 @@ function	script	Func_Socket	{
 					mes "However, I am completely innocent.";
 					mes "This is your luck, and it is destined by god, okay?";
 					mes "Don't be so disappointed, and try next time.";
-					delitem getarg(0),1;
-					delitem getarg(5),getarg(6);
-					if (getarg(7,0) != 0 && getarg(8,0) != 0)
-						delitem getarg(7),getarg(8);
-					set Zeny, Zeny - getarg(4)*1000;
+					delitem .@item_id,1;
+					delitem .@item_req[0],.@req_amount[0];
+					if (.@item_req[1] != 0 && .@req_amount[1] != 0)
+						delitem .@item_req[1],.@req_amount[1];
+					Zeny = Zeny - .@zeny_req *1000;
 					next;
 					mes "[Seiyablem]";
 					mes "I wish you good luck next time!";

+ 25 - 21
npc/merchants/socket_enchant2.txt

@@ -386,35 +386,39 @@ prt_in,22,60,6	duplicate(SocketEnchant2)	Leablem#prt	86
 moc_ruins,154,86,3	duplicate(SocketEnchant2)	Leablem#moc	86
 
 function	script	Func_Socket2	{
+	.@item_id = getarg(0);
+	.@zeny_req = getarg(4);
+	setarray .@item_req[0], getarg(5), getarg(7,0);
+	setarray .@req_amount[0], getarg(6), getarg(8,0);
 
 	disable_items;
 	mes "[Leablem]";
-	if(getarg(7,0) != 0 && getarg(8,0) != 0)
+	if (.@item_req[1] != 0 && .@req_amount[1] != 0)
 	{
-		mes getitemname(getarg(0)) + "... Okay, then you need to bring me";
-		mes "^FF0000" + (getarg(4) >= 1000 ? (getarg(4)/1000 + ",000") : getarg(4)) + ",000 zeny as service charge,";
-		mes "^FF0000" + getarg(6) + "ea " + getitemname(getarg(5)) + " and " + getarg(8) + "ea " + getitemname(getarg(7)) + ".";
-		mes "^FF0000Of course, you need a " + getitemname(getarg(0)) + ".^000000";
+		mes getitemname(.@item_id) +"... Okay, then you need to bring me";
+		mes "^FF0000"+ (.@zeny_req >= 1000 ? (.@zeny_req /1000 +",000") : .@zeny_req) +",000 zeny as service charge,";
+		mes "^FF0000"+ .@req_amount[0] +"ea "+ getitemname(.@item_req[0]) +" and "+ .@req_amount[1] +"ea "+ getitemname(.@item_req[1]) +".";
+		mes "^FF0000Of course, you need a "+ getitemname(.@item_id) +".^000000";
 	}
 	else
 	{
-		mes getitemname(getarg(0)) + "? Okay, then you need to bring me";
-		mes "^FF0000" + (getarg(4) >= 1000 ? (getarg(4)/1000 + ",000") : getarg(4)) + ",000 zeny as service charge and " + getarg(6) + " " + getitemname(getarg(5)) + (getarg(6) > 1 && getarg(5) != 999 ? "s":"") + " as the requirement.";
-		mes "^FF0000Of course, don't forget to bring me a " + getitemname(getarg(0)) + ".";
+		mes getitemname(.@item_id) +"? Okay, then you need to bring me";
+		mes "^FF0000"+ (.@zeny_req >= 1000 ? (.@zeny_req/1000 +",000") : .@zeny_req) +",000 zeny as service charge and "+ .@req_amount[0] +" "+ getitemname(.@item_req[0]) + (.@req_amount[0] > 1 && .@item_req[0] != 999 ? "s":"") +" as the requirement.";
+		mes "^FF0000Of course, don't forget to bring me a "+ getitemname(.@item_id) +".";
 		mes "^FF0000You should have all items.^000000";
 	}
 	next;
 	mes "[Leablem]";
 	mes "Did you already bring all of them?";
 	mes "For your information, if you fail to create a slot,";
-	mes "you will lose all the item requirement as well as the target " + (getiteminfo(getarg(0),5)&2 ? "weapon" : "armor") + "."; // EQP_HAND_R = 2, it's a weapon, otherwise armor
-	mes "Also remember, if the " + (getiteminfo(getarg(0),5)&2 ? "weapon" : "armor") + " has been upgraded, and has been inserted with a card,";
+	mes "you will lose all the item requirement as well as the target "+ (getiteminfo(.@item_id,5) == 2 ? "weapon" : "armor") +".";// EQP_HAND_R = 2, it's a weapon, otherwise armor
+	mes "Also remember, if the "+ (getiteminfo(.@item_id,5) == 2 ? "weapon" : "armor") +" has been upgraded, and has been inserted with a card,";
 	mes "you will lose them even if you succeed in creating a slot.";
 	next;
 	switch(select("Ask for slot creation.:Try next time."))
 	{
 		case 1:
-			if ((Zeny >= getarg(4)*1000) && (countitem(getarg(5)) >= getarg(6)) && (countitem(getarg(7,512)) >= getarg(8,0)) && (countitem(getarg(0)) > 0)) // if there's no getarg(7) and getarg(8) provided, check itemcount against 0 (we still need a valid item ID though)
+			if ((Zeny >= .@zeny_req*1000) && countitem(.@item_req[0]) >= .@req_amount[0] && countitem(getarg(7,512)) >= .@req_amount[1] && countitem(.@item_id) > 0)// if there's no .@req_amount[0] and .@req_amount[1] provided, check itemcount against 0 (we still need a valid item ID though)
 			{
 				mes "[Leablem]";
 				mes "Alright then, let the work begin!";
@@ -427,11 +431,11 @@ function	script	Func_Socket2	{
 					mes "[Leablem]";
 					mes "Great, it seems to be successful.";
 					mes "It looks pretty well done. Congratulations!";
-					delitem getarg(0),1;
-					delitem getarg(5),getarg(6);
-					if (getarg(7,0) != 0 && getarg(8,0) != 0)
-						delitem getarg(7),getarg(8);
-					set Zeny, Zeny - getarg(4)*1000;
+					delitem .@item_id,1;
+					delitem .@item_req[0],.@req_amount[0];
+					if (.@item_req[1] != 0 && .@req_amount[1] != 0)
+						delitem .@item_req[1],.@req_amount[1];
+					Zeny = Zeny - .@zeny_req *1000;
 					getitem getarg(1),1;
 					next;
 					mes "[Leablem]";
@@ -447,11 +451,11 @@ function	script	Func_Socket2	{
 					mes "This is your luck, and it is destined by god, okay?";
 					mes "Don't be so disappointed,";
 					mes "and try next time.";
-					delitem getarg(0),1;
-					delitem getarg(5),getarg(6);
-					if (getarg(7,0) != 0 && getarg(8,0) != 0)
-						delitem getarg(7),getarg(8);
-					set Zeny, Zeny - getarg(4)*1000;
+					delitem .@item_id,1;
+					delitem .@item_req[0],.@req_amount[0];
+					if (.@item_req[1] != 0 && .@req_amount[1] != 0)
+						delitem .@item_req[1],.@req_amount[1];
+					Zeny = Zeny - .@zeny_req *1000;
 					next;
 					mes "[Leablem]";
 					mes "See you again, buddy!";

+ 7 - 5
npc/other/arena/arena_point.txt

@@ -155,13 +155,15 @@ S_ExchangePoints:
 		mes "Thank you for your patronage.";
 		close;
 	}
-	if (tt_point >= getarg(1)) {
+	.@track_point = getarg(1);
+	if (tt_point >= .@track_point) {
+		.@arena_point = getarg(2);
 		mes "[Arena Point Manager]";
 		mes "" + strcharinfo(0) + ",";
-		mes "you've converted "+getarg(1)+" Track";
-		mes "Points into "+getarg(2)+" Arena Point.";
-		set tt_point,tt_point-getarg(1);
-		set arena_point,arena_point+getarg(2);
+		mes "you've converted "+ .@track_point +" Track";
+		mes "Points into "+ .@arena_point +" Arena Point.";
+		tt_point = tt_point - .@track_point;
+		arena_point = arena_point + .@arena_point;
 		next;
 		mes "[Arena Point Manager]";
 		mes "" + strcharinfo(0) + ",";

+ 9 - 5
npc/other/arena/arena_room.txt

@@ -989,9 +989,13 @@ sec_in02,76,176,5	script	Live Broadcast#arena	802,{
 }
 
 function	script	Func_Are_Rew	{
+	.@item_id = getarg(0);
+	.@amount = getarg(1);
+	.@arena_point = getarg(2);
+
 	mes "[Givu]";
-	mes "Would you like to exchange your arena points with "+getitemname(getarg(0))+"?";
-	mes "You can exchange ^3131FF"+getarg(2)+" arena points with "+getarg(1)+" "+getitemname(getarg(0))+"^000000.";
+	mes "Would you like to exchange your arena points with "+ getitemname(.@item_id) +"?";
+	mes "You can exchange ^3131FF"+ .@arena_point +" arena points with "+ .@amount +" "+ getitemname(.@item_id) +"^000000.";
 	mes "If you wish to cancel, please enter 0. If you don't, please enter how many ^3131FFtimes^000000 of arena points you wish to spend.";
 	next;
 	input .@reward;
@@ -1004,14 +1008,14 @@ function	script	Func_Are_Rew	{
 		mes "You have exceeded the maximum capacity.";
 		close;
 	}
-	if (arena_point < .@reward * getarg(2)) {
+	if (arena_point < .@reward * .@arena_point) {
 		mes "[Givu]";
 		mes "You do not have enough arena points.";
 		mes "Please check the total amount of arena points you have.";
 		close;
 	}
-	set arena_point, arena_point - (.@reward * getarg(2));
-	getitem getarg(0),.@reward * getarg(1);
+	arena_point = arena_point - (.@reward * .@arena_point);
+	getitem .@item_id,.@reward * .@amount;
 	mes "[Givu]";
 	mes "Thank you, please come again.";
 	close;

+ 3 - 2
npc/other/auction.txt

@@ -41,7 +41,8 @@ function	script	F_AuctionWarper	{
 	mes "Auction Hall?";
 	next;
 	if (select("Yes:No") == 1) {
-		if (getarg(0) == 1 || getarg(0) == 4) {
+		.@num = getarg(0);
+		if (.@num == 1 || .@num == 4) {
 			mes "[Auction Hall Guide]";
 			mes "Great! Well then,";
 			mes "I hope you have fun";
@@ -51,7 +52,7 @@ function	script	F_AuctionWarper	{
 			mes "Enjoy your auction.";
 		}
 		close2;
-		switch(getarg(0)) {
+		switch(.@num) {
 		case 1:
 			warp "auction_01",179,53; end;
 		case 2:

+ 7 - 6
npc/other/hugel_bingo.txt

@@ -860,12 +860,13 @@ function	script	Func_Bingo	{
 }
 
 function	script	Func_BingoResult	{
-	mapannounce "que_bingo","Eukran: The "+callfunc("F_GetNumSuffix",getarg(0))+" number is "+$bingo[getarg(0) - 1]+". Please check your Bingo Plate.",4,0xFFAB54;
-	enablenpc getarg(0)+"a#bingo";
-	enablenpc getarg(0)+"b#bingo";
-	enablenpc getarg(0)+"c#bingo";
-	enablenpc getarg(0)+"d#bingo";
-	enablenpc getarg(0)+"e#bingo";
+	.@num = getarg(0);
+	mapannounce "que_bingo","Eukran: The "+ callfunc("F_GetNumSuffix",.@num) +" number is "+ $bingo[.@num - 1] +". Please check your Bingo Plate.",4,0xFFAB54;
+	enablenpc .@num +"a#bingo";
+	enablenpc .@num +"b#bingo";
+	enablenpc .@num +"c#bingo";
+	enablenpc .@num +"d#bingo";
+	enablenpc .@num +"e#bingo";
 	set $@bingoresult, $@bingoresult + 1;
 	end;
 }

+ 3 - 2
npc/other/pvp.txt

@@ -286,9 +286,10 @@ payon_in01,140,53,4	duplicate(gkut)	Gate Keeper#gke5	83
 //callfunc "F_PVP_FSRS"{,<min_lvl>,<max_lvl>};
 function	script	F_PVP_FSRS	{
 	if (getargcount()) {
-		if (BaseLevel < getarg(0) || BaseLevel > getarg(1)) {
+		setarray .@lvl[0], getarg(0), getarg(1);
+		if (BaseLevel < .@lvl[0] || BaseLevel > .@lvl[1]) {
 			mes "[PVP Fight Square Reception Staff]";
-			mes "Sorry, but you base level has to be between LV "+getarg(0)+" and LV "+getarg(1)+".";
+			mes "Sorry, but you base level has to be between LV "+ .@lvl[0] +" and LV "+ .@lvl[1] +".";
 			close;
 		}
 	}

+ 4 - 2
npc/other/turbo_track.txt

@@ -400,7 +400,8 @@ OnInit:
 	end;
 	
 	function	RName	{
-		set .@s,(getstrlen(getarg(0)) > 2)?(substr(getarg(0),1,2)):(charat(getarg(0),getstrlen(getarg(0))-1));
+		.@string$ = getarg(0);
+		.@s = ( getstrlen(.@string$) > 2 ? substr(.@string$,1,2) : charat(.@string$,getstrlen(.@string$)-1) );
 		set .@rn$,((compare(strnpcinfo(4),"_e_"+.@s))?"Expert mode":"Normal mode")+" - "+.@s+" person";
 		return .@rn$;
 	}
@@ -2529,7 +2530,8 @@ OnTimer71000:
 	end;
 	
 	function	RName	{
-		set .@s,(getstrlen(getarg(0)) > 2)?(substr(getarg(0),1,2)):(charat(getarg(0),getstrlen(getarg(0))-1));
+		.@string$ = getarg(0);
+		.@s = ( getstrlen(.@string$) > 2 ? substr(.@string$,1,2) : charat(.@string$,getstrlen(.@string$)-1) );
 		set .@rn$,((compare(strnpcinfo(4),"_e_"+.@s))?"Expert mode":"Normal mode")+" - "+.@s+" person";
 		return .@rn$;
 	}

+ 5 - 4
npc/quests/bard_quest.txt

@@ -1117,8 +1117,9 @@ S_StorySong:
 		goto L_End;
 
 	case 2:
+		.@num = getarg(0);
 		mes "[Errende]";
-		if(getarg(0) < 3)
+		if (.@num < 3)
 			mes "You recognize my talent, so you deserve to listen to my songs! Now, what would you like to hear? I can play anything you want, you know.";
 		else
 			mes "At last, I've met someone who recognizes my talent! You deserve to listen to my songs! Now, what would you like to hear? I can play anything you want, you know.";
@@ -1160,7 +1161,7 @@ S_StorySong:
 			mes "Okay, here we go~";
 			next;
 			//for 3 and 4 variants, we need higher chance
-			if(getarg(0) == 3 || getarg(0) == 4)
+			if (.@num == 3 || .@num == 4)
 				set .@random,rand(1,5);
 			else
 				set .@random,rand(1,3);
@@ -1200,7 +1201,7 @@ S_StorySong:
 				mes "and your spirit will be";
 				mes "led to Valhalla.^000000";
 				//Expanded version for 2nd variant
-				if(getarg(0) == 2){
+				if (.@num == 2){
 					next;
 					mes "[Errende]";
 					mes "...";
@@ -1251,7 +1252,7 @@ S_StorySong:
 
 			} else {
 				// For 3 and 4 cases we set more chance earlier on .@random
-				if(getarg(0) == 3 || getarg(0) == 4){
+				if (.@num == 3 || .@num == 4){
 					mes "[Errende]";
 					if (Sex)
 						mes "Heroic warrior,";

+ 10 - 9
npc/quests/cooking_quest.txt

@@ -2061,10 +2061,11 @@ prt_castle,45,35,5	script	Madeleine Chu#cook	886,{
 	close;
 
 S_SellSets:
-	set .@item_cost,getiteminfo(getarg(0),0);
-	set .@item_weight,getiteminfo(getarg(0),6);
+	.@item_id = getarg(0);
+	.@item_cost = getiteminfo(.@item_id,0);
+	.@item_weight = getiteminfo(.@item_id,6);
 	mes "[Madeleine Chu]";
-	mes "How many " + (getarg(0)==12125 ? "Outdoor":"Indoor");
+	mes "How many "+ (.@item_id == 12125 ? "Outdoor":"Indoor");
 	mes "Cooking Kits would";
 	mes "you like to buy? If you";
 	mes "want to cancel, please";
@@ -2076,7 +2077,7 @@ S_SellSets:
 			mes "[Madeleine Chu]";
 			mes "You've changed your";
 			mes "mind? Well, if you need";
-			mes "to buy "+getitemname(getarg(0));
+			mes "to buy "+ getitemname(.@item_id);
 			mes "Kits later, just come back";
 			mes "to me at anytime, alright?";
 			close;
@@ -2085,7 +2086,7 @@ S_SellSets:
 			mes "[Madeleine Chu]";
 			mes "Oh, I'm sorry, but";
 			mes "I don't sell more than";
-			mes "100 "+getitemname(getarg(0));
+			mes "100 "+ getitemname(.@item_id);
 			mes "at a time, just to be safe.";
 			next;
 		}
@@ -2097,21 +2098,21 @@ S_SellSets:
 		mes "[Madeleine Chu]";
 		mes "Oh, I'm sorry, but you";
 		mes "can't afford this many";
-		mes getitemname(getarg(0));
+		mes getitemname(.@item_id);
 		mes "Please check your zeny";
 		mes "before purchasing my kits~";
 		close;
 	}
-	if (!checkweight(getarg(0),.@sell)) {
+	if (!checkweight(.@item_id,.@sell)) {
 		mes "[Madeleine Chu]";
 		mes "I'm sorry, but you don't";
 		mes "have enough room in your";
 		mes "Inventory for this many";
-		mes getitemname(getarg(0))+"...";
+		mes getitemname(.@item_id) +"...";
 		close;
 	}
 	set Zeny, Zeny-.@total_cost;
-	getitem getarg(0),.@sell;
+	getitem .@item_id,.@sell;
 	mes "[Madeleine Chu]";
 	mes "Here you are~";
 	mes "Best of luck with";

+ 4 - 3
npc/quests/doomed_swords_quest.txt

@@ -1055,15 +1055,16 @@ S_GetSword:
 		mes "space available. Then, we can finally claim your doomed sword.";
 		close;
 	}
+	.@num = getarg(1);
 	mes "[Huey]";
-	if (getarg(1) == 0) {
+	if (.@num == 0) {
 		mes "Th-that's the Grimtooth!";
 		mes "Ever since I've been taught";
 		mes "the pentagram techniques by";
 		mes "those Dwarves, I've never once";
 		mes "imagined that I'd see that sword. Please use that weapon wisely.";
 	}
-	else if (getarg(1) == 1) {
+	else if (.@num == 1) {
 		mes "I don't believe it!";
 		mes "You... You've been found";
 		mes "worthy of the Mysteltainn?";
@@ -1071,7 +1072,7 @@ S_GetSword:
 		mes "its power overwhelm you.";
 		mes "Wield it only for just ends...";
 	}
-	else if (getarg(1) == 2) {
+	else if (.@num == 2) {
 		mes "Th-that's...!";
 		mes "The Executionier has";
 		mes "chosen you to wield it?";

+ 6 - 5
npc/quests/newgears/2006_headgears.txt

@@ -761,9 +761,10 @@ payon,135,320,3	script	Chungwolmang	97,{
 	close;
 
 S_MakeMask:
+	.@item_id = getarg(0);
 	mes "[Chungwolmang]";
 	mes "Oh, you have brought everything";
-	mes "to make a "+getitemname(getarg(0))+". Excellent.";
+	mes "to make a "+ getitemname(.@item_id) +". Excellent.";
 	mes "Please give me the materials. I will make the mask right away.";
 	next;
 	if (select("Give him the items.:Don't give him the items.") == 1) {
@@ -786,14 +787,14 @@ S_MakeMask:
 		delitem getarg(1),getarg(2);
 		delitem getarg(3),getarg(4);
 		delitem getarg(5),getarg(6);
-		if (getarg(0) == 5169) 
+		if (.@item_id == 5169) 
 			delitem getarg(7),getarg(8);
-		getitem getarg(0),1;
+		getitem .@item_id,1;
 		set moza_tal,0;
 		mes "[Chungwolmang]";
 		mes "Wow, it was a piece of cake!";
 		mes "You know, I am not an artisan only in title.";
-		mes "Hahaha, here, take your "+getitemname(getarg(0))+".";
+		mes "Hahaha, here, take your "+ getitemname(.@item_id) +".";
 		mes "I hope that you will wear it with pride, hahaha!";
 		next;
 		mes "[Chungwolmang]";
@@ -802,7 +803,7 @@ S_MakeMask:
 		close;
 	}
 	mes "[Chungwolmang]";
-	mes "Err? Don't you want "+getitemname(getarg(0))+"?";
+	mes "Err? Don't you want "+ getitemname(.@item_id) +"?";
 	mes "Alright then...coward.";
 	close;
 }

+ 11 - 9
npc/quests/quests_13_2.txt

@@ -4470,16 +4470,18 @@ mid_camp,147,256,3	script	Rune Midgarts Magician#1	735,{
 }
 
 function	script	jewel_13_2	{
+	.@color$ = getarg(0);
 	if (ep13_2_rhea < 5) {
 		mes "- Under a round pile of earth, -";
-		mes "- there's a "+getarg(0)+" Gem -";
+		mes "- there's a "+ .@color$ +" Gem -";
 		mes "- half-buried. -";
 		close;
 	}
 	else if (ep13_2_rhea == 5) {
-		if (checkquest(8240+getarg(1)) == -1) {
+		.@num = getarg(1);
+		if (checkquest(8240+.@num) == -1) {
 			mes "- Under a round pile of earth, -";
-			mes "- there's a "+getarg(0)+" Gem -";
+			mes "- there's a "+ .@color$ +" Gem -";
 			mes "- half-buried. -";
 			next;
 			if(select("Dig out the Gem:Leave it alone")==2) {
@@ -4492,15 +4494,15 @@ function	script	jewel_13_2	{
 			}
 			if (rand(1,4) == 2) {
 				mes "- You dug up a pile of earth -";
-				mes "- and pulled out the "+getarg(0)+" Gem -";
-				setquest 8240+getarg(1);
-				getitem 7574+getarg(1),1;
+				mes "- and pulled out the "+ .@color$ +" Gem -";
+				setquest 8240+.@num;
+				getitem 7574+.@num,1;
 				close;
 			}
 			else {
 				mes "- As you dug up a pile of earth, -";
 				mes "- a Thief Bug attacks you! -";
-				donpcevent "Half-buried Gem#"+getarg(1)+"::OnDisable";
+				donpcevent "Half-buried Gem#"+ .@num +"::OnDisable";
 				next;
 				mes "["+ strcharinfo(0) +"]";
 				mes "What the heck is this?!?!?!";
@@ -4509,13 +4511,13 @@ function	script	jewel_13_2	{
 		}
 		else {
 			mes "- Small pile of earth -";
-			mes "- which you dug up the "+getarg(0)+" Gem -";
+			mes "- which you dug up the "+ .@color$ +" Gem -";
 			close;
 		}
 	}
 	else {
 		mes "- Small pile of earth -";
-		mes "- which you dug up the "+getarg(0)+" Gem -";
+		mes "- which you dug up the "+ .@color$ +" Gem -";
 		close;
 	}
 	end;

+ 35 - 34
npc/quests/quests_juperos.txt

@@ -554,6 +554,7 @@ yuno_in04,190,125,4	script	Scholar	700,{
 }
 
 function	script	Func_JupHist	{
+	setarray .@arg[0], getarg(0), getarg(1), getarg(2), getarg(3);
 	switch(yuno_hist) {
 	case 4:
 		mes "[Fayruz]";
@@ -577,9 +578,9 @@ function	script	Func_JupHist	{
 		mes "tale eventually comes to an end";
 		mes "and you awaken from the trance,";
 		mes "gently brought back to reality.^000000";
-		delitem getarg(0),1;
+		delitem .@arg[0],1;
 		set yuno_hist,5;
-		set jupe_hist,getarg(1);
+		jupe_hist = .@arg[1];
 		getexp (checkre(3))?10000:100000,0;
 		next;
 		mes "[Fayruz]";
@@ -598,7 +599,7 @@ function	script	Func_JupHist	{
 		mes "then, I'll see you, adventurer~";
 		close;
 	case 5:
-		if ((countitem(getarg(0))) || (countitem(getarg(1))) || (countitem(getarg(2)))) {
+		if (countitem(.@arg[0]) || countitem(.@arg[1]) || countitem(.@arg[2])) {
 			mes "[Fayruz]";
 			mes "Oh, that's unexpected.";
 			mes "This Transparent Plate";
@@ -640,19 +641,19 @@ function	script	Func_JupHist	{
 			mes "I think you'd agree that";
 			mes "it contains a truth about";
 			mes "mankind that can't be ignored.";
-			if (countitem(getarg(0))) {
-				delitem getarg(0),1;
-				if (getarg(0) == 7352) set jupe_hist,jupe_hist +1;
+			if (countitem(.@arg[0])) {
+				delitem .@arg[0],1;
+				if (.@arg[0] == 7352) set jupe_hist,jupe_hist +1;
 				else set jupe_hist,jupe_hist +2;
 			}
-			else if (countitem(getarg(1))) {
-				delitem getarg(1),1;
-				if (getarg(1) == 7353) set jupe_hist,jupe_hist +2;
+			else if (countitem(.@arg[1])) {
+				delitem .@arg[1],1;
+				if (.@arg[1] == 7353) set jupe_hist,jupe_hist +2;
 				else set jupe_hist,jupe_hist +4;
 			}
 			else {
-				delitem getarg(2),1;
-				if (getarg(2) == 7354) set jupe_hist,jupe_hist +4;
+				delitem .@arg[2],1;
+				if (.@arg[2] == 7354) set jupe_hist,jupe_hist +4;
 				else set jupe_hist,jupe_hist +8;
 			}
 			set yuno_hist,6;
@@ -674,7 +675,7 @@ function	script	Func_JupHist	{
 			mes "story with you, "+strcharinfo(0)+".";
 			close;
 		}
-		else if (countitem(getarg(3))) {
+		else if (countitem(.@arg[3])) {
 			mes "[Fayruz]";
 			mes "Oh, this one seems";
 			mes "to have been created";
@@ -689,7 +690,7 @@ function	script	Func_JupHist	{
 			mes "won't be as making progress";
 			mes "as quickly as I had projected.";
 			mes "Please, I'd like you to take this as a token of my gratitude.";
-			delitem getarg(3),1;
+			delitem .@arg[3],1;
 			getitem 644,1;
 			next;
 			mes "[Fayruz]";
@@ -710,7 +711,7 @@ function	script	Func_JupHist	{
 			close;
 		}
 	case 7:
-		if ((countitem(getarg(0))) || (countitem(getarg(1)))) {
+		if (countitem(.@arg[0]) || countitem(.@arg[1])) {
 			mes "[Fayruz]";
 			mes "Is this another";
 			mes "Transparent Plate?";
@@ -767,16 +768,16 @@ function	script	Func_JupHist	{
 			mes "or another. Scary stories are";
 			mes "appealing because we actually";
 			mes "like the strange and grotesque.";
-			if (countitem(getarg(0))) {
-				delitem getarg(0),1;
-				if (getarg(0) == 7352) set jupe_hist,jupe_hist +1;
-				else if (getarg(0) == 7353) set jupe_hist,jupe_hist +2;
+			if (countitem(.@arg[0])) {
+				delitem .@arg[0],1;
+				if (.@arg[0] == 7352) set jupe_hist,jupe_hist +1;
+				else if (.@arg[0] == 7353) set jupe_hist,jupe_hist +2;
 				else set jupe_hist,jupe_hist +4;
 			}
-			else if (countitem(getarg(1))) {
-				delitem getarg(1),1;
-				if (getarg(1) == 7353) set jupe_hist,jupe_hist +2;
-				else if (getarg(1) == 7354) set jupe_hist,jupe_hist +4;
+			else if (countitem(.@arg[1])) {
+				delitem .@arg[1],1;
+				if (.@arg[1] == 7353) set jupe_hist,jupe_hist +2;
+				else if (.@arg[1] == 7354) set jupe_hist,jupe_hist +4;
 				else set jupe_hist,jupe_hist +8;
 			}
 			set yuno_hist,8;
@@ -791,7 +792,7 @@ function	script	Func_JupHist	{
 			mes "to me, alright? See you later~";
 			close;
 		}
-		else if ((countitem(getarg(2))) || (countitem(getarg(3)))) {
+		else if (countitem(.@arg[2]) || countitem(.@arg[3])) {
 			mes "[Fayruz]";
 			mes "Oh, this one seems";
 			mes "to have been created";
@@ -813,8 +814,8 @@ function	script	Func_JupHist	{
 			mes "to compiling my research...";
 			mes "Thank you so much for";
 			mes "your help, "+strcharinfo(0)+".";
-			if (countitem(getarg(2))) delitem getarg(2),1;
-			else if (countitem(getarg(3))) delitem getarg(3),1;
+			if (countitem(.@arg[2])) delitem .@arg[2],1;
+			else if (countitem(.@arg[3])) delitem .@arg[3],1;
 			getitem 644,1;
 			close;
 		}
@@ -828,7 +829,7 @@ function	script	Func_JupHist	{
 			close;
 		}
 	case 9:
-		if (countitem(getarg(0))) {
+		if (countitem(.@arg[0])) {
 			mes "[Fayruz]";
 			mes "Oooh...! This one is";
 			mes "much different than the";
@@ -871,12 +872,12 @@ function	script	Func_JupHist	{
 			mes "feeling of indefatigable";
 			mes "hope and inspiration...";
 			mes "You can make it if you try!^000000";
-			if (getarg(0) == 7352) set jupe_hist,jupe_hist+1;
-			else if (getarg(0) == 7353) set jupe_hist,jupe_hist+2;
-			else if (getarg(0) == 7354) set jupe_hist,jupe_hist+4;
+			if (.@arg[0] == 7352) set jupe_hist,jupe_hist+1;
+			else if (.@arg[0] == 7353) set jupe_hist,jupe_hist+2;
+			else if (.@arg[0] == 7354) set jupe_hist,jupe_hist+4;
 			else set jupe_hist,jupe_hist+8;
 			set yuno_hist,10;
-			delitem getarg(0),1;
+			delitem .@arg[0],1;
 			getexp (checkre(3))?10000:100000,0;
 			next;
 			mes "[Fayruz]";
@@ -888,7 +889,7 @@ function	script	Func_JupHist	{
 			mes "research progress~";
 			close;
 		}
-		else if ((countitem(getarg(1))) || (countitem(getarg(2))) || (countitem(getarg(3)))) {
+		else if (countitem(.@arg[1]) || countitem(.@arg[2]) || countitem(.@arg[3])) {
 			mes "[Fayruz]";
 			mes "Hmm...";
 			mes "This one seems to be created in a similar time";
@@ -906,9 +907,9 @@ function	script	Func_JupHist	{
 			next;
 			mes "[Fayruz]";
 			mes "Now, excuse me. I need to go back to my research.";
-			if (countitem(getarg(1))) delitem getarg(1),1;
-			else if (countitem(getarg(2))) delitem getarg(2),1;
-			else delitem getarg(3),1;
+			if (countitem(.@arg[1])) delitem .@arg[1],1;
+			else if (countitem(.@arg[2])) delitem .@arg[2],1;
+			else delitem .@arg[3],1;
 			getitem 644,1;
 			close;
 		}

+ 12 - 9
npc/quests/quests_moscovia.txt

@@ -1127,18 +1127,21 @@ mosk_ship,101,111,4	script	rudder#ship	HIDDEN_NPC,{
 	end;
 
 S_Rud1:
+	.@direction = getarg(0);
+	.@monster_setting = getarg(1);
+
 	mes "Which way?";
 	next;
 	setarray .@d$[1],"East","West","South","North";
 	.@j = select(implode(.@d$,":")) -1;
-	if (.@j == getarg(0)) {
+	if (.@j == .@direction) {
 		mes "[Mr. Ibanoff]";
 		mes "Good. Firstly, we should";
-		mes "keep heading "+strtolower(.@d$[getarg(0)])+" this way.";
+		mes "keep heading "+ strtolower(.@d$[.@direction]) +" this way.";
 		mes "When I give the order,";
 		mes "please adjust the rudder again.";
-		if (getarg(1) == 2) .@r = rand(1,4);
-		if (getarg(1) == 2 && .@r == 3) {
+		if (.@monster_setting == 2) .@r = rand(1,4);
+		if (.@monster_setting == 2 && .@r == 3) {
 			next;
 			mes "[Mr. Ibanoff]";
 			mes "Wait! Something has appeared in front of us...";
@@ -1156,15 +1159,15 @@ S_Rud1:
 			else
 				donpcevent "Baehideun3#ship::OnEnable";
 		}
-		mos_whale_edq = (getarg(1) == 2)?((mos_whale_edq >= 241)?((.@r != 3)?26:25):((.@r != 3)?10:11)):(mos_whale_edq + 1);
+		mos_whale_edq = (.@monster_setting == 2)?((mos_whale_edq >= 241)?((.@r != 3)?26:25):((.@r != 3)?10:11)):(mos_whale_edq + 1);
 		close;
 	}
 	mes "[Mr. Ibanoff]";
-	mes "I said that we should go "+.@d$[getarg(0)]+"!";
+	mes "I said that we should go "+ .@d$[.@direction] +"!";
 	mes "You should sail in the right";
-	mes "direction! To the "+strtolower(.@d$[getarg(0)])+"!";
-	if (getarg(1) >= 1) {
-		.@r = (getarg(1) == 1)?5:4;
+	mes "direction! To the "+ strtolower(.@d$[.@direction]) +"!";
+	if (.@monster_setting >= 1) {
+		.@r = (.@monster_setting == 1)?5:4;
 		if (rand(1,.@r) <= 2) {
 			next;
 			mes "[Mr. Ibanoff]";

+ 8 - 7
npc/quests/quests_rachel.txt

@@ -4155,13 +4155,14 @@ L_End:
 	end;
 
 S_Donate:
+	.@num = getarg(0);
 	cutin "ra_nemma01",2;
 	mes "[Priestess Nemma]";
 	mes "So, " + strcharinfo(0) + "...";
 	mes "I just want to make sure:";
 	mes "You want to donate "+getarg(1);
-	mes "zeny, and receive "+getarg(0)+" Lottery";
-	if(getarg(0) == 1) mes "Ticket. Is that correct?";
+	mes "zeny, and receive "+ .@num +" Lottery";
+	if (.@num == 1) mes "Ticket. Is that correct?";
 	else mes "Tickets. Is that correct?";
 	next;
 	if (select("No:Yes") == 1) {
@@ -4174,8 +4175,8 @@ S_Donate:
 		mes "generous and rewards the patient!";
 		return;
 	}
-	if (Zeny >= getarg(0)*50000) {
-		if (!checkweight(7570,getarg(0))) {
+	if (Zeny >= .@num*50000) {
+		if (!checkweight(7570,.@num)) {
 			cutin "ra_nemma02",2;
 			mes "[Priestess Nemma]";
 			mes "I can scarcely believe it...";
@@ -4194,9 +4195,9 @@ S_Donate:
 			mes "donate if you can, okay?";
 			return;
 		}
-		set $rachel_donate,$rachel_donate+getarg(0);
-		getitem 7570,getarg(0); //Temple_Lottery_Ticket
-		set Zeny, Zeny-getarg(0)*50000;
+		$rachel_donate = $rachel_donate + .@num;
+		getitem 7570,.@num;// Temple_Lottery_Ticket
+		Zeny = Zeny - .@num *50000;
 		set ra_have_donated,1;
 		if ($rachel_donate > 9999) {
 			cutin "ra_nemma03",2;

+ 19 - 18
npc/quests/the_sign_quest.txt

@@ -11967,42 +11967,43 @@ function	script	F_SignSeal	{
 		mes "more powerful to break the seal...^000000";
 		close;
 	}
+	.@r = getarg(0);
 	if (countitem(1558) || countitem(1963)) {
-		if (getarg(0) < 980) F_SealFail; }
+		if (.@r < 980) F_SealFail; }
 	else if (countitem(1227) || countitem(1228) || countitem(1240) || countitem(1241) || countitem(1962) || countitem(1813)) {
-		if (getarg(0) < 960) F_SealFail; }
+		if (.@r < 960) F_SealFail; }
 	else if (countitem(1719) || countitem(1130) || countitem(1133) || countitem(1223) || countitem(1229) || countitem(1231) || countitem(1413) || countitem(1814) || countitem(1242)) {
-		if (getarg(0) < 940) F_SealFail; }
+		if (.@r < 940) F_SealFail; }
 	else if (countitem(1131) || countitem(1230) || countitem(1232)) {
-		if (getarg(0) < 920) F_SealFail; }
+		if (.@r < 920) F_SealFail; }
 	else if (countitem(1132) || countitem(1134) || countitem(1233) || countitem(1234) || countitem(1235) || countitem(1414) || countitem(1523) || countitem(1236)) {
-		if (getarg(0) < 900) F_SealFail; }
+		if (.@r < 900) F_SealFail; }
 	else if (countitem(1237) || countitem(1524) || countitem(1525) || countitem(1557) || countitem(1415) || countitem(1964)) {
-		if (getarg(0) < 880) F_SealFail; }
+		if (.@r < 880) F_SealFail; }
 	else if (countitem(1135) || countitem(1140) || countitem(1141) || countitem(1527)) {
-		if (getarg(0) < 860) F_SealFail; }
+		if (.@r < 860) F_SealFail; }
 	else if (countitem(1164) || countitem(1165) || countitem(1467) || countitem(1138) || countitem(1139) || countitem(1224) || countitem(1225) || countitem(1416) || countitem(1526)) {
-		if (getarg(0) < 840) F_SealFail; }
+		if (.@r < 840) F_SealFail; }
 	else if (countitem(1305) || countitem(1720) || countitem(1136) || countitem(1137) || countitem(1166)) {
-		if (getarg(0) < 820) F_SealFail; }
+		if (.@r < 820) F_SealFail; }
 	else if (countitem(1261) || countitem(1528) || countitem(1167)) {
-		if (getarg(0) < 800) F_SealFail; }
+		if (.@r < 800) F_SealFail; }
 	else if (countitem(1364) || countitem(1913)) {
-		if (getarg(0) < 780) F_SealFail; }
+		if (.@r < 780) F_SealFail; }
 	else if (countitem(1170) || countitem(1468) || countitem(1168) || countitem(1169)) {
-		if (getarg(0) < 760) F_SealFail; }
+		if (.@r < 760) F_SealFail; }
 	else if (countitem(1365) || countitem(1366) || countitem(1473)) {
-		if (getarg(0) < 740) F_SealFail; }
+		if (.@r < 740) F_SealFail; }
 	else if (countitem(1367) || countitem(1368) || countitem(1466) || countitem(1469)) {
-		if (getarg(0) < 720) F_SealFail; }
+		if (.@r < 720) F_SealFail; }
 	else if (countitem(1369) || countitem(1470)) {
-		if (getarg(0) < 700) F_SealFail; }
+		if (.@r < 700) F_SealFail; }
 	else if (countitem(1722) || countitem(1471)) {
-		if (getarg(0) < 680) F_SealFail; }
+		if (.@r < 680) F_SealFail; }
 	else if (countitem(1363)) {
-		if (getarg(0) < 660) F_SealFail; }
+		if (.@r < 660) F_SealFail; }
 	else if (countitem(1530)) {
-		if (getarg(0) < 500) F_SealFail; }
+		if (.@r < 500) F_SealFail; }
 	else {
 		mes "^3355FFThe weapon you're holding";
 		mes "right now doesn't look like it has any chance of breaking this seal. You'll definitely need something";

+ 16 - 15
npc/re/guild/invest_main.txt

@@ -113,12 +113,13 @@ function	script	F_Invest_Status	{
 
 //callfunc "F_Invest_Abyss","<variable>","<NPC name>"{,"<addon message>"};
 function	script	F_Invest_Abyss	{
+	.@npc_name$ = getarg(1);
 	mes "There are 2 ways to invest, by Zeny or the Investment Certificate given out by the Cat Paw Merchant Guild.";
 	mes "Which way would you like to make your investment?";
 	next;
 	switch(select("Invest with Zeny.:Invest with Investment Certificates.:Cancel")) {
 	case 1:
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "So you've decided to invest in Zeny.";
 		mes "Minimum investment unit is ^4d4dff10,000 Zeny^000000.";
 		mes "You can invest a maximum of 50 units which is ^4d4dff500,000 Zeny^000000.";
@@ -134,35 +135,35 @@ function	script	F_Invest_Abyss	{
 			set .@units,50;
 			break;
 		case 4:
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Please enter the amount you want to invest.";
 			mes "Please choose between 1 to 200.";
 			mes "Please enter 0 to cancel.";
 			next;
 			input .@units;
 			if (.@units < 0 || .@units > 200) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "You've exceeded the amount per investment.";
 				mes "Please try again.";
 				close;
 			} else if (.@units == 0) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "Canceled.";
 				close;
 			} else
 				break;
 		case 5:
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Canceled.";
 			close;
 		}
 		set .@zeny, .@units * 10000;
 		if (Zeny < .@zeny) {
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "You do not have enough money.";
 			close;
 		}
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "You've invested "+callfunc("F_InsertPlural",.@units,"unit")+" "+callfunc("F_InsertComma",.@zeny)+" Zeny"+getarg(2,"")+".";
 		mes "Not much but this is a small gift. You can exchange it with items in Malangdo.";
 		set Zeny, Zeny-.@zeny;
@@ -170,7 +171,7 @@ function	script	F_Invest_Abyss	{
 		getitem 6488,.@units; //Thanks_Invest_Ticket
 		close;
 	case 2:
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "Wow, you've brought Investment Certificates.";
 		mes "How many certificates will you submit?";
 		next;
@@ -182,35 +183,35 @@ function	script	F_Invest_Abyss	{
 			set .@tickets,5;
 			break;
 		case 3:
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Please enter the number of Investment Certificates you want to submit.";
 			mes "Please choose between 1 to 20.";
 			mes "Please enter 0 to cancel.";
 			next;
 			input .@tickets;
 			if (.@tickets < 0 || .@tickets > 20) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "You've exceeded the amount per investment.";
 				mes "Please try again.";
 				close;
 			} else if (.@tickets == 0) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "Canceled.";
 				close;
 			} else
 				break;
 		case 4:
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Canceled.";
 			close;
 		}
 		if (countitem(6489) < .@tickets) {
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Looks like you have fewer Investment Certificates than you want to submit.";
 			close;
 		}
 		set .@units, .@tickets * 10;
-		mes getarg(1);
+		mes .@npc_name$;
 		mes .@tickets+" Investment Certificate"+((.@tickets == 1)?" is":"s are")+" the same as an investment of "+.@units+" units ("+((.@units < 100)?.@units:insertchar(""+.@units,",",1))+"0,000z)"+getarg(2,"")+".";
 		mes "Not much but this is a small gift. You can exchange it with items in Malangdo.";
 		delitem 6489,.@tickets; //Cats_Invest_Certif
@@ -218,7 +219,7 @@ function	script	F_Invest_Abyss	{
 		getitem 6488,.@units; //Thanks_Invest_Ticket
 		close;
 	case 3:
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "Canceled.";
 		close;
 	}

+ 9 - 8
npc/re/jobs/novice/academy.txt

@@ -4475,7 +4475,8 @@ iz_ac01,59,83,3	script	Battle Instructor#08	4_M_NOV_HUNT,{
 	}
 
 L_Quest:
-	if (checkquest(getarg(0),HUNTING) == -1) {
+	.@quest_id = getarg(0);
+	if (checkquest(.@quest_id,HUNTING) == -1) {
 		if (select("Take quest.", "Stop.") == 2) {
 			mes "[Battle Instructor Subino]";
 			mes "You don't seem to be interested.";
@@ -4483,18 +4484,18 @@ L_Quest:
 			close;
 		}
 		mes "[Battle Instructor Subino]";
-		if (getarg(0) == 11342) {
+		if (.@quest_id == 11342) {
 			mes getarg(5)+"s "+getarg(6)+" in ^ff0000West field of Prontera^000000.";
 			mes getarg(5)+"s are difficult to catch for a Novice... But if you gather more Novices, you can do it.";
 			next;
 			mes "[Battle Instructor Subino]";
 		} else
 			mes getarg(5)+" "+getarg(6)+" at the ^ff0000West field of Izlude^000000.";
-		mes getarg(7)+" ^ff0000"+(getarg(0)==11344?"5":"10")+" "+getarg(5)+"s^000000 and bring ^ff0000"+getarg(4)+" "+getarg(8)+"^000000.";
+		mes getarg(7)+" ^ff0000"+(.@quest_id==11344?"5":"10")+" "+getarg(5)+"s^000000 and bring ^ff0000"+getarg(4)+" "+getarg(8)+"^000000.";
 		mes "You can check received quests by pressing ^ff0000Alt + U^000000.";
-		setquest getarg(0);
+		setquest .@quest_id;
 		close;
-	} else if (checkquest(getarg(0),HUNTING) == 1) {
+	} else if (checkquest(.@quest_id,HUNTING) == 1) {
 		if (select("End Conversation", "Give up on the quest.") == 2) {
 			mes "[Battle Instructor Subino]";
 			mes "Will you really give up on the quest?";
@@ -4502,7 +4503,7 @@ L_Quest:
 			if (select("End Conversation", "Give up for sure.") == 2) {
 				mes "[Battle Instructor Subino]";
 				mes "You can challenge the quest as long as you need my help so come to me anytime.";
-				erasequest getarg(0);
+				erasequest .@quest_id;
 			}
 		}
 		close;
@@ -4519,7 +4520,7 @@ L_Quest:
 				if (select("End Conversation", "Yes, give up.") == 2) {
 					mes "[Battle Instructor Subino]";
 					mes "You can challenge the quest as long as you need my help so come to me anytime.";
-					erasequest getarg(0);
+					erasequest .@quest_id;
 				}
 			}
 			close;
@@ -4527,7 +4528,7 @@ L_Quest:
 		mes "[Battle Instructor Subino]";
 		mes "Wow..!!";
 		mes "Well done!!";
-		erasequest getarg(0);
+		erasequest .@quest_id;
 		delitem getarg(3), getarg(4);
 		getexp getarg(1), getarg(2);
 		getitem 7059,1;// Cargo_Free_Ticket

+ 6 - 5
npc/re/merchants/bio4_reward.txt

@@ -360,10 +360,11 @@ lighthalzen,342,291,4	script	Weird old man#Bio4Reward	4_M_EINOLD,{
 	close;
 
 L_Reward:
+	setarray .@amount[0], getarg(1), getarg(2), getarg(3);
 	next;
-	mes ""+getarg(1)+" Will of Warrior, "+getarg(2)+" Thirst for Blood, "+getarg(3)+" Chill of the Dead are needed for the exchange.";
+	mes ""+ .@amount[0] +" Will of Warrior, "+ .@amount[1] +" Thirst for Blood, "+ .@amount[2] +" Chill of the Dead are needed for the exchange.";
 	next;
-	if (countitem(6469) >= getarg(1) && countitem(6470) >= getarg(2) && countitem(6471) >= getarg(3)) {
+	if (countitem(6469) >= .@amount[0] && countitem(6470) >= .@amount[1] && countitem(6471) >= .@amount[2]) {
 		if (select("Don't exchange", "Exchange") == 1) {
 			mes "[Weird old man]";
 			mes "Okay..";
@@ -371,9 +372,9 @@ L_Reward:
 		}
 		emotion e_swt2, "Weird old man#Bio4Reward";
 		progressbar "FF00FF", 2;
-		delitem 6469, getarg(1); //Will_Of_Warrior
-		delitem 6470, getarg(2); //Blood_Thirst
-		delitem 6471, getarg(3); //Goast_Chill
+		delitem 6469, .@amount[0]; //Will_Of_Warrior
+		delitem 6470, .@amount[1]; //Blood_Thirst
+		delitem 6471, .@amount[2]; //Goast_Chill
 		getitem getarg(0), 1;
 		mes "[Weird old man]";
 		mes "There you go. Visit me sometimes and we could talk.";

+ 15 - 14
npc/re/merchants/coin_exchange.txt

@@ -430,9 +430,10 @@ function	script	F_mal_coin	{
 
 // Initial dialogue and checks:
 // -- callfunc "F_mal_coin",0,"[<NPC Name>]",<NPC ID>;
+	.@npc_name$ = getarg(1);
 	if (getarg(0) == 0) {
 		if (getarg(2) != 2 && BaseLevel < 50) {
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Ahaaa~";
 			mes "If you want to buy this stuff,";
 			mes "you can talk to me";
@@ -441,13 +442,13 @@ function	script	F_mal_coin	{
 			mes "for a child~";
 			close;
 		}
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "Nice to meet you~~";
 		mes "I am! YES~~ That's right!";
 		mes "I'm selling special stuff";
 		mes "which you can see only here on Meow Meow Island!";
 		next;
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "How about it? What are you waiting for?";
 		mes "Why don't you take a look at";
 		mes "what kinds of stuff I have?";
@@ -468,29 +469,29 @@ function	script	F_mal_coin	{
 			next;
 			break;
 		}
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "Well then, do you want to take a look at what I have now?";
 		next;
 		switch(select("Yes:No")) {
 		case 1:
 			if (checkweight(1201,1) == 0) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "It seems that there are too many items in your inventory.";
 				mes "Please make space and come back again~";
 				close;
 			}
 			if (MaxWeight - Weight < 2500) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "It seems that you're overweight.";
 				mes "Please reduce your weight and come back again~";
 				close;
 			}
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Well, take a good look at them~~~";
 			next;
 			return;
 		case 2:
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Well, then. I'll see you next time.";
 			mes "Goodbye.";
 			close;
@@ -500,7 +501,7 @@ function	script	F_mal_coin	{
 // Exchange function:
 // -- callfunc "F_mal_coin",1,"[<NPC Name>]","<Display Name>",<Item ID>,<Egrade_Coin>,<Malang_Sp_Can>,<Silvervine>
 	if (getarg(0) == 1) {
-		mes getarg(1);
+		mes .@npc_name$;
 		mes "The price of ^0000FF["+getarg(2)+"]^000000 is";
 		if (getarg(4) && getarg(5)) { // Type 1: Egrade_Coin or Malang_Sp_Can
 			mes getarg(4)+" E Grade Coin or "+getarg(5)+" Malangdo Canned Specialties.";
@@ -516,7 +517,7 @@ function	script	F_mal_coin	{
 			.@menu$ = "Yes.::I don't want to purchase any.";
 		}
 		next;
-		mes getarg(1);
+		mes .@npc_name$;
 		if (.@type == 1) {
 			mes "Would you like to purchase";
 			mes "^0000FF["+getarg(2)+"]^000000 with E Grade Coins?";
@@ -547,23 +548,23 @@ function	script	F_mal_coin	{
 				break;
 			}
 			if (countitem(.@item) < .@amount) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "I'm sorry, you need more "+.@str$+".";
 				close;
 			}
 			if (MaxWeight - Weight < getiteminfo(getarg(3),6)) {
-				mes getarg(1);
+				mes .@npc_name$;
 				mes "Sorry, you've purchased too many.";
 				mes "You need to make more space in your inventory. Please come back later.";
 				close;
 			}
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Thank you.";
 			delitem .@item,.@amount;
 			getitem getarg(3),1;
 			return;
 		case 3:
-			mes getarg(1);
+			mes .@npc_name$;
 			mes "Always be careful";
 			mes "when you purchase items.";
 			close;

+ 12 - 10
npc/re/merchants/enchan_mora.txt

@@ -721,6 +721,8 @@ mora,148,98,3	script	Artifact Researcher#new	521,{
 L_Socket:
 	set .@select, @mora_enchant_select;
 	set .@enchant_type, getarg(0);
+	.@bonus_enchant = getarg(1);
+	.@allowed_slot = getarg(2);
 	set .@part, @mora_equip_part;
 	set .@equip_id, getequipid(.@part);
 	set .@equip_name$, getitemname(.@equip_id);
@@ -731,8 +733,8 @@ L_Socket:
 
 	if (.@select == 1) {
 		// If refine is +9 or higher, unlock bonus enchant type.
-		if (.@equip_refine >= 9 && getarg(1) > 0) {
-			if (.@enchant_type < 1 || .@enchant_type > 11 || getarg(1) > 11) {
+		if (.@equip_refine >= 9 && .@bonus_enchant > 0) {
+			if (.@enchant_type < 1 || .@enchant_type > 11 || .@bonus_enchant > 11) {
 				mes "[Artifact Researcher]";
 				mes "Mm-hmm something is wrong.";
 				close;
@@ -741,26 +743,26 @@ L_Socket:
 			mes "[Artifact Researcher]";
 			mes "It's a considerable reinforcement to the equipment. In this case extended enhancements can be granted. Which stat do you want to enhance?";
 			next;
-			switch(select(.@enchant_type$[.@enchant_type],.@enchant_type$[getarg(1)])) {
+			switch(select(.@enchant_type$[.@enchant_type],.@enchant_type$[.@bonus_enchant])) {
 			case 1:
 				break;
 			case 2:
-				set .@enchant_type, getarg(1);
+				set .@enchant_type, .@bonus_enchant;
 				break;
 			}
 		}
-		if (.@equip_card[3] == 0 && getarg(2) < 4) {
+		if (.@equip_card[3] == 0 && .@allowed_slot < 4) {
 			set .@slot,4;
 			mes "[Artifact Researcher]";
 			mes "Attempting to strengthen the ability further. The previous enforcement won't be affected. Do you want to continue?";
-		} else if (.@equip_card[2] == 0 && getarg(2) < 3) {
+		} else if (.@equip_card[2] == 0 && .@allowed_slot < 3) {
 			set .@slot,3;
 			mes "[Artifact Researcher]";
 			mes "Attempting second enhancement. The previous enforcement won't be affected.";
 			next;
 			mes "[Artifact Researcher]";
 			mes "I may have a chance to fail now with this attempt. Do you wish to continue?";
-		} else if (.@equip_card[1] == 0 && getarg(2) < 2) {
+		} else if (.@equip_card[1] == 0 && .@allowed_slot < 2) {
 			set .@slot,2;
 			mes "[Artifact Researcher]";
 			mes "Let's start the third enhancement. I can give the best stats at this stage but remember, ^990000there is now a chance for the artifact to be destroyed and previous enhancements will be erased^000000. Continue?";
@@ -1085,14 +1087,14 @@ L_Socket:
 		    callfunc("F_IsEquipCardHack", .@part, .@equip_card[0], .@equip_card[1], .@equip_card[2], .@equip_card[3]))
 			close;
 
-		if (.@equip_card[3] == 0 && getarg(2) < 4) {
+		if (.@equip_card[3] == 0 && .@allowed_slot < 4) {
 			set .@equip_card[3],.@enchant;
-		} else if (.@equip_card[2] == 0 && getarg(2) < 3) {
+		} else if (.@equip_card[2] == 0 && .@allowed_slot < 3) {
 			set .@equip_card[2],.@enchant;
 			if (.@enchant == 0) {
 				set .@equip_card[3],0;
 			}
-		} else if (.@equip_card[1] == 0 && getarg(2) < 2) {
+		} else if (.@equip_card[1] == 0 && .@allowed_slot < 2) {
 			set .@equip_card[1],.@enchant;
 			if (.@enchant == 0) {
 				set .@equip_card[2],0;

+ 11 - 9
npc/re/merchants/quivers.txt

@@ -65,21 +65,23 @@ mora,106,117,3	script	Quiver Maker#mora	516,{
 	end;
 
 S_BuyQuiver:
-	if (countitem(getarg(0)) < getarg(1)) {
+	.@item_req = getarg(0);
+	.@req_amount = getarg(1);
+	if (countitem(getarg(0)) < .@req_amount) {
 		mes "[Quiver Maker]";
-		mes "Bring more than "+getarg(1)+" "+getitemname(getarg(0))+" and I'll make you a quiver.";
+		mes "Bring more than "+ .@req_amount +" "+ getitemname(.@item_req) +" and I'll make you a quiver.";
 		close;
 	}
 	mes "[Quiver Maker]";
-	mes "Oh, I see you have "+getitemname(getarg(0))+" in your hand!";
+	mes "Oh, I see you have "+ getitemname(.@item_req) +" in your hand!";
 	mes "Are you interested in using a quiver? It's really convenient!";
-	mes "If you're interested, I can trade "+getarg(1)+" of those arrows for one of these quivers for ^FF3131"+getarg(2)+" zeny^000000.";
+	mes "If you're interested, I can trade "+ .@req_amount +" of those arrows for one of these quivers for ^FF3131"+getarg(2)+" zeny^000000.";
 	next;
 	switch(select("Trade all the arrows you have:Get only one quiver:Don't trade")) {
 	case 1:
-		set .@arrows, countitem(getarg(0));
-		set .@quiver, .@arrows / getarg(1);
-		set .@arrows_used, .@quiver * getarg(1);
+		set .@arrows, countitem(.@item_req);
+		set .@quiver, .@arrows / .@req_amount;
+		set .@arrows_used, .@quiver * .@req_amount;
 		set .@arrow_zeny01, .@quiver * getarg(2);
 		mes "The number of arrows you have : ^3131FF"+.@arrows+"^000000";
 		mes "The number of quivers available : ^3131FF"+.@quiver+"^000000";
@@ -95,7 +97,7 @@ S_BuyQuiver:
 		break;
 	case 2:
 		set .@quiver, 1;
-		set .@arrows_used, getarg(1);
+		set .@arrows_used, .@req_amount;
 		set .@arrow_zeny01, getarg(2);
 		set .@zeny_mes,1;
 		break;
@@ -118,7 +120,7 @@ S_BuyQuiver:
 	mes "^FF0000You can't use quivers when your encumbrance is over 70%.^000000";
 	mes "You'd better keep that in mind, or you might be in trouble later.";
 	set Zeny, Zeny-.@arrow_zeny01;
-	delitem getarg(0),.@arrows_used;
+	delitem .@item_req,.@arrows_used;
 	getitem getarg(3),.@quiver;
 	close;
 }

+ 44 - 43
npc/re/merchants/refine.txt

@@ -45,13 +45,14 @@ payon_in01,18,132,3	script	Vestri#pay	826,{
 //= it will break at a 20% rate and downgrade at an 80% rate.
 //============================================================
 function	script	refinenew	{
+	.@npc_name$ = getarg(0);
 	disable_items;
-	mes "["+ getarg(0) +"]";
+	mes "["+ .@npc_name$ +"]";
 	mes "I am the best Armsmith ever!";
 	mes "I don't refine normal, boring items.";
 	mes "I only refine items that are Level 10 or higher.";
 	next;
-	mes "["+ getarg(0) +"]";
+	mes "["+ .@npc_name$ +"]";
 	mes "Anyway, you may use my services if your item is Level 10 or higher.";
 	mes "What do you want me to refine?";
 	next;
@@ -66,14 +67,14 @@ function	script	refinenew	{
 		set .@menu$, .@menu$ + ":";
 	}
 	if (.@equipped == 0) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I don't think I can refine any items you have...";
 		close;
 	}
 	set .@part, select(.@menu$);
 
 	if (!getequipisequiped(.@part)) { //custom check
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "You're not wearing";
 		mes "anything there that";
 		mes "I can refine.";
@@ -81,18 +82,18 @@ function	script	refinenew	{
 		close;
 	}
 	if (!getequipisenableref(.@part)) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I don't think I can";
 		mes "refine this item at all...";
 		close;
 	}
 	if (getequiprefinerycnt(.@part) < 10) {
-		mes "["+ getarg(0) +"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I said I don't work with items that are lower than Level 10.";
 		close;
 	}
 	if (getequiprefinerycnt(.@part) >= 20) { //custom check
-		mes "["+ getarg(0) +"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I can't refine this";
 		mes "any more. This is as";
 		mes "refined as it gets!";
@@ -105,7 +106,7 @@ function	script	refinenew	{
 		set .@material,6224; //Bradium
 		set .@price,100000;
 		set .@safe,10;
-		mes "["+ getarg(0) +"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hmm a weapon, is that ok?";
 		mes "If you want to refine this weapon,";
 		mes "I will need 1 ^003366Bradium^000000 and 100,000 zeny.";
@@ -114,7 +115,7 @@ function	script	refinenew	{
 		set .@material,6223; //Carnium
 		set .@price,100000;
 		set .@safe,10;
-		mes "["+ getarg(0) +"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hmm an armor, is that ok?";
 		mes "If you want to refine this armor,";
 		mes "I will need 1 ^003366Carnium^000000 and 100,000 zeny.";
@@ -122,34 +123,34 @@ function	script	refinenew	{
 	mes "Are you sure you want to continue?";
 	next;
 	if(select("Yes:No") == 2){
-		mes "["+ getarg(0) +"]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hm... if you mind... never mind...";
 		close;
 	}
 	if (getarg(1) != 1) {
 		if (getequippercentrefinery(.@part) < 100) {
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "This "+.@type$+" already has been refined serveral times.";
 			mes "It could be destroyed if I try again.";
 			mes "It won't break for sure, but there is has a small chance.";
 			next;
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "You could be ^FF0000lowering the upgrade level^000000 of the "+.@type$+",";
 			mes "or if it breaks, you will lose ^FF0000any cards^000000 or special properties added to it.";
 			next;
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Do you still want me to refine it?";
 			mes "I think I have given you enough warning.";
 			next;
 			if(select("Yes.:No.") == 2) {
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Well, no challenge is one way to go...";
 				mes "No risk... that could be wise.";
 				close;
 			}
 		}
 		if (countitem(.@material) < 1 || Zeny < .@price) {
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Hm. You don't seem to have enough money or "+getitemname(.@material)+".";
 			mes "Please come back when you have them.";
 			close;
@@ -160,7 +161,7 @@ function	script	refinenew	{
 		// anti-hack
 		if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) ||
 		    callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt)) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			emotion e_an;
 			mes "Wait a second...";
 			mes "Do you think I'm stupid?!";
@@ -173,47 +174,47 @@ function	script	refinenew	{
 			successrefitem .@part;
 			next;
 			emotion e_no1;
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Good! Succes!!!";
 			mes "I am the best Armsmith.";
 			close;
 		} else {
 			if (rand(100) < 80) {
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Clang! Clang! Clang! Clang!";
 				downrefitem .@part,3; // Failed refine attempts decrease the item's refine level by 3
 				next;
 				emotion (!rand(5))?e_cash:e_omg;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Ahhh!!!";
 				next;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Oh my god!";
 				mes "The upgrade level has dropped...";
 			} else {
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Clang! Clang! Clang!";
 				failedrefitem .@part;
 				next;
 				emotion (!rand(5))?e_cash:e_omg;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Hmmm!";
 				next;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Oh my! I've failed to refine stuff...";
 				mes "I didn't mean it!";
 			}
 			mes "I could have made a mistake even though I am the best Armsmith ever.";
 			mes "It just wasn't meant to be.";
 			next;
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "I will do a better job next time! Don't worry!";
 			close;
 		}
 	}
 // New +11 and above Refining Functions ========================
 	if (getequiprefinerycnt(.@part) < .@safe) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "I can refine this to the safe limit or a desired number of times. It's your choice.";
 		next;
 		set .@menu2,select("To the safe limit, please.","I'll decide how many times.","I've changed my mind...");
@@ -224,44 +225,44 @@ function	script	refinenew	{
 		set .@refinecnt,.@safe - getequiprefinerycnt(.@part);
 		break;
 	case 2:
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "How many times would you like me to refine your item?";
 		next;
 		input .@refinecnt;
 		set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
 		if (.@refinecnt < 1 || .@refinecheck > 20) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "I can't refine this item that many times.";
 			close;
 		}
 		if (.@refinecheck > .@safe) {
 			set .@refinecheck,.@refinecheck - .@safe;
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
 			next;
 			if(select("Yes...","No...") == 2){
-				mes "[" + getarg(0) + "]";
+				mes "["+ .@npc_name$ +"]";
 				mes "You said so... So be it.";
 				close;
 			}
 		}
 		break;
 	case 3:
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "You said so... So be it.";
 		close;
 	}
 	set .@fullprice,.@price * .@refinecnt;
-	mes "[" + getarg(0) + "]";
+	mes "["+ .@npc_name$ +"]";
 	mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
 	next;
 	if(select("Yes:No...") == 2){
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "You said so... So be it.";
 		close;
 	}
 	if (countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
-		mes "[" + getarg(0) + "]";
+		mes "["+ .@npc_name$ +"]";
 		mes "Hm. You don't seem to have enough money or "+getitemname(.@material)+".";
 		mes "Please come back when you have them.";
 		close;
@@ -270,12 +271,12 @@ function	script	refinenew	{
 	delitem .@material,.@refinecnt;
 	while(.@refinecnt){
 		if (getequipisequiped(.@part) == 0) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Look here... you don't have any items on...";
 			close;
 		}
 		if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
-			mes "[" + getarg(0) + "]";
+			mes "["+ .@npc_name$ +"]";
 			mes "Clang... No, but did you imagine I could be so stupid?!";
 			mes "You changed it...";
 			mes "Get out before I stun you with my Hammer!!";
@@ -288,40 +289,40 @@ function	script	refinenew	{
 			next;
 		} else {
 			if (rand(100) < 80) {
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Clang! Clang! Clang! Clang!";
 				downrefitem .@part,3; // Failed refine attempts decrease the item's refine level by 3
 				next;
 				emotion (!rand(5))?e_cash:e_omg;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Ahhh!!!";
 				next;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Oh my god!";
 				mes "The upgrade level has dropped...";
 			} else {
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Clang! Clang! Clang!";
 				failedrefitem .@part;
 				next;
 				emotion (!rand(5))?e_cash:e_omg;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Hmmm!";
 				next;
-				mes "["+ getarg(0) +"]";
+				mes "["+ .@npc_name$ +"]";
 				mes "Oh my! I've failed to refine stuff...";
 				mes "I didn't mean it!";
 			}
 			mes "I could have made a mistake even though I am the best Armsmith ever.";
 			mes "It just wasn't meant to be.";
 			next;
-			mes "["+ getarg(0) +"]";
+			mes "["+ .@npc_name$ +"]";
 			mes "I will do a better job next time! Don't worry!";
 			close;
 		}
 	}
 	emotion e_no1;
-	mes "["+ getarg(0) +"]";
+	mes "["+ .@npc_name$ +"]";
 	mes "Good! Succes!!!";
 	mes "I am the best Blacksmith.";
 	close;

+ 11 - 8
npc/re/quests/eden/11-25.txt

@@ -129,12 +129,15 @@ moc_para01,32,30,6	script	Spike	914,{
 	mes "Why don't you look around and find some interesting tasks?";
 	close;
 L_Quest:
-	if (checkquest(getarg(0),HUNTING) == 2) {
-		if (getarg(3,0))
-			if (countitem(getarg(3)) < getarg(4)) {
+	.@quest_id = getarg(0);
+	if (checkquest(.@quest_id,HUNTING) == 2) {
+		.@item_req = getarg(3,0);
+		.@req_amount = getarg(4,0);
+		if (.@item_req)
+			if (countitem(.@item_req) < .@req_amount) {
 				mes "[Spike]";
-				mes "You don't have enough "+getitemname(getarg(3))+".";
-				mes "You need to bring "+getarg(4)+" "+getitemname(getarg(3))+".";
+				mes "You don't have enough "+ getitemname(.@item_req) +".";
+				mes "You need to bring "+ .@req_amount +" "+ getitemname(.@item_req) +".";
 				close;
 			}
 		mes "[Spike]";
@@ -145,9 +148,9 @@ L_Quest:
 		mes "Good work~!!";
 		mes "Our client is so happy with your work. He will appreciate what you have done.";
 		mes "Please help us again. Thanks!";
-		if (getarg(3,0)) delitem getarg(3),getarg(4);
-		erasequest getarg(0);
-		setquest getarg(0)+10;
+		if (.@item_req) delitem .@item_req,.@req_amount;
+		erasequest .@quest_id;
+		setquest .@quest_id+10;
 		getexp getarg(2),0;
 		close;
 	}

+ 9 - 7
npc/re/quests/eden/26-40.txt

@@ -71,11 +71,12 @@ moc_para01,38,38,3	script	Mission [26 - 40]	857,{
 	end;
 L_Quest:
 	//QuestID,ReqLvl,Quest,Client,Loc,Desc
+	.@string$ = getarg(2);
 	if (BaseLevel < getarg(1,26)) {
-		mes "Your level doesn't meet the requirements. You can't take the '"+getarg(2)+"' mission.";
+		mes "Your level doesn't meet the requirements. You can't take the '"+ .@string$ +"' mission.";
 		close;
 	}
-	mes "["+getarg(2)+" !!]";
+	mes "["+ .@string$ +" !!]";
 	mes "Client : "+getarg(3);
 	mes "Client Location : "+getarg(4);
 	mes "Requested Mission : "+getarg(5);
@@ -83,13 +84,13 @@ L_Quest:
 	mes "Will you accept this mission?";
 	next;
 	if(select("No, I won't accept it.:Yes, I will accept it.") == 1) {
-		mes "You have declined the "+getarg(2)+" mission.";
+		mes "You have declined the "+ .@string$ +" mission.";
 		close;
 	}
 	if (checkquest(getarg(0)) > -1) mes "You are already doing this mission.";
 	else {
 		setquest getarg(0);
-		mes "You have accepted the "+getarg(2)+" mission.";
+		mes "You have accepted the "+ .@string$ +" mission.";
 	}
 	mes "You can get a reward from the client after you finish the mission.";
 	next;
@@ -136,8 +137,9 @@ geffen,103,42,5	script	Sponiac	99,{
 	end;
 L_Quest:
 	//QuestID,Quest,BExp,JExp,PotionAmt,Desc
-	if (checkquest(getarg(0)) == 1) {
-		if (checkquest(getarg(0),HUNTING) == 2) {
+	.@quest_id = getarg(0);
+	if (checkquest(.@quest_id) == 1) {
+		if (checkquest(.@quest_id,HUNTING) == 2) {
 			mes "[Sponiac]";
 			mes getarg(1)+"!";
 			mes "Wow, I didn't expect you would do that mission. I was just about to give up. But you did good job. I appreciate it!";
@@ -150,7 +152,7 @@ L_Quest:
 			mes "Here it is. Thank you very much. God bless you!";
 			getitem 569,getarg(4); //Novice_Potion
 			getexp getarg(2),getarg(3);
-			erasequest getarg(0);
+			erasequest .@quest_id;
 			close;
 		}
 		mes "[Sponiac]";

+ 15 - 13
npc/re/quests/eden/56-70.txt

@@ -53,8 +53,9 @@ moc_para01,42,38,3	script	Mission [56 - 70]	857,{
 	end;
 
 L_Quest:
-	if (checkquest(getarg(0)) == -1) {
-		callsub L_Details, getarg(0);
+	.@quest_id = getarg(0);
+	if (checkquest(.@quest_id) == -1) {
+		callsub L_Details, .@quest_id;
 		next;
 		mes "Would you like to accept this mission?";
 		next;
@@ -63,7 +64,7 @@ L_Quest:
 				mes "These missions are not fit for my level. I should look for other missions.";
 				close;
 			}
-			setquest getarg(0);
+			setquest .@quest_id;
 			mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
 			next;
 			mes "This mission doesn't have time limits.";
@@ -76,11 +77,11 @@ L_Quest:
 		else
 			set .@items,2; //complete
 	}
-	if (checkquest(getarg(0)) < 2 && (countitem(getarg(3)) < getarg(4) || .@items == 1)) {
+	if (checkquest(.@quest_id) < 2 && (countitem(getarg(3)) < getarg(4) || .@items == 1)) {
 		mes "You have an on-going mission. Would you like to check the details?";
 		next;
 		if(select("Check the details.:Cancel.") == 1)
-			callsub L_Details, getarg(0);
+			callsub L_Details, .@quest_id;
 		close;
 	} else {
 		mes "I have done pretty well for the mission. Should I report it now?";
@@ -90,7 +91,7 @@ L_Quest:
 			if (.@items)
 				delitem getarg(5),getarg(6);
 			getexp getarg(1),getarg(2);
-			erasequest getarg(0);
+			erasequest .@quest_id;
 			mes "You have completed the mission. Get rewards.";
 		}
 		close;
@@ -98,8 +99,9 @@ L_Quest:
 	end;
 
 L_HuntingQuest:
-	if (checkquest(getarg(0)) == -1) {
-		callsub L_Details, getarg(0);
+	.@quest_id = getarg(0);
+	if (checkquest(.@quest_id) == -1) {
+		callsub L_Details, .@quest_id;
 		next;
 		mes "Would you like to accept this mission?";
 		next;
@@ -108,7 +110,7 @@ L_HuntingQuest:
 				mes "These missions are not fit for my level. I should look for other missions.";
 				close;
 			}
-			setquest getarg(0);
+			setquest .@quest_id;
 			mes "I have successfully accepted the mission. I have to come back and confirm my work after I complete the mission.";
 			next;
 			mes "This mission doesn't have time limits.";
@@ -121,20 +123,20 @@ L_HuntingQuest:
 		else
 			set .@items,2; //complete
 	}
-	if (checkquest(getarg(0),HUNTING) < 2 || .@items == 1) {
+	if (checkquest(.@quest_id,HUNTING) < 2 || .@items == 1) {
 		mes "You have an on-going mission. Would you like to check the details?";
 		next;
 		if(select("Check the details.:Cancel.") == 1)
-			callsub L_Details, getarg(0);
+			callsub L_Details, .@quest_id;
 		close;
-	} else if (checkquest(getarg(0),HUNTING) == 2) {
+	} else if (checkquest(.@quest_id,HUNTING) == 2) {
 		mes "I have done pretty well for the mission. Should I report it now?";
 		next;
 		if(select("Report the mission.:Do not report it yet.") == 1) {
 			if (.@items)
 				delitem getarg(3),getarg(4);
 			getexp getarg(1),getarg(2);
-			erasequest getarg(0);
+			erasequest .@quest_id;
 			mes "You have completed the mission. Get rewards.";
 		}
 		close;

+ 3 - 2
npc/re/quests/eden/86-90.txt

@@ -152,6 +152,7 @@ moc_para01,48,175,3	script	86-90 Mission Board	857,{
 L_Quest:
 	set .@quest1, getarg(0);
 	set .@quest2, .@quest1+31;
+	.@cutin$ = getarg(3);
 	set .@playtime, checkquest(.@quest2,PLAYTIME);
 	if (.@playtime == 0 || .@playtime == 1) {
 		mes "[86-90 Mission Board]";
@@ -182,11 +183,11 @@ L_Quest:
 		mes "[86-90 Mission Board]";
 		mes getarg(4);
 		next;
-		if (getarg(3) != "") cutin getarg(3),3;
+		if (.@cutin$ != "") cutin .@cutin$,3;
 		mes "[86-90 Mission Board]";
 		mes "Hunt 30 "+getarg(1)+" monsters there and post your success on this board.";
 		next;
-		if (getarg(3) != "") cutin getarg(3),255;
+		if (.@cutin$ != "") cutin .@cutin$,255;
 		if(select("I'll hunt them.:No thanks.") == 1) {
 			mes "[86-90 Mission Board]";
 			mes "When you have completed the mission, post it on this board and collect your reward.";

+ 3 - 2
npc/re/quests/eden/91-99.txt

@@ -161,6 +161,7 @@ moc_para01,48,177,3	script	91-99 Mission Board	857,{
 L_Quest:
 	set .@quest1, getarg(0);
 	set .@quest2, .@quest1+31;
+	.@cutin$ = getarg(3);
 	set .@playtime, checkquest(.@quest2,PLAYTIME);
 	if (.@playtime == 0 || .@playtime == 1) {
 		mes "[91-99 Mission Board]";
@@ -199,11 +200,11 @@ L_Quest:
 		mes "[91-99 Mission Board]";
 		mes getarg(4);
 		next;
-		if (getarg(3) != "") cutin getarg(3),3;
+		if (.@cutin$ != "") cutin .@cutin$,3;
 		mes "[91-99 Mission Board]";
 		mes "Hunt 30 "+getarg(1)+" monsters there and post your success on this board.";
 		next;
-		if (getarg(3) != "") cutin getarg(3),255;
+		if (.@cutin$ != "") cutin .@cutin$,255;
 		if(select("I'll hunt them.:No thanks.") == 1) {
 			mes "[91-99 Mission Board]";
 			mes "When you have completed the mission, post it on this board and collect your reward.";

+ 5 - 4
npc/re/quests/eden/eden_111_120.txt

@@ -1119,7 +1119,8 @@ S_Hunting:
 	}
 	return;
 S_Gathering:
-	if (isbegin_quest(getarg(0)) > 0) {
+	.@quest_id = getarg(0);
+	if (isbegin_quest(.@quest_id) > 0) {
 		if (getarg(5,0))
 			.@count_item2 = countitem(getarg(5));
 		mes "[Mingmin]";
@@ -1139,10 +1140,10 @@ S_Gathering:
 			else
 				mes "I will delete "+  getitemname(getarg(3)) +" research from request list.";
 		}
-		erasequest getarg(0);
+		erasequest .@quest_id;
 		next;
 	}
-	else if (isbegin_quest(getarg(0)+1) > 0)
-		erasequest (getarg(0)+1);
+	else if (isbegin_quest(.@quest_id+1) > 0)
+		erasequest (.@quest_id+1);
 	return;
 }

+ 19 - 18
npc/re/quests/homun_s.txt

@@ -857,14 +857,15 @@ que_house_s,83,47,3	script	Magic Board#homun_s	857,{
 }
 
 function	script	F_HomMutateInfo	{
-	mes getarg(0);
+	.@npc_name$ = getarg(0);
+	mes .@npc_name$;
 	mes ":: The ability of the mutated";
 	mes ":: ^0000FFHomunculus^000000 clearly goes";
 	mes ":: beyond the previous state.";
 	mes ":: In addition, its appearance";
 	mes ":: will evolve as well.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^0000FFHomunculus^000000 appearances of the";
 	mes ":: new types can be classified";
 	mes ":: based on different species.";
@@ -872,19 +873,19 @@ function	script	F_HomMutateInfo	{
 	mes ":: generally have a similar";
 	mes ":: appearance.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: The category, appearance and";
 	mes ":: ability of the ^0000FFHomunculus^000000";
 	mes ":: via the Homunculus Mutation";
 	mes ":: System are as follows:";
 	next;
 	cutin "Mer_Eira_Card",3;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: The first of the five";
 	mes ":: is called ^FF4800Eira^000000.";
 	mes ":: Beautiful and graceful.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Eira^000000 uses";
 	mes ":: ^006400Wind Element^000000 Magic Attacks and";
 	mes ":: Support Skills.";
@@ -892,7 +893,7 @@ function	script	F_HomMutateInfo	{
 	mes ":: to revive its";
 	mes ":: fallen master.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Eira^000000 eats";
 	mes ":: ^0000FFSmall Snow Flower^000000.";
 	mes ":: Surprising how it survives on";
@@ -902,19 +903,19 @@ function	script	F_HomMutateInfo	{
 	next;
 	cutin "",255;
 	cutin "Mer_Sera_Card",3;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: The second of the five";
 	mes ":: is known as ^FF4800Sera^000000.";
 	mes ":: It looks just like ^FF0000Mistress^000000 but";
 	mes ":: it doesn't run away.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Sera^000000";
 	mes ":: specializes in ^006400Poison Attacks^000000.";
 	mes ":: Also, it uses distinct";
 	mes ":: Support Skills using poisons.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Sera^000000 eats";
 	mes ":: ^0000FFApple Pudding^000000.";
 	mes ":: It prefers sweet food.";
@@ -923,20 +924,20 @@ function	script	F_HomMutateInfo	{
 	next;
 	cutin "",255;
 	cutin "Mer_Dieter_Card",3;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: The third of the five";
 	mes ":: is ^FF4800Dieter^000000.";
 	mes ":: It looks unusual but it";
 	mes ":: has a good demeanor.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Dieter^000000 uses";
 	mes ":: ^FF0000Fire^000000 based Attacks and";
 	mes ":: Support Skills.";
 	mes ":: It is just as fragile...";
 	mes ":: ah, reliable, as it looks.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Dieter^000000 eats";
 	mes ":: ^0000FFBig Cell^000000.";
 	mes ":: ^0000FFBig Cell^000000 can be bought";
@@ -944,13 +945,13 @@ function	script	F_HomMutateInfo	{
 	next;
 	cutin "",255;
 	cutin "Mer_Bayeri_Card",3;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: The fourth of the five";
 	mes ":: is ^FF4800Bayeri^000000.";
 	mes ":: Bayeri has the form of a";
 	mes ":: unicorn.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: It has a powerful dash skill";
 	mes ":: and uses ^006400Holy Element^000000 magic.";
 	mes ":: Unfortunately,";
@@ -958,7 +959,7 @@ function	script	F_HomMutateInfo	{
 	mes ":: Not all four-legged creatures";
 	mes ":: can be ridden.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Bayeri^000000 eats";
 	mes ":: ^0000FFFresh Plant^000000.";
 	mes ":: No matter how hungry it";
@@ -968,19 +969,19 @@ function	script	F_HomMutateInfo	{
 	next;
 	cutin "",255;
 	cutin "Mer_Eleanor_Card",3;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: The last of the five";
 	mes ":: is ^FF4800Eleanor^000000.";
 	mes ":: It has a feminine appearance";
 	mes ":: and outstanding physical skill.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Eleanor^000000";
 	mes ":: uses ^006400Strike or Grapple Attacks^000000";
 	mes ":: sequentially in battle.";
 	mes ":: Absolutely stunning.";
 	next;
-	mes getarg(0);
+	mes .@npc_name$;
 	mes ":: ^FF4800Eleanor^000000 eats";
 	mes ":: ^0000FFKid's Dumpling^000000.";
 	mes ":: Don't confuse it with a normal";

+ 6 - 4
npc/re/quests/magic_books.txt

@@ -805,20 +805,22 @@ function	script	Magic_Book_Essence	{
 		mes "Please lighten your bag.";
 		close;
 	}
-	if (checkquest(getarg(0)) == 1 && countitem(getarg(1)) >= getarg(2)) {
+	.@item_req = getarg(1);
+	.@req_amount = getarg(2);
+	if (checkquest(getarg(0)) == 1 && countitem(.@item_req) >= .@req_amount) {
 		specialeffect2 EF_BLIND;
 		specialeffect2 EF_BEGINSPELL;
 		progressbar "ffff00",4;
-		delitem getarg(1),getarg(2);
+		delitem .@item_req,.@req_amount;
 		if (rand(2)) {
-			mes "You have used "+callfunc("F_InsertPlural",getarg(2),getitemname(getarg(1)))+" to create ^999900"+getarg(3)+" Essence^000000.";
+			mes "You have used "+ callfunc("F_InsertPlural",.@req_amount,getitemname(.@item_req)) +" to create ^999900"+ getarg(3) +" Essence^000000.";
 			next;
 			mes "^008800The "+getarg(3)+" Essence will last permanently, unless there's a problem.^000000";
 			completequest getarg(0);
 			specialeffect2 EF_LORD;
 			close;
 		}
-		mes "^008888You have failed to refine the essence using "+callfunc("F_InsertPlural",getarg(2),getitemname(getarg(1)))+".^000000";
+		mes "^008888You have failed to refine the essence using "+ callfunc("F_InsertPlural",.@req_amount,getitemname(.@item_req)) +".^000000";
 		close;
 	}
 	if (checkquest(getarg(0)) == 2) {

+ 4 - 3
npc/re/quests/quests_dicastes.txt

@@ -454,11 +454,12 @@ sec_in02,10,42,1	script	13.3 Related Reset	449,{
 // Civil Services
 //============================================================
 function	script	que_dic	{
-	if (!getarg(0)) {
+	.@type = getarg(0);
+	if (!.@type) {
 		if (checkquest(getarg(1),HUNTING) != 2) return;
 		mes getarg(3); 
 	}
-	else if (getarg(0) == 1) {
+	else if (.@type == 1) {
 		if (checkquest(getarg(1)) == -1) return;
 		if (countitem(getarg(3)) < getarg(4)) {
 			mes "It looks like you are short on the amount.";
@@ -468,7 +469,7 @@ function	script	que_dic	{
 		mes getarg(6,"");
 		delitem getarg(3), getarg(4); 
 	}
-	else if (getarg(0) == 2) {
+	else if (.@type == 2) {
 		for(set .@i,1; .@i<getargcount(); set .@i,.@i+1) {
 			if (checkquest(getarg(.@i)) >= 0)
 				erasequest getarg(.@i);

+ 17 - 15
npc/re/quests/quests_malangdo.txt

@@ -5435,37 +5435,38 @@ malangdo,212,204,0	script	Beginning Compass#nya_02	844,{
 
 // callsub L_Viewpoint,<order number>,<start index>;
 L_Viewpoint:
+	.@index = getarg(1);
 	switch(getarg(0)) {
 	case 1: // Order 1: Red, Blue, Yellow, Green, White
 		setarray .@Colors$[1],"^FF0000","^0000FF","^FFFF00","^00FF00","^cccccc";
 		setarray .@Text$[1],"Red","Blue","Yellow","Green","White";
-		if (getarg(1) <= 1)
+		if (.@index <= 1)
 			viewpoint 1,213,89,0,0xFF0000;
-		if (getarg(1) <= 2)
+		if (.@index <= 2)
 			viewpoint 1,128,103,1,0x0000FF;
-		if (getarg(1) <= 3)
+		if (.@index <= 3)
 			viewpoint 1,73,253,2,0xFFFF00;
-		if (getarg(1) <= 4)
+		if (.@index <= 4)
 			viewpoint 1,153,146,3,0x00FF00;
 		viewpoint 1,111,178,4,0xcccccc;
 		break;
 	case 2: // Order 2: Yellow, Blue, White, Green, Red
 		setarray .@Colors$[1],"^FFFF00","^0000FF","^cccccc","^00FF00","^FF0000";
 		setarray .@Text$[1],"Yellow","Blue","White","Green","Red";
-		if (getarg(1) <= 1)
+		if (.@index <= 1)
 			viewpoint 1,73,253,0,0xFFFF00;
-		if (getarg(1) <= 2)
+		if (.@index <= 2)
 			viewpoint 1,128,103,1,0x0000FF;
-		if (getarg(1) <= 3)
+		if (.@index <= 3)
 			viewpoint 1,111,178,2,0xcccccc;
-		if (getarg(1) <= 4)
+		if (.@index <= 4)
 			viewpoint 1,153,146,3,0x00FF00;
 		viewpoint 1,213,89,4,0xFF0000;
 		break;
 	}
 	for(set .@i,1; .@i<=5; set .@i,.@i+1)
-		set .@str$, .@str$+((.@i >= getarg(1))?.@Colors$[.@i]:"")+.@Text$[.@i]+" ";
-	if (getarg(1) > 1)
+		set .@str$, .@str$+((.@i >= .@index)?.@Colors$[.@i]:"")+.@Text$[.@i]+" ";
+	if (.@index > 1)
 		mes "After inserting the card and pressing the red button, the path to the destination lit up.";
 	mes "The order will be "+.@str$+"^000000.";
 	return;
@@ -6221,6 +6222,7 @@ malangdo,174,175,0	script	Noisy Machine#nya_13	844,{
 
 // callsub L_ShowLights,<number of lights>;
 L_ShowLights:
+	.@num = getarg(0);
 	mes "Luminous";
 	mes "The order of buttons are:";
 	mes "[Red] [Green] [Blue] [Yellow]";
@@ -6231,11 +6233,11 @@ L_ShowLights:
 	mes "Luminous";
 	setarray .@Color$[0],"Red","Blue","Yellow","Green";
 	setarray .@Cutin$[0],"nya_red","nya_blue","nya_yellow","nya_green";
-	for(set .@i,0; .@i<getarg(0); set .@i,.@i+1) {
+	for(set .@i,0; .@i < .@num; set .@i,.@i+1) {
 		set .@rand, rand(4);
 		set .@Lamp[.@i],.@rand;
 		mes .@Color$[.@rand];
-		if (.@i+1 == getarg(0))
+		if (.@i+1 == .@num)
 			mes "Shines according to this order.";
 		cutin .@Cutin$[.@rand],4;
 		progressbar "0xFFFF00",1;
@@ -6246,7 +6248,7 @@ L_ShowLights:
 	next;
 	set .@pass,0;
 	setarray .@Count$[0],"first","second","third","fourth","fifth","sixth","seventh","eighth";
-	for(set .@i,0; .@i<getarg(0); set .@i,.@i+1) {
+	for(set .@i,0; .@i < .@num; set .@i,.@i+1) {
 		mes "Which color button do you want to press "+.@Count$[.@i]+"?";
 		next;
 		// Red <-> Green, Blue <-> Yellow
@@ -6254,7 +6256,7 @@ L_ShowLights:
 		if (.@Lamp[.@i] == 4-.@j)
 			set .@pass,.@pass+1;
 	}
-	if (.@pass < getarg(0)) {
+	if (.@pass < .@num) {
 		mes "The speed of spinning is getting faster after pressing the buttons.";
 		mes "After all...";
 		specialeffect EF_BEGINSPELL6;
@@ -6282,7 +6284,7 @@ L_ShowLights:
 	mes "The luminous shines once and stops also.";
 	cutin "nya_off",4;
 	next;
-	if (getarg(0) < 8) {
+	if (.@num < 8) {
 		mes "[Homnya]";
 		mes "Don't reduce your tension!";
 		mes "It's not over yet!";