summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Philipps <Turmfalke2007@web.de>2010-07-08 18:46:26 +0200
committerMaximilian Philipps <Turmfalke2007@web.de>2010-07-08 18:46:26 +0200
commitc94cc7043c255ac8b05494018eccffffe03ac9b7 (patch)
treeb3e065014964f2b1d9b8bbcfab9293b97413d28b
parente931cf24d15378956471e4c44b2f18aac07f07fd (diff)
parent43093b041b6b892d30c936df4f152573a16046b1 (diff)
downloadserverdata-c94cc7043c255ac8b05494018eccffffe03ac9b7.tar.gz
serverdata-c94cc7043c255ac8b05494018eccffffe03ac9b7.tar.bz2
serverdata-c94cc7043c255ac8b05494018eccffffe03ac9b7.tar.xz
serverdata-c94cc7043c255ac8b05494018eccffffe03ac9b7.zip
Merge branch 'master' of git@gitorious.org:tmw-eathena-data/mainline
-rw-r--r--npc/021-1_Tulimshar/north_shops.txt4
-rw-r--r--npc/functions/banker.txt12
-rw-r--r--npc/functions/water_bottle.txt34
-rw-r--r--npc/scripts.conf1
4 files changed, 47 insertions, 4 deletions
diff --git a/npc/021-1_Tulimshar/north_shops.txt b/npc/021-1_Tulimshar/north_shops.txt
index 6d38531c..333b88e1 100644
--- a/npc/021-1_Tulimshar/north_shops.txt
+++ b/npc/021-1_Tulimshar/north_shops.txt
@@ -33,6 +33,10 @@
close;
}
+021-1.gat,129,40,0 script Well 127,{
+ callfunc "WaterBottle";
+}
+
// An officer (for security)
021-1.gat,130,38,0 script Officer 150,{
mes "[Officer]";
diff --git a/npc/functions/banker.txt b/npc/functions/banker.txt
index 6a43b90d..025647d2 100644
--- a/npc/functions/banker.txt
+++ b/npc/functions/banker.txt
@@ -8,7 +8,8 @@ L_Start:
mes "\"Welcome to the bank!";
mes "How can I help you?\"";
next;
- menu "Deposit", L_Dep,
+ menu
+ "Deposit", L_Dep,
"Withdraw", L_With,
"Check my balance", L_Balance,
"Nevermind", L_Nev;
@@ -17,7 +18,7 @@ L_Dep:
mes "[" + @npcName$ + "]";
mes "\"How much would you like to deposit?\"";
next;
- menu
+ menu
"Other", L_Dep_Input,
"5,000 GP", L_Dep_5k,
"10,000 GP", L_Dep_10k,
@@ -30,13 +31,15 @@ L_Dep:
"All of my money", L_Dep_All,
"I've changed my mind", L_Start,
"Quit", -;
+ return;
L_Dep_Input:
input @Amount;
if (@Amount >= 0) goto L_Dep_Continue;
mes "[" + @npcName$ + "]";
mes "\"I need a positive amount. What would you like to do?\"";
- menu "Go back", L_Start,
+ menu
+ "Go back", L_Start,
"Try again", L_Dep_Input,
"Deposit all", L_Dep_All,
"Quit", -;
@@ -115,7 +118,8 @@ L_With_Input:
if (@Amount >= 0) goto L_With_Continue;
mes "[" + @npcName$ + "]";
mes "\"I need a positive amount. What would you like to do?\"";
- menu "Go back", L_Start,
+ menu
+ "Go back", L_Start,
"Try again", L_With_Input,
"Withdraw all", L_With_All,
"Quit", -;
diff --git a/npc/functions/water_bottle.txt b/npc/functions/water_bottle.txt
new file mode 100644
index 00000000..c2d9a1e0
--- /dev/null
+++ b/npc/functions/water_bottle.txt
@@ -0,0 +1,34 @@
+// Fills empty bottles with water
+
+function script WaterBottle {
+ set @COST_PER_BOTTLE, 150;
+
+ mes "How many empty bottles do you want to fill with water? It costs " + @COST_PER_BOTTLE + "gp per bottle.";
+ input @count;
+
+ if (@count == 0) close;
+ set @cost, @count * @COST_PER_BOTTLE;
+ set @empty, countitem("EmptyBottle");
+
+ if (@empty < @count) goto L_NotEnoughBottles;
+ if (zeny < @cost) goto L_NotEnoughMoney;
+ getinventorylist;
+ if (@inventorylist_count == 100 && countitem("BottleOfWater") == 0 && @empty > @count) goto L_NotEnoughSlots;
+
+ set zeny, zeny - @cost;
+ delitem "EmptyBottle", @count;
+ getitem "BottleOfWater", @count;
+ close;
+
+L_NotEnoughBottles:
+ mes "You don't have that many empty bottles!";
+ close;
+
+L_NotEnoughMoney:
+ mes "You don't have enough gp! You need " + @cost + "gp.";
+ close;
+
+L_NotEnoughSlots:
+ mes "You don't have room for these bottles!";
+ close;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index d630571b..b61e0c62 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -12,6 +12,7 @@ npc: npc/functions/mob_points.txt
npc: npc/functions/process_equip.txt
npc: npc/functions/slot_machine.txt
npc: npc/functions/soul_menhir.txt
+npc: npc/functions/water_bottle.txt
// Item Functions
npc: npc/items/purification_potion.txt