我是 Java 新手,但我尝试为游戏 Lineage2 编写脚本。
继承人的代码:
package ZergZ.ZTeleport;
import javolution.util.FastMap;
import com.l2jserver.Config;
import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.handler.VoicedCommandHandler;
public class ZTeleport implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS =
{
"teleport"
};
@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
{
if (activeChar == null)
return false;
if (params.equalsIgnoreCase("aden"))
{
activeChar.teleToLocation(147736,-56243,-2781);
}
if (params.equalsIgnoreCase("gracia"))
{
activeChar.teleToLocation(-186742,244167,2675);
}
if (params.equalsIgnoreCase("pvp1"))
{
activeChar.teleToLocation(147736,-56243,-2781);
}
if (params.equalsIgnoreCase("pvp2"))
{
activeChar.teleToLocation(179337,221937,4475);
}
}
@Override
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}
当服务器启动 java 时说: 1. \ZTeleport.java 中的错误(第 17 行)
包 ZergZ.ZTeleport;
^^^^^^^^^^^^^^^^^^^^ 包ZergZ.ZTeleport
与类型碰撞
该脚本位于 ZergZ/ZTeleport.java
我会给你另一个运行良好的脚本:
package custom.HeroCirclet;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
public class HeroCirclet extends Quest
{
______
}
谢谢。