summaryrefslogtreecommitdiff
path: root/npc/024-9
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 21:44:22 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 21:44:22 -0300
commita7c45a192268da2601cef47a4cdba987ae2327ca (patch)
treec5fb5b97db109fe7106496dd96498c475881046b /npc/024-9
downloadserverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.gz
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.bz2
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.xz
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.zip
Initial commit (Moubootaur Legends fork)
Diffstat (limited to 'npc/024-9')
-rw-r--r--npc/024-9/_import.txt5
-rw-r--r--npc/024-9/_warps.txt3
-rw-r--r--npc/024-9/barkeeper.txt54
-rw-r--r--npc/024-9/sake.txt175
4 files changed, 237 insertions, 0 deletions
diff --git a/npc/024-9/_import.txt b/npc/024-9/_import.txt
new file mode 100644
index 0000000..b196b3f
--- /dev/null
+++ b/npc/024-9/_import.txt
@@ -0,0 +1,5 @@
+// Map 024-9: Frostia Indoors
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/024-9/_warps.txt",
+"npc/024-9/barkeeper.txt",
+"npc/024-9/sake.txt",
diff --git a/npc/024-9/_warps.txt b/npc/024-9/_warps.txt
new file mode 100644
index 0000000..6606fb7
--- /dev/null
+++ b/npc/024-9/_warps.txt
@@ -0,0 +1,3 @@
+// This file is generated automatically. All manually added changes will be removed when running the Converter.
+// Map 024-9: Frostia Indoors warps
+024-9,41,38,0 warp #024-9_41_38 0,0,024-1,134,49
diff --git a/npc/024-9/barkeeper.txt b/npc/024-9/barkeeper.txt
new file mode 100644
index 0000000..2bdd419
--- /dev/null
+++ b/npc/024-9/barkeeper.txt
@@ -0,0 +1,54 @@
+// TMW-2 Script
+// Author:
+// Jesusalva
+// Description:
+// Sells beer
+
+// Temporary Sprite
+024-9,39,31,0 script Bar Jobs NPC_DWARF_TRADER,{
+ hello;
+ npcshopattach(.name$);
+ shop .name$;
+ close;
+
+OnInit:
+ sleep(SHOPWAIT);
+ tradertype(NST_MARKET);
+
+ sellitem DwarvenSake, 1100, 1;
+ sellitem Beer, 300, 20;
+ if ($ARKIM_ST >= 4000)
+ sellitem ClothoLiquor, -1, (($ARKIM_ST-4000)/500)+1;
+ if ($ARKIM_ST >= 4700)
+ sellitem LachesisBrew, -1, (($ARKIM_ST-4700)/500)+1;
+ if (!rand2(10))
+ sellitem JasmineTea, getiteminfo(JasmineTea, ITEMINFO_BUYPRICE)*15/10, rand2(1,3);
+
+ .sex = G_MALE;
+ .distance = 5;
+ end;
+
+OnClock2358:
+ restoreshopitem DwarvenSake, 1100, 1;
+ restoreshopitem Beer, 300, 20;
+ if ($ARKIM_ST >= 4000)
+ restoreshopitem ClothoLiquor, (($ARKIM_ST-4000)/500)+1;
+ if ($ARKIM_ST >= 4700)
+ restoreshopitem LachesisBrew, (($ARKIM_ST-4700)/500)+1;
+ if (!rand2(10))
+ restoreshopitem JasmineTea, getiteminfo(JasmineTea, ITEMINFO_BUYPRICE)*15/10, rand2(1,3);
+ end;
+
+// Pay your taxes!
+OnBuyItem:
+ debugmes("Purchase confirmed");
+ PurchaseTaxes();
+ end;
+
+OnSellItem:
+ debugmes("Sale confirmed");
+ SaleTaxes();
+ end;
+
+}
+
diff --git a/npc/024-9/sake.txt b/npc/024-9/sake.txt
new file mode 100644
index 0000000..61e1aab
--- /dev/null
+++ b/npc/024-9/sake.txt
@@ -0,0 +1,175 @@
+// TMW2 Scripts
+// Author:
+// Jesusalva
+// Description:
+// Dwarven Sake, the most powerful beverage which is not a rare
+// Variables:
+// DWARVEN_DATE = When the Sake started being done
+// DWARVEN_DONE = When the Sake will be ready
+// DWARVEN_AMMO = How much Sake you're trying to make
+// Success Rate is based on how much you're trying to do and how long ago that was
+
+024-9,43,30,0 script Sake Barrel NPC_NO_SPRITE,{
+ goto L_Main;
+ // dwarvensake_chance()
+ // Returns chance (0~10,000) to successfully obtain sake
+ // DWARVEN_DONE/DWARVEN_DATE is taken in account
+ function dwarvensake_chance {
+ .@max=10000;
+ .@base=DWARVEN_DATE;//-(DWARVEN_DONE-DWARVEN_DATE);
+ // .@c = how much time is left until completion
+ // .@d = original amount of time required
+ // .@e = Current time
+ .@c=DWARVEN_DONE-.@base; //-gettimetick(2);
+ .@d=DWARVEN_DATE-.@base; //-DWARVEN_DONE;
+ .@e=gettimetick(2)-.@base;
+
+ // We must divide everything by 10 to cause imprecision
+ // aka. don't cause overflow bug
+ .@c=.@c/10;
+ .@d=.@d/10;
+ .@e=.@e/10;
+
+ //debugmes "%d - %d - %d", .@d, .@e, .@c;
+ //debugmes "Start - Now - Finish";
+ if (.@c == 0)
+ return .@max;
+ if ($@GM_OVERRIDE) debugmes "Ratio: %d/%d = %d", .@e, .@c, (.@e*.@max)/.@c;
+ return min(10000, (.@e*.@max)/.@c);
+ }
+
+L_Main:
+ if (!DWARVEN_DATE) {
+ mesn;
+ mesc l("Do you want to make sake?");
+ mesc l("This barrel is a courtesy from Dimond Cove Inn.");
+ next;
+ select
+ l("Information"),
+ l("Yes"),
+ l("No");
+ mes "";
+
+ switch (@menu) {
+ case 1:
+ mesc l("Produced item:");
+ mesc l("@@", getitemlink(DwarvenSake));
+ mes "";
+ mesc l("Cost per two glass:");
+ mesc l("* @@/@@ @@", countitem(ArtichokeHerb), 25, getitemlink(ArtichokeHerb));
+ mesc l("* @@/@@ @@", countitem(MauveHerb), 25, getitemlink(MauveHerb));
+ mesc l("* @@/@@ @@", countitem(CobaltHerb), 25, getitemlink(CobaltHerb));
+ mesc l("* @@/@@ @@", countitem(GambogeHerb), 25, getitemlink(GambogeHerb));
+ mesc l("* @@/@@ @@", countitem(AlizarinHerb), 25, getitemlink(AlizarinHerb));
+ mesc l("* @@/@@ @@", countitem(ShadowHerb), 20, getitemlink(ShadowHerb));
+ mesc l("* @@ Water Bottle", 1);
+ next;
+ break;
+ case 2:
+ mesc l("How many batches do you want to produce? (max. 5)");
+ input .@glass_count;
+ if (.@glass_count < 1 ||
+ .@glass_count > 5 ||
+ countitem(ArtichokeHerb) < 25*.@glass_count ||
+ countitem(MauveHerb) < 25*.@glass_count ||
+ countitem(CobaltHerb) < 25*.@glass_count ||
+ countitem(GambogeHerb) < 25*.@glass_count ||
+ countitem(AlizarinHerb) < 25*.@glass_count ||
+ countitem(ShadowHerb) < .@glass_count*20
+ ) {
+ mesc l("Not enough ingredients or invalid amount."), 1;
+ break;
+ }
+ mesc l("Which water will you use?");
+ mesc l("The bottom-most the water, the better the bonus.");
+ menuint
+ l("Cancel"), -1,
+ rif(countitem(BottleOfSewerWater) >= .@glass_count, l("Sewer Water")), 0,
+ rif(countitem(BottleOfSeaWater) >= .@glass_count, l("Sea Water")), 3600,
+ rif(countitem(BottleOfTonoriWater) >= .@glass_count, l("Tonori Water")), 11760,
+ rif(countitem(BottleOfWoodlandWater) >= .@glass_count, l("Woodland Water")), 12000,
+ rif(countitem(BottleOfDivineWater) >= .@glass_count, l("Divine Water")), 21600;
+ mes "";
+ if (@menuret < 0)
+ break;
+ switch (@menuret) {
+ case 0:
+ .@bonus=@menuret;
+ .@water=BottleOfSewerWater;
+ break;
+ case 3600:
+ .@bonus=@menuret;
+ .@water=BottleOfSeaWater;
+ break;
+ case 11760:
+ .@bonus=@menuret;
+ .@water=BottleOfTonoriWater;
+ break;
+ case 12000:
+ .@bonus=@menuret;
+ .@water=BottleOfWoodlandWater;
+ break;
+ case 21600:
+ .@bonus=@menuret;
+ .@water=BottleOfDivineWater;
+ break;
+ default:
+ mesc l("Error, invalid return code, blame Saulc"), 1;
+ mes "==== SCRIPT ABORTED";
+ close;
+ }
+
+ // Save data
+ delitem ArtichokeHerb, .@glass_count*25;
+ delitem MauveHerb, .@glass_count*25;
+ delitem CobaltHerb, .@glass_count*25;
+ delitem GambogeHerb, .@glass_count*25;
+ delitem AlizarinHerb, .@glass_count*25;
+ delitem ShadowHerb, .@glass_count*20;
+ delitem .@water, .@glass_count;
+ DWARVEN_AMMO=.@glass_count;
+ DWARVEN_DATE=gettimetick(2);
+ DWARVEN_DONE=gettimetick(2)-.@bonus+.mintime;
+ DWARVEN_DONE+=.cuptime*DWARVEN_AMMO;
+ break;
+ case 3:
+ close;
+ break;
+ }
+ goto L_Main;
+ } else {
+ mesn;
+ mesc l("Your request for @@ @@ are being fermented for @@.", DWARVEN_AMMO, getitemlink(DwarvenSake), FuzzyTime(DWARVEN_DATE));
+ next;
+ inventoryplace DwarvenSake, DWARVEN_AMMO;
+ mesn;
+ mes l("Trying to retrieve it now will have @@ % chance to be successful.", dwarvensake_chance()/100);
+ mes l("Attempt to retrieve it now?");
+ next;
+ if (askyesno() == ASK_YES) {
+ if (rand(1000,10000) < dwarvensake_chance()) {
+ mesc l("Success!"), 3;
+ getitem DwarvenSake, DWARVEN_AMMO*2;
+ } else {
+ mesc l("The sake wasn't ready yet and you lost it..."), 1;
+ }
+ DWARVEN_DATE=0;
+ DWARVEN_AMMO=0;
+ }
+ }
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 4;
+
+ // Time to make each batch (12 hours)
+ .cuptime=(60*60*12);
+ // Base time to make any amount of cups (72 hours)
+ .mintime=(60*60*72);
+ end;
+
+}
+
+
+