package ai;
import l2p.extensions.scripts.Functions;
import l2p.gameserver.ai.CtrlIntention;
import l2p.gameserver.ai.Fighter;
import l2p.gameserver.model.L2Character;
import l2p.gameserver.model.instances.L2NpcInstance;
import l2p.util.Rnd;
/**
* AI Town Guard в городе-инстанте на Hellbound<br>
* - перед тем как броситься в атаку кричат
*
* @author SYS
*/
public class TownGuard extends Fighter
{
public TownGuard(L2Character actor)
{
super(actor);
}
@Override
protected void onIntentionAttack(L2Character target)
{
L2NpcInstance actor = getActor();
if(actor == null)
{
return;
}
if(getIntention() == CtrlIntention.AI_INTENTION_ACTIVE && Rnd.chance(50))
{
Functions.npcSay(actor, "Захватчик!");
}
super.onIntentionAttack(target);
}
}