Jump to content
  • 0

Quest NPC w/ Question & Answer


skymia

Question


  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   4
  • Joined:  02/19/17
  • Last Seen:  

does anyone have here a script like this?

I saw this npc in Dark-Ro Force...credits to them...I hope someone have this type of script...thanks

  1. Pay an application Fee (5 Milion Zenies).
  2. Show your survival skills (hunt 5 Majestic Goats).
  3. Do a knowledge Test.
  • After paying the fees you need to delivery 5 Majestic Goats (They can be bought at @mall).
  • The last step is the test, you can either answer in small letter (test), in capital letters (TEST), or the normal way (Test), but nothing else will work (i.e teSt). You need at least a 8/10 score to pass the exam. You can't quit the exam before answering all questions. Here are the questions:
  1. What is the special source of energy used by ninjas ?
  2. What is the name of the special eye of the Uchiha clan ?
  3. What is the name of the secret village of the country of Fire ?
  4. What is the prefered jutsu of Naruto ?
  5. How many villages are there in total ?
  6. What is the name of the 'star looking' weapon of the ninjas ?
  7. What is the name of the ultimate warrior/ninja in a particular village ?
  8. What is the name of Kiba's dog ?
  9. Who is the master of Naruto, Sasuke and Sakura ?
  10. What is the name of the nine-tailed demon fox ?
Answers to the question:
  1. chakra
  2. sharingan
  3. konoha
  4. kage bunshin no jutsu
  5. 10
  6. shuriken
  7. kage
  8. akamaru
  9. kakashi
  10. kurama
  • Once you passed on the exam you can choose to be a genin of one country, each country gives a different Head Protector with different status

Item Quest

  1. Headprotector Fire - Country of Fire (Item Effect:+10 STR HP)
    Example:
    31224,_headprotectorfire,Headprotector Fire,4,0,,200,,3,,1,0xFFFFFFFF,7,2,256,,0,1,1621,{bonus bStr,10; bonus bMaxHP,1000;},{},{}

     

  2. Headprotector Wind - Country of Wind (Item Effect:+10 AGI HP)
  3. Headprotector Water - Country of Water. (Item Effect:+10 INT HP)
  4. Headprotector Lightning - Country of Lightning. (Item Effect:+10 LUK HP)
  5. Headprotector Earth - Country of Earth. (Item Effect:+10 VIT HP)
  6. Headprotector Sound - Country of Sound. (Item Effect:+10 DEX HP)

 

 

Edited by skymia
Link to comment
Share on other sites

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   4
  • Joined:  02/19/17
  • Last Seen:  

14 hours ago, Z3R0 said:

Why would u want it multiple times? Once they do it right they shouldn't choose a different one?

You want it to be repeatable?

yes i want to be repeatable and can choose other also a item to make

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

For simplicity without changing a bunch of the script...

 

under the OnComplete: section... change

set(quizzer, quizzer^8);

to

set(quizzer, 0);

That should reset the variable and let them do the quiz again (zeny cost and everything)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  234
  • Reputation:   113
  • Joined:  02/24/15
  • Last Seen:  

On 11/8/2017 at 12:43 AM, Z3R0 said:

Un poco áspero, estoy cansado ... pero funciona disfrutar


//===== Script =========================================================================
//= Quizzer
//===== Made by: =======================================================================
//= Z3R0
//===== Current Version: ===============================================================
//= Version: 1.0
//===== Description: ===================================================================
//= rAthena Script Request
//= https://rathena.org/board/topic/112260-quest-npc-w-question-answer
//===== Additional Comments: ===========================================================
//= version 1.0: Initial Attempt
//======================================================================================

prontera,158,173,4	script	Quizzer	92,{ doevent "quizzer_core::OnClick"; }

-	script	quizzer_core	-1,{

	// Function Declarations
	function MesItem;
	function ChkItem;
	function ChkAnswer;

	OnInit:

		// ---------------------------------
		// Configurable Settings
		// ---------------------------------

			// NPC Name to Display
			set(.npc$, "[Quizzer]");

			// Fee to Pay to Begin Quiz
			set(.fee, 5000000);

			// Show # of Question Player is On and Total number of questions?
			set(.ShowQuestionProgress, 1);

			// Number of Answers to Pass Quiz
			set(.NumRightToPass, 8);

			// Required Items Array (Pair: Item_ID, Item_Amount)
			setarray(.required_items[0], 2256, 5); // Here you can setup multiple items in pairs.. (item_id, amount)

			// Array of Questions (Each question must have a corresponding answer)
			setarray(.questions$[0],
				"What is the special source of energy used by ninjas ?",
				"What is the name of the special eye of the Uchiha clan ?",
				"What is the name of the secret village of the country of Fire ?",
				"What is the prefered jutsu of Naruto ?",
				"How many villages are there in total ?",
				"What is the name of the 'star looking' weapon of the ninjas ?",
				"What is the name of the ultimate warrior/ninja in a particular village ?",
				"What is the name of Kiba's dog ?",
				"Who is the master of Naruto, Sasuke and Sakura ?",
				"What is the name of the nine-tailed demon fox ?"
			);

			// Array of Answers (Each Answer must have a corresponding Question)
			setarray(.answers$[0],
				"Chakra",
				"Sharingan",
				"Konoha",
				"Kage bunshin no jutsu",
				"10",
				"Shuriken",
				"Kage",
				"Akamaru",
				"Kakashi",
				"Kurama"
			);

			// Array of Reward Item ID's
			setarray(.rewards[0], 501, 502, 503, 504, 505, 506);
			setarray(.rewards_effects$[0], "+10 STR HP", "+10 AGI HP", "+10 INT HP", "+10 LUK HP", "+10 VIT HP", "+10 DEX HP");

			// STOP!!! DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!!!!
			// check .ShowQuestionProgress
			if (.ShowQuestionProgress > 1) set(.ShowQuestionProgress, 1);

			// Check .required_items
			if (getarraysize(.required_items) % 2 != 0) {
				set(.error, 1);
				announce(strnpcinfo(0) + ": [ERROR] Invalid Number of Items in .required_items", bc_all, C_YELLOW); end();
			}

			if (getarraysize(.questions$) != getarraysize(.answers$)) {
				set(.error, 1);
				announce(strnpcinfo(0) + ": [ERROR] Invalid Number of Questions to Answers", bc_all, C_YELLOW); end();
			}

			if (getarraysize(.rewards) != getarraysize(.rewards_effects$)) {
				set(.error, 1);
				announce(strnpcinfo(0) + ": [ERROR] Invalid Number of Rewards to Reward Effects", bc_all, C_YELLOW); end();
			}

			set(.error, 0);
			end();



	// Player clicks the initial NPC
	OnClick:
		if (.error) {
			mes("There was an error loading this script. Please contact your server administrator");
			close();
		}

		if (quizzer & 8) {
			mes("You have already completed this trial.");
			close();
		}
		else if (quizzer & 4) doevent("quizzer_core::OnComplete");
		else if (quizzer & 2) doevent("quizzer_core::OnQuiz");
		else if (quizzer & 1) doevent("quizzer_core::OnHunt");
		else doevent("quizzer_core::OnStart");
		end();

	OnStart:
		mes(.npc$);

		if (.fee) {
			mes("You will need " + .fee + " zeny to start this trial.");
			mes("Are you ready to proceed?");
			next();
			switch(select("Yes:No")) {
				case 1:

					if (Zeny < .fee) {
						mes("You do not have enough zeny to start this trial.");
						close();
					}

					set(Zeny, Zeny - .fee);
					set(quizzer, 1);

					mes("I need you to gather these items:");
					for(.@i = 0; .@i < getarraysize(.required_items); .@i+=2) {
						mes( MesItem(.required_items, .@i) );
					}
					mes("I await your return");
					close();

				case 2:
				default:
					mes("I knew you weren't capable!");
					close();
			}
		}

	OnHunt:
		mes(.npc$);

		// Determine if they have completed all the required items...
		mes("Checking Requirement Status:");
		for(.@i = 0; .@i < getarraysize(.required_items); .@i+=2) {
			mes(MesItem(.required_items, .@i) + " - " + ChkItem(.required_items[.@i], .required_items[.@i+1]));
		}

		if (@quizzer_no_items == 1) {
			mes("You do not have enough items... You fail!");
			set(@quizzer_no_items, 0);
			close();
		}

		// Passed let's remove the items
		for(.@i = 0; .@i < getarraysize(.required_items); .@i+=2) {
			delitem .required_items[.@i], .required_items[.@i+1];
		}

		mes("Success! You may now start the quiz!");
		next();
		set(quizzer, quizzer^2);
		doevent("quizzer_core::OnQuiz");
		end();

	OnQuiz:
		mes(.npc$);

		.@num_right = 0;

		for(.@i = 0; .@i < getarraysize(.questions$); .@i++) {

			if (.ShowQuestionProgress) {
				mes("Question #" + (.@i+1) + " / " + getarraysize(.questions$));
			}

			mes(.questions$[.@i]);
			input .player_answers$[.@i];

			// Let's compare the answer :D
			.@num_right += ChkAnswer(.answers$[.@i], .player_answers$[.@i]);

			mes("Answer Recorded. Next Question");
			next();

		}

		if (.@num_right >= .NumRightToPass) {
			set(quizzer, quizzer^4);
			mes("You have passed the quiz!");
			next();
			doevent("quizzer_core::OnComplete");
			end();
		}

		mes("You did not pass the quiz!");
		close();

	OnComplete:
		mes(.npc$);
		mes("Well Done Old Chap!");
		mes("Please select from the following rewards");

		set(.@menu$, "");
		for(.@i = 0; .@i < getarraysize(.rewards); .@i++) {
			set(.@menu$, .@menu$ + getitemname(.rewards[.@i]) + " (" + .rewards_effects$[.@i] + "):");
		}

		getitem .rewards[select(.@menu$) - 1], 1;
		set(quizzer, quizzer^8);

		mes("Thank you for participating");
		close();

	// getarg(0) = Array
	// getarg(1) = Index
	function MesItem {
		.@item_id = getelementofarray(getarg(0), getarg(1));
		.@item_amount = getelementofarray(getarg(0), getarg(1) + 1);

		return .@item_amount + ( .@item_amount > 1 ? "x" : "") + " " + getitemname(.@item_id);
	}

	// getarg(0) = item_id
	// getarg(1) = amount required
	function ChkItem {
		.@has = countitem(getarg(0));

		if (.@has >= getarg(1)) {
			return "^000000" + .@has + "^000000/^000000" + getarg(1) + "^000000";
		}

		set(@quizzer_no_items, 1);
		return "^FF0000" + .@has + "^000000/^000000" + getarg(1) + "^000000";
	}

	// getarg(0) = Answer
	// getarg(1) = Player Answer
	function ChkAnswer {
		if (getarg(0) == getarg(1)) return 1;
		else if (strtoupper(getarg(0)) == getarg(1)) return 1;
		else if (strtolower(getarg(0)) == getarg(1)) return 1;
		else return 0;
	}


}

Is it possible to return this repeatable quest? and how could it be done?

(SOLVED)

Edited by maken06
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  234
  • Reputation:   113
  • Joined:  02/24/15
  • Last Seen:  

Hi @Bringer

Only in the script should you change this.

set(quizzer, quizzer^8);

to

set(quizzer, 0);

and uncomment or erase this, so that the quest can be repeated.

//		if (quizzer & 8) {
//			mes("You have already completed this trial.");
//			close();
//		}

and that's it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...