summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/001-1/manhole.txt34
-rw-r--r--npc/001-2-11/mona.txt52
-rw-r--r--npc/001-3-0/_import.txt1
-rw-r--r--npc/001-3-0/mundane.txt142
4 files changed, 179 insertions, 50 deletions
diff --git a/npc/001-1/manhole.txt b/npc/001-1/manhole.txt
index 856689a3..3e8a5bc8 100644
--- a/npc/001-1/manhole.txt
+++ b/npc/001-1/manhole.txt
@@ -1,5 +1,6 @@
// Evol scripts.
// Author:
+// Jesusalva
// Reid
// Description:
// A manhole near Mona's house.
@@ -11,32 +12,14 @@
001-1,152,52,0 script #manhole1-001-1 NPC_NO_SPRITE,{
- if (getq(ArtisQuests_MonaDad) < 1) {
- end;
- }
-
- narrator(S_LAST_BLANK_LINE | S_LAST_NEXT,
- l("You hear some creeping and crawling sounds from the murkiness below."),
- l("..."),
- l("Do you want to enter in sewer?"));
-
+ .@i=manhole_interact("001-3-0");
closeclientdialog();
- if (askyesno() == 1) slide_or_warp("001-3-0", 152, 56);
- close;
-
-OnTouch:
- // (has_instance2 wasn't checked if it works)
- if (getq(ArtisQuests_MonaDad) == 2 && has_instance2("mona@"+strcharinfo(0)) >= 0) {
- mesn l("Mundane");
- mesq l("Thanks for saving me. This is enough, I'll watch if Mona is fine and return to Sewers later.");
- next;
- inventoryplace WoodenBow, 1;
- mesn l("Mundane");
- mesq lg("Here, take this @@ as a gift. I'm sure someone as skilled you will make a good use of my old weapon.", "Here, take this @@ as a gift. I'm sure someone as skilled you will make a good use of my old weapon.", getitemlink(WoodenBow));
- getitem WoodenBow, 1;
- setq(ArtisQuests_MonaDad, 3);
+ if (.@i == -1) {
+ slide_or_warp("001-3-0", 152, 56);
+ } else if (.@i == TrainingArrow || .@i == WoodenBow) {
+ npctalk3 l("(You hear a faint sound in distance, but can't say what sound it was.)");
}
- end;
+ close;
OnInit:
.sex = G_OTHER;
@@ -51,7 +34,7 @@ OnInit:
if (.@i == -1) {
slide_or_warp("001-3-0", 196, 36);
} else if (.@i == TrainingArrow || .@i == WoodenBow) {
- npctalk3 l("Mundane: Hey! Is someone there? Please, help, it's so dark down here!");
+ npctalk3 l("???: Hey! Is someone there? Please, help, it's so dark down here!");
}
close;
@@ -106,3 +89,4 @@ OnInit:
// To quickly create more sewer mouths we can use:
//001-1,86,131,0 duplicate(#manhole3-001-1) #manhole4-001-1 NPC_NO_SPRITE
+
diff --git a/npc/001-2-11/mona.txt b/npc/001-2-11/mona.txt
index 17a72631..366b658c 100644
--- a/npc/001-2-11/mona.txt
+++ b/npc/001-2-11/mona.txt
@@ -1,13 +1,20 @@
// Evol scripts.
// Author:
// Reid
+// Jesusalva
// Description:
-// A rich girl holding a candle.
+// A rich girl holding a candle. Her father went to examine weird noises on
+// sewers and still haven't come back. Her mother is gone, but it is not clear
+// if she died, abandoned them, or something else.
// Variable:
// ArtisQuests_MonaDad
// Quest states:
// 0 - Quest not started
// 1 - Mona explained that her dad was missing
+// 2 - Player is bringing Mundane out of Sewers
+// 3 - Quest is complete
+// Note:
+// Any misformatted code is Jesusalva's fault.
001-2-11,39,30,0 script Mona NPC_MONA,{
@@ -50,13 +57,51 @@
close;
}
+ // You're here to report that Mundane is out of the sewers.
+ // Forcing you to enter an instanced map would require more work.
+ // This means adding a warp NPC and a global instance.
+ // Global Instances get reset every 10 days or so, it would need a patch
+ // only to support Global Instances and in general is not a smart thing to do.
+ function check_daddy_quest
+ {
+ // Did you really brought Mundane to sewer exit (152, 56)?
+ // We need to add 1 tile in each direction of tolerance because addtimer()
+ // is not exactly what I would call “a reliable way to do stuff”
+ // Note that @variables sometimes get erasen AT RANDOM.
+ // If this problem happens, move it char variables.
+ // (that might cause problems with logout though.)
+ // Temporary variables give you a time limit to report back...
+ if (@MUNDANE_OLDX >= 151 && @MUNDANE_OLDX <= 153 &&
+ @MUNDANE_OLDY >= 55 && @MUNDANE_OLDY <= 57) {
+ // There's no need to check if instance still exists, because
+ // when the instance expires, you get warped to *somewhere*.
+ // This means the timer will die and MUNDANE_OLD* variables will stop
+ // being updated.
+ inventoryplace WoodenBow, 1;
+ speech 0x0,
+ l("Daddy finally came back home! He grabbed a snack and said he would be returning to the sewers."),
+ lg("He did said to you take this @@ as a gift. He says you are very skilled and will make a good use of his old weapon.",
+ "He did said to you take this @@ as a gift. He says you are very skilled and will make a good use of his old weapon.",
+ getitemlink(WoodenBow)),
+ l("He was never the same since mommy vanished...");
+ getitem WoodenBow, 1;
+ setq(ArtisQuests_MonaDad, 3);
+ close;
+ }
+ }
+
+ // Here the script really starts
if (getq(ArtisQuests_MonaDad) == 0)
{
find_daddy_quest();
}
else if (getq(ArtisQuests_MonaDad) == 3)
{
- npctalkonce l("Thanks for finding daddy... I wish he spent more time with me...");
+ npctalkonce l("Thanks for finding daddy... I wish he spent more time with me..."); // TODO: Sophialla
+ }
+ else if (getq(ArtisQuests_MonaDad) == 2)
+ {
+ check_daddy_quest();
}
else
{
@@ -68,6 +113,7 @@
OnInit:
.sex = G_FEMALE;
- .distance = 2;
+ .distance = 3;
end;
}
+
diff --git a/npc/001-3-0/_import.txt b/npc/001-3-0/_import.txt
index 5ead6439..a4262ee3 100644
--- a/npc/001-3-0/_import.txt
+++ b/npc/001-3-0/_import.txt
@@ -1,5 +1,6 @@
// Map 001-3-0: Sewer
// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/001-3-0/mundane.txt",
"npc/001-3-0/_mobs.txt",
"npc/001-3-0/_warps.txt",
"npc/001-3-0/mundane.txt",
diff --git a/npc/001-3-0/mundane.txt b/npc/001-3-0/mundane.txt
index ff4d51b9..b653fa0d 100644
--- a/npc/001-3-0/mundane.txt
+++ b/npc/001-3-0/mundane.txt
@@ -1,13 +1,23 @@
-
// Evol Scripts
// Author:
// Jesusalva
// Description:
// Mundane (anagram of Unnamed) is Mona's father
-
-// Note: Due technical limitations do not make Mundane move
-// Note: Temporary sprite
-001-3-0,161,59,0 script Mundane NPC_MUNDANE,{
+// He likes to smoke cigarettes while looking for the strange sounds.
+// He is an old bowman of the Legion. He was married but it is not clear
+// what happened to his wife.
+// Lore Problems:
+// If he is missing for a week already, how is he eating anyway?
+// Also, is he afraid of blubs/rattos or of Green Slimes?
+
+// Note: Jesusalva is not someone to care a lot with code styling, and he uses
+// a convention of his own, gumi will need to cleanse the code before it gets
+// compliant with Evol Coding Style Guidelines.
+// Note 2: Logout is not handled. Making logout at an instanced map may randomly
+// warp you back to Drasil Island (000-1) or something like that. I don't know.
+// This behavior remains to be checked.
+
+001-3-0,96,66,0 script Mundane NPC_MUNDANE,{
function quest_completed
{
@@ -17,14 +27,21 @@
close;
}
+ function quest_inprogress
+ {
+ speech(0x0,
+ l("We need to get out of here soon. I'm scared of the Slimes!"));
+ close;
+ }
+
function rescue_mundane
{
speech(S_LAST_NEXT,
- l("Scary... I am afraid of these blubs and rattos... And worse, I am lost..."),
- l("I already killed many strong monsters, but I everyone have fears, right?!"),
- l("My daughter is probably worried with me. Could you perhaps lead me out of here?"));
+ l("Scary... I am afraid of these Slimes, Rattos and Maggots... And worse, I am lost..."),
+ l("I already killed many strong monsters, but everyone has fears, right?!"),
+ l("My daughter is probably worried about me. Could you perhaps lead me out of here?"));
- switch (select(l("Yes, follow me!"), l("Not now. You see, I am also afraid of Blubs and Rattos!")))
+ switch (select(l("Yes, follow me!"), l("Not now. You see, I am also afraid of Slimes and Rattos!")))
{
case 1:
mes "";
@@ -38,11 +55,11 @@
}
.@ID=getcharid(0);
.@MAP_NAME$="mona@"+str(.@ID);
- .@MUNDANE_INSTID = instance_create("001-3-0@a"+(.@ID), getcharid(3), IOT_CHAR);
+ @MUNDANE_INSTID = instance_create("001-3-0@a"+(.@ID), getcharid(3), IOT_CHAR);
//debugmes "You are "+str(.@ID);
- //if (.@MUNDANE_INSTID < 0) debugmes "Error: No instance ID";
- //debugmes "new instance id: " + str(.@MUNDANE_INSTID);
+ //if (@MUNDANE_INSTID < 0) debugmes "Error: No instance ID";
+ //debugmes "new instance id: " + str(@MUNDANE_INSTID);
// XXX - Important Note - XXX
// We currently have only FOUR chars to name the map. "001-3-0" or "mundane" have 7 chars, so that cannot be used.
@@ -50,27 +67,49 @@
//
// Rationale: We have only 11 chars available, but 7 are reserved. So, longest name would be "abcd" + "@" + getcharid(0)
// Some test reported that (apparently) we have 15 whitespaces at map name start, not sure why.
- .@instanceMapName$ = instance_attachmap("001-3-0", .@MUNDANE_INSTID, 0, .@MAP_NAME$);
-
- //if (.@instanceMapName$ == "") debugmes "Error: Map 001-3-0 X failed";
- //debugmes "Created map: "+ str(.@instanceMapName$);
+ .@instanceMapName$ = instance_attachmap("001-3-0", @MUNDANE_INSTID, 0, .@MAP_NAME$);
+
+ // This can be a bug, but most likely is because instance already exists.
+ // I don't know what would happen if we continue, so let's "penalize" the player
+ if (.@instanceMapName$ == "") {
+ speech(0x0,
+ l("Wait... You are that @@ from earlier, aren't you?", strcharinfo(0)),
+ l("If my memory serves me right, you died just before. Why don't you go out to buy better equipment?"));
+ close;
+ }
// You have 5 minutes to complete the quest. This does not results in failure by itself, getq2 does that
- instance_set_timeout(300, 300, .@MUNDANE_INSTID);
- instance_init(.@MUNDANE_INSTID);
+ instance_set_timeout(300, 300, @MUNDANE_INSTID);
+ instance_init(@MUNDANE_INSTID);
dispbottom(l("Mona Father's is right behind you. You have five minutes to bring him out of sewers!"));
// Not sure if Green Slimes are exactly what we want here - and shouldn't it be "Slime"? (mind upper-case)
areamonster(.@MAP_NAME$, 119, 51, 162, 85, l("Green Slime"), slime, 3);
+ areamonster(.@MAP_NAME$, 190, 65, 193, 68, l("Ratto"), Ratto, 5);
+ areamonster(.@MAP_NAME$, 90, 67, 92, 72, l("Cave Maggot"), CaveMaggot, 3);
+ areamonster(.@MAP_NAME$, 99, 106, 102, 111, l("Green Slime"), slime, 3);
+ areamonster(.@MAP_NAME$, 115, 93, 115, 75, l("Green Slime"), slime, 3);
+ areamonster(.@MAP_NAME$, 120, 85, 7, 2, l("Little Green Slime"), slime-littleslime, 7);
+ areamonster(.@MAP_NAME$, 114, 65, 121, 68, l("Cave Maggot"), CaveMaggot, 5);
+ areamonster(.@MAP_NAME$, 137, 76, 130, 87, l("Spider"), Spider, 4);
+ areamonster(.@MAP_NAME$, 98, 92, 101, 94, l("Green Slime"), slime, 3);
setq ArtisQuests_MonaDad, 2;
- warp(.@MAP_NAME$, 161,59);
+ warp(.@MAP_NAME$, 96,66);
+ addtimer(150, "Mundane::OnMove");
+
+ // Important temporary variables
+ @MUNDANE_OLDX=96;
+ @MUNDANE_OLDY=66;
close;
}
.@q=getq(ArtisQuests_MonaDad);
- if (.@q != 1) quest_completed();
+ if (.@q >= 3) quest_completed();
+ if (.@q == 2) quest_inprogress();
if (.@q == 1) rescue_mundane();
+ // Impossible situation, but let's not trust this. You must talk to Mona first!
+ if (.@q == 0) quest_completed();
hello;
end;
@@ -80,16 +119,75 @@ OnInit:
.distance = 3;
end;
+/*
+// If we are to use a fake-NPC (a monster which actually is a NPC, for example),
+// We need to uncomment this code block. As we are moving the actual NPC, this is
+// not needed (and harmful, too)
OnInstanceInit:
disablenpc(instance_npcname(.name$));
end;
+*/
+
+// This functions serves two major purposes:
+// 1- Move Mundane accordingly
+// 2- Be able to determine if you brought Mundane to exit or cheat (warp, etc.)
+// NOTE: Using instance_npcname(.name$) can be unreliable at times.
+// It should work with addtimer(), but if it breaks, move @MUNDANE_INSTID to
+// the @ varspace, and use instance_npcname(.name$, @MUNDANE_INSTID)
+// That'll fix any problem when playtesting.
+OnMove:
+ getmapxy(.@m$, .@x, .@y, 0);
+ // You left the map, we don't need to move NPC anymore
+ if (!(.@m$ ~= "mona@*") && (.@m$ != "001-3-0")) {
+ disablenpc(instance_npcname(.name$, @MUNDANE_INSTID));
+ // This check shouldn't be needed but better safe than sorry
+ if (.@m$ == "001-1")
+ dispbottom l("Mundane ran straight home. He must be missing his daughter.");
+ end;
+ }
+ // We actually won't move the NPC to your position, but to where you were last.
+ // The NPC should not walk right in you because I thought it looks weird ingame.
+ if (.@x == @MUNDANE_OLDX && .@y == @MUNDANE_OLDY) {
+ addtimer(150, "Mundane::OnMove");
+ end;
+ }
+
+ // movenpc() will cause NPC to "jump" to player position.
+ // npcwalkto(x, y) could be better, but there are concerns about instance NPC,
+ // and the server code behind this function would need to be changed to actually
+ // use NPC walking animation (instead of just sliding it around).
+ //
+ // Mind the note about instance_npcname and about ignoring your position
+ // We should in future at least figure out the right direction to display too
+ movenpc(instance_npcname(.name$, @MUNDANE_INSTID), @MUNDANE_OLDX, @MUNDANE_OLDY);
+
+ // We now update the misleading @MUNDANE_OLD* variable with your current
+ // position.
+ @MUNDANE_OLDX=.@x;
+ @MUNDANE_OLDY=.@y;
+ // We must handle this every 150ms or so, which is player walk delay.
+ // When you leave the map this timer will die.
+ addtimer(150, "Mundane::OnMove");
+ end;
OnPCDieEvent:
if (getq(ArtisQuests_MonaDad) != 2) end;
setq ArtisQuests_MonaDad, 1;
dispbottom l("What a pity! You've died.");
- //warp("Save",0,0); // That works, but won't revive you without recovery();
+
+ // We must disable Mona's Dad NPC sprite if you are still on the map
+ // This will cause the NPC to "vanish", player is left to guess that he ran
+ // back to where he originally was.
+ // (ie. The NPC won't be fine without you if we have code to handle that).
+ getmapxy(.@m$, .@x, .@y, 0);
+ if (.@m$ ~= "mona@*") {
+ disablenpc(instance_npcname(.name$, @MUNDANE_INSTID));
+ }
+
+ // Uncommenting the code piece will warp you back to your savepoint.
+ // It's better to don't use this if the previous code works.
+ //recovery();
+ //warp("Save",0,0);
end;
}
-// >>>>>>> Initial proof-of-concept version, works, but quest cannot be completed yet