Support for community buffer multi buffs.
This commit is contained in:
parent
8440c8cfee
commit
a55076fc8a
@ -159,18 +159,19 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
else if (Config.CUSTOM_CB_ENABLED && Config.COMMUNITYBOARD_ENABLE_BUFFS && command.startsWith("_bbsbuff"))
|
||||
{
|
||||
final String fullBypass = command.replace("_bbsbuff;", "");
|
||||
final String[] buypassOptions = fullBypass.split(",");
|
||||
final int buffId = Integer.parseInt(buypassOptions[0]);
|
||||
final int buffLevel = Integer.parseInt(buypassOptions[1]);
|
||||
final String page = buypassOptions[2];
|
||||
if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_BUFF_PRICE)
|
||||
final String[] buypassOptions = fullBypass.split(";");
|
||||
final int buffCount = buypassOptions.length - 1;
|
||||
final String page = buypassOptions[buffCount];
|
||||
if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < (Config.COMMUNITYBOARD_BUFF_PRICE * buffCount))
|
||||
{
|
||||
activeChar.sendMessage("Not enough currency!");
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.getInventory().destroyItemByItemId("CB_Buff", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_BUFF_PRICE, activeChar, activeChar);
|
||||
final Skill skill = SkillData.getInstance().getSkill(buffId, buffLevel);
|
||||
activeChar.getInventory().destroyItemByItemId("CB_Buff", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_BUFF_PRICE * buffCount, activeChar, activeChar);
|
||||
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.COMMUNITYBOARD_CAST_ANIMATIONS)
|
||||
{
|
||||
SkillCaster.triggerCast(activeChar, activeChar, skill);
|
||||
@ -202,6 +203,7 @@ public final class HomeBoard implements IParseBoardHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CommunityBoardHandler.separateAndSend(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/Custom/" + page + ".html"), activeChar);
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user