summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-28 23:25:03 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-28 23:25:03 -0300
commit2486a1dd2b67bfea7722f793d1c9f180fcc8d57a (patch)
tree07f64d5ceb18887468aaa13af9e7ac8affd99abf /npc
parent15e29af281ce4dae2c945281b995d2831a621640 (diff)
downloadserverdata-2486a1dd2b67bfea7722f793d1c9f180fcc8d57a.tar.gz
serverdata-2486a1dd2b67bfea7722f793d1c9f180fcc8d57a.tar.bz2
serverdata-2486a1dd2b67bfea7722f793d1c9f180fcc8d57a.tar.xz
serverdata-2486a1dd2b67bfea7722f793d1c9f180fcc8d57a.zip
*evil laugh*
Diffstat (limited to 'npc')
-rw-r--r--npc/012-1/mahad.txt49
1 files changed, 32 insertions, 17 deletions
diff --git a/npc/012-1/mahad.txt b/npc/012-1/mahad.txt
index 9fd44fd75..5195b7045 100644
--- a/npc/012-1/mahad.txt
+++ b/npc/012-1/mahad.txt
@@ -6,29 +6,44 @@
// Mahad is the Hurnscald Well Master
// ...Well, he takes the water from the pond, but you shouldn't mind this.
// It's still safe to drink, 100% warranted!
-// TODO: Chance to lose 3 GP by getting a fish instead of a water bottle
+// Note: You may get a Grass Carp (worth 100 GP) instead. Bottle is lost? O.o
012-1,117,54,0 script Mahad NPC_PLAYER,{
mesn;
- mes l("I can fill your bottle with water for only @@ gp the bottle.", .COST_PER_BOTTLE);
+ mes l("I can fill your bottle with water for only @@ gp the bottle.", .price);
mes l("After all, I am the Well Master!");
input .@count;
- if (.@count == 0)
+
+ if (!.@count)
close;
- .@Cost = .@count * .COST_PER_BOTTLE;
- .@empty = countitem(EmptyBottle);
-
- if (.@empty < .@count)
- goto L_NotEnoughBottles;
- if (Zeny < .@Cost)
- goto L_NotEnoughMoney;
- getinventorylist;
- inventoryplace BottleOfWoodlandWater, .@count;
-
- Zeny=Zeny-.@Cost;
- delitem EmptyBottle, .@count;
- getitem BottleOfWoodlandWater, .@count;
+
+ .@gp = .@count * .price;
+
+ if (Zeny < .@gp) {
+ mesc l("Not enough money.");
+ close;
+ }
+
+ if (countitem(EmptyBottle) < .@count) {
+ mesc l("Not enough bottles.");
+ close;
+ }
+
+ inventoryplace GrassCarp, .@count, BottleOfWoodlandWater, .@count;
+
+ // Calculate how many grass carp you'll get
+ .@iced=0;
+ for (.@i=0; .@i < .@count; .@i++) {
+ if (rand(1,1000) < 11)
+ .@iced++;
+ }
+
+ // Apply the results and have a happy day!
+ Zeny-=.@gp;
+ if (.@iced)
+ getitem GrassCarp, .@iced;
+ getitem BottleOfWoodlandWater, .@count-.@iced;
close;
L_NotEnoughBottles:
@@ -44,7 +59,7 @@ L_NotEnoughMoney:
close;
OnInit:
- .COST_PER_BOTTLE = 60;
+ .price = 60;
.sex = G_MALE;
.distance = 7;