/** * Method onEvtDead. * * @param killer Creature */ @Override protected void onEvtDead(Creature killer) { final NpcInstance actor = getActor(); final int npcId = actor.getNpcId(); switch (npcId) { case 25605: { epidosIndex.put(1, epidosIndex.get(1) + 1); break; } case 25606: { epidosIndex.put(2, epidosIndex.get(2) + 1); break; } case 25607: { epidosIndex.put(3, epidosIndex.get(3) + 1); break; } case 25608: { epidosIndex.put(4, epidosIndex.get(4) + 1); break; } default: break; } if ((isBossSpawnCondMet() != 0) && !NaiaCoreManager.isBossSpawned()) { NaiaCoreManager.spawnEpidos(isBossSpawnCondMet()); } super.onEvtDead(killer); }
@Override protected void onEvtAttacked(Creature attacker, int damage) { if ((attacker == null) || (attacker.isPlayable())) { return; } super.onEvtAttacked(attacker, damage); }
/** * Method onEvtClanAttacked. * * @param attacked_member Creature * @param attacker Creature * @param damage int */ @Override protected void onEvtClanAttacked(Creature attacked_member, Creature attacker, int damage) { super.onEvtClanAttacked(attacked_member, attacker, damage); final NpcInstance actor = getActor(); if (_healSkills.length == 0) { return; } if (attacked_member.isDead() || actor.isDead() || (attacked_member.getCurrentHpPercents() > 50)) { return; } int heal_chance = 0; if (attacked_member.getId() == actor.getId()) { heal_chance = (attacked_member.getObjectId() == actor.getObjectId()) ? 100 : 0; } else { heal_chance = (attacked_member.getId() == Orfen_id) ? 90 : 10; } if (Rnd.chance(heal_chance) && canUseSkill(_healSkills[0], attacked_member, -1)) { addTaskAttack(attacked_member, _healSkills[0], 1000000); } }
/** Method thinkAttack. */ @Override protected void thinkAttack() { final NpcInstance actor = getActor(); if (actor == null) { return; } sendOrderToMinions(actor); super.thinkAttack(); }
/** Method onEvtArrived. */ @Override protected void onEvtArrived() { super.onEvtArrived(); if ((loc != null) && (getActor().getDistance(loc) <= 100)) { if (currentPoint <= (MOVE_LOC.length - 1)) { currentPoint++; } else { currentPoint2++; } loc = null; } }
/** * Method onEvtDead. * * @param killer Creature */ @Override protected void onEvtDead(Creature killer) { if (checkAllDestroyed()) { try { final SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(TeleportCube)); sp.setLoc(new Location(-12527, 279714, -11622, 16384)); sp.doSpawn(true); sp.stopRespawn(); ThreadPoolManager.getInstance().schedule(new Unspawn(), 600 * 1000L); } catch (Exception e) { e.printStackTrace(); } } super.onEvtDead(killer); }
/** * Method onEvtScriptEvent. * * @param event String * @param arg1 Object * @param arg2 Object */ @Override protected void onEvtScriptEvent(String event, Object arg1, Object arg2) { super.onEvtScriptEvent(event, arg1, arg2); switch (event) { case "SHOUT_ALL_1": Functions.npcSayInRange( getActor(), 1500, NpcString.valueOf(MESSAGES_1[Rnd.get(MESSAGES_1.length)])); startBattle = true; break; case "SHOUT_ALL_2": Functions.npcSayInRange( getActor(), 1500, NpcString.valueOf(MESSAGES_2[Rnd.get(MESSAGES_2.length)])); break; case "TENTACLE_DIE": diedTentacle++; break; } }
/** 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(); }
/** * Method onEvtDead. * * @param killer Creature */ @Override protected void onEvtDead(Creature killer) { _mobsNotSpawned = true; super.onEvtDead(killer); }
/** Method onEvtSpawn. */ @Override protected void onEvtSpawn() { super.onEvtSpawn(); _spawnTimer = System.currentTimeMillis(); }