Ta®oS™ Posted January 11, 2014 Share Posted January 11, 2014 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) { Quote Link to comment Share on other sites More sharing options...
0 Versus Posted January 12, 2014 Share Posted January 12, 2014 Not all packs contain handlers for Chat. In this case, simply use Say2.java. Quote Link to comment Share on other sites More sharing options...
Question
Ta®oS™
i search this file ChaTtell on l2jfrozen and i cant find.
i need to adapt this small code
Link to comment
Share on other sites
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.