Package ai

Source Code of ai.TownGuard

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);
  }
}
TOP

Related Classes of ai.TownGuard

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.