Package ai

Source Code of ai.Quest421FairyTree

package ai;

import l2p.gameserver.ai.Fighter;
import l2p.gameserver.model.L2Character;
import l2p.gameserver.model.L2Skill;
import l2p.gameserver.model.instances.L2NpcInstance;
import l2p.gameserver.tables.SkillTable;

public class Quest421FairyTree extends Fighter
{
  public Quest421FairyTree(L2Character actor)
  {
    super(actor);
    actor.setImobilised(true);
  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2NpcInstance actor = getActor();
    if(actor != null && attacker != null && attacker.isPlayer())
    {
      L2Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
    }
    if(attacker.isPet())
    {
      super.onEvtAttacked(attacker, damage);
      return;
    }
  }

  @Override
  protected void onEvtAggression(L2Character attacker, int aggro)
  {
    L2NpcInstance actor = getActor();
    if(actor != null && attacker != null && attacker.isPlayer())
    {
      L2Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
    }
  }

  @Override
  protected boolean randomWalk()
  {
    return false;
  }
}
TOP

Related Classes of ai.Quest421FairyTree

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.