From 32db36e32b3cb1dbb3505703b4e6d2a74b286751 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 25 Apr 2011 11:37:14 +0200 Subject: Strangers quiz: answers now as a function not as spellinvocation --- conf/magic.conf.template | 81 -------------------------------------- npc/003-1_Beach/stranger.txt | 54 +++++++++++++++++++++----- npc/functions/strangerquiz.txt | 88 ++++++++++++++++++++++++++++++++++++++++++ npc/scripts.conf | 1 + 4 files changed, 133 insertions(+), 91 deletions(-) create mode 100644 npc/functions/strangerquiz.txt diff --git a/conf/magic.conf.template b/conf/magic.conf.template index f208b440..55ab9072 100644 --- a/conf/magic.conf.template +++ b/conf/magic.conf.template @@ -1599,87 +1599,6 @@ NONMAGIC SPELL hug5 (target : STRING) : "*hugs" = REQUIRE ((rdistance(location(c || rdistance(location(caster), location(npc("#DruidTree1#_M"))) <= 1)) => EFFECT CALL hug_tree(target); -NONMAGIC SPELL towelanswer00a : "###towel 00a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer00b : "###towel 00b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer01a : "###towel 01a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer01b : "###towel 01b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer02a : "###towel 02a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer02b : "###towel 02b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer03a : "###towel 03a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer03b : "###towel 03b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer04a : "###towel 04a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer04b : "###towel 04b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer05a : "###towel 05a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer05b : "###towel 05b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer05c : "###towel 05c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer05d : "###towel 05d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer06a : "###towel 06a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer06b : "###towel 06b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer06c : "###towel 06c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer06d : "###towel 06d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer07a : "###towel 07a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer07b : "###towel 07b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer08a : "###towel 08a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer08b : "###towel 08b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer08c : "###towel 08c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer08d : "###towel 08d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer09a : "###towel 09a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer09b : "###towel 09b" = EFFECT { message strcharinfo(0), ""; }; - -NONMAGIC SPELL towelanswer10a : "###towel 10a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer10b : "###towel 10b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer11a : "###towel 11a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer11b : "###towel 11b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer12a : "###towel 12a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer12b : "###towel 12b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer13a : "###towel 13a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer13b : "###towel 13b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer14a : "###towel 14a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer14b : "###towel 14b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer15a : "###towel 15a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer15b : "###towel 15b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer15c : "###towel 15c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer16a : "###towel 16a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer16b : "###towel 16b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer17a : "###towel 17a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer17b : "###towel 17b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer18a : "###towel 18a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer18b : "###towel 18b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer18c : "###towel 18c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer18d : "###towel 18d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer19a : "###towel 19a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer19b : "###towel 19b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer19c : "###towel 19c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer19d : "###towel 19d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer110a : "###towel 110a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer110b : "###towel 110b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer111a : "###towel 111a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer111b : "###towel 111b" = EFFECT { message strcharinfo(0), ""; }; - -NONMAGIC SPELL towelanswer20a : "###towel 20a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer20b : "###towel 20b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer20c : "###towel 20c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer20d : "###towel 20d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer21a : "###towel 21a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer21b : "###towel 21b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer22a : "###towel 22a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer22b : "###towel 22b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer23a : "###towel 23a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer23b : "###towel 23b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer24a : "###towel 24a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer24b : "###towel 24b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer25a : "###towel 25a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer25b : "###towel 25b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer26a : "###towel 26a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer26b : "###towel 26b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer26c : "###towel 26c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer26d : "###towel 26d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer27a : "###towel 27a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer27b : "###towel 27b" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer27c : "###towel 27c" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer27d : "###towel 27d" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer28a : "###towel 28a" = EFFECT { message strcharinfo(0), ""; }; -NONMAGIC SPELL towelanswer28b : "###towel 28b" = EFFECT { message strcharinfo(0), ""; }; #-------------------------------------------------------------------------------- # Teleport anchors 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 -- cgit v1.2.3-60-g2f50