Skill parameter to consume fame points.

This commit is contained in:
MobiusDev 2017-10-11 14:25:55 +00:00
parent ea15592689
commit e6be147b64
8 changed files with 132 additions and 4 deletions

View File

@ -99,6 +99,8 @@ public final class Skill implements IIdentifiable
private final int _itemConsumeCount; private final int _itemConsumeCount;
/** Id of item consumed by this skill from caster. */ /** Id of item consumed by this skill from caster. */
private final int _itemConsumeId; private final int _itemConsumeId;
/** Fame points consumed by this skill from caster */
private final int _famePointConsume;
/** Clan points consumed by this skill from caster's clan */ /** Clan points consumed by this skill from caster's clan */
private final int _clanRepConsume; private final int _clanRepConsume;
/** Cast range: how far can be the target. */ /** Cast range: how far can be the target. */
@ -229,6 +231,7 @@ public final class Skill implements IIdentifiable
_hpConsume = set.getInt("hpConsume", 0); _hpConsume = set.getInt("hpConsume", 0);
_itemConsumeCount = set.getInt("itemConsumeCount", 0); _itemConsumeCount = set.getInt("itemConsumeCount", 0);
_itemConsumeId = set.getInt("itemConsumeId", 0); _itemConsumeId = set.getInt("itemConsumeId", 0);
_famePointConsume = set.getInt("famePointConsume", 0);
_clanRepConsume = set.getInt("clanRepConsume", 0); _clanRepConsume = set.getInt("clanRepConsume", 0);
_castRange = set.getInt("castRange", -1); _castRange = set.getInt("castRange", -1);
@ -727,6 +730,14 @@ public final class Skill implements IIdentifiable
return _itemConsumeId; return _itemConsumeId;
} }
/**
* @return Fame points consumed by this skill from caster
*/
public int getFamePointConsume()
{
return _famePointConsume;
}
/** /**
* @return Clan points consumed by this skill from caster's clan * @return Clan points consumed by this skill from caster's clan
*/ */

View File

@ -343,11 +343,26 @@ public class SkillCaster implements Runnable
if (caster.isPlayer()) if (caster.isPlayer())
{ {
final L2PcInstance player = caster.getActingPlayer(); final L2PcInstance player = caster.getActingPlayer();
final L2Clan clan = player.getClan();
// Consume fame points
if (_skill.getFamePointConsume() > 0)
{
if (player.getFame() < _skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
player.setFame(player.getFame() - _skill.getFamePointConsume());
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S1_FAME_HAS_BEEN_CONSUMED);
msg.addInt(_skill.getFamePointConsume());
player.sendPacket(msg);
}
// Consume clan reputation points // Consume clan reputation points
if (_skill.getClanRepConsume() > 0) if (_skill.getClanRepConsume() > 0)
{ {
final L2Clan clan = player.getClan();
if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume())) if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume()))
{ {
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW); player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
@ -981,6 +996,12 @@ public class SkillCaster implements Runnable
return false; return false;
} }
if (player.getFame() < skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
// Consume clan reputation points // Consume clan reputation points
if (skill.getClanRepConsume() > 0) if (skill.getClanRepConsume() > 0)
{ {

View File

@ -99,6 +99,8 @@ public final class Skill implements IIdentifiable
private final int _itemConsumeCount; private final int _itemConsumeCount;
/** Id of item consumed by this skill from caster. */ /** Id of item consumed by this skill from caster. */
private final int _itemConsumeId; private final int _itemConsumeId;
/** Fame points consumed by this skill from caster */
private final int _famePointConsume;
/** Clan points consumed by this skill from caster's clan */ /** Clan points consumed by this skill from caster's clan */
private final int _clanRepConsume; private final int _clanRepConsume;
/** Cast range: how far can be the target. */ /** Cast range: how far can be the target. */
@ -229,6 +231,7 @@ public final class Skill implements IIdentifiable
_hpConsume = set.getInt("hpConsume", 0); _hpConsume = set.getInt("hpConsume", 0);
_itemConsumeCount = set.getInt("itemConsumeCount", 0); _itemConsumeCount = set.getInt("itemConsumeCount", 0);
_itemConsumeId = set.getInt("itemConsumeId", 0); _itemConsumeId = set.getInt("itemConsumeId", 0);
_famePointConsume = set.getInt("famePointConsume", 0);
_clanRepConsume = set.getInt("clanRepConsume", 0); _clanRepConsume = set.getInt("clanRepConsume", 0);
_castRange = set.getInt("castRange", -1); _castRange = set.getInt("castRange", -1);
@ -727,6 +730,14 @@ public final class Skill implements IIdentifiable
return _itemConsumeId; return _itemConsumeId;
} }
/**
* @return Fame points consumed by this skill from caster
*/
public int getFamePointConsume()
{
return _famePointConsume;
}
/** /**
* @return Clan points consumed by this skill from caster's clan * @return Clan points consumed by this skill from caster's clan
*/ */

View File

@ -343,11 +343,26 @@ public class SkillCaster implements Runnable
if (caster.isPlayer()) if (caster.isPlayer())
{ {
final L2PcInstance player = caster.getActingPlayer(); final L2PcInstance player = caster.getActingPlayer();
final L2Clan clan = player.getClan();
// Consume fame points
if (_skill.getFamePointConsume() > 0)
{
if (player.getFame() < _skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
player.setFame(player.getFame() - _skill.getFamePointConsume());
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S1_FAME_HAS_BEEN_CONSUMED);
msg.addInt(_skill.getFamePointConsume());
player.sendPacket(msg);
}
// Consume clan reputation points // Consume clan reputation points
if (_skill.getClanRepConsume() > 0) if (_skill.getClanRepConsume() > 0)
{ {
final L2Clan clan = player.getClan();
if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume())) if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume()))
{ {
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW); player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
@ -981,6 +996,12 @@ public class SkillCaster implements Runnable
return false; return false;
} }
if (player.getFame() < skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
// Consume clan reputation points // Consume clan reputation points
if (skill.getClanRepConsume() > 0) if (skill.getClanRepConsume() > 0)
{ {

View File

@ -99,6 +99,8 @@ public final class Skill implements IIdentifiable
private final int _itemConsumeCount; private final int _itemConsumeCount;
/** Id of item consumed by this skill from caster. */ /** Id of item consumed by this skill from caster. */
private final int _itemConsumeId; private final int _itemConsumeId;
/** Fame points consumed by this skill from caster */
private final int _famePointConsume;
/** Clan points consumed by this skill from caster's clan */ /** Clan points consumed by this skill from caster's clan */
private final int _clanRepConsume; private final int _clanRepConsume;
/** Cast range: how far can be the target. */ /** Cast range: how far can be the target. */
@ -229,6 +231,7 @@ public final class Skill implements IIdentifiable
_hpConsume = set.getInt("hpConsume", 0); _hpConsume = set.getInt("hpConsume", 0);
_itemConsumeCount = set.getInt("itemConsumeCount", 0); _itemConsumeCount = set.getInt("itemConsumeCount", 0);
_itemConsumeId = set.getInt("itemConsumeId", 0); _itemConsumeId = set.getInt("itemConsumeId", 0);
_famePointConsume = set.getInt("famePointConsume", 0);
_clanRepConsume = set.getInt("clanRepConsume", 0); _clanRepConsume = set.getInt("clanRepConsume", 0);
_castRange = set.getInt("castRange", -1); _castRange = set.getInt("castRange", -1);
@ -727,6 +730,14 @@ public final class Skill implements IIdentifiable
return _itemConsumeId; return _itemConsumeId;
} }
/**
* @return Fame points consumed by this skill from caster
*/
public int getFamePointConsume()
{
return _famePointConsume;
}
/** /**
* @return Clan points consumed by this skill from caster's clan * @return Clan points consumed by this skill from caster's clan
*/ */

View File

@ -343,11 +343,26 @@ public class SkillCaster implements Runnable
if (caster.isPlayer()) if (caster.isPlayer())
{ {
final L2PcInstance player = caster.getActingPlayer(); final L2PcInstance player = caster.getActingPlayer();
final L2Clan clan = player.getClan();
// Consume fame points
if (_skill.getFamePointConsume() > 0)
{
if (player.getFame() < _skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
player.setFame(player.getFame() - _skill.getFamePointConsume());
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S1_FAME_HAS_BEEN_CONSUMED);
msg.addInt(_skill.getFamePointConsume());
player.sendPacket(msg);
}
// Consume clan reputation points // Consume clan reputation points
if (_skill.getClanRepConsume() > 0) if (_skill.getClanRepConsume() > 0)
{ {
final L2Clan clan = player.getClan();
if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume())) if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume()))
{ {
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW); player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
@ -981,6 +996,12 @@ public class SkillCaster implements Runnable
return false; return false;
} }
if (player.getFame() < skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
// Consume clan reputation points // Consume clan reputation points
if (skill.getClanRepConsume() > 0) if (skill.getClanRepConsume() > 0)
{ {

View File

@ -99,6 +99,8 @@ public final class Skill implements IIdentifiable
private final int _itemConsumeCount; private final int _itemConsumeCount;
/** Id of item consumed by this skill from caster. */ /** Id of item consumed by this skill from caster. */
private final int _itemConsumeId; private final int _itemConsumeId;
/** Fame points consumed by this skill from caster */
private final int _famePointConsume;
/** Clan points consumed by this skill from caster's clan */ /** Clan points consumed by this skill from caster's clan */
private final int _clanRepConsume; private final int _clanRepConsume;
/** Cast range: how far can be the target. */ /** Cast range: how far can be the target. */
@ -229,6 +231,7 @@ public final class Skill implements IIdentifiable
_hpConsume = set.getInt("hpConsume", 0); _hpConsume = set.getInt("hpConsume", 0);
_itemConsumeCount = set.getInt("itemConsumeCount", 0); _itemConsumeCount = set.getInt("itemConsumeCount", 0);
_itemConsumeId = set.getInt("itemConsumeId", 0); _itemConsumeId = set.getInt("itemConsumeId", 0);
_famePointConsume = set.getInt("famePointConsume", 0);
_clanRepConsume = set.getInt("clanRepConsume", 0); _clanRepConsume = set.getInt("clanRepConsume", 0);
_castRange = set.getInt("castRange", -1); _castRange = set.getInt("castRange", -1);
@ -727,6 +730,14 @@ public final class Skill implements IIdentifiable
return _itemConsumeId; return _itemConsumeId;
} }
/**
* @return Fame points consumed by this skill from caster
*/
public int getFamePointConsume()
{
return _famePointConsume;
}
/** /**
* @return Clan points consumed by this skill from caster's clan * @return Clan points consumed by this skill from caster's clan
*/ */

View File

@ -343,11 +343,26 @@ public class SkillCaster implements Runnable
if (caster.isPlayer()) if (caster.isPlayer())
{ {
final L2PcInstance player = caster.getActingPlayer(); final L2PcInstance player = caster.getActingPlayer();
final L2Clan clan = player.getClan();
// Consume fame points
if (_skill.getFamePointConsume() > 0)
{
if (player.getFame() < _skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
player.setFame(player.getFame() - _skill.getFamePointConsume());
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S1_FAME_HAS_BEEN_CONSUMED);
msg.addInt(_skill.getFamePointConsume());
player.sendPacket(msg);
}
// Consume clan reputation points // Consume clan reputation points
if (_skill.getClanRepConsume() > 0) if (_skill.getClanRepConsume() > 0)
{ {
final L2Clan clan = player.getClan();
if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume())) if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume()))
{ {
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW); player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
@ -981,6 +996,12 @@ public class SkillCaster implements Runnable
return false; return false;
} }
if (player.getFame() < skill.getFamePointConsume())
{
player.sendPacket(SystemMessageId.YOU_DON_T_HAVE_ENOUGH_FAME_TO_DO_THAT);
return false;
}
// Consume clan reputation points // Consume clan reputation points
if (skill.getClanRepConsume() > 0) if (skill.getClanRepConsume() > 0)
{ {