This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
Ta®oS™
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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now