summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-09-18 21:40:22 -0300
committerJesusaves <cpntb1@ymail.com>2019-09-18 21:40:22 -0300
commit8bcd2b6d501e620a4992ee4efc2ce8826b8a5d5e (patch)
tree630bf04c314e6937926d02bea4d97eda1a5f550c
parent95726044bba83ce3e893efd4ac978df062ff59dd (diff)
downloadserverdata-8bcd2b6d501e620a4992ee4efc2ce8826b8a5d5e.tar.gz
serverdata-8bcd2b6d501e620a4992ee4efc2ce8826b8a5d5e.tar.bz2
serverdata-8bcd2b6d501e620a4992ee4efc2ce8826b8a5d5e.tar.xz
serverdata-8bcd2b6d501e620a4992ee4efc2ce8826b8a5d5e.zip
Maxime: Rewrite the code to use a function
-rw-r--r--npc/003-0-1/maxime.txt43
1 files changed, 25 insertions, 18 deletions
diff --git a/npc/003-0-1/maxime.txt b/npc/003-0-1/maxime.txt
index d8e918b1d..10a9cd46c 100644
--- a/npc/003-0-1/maxime.txt
+++ b/npc/003-0-1/maxime.txt
@@ -6,6 +6,7 @@
// Bakes Tonori Delight
003-0-1,77,40,0 script Maxime NPC_PLAYER,{
+ function MaximeOven;
mesn;
mesq l("Hello. I know the secrets of the legendary @@.", getitemlink(TonoriDelight));
next;
@@ -28,6 +29,27 @@
if (@menu == 2)
goto L_Close;
+ if (!MaximeOven())
+ goto L_Missing;
+
+ mesn;
+ mesq l("Here you go, fresh from the oven!");
+ next;
+
+L_Close:
+ closedialog;
+ goodbye;
+ close;
+
+L_Missing:
+ mesn;
+ mesq l("You don't have everything I asked you for.");
+ next;
+ mesn;
+ mesq l("I always wonder if I should raise my price to teach bad kids to don't lie.");
+ close;
+
+function MaximeOven {
if (
countitem(MaggotSlime) < 12 ||
countitem(Plushroom) < 8 ||
@@ -35,7 +57,7 @@
countitem(ScorpionStinger) < 3 ||
countitem(CactusDrink) < 2 ||
countitem(RoastedMaggot) < 1 ||
- Zeny < 120) goto L_Missing;
+ Zeny < 120) return false;
// 4~7 normaly, 5~10 during Summer
// Xanthem Patch: +20% craft and -20% effect
@@ -54,23 +76,8 @@
}
Zeny=Zeny-120;
getexp rand2(30, 60), 0;
-
- mesn;
- mesq l("Here you go, fresh from the oven!");
- next;
-
-L_Close:
- closedialog;
- goodbye;
- close;
-
-L_Missing:
- mesn;
- mesq l("You don't have everything I asked you for.");
- next;
- mesn;
- mesq l("I always wonder if I should raise my price to teach bad kids to don't lie.");
- close;
+ return true;
+}
OnInit:
.@npcId = getnpcid(.name$);