Jump to content

Question

Posted

i search this file ChaTtell on l2jfrozen and i cant find.

 

i need to adapt this small code

 

 

Index: java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java    (revision 5)
+++ java/net/sf/l2j/gameserver/handler/chathandlers/ChatTell.java    (working copy)
@@ -18,6 +18,7 @@
 import net.sf.l2j.gameserver.model.BlockList;
 import net.sf.l2j.gameserver.model.L2World;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.entity.Trivia;
 import net.sf.l2j.gameserver.network.SystemMessageId;
 import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
 
@@ -39,10 +40,30 @@
     @Override
     public void handleChat(int type, L2PcInstance activeChar, String target, String text)
     {
+            
         // Return if no target is set.
         if (target == null)
             return;
         
+        if(target.equalsIgnoreCase("trivia"))
+        {
+            if(Trivia.isInactive())
+            {
+                activeChar.sendMessage("Trivia event is not currently running.");
+                return;
+            }
+            else if(!Trivia.isAnswering() || Trivia.isCorrect() || Trivia.isRewarding())
+            {
+                activeChar.sendMessage("You cannot answer now.");
+                return;
+            }
+            else
+            {
+                Trivia.handleAnswer(text,activeChar);
+                return;
+            }
+        }
+        
         final L2PcInstance receiver = L2World.getInstance().getPlayer(target);
         if (receiver != null)
         {

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...