diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json
index 56b1466..a472bca 100755
--- a/DataCollection/gamedata.json
+++ b/DataCollection/gamedata.json
@@ -61,6 +61,9 @@
"no_telescope":"You do not have a telescope to use! You try making circles with your hands and placing them in front of one eye, but it is of minimal aid...",
"starved_horse":"You have been sent to Prison Isle for starving one of your horses! They have been fed for you.",
"message_queue":"OFFLINE MESSAGE:",
+ "timed_messages":{
+ {"hours":2, "messages":["You have been playing for 2 hours. Aren't you sleepy? It's okay to go to bed. We'll all be here tomorrow."]},
+ },
"chat_errors":{
"cant_find_player":"Could not find player to Private chat!",
"ads_once_per_minute":"Ads may only be posted once per minute.",
@@ -84,11 +87,14 @@
"event_end":"TACK SHOP HORSE GIVEAWAY: No one was at %SHOPNAME% in %TOWN% to win the horse. Oh well, event is over.",
},
"real_time_quiz":{
- "event_meta":"^ATReal Time Quiz - Q: %QUESTIONNUMBER%/8^HFirst player to answer all 8 questions wins!
You have made %MISTAKE% mistakes so far.
Question #%QUESTIONNUMBER% (Category: %CATEGORY%):
%QUESTIONTEXT^PLAnswer (simplest form):|^PS15|SUBMIT^R3^LType QUIT if you want to give up.^R1",
+ "event_meta":"^ATReal Time Quiz - Q: %QUESTIONNUMBER%/8^HFirst player to answer all 8 questions wins!
You have made %MISTAKES% mistakes so far.
Question #%QUESTIONNUMBER% (Category: %CATEGORY%):
%QUESTIONTEXT%^PLAnswer (simplest form):|^PS15|SUBMIT^R3^LType QUIT if you want to give up.^R1",
"event_start":"REAL TIME QUIZ: Type !QUIZ to attempt the 8 question, 5 minute Real Time Quiz. Prizes for all that participate. Feel free to search the web for answers you don't know.",
"event_end":"QUIZ TIME IS UP: No one had answered all questions.",
"event_bonus":"QUIZ BONUS: $%MONEY% Earned. ($500/correct - $100/mistake($250 min))",
- "event_unavailable":"Realtime quiz is currently unavailable"
+ "event_win_bonus":"QUIZ WINNER BONUS: $%MONEY% Earned. ($2500 win + $500/correct - $100/mistake)",
+ "event_win":"QUIZ COMPLETED: %USERNAME% answered all questions first!",
+ "event_unavailable":"Realtime quiz is currently unavailable",
+ "event_entered":"You have entered the Realtime Quiz. Good luck!"
},
},
"horse_leaser":{
diff --git a/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs b/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs
index ba94e18..d6cd80e 100755
--- a/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs
+++ b/Horse Isle Server/HorseIsleServer/Game/Chat/Chat.cs
@@ -158,6 +158,9 @@ namespace HISP.Game.Chat
else if (message.ToUpper().StartsWith("!HEAR"))
return Command.UnMute(message, args, user);
+ else if (message.ToUpper().StartsWith("!QUIZ"))
+ return Command.Quiz(message, args, user);
+
else if (message.ToUpper().StartsWith("!WARP"))
return Command.Warp(message, args, user);
diff --git a/Horse Isle Server/HorseIsleServer/Game/Chat/Command.cs b/Horse Isle Server/HorseIsleServer/Game/Chat/Command.cs
index 708fba7..4788705 100755
--- a/Horse Isle Server/HorseIsleServer/Game/Chat/Command.cs
+++ b/Horse Isle Server/HorseIsleServer/Game/Chat/Command.cs
@@ -368,6 +368,32 @@ namespace HISP.Game.Chat
return true;
}
+
+ public static bool Quiz(string message, string[] args, User user)
+ {
+ bool quizActive = false;
+ // TODO: Check quiz event is running.
+ if (quizActive)
+ {
+ string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
+
+ byte[] enteredRealTimeQuiz = PacketBuilder.CreateChat(Messages.EventEnteredRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
+ user.LoggedinClient.SendPacket(enteredRealTimeQuiz);
+
+ byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
+ user.LoggedinClient.SendPacket(chatPacket);
+ return true;
+
+ }
+ else
+ {
+ byte[] quizUnavailable = PacketBuilder.CreateChat(Messages.EventUnavailableRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
+ user.LoggedinClient.SendPacket(quizUnavailable);
+ return false;
+ }
+
+ }
+
public static bool Mute(string message, string[] args, User user)
{
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
diff --git a/Horse Isle Server/HorseIsleServer/Game/Messages.cs b/Horse Isle Server/HorseIsleServer/Game/Messages.cs
index 4b31eb1..e42f99e 100755
--- a/Horse Isle Server/HorseIsleServer/Game/Messages.cs
+++ b/Horse Isle Server/HorseIsleServer/Game/Messages.cs
@@ -65,6 +65,16 @@ namespace HISP.Game
public static string SocialTypeFormat;
public static string SocialPlayerNoLongerNearby;
+ // Events : Real Time Quiz
+ public static string EventMetaRealTimeQuizFormat;
+ public static string EventStartRealTimeQuiz;
+ public static string EventEndRealTimeQuiz;
+ public static string EventBonusRealTimeQuizFormat;
+ public static string EventWinBonusRealTimeQuizFormat;
+ public static string EventWinRealTimeQuizFormat;
+ public static string EventUnavailableRealTimeQuiz;
+ public static string EventEnteredRealTimeQuiz;
+
// Events : Real Time Riddles
public static string EventStartRealTimeRiddleFormat;
public static string EventEndRealTimeRiddle;
@@ -144,7 +154,7 @@ namespace HISP.Game
// Trading : Messages
public static string TradeWaitingForOthersToAcceptMessage;
-
+
public static string TradeRequiresBothPlayersMessage;
public static string TradeCanceledBecuasePlayerMovedMessage;
@@ -1114,8 +1124,7 @@ namespace HISP.Game
// Click
public static string NothingInterestingHere;
- // Event : Tack Shop Giveaway
-
+
// Throwables
public static string FormatModSplatterBallAwardedOther(string username)
@@ -1130,8 +1139,27 @@ namespace HISP.Game
{
return itemFormat.Replace("%USERNAME%", username);
}
-
- // Tack Shop Giveaway
+
+ // Event : Real Time Quiz
+ public static string FormatEventRealTimeQuizMeta(int questionNo, int totalMistakes, string category, string question)
+ {
+ return EventMetaRealTimeQuizFormat.Replace("%QUESTIONNUMBER%", questionNo.ToString()).Replace("%MISTAKES%", questionNo.ToString()).Replace("%CATEGORY%", category).Replace("%QUESTIONTEXT%", question);
+ }
+ public static string FormatEventRealTimeQuizBonus(int bonusMoney)
+ {
+ return EventBonusRealTimeQuizFormat.Replace("%MONEY%", bonusMoney.ToString("N0", CultureInfo.InvariantCulture));
+ }
+ public static string FormatEventRealTimeQuizWinBonus(int bonusMoney)
+ {
+ return EventWinBonusRealTimeQuizFormat.Replace("%MONEY%", bonusMoney.ToString("N0", CultureInfo.InvariantCulture));
+ }
+ public static string FormatEventRealTimeQuizWin(string winner)
+ {
+ return EventWinRealTimeQuizFormat.Replace("%USERNAME%", winner);
+ }
+
+
+ // Event : Tack Shop Giveaway
public static string FormatEventTackShopGiveawayEnd(string shopName, string townName)
{
return EventEndTackShopGiveawayFormat.Replace("%SHOPNAME%", shopName).Replace("%TOWN%", townName);
diff --git a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs
index 6541008..8e0d52d 100755
--- a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs
+++ b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs
@@ -952,6 +952,17 @@ namespace HISP.Server
// Message Queue
Messages.MessageQueueHeader = gameData.messages.message_queue;
+ // Events : Real Time Quiz
+
+ Messages.EventMetaRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_meta;
+ Messages.EventStartRealTimeQuiz = gameData.messages.events.real_time_quiz.event_start;
+ Messages.EventEndRealTimeQuiz = gameData.messages.events.real_time_quiz.event_end;
+ Messages.EventBonusRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_bonus;
+ Messages.EventWinBonusRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_win_bonus;
+ Messages.EventWinRealTimeQuizFormat = gameData.messages.events.real_time_quiz.event_win;
+ Messages.EventUnavailableRealTimeQuiz = gameData.messages.events.real_time_quiz.event_unavailable;
+ Messages.EventEnteredRealTimeQuiz = gameData.messages.events.real_time_quiz.event_entered;
+
// Events : Real Time Riddle
Messages.EventStartRealTimeRiddleFormat = gameData.messages.events.real_time_riddle.event_start;