summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbby Hulka <abby.hulka@gmail.com>2023-03-04 21:24:09 +0000
committerAbby Hulka <abby.hulka@gmail.com>2023-03-04 21:24:09 +0000
commit55520573a1b9a03df31bd548ad5cec06294d0009 (patch)
treebe3d047f1ad944700b7044890cd74cdc3a674d27
parente748f6029e1509481b78005a38cffaae909ecc8f (diff)
downloadserverdata-55520573a1b9a03df31bd548ad5cec06294d0009.tar.gz
serverdata-55520573a1b9a03df31bd548ad5cec06294d0009.tar.bz2
serverdata-55520573a1b9a03df31bd548ad5cec06294d0009.tar.xz
serverdata-55520573a1b9a03df31bd548ad5cec06294d0009.zip
Hatchling for Nurse May quest
-rw-r--r--npc/006-2-6/hatchling.txt135
1 files changed, 135 insertions, 0 deletions
diff --git a/npc/006-2-6/hatchling.txt b/npc/006-2-6/hatchling.txt
new file mode 100644
index 000000000..347769e3e
--- /dev/null
+++ b/npc/006-2-6/hatchling.txt
@@ -0,0 +1,135 @@
+// Evol scripts.
+// Author:
+// Travolta
+// +seeds
+// Description:
+// A piou hatchling who escaped his nurse and fled to the castle. He's been terrorizing the staff.
+// Variables:
+// none
+
+function script ArtisFlyingPiouLogic {
+ .@tick = gettimetick(1);
+ .@LastTimeTouched = getvariableofnpc(.LastTimeTouched, strnpcinfo(3));
+ if (.@tick > .@LastTimeTouched + 300)
+ {
+ .speed = 200;
+ set getvariableofnpc(.LastPlayerTouched, strnpcinfo(3)), -1;
+ }
+ .@rnd = rand(5) - 3;
+ if (.@rnd > 0)
+ return execmovecmd("wait " + .@rnd);
+ return 0;
+}
+
+006-2-6,38,28,0 script #Hatchling NPC_FLYING_PIOU,{
+ .@q=getq(LilitQuest_Hatchling);
+ function TryCatchPiou {
+ .@agi = readparam(bAgi);
+ @ArtisQuests_CatchPiouTries += 1;
+ getmapxy(.@map$, .@x1, .@y1, 1);
+ getmapxy(.@map$, .@x2, .@y2, 0);
+ .@distance = distance(.@x1, .@y1, .@x2, .@y2);
+ .@chance = max(ArtisQuests_CatchPiou_Difficulcy,
+ 20 + .@distance * 5 - .@agi/10 -
+ @ArtisQuests_CatchPiouTries);
+ return rand(.@chance);
+ }
+
+ .@charid = getcharid(0);
+ if (.LastPlayerTouched <= 0)
+ {
+ .LastPlayerTouched = .@charid;
+ @ArtisQuests_CatchPiouTries = 0;
+ }
+ else if (.LastPlayerTouched != .@charid)
+ {
+ message strcharinfo(0), l("Looks like somebody else is looking for Chuck. I better leave them to try.");
+ end;
+ }
+
+ .@q = getq(ArtisQuests_CatchPiou);
+ if (.@q != 1)
+ {
+ mesn "Narrator";
+ mesc(l("The hatchling looks at you with big, pleading eyes, and you don't have the heart to take it back to May."), 9);
+ close;
+ }
+
+ .@tick = gettimetick(1);
+ if (.@tick < .LastTimeTouched + min(4, ArtisQuests_CatchPiou_Difficulcy
+ + @ArtisQuests_CatchPiouTries / 3))
+ {
+ mesq l("The hatchling spooked at your attempt to catch it, and zoomed out of sight.");
+ .LastTimeTouched = .@tick;
+ end;
+ }
+
+ .LastTimeTouched = .@tick;
+
+ .@rnd = TryCatchPiou();
+ if (!.@rnd)
+ {
+ npcstop;
+ stopnpctimer;
+ getmapxy(.@map$, .@x, .@y, 1);
+ npcwalkto .@x, .@y;
+ .@trader$ = "Salem#001-1";
+ mesn "Narrator";
+ mesc(l("Finally, you captured the speedy hatchling, but he's trying to squirm away! Hurry back to May before he escapes."), 9);
+ setq LilitQuest_Hatchling, 1;
+ set getvariableofnpc(.LastPiouHunter$, .@trader$), strcharinfo(0);
+ set getvariableofnpc(.PiouEscapedMessage$, .@trader$), l("The little pipsqueak gave you the slip! You need to catch him again.");
+ set getvariableofnpc(.LastPiouHunterID, .@trader$), .@charid;
+ set getvariableofnpc(.PiouCaught, .@trader$), 1;
+ donpcevent .@trader$ + "::OnPiouFlee";
+ close2;
+ disablenpc strnpcinfo(3);
+ close;
+ }
+ else
+ {
+ setarray .RandomFailureMessages$[0], l("Nearly there!"), l("Like trying to catch a greased shrewboo..."), l("Aw, he got away again!"), l("Slippery little guy!");
+ .@r = rand(getarraysize(.RandomFailureMessages$));
+ message strcharinfo(0), .RandomFailureMessages$[.@r];
+ .speed = max(140, 200 - 10 * (@ArtisQuests_CatchPiouTries +
+ ArtisQuests_CatchPiou_Difficulcy));
+ }
+ end;
+
+OnHour00:
+ .LastTimeTouched = 0;
+ end;
+
+OnTimer1000:
+ dographmovestep;
+
+OnInit:
+ .distance = 5;
+ .walkmask = WALK_WATER;
+
+ initmovegraph "carpet middle", 38, 28,
+ "upper left", 34, 26, 32, 23,
+ "lower right", 41, 31, 44, 34,
+ "upper right", 42, 26, 44, 23,
+ "lower left", 35, 31, 32, 34,
+ "passage left", 32, 28,
+ "passage right", 44, 28,
+ ;
+
+ setmovegraphcmd "carpet middle", "upper left", 1, "wait 1; call ArtisFlyingPiouLogic",
+ "upper left", "lower right", 1, "call ArtisFlyingPiouLogic",
+ "lower right", "upper right", 2, "call ArtisFlyingPiouLogic",
+ "lower right", "lower_left", 1, "call ArtisFlyingPiouLogic",
+ "upper right", "lower left", 1, "call ArtisFlyingPiouLogic",
+ "lower left", "table left", 1, "call ArtisFlyingPiouLogic",
+ "lower left", "table right", 1, "call ArtisFlyingPiouLogic",
+ "passage left", "carpet middle", 1, "wait 2; call ArtisFlyingPiouLogic",
+ "passage right", "carpet middle", 1, "wait 2; call ArtisFlyingPiouLogic",
+ ;
+
+ firstmove "speed 200", "market_start";
+ initnpctimer;
+
+ .LastPlayerTouched = -1;
+ end;
+}