diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-07-07 20:34:27 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-07-07 20:34:27 -0300 |
commit | 9877fd4ad81120af8e63e96d5d429092014dc017 (patch) | |
tree | ec045a0535109a2e0d82e0e8155eb01ed9776452 /world/map/npc/functions/quiz.txt | |
parent | aedbeb335a5ec5f55d22eace389076a18241ac9a (diff) | |
download | serverdata-9877fd4ad81120af8e63e96d5d429092014dc017.tar.gz serverdata-9877fd4ad81120af8e63e96d5d429092014dc017.tar.bz2 serverdata-9877fd4ad81120af8e63e96d5d429092014dc017.tar.xz serverdata-9877fd4ad81120af8e63e96d5d429092014dc017.zip |
Remove all Legacy files
Diffstat (limited to 'world/map/npc/functions/quiz.txt')
-rw-r--r-- | world/map/npc/functions/quiz.txt | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/world/map/npc/functions/quiz.txt b/world/map/npc/functions/quiz.txt deleted file mode 100644 index 3deddd0a..00000000 --- a/world/map/npc/functions/quiz.txt +++ /dev/null @@ -1,97 +0,0 @@ -// FIXME/TODO: some variables should be scoped, and some other variables -// combined in an array, with a very specific name, to avoid -// collisions. The script as a whole should be optimized to -// take advangage of magic-v3 - -function|script|MultiQuiz -{ - 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$[0]) - 1)); - set @question$, @quiz_questions$[@index]; - mes "\""+ @question$ + "\""; - next; - mes "Pick the correct answer."; - callfunc "Quiz"; - return; - -L_ArrayError: - if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty"; - if(@quiz_questions$[0] == "") debugmes "@quiz_questions$ is empty"; - 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$[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)); - cleararray @choices$, "", getarraysize(@choices$[0]); - set @loop, 0; - goto L_Shuffle; - -L_Shuffle: - 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; - -L_Search: - if(@choices$[@loop2] == @quiz_answers$[@nindex]) goto L_Shuffle; // array is already populated with this choice - if(@loop2 >= (@choices_nr - 1)) goto L_Shuffle2; - set @loop2, @loop2 + 1; - goto L_Search; - -L_Shuffle2: - set @choices$[@loop], @quiz_answers$[@nindex]; - if(@loop >= (@choices_nr - 1)) goto L_Answer; - set @loop, @loop + 1; - goto L_Shuffle; - -L_Answer: - set @choices$[@good], @quiz_answers$[@index]; // set the good definition - menu - @choices$[0], L_Enter, - @choices$[1], L_Enter, - @choices$[2], L_Enter, - @choices$[3], L_Enter, - @choices$[4], L_Enter, - @choices$[5], L_Enter, - @choices$[6], L_Enter, - @choices$[7], L_Enter; - -L_Enter: - if(@menu != (@good + 1)) goto L_Shift; - set @success, 1; - goto L_Shift; - -L_Shift: - if(@shift < @index) set @shift, @index; - - if(@shift == @index) set @quiz_answers$[@index], ""; // do not allow twice the same question - - if((@quiz_questions$[0] != "") && (@shift == @index)) set @quiz_questions$[@index], ""; - if((@quiz_questions$[0] != "") && (@quiz_questions$[(@shift + 1)] != "")) set @quiz_questions$[@shift], @quiz_questions$[(@shift + 1)]; - if((@quiz_questions$[0] != "") && (@quiz_questions$[(@shift + 1)] != "")) set @quiz_questions$[(@shift + 1)], ""; - - if(@quiz_answers$[(@shift + 1)] != "") set @quiz_answers$[@shift], @quiz_answers$[(@shift + 1)]; - if(@quiz_answers$[(@shift + 1)] != "") set @quiz_answers$[(@shift + 1)], ""; - - set @shift, @shift + 1; - if(@quiz_answers$[(@shift + 1)] != "") goto L_Shift; - set @shift, 0; - goto L_Close; - -L_Close: - set @answer, 0; - return; - -L_ArrayError: - if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty"; - mapexit; -} |