Community board buff skill id protection.
This commit is contained in:
@@ -61,3 +61,7 @@ CommunityPremiumBuyCoinId = 57
|
||||
|
||||
# Amount of coins needed for each premium day bought.
|
||||
CommunityPremiumPricePerDay = 1000000
|
||||
|
||||
# List of available buffs to avoid exploits.
|
||||
# Usage: SkillId1,SkillId2...
|
||||
CommunityAvailableBuffs = 11517,11522,11519,11520,11521,11518,11565,11824,11567,11615,11616,11529,11530,11532,11523,11524,11525,1259,982,5987,5988,1323
|
||||
|
@@ -90,7 +90,7 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
return commandCheck && (activeChar.isInCombat() || activeChar.isInDuel() || activeChar.isInOlympiadMode() || activeChar.isInsideZone(ZoneId.SIEGE) || activeChar.isInsideZone(ZoneId.PVP));
|
||||
};
|
||||
|
||||
public static final Predicate<L2PcInstance> KARMAR_CHECK = player -> Config.COMMUNITYBOARD_KARMA_DISABLED && (player.getReputation() < 0);
|
||||
public static final Predicate<L2PcInstance> KARMA_CHECK = player -> Config.COMMUNITYBOARD_KARMA_DISABLED && (player.getReputation() < 0);
|
||||
|
||||
@Override
|
||||
public String[] getCommunityBoardCommands()
|
||||
@@ -111,7 +111,7 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (KARMAR_CHECK.test(activeChar))
|
||||
if (KARMA_CHECK.test(activeChar))
|
||||
{
|
||||
activeChar.sendMessage("Players with Karma cannot use the Community Board.");
|
||||
return false;
|
||||
@@ -201,7 +201,10 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
for (int i = 0; i < buffCount; i++)
|
||||
{
|
||||
final Skill skill = SkillData.getInstance().getSkill(Integer.parseInt(buypassOptions[i].split(",")[0]), Integer.parseInt(buypassOptions[i].split(",")[1]));
|
||||
|
||||
if (!Config.COMMUNITY_AVAILABLE_BUFFS.contains(skill.getId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
targets.stream().filter(target -> !target.isSummon() || !skill.isSharedWithSummon()).forEach(target ->
|
||||
{
|
||||
skill.applyEffects(activeChar, target);
|
||||
|
@@ -1056,6 +1056,7 @@ public final class Config
|
||||
public static boolean COMMUNITY_PREMIUM_SYSTEM_ENABLED;
|
||||
public static int COMMUNITY_PREMIUM_COIN_ID;
|
||||
public static int COMMUNITY_PREMIUM_PRICE_PER_DAY;
|
||||
public static List<Integer> COMMUNITY_AVAILABLE_BUFFS;
|
||||
public static boolean FACTION_SYSTEM_ENABLED;
|
||||
public static Location FACTION_STARTING_LOCATION;
|
||||
public static int FACTION_MANAGER_NPCID;
|
||||
@@ -2333,6 +2334,12 @@ public final class Config
|
||||
COMMUNITY_PREMIUM_SYSTEM_ENABLED = CommunityBoard.getBoolean("CommunityPremiumSystem", false);
|
||||
COMMUNITY_PREMIUM_COIN_ID = CommunityBoard.getInt("CommunityPremiumBuyCoinId", 57);
|
||||
COMMUNITY_PREMIUM_PRICE_PER_DAY = CommunityBoard.getInt("CommunityPremiumPricePerDay", 1000000);
|
||||
final String[] allowedBuffs = CommunityBoard.getString("CommunityAvailableBuffs", "").split(",");
|
||||
COMMUNITY_AVAILABLE_BUFFS = new ArrayList<>(allowedBuffs.length);
|
||||
for (String s : allowedBuffs)
|
||||
{
|
||||
COMMUNITY_AVAILABLE_BUFFS.add(Integer.parseInt(s));
|
||||
}
|
||||
|
||||
// Load DebugVoiceCommand config file (if exists)
|
||||
final PropertiesParser DebugVoiceCommand = new PropertiesParser(CUSTOM_DEBUG_VOICE_COMMAND_CONFIG_FILE);
|
||||
|
Reference in New Issue
Block a user