Fixed restoring summons on login.
This commit is contained in:
@@ -197,21 +197,24 @@ public class CharSummonTable
|
|||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(activeChar, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
removeServitor(activeChar, summonObjId);
|
||||||
|
|
||||||
skill.applyEffects(activeChar, activeChar);
|
skill.applyEffects(activeChar, activeChar);
|
||||||
|
|
||||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||||
|
if (summon != null)
|
||||||
|
{
|
||||||
summon.setCurrentHp(curHp);
|
summon.setCurrentHp(curHp);
|
||||||
summon.setCurrentMp(curMp);
|
summon.setCurrentMp(curMp);
|
||||||
summon.setLifeTimeRemaining(time);
|
summon.setLifeTimeRemaining(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
||||||
|
|||||||
@@ -197,21 +197,24 @@ public class CharSummonTable
|
|||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(activeChar, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
removeServitor(activeChar, summonObjId);
|
||||||
|
|
||||||
skill.applyEffects(activeChar, activeChar);
|
skill.applyEffects(activeChar, activeChar);
|
||||||
|
|
||||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||||
|
if (summon != null)
|
||||||
|
{
|
||||||
summon.setCurrentHp(curHp);
|
summon.setCurrentHp(curHp);
|
||||||
summon.setCurrentMp(curMp);
|
summon.setCurrentMp(curMp);
|
||||||
summon.setLifeTimeRemaining(time);
|
summon.setLifeTimeRemaining(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
||||||
|
|||||||
@@ -197,21 +197,24 @@ public class CharSummonTable
|
|||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(activeChar, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
removeServitor(activeChar, summonObjId);
|
||||||
|
|
||||||
skill.applyEffects(activeChar, activeChar);
|
skill.applyEffects(activeChar, activeChar);
|
||||||
|
|
||||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||||
|
if (summon != null)
|
||||||
|
{
|
||||||
summon.setCurrentHp(curHp);
|
summon.setCurrentHp(curHp);
|
||||||
summon.setCurrentMp(curMp);
|
summon.setCurrentMp(curMp);
|
||||||
summon.setLifeTimeRemaining(time);
|
summon.setLifeTimeRemaining(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
||||||
|
|||||||
@@ -197,21 +197,24 @@ public class CharSummonTable
|
|||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(activeChar, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
removeServitor(activeChar, summonObjId);
|
||||||
|
|
||||||
skill.applyEffects(activeChar, activeChar);
|
skill.applyEffects(activeChar, activeChar);
|
||||||
|
|
||||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||||
|
if (summon != null)
|
||||||
|
{
|
||||||
summon.setCurrentHp(curHp);
|
summon.setCurrentHp(curHp);
|
||||||
summon.setCurrentMp(curMp);
|
summon.setCurrentMp(curMp);
|
||||||
summon.setLifeTimeRemaining(time);
|
summon.setLifeTimeRemaining(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
||||||
|
|||||||
@@ -197,21 +197,24 @@ public class CharSummonTable
|
|||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(activeChar, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
removeServitor(activeChar, summonObjId);
|
||||||
|
|
||||||
skill.applyEffects(activeChar, activeChar);
|
skill.applyEffects(activeChar, activeChar);
|
||||||
|
|
||||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||||
|
if (summon != null)
|
||||||
|
{
|
||||||
summon.setCurrentHp(curHp);
|
summon.setCurrentHp(curHp);
|
||||||
summon.setCurrentMp(curMp);
|
summon.setCurrentMp(curMp);
|
||||||
summon.setLifeTimeRemaining(time);
|
summon.setLifeTimeRemaining(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
||||||
|
|||||||
@@ -197,21 +197,24 @@ public class CharSummonTable
|
|||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(activeChar, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
removeServitor(activeChar, summonObjId);
|
||||||
|
|
||||||
skill.applyEffects(activeChar, activeChar);
|
skill.applyEffects(activeChar, activeChar);
|
||||||
|
|
||||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||||
|
if (summon != null)
|
||||||
|
{
|
||||||
summon.setCurrentHp(curHp);
|
summon.setCurrentHp(curHp);
|
||||||
summon.setCurrentMp(curMp);
|
summon.setCurrentMp(curMp);
|
||||||
summon.setLifeTimeRemaining(time);
|
summon.setLifeTimeRemaining(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
LOGGER.warning(getClass().getSimpleName() + ": Servitor cannot be restored: " + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user