commonized ammo_boxes.txt ammo_dealer.txt kunai_maker.txt

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10696 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Lupus 2007-06-05 08:59:52 +00:00
parent 820d68b966
commit ce8c510e51
4 changed files with 62 additions and 82 deletions

View File

@ -1,6 +1,7 @@
Date Added Date Added
====== ======
2007/06/05 2007/06/05
* Optimized, commonized and got rid of extra @vars: ammo_boxes.txt,ammo_dealer.txt,kunai_maker.txt [Lupus]
* Fixed a bug in Thanatos Tower quest. [SinSloth] * Fixed a bug in Thanatos Tower quest. [SinSloth]
2007/06/04 2007/06/04
* Updated versions in some merchants scripts [Lupus] * Updated versions in some merchants scripts [Lupus]

View File

@ -39,23 +39,21 @@ que_ng,187,149,3 script Magazine Dealer Kenny 83,{
mes "Spheres at a lower weight!"; mes "Spheres at a lower weight!";
mes "Come on! Take a look!"; mes "Come on! Take a look!";
next; next;
switch( select( "Lightning Sphere Pack","Blind Sphere Pack","Poison Sphere Pack","Freezing Sphere Pack","Flare Sphere Pack","Bullet Casing","Shell of Blood Casing","Silver Bullet Casing","Cancel" )) switch(select("Lightning Sphere Pack","Blind Sphere Pack","Poison Sphere Pack","Freezing Sphere Pack","Flare Sphere Pack","Bullet Casing","Shell of Blood Casing","Silver Bullet Casing","Cancel")) {
{ case 1: callfunc "Func_Casing",13204,12144; break;
case 1: callfunc "Func_Casing",13204,12144; break; case 2: callfunc "Func_Casing",13206,12145; break;
case 2: callfunc "Func_Casing",13206,12145; break; case 3: callfunc "Func_Casing",13205,12146; break;
case 3: callfunc "Func_Casing",13205,12146; break; case 4: callfunc "Func_Casing",13207,12147; break;
case 4: callfunc "Func_Casing",13207,12147; break; case 5: callfunc "Func_Casing",13203,12148; break;
case 5: callfunc "Func_Casing",13203,12148; break; case 6: callfunc "Func_Casing",13200,12149; break;
case 6: callfunc "Func_Casing",13200,12149; break; case 7: callfunc "Func_Casing",13202,12150; break;
case 7: callfunc "Func_Casing",13202,12150; break; case 8: callfunc "Func_Casing",13201,12151; break;
case 8: callfunc "Func_Casing",13201,12151; break; default:
case 9: mes "[Kenny]";
default: mes "Alright. If there's";
mes "[Kenny]"; mes "something else I can help";
mes "Alright. If there's"; mes "you with, please tell me.";
mes "something else I can help"; close;
mes "you with, please tell me.";
close;
} }
close; close;
} }
@ -77,30 +75,28 @@ function script Func_Casing {
mes "You can trade a maximum of 50."; mes "You can trade a maximum of 50.";
mes "Input 0 if you want to cancel."; mes "Input 0 if you want to cancel.";
next; next;
input .@caser_amount; input .@amount;
mes "[Kenny]"; mes "[Kenny]";
if(.@caser_amount < 1) { if(.@amount < 1) {
mes "Alright. If there's"; mes "Alright. If there's";
mes "something else I can help"; mes "something else I can help";
mes "you with, please tell me."; mes "you with, please tell me.";
close; close;
} }
if(.@caser_amount > 50) { if(.@amount > 50) {
mes "You've exceeded the limit!"; mes "You've exceeded the limit!";
mes "Try again next time?"; mes "Try again next time?";
close; close;
} }
set .@caser_bullet, .@caser_amount * 500;
//Weight checking //Weight checking
if(checkweight(getarg(1), .@caser_amount) != 1) { if(checkweight(getarg(1), .@amount) != 1) {
mes "You are overweight."; mes "You are overweight.";
mes "Please clear your inventory."; mes "Please clear your inventory.";
close; close;
} }
//Materials checking //Materials checking
if(countitem(getarg(0)) < .@caser_bullet) { if(countitem(getarg(0)) < .@amount * 500) {
mes "Huh......"; mes "Huh......";
mes "You don't have enough"; mes "You don't have enough";
mes "materials to trade for"; mes "materials to trade for";
@ -111,7 +107,7 @@ function script Func_Casing {
} }
//Zeny checking //Zeny checking
if(Zeny < .@caser_bullet) { if(Zeny < .@amount * 500) {
mes "Erm... You don't have enough money."; mes "Erm... You don't have enough money.";
mes "The fee is 500 zeny"; mes "The fee is 500 zeny";
mes "Check your zeny and come again."; mes "Check your zeny and come again.";
@ -124,8 +120,8 @@ function script Func_Casing {
mes "I'll get you the Packs right away."; mes "I'll get you the Packs right away.";
else else
mes "I'll get you the Casings right away."; mes "I'll get you the Casings right away.";
set Zeny, Zeny - .@caser_bullet; set Zeny, Zeny - .@amount * 500;
delitem getarg(0), .@caser_bullet; delitem getarg(0), .@amount * 500;
getitem getarg(1), .@caser_amount; getitem getarg(1), .@amount;
close; close;
} }

View File

@ -13,7 +13,7 @@
//= 1.1 Converted from Aegis [Paradox924X] //= 1.1 Converted from Aegis [Paradox924X]
//= 1.2 More optimized conversion [Legionaire] //= 1.2 More optimized conversion [Legionaire]
//= 1.2a Removed .GATs [Lupus] //= 1.2a Removed .GATs [Lupus]
//= 1.3 Fixed [Playtester] //= 1.3 Fixed [Playtester] Optimized. Got rid of @vars [Lupus]
//============================================================ //============================================================
que_ng,187,156,3 script Bullet Dealer Tony 86,{ que_ng,187,156,3 script Bullet Dealer Tony 86,{
@ -31,18 +31,18 @@ que_ng,187,156,3 script Bullet Dealer Tony 86,{
mes "And pay money~!"; mes "And pay money~!";
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 1: callfunc "Bullet_Trade",937,10,13205; break;
case 2: callfunc "Bullet_Trade",7097,2,13203; break; case 2: callfunc "Bullet_Trade",7097,2,13203; break;
case 3: callfunc "Bullet_Trade",7053,3,13204; break; case 3: callfunc "Bullet_Trade",7053,3,13204; break;
case 4: callfunc "Bullet_Trade",1024,5,13206; break; case 4: callfunc "Bullet_Trade",1024,5,13206; break;
case 5: callfunc "Bullet_Trade",7054,2,13207; break; case 5: callfunc "Bullet_Trade",7054,2,13207; break;
case 6: default:
mes "[Tony]"; mes "[Tony]";
mes "Mmm~ Okay~"; mes "Mmm~ Okay~";
mes "Please visit again~"; mes "Please visit again~";
mes "I, Bullet-tooth Tony,"; mes "I, Bullet-tooth Tony,";
mes "Will always be here~!!!"; mes "Will always be here~!!!";
close; close;
} }
} }
mes "I'm a trader who supplies"; mes "I'm a trader who supplies";
@ -70,27 +70,24 @@ function script Bullet_Trade {
mes "The maximum number you can trade is 500."; mes "The maximum number you can trade is 500.";
mes "If you want to cancel, input 0."; mes "If you want to cancel, input 0.";
next; next;
input .@input; input .@amount;
set @tony,.@input;
set @tony1,.@input;
set @tony2,.@input * getarg(1);
mes "[Tony]"; mes "[Tony]";
if (.@input < 1 || .@input > 500) { if (.@amount < 1 || .@amount > 500) {
mes "Invalid Amount!"; mes "Invalid Amount!";
mes "Enter again~!"; mes "Enter again~!";
close; close;
} else if ((countitem(1010) >= @tony) && (countitem(1011) >= @tony1) && (countitem(getarg(0)) >= @tony2)) { } else if (countitem(1010) >= .@amount && countitem(1011) >= .@amount && countitem(getarg(0)) >= (.@amount*getarg(1))) {
if (checkweight(getarg(2),.@input * 30) == 0) { if (checkweight(getarg(2),.@amount * 30) == 0) {
mes "I cannot give it to you because your inventory is full. Come back after your inventory has more space."; mes "I cannot give it to you because your inventory is full. Come back after your inventory has more space.";
close; close;
} else { } else {
mes "Oh~ Good!"; mes "Oh~ Good!";
mes "Trade number checked!"; mes "Trade number checked!";
mes "I'll trade immediately."; mes "I'll trade immediately.";
delitem 1010,@tony; delitem 1010,.@amount;
delitem 1011,@tony1; delitem 1011,.@amount;
delitem getarg(0),@tony2; delitem getarg(0),.@amount * getarg(1);
getitem getarg(2),.@input * 30; getitem getarg(2),.@amount * 30;
close; close;
} }
} else { } else {

View File

@ -3,7 +3,7 @@
//===== By: ================================================== //===== By: ==================================================
//= eAthena dev team //= eAthena dev team
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 1.2 //= 1.2a
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= eAthena 1.0 //= eAthena 1.0
//===== Description: ========================================= //===== Description: =========================================
@ -14,22 +14,19 @@
//= id of the 2 required items plus the amount. Can trade //= id of the 2 required items plus the amount. Can trade
//= up to 500 units (5,000 kunais) at once. [erKURITA] //= up to 500 units (5,000 kunais) at once. [erKURITA]
//= 1.1 Officialized script [Playtester] //= 1.1 Officialized script [Playtester]
//= 1.2 Optimized/cleaned up a bit [ultramage] //= 1.2a Optimized/cleaned up a bit [ultramage]
//============================================================ //============================================================
que_ng,72,29,3 script Kunai Merchant Kashin 83,{ que_ng,72,29,3 script Kunai Merchant Kashin 83,{
if(BaseJob != Job_Ninja) mes "[Kashin]";
{ if(BaseJob != Job_Ninja) {
mes "[Kashin]";
mes "I am Kashin of the Wind. I distribute trade items to the shadows."; mes "I am Kashin of the Wind. I distribute trade items to the shadows.";
next; next;
mes "[Kashin]"; mes "[Kashin]";
mes "It doesn't seem like you are a Ninja... Just take a good look around and be on your way."; mes "It doesn't seem like you are a Ninja... Just take a good look around and be on your way.";
close; close;
} }
mes "[Kashin]";
mes "I'm Kashin!"; mes "I'm Kashin!";
mes "If you're ever short on Shurikens, come and see me."; mes "If you're ever short on Shurikens, come and see me.";
next; next;
@ -38,15 +35,13 @@ que_ng,72,29,3 script Kunai Merchant Kashin 83,{
mes "Choose what you want."; mes "Choose what you want.";
next; next;
switch(select("Poison Kunais:Frost Kunais:Wind Kunais:Earth Kunais:Fire Kunais:Cancel")) switch(select("Poison Kunais:Frost Kunais:Wind Kunais:Earth Kunais:Fire Kunais:Cancel")) {
{
//usage: callfunc "Kunai_Trade",itemreqid1,itemreqct1,itemreqid2,itemreqct2,itemidtrade; //usage: callfunc "Kunai_Trade",itemreqid1,itemreqct1,itemreqid2,itemreqct2,itemidtrade;
case 1: callfunc "Kunai_Trade",13250,20,7524,1,13259; break; case 1: callfunc "Kunai_Trade",13250,20,7524,1,13259; break;
case 2: callfunc "Kunai_Trade",13251,8,7522,2,13255; break; case 2: callfunc "Kunai_Trade",13251,8,7522,2,13255; break;
case 3: callfunc "Kunai_Trade",13252,4,7523,2,13257; break; case 3: callfunc "Kunai_Trade",13252,4,7523,2,13257; break;
case 4: callfunc "Kunai_Trade",13253,2,7524,1,13256; break; case 4: callfunc "Kunai_Trade",13253,2,7524,1,13256; break;
case 5: callfunc "Kunai_Trade",13254,1,7521,2,13258; break; case 5: callfunc "Kunai_Trade",13254,1,7521,2,13258; break;
case 6:
default: default:
mes "[Kashin]"; mes "[Kashin]";
mes "Hmm~ Ok~"; mes "Hmm~ Ok~";
@ -66,44 +61,35 @@ function script Kunai_Trade {
mes "You can trade up to 500 packs at a time."; mes "You can trade up to 500 packs at a time.";
mes "If you don't want to trade, just enter 0 as the amount."; mes "If you don't want to trade, just enter 0 as the amount.";
next; next;
input .@amount;
input .@trade; mes "[Kashin]";
if(.@amount < 1) {
if(.@trade < 1)
{
mes "[Kashin]";
mes "Hmm~ Ok~"; mes "Hmm~ Ok~";
mes "Come again~"; mes "Come again~";
mes "I, Kashin of the Wind, will always be at this place."; mes "I, Kashin of the Wind, will always be at this place.";
close; close;
} }
if(.@trade > 500) if(.@amount > 500) {
{
mes "[Kashin]";
mes "You've exceeded the input amount!"; mes "You've exceeded the input amount!";
mes "Enter a valid number next time~!"; mes "Enter a valid number next time~!";
close; close;
} }
if(countitem(getarg(0)) < .@trade*getarg(1) || countitem(getarg(2)) < .@trade*getarg(3)) if(countitem(getarg(0)) < .@amount*getarg(1) || countitem(getarg(2)) < .@amount*getarg(3)) {
{
mes "[Kashin]";
mes "Hmm... this is no good~"; mes "Hmm... this is no good~";
mes "You don't have enough materials to trade in for the amount of Kunai's that you want."; mes "You don't have enough materials to trade in for the amount of Kunai's that you want.";
mes "Bring some more if you want this amount."; mes "Bring some more if you want this amount.";
close; close;
} }
if(checkweight(getarg(4), .@trade*10) == 0) if(checkweight(getarg(4), .@amount*10) == 0) {
{
mes "[Kashin]";
mes "Your bag is too full to carry the trade items. Come back after you made room for the traded items."; mes "Your bag is too full to carry the trade items. Come back after you made room for the traded items.";
close; close;
} }
mes "[Kashin]";
mes "Ok~ Very well!"; mes "Ok~ Very well!";
mes "Amount verified!"; mes "Amount verified!";
mes "Here are your traded items."; mes "Here are your traded items.";
delitem getarg(0),getarg(1)*.@trade; delitem getarg(0),getarg(1)*.@amount;
delitem getarg(2),getarg(3)*.@trade; delitem getarg(2),getarg(3)*.@amount;
getitem getarg(4),10*.@trade; getitem getarg(4),10*.@amount;
close; close;
} }