}
if(activeChar.getPet() != null || activeChar.isMounted())
{
return;
}
L2NpcTemplate summonTemplate = NpcTable.getTemplate(getNpcId());
if(summonTemplate == null)
{
System.out.println("Null summon template for skill " + this);
return;
}
L2SummonInstance summon = new L2SummonInstance(IdFactory.getInstance().getNextId(), summonTemplate, activeChar, _lifeTime, _itemConsumeIdInTime, _itemConsumeCountInTime, _itemConsumeDelay);
summon.setTitle(activeChar.getName());
summon.setExpPenalty(_expPenalty);
summon.setExp(Experience.LEVEL[Math.min(summon.getLevel(), Experience.LEVEL.length - 1)]);
summon.setCurrentHp(summon.getMaxHp(), false);
summon.setCurrentMp(summon.getMaxMp());
summon.setHeading(activeChar.getHeading());
summon.setRunning();
activeChar.setPet(summon);
summon.spawnMe(loc == null ? GeoEngine.findPointToStay(activeChar.getX(), activeChar.getY(), activeChar.getZ(), 100, 150, activeChar.getReflection().getGeoIndex()) : loc);
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));
}
summon.setFollowStatus(true, true);
break;
case DECOY:
if(activeChar.getPet() != null || activeChar.isMounted())
{
return;
}
L2NpcTemplate DecoyTemplate = NpcTable.getTemplate(getNpcId());
L2DecoyInstance decoy = new L2DecoyInstance(IdFactory.getInstance().getNextId(), DecoyTemplate, activeChar, _lifeTime);
decoy.setCurrentHp(decoy.getMaxHp(), false);
decoy.setCurrentMp(decoy.getMaxMp());
decoy.setHeading(activeChar.getHeading());
decoy.setReflection(activeChar.getReflection());
activeChar.setDecoy(decoy);
decoy.spawnMe(activeChar.getLoc());
break;
case MERCHANT:
if(activeChar.getPet() != null || activeChar.isMounted())
{
return;
}
L2NpcTemplate merchantTemplate = NpcTable.getTemplate(getNpcId());
L2MerchantInstance merchant = new L2MerchantInstance(IdFactory.getInstance().getNextId(), merchantTemplate);
merchant.setCurrentHp(merchant.getMaxHp(), false);
merchant.setCurrentMp(merchant.getMaxMp());
merchant.setHeading(activeChar.getHeading());
merchant.setReflection(activeChar.getReflection());