summaryrefslogtreecommitdiff
path: root/npc/006-2-6/hatchling.txt
diff options
context:
space:
mode:
author+seeds <abby.hulka@gmail.com>2023-03-05 00:18:54 +0000
committerJesusalva Jesusalva <jesusalva@themanaworld.org>2023-03-05 00:48:58 +0000
commitec95a5c75d0ce36ae0cfec18726d346018c04cbc (patch)
tree5f71528bfdb5a8859040f6dee43ee0466693acfb /npc/006-2-6/hatchling.txt
parentf123b04e54885559000b799e73373e5b99affc71 (diff)
downloadserverdata-cherry-pick-181de88c.tar.gz
serverdata-cherry-pick-181de88c.tar.bz2
serverdata-cherry-pick-181de88c.tar.xz
serverdata-cherry-pick-181de88c.zip
Merge branch 'PiouIsles_quests' into 'master'cherry-pick-181de88c
Update db/constants.conf See merge request ml/serverdata!94 (cherry picked from commit 181de88c329902299082dfb61f8a8e644b8e89bf) 88800735 Update db/constants.conf c32b5649 Upload New File a2f38cb8 Upload New File 2caf4ba1 Upload New File f407a2a0 Upload New File 2081d905 Upload New File 21606ee2 Upload New File 7073e232 Upload New File 1522ab30 Replace quest_db.conf b356ff2c Replace item_db.conf
Diffstat (limited to 'npc/006-2-6/hatchling.txt')
-rw-r--r--npc/006-2-6/hatchling.txt136
1 files changed, 136 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..df06409eb
--- /dev/null
+++ b/npc/006-2-6/hatchling.txt
@@ -0,0 +1,136 @@
+// 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;
+ getexp(1000, 500);
+ 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;
+}