Fixed restoring multiple summons.
This commit is contained in:
parent
2ed402df38
commit
381abc4cb2
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS `character_summons` (
|
|||||||
`curHp` int(9) unsigned DEFAULT '0',
|
`curHp` int(9) unsigned DEFAULT '0',
|
||||||
`curMp` int(9) unsigned DEFAULT '0',
|
`curMp` int(9) unsigned DEFAULT '0',
|
||||||
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
`time` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ownerId`,`summonSkillId`)
|
PRIMARY KEY (`ownerId`,`summonId`,`summonSkillId`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
|
@ -196,13 +196,12 @@ public class CharSummonTable
|
|||||||
final int curMp = rs.getInt("curMp");
|
final int curMp = rs.getInt("curMp");
|
||||||
final int time = rs.getInt("time");
|
final int time = rs.getInt("time");
|
||||||
|
|
||||||
|
removeServitor(player, summonObjId);
|
||||||
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
skill = SkillData.getInstance().getSkill(skillId, player.getSkillLevel(skillId));
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
removeServitor(player, summonObjId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skill.applyEffects(player, player);
|
skill.applyEffects(player, player);
|
||||||
|
|
||||||
if (player.hasServitors())
|
if (player.hasServitors())
|
||||||
@ -223,7 +222,7 @@ public class CharSummonTable
|
|||||||
|
|
||||||
public void saveSummon(ServitorInstance summon)
|
public void saveSummon(ServitorInstance summon)
|
||||||
{
|
{
|
||||||
if ((summon == null) || (summon.getLifeTimeRemaining() <= 0))
|
if (summon == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public class CharSummonTable
|
|||||||
ps.setInt(3, summon.getReferenceSkill());
|
ps.setInt(3, summon.getReferenceSkill());
|
||||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
ps.setInt(6, Math.max(0, summon.getLifeTimeRemaining()));
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
Loading…
Reference in New Issue
Block a user