Skip to content

On Small Adapt

Featured Replies

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)
         {

Not all packs contain handlers for Chat. In this case, simply use Say2.java.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.