04-29-2014, 06:38 PM
Помогите пожалуйста! Сборка first team, HF.
Пытаюсь добавить евент Soul, при компиляции выдаёт ошибку:
Само AI
Я так понимаю он ругается, что где-то пропустил или лишняя скобка, но не могу понять....
Пытаюсь добавить евент Soul, при компиляции выдаёт ошибку:
Ошибка
Код:
[javac] Compiling 1202 source files to C:\server\HF\build\classes
[javac] C:\server\HF\dist\gameserver\data\scripts\ai\SoulFolowerAI.java:90: error: illegal start of expression
[javac] }
[javac] ^
[javac] C:\server\HF\dist\gameserver\data\scripts\ai\SoulFolowerAI.java:121: error: illegal start of expression
[javac] protected class ThinkFollow extends RunnableImpl()
[javac] ^
[javac] C:\server\HF\dist\gameserver\data\scripts\ai\SoulFolowerAI.java:121: error: '{' expected
[javac] protected class ThinkFollow extends RunnableImpl()
[javac] ^
[javac] C:\server\HF\dist\gameserver\data\scripts\ai\SoulFolowerAI.java:148: error: reached end of file while parsing
[javac] }
[javac] ^
[javac] 4 errors
Само AI
AI
Код:
package ai;
import l2ft.commons.threading.RunnableImpl;
import l2ft.commons.util.Rnd;
import l2ft.gameserver.Config;
import l2ft.gameserver.ThreadPoolManager;
import l2ft.gameserver.ai.CtrlIntention;
import l2ft.gameserver.ai.DefaultAI;
import l2ft.gameserver.model.Creature;
import l2ft.gameserver.model.Player;
import l2ft.gameserver.model.instances.NpcInstance;
import l2ft.gameserver.utils.Location;
import java.util.concurrent.ScheduledFuture;
public class SoulFolowerAI extends DefaultAI
{
private Player player;
private boolean thinking = false;
private ScheduledFuture<?> _followTask;
public SoulFolowerAI(NpcInstance actor)
{
super(actor);
}
public void setMaster(Player player)
{
this.player = player;
}
@Override
protected void onEvtThink()
{
NpcInstance actor = getActor();
if(thinking || actor.isActionsDisabled() || actor.isAfraid() || actor.isDead() || actor.isMovementDisabled())
{
return;
}
thinking = true;
try
{
if(!Config.BLOCK_ACTIVE_TASKS && (getIntention() == CtrlIntention.AI_INTENTION_ACTIVE || getIntention() == CtrlIntention.AI_INTENTION_IDLE))
{
thinkActive();
}
else if(getIntention() == CtrlIntention.AI_INTENTION_FOLLOW)
{
thinkFollow();
}
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
thinking = false;
}
}
@Override
protected boolean thinkActive()
{
NpcInstance actor = getActor();
Creature following = actor.getFollowTarget();
if(following == null || !actor.isFollow)
{
if(player != null)
{
actor.setFollowTarget(player);
actor.setRunning();
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player, Config.FOLLOW_RANGE);
}
}
return super.thinkActive();
}
protected void thinkFollow()
{
NpcInstance actor = getActor();
Creature target = actor.getFollowTarget();
for(NpcInstance npc : actor.getAroundNpc(250, 250))
{
if(npc.getNpcId() == 36600)
}
//Находимся слишком далеко цели, либо цель не пригодна для следования, либо не можем перемещаться
if(target == null || target.isAlikeDead() || actor.getDistance(target) > 4000 || actor.isMovementDisabled())
{
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
return;
}
//Уже следуем за этой целью
if(actor.isFollow && actor.getFollowTarget() == target)
{
clientActionFailed();
return;
}
//Находимся достаточно близко
if(actor.isInRange(target, Config.FOLLOW_RANGE + 20))
{
clientActionFailed();
}
if(_followTask != null)
{
_followTask.cancel(false);
_followTask = null;
}
_followTask = ThreadPoolManager.getInstance().schedule(new ThinkFollow(), 250L);
}
protected class ThinkFollow extends RunnableImpl
{
@Override
public void runImpl()
{
NpcInstance actor = getActor();
if(actor == null)
{
return;
}
Creature target = actor.getFollowTarget();
if(target == null || actor.getDistance(target) > 4000)
{
actor.deleteMe();
return;
}
if(!actor.isInRange(target, Config.FOLLOW_RANGE + 20) && (!actor.isFollow || actor.getFollowTarget() != target))
{
Location loc = new Location(target.getX() + Rnd.get(-60, 60), target.getY() + Rnd.get(-60, 60), target.getZ());
actor.followToCharacter(loc, target, Config.FOLLOW_RANGE, false);
}
_followTask = ThreadPoolManager.getInstance().schedule(this, 250L);
}
}
}
Я так понимаю он ругается, что где-то пропустил или лишняя скобка, но не могу понять....