Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (actor.getTemplate().getAiType() == NpcAiType.MAGE && !actor.getCast().isCastingNow())
- {
- // This list is used in order to avoid multiple calls on skills lists. Tests are made one after the other, and content is replaced when needed.
- List<L2Skill> defaultList;
- // -------------------------------------------------------------------------------
- // Heal
- defaultList = actor.getTemplate().getSkills(NpcSkillType.HEAL);
- if (!defaultList.isEmpty())
- {
- Player leader = actor.getLeader();
- // Go through all characters around the actor that belongs to its faction.
- for (Creature cha : actor.getKnownTypeInRadius(Creature.class, 1000))
- {
- if (leader.getStatus().getHpRatio() < 0.75)
- cha = leader;
- else if (actor.getStatus().getHpRatio() < 0.75)
- cha = actor;
- else if (cha instanceof BodyGuard && ((BodyGuard) cha).getclans().getname() == leader.getName())
- // Will affect only defenders or NPCs from same faction.
- if (!actor.isAttackingDisabled())
- {
- for (L2Skill sk : defaultList)
- {
- System.out.println("name:" + cha.getName() + " sk: " + sk.getName());
- actor.getCast().doCast(sk, cha, actor.getActiveWeapon());
- return;
- }
- }
- leader.getClan().getName();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement