}
@Override
protected void onEvtAttacked(L2Character attacker, int damage)
{
L2NpcInstance actor = (L2NpcInstance) getActor();
if(actor == null || attacker == null || attacker.getPlayer() == null)
{
return;
}
// Ругаемся не чаще, чем раз в 15 секунд
if(System.currentTimeMillis() - _lastAction > 15000)
{
_lastAction = System.currentTimeMillis();
Functions.npcSayCustomMessage(actor, "scripts.ai.FieldMachine." + actor.getNpcId());
GArray<L2NpcInstance> around = actor.getAroundNpc(1500, 300);
if(around != null && !around.isEmpty())
{
for(L2NpcInstance npc : around)
{
if(npc.isMonster() && npc.getNpcId() >= 22656 && npc.getNpcId() <= 22659)