/** * Method getBrother. * * @return NpcInstance */ private NpcInstance getBrother() { final NpcInstance actor = getActor(); int brotherId = 0; if (actor.getId() == 25665) { brotherId = 25666; } else if (actor.getId() == 25666) { brotherId = 25665; } for (NpcInstance npc : actor.getReflection().getNpcs()) { if (npc.getId() == brotherId) { return npc; } } return null; }
/** Method thinkAttack. */ @Override protected void thinkAttack() { final NpcInstance actor = getActor(); final NpcInstance brother = getBrother(); if (!brother.isDead() && !actor.isInRange(brother, 300)) { actor.altOnMagicUseTimer(getActor(), SkillTable.getInstance().getInfo(6371, 1)); } else { removeInvul(actor); } if ((_spawnTimer + 40000) < System.currentTimeMillis()) { _spawnTimer = System.currentTimeMillis(); final NpcInstance mob = actor .getReflection() .addSpawnWithoutRespawn( _minions[Rnd.get(_minions.length)], Location.findAroundPosition(actor, 300), 0); mob.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, actor.getAggressionTarget(), 1000); } super.thinkAttack(); }