summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjesusalva <cpntb1@ymail.com>2018-02-10 13:10:34 -0200
committerjesusalva <cpntb1@ymail.com>2018-02-10 13:10:34 -0200
commit4152c408d762c01cf5c27ef89289c21041140c10 (patch)
tree595824823545ef8689a5643dd0997a1a745cc51b
parent4c775bf118845058299c27c859138f147e15d972 (diff)
downloadserverdata-4152c408d762c01cf5c27ef89289c21041140c10.tar.gz
serverdata-4152c408d762c01cf5c27ef89289c21041140c10.tar.bz2
serverdata-4152c408d762c01cf5c27ef89289c21041140c10.tar.xz
serverdata-4152c408d762c01cf5c27ef89289c21041140c10.zip
Fix and update the Well. Not really happy with it, though
-rw-r--r--npc/003-1/well.txt78
1 files changed, 36 insertions, 42 deletions
diff --git a/npc/003-1/well.txt b/npc/003-1/well.txt
index c7e272213..272deda1a 100644
--- a/npc/003-1/well.txt
+++ b/npc/003-1/well.txt
@@ -1,54 +1,48 @@
// Author:
// Saulc
+// Jesusalva
003-1,45,80,0 script Well NPC_NO_SPRITE,{
+ .@COST_PER_BOTTLE = 50;
- .Item1 = IronOre; //7
- .GP = 8500;
- .ItemCreate = IronIngot;
-
- function quest_create {
- speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("How many ingots do you want to make?");
- input .amount;
-
- if (countitem("Iron Ore") >= .amount * 7 && Zeny >= 8500 * .amount)
- {
- delitem .Item1, .amount * 7;
- Zeny = Zeny - .amount * .GP;
- getitem .ItemCreate, .amount;
- close;
- }
- speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("You don't have enough ore.");
+ mes l("This well have a mechanism to fill water bottles. It costs @@ gp per bottle.", .@COST_PER_BOTTLE);
+ mes l("You need the bottle, too. Too bad, not even water is free in this world!");
+ input .@count;
+
+ if (.@count == 0)
close;
-
- }
-
- speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("Hello! Do you want to craft @@? For that I will need 7 @@, and @@ gp.", getitemlink(.ItemCreate),getitemlink(.Item1),.GP);
-
- do
- {
- .@karim = getq(Karim_Quest);
- select
- l("Yes"),
- menuaction(l("Quit"));
-
- switch (@menu)
- {
- case 1:
- quest_create;
- break;
- }
- } while (@menu != 2);
-
- closedialog;
- goodbye;
+ .@Cost = .@count * .@COST_PER_BOTTLE;
+ .@empty = countitem("EmptyBottle");
+
+ if (.@empty < .@count)
+ goto L_NotEnoughBottles;
+ if (Zeny < .@Cost)
+ goto L_NotEnoughMoney;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem("BottleOfSweaWater") == 0
+ && .@empty > .@count)
+ goto L_NotEnoughSlots;
+
+ set Zeny, Zeny - .@Cost;
+ delitem "EmptyBottle", .@count;
+ getitem "BottleOfSweaWater", .@count; // TODO FIXME: "Swea" water? Also, this is not sea water...
+ close;
+
+L_NotEnoughBottles:
+ mes l("You don't have that many empty bottles!");
+ close;
+
+L_NotEnoughMoney:
+ mes l("You don't have enough gp! You need @@ gp.", .@Cost);
+ close;
+
+L_NotEnoughSlots:
+ mes l("You don't have room for these bottles!");
close;
OnInit:
- .sex = G_MALE;
+ .sex = G_OTHER;
.distance = 3;
end;
}