Package commands.voiced

Source Code of commands.voiced.Debug

package commands.voiced;

import l2p.extensions.scripts.Functions;
import l2p.extensions.scripts.ScriptFile;
import l2p.gameserver.handler.IVoicedCommandHandler;
import l2p.gameserver.handler.VoicedCommandHandler;
import l2p.gameserver.model.L2Object;
import l2p.gameserver.model.L2Player;
import l2p.util.Log;
import l2p.util.Util;

public class Debug extends Functions implements IVoicedCommandHandler, ScriptFile
{
  private String[] _commandList = new String[] {"mobDbg", "dbg"};

  public void onLoad()
  {
    VoicedCommandHandler.getInstance().registerVoicedCommandHandler(this);
  }

  public void onReload()
  {
  }

  public void onShutdown()
  {
  }

  public boolean useVoicedCommand(String command, L2Player activeChar, String args)
  {
    command = command.intern();
    if(command.equalsIgnoreCase("mobDbg") || command.equalsIgnoreCase("dbg"))
    {
      L2Object target = activeChar.getTarget();
      if(target == null)
      {
        target = activeChar;
      }
      if(target.isCharacter())
      {
        Log.add(target.dump() + "AI: " + Util.dumpObject(target.getAI(), true, true, true) + "\n ========================================================================================== \n", "mobDbg");
        activeChar.sendMessage(target.getName() + "'s info dumped");
        return true;
      }
    }
    return false;
  }

  public String[] getVoicedCommandList()
  {
    return _commandList;
  }
}
TOP

Related Classes of commands.voiced.Debug

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.