Changed summon points logic.

This commit is contained in:
MobiusDev
2015-05-11 14:22:36 +00:00
parent 033cc35f80
commit f3458d8c39
26 changed files with 169 additions and 57 deletions

View File

@ -392,6 +392,7 @@ public abstract class L2Summon extends L2Playable
{
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
}
owner.setUsedSummonPoints(owner.getUsedSummonPoints() - _summonPoints);
}
// pet will be deleted along with all his items
@ -473,6 +474,7 @@ public abstract class L2Summon extends L2Playable
owner.disableAutoShot(itemId);
}
}
owner.setUsedSummonPoints(owner.getUsedSummonPoints() - _summonPoints);
}
}
}

View File

@ -609,6 +609,7 @@ public final class L2PcInstance extends L2Playable
private L2Summon _pet = null;
/** Servitors of the L2PcInstance */
private volatile Map<Integer, L2Summon> _servitors = null;
private int _usedSummonPoints = 0;
/** The L2Decoy of the L2PcInstance */
private L2Decoy _decoy = null;
/** The L2Trap of the L2PcInstance */
@ -15036,15 +15037,21 @@ public final class L2PcInstance extends L2Playable
*/
public int getMaxSummonPoints()
{
return (int) getStat().calcStat(Stats.MAX_SUMMON_POINTS, 0, null, null);
// return (int) getStat().calcStat(Stats.MAX_SUMMON_POINTS, 0, null, null);
return 4;
}
/**
* @return the amount of points that player used
*/
public int getSummonPoints()
public int getUsedSummonPoints()
{
return getServitors().values().stream().mapToInt(L2Summon::getSummonPoints).sum();
return _usedSummonPoints;
}
public void setUsedSummonPoints(int points)
{
_usedSummonPoints = points;
}
/**

View File

@ -53,7 +53,7 @@ public class ConditionPlayerHasFreeSummonPoints extends Condition
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_S1_SKILL_DUE_TO_INSUFFICIENT_SUMMON_POINTS);
canSummon = false;
}
else if ((player.getSummonPoints() + _summonPoints) > player.getMaxSummonPoints())
else if ((player.getUsedSummonPoints() + _summonPoints) > player.getMaxSummonPoints())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_THE_S1_SKILL_DUE_TO_INSUFFICIENT_SUMMON_POINTS);
sm.addSkillName(skill);

View File

@ -175,7 +175,7 @@ public class PetInfo extends L2GameServerPacket
writeD(0x00); // TODO: Find me
writeD(_summon.getFormId()); // Transformation ID - Confirmed
writeC(_summon.getOwner().getSummonPoints()); // Used Summon Points
writeC(_summon.getOwner().getUsedSummonPoints()); // Used Summon Points
writeC(_summon.getOwner().getMaxSummonPoints()); // Maximum Summon Points
final Set<AbnormalVisualEffect> aves = _summon.getCurrentAbnormalVisualEffects();