@Override protected void onEvtAttacked(Creature attacker, int damage) { NpcInstance actor = getActor(); if (actor.getCurrentHpPercents() < 70 && !summonsReleased) { summonsReleased = true; summon1 = NpcUtils.spawnSingle( 18950, Location.findAroundPosition(actor, 150), actor.getReflection()); summon2 = NpcUtils.spawnSingle( 18951, Location.findAroundPosition(actor, 150), actor.getReflection()); } super.onEvtAttacked(attacker, damage); }
@Override protected void onEvtDead(Creature killer) { super.onEvtDead(killer); Player player = killer.getPlayer(); if (player == null) return; KrateisCubeEvent cubeEvent = getActor().getEvent(KrateisCubeEvent.class); if (cubeEvent == null) return; KrateisCubePlayerObject particlePlayer = cubeEvent.getParticlePlayer(player); particlePlayer.setPoints(particlePlayer.getPoints() + 3); cubeEvent.updatePoints(particlePlayer); }
@Override protected void onEvtDead(Creature killer) { if (summon1 != null && !summon1.isDead()) summon1.decayMe(); if (summon2 != null && !summon2.isDead()) summon2.decayMe(); super.onEvtDead(killer); }