/** @param summon */ public SM_NPC_INFO(Summon summon) { this.npc = summon; npcTemplate = summon.getObjectTemplate(); npcTypeId = npcTemplate.getNpcType().getId(); npcId = summon.getNpcId(); Player owner = summon.getMaster(); if (owner != null) { masterObjId = owner.getObjectId(); masterName = owner.getName(); speed = owner.getGameStats().getCurrentStat(StatEnum.SPEED) / 1000f; } else { masterName = "LOST"; } }
@Override public boolean onDie(Player player, Creature lastAttacker) { Summon summon = player.getSummon(); if (summon != null) { summon.getController().release(UnsummonType.UNSPECIFIED); } PacketSendUtility.broadcastPacket( player, new SM_EMOTION( player, EmotionType.DIE, 0, lastAttacker == null ? 0 : lastAttacker.getObjectId()), true); PacketSendUtility.sendPacket(player, new SM_DIE(false, false, 0, 8)); return true; }