From 0e0e24f5222e3a536bf33f960e7a3a99f4b00eb6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 28 Apr 2022 11:01:17 -0300 Subject: Incomplete code --- npc/014-2-2/_import.txt | 1 + npc/014-2-2/valia.txt | 110 ++++++++++++++++++++++++++++++++++++++++++++++++ npc/034-4/exit.txt | 43 +++++++++++++++++-- npc/functions/maze.txt | 72 +++++++++++++++++++++++++++++-- 4 files changed, 220 insertions(+), 6 deletions(-) create mode 100644 npc/014-2-2/valia.txt (limited to 'npc') diff --git a/npc/014-2-2/_import.txt b/npc/014-2-2/_import.txt index 0c96b6aa0..4db8f66f6 100644 --- a/npc/014-2-2/_import.txt +++ b/npc/014-2-2/_import.txt @@ -1,3 +1,4 @@ // Map 014-2-2: Forsaken Inn // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/014-2-2/_warps.txt", +"npc/014-2-2/valia.txt", diff --git a/npc/014-2-2/valia.txt b/npc/014-2-2/valia.txt new file mode 100644 index 000000000..e0968bc9b --- /dev/null +++ b/npc/014-2-2/valia.txt @@ -0,0 +1,110 @@ +// TMW2 scripts. +// Authors: +// Jesusalva +// Description: +// Gemini Sisters Quest - Valia Gemini + +function script GeminiCheck { + .@st = getarg(0, 0); + if (getq(General_Narrator) < 16 || getq(HurnscaldQuest_Gemini) < .@st) { + warp "Save", 0, 0; + dispbottom l("You don't feel so well... And then, you're dead."); + die(); + end; + } +} + +// Valia Gemini +014-2-2,36,22,0 script Valia NPC_RED_WIZARD_F,{ + GeminiCheck(); + .@q = getq(HurnscaldQuest_Gemini); + mesn; + mesq l("Greetings, adventurer. I am Valia Gemini, owner of this abode."); + next; + mesn; + mesq l("I usually don't let anyone in, but I had to make an exception for the likes of you."); + next; + mesn; + mesq l("You see, I have a sister. Luvia Gemini. Very talented, but unfortunately, not enough to prevent being captured and brainwashed by Isbamuth."); + next; + mesn; + mesq l("I am sure you already fought him. And survived, too, apparently. Help her, and I will reward your efforts appropriately."); + next; + mesn; + mesq l("You can bring up to 3 other friends with you, but they must be on the same party as you and you must be the party leader."); + next; + select + l("I'm not interested, sorry."), + l("Why don't you go yourself?"), + l("Alright, I will help."); + mes ""; + switch (@menu) { + case 1: + close; + case 2: + mesn; + mesq l("Because Isbamuth is tracking me? It would be pointless if he noticed. If you can't even understand this, maybe I overestimated you, after all..."); + close; + } + // You accepted the quest + mesn; + // ...But you lack a party + if (getcharid(1) <= 0) { + mesq l("You don't have a party. You're useless to me."); + close; + } + // ...But you are not the leader + if (strcharinfo(0) != getpartyleader(getcharid(1))) { + mesq l("Bring me %s or make your own party if you want to help me.", getpartyleader(getcharid(1))); + close; + } + // ...But the party is too large + getpartymember(getcharid(1)); + .@count = $@partymembercount; + if (.@count > 4) { + mesq l("Your party is too big. Discretion is a key if we want to succeed."); + close; + } + // Alright. + mesq l("Good. I hope you have stocked everything. The time limit is 4 hours."); + mesc l("Are you and your party ready?"), 1; + if (askyesno() != ASK_YES) + close; + + mesn; + mesq l("Good. Here, take this key and hide it."); + compareandsetq HurnscaldQuest_Gemini, 0, 1; + + // Create instance + .@p=getcharid(1); + .@inst = instance_create("Gemini "+.@p, .@p, IOT_PARTY); + + // If it worked then setup + if (.@inst >= 0) { + // Attach maps + instance_attachmap("034-1", .@inst, false, "val1@"+.@p); + instance_attachmap("034-2", .@inst, false, "val2@"+.@p); + instance_attachmap("034-3", .@inst, false, "val3@"+.@p); + instance_attachmap("034-4", .@inst, false, "val4@"+.@p); + // Save the instance ID + $@VALIA_INST[.@p]=.@inst; + $@VALIA_MAP$[.@p]=""; + } + + // Instance lasts 4 hours - your time limit + instance_set_timeout(14400, 14400, $@VALIA_INST[.@p]); + + // Do we need to initialize or are we just restarting? + if (.@inst >= 0) + instance_init(.@inst); + + // Warp everyone and add timers + //partytimer("008-0", 1000, "Party Master::OnStart", getcharid(1)); + warpparty("val1@"+.@p, 24, 24, getcharid(1), "014-2-2", true); + + close; +OnInit: + .distance=4; + end; +} + diff --git a/npc/034-4/exit.txt b/npc/034-4/exit.txt index a20664099..3a6c5dfba 100644 --- a/npc/034-4/exit.txt +++ b/npc/034-4/exit.txt @@ -7,6 +7,7 @@ 034-4,144,82,0 script #GeminiFExit NPC_HIDDEN,0,0,{ OnWumpus: + GeminiCheck(); // TODO FIXME: Instead of 75% chance, a Wumpus Egg only on first victory if (any(true, true, true, false)) getitem WumpusEgg, 1; @@ -17,7 +18,13 @@ OnWumpus: end; OnTouch: - // if not (quest) end; + GeminiCheck(); + // Only the party leader go ahead + if (strcharinfo(0) != getpartyleader(getcharid(1))) { + mesq l("%s has the key.", getpartyleader(getcharid(1))); + close; + } + // Create maze and populate (From 45x45 to 60x60) CreateMaze(IOT_CHAR, MAZE_SIZE_M | MAZE_SIZE_G); .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; @@ -142,9 +149,39 @@ OnTouch: setunitdata(.@mob, UDT_DMOTION, 50); // Defeating the boss yields a bonus - InitMaze(7200); + .@old$=getmap(); + .@p=getcharid(1); + InitMaze(7200, false); + sleep2(500); + dispbottom l("It was a trap! We must escape!"); + $@VALIA_MAP$[.@p]=getmap(); + partytimer(.@old$, 2000, "#GeminiFExit::OnSick", .@p); + sleep2(2000); + @forced_sick$ = getmap(); + doevent "#DungeonCore::OnSick"; + end; + +OnSick: + .@p=getcharid(1); + MAZE_MAP$ = $@VALIA_MAP$[.@p]; + // Find random, warpable coordinates + .@e=0; .@x=0; .@y=0; + .@mx=50; + .@my=50; + do { + .@x = rand2(20, .@mx); + .@y = rand2(20, .@my); + .@e += 1; + if (.@e > 30) { + consolebug("Too many failures at Maze \"%s\"! Trying anyway!", MAZE_MAP$); + break; + } + } while (!checknpccell(MAZE_MAP$, .@x, .@y, cell_chkpass)); + + warp MAZE_MAP$, .@x, .@y; + sleep2(500); dispbottom l("It was a trap! We must escape!"); - sleep2(2500); + sleep2(2000); @forced_sick$ = getmap(); doevent "#DungeonCore::OnSick"; end; diff --git a/npc/functions/maze.txt b/npc/functions/maze.txt index 8867f09b8..3c5c13857 100644 --- a/npc/functions/maze.txt +++ b/npc/functions/maze.txt @@ -75,7 +75,7 @@ function script CreateMaze { } ///////////////////////////////////////////////////////////////////////////////// -// InitMaze(duration=2 hours) +// InitMaze(duration=2 hours, random=yes) // Puts maze to work and send player there. // Exit must have been configured prior to the maze. function script InitMaze { @@ -85,8 +85,13 @@ function script InitMaze { // Find random, warpable coordinates .@e=0; .@x=0; .@y=0; - .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; - .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; + if (getarg(1, true)) { + .@mx=getmapinfo(MAPINFO_SIZE_X, MAZE_MAP$)-20; + .@my=getmapinfo(MAPINFO_SIZE_Y, MAZE_MAP$)-20; + } else { + .@mx=50; + .@my=50; + } do { .@x = rand2(20, .@mx); .@y = rand2(20, .@my); @@ -126,4 +131,65 @@ function script RenewMaze { 030-12 mapflag zone MMO 030-13 mapflag zone MMO 030-14 mapflag zone MMO +030-15 mapflag zone MMO +030-16 mapflag zone MMO +030-17 mapflag zone MMO +030-18 mapflag zone MMO +030-19 mapflag zone MMO +030-20 mapflag zone MMO +030-21 mapflag zone MMO +030-22 mapflag zone MMO +030-23 mapflag zone MMO +030-24 mapflag zone MMO +030-25 mapflag zone MMO +030-26 mapflag zone MMO +030-27 mapflag zone MMO +030-28 mapflag zone MMO +030-29 mapflag zone MMO +030-30 mapflag zone MMO +030-31 mapflag zone MMO +030-32 mapflag zone MMO +030-33 mapflag zone MMO +030-34 mapflag zone MMO +030-35 mapflag zone MMO +030-36 mapflag zone MMO +030-37 mapflag zone MMO +030-38 mapflag zone MMO +030-39 mapflag zone MMO +030-40 mapflag zone MMO +030-41 mapflag zone MMO +030-42 mapflag zone MMO +030-43 mapflag zone MMO +030-44 mapflag zone MMO +030-45 mapflag zone MMO +030-46 mapflag zone MMO +030-47 mapflag zone MMO +030-48 mapflag zone MMO +030-49 mapflag zone MMO +030-50 mapflag zone MMO +030-51 mapflag zone MMO +030-52 mapflag zone MMO +030-53 mapflag zone MMO +030-54 mapflag zone MMO +030-55 mapflag zone MMO +030-56 mapflag zone MMO +030-57 mapflag zone MMO +030-58 mapflag zone MMO +030-59 mapflag zone MMO +030-60 mapflag zone MMO +030-61 mapflag zone MMO +030-62 mapflag zone MMO +030-63 mapflag zone MMO +030-64 mapflag zone MMO +030-65 mapflag zone MMO +030-66 mapflag zone MMO +030-67 mapflag zone MMO +030-68 mapflag zone MMO +030-69 mapflag zone MMO +030-70 mapflag zone MMO +030-71 mapflag zone MMO +030-72 mapflag zone MMO +030-73 mapflag zone MMO +030-74 mapflag zone MMO +030-75 mapflag zone MMO -- cgit v1.2.3-60-g2f50