Перейти к содержанию

[Авто Ивент] Викторина


Рекомендуемые сообщения

Здарова народ , Хабиля как и обещял релизнул скрипт Викторины

Этот скрипт изначально писался на eA, потом его дорабатывали на rA. (Все автары указаны в шапке)

А теперь, Хабиля докодил Ивент...

Ивент анонсируеться несколько раз перед началом

P888Zdq.jpg

- НПЦ задает 10 разных вопросов
- Вопросы беруться из банка вопросов

- Игроки отвечают в общий чат 
- Игрокам не нужно беспокоиться о Заглавных буквах
- 1) Вопросы задает НПЦ

l33tzjF.jpg
- 2) Если через 15 секунд не дан ответ, даеться подсказка

ahaNusT.jpg
- 3) Если еще через 15 секунд после подсказки, ответ не был дан, вопрос валиться.

ZB5wgGq.jpg
- 4) Если правильный ответ был дан, даеться награда

2k8BuqW.jpg

 

Замеики Хабили:

1) Контроль

Если у вас есть некий контроллер АвтоИвентов как у Хабили, хабиля добавил методы контроля

OnEventStart:

OnStop:

OnEventTimeOut:

 

Если у вас нет такого контроллера, можете тупо написать время когда евент должен запускаться:

OnMinute33:

OnMinute50:

OnMinute05:

 

2) Награды

На сервере МОТОР даються специяльные Ивент поинты...

Если-же вы больше хотите давать Зенни,  Веш (или бан B38cFIv.jpg)

Хабиля добавил примеры в код

// Winner gets reward in Zeny
//Zeny += 1000000; // Alotta bax ;)

 

3) Вопросы Викторины

Чтобы добавить или изменить вопросы следуйте этой схеме

DefineQuestion("<Вопрос>", "<ответ>", "<подсказка>");

 

4) Читы

Хабиля в курсы, что этот ивент можно про читить используя бота или КАКросы (Какеры в курсе)

По этому только скромные награды даються :blush:

//===== Hercules Script ====================================================================
// Automatic Trivia Event
//===== Originally initiated By: ===========================================================
// Capuche http://rathena.org/board/user/5984-capuche/
//===== Changed By: ========================================================================
// Habilis
//===== Current Version: ===================================================================
// 1.5
//===== Compatible With: ===================================================================
// Hercules
//===== Description: =======================================================================
//- Enhanced version of facts auto event. The Event is announced. The NPC asks 10 random 
//- questions from a question bank. Players have to write the answer to the main chat.
//- Players don't need to worry about CAPITAL letters.
//- 1) Question is asked by the NPC.
//- 2) If there is no answer after 15 seconds NPC will give a hint.
//- 3) IF there is still no answer after a hint, the question is skipped.
//- 4) If the right answer is given, player is announced and reward is given
//==========================================================================================
//=====From eAthena to rAthena to Hercules==================================================
//==========Without this original author, this script will never exist======================
//========Original author Credits===========================================================
//=====================================================DONT=================================
// ToastOfDoom ================================================REMOVE=======================
// RxChris	   =========================================================THIS================
// Hellflaem   ================================================================CREDIT=======
//==========================================================================================
//==========================================================================================


-	script	Trivia_Auto_Event	FAKE_NPC ,{
	
	OnMinute18:
	//OnEventStart:
		// Спаве НПЦ чтобы игроки могли подойти
		// и ВОЗМОЖНО почитать правила.
		enablenpc "Викторина#main";
		.@nbAnnounce = 3; // Сколько раз анонсировать Ивент с минутным интервалом.
		while( .@nbAnnounce > 0 ) {
			announce "Викторина начнеться на юге от Пронтеры через " + .@nbAnnounce + " минут.",bc_all | bc_blue;
			.@nbAnnounce--;
			sleep 60000;
		}
	    announce "Викторина началась!",bc_all | bc_blue;
		donpcevent "Викторина#main::OnEventBegin";
		end;
		
	OnStop:	
	OnEventTimeOut:
		disablenpc "Викторина#main";
		end;
	
	OnInit:
		disablenpc "Викторина#main";
		end;
}


prt_fild08,137,365,6	script	Викторина#main	4_F_JOB_ASSASSIN,{

OnTalk:
	mes "[^0055FF ::: Викторина ::: ^000000]";
	mes " ";
	mes "Очень простой Ивент!";
	mes " ";
	mes "Я буду задавать различные вопросы.";
	mes " ";
	mes "Нужно просто сказать правильный ответ в общий чат!";
	mes " ";
	mes "Не беспокойся о заглавных буквах, Я способна распознать правильный ответ, когда я увижу таковой ;)";
	mes "Правильное написание ответа обязательно.";
	
	close2;
	end;

function DefineQuestion; function GetQuestion; function GetAnswer; function GetHint;

OnEventBegin:
L_loop:
	do {
		.@i = rand(.numQuestions); // Randomly picks a fact.
	} while(.already_asked[.@i]);
	
	.already_asked[.@i] = true;
	
	if( !.count ) {
		npctalk "Отвечайте на мои вопросы:";
		sleep 2000;
		npctalk "Если ваш ответ окажеться верным, вы получите призы!";
	}
	.count++;
	sleep 4000;
	npctalk "[" + .count + "/" + .max_questions + "] " + GetQuestion(.@i);
	defpattern 1, "([^:]+):.*\\s" + GetAnswer( .@i ) + "(.*)", "Right";
	.Ans$ = GetAnswer( .@i );
	.Hint$ = GetHint( .@i );;
	activatepset 1;
	initnpctimer;
	end;
	
OnTimer15000:
	npctalk "[Подсказка] : " + .Hint$;
	end;
OnTimer30000:
	npctalk "Извините, что-то долго думали над ответом...";
	callsub L_continue;
	end;
	
Right:
	npctalk "Правильно, " + strcharinfo(0) + "! Правильный ответ  " + .Ans$ + ".";
	
	// Winner gets reward in Zeny
	//Zeny += 1000000; // Alotta bax ;)
	
	// Winner gets reward in Item
	//getitem 607, rand( 1,10 ); // Randomly picks from 1 to 10   607 --Ygg berry~ .
	
	// Winner gets reward in Points
	.@pointsWon = rand(.minPoints,.maxPoints);
	#LROEVENTPOINTS = #LROEVENTPOINTS + .@pointsWon;
	dispbottom .ServerName$  + " : Вы выиграли " + .@pointsWon + " ивент поинтов.";
	
L_continue:
	deletepset 1;
	stopnpctimer;
	if( .count < .max_questions ) {
		callsub L_loop; // loop 10 questions
	}
	.count = 0; // end of event
	.Q_session = 0;
	npctalk "К сожалению, у меня больше нет вопросов. Спасибо за участие в этом ивенте! ^^";
	deletearray .already_asked, getarraysize(.already_asked);
	emotion e_thx;
	sleep 2000;
	disablenpc "Викторина#main";
	end;

function DefineQuestion {
	.@a = .numQuestions % 128;
	.@b = .numQuestions / 128;

	setd(".question_" + .@a + "$[" + .@b + "]", getarg(0));
	setd(".answer_" + .@a + "$[" + .@b + "]", getarg(1));
	setd(".hint_" + .@a + "$[" + .@b + "]", getarg(2));
	
	.numQuestions = .numQuestions + 1;
	return;
}
function GetQuestion {
	return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}
function GetAnswer {
	return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}
function GetHint {
	return getd(".hint_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}

OnInit:
	.ServerName$ = "[Ваш скучный сервер]";
	.minPoints = 10;
	.maxPoints = 25;
	.max_questions = 10;	// 10 questions if more than 10 questions are defined
	DefineQuestion("Когда вы создаете нового персонажа, сколько начальных статов в этой игре?","6", "STR, AGI, VIT, INT, DEX, LUK");
	DefineQuestion("Умение Волщебника Water Ball может быть использовано над deluge или над каким элементом?", "вода", "мокрая.");
	DefineQuestion("Which item is required to create a guild?", "emperium", "Имперский ");
	DefineQuestion("which skill is beneficial to the living and damaging to the undead?", "heal", "It restores health.");
	DefineQuestion("In which town Thieves guild is located?", "morocc", "A town in the sorgat desert.");
	DefineQuestion("In which town Merchants guild is located?", "alberta", "It's a portuary town.");
	DefineQuestion("In which town Archers guild is located?", "payon", "");
	DefineQuestion("What property do Izlude dungeon monsters possess?", "water", "It is liquid.");
	DefineQuestion("What status can be inflicted with the Hammer Fall skill?", "stun", "Did I see the stars around your head?");
	DefineQuestion("How much Zeny one Jellopy is worth?", "3", "Just get it from a Poring.");
	DefineQuestion("Which town has the most Dancers?", "comodo", "An island in the warm waters.");
	DefineQuestion("How many different poring-like monsters you can meet near prontera, including mini bosses?", "9", "poring, drops, poporing, marin, santa poring, mastering, angeling, arcangeling, ghostring");
	DefineQuestion("What property counters best the water property?", "wind", "It's Blowing");
	DefineQuestion("What property counters best the undead property?", "holy", "Perhaps an acolyte or a priest can tell you?");
	DefineQuestion("What kind of food both Vanilmirth and Christmas Goblin like?", "scel", "Yellow jeloppy");
	DefineQuestion("How many cities are in Rune-Midgrad kingdom?", "11", "Prontera, Izlude, Jawaii, Geffen, Payon, Morocc, Alberta, Comodo, Umbala, Al De Baran, Lutie");
	DefineQuestion("What city is the capital of Rune-Midgrad kingdom?", "prontera", "The most central town of all.");
	DefineQuestion("Which food is able to fully restore health and mana? _________ _____", "yggdrasil berry", "A berry growing on the most majestic tree!");
	DefineQuestion("Which one of those is the fastest weapon type? Sword, Dagger, Staff, Mace", "dagger", "Something that has to do with the length of the blade.");
	DefineQuestion("Which one of those id the cheapest? Jellopy  Large Jellopy   Royal Jelly   Honey", "jellopy", "Dropped by Porings.");
	DefineQuestion("Which monster drops a pet taming item to tame Deviruchi?", "joker", "Why so serious?");
	
	if( .numQuestions < .max_questions ) .max_questions = .numQuestions;
	end;
}

 

 

Патом доперевожу вопросики....

  • Upvote 3
Ссылка на комментарий
Поделиться на другие сайты

×
×
  • Создать...
Яндекс.Метрика