summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-06-27 14:35:56 -0300
committerJesusaves <cpntb1@ymail.com>2021-06-27 14:35:56 -0300
commit753f7b7d30d356eccfcb999c76a28f7ee0692055 (patch)
tree756e467eb0a57ccdd227da020db5ef2df96f8970
parent031eab0d7b1e10bddf2a2648efd7a03704ee7f49 (diff)
downloadserverdata-753f7b7d30d356eccfcb999c76a28f7ee0692055.tar.gz
serverdata-753f7b7d30d356eccfcb999c76a28f7ee0692055.tar.bz2
serverdata-753f7b7d30d356eccfcb999c76a28f7ee0692055.tar.xz
serverdata-753f7b7d30d356eccfcb999c76a28f7ee0692055.zip
Rewrite catalazuli scripts, drop the formely mandatory preceding hashtag.
Using the hash will cause catalazuli to NOT WORK.
-rw-r--r--npc/052-1/channelling.txt31
1 files changed, 23 insertions, 8 deletions
diff --git a/npc/052-1/channelling.txt b/npc/052-1/channelling.txt
index e3c6097d..143a1225 100644
--- a/npc/052-1/channelling.txt
+++ b/npc/052-1/channelling.txt
@@ -62,7 +62,7 @@ OnCommandDestroy:
next;
mes "Below this strange writing, you notice a word still deeply engraved in the stone:";
next;
- mes "\"#catalazuli\"";
+ mesq b("catalazuli");
next;
mes "... that looks like an incantation or something.";
if ($@illia_level_4_progress == 0)
@@ -76,11 +76,10 @@ L_SuggestChannelling:
mes "Let's see how I can activate it...";
mes "But I should probably get inside it, first.";
close;
-
}
function script StartChannelling {
- if (isat("052-1",53,38) == 0)
+ if (isat("052-1", 53, 38) == 0)
goto L_Return;
if ($@illia_level_4_progress > 0)
goto L_Return;
@@ -126,10 +125,6 @@ L_Return:
goto L_Hint;
end;
-OnCast:
- callfunc "StartChannelling";
- end;
-
OnCommandSt:
initnpctimer;
end;
@@ -319,6 +314,26 @@ L_ShouldNotBeHere:
end;
OnInit:
- registercmd "#catalazuli", strnpcinfo(0)+"::OnCast";
+ // In theory, pattern ID must be between 1~9
+ // To set $@p1$~$@p9$ with the PERL expression
+ // But as we're only using $@p0$ (full string)
+ // the value itself is meaningless
+ .pid=getnpcid();
+ debugmes "Catalazuli: Pattern %d", .pid;
+ //I'm not going to learn PERL just for that
+ defpattern(.pid, "^(.*)$", "OnTalkNearby");
+ activatepset(.pid);
+ end;
+
+OnTalkNearby:
+ // not very obvious stuff by gumi, $@p0$ contains the whole string
+ // so we must cut it. Could use $@p1$ if perl was proper but... meh.
+ .@no_nick$ = strip(substr($@p0$, getstrlen(strcharinfo(PC_NAME)) + 3, getstrlen($@p0$) - 1));
+ .@message$ = strtoupper(.@no_nick$);
+
+ // Only react if the message is what we want to hear
+ if (.@message$ == "CATALAZULI") {
+ StartChannelling();
+ }
end;
}