summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/quiz.txt
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-11-19 16:10:04 -0500
committergumi <mekolat@users.noreply.github.com>2017-11-19 16:10:04 -0500
commit0e81a91664eabc64a38765392960405218e9a8f1 (patch)
tree9ece24b9e594466c0f90b4c616403537b48785f0 /world/map/npc/functions/quiz.txt
parent42e6b61ae2d24dd0401891072e98f9e9726292ff (diff)
downloadserverdata-0e81a91664eabc64a38765392960405218e9a8f1.tar.gz
serverdata-0e81a91664eabc64a38765392960405218e9a8f1.tar.bz2
serverdata-0e81a91664eabc64a38765392960405218e9a8f1.tar.xz
serverdata-0e81a91664eabc64a38765392960405218e9a8f1.zip
fix the stranger quiz
Diffstat (limited to 'world/map/npc/functions/quiz.txt')
-rw-r--r--world/map/npc/functions/quiz.txt15
1 files changed, 7 insertions, 8 deletions
diff --git a/world/map/npc/functions/quiz.txt b/world/map/npc/functions/quiz.txt
index 0f2f7c87..3deddd0a 100644
--- a/world/map/npc/functions/quiz.txt
+++ b/world/map/npc/functions/quiz.txt
@@ -5,10 +5,10 @@
function|script|MultiQuiz
{
- if((getarraysize(@quiz_answers$) != getarraysize(@quiz_questions$)) ||
+ if((getarraysize(@quiz_answers$[0]) != getarraysize(@quiz_questions$[0])) ||
(@quiz_answers$[0] == "") || (@quiz_questions$[0] == "")) goto L_ArrayError;
set @setindex, 1;
- set @index, rand(0,(getarraysize(@quiz_answers$) - 1));
+ set @index, rand(0,(getarraysize(@quiz_answers$[0]) - 1));
set @question$, @quiz_questions$[@index];
mes "\""+ @question$ + "\"";
next;
@@ -19,25 +19,24 @@ function|script|MultiQuiz
L_ArrayError:
if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty";
if(@quiz_questions$[0] == "") debugmes "@quiz_questions$ is empty";
- if(getarraysize(@quiz_answers$) != getarraysize(@quiz_questions$)) debugmes "Size of @quiz_answers$ is not equal to size of @quiz_questions$";
- mapexit;
+ if(getarraysize(@quiz_answers$[0]) != getarraysize(@quiz_questions$[0])) debugmes "Size of @quiz_answers$ is not equal to size of @quiz_questions$";
+ close;
}
function|script|Quiz
{
if((@choices_nr < 1) || (@choices_nr > 8)) set @choices_nr, 3;
- if(@choices_nr > getarraysize(@quiz_answers$)) set @choices_nr, getarraysize(@quiz_answers$);
+ if(@choices_nr > getarraysize(@quiz_answers$[0])) set @choices_nr, getarraysize(@quiz_answers$[0]);
if(@quiz_answers$[0] == "") goto L_ArrayError;
set @success, 0;
if(@setindex < 1) set @index, @answer;
set @good, rand(0,(@choices_nr - 1));
- setarray @choices$, "";
- cleararray @choices$, "", getarraysize(@choices$);
+ cleararray @choices$, "", getarraysize(@choices$[0]);
set @loop, 0;
goto L_Shuffle;
L_Shuffle:
- set @nindex, rand(0,(getarraysize(@quiz_answers$) - 1));
+ set @nindex, rand(0,(getarraysize(@quiz_answers$[0]) - 1));
if(@nindex == @index) goto L_Shuffle; // do not get the good definition
set @loop2, 0;
goto L_Search;