if (activeChar.isMounted() || !activeChar.getSummonList().canSummon(_summonType, _summonPoint))
{
return;
}
NpcTemplate summonTemplate = NpcHolder.getInstance().getTemplate(getNpcId());
SummonInstance summon = new SummonInstance(IdFactory.getInstance().getNextId(), summonTemplate, activeChar, _lifeTime, _summonPoint, this);
activeChar.getSummonList().addSummon(summon);
summon.setExpPenalty(_expPenalty);
summon.setExp(Experience.LEVEL[Math.min(summon.getLevel(), Experience.LEVEL.length - 1)]);
summon.setHeading(activeChar.getHeading());
summon.setReflection(activeChar.getReflection());
summon.spawnMe(loc == null ? Location.findAroundPosition(activeChar, 50, 70) : loc);
summon.setRunning();
summon.setFollowMode(true);
if (summon.getSkillLevel(4140) > 0)
{
summon.altUseSkill(SkillTable.getInstance().getInfo(4140, summon.getSkillLevel(4140)), activeChar);
}
if (summon.getName().equalsIgnoreCase("Shadow"))
{
summon.addStatFunc(new FuncAdd(Stats.ABSORB_DAMAGE_PERCENT, 0x40, this, 15));
}
if (activeChar.isInOlympiadMode())
{
summon.getEffectList().stopAllEffects();
}
summon.setCurrentHpMp(summon.getMaxHp(), summon.getMaxMp(), false);
if (_summonType == SummonType.SIEGE_SUMMON)
{
SiegeEvent<?, ?> siegeEvent = activeChar.getEvent(SiegeEvent.class);
siegeEvent.addSiegeSummon(summon);
}