summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-03-15 14:00:04 -0400
committermekolat <mekolat@users.noreply.github.com>2016-03-30 11:22:57 -0400
commita99779828dd609f004a17048d72bbfeb484a81bd (patch)
treef3605c8bdded9dd1f89461001a316fbf2fb1be26 /world/map/npc
parent8d9de1d4d43b4548aa544a995d402173e7e56af8 (diff)
downloadserverdata-a99779828dd609f004a17048d72bbfeb484a81bd.tar.gz
serverdata-a99779828dd609f004a17048d72bbfeb484a81bd.tar.bz2
serverdata-a99779828dd609f004a17048d72bbfeb484a81bd.tar.xz
serverdata-a99779828dd609f004a17048d72bbfeb484a81bd.zip
get rid of magic secrets, convert stranger quiz
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/002-2/stranger.txt235
-rw-r--r--world/map/npc/functions/quiz.txt5
-rw-r--r--world/map/npc/functions/strangerquiz.txt8
-rw-r--r--world/map/npc/magic/README.md18
-rw-r--r--world/map/npc/scripts.conf1
5 files changed, 98 insertions, 169 deletions
diff --git a/world/map/npc/002-2/stranger.txt b/world/map/npc/002-2/stranger.txt
index 8186636b..1367e6f7 100644
--- a/world/map/npc/002-2/stranger.txt
+++ b/world/map/npc/002-2/stranger.txt
@@ -58,171 +58,104 @@ L_Towel:
mes "\"The first one is easy.\"";
next;
- setarray @easy_questions$,
- "What two words are written in big friendly letters on the back cover?",
- "What's the name of the paranoid robot?",
- "What is the answer to life, the universe and everything?",
- "What is the first name of the author of the hitchhikers guide?",
- "What is the last name of the author of the hitchhikers guide?",
- "Who is the male human protagonist?",
- "Who is the female human protagonist?",
- "According to the Guide, space is ____?",
- "What is the name of the spaceship which was stolen by the president of the universe?",
- "How many heads does Zaphod Beeblebrox have?";
-
- setarray @easy_answers_amount,2,2,2,2,2,4,4,2,4,2;
-
- set @random, rand(10);
- mes "\"" + @easy_questions$[@random] + "\"";
- input @answer$;
-
- if (@easy_answers_amount[@random] < 4)
- goto L_Easy_Skip4;
- set @quizparam$, "towelanswer0" + @random + "d";
- callfunc "StrangerQuiz";
- if (("###" + @answer$ == @quizanswer$))
- goto L_Right_Answer_Easy;
- goto L_Easy_Skip4;
-
-L_Easy_Skip4:
- if (@easy_answers_amount[@random] < 3)
- goto L_Easy_Skip3;
- set @quizparam$, "towelanswer0" + @random + "c";
- callfunc "StrangerQuiz";
- if (("###" + @answer$ == @quizanswer$))
- goto L_Right_Answer_Easy;
- goto L_Easy_Skip3;
-
-L_Easy_Skip3:
- 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;
-
-L_Right_Answer_Easy:
+ setarray @quiz_questions$[0],
+ "What two words are written in big friendly letters on the back cover?",
+ "What's the name of the paranoid robot?",
+ "What is the answer to life, the universe and everything?",
+ "What is the first name of the author of the hitchhikers guide?",
+ "What is the last name of the author of the hitchhikers guide?",
+ "Who is the male human protagonist?",
+ "Who is the female human protagonist?",
+ "According to the Guide, space is ___?",
+ "What is the name of the spaceship which was stolen by the president of the universe?",
+ "How many heads does Zaphod Beeblebrox have?";
+ setarray @quiz_answers$[0],
+ "Don't Panic",
+ "Marvin",
+ "42",
+ "Douglas",
+ "Adams",
+ "Arthur Philip Dent",
+ "Trillian",
+ "Big",
+ "Heart of Gold",
+ "2";
+
+ callfunc "MultiQuiz";
+ if (@success == 0) goto L_Wrong_Answer;
+
mes "[Stranger]";
mes "\"You're absolutely right. The next one will be more tricky.\"";
next;
- setarray @medium_questions$,
- "What is the name of the rock group claiming to be the loudest band in the universe?",
- "What star is near Ford's home planet?",
- "Which country does the human protagonist come from?",
- "What is the name of the computer on The Heart of Gold?",
- "What color is a Babel Fish?",
- "What did the bowl of petunias think?",
- "What body orifice should a babel fish be inserted in to work properly?",
- "What is the name of the super computer?",
- "What were the second most intelligent creatures on Earth?",
- "What race creates the worst poetry in universe?",
- "What is the name of the Vogon home planet?",
- "What is the name of the Restaurant at the End of the Universe?";
-
- setarray @medium_answers_amount,2,2,2,2,2,3,2,2,4,4,2,2;
-
- set @random, rand(12);
- mes "\"" + @medium_questions$[@random] + "\"";
- input @answer$;
-
- if (@medium_answers_amount[@random] < 4)
- goto L_Medium_Skip4;
-
- set @quizparam$, "towelanswer1" + @random + "d";
- callfunc "StrangerQuiz";
- if (("###" + @answer$ == @quizanswer$))
- goto L_Right_Answer_Medium;
- goto L_Medium_Skip4;
-
-L_Medium_Skip4:
- if (@medium_answers_amount[@random] < 3)
- goto L_Medium_Skip3;
- set @quizparam$, "towelanswer1" + @random + "c";
- callfunc "StrangerQuiz";
- if (("###" + @answer$ == @quizanswer$))
- goto L_Right_Answer_Medium;
- goto L_Medium_Skip3;
-
-L_Medium_Skip3:
- 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;
-
-L_Right_Answer_Medium:
+ setarray @quiz_questions$[0],
+ "What is the name of the rock group claiming to be the loudest band in the universe?",
+ "What star is near Ford's home planet?",
+ "Which country does the human protagonist come from?",
+ "What is the name of the computer on The Heart of Gold?",
+ "What color is a Babel Fish?",
+ "What did the bowl of petunias think?",
+ "What body orifice should a babel fish be inserted in to work properly?",
+ "What is the name of the super computer?",
+ "What were the second most intelligent creatures on Earth?",
+ "What race creates the worst poetry in universe?",
+ "What is the name of the Vogon home planet?",
+ "What is the name of the Restaurant at the End of the Universe?";
+ setarray @quiz_answers$[0],
+ "Disaster Area",
+ "Betelgeuse",
+ "England",
+ "Eddie",
+ "Yellow",
+ "Oh no, not again",
+ "Ear",
+ "Deep Thought",
+ "Dolphins",
+ "Vogons",
+ "Vogsphere",
+ "Milliways";
+
+ callfunc "MultiQuiz";
+ if (@success == 0) goto L_Wrong_Answer;
+
mes "[Stranger]";
mes "\"Not bad, not bad. Let's see if you can answer an even more difficult one.\"";
next;
- setarray @hard_questions$,
- "Drinking what drink is like having your brain smashed out by a slice of lemon wrapped round a large gold brick?",
- "How many pints of beers should you drink before hitchhiking?",
- "What initials are carved into Zaphod Beeblebrox's brain?",
- "What is Ford Prefect's nickname?",
- "Who is responsible for the fjords of Norway?",
- "What game is played on earth as a relict of memories to an ancient war?",
- "What is the name of the triple-breasted whore from Eroticon VI?",
- "Who will insult every living being in the universe, because he is immortal and getting bored?",
- "What is the name of the piteous creature that is continually reincarnated and subsequently killed, each time unknowingly, by Arthur Dent?";
-
- setarray @hard_answers_amount,4,2,2,2,2,2,2,4,2;
-
- set @random, rand(9);
- mes "\"" + @hard_questions$[@random] + "\"";
- input @answer$;
-
- if (@hard_answers_amount[@random] < 4)
- goto L_Hard_Skip4;
- set @quizparam$, "towelanswer2" + @random + "d";
- callfunc "StrangerQuiz";
- if (("###" + @answer$ == @quizanswer$))
- goto L_Right_Answer_Hard;
- goto L_Hard_Skip4;
-
-L_Hard_Skip4:
- if (@hard_answers_amount[@random] < 3)
- goto L_Hard_Skip3;
- set @quizparam$, "towelanswer2" + @random + "c";
- callfunc "StrangerQuiz";
- if (("###" + @answer$ == @quizanswer$))
- goto L_Right_Answer_Hard;
- goto L_Hard_Skip3;
-
-L_Hard_Skip3:
- 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;
-
-L_Right_Answer_Hard:
+ setarray @quiz_questions$[0],
+ "Drinking what drink is like having your brain smashed out by a slice of lemon wrapped round a large gold brick?",
+ "How many pints of beers should you drink before hitchhiking?",
+ "What initials are carved into Zaphod Beeblebrox's brain?",
+ "What is Ford Prefect's nickname?",
+ "Who is responsible for the fjords of Norway?",
+ "What game is played on earth as a relict of memories to an ancient war?",
+ "What is the name of the triple-breasted whore from Eroticon VI?",
+ "Who will insult every living being in the universe, because he is immortal and getting bored?",
+ "What is the name of the piteous creature that is continually reincarnated and subsequently killed, each time unknowingly, by Arthur Dent?";
+ setarray @quiz_answers$[0],
+ "Pan Galactic Gargle Blaster",
+ "3",
+ "ZB",
+ "Ix",
+ "Slartibartfast",
+ "Cricket",
+ "Eccentrica Gallumbits",
+ "Wowbagger",
+ "Agrajag";
+
+ callfunc "MultiQuiz";
+ if (@success == 0) goto L_Wrong_Answer;
+
mes "[Stranger]";
mes "\"Unbelievable! You're really a wise person.\"";
next;
mes "\"One last question, but this shouldn't be a problem for you.\"";
next;
mes "\"What is the most important item for every hitchhiker to have?\"";
- input @answer$;
- if (@answer$ != "Towel" && @answer$ != "towel")
+ mes "";
+ mes "##BDrag & drop the item from your inventory##b.";
+ requestitem @answer$;
+ if (@answer$ != "Towel" && @answer$ != "HitchhikersTowel")
goto L_Wrong_Answer;
mes "[Stranger]";
diff --git a/world/map/npc/functions/quiz.txt b/world/map/npc/functions/quiz.txt
index ea10a3c4..0f2f7c87 100644
--- a/world/map/npc/functions/quiz.txt
+++ b/world/map/npc/functions/quiz.txt
@@ -1,3 +1,8 @@
+// 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$) != getarraysize(@quiz_questions$)) ||
diff --git a/world/map/npc/functions/strangerquiz.txt b/world/map/npc/functions/strangerquiz.txt
deleted file mode 100644
index 3427a0ee..00000000
--- a/world/map/npc/functions/strangerquiz.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-function|script|StrangerQuiz
-{
- // param @quizparam$$
- // return in @quizanswer$
- set @quizanswer$, (@quizparam$);
- return;
-}
diff --git a/world/map/npc/magic/README.md b/world/map/npc/magic/README.md
index 1ba351d1..89d0fe12 100644
--- a/world/map/npc/magic/README.md
+++ b/world/map/npc/magic/README.md
@@ -1,15 +1,15 @@
# To-do
- [X] finish the missing spells and push them so they can be tested
- [ ] Deal with the removal of the following spells from magic to NPCs or Commands
- - Ched
- - [ ] merge-concentration-potions
- - [ ] Auldsbel
- - [ ] make-short-tanktop
- - [ ] make-tanktop
- - [ ] make-shirt
- - [ ] make-concentration-potion
- - Wyara
- - [ ] sense-spouse
+ - [X] Ched
+ - [ ] merge-concentration-potions
+ - [ ] Auldsbel
+ - [ ] make-short-tanktop
+ - [ ] make-tanktop
+ - [ ] make-shirt
+ - [ ] make-concentration-potion
+ - [X] Wyara
+ - [ ] sense-spouse
---
---
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 68a348e1..57aa43e0 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -14,7 +14,6 @@ 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/time.txt
npc: npc/functions/water_bottle.txt
npc: npc/functions/evil_obelisk.txt