summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2011-04-25 11:37:14 +0200
committerStefan Beller <stefanbeller@googlemail.com>2011-04-25 11:37:14 +0200
commit32db36e32b3cb1dbb3505703b4e6d2a74b286751 (patch)
tree72a9de3672dc3bd8fc6fa39f7bb33548f6cc1d18 /npc
parentb41d057c824eee946b810ea994fa4883e91b9c3d (diff)
downloadserverdata-32db36e32b3cb1dbb3505703b4e6d2a74b286751.tar.gz
serverdata-32db36e32b3cb1dbb3505703b4e6d2a74b286751.tar.bz2
serverdata-32db36e32b3cb1dbb3505703b4e6d2a74b286751.tar.xz
serverdata-32db36e32b3cb1dbb3505703b4e6d2a74b286751.zip
Strangers quiz: answers now as a function
not as spellinvocation
Diffstat (limited to 'npc')
-rw-r--r--npc/003-1_Beach/stranger.txt54
-rw-r--r--npc/functions/strangerquiz.txt88
-rw-r--r--npc/scripts.conf1
3 files changed, 133 insertions, 10 deletions
diff --git a/npc/003-1_Beach/stranger.txt b/npc/003-1_Beach/stranger.txt
index 1eb98d1f..b322eb5d 100644
--- a/npc/003-1_Beach/stranger.txt
+++ b/npc/003-1_Beach/stranger.txt
@@ -13,7 +13,7 @@
// if (gettime(6) != @month) goto L_No_Event;
// if (gettime(5) < @start_day) goto L_No_Event;
// if (gettime(5) > @end_day) goto L_No_Event;
-// if ((gettimetick(2)-TUT_var < 4*7*86400) || (baselevel < 42 )) //player must be created at least 4 weeks ago and at least level 42
+// if ((gettimetick(2)-TUT_var < 6*7*86400) || (baselevel < 42 )) //player must be created at least 6 weeks ago and at least level 42
// goto L_No_Event;
// if ((gettime(5) == @end_day) && (FLAGS & FLAG_TOWEL_HELPED)) goto L_Towel;
if (FLAGS & FLAG_TOWEL_HELPED) goto L_Towel; // TODO: remove
@@ -85,15 +85,26 @@ L_Towel:
if (@easy_answers_amount[@random] < 4)
goto L_Easy_Skip4;
- if (("###" + @answer$ == getspellinvocation("towelanswer0" + @random + "d")))
+ set @quizparam$, "towelanswer0" + @random + "d";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Easy;
L_Easy_Skip4:
if (@easy_answers_amount[@random] < 3)
goto L_Easy_Skip3;
- if (("###" + @answer$ == getspellinvocation("towelanswer0" + @random + "c")))
+ set @quizparam$, "towelanswer0" + @random + "c";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Easy;
L_Easy_Skip3:
- if (("###" + @answer$ == getspellinvocation("towelanswer0" + @random + "a")) || ("###" + @answer$ == getspellinvocation("towelanswer0" + @random + "b")))
+ set @quizparam$, "towelanswer0" + @random + "b";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
+ goto L_Right_Answer_Easy;
+
+ set @quizparam$, "towelanswer0" + @random + "a";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Easy;
goto L_Wrong_Answer;
@@ -125,15 +136,27 @@ L_Right_Answer_Easy:
if (@medium_answers_amount[@random] < 4)
goto L_Medium_Skip4;
- if (("###" + @answer$ == getspellinvocation("towelanswer1" + @random + "d")))
+
+ set @quizparam$, "towelanswer1" + @random + "d";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Medium;
L_Medium_Skip4:
if (@medium_answers_amount[@random] < 3)
goto L_Medium_Skip3;
- if (("###" + @answer$ == getspellinvocation("towelanswer1" + @random + "c")))
+ set @quizparam$, "towelanswer1" + @random + "c";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Medium;
L_Medium_Skip3:
- if (("###" + @answer$ == getspellinvocation("towelanswer1" + @random + "a")) || ("###" + @answer$ == getspellinvocation("towelanswer1" + @random + "b")))
+ set @quizparam$, "towelanswer1" + @random + "b";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
+ goto L_Right_Answer_Medium;
+
+ set @quizparam$, "towelanswer1" + @random + "a";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Medium;
goto L_Wrong_Answer;
@@ -162,15 +185,26 @@ L_Right_Answer_Medium:
if (@hard_answers_amount[@random] < 4)
goto L_Hard_Skip4;
- if (("###" + @answer$ == getspellinvocation("towelanswer2" + @random + "d")))
+ set @quizparam$, "towelanswer2" + @random + "d";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Hard;
L_Hard_Skip4:
if (@hard_answers_amount[@random] < 3)
goto L_Hard_Skip3;
- if (("###" + @answer$ == getspellinvocation("towelanswer2" + @random + "c")))
+ set @quizparam$, "towelanswer2" + @random + "c";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Hard;
L_Hard_Skip3:
- if (("###" + @answer$ == getspellinvocation("towelanswer2" + @random + "a")) || ("###" + @answer$ == getspellinvocation("towelanswer2" + @random + "b")))
+ set @quizparam$, "towelanswer2" + @random + "b";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
+ goto L_Right_Answer_Hard;
+
+ set @quizparam$, "towelanswer2" + @random + "a";
+ callfunc "StrangerQuiz";
+ if (("###" + @answer$ == @quizanswer$))
goto L_Right_Answer_Hard;
goto L_Wrong_Answer;
diff --git a/npc/functions/strangerquiz.txt b/npc/functions/strangerquiz.txt
new file mode 100644
index 00000000..50f73ecc
--- /dev/null
+++ b/npc/functions/strangerquiz.txt
@@ -0,0 +1,88 @@
+
+
+
+function script StrangerQuiz {
+ // param @quizparam$$
+ // return in @quizanswer$
+ if ( @quizparam$ == "towelanswer00a" ) set @quizanswer$, "###towel 00a";
+ if ( @quizparam$ == "towelanswer00b" ) set @quizanswer$, "###towel 00b";
+ if ( @quizparam$ == "towelanswer01a" ) set @quizanswer$, "###towel 01a";
+ if ( @quizparam$ == "towelanswer01b" ) set @quizanswer$, "###towel 01b";
+ if ( @quizparam$ == "towelanswer02a" ) set @quizanswer$, "###towel 02a";
+ if ( @quizparam$ == "towelanswer02b" ) set @quizanswer$, "###towel 02b";
+ if ( @quizparam$ == "towelanswer03a" ) set @quizanswer$, "###towel 03a";
+ if ( @quizparam$ == "towelanswer03b" ) set @quizanswer$, "###towel 03b";
+ if ( @quizparam$ == "towelanswer04a" ) set @quizanswer$, "###towel 04a";
+ if ( @quizparam$ == "towelanswer04b" ) set @quizanswer$, "###towel 04b";
+ if ( @quizparam$ == "towelanswer05a" ) set @quizanswer$, "###towel 05a";
+ if ( @quizparam$ == "towelanswer05b" ) set @quizanswer$, "###towel 05b";
+ if ( @quizparam$ == "towelanswer05c" ) set @quizanswer$, "###towel 05c";
+ if ( @quizparam$ == "towelanswer05d" ) set @quizanswer$, "###towel 05d";
+ if ( @quizparam$ == "towelanswer06a" ) set @quizanswer$, "###towel 06a";
+ if ( @quizparam$ == "towelanswer06b" ) set @quizanswer$, "###towel 06b";
+ if ( @quizparam$ == "towelanswer06c" ) set @quizanswer$, "###towel 06c";
+ if ( @quizparam$ == "towelanswer06d" ) set @quizanswer$, "###towel 06d";
+ if ( @quizparam$ == "towelanswer07a" ) set @quizanswer$, "###towel 07a";
+ if ( @quizparam$ == "towelanswer07b" ) set @quizanswer$, "###towel 07b";
+ if ( @quizparam$ == "towelanswer08a" ) set @quizanswer$, "###towel 08a";
+ if ( @quizparam$ == "towelanswer08b" ) set @quizanswer$, "###towel 08b";
+ if ( @quizparam$ == "towelanswer08c" ) set @quizanswer$, "###towel 08c";
+ if ( @quizparam$ == "towelanswer08d" ) set @quizanswer$, "###towel 08d";
+ if ( @quizparam$ == "towelanswer09a" ) set @quizanswer$, "###towel 09a";
+ if ( @quizparam$ == "towelanswer09b" ) set @quizanswer$, "###towel 09b";
+
+ if ( @quizparam$ == "towelanswer10a" ) set @quizanswer$, "###towel 10a";
+ if ( @quizparam$ == "towelanswer10b" ) set @quizanswer$, "###towel 10b";
+ if ( @quizparam$ == "towelanswer11a" ) set @quizanswer$, "###towel 11a";
+ if ( @quizparam$ == "towelanswer11b" ) set @quizanswer$, "###towel 11b";
+ if ( @quizparam$ == "towelanswer12a" ) set @quizanswer$, "###towel 12a";
+ if ( @quizparam$ == "towelanswer12b" ) set @quizanswer$, "###towel 12b";
+ if ( @quizparam$ == "towelanswer13a" ) set @quizanswer$, "###towel 13a";
+ if ( @quizparam$ == "towelanswer13b" ) set @quizanswer$, "###towel 13b";
+ if ( @quizparam$ == "towelanswer14a" ) set @quizanswer$, "###towel 14a";
+ if ( @quizparam$ == "towelanswer14b" ) set @quizanswer$, "###towel 14b";
+ if ( @quizparam$ == "towelanswer15a" ) set @quizanswer$, "###towel 15a";
+ if ( @quizparam$ == "towelanswer15b" ) set @quizanswer$, "###towel 15b";
+ if ( @quizparam$ == "towelanswer15c" ) set @quizanswer$, "###towel 15c";
+ if ( @quizparam$ == "towelanswer16a" ) set @quizanswer$, "###towel 16a";
+ if ( @quizparam$ == "towelanswer16b" ) set @quizanswer$, "###towel 16b";
+ if ( @quizparam$ == "towelanswer17a" ) set @quizanswer$, "###towel 17a";
+ if ( @quizparam$ == "towelanswer17b" ) set @quizanswer$, "###towel 17b";
+ if ( @quizparam$ == "towelanswer18a" ) set @quizanswer$, "###towel 18a";
+ if ( @quizparam$ == "towelanswer18b" ) set @quizanswer$, "###towel 18b";
+ if ( @quizparam$ == "towelanswer18c" ) set @quizanswer$, "###towel 18c";
+ if ( @quizparam$ == "towelanswer18d" ) set @quizanswer$, "###towel 18d";
+ if ( @quizparam$ == "towelanswer19a" ) set @quizanswer$, "###towel 19a";
+ if ( @quizparam$ == "towelanswer19b" ) set @quizanswer$, "###towel 19b";
+ if ( @quizparam$ == "towelanswer19c" ) set @quizanswer$, "###towel 19c";
+ if ( @quizparam$ == "towelanswer19d" ) set @quizanswer$, "###towel 19d";
+ if ( @quizparam$ == "towelanswer110a" ) set @quizanswer$, "###towel 110a";
+ if ( @quizparam$ == "towelanswer110b" ) set @quizanswer$, "###towel 110b";
+ if ( @quizparam$ == "towelanswer111a" ) set @quizanswer$, "###towel 111a";
+ if ( @quizparam$ == "towelanswer111b" ) set @quizanswer$, "###towel 111b";
+
+ if ( @quizparam$ == "towelanswer20a" ) set @quizanswer$, "###towel 20a";
+ if ( @quizparam$ == "towelanswer20b" ) set @quizanswer$, "###towel 20b";
+ if ( @quizparam$ == "towelanswer20c" ) set @quizanswer$, "###towel 20c";
+ if ( @quizparam$ == "towelanswer20d" ) set @quizanswer$, "###towel 20d";
+ if ( @quizparam$ == "towelanswer21a" ) set @quizanswer$, "###towel 21a";
+ if ( @quizparam$ == "towelanswer21b" ) set @quizanswer$, "###towel 21b";
+ if ( @quizparam$ == "towelanswer22a" ) set @quizanswer$, "###towel 22a";
+ if ( @quizparam$ == "towelanswer22b" ) set @quizanswer$, "###towel 22b";
+ if ( @quizparam$ == "towelanswer23a" ) set @quizanswer$, "###towel 23a";
+ if ( @quizparam$ == "towelanswer23b" ) set @quizanswer$, "###towel 23b";
+ if ( @quizparam$ == "towelanswer24a" ) set @quizanswer$, "###towel 24a";
+ if ( @quizparam$ == "towelanswer24b" ) set @quizanswer$, "###towel 24b";
+ if ( @quizparam$ == "towelanswer25a" ) set @quizanswer$, "###towel 25a";
+ if ( @quizparam$ == "towelanswer25b" ) set @quizanswer$, "###towel 25b";
+ if ( @quizparam$ == "towelanswer26a" ) set @quizanswer$, "###towel 26a";
+ if ( @quizparam$ == "towelanswer26b" ) set @quizanswer$, "###towel 26b";
+ if ( @quizparam$ == "towelanswer26c" ) set @quizanswer$, "###towel 26c";
+ if ( @quizparam$ == "towelanswer26d" ) set @quizanswer$, "###towel 26d";
+ if ( @quizparam$ == "towelanswer27a" ) set @quizanswer$, "###towel 27a";
+ if ( @quizparam$ == "towelanswer27b" ) set @quizanswer$, "###towel 27b";
+ if ( @quizparam$ == "towelanswer27c" ) set @quizanswer$, "###towel 27c";
+ if ( @quizparam$ == "towelanswer27d" ) set @quizanswer$, "###towel 27d";
+ if ( @quizparam$ == "towelanswer28a" ) set @quizanswer$, "###towel 28a";
+ if ( @quizparam$ == "towelanswer28b" ) set @quizanswer$, "###towel 28b";
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index ca73422e..8d07ff18 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -13,6 +13,7 @@ npc: npc/functions/mob_points.txt
npc: npc/functions/process_equip.txt
npc: npc/functions/slot_machine.txt
npc: npc/functions/soul_menhir.txt
+npc: npc/functions/strangerquiz.txt
npc: npc/functions/water_bottle.txt
npc: npc/functions/evil_obelisk.txt