浏览代码

Little clean-up

Signed-off-by: Capuche <capucrath@gmail.com>
Capuche 10 年之前
父节点
当前提交
5f8a451913
共有 2 个文件被更改,包括 50 次插入59 次删除
  1. 28 34
      npc/merchants/ammo_boxes.txt
  2. 22 25
      npc/merchants/ammo_dealer.txt

+ 28 - 34
npc/merchants/ammo_boxes.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //===== By: ==================================================
 //= rAthena Dev Team
 //= rAthena Dev Team
 //===== Current Version: =====================================
 //===== Current Version: =====================================
-//= 1.5
+//= 2.0
 //===== Compatible With: =====================================
 //===== Compatible With: =====================================
 //= rAthena Project
 //= rAthena Project
 //===== Description: =========================================
 //===== Description: =========================================
@@ -16,11 +16,12 @@
 //= 1.3 Updated to match AEGIS script. [Kisuka]
 //= 1.3 Updated to match AEGIS script. [Kisuka]
 //= 1.4 Updated to match AEGIS script again. [Masao]
 //= 1.4 Updated to match AEGIS script again. [Masao]
 //= 1.5 Moved Izlude duplicate to pre-re/re paths. [Euphy]
 //= 1.5 Moved Izlude duplicate to pre-re/re paths. [Euphy]
+//= 2.0 Clean-up. [Capuche]
 //============================================================
 //============================================================
 
 
-alberta,118,157,3	script	Magazine Dealer Kenny::mdk	83,{
+alberta,118,157,3	script	Magazine Dealer Kenny::mdk	4_M_01,{
+	mes "[Kenny]";
 	if (BaseJob == Job_Gunslinger) {
 	if (BaseJob == Job_Gunslinger) {
-		mes "[Kenny]";
 		mes "Welcome to my Magazine Shop.";
 		mes "Welcome to my Magazine Shop.";
 		mes "As you may know, large numbers";
 		mes "As you may know, large numbers";
 		mes "of bullets can be carried more";
 		mes "of bullets can be carried more";
@@ -28,14 +29,14 @@ alberta,118,157,3	script	Magazine Dealer Kenny::mdk	83,{
 		mes "anything in particular?";
 		mes "anything in particular?";
 		next;
 		next;
 		switch(select("Wind Sphere Pack:Shadow Sphere Pack:Poison Sphere Pack:Water Sphere Pack:Fire Sphere Pack:Cartridge:Blood Cartridge:Silver Cartridge:Cancel")) {
 		switch(select("Wind Sphere Pack:Shadow Sphere Pack:Poison Sphere Pack:Water Sphere Pack:Fire Sphere Pack:Cartridge:Blood Cartridge:Silver Cartridge:Cancel")) {
-		case 1: callfunc "Func_Casing",13204,12144; break;
-		case 2: callfunc "Func_Casing",13206,12145; break;
-		case 3: callfunc "Func_Casing",13205,12146; break;
-		case 4: callfunc "Func_Casing",13207,12147; break;
-		case 5: callfunc "Func_Casing",13203,12148; break;
-		case 6: callfunc "Func_Casing",13200,12149; break;
-		case 7: callfunc "Func_Casing",13202,12150; break;
-		case 8: callfunc "Func_Casing",13201,12151; break;
+		case 1: callsub S_Casing,13204,12144;// <bullet id>, <pack id>
+		case 2: callsub S_Casing,13206,12145;
+		case 3: callsub S_Casing,13205,12146;
+		case 4: callsub S_Casing,13207,12147;
+		case 5: callsub S_Casing,13203,12148;
+		case 6: callsub S_Casing,13200,12149;
+		case 7: callsub S_Casing,13202,12150;
+		case 8: callsub S_Casing,13201,12151;
 		case 9:
 		case 9:
 			mes "[Kenny]";
 			mes "[Kenny]";
 			mes "Well, if you ever find";
 			mes "Well, if you ever find";
@@ -46,7 +47,6 @@ alberta,118,157,3	script	Magazine Dealer Kenny::mdk	83,{
 			close;
 			close;
 		}
 		}
 	}
 	}
-	mes "[Kenny]";
 	mes "Welcome to my shop.";
 	mes "Welcome to my shop.";
 	mes "Here, I provide Magazines";
 	mes "Here, I provide Magazines";
 	mes "and Cartridges for Gunslingers.";
 	mes "and Cartridges for Gunslingers.";
@@ -60,19 +60,21 @@ alberta,118,157,3	script	Magazine Dealer Kenny::mdk	83,{
 	mes "them my way. You can never";
 	mes "them my way. You can never";
 	mes "have too many bullets.";
 	mes "have too many bullets.";
 	close;
 	close;
-}
 
 
-function	script	Func_Casing	{
+S_Casing:
+	.@bullet_id = getarg(0);
+	.@pack_id = getarg(1);
+
 	mes "[Kenny]";
 	mes "[Kenny]";
 	mes "Now, you can trade";
 	mes "Now, you can trade";
-	mes callfunc("F_InsertPlural",500,getitemname(getarg(0)));
-	mes "and 500 zeny for 1 "+getitemname(getarg(1))+", so make sure";
+	mes callfunc("F_InsertPlural",500,getitemname(.@bullet_id));
+	mes "and 500 zeny for 1 "+getitemname(.@pack_id)+", so make sure";
 	mes "you have sufficient bullets";
 	mes "you have sufficient bullets";
 	mes "and zeny for this exchange.";
 	mes "and zeny for this exchange.";
 	next;
 	next;
 	mes "[Kenny]";
 	mes "[Kenny]";
-	mes "You can exchange "+callfunc("F_InsertPlural",500,getitemname(getarg(0)))+" and 500 zeny";
-	mes "with 1 "+getitemname(getarg(1))+".";
+	mes "You can exchange "+callfunc("F_InsertPlural",500,getitemname(.@bullet_id))+" and 500 zeny";
+	mes "with 1 "+getitemname(.@pack_id)+".";
 	next;
 	next;
 	mes "[Kenny]";
 	mes "[Kenny]";
 	mes "Remember that I can't give";
 	mes "Remember that I can't give";
@@ -82,56 +84,48 @@ function	script	Func_Casing	{
 	mes "want to receive. If you want to cancel, then just enter ''0.''";
 	mes "want to receive. If you want to cancel, then just enter ''0.''";
 	next;
 	next;
 	input .@amount;
 	input .@amount;
+	mes "[Kenny]";
 	if (.@amount > 50 || .@amount == 0) {
 	if (.@amount > 50 || .@amount == 0) {
-		mes "[Kenny]";
 		mes "Hey, I can't give you";
 		mes "Hey, I can't give you";
 		mes "that many Magazines.";
 		mes "that many Magazines.";
 		mes "Please try again, and";
 		mes "Please try again, and";
 		mes "enter a number no";
 		mes "enter a number no";
 		mes "greater than 50.";
 		mes "greater than 50.";
-		close;
 	}
 	}
-	if (countitem(getarg(0)) >= (500*.@amount)) {
+	else if (countitem(.@bullet_id) >= (500*.@amount)) {
 		if (Zeny >= (500*.@amount)) {
 		if (Zeny >= (500*.@amount)) {
-			if (checkweight(getarg(1),.@amount) == 0) {
-				mes "[Kenny]";
+			if (checkweight(.@pack_id,.@amount) == 0) {
 				mes "Hey, you've got a lot";
 				mes "Hey, you've got a lot";
 				mes "of junk crammed in your";
 				mes "of junk crammed in your";
 				mes "Inventory. Free up some";
 				mes "Inventory. Free up some";
 				mes "space, and then come back";
 				mes "space, and then come back";
 				mes "and trade your bullets for";
 				mes "and trade your bullets for";
 				mes "some Magazines later, okay?";
 				mes "some Magazines later, okay?";
-				close;
-			}else{
-				mes "[Kenny]";
+			} else {
 				mes "Alright, here are";
 				mes "Alright, here are";
 				mes "your Magazines. Thanks";
 				mes "your Magazines. Thanks";
 				mes "for visiting my shop, and";
 				mes "for visiting my shop, and";
 				mes "I hope that you use all";
 				mes "I hope that you use all";
 				mes "of your ammo wisely.";
 				mes "of your ammo wisely.";
-				set Zeny,Zeny-500*.@amount;
-				delitem getarg(0),500*.@amount;
-				getitem getarg(1),.@amount;
-				close;
+				Zeny = Zeny -500*.@amount;
+				delitem .@bullet_id,(500*.@amount);
+				getitem .@pack_id,.@amount;
 			}
 			}
 		} else {
 		} else {
-			mes "[Kenny]";
 			mes "Sorry, but you don't";
 			mes "Sorry, but you don't";
 			mes "have enough zeny for";
 			mes "have enough zeny for";
 			mes "this Magazine exchange.";
 			mes "this Magazine exchange.";
 			mes "Come back to my shop";
 			mes "Come back to my shop";
 			mes "after you've saved up";
 			mes "after you've saved up";
 			mes "some more money.";
 			mes "some more money.";
-			close;
 		}
 		}
 	} else {
 	} else {
-		mes "[Kenny]";
 		mes "Sorry, but you don't";
 		mes "Sorry, but you don't";
 		mes "have enough bullets for";
 		mes "have enough bullets for";
 		mes "this Magazine exchange.";
 		mes "this Magazine exchange.";
 		mes "Maybe you should double";
 		mes "Maybe you should double";
 		mes "check your Inventory, and";
 		mes "check your Inventory, and";
 		mes "then come back to me later.";
 		mes "then come back to me later.";
-		close;
 	}
 	}
+	close;
 }
 }

+ 22 - 25
npc/merchants/ammo_dealer.txt

@@ -3,7 +3,7 @@
 //===== By ===================================================
 //===== By ===================================================
 //= Playtester, Paradox924X
 //= Playtester, Paradox924X
 //===== Version ==============================================
 //===== Version ==============================================
-//= 1.5
+//= 2.0
 //===== Compatible With ======================================
 //===== Compatible With ======================================
 //= rAthena Project
 //= rAthena Project
 //===== Description ==========================================
 //===== Description ==========================================
@@ -17,11 +17,12 @@
 //= 1.4 Updated to match AEGIS script. [Kisuka]
 //= 1.4 Updated to match AEGIS script. [Kisuka]
 //= 1.5 Updated to match AEGIS script again. [Masao]
 //= 1.5 Updated to match AEGIS script again. [Masao]
 //= 1.6 Moved Izlude duplicate to pre-re/re paths. [Euphy]
 //= 1.6 Moved Izlude duplicate to pre-re/re paths. [Euphy]
+//= 2.0 Clean-up. [Capuche]
 //============================================================
 //============================================================
 
 
-alberta,118,160,3	script	Bullet Dealer Tony#alb::bdt	86,{
+alberta,118,160,3	script	Bullet Dealer Tony#alb::bdt	4_M_04,{
+	mes "[Tony]";
 	if (BaseJob == Job_Gunslinger) {
 	if (BaseJob == Job_Gunslinger) {
-		mes "[Tony]";
 		mes "I'm Tony, the Bullet Dealer.";
 		mes "I'm Tony, the Bullet Dealer.";
 		mes "Come to me whenever you're";
 		mes "Come to me whenever you're";
 		mes "short on ammo. Just bring me";
 		mes "short on ammo. Just bring me";
@@ -29,11 +30,11 @@ alberta,118,160,3	script	Bullet Dealer Tony#alb::bdt	86,{
 		mes "you the bullets you need.";
 		mes "you the bullets you need.";
 		next;
 		next;
 		switch(select("Poison Sphere:Flare Sphere:Lighting Sphere:Blind Sphere:Freezing Sphere:Cancel")) {
 		switch(select("Poison Sphere:Flare Sphere:Lighting Sphere:Blind Sphere:Freezing Sphere:Cancel")) {
-		case 1: callfunc "Bullet_Trade",937,10,13205; break;
-		case 2: callfunc "Bullet_Trade",7097,2,13203; break;
-		case 3: callfunc "Bullet_Trade",7053,3,13204; break;
-		case 4: callfunc "Bullet_Trade",1024,5,13206; break;
-		case 5: callfunc "Bullet_Trade",7054,2,13207; break;
+		case 1: callsub S_BulletTrade,937,10,13205;// <item required>, <amount req>, <bullet id>
+		case 2: callsub S_BulletTrade,7097,2,13203;
+		case 3: callsub S_BulletTrade,7053,3,13204;
+		case 4: callsub S_BulletTrade,1024,5,13206;
+		case 5: callsub S_BulletTrade,7054,2,13207;
 		case 6:
 		case 6:
 			mes "[Tony]";
 			mes "[Tony]";
 			mes "Changed your mind?";
 			mes "Changed your mind?";
@@ -45,7 +46,6 @@ alberta,118,160,3	script	Bullet Dealer Tony#alb::bdt	86,{
 			close;
 			close;
 		}
 		}
 	}
 	}
-	mes "[Tony]";
 	mes "Hey, I'm Tony. I'm in";
 	mes "Hey, I'm Tony. I'm in";
 	mes "charge of distributing";
 	mes "charge of distributing";
 	mes "and making bullets for";
 	mes "and making bullets for";
@@ -59,16 +59,19 @@ alberta,118,160,3	script	Bullet Dealer Tony#alb::bdt	86,{
 	mes "I can only do business with";
 	mes "I can only do business with";
 	mes "fully fledged Gunslingers.";
 	mes "fully fledged Gunslingers.";
 	close;
 	close;
-}
 
 
-function	script	Bullet_Trade	{
+S_BulletTrade:
+	.@required_id = getarg(0);
+	.@required_amount = getarg(1);
+	.@bullet_id = getarg(2);
+
 	mes "[Tony]";
 	mes "[Tony]";
 	mes "For every set of";
 	mes "For every set of";
-	mes callfunc("F_InsertPlural",30,getitemname(getarg(2)))+",";
+	mes callsub("F_InsertPlural",30,getitemname(.@bullet_id))+",";
 	mes "you must give me";
 	mes "you must give me";
 	mes "1 Emveretarcon,";
 	mes "1 Emveretarcon,";
 	mes "1 Phracon, and";
 	mes "1 Phracon, and";
-	mes callfunc("F_InsertPlural",getarg(1),getitemname(getarg(0)))+".";
+	mes callsub("F_InsertPlural",.@required_amount,getitemname(.@required_id))+".";
 	next;
 	next;
 	mes "[Tony]";
 	mes "[Tony]";
 	mes "Remember that I can give";
 	mes "Remember that I can give";
@@ -79,28 +82,24 @@ function	script	Bullet_Trade	{
 	mes "cancel, then just enter ''0.''";
 	mes "cancel, then just enter ''0.''";
 	next;
 	next;
 	input .@amount;
 	input .@amount;
+	mes "[Tony]";
 	if (.@amount < 1 || .@amount > 500) {
 	if (.@amount < 1 || .@amount > 500) {
-		mes "[Tony]";
 		mes "Hey, I can't give you";
 		mes "Hey, I can't give you";
 		mes "that many bullets. Don't";
 		mes "that many bullets. Don't";
 		mes "forget to enter a number";
 		mes "forget to enter a number";
 		mes "that's no higher than 500";
 		mes "that's no higher than 500";
 		mes "if you want to trade your";
 		mes "if you want to trade your";
 		mes "items for some bullets.";
 		mes "items for some bullets.";
-		close;
 	}
 	}
-	if (countitem(1010) >= .@amount && countitem(1011) >= .@amount && countitem(getarg(0)) >= (.@amount*getarg(1))) {
-		if (checkweight(getarg(2),.@amount * 30) == 0) {
-			mes "[Tony]";
+	else if (countitem(1010) >= .@amount && countitem(1011) >= .@amount && countitem(.@required_id) >= (.@amount*.@required_amount)) {
+		if (checkweight(.@bullet_id,.@amount * 30) == 0) {
 			mes "Eh? Your Inventory doesn't";
 			mes "Eh? Your Inventory doesn't";
 			mes "have enough space for this";
 			mes "have enough space for this";
 			mes "many bullets. Come back later";
 			mes "many bullets. Come back later";
 			mes "after you make more space";
 			mes "after you make more space";
 			mes "available. Try putting some of";
 			mes "available. Try putting some of";
 			mes "your things into Kafra Storage.";
 			mes "your things into Kafra Storage.";
-			close;
 		} else {
 		} else {
-			mes "[Tony]";
 			mes "Great, everything seems";
 			mes "Great, everything seems";
 			mes "to be in order. Let me take";
 			mes "to be in order. Let me take";
 			mes "these materials, and here are";
 			mes "these materials, and here are";
@@ -108,18 +107,16 @@ function	script	Bullet_Trade	{
 			mes "to do business with you~";
 			mes "to do business with you~";
 			delitem 1010,.@amount; //Phracon
 			delitem 1010,.@amount; //Phracon
 			delitem 1011,.@amount; //Emveretarcon
 			delitem 1011,.@amount; //Emveretarcon
-			delitem getarg(0),.@amount * getarg(1);
-			getitem getarg(2),.@amount * 30;
-			close;
+			delitem .@required_id,.@amount * .@required_amount;
+			getitem .@bullet_id,.@amount * 30;
 		}
 		}
 	} else {
 	} else {
-		mes "[Tony]";
 		mes "Huh. It looks like you";
 		mes "Huh. It looks like you";
 		mes "don't have enough materials";
 		mes "don't have enough materials";
 		mes "for that many bullets. Well,";
 		mes "for that many bullets. Well,";
 		mes "it's no problem. Just come";
 		mes "it's no problem. Just come";
 		mes "back after gathering everything";
 		mes "back after gathering everything";
 		mes "that you need, okay?";
 		mes "that you need, okay?";
-		close;
 	}
 	}
+	close;
 }
 }