Clan Flag.
Thanks gamelike85, gigilo1968.
This commit is contained in:
@@ -99,6 +99,8 @@ public final class Skill implements IIdentifiable
|
||||
private final int _itemConsumeCount;
|
||||
/** Id of item consumed by this skill from caster. */
|
||||
private final int _itemConsumeId;
|
||||
/** Clan points consumed by this skill from caster's clan */
|
||||
private final int _clanRepConsume;
|
||||
/** Cast range: how far can be the target. */
|
||||
private final int _castRange;
|
||||
/** Effect range: how far the skill affect the target. */
|
||||
@@ -227,6 +229,7 @@ public final class Skill implements IIdentifiable
|
||||
_hpConsume = set.getInt("hpConsume", 0);
|
||||
_itemConsumeCount = set.getInt("itemConsumeCount", 0);
|
||||
_itemConsumeId = set.getInt("itemConsumeId", 0);
|
||||
_clanRepConsume = set.getInt("clanRepConsume", 0);
|
||||
|
||||
_castRange = set.getInt("castRange", -1);
|
||||
_effectRange = set.getInt("effectRange", -1);
|
||||
@@ -724,6 +727,14 @@ public final class Skill implements IIdentifiable
|
||||
return _itemConsumeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Clan points consumed by this skill from caster's clan
|
||||
*/
|
||||
public int getClanRepConsume()
|
||||
{
|
||||
return _clanRepConsume;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the level.
|
||||
*/
|
||||
|
@@ -38,6 +38,7 @@ import com.l2jmobius.gameserver.enums.ItemSkillType;
|
||||
import com.l2jmobius.gameserver.enums.NextActionType;
|
||||
import com.l2jmobius.gameserver.enums.StatusUpdateType;
|
||||
import com.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
@@ -339,6 +340,27 @@ public class SkillCaster implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
if (caster.isPlayer())
|
||||
{
|
||||
final L2PcInstance player = caster.getActingPlayer();
|
||||
final L2Clan clan = player.getClan();
|
||||
|
||||
// Consume clan reputation points
|
||||
if (_skill.getClanRepConsume() > 0)
|
||||
{
|
||||
if ((clan == null) || (clan.getReputationScore() < _skill.getClanRepConsume()))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
|
||||
return false;
|
||||
}
|
||||
clan.takeReputationScore(_skill.getClanRepConsume(), true);
|
||||
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.S1_CLAN_REPUTATION_HAS_BEEN_CONSUMED);
|
||||
msg.addInt(_skill.getClanRepConsume());
|
||||
player.sendPacket(msg);
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger any skill cast start effects.
|
||||
if (target.isCharacter())
|
||||
{
|
||||
@@ -959,6 +981,17 @@ public class SkillCaster implements Runnable
|
||||
return false;
|
||||
}
|
||||
|
||||
// Consume clan reputation points
|
||||
if (skill.getClanRepConsume() > 0)
|
||||
{
|
||||
final L2Clan clan = player.getClan();
|
||||
if ((clan == null) || (clan.getReputationScore() < skill.getClanRepConsume()))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for skill reuse (fixes macro right click press exploit).
|
||||
if (caster.hasSkillReuse(skill.getReuseHashCode()))
|
||||
{
|
||||
|
Reference in New Issue
Block a user