Support for custom community board delevel.

This commit is contained in:
MobiusDev
2019-03-06 13:32:27 +00:00
parent 4ac4ce3c05
commit f6c0fd7679
84 changed files with 4344 additions and 12 deletions

View File

@@ -26,6 +26,10 @@ CommunityEnableBuffs = True
# Default: True
CommunityEnableHeal = True
# Enable delevel.
# Default: False
CommunityEnableDelevel = False
# Price for Teleports.
# Default: 0 (free)
CommunityTeleportPrice = 0
@@ -38,6 +42,10 @@ CommunityBuffPrice = 0
# Default: 0 (free)
CommunityHealPrice = 0
# Price for Delevel.
# Default: 0 (free)
CommunityDelevelPrice = 0
# Disable Community Board while in combat.
# Default: True
CommunityCombatDisabled = True

View File

@@ -0,0 +1,108 @@
<html noscrollbar>
<body>
<table width=700>
<tr>
<td height=10></td>
</tr>
</table>
<table width=20>
<tr>
<td>
%navigation%
</td>
<td>
<center>
<table border=0 cellpadding=0 cellspacing=0 width=555 height=455 background="L2UI_CT1.Windows_DF_TooltipBG">
<tr>
<td height=25></td>
</tr>
<tr>
<td height=25 align="center"><font name="hs12" color="CDB67F">Delevel Manager</font></td>
</tr>
<tr>
<td>
<center><img src="L2UI.SquareGray" width=200 height=1></center>
</td>
</tr>
<tr>
<td height=20></td>
</tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Make sure this is the character you want to delevel.<br1></font></td></tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Deleveling is irreversible.<br1></font></td></tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Your skill levels will be decreased or removed accordingly.</font></td></tr>
<tr>
<td height=20></td>
</tr>
<tr><td height=15 align="center"></td></tr>
<tr><td height=15 align="center"></td></tr>
<tr>
<td height=10></td>
</tr>
<tr>
<td>
<center><img src="L2UI.SquareGray" width=500 height=1></center>
</td>
</tr>
<tr>
<td height=25></td>
</tr>
<tr>
<td align="center">
<table align=center border="0" height=85 >
<tr>
<td width=500 align=center>Are you sure you want to delevel your character?</td>
</tr>
<tr>
<td width=500 align=center><button value="I agree!" action="bypass _bbsdelevel" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<table align=center border="0">
<tr>
<td>
<center><img src="L2UI.SquareGray" width=500 height=1></center>
</td>
</tr>
<tr>
<td height=10></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<center><img src="L2UI_CH3.herotower_deco" width=256 height=32></center>
</td>
</tr>
<tr>
<td height=150 align="center">
<br>
<font name="hs12" color="CDB67F">In case you want to disable any experience gains
<br1>
try entering the following command in chat</font>
<br1>
<font name="hs12" color="00A5FF">.expoff</font>
</td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=555>
<tr>
<td height=10></td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=555 background="L2UI_CT1.Windows_DF_TooltipBG">
<tr>
<td height=17></td>
</tr>
<tr>
<td align=center><font color=696969>LINEAGE II - COMMUNITY BOARD</font></td>
</tr>
<tr>
<td height=15></td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,105 @@
<html noscrollbar>
<body>
<table width=700>
<tr>
<td height=10></td>
</tr>
</table>
<table width=20>
<tr>
<td>
%navigation%
</td>
<td>
<center>
<table border=0 cellpadding=0 cellspacing=0 width=555 height=455 background="L2UI_CT1.Windows_DF_TooltipBG">
<tr>
<td height=25></td>
</tr>
<tr>
<td height=25 align="center"><font name="hs12" color="CDB67F">Delevel Manager</font></td>
</tr>
<tr>
<td>
<center><img src="L2UI.SquareGray" width=200 height=1></center>
</td>
</tr>
<tr>
<td height=20></td>
</tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Make sure this is the character you want to delevel.<br1></font></td></tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Deleveling is irreversible.<br1></font></td></tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Your skill levels will be decreased or removed accordingly.</font></td></tr>
<tr>
<td height=20></td>
</tr>
<tr><td height=15 align="center"></td></tr>
<tr><td height=15 align="center"></td></tr>
<tr>
<td height=10></td>
</tr>
<tr>
<td>
<center><img src="L2UI.SquareGray" width=500 height=1></center>
</td>
</tr>
<tr>
<td height=25></td>
</tr>
<tr>
<td align="center">
<table align=center border="0" height=85 >
<tr>
<td width=500 align=center><font name="hs12" color="CDB67F">Congratulations!<br1>Your level was decreased!</font></td>
</tr>
</table>
<table align=center border="0">
<tr>
<td>
<center><img src="L2UI.SquareGray" width=500 height=1></center>
</td>
</tr>
<tr>
<td height=10></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<center><img src="L2UI_CH3.herotower_deco" width=256 height=32></center>
</td>
</tr>
<tr>
<td height=150 align="center">
<br>
<font name="hs12" color="CDB67F">In case you want to disable any experience gains
<br1>
try entering the following command in chat</font>
<br1>
<font name="hs12" color="00A5FF">.expoff</font>
</td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=555>
<tr>
<td height=10></td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=555 background="L2UI_CT1.Windows_DF_TooltipBG">
<tr>
<td height=17></td>
</tr>
<tr>
<td align=center><font color=696969>LINEAGE II - COMMUNITY BOARD</font></td>
</tr>
<tr>
<td height=15></td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -0,0 +1,108 @@
<html noscrollbar>
<body>
<table width=700>
<tr>
<td height=10></td>
</tr>
</table>
<table width=20>
<tr>
<td>
%navigation%
</td>
<td>
<center>
<table border=0 cellpadding=0 cellspacing=0 width=555 height=455 background="L2UI_CT1.Windows_DF_TooltipBG">
<tr>
<td height=25></td>
</tr>
<tr>
<td height=25 align="center"><font name="hs12" color="CDB67F">Delevel Manager</font></td>
</tr>
<tr>
<td>
<center><img src="L2UI.SquareGray" width=200 height=1></center>
</td>
</tr>
<tr>
<td height=20></td>
</tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Make sure this is the character you want to delevel.<br1></font></td></tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Deleveling is irreversible.<br1></font></td></tr>
<tr><td align="left"> <font color="CDB67F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Your skill levels will be decreased or removed accordingly.</font></td></tr>
<tr>
<td height=20></td>
</tr>
<tr><td height=15 align="center"></td></tr>
<tr><td height=15 align="center"></td></tr>
<tr>
<td height=10></td>
</tr>
<tr>
<td>
<center><img src="L2UI.SquareGray" width=500 height=1></center>
</td>
</tr>
<tr>
<td height=25></td>
</tr>
<tr>
<td align="center">
<table align=center border="0" height=85 >
<tr>
<td width=500 align=center>Proceed with character delevel.</td>
</tr>
<tr>
<td width=500 align=center><button value="I want to delevel!" action="bypass _bbstop;delevel/ask.html" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<table align=center border="0">
<tr>
<td>
<center><img src="L2UI.SquareGray" width=500 height=1></center>
</td>
</tr>
<tr>
<td height=10></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<center><img src="L2UI_CH3.herotower_deco" width=256 height=32></center>
</td>
</tr>
<tr>
<td height=150 align="center">
<br>
<font name="hs12" color="CDB67F">In case you want to disable any experience gains
<br1>
try entering the following command in chat</font>
<br1>
<font name="hs12" color="00A5FF">.expoff</font>
</td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=555>
<tr>
<td height=10></td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=555 background="L2UI_CT1.Windows_DF_TooltipBG">
<tr>
<td height=17></td>
</tr>
<tr>
<td align=center><font color=696969>LINEAGE II - COMMUNITY BOARD</font></td>
</tr>
<tr>
<td height=15></td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>

View File

@@ -17,6 +17,9 @@
<tr>
<td><button value="Drop Search" action="bypass _bbstop;dropsearch/main.html" width=200 height=30 back="L2UI_CT1.OlympiadWnd_DF_Watch_Down" fore="L2UI_CT1.OlympiadWnd_DF_Watch"></td></tr>
</tr>
<tr>
<td><button value="Delevel" action="bypass _bbstop;delevel/main.html" width=200 height=30 back="L2UI_CT1.OlympiadWnd_DF_Back_Down" fore="L2UI_CT1.OlympiadWnd_DF_Back"></td>
</tr>
<tr>
<td><button value="Premium" action="bypass _bbstop;premium/main.html" width=200 height=30 back="L2UI_CT1.OlympiadWnd_DF_Reward_Down" fore="L2UI_CT1.OlympiadWnd_DF_Reward"></td>
</tr>

View File

@@ -34,6 +34,7 @@ import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.cache.HtmCache;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.xml.impl.BuyListData;
import com.l2jmobius.gameserver.data.xml.impl.ExperienceData;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.CommunityBoardHandler;
@@ -73,7 +74,8 @@ public final class HomeBoard implements IParseBoardHandler
Config.COMMUNITYBOARD_ENABLE_MULTISELLS ? "_bbssell" : null,
Config.COMMUNITYBOARD_ENABLE_TELEPORTS ? "_bbsteleport" : null,
Config.COMMUNITYBOARD_ENABLE_BUFFS ? "_bbsbuff" : null,
Config.COMMUNITYBOARD_ENABLE_HEAL ? "_bbsheal" : null
Config.COMMUNITYBOARD_ENABLE_HEAL ? "_bbsheal" : null,
Config.COMMUNITYBOARD_ENABLE_DELEVEL ? "_bbsdelevel" : null
};
public static final BiPredicate<String, L2PcInstance> COMBAT_CHECK = (command, activeChar) ->
@@ -255,6 +257,29 @@ public final class HomeBoard implements IParseBoardHandler
returnHtml = HtmCache.getInstance().getHtm(activeChar, "data/html/CommunityBoard/Custom/" + page + ".html");
}
else if (command.equals("_bbsdelevel"))
{
if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_DELEVEL_PRICE)
{
activeChar.sendMessage("Not enough currency!");
}
else if (activeChar.getLevel() == 1)
{
activeChar.sendMessage("You are at minimum level!");
}
else
{
activeChar.destroyItemByItemId("CB_Delevel", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_DELEVEL_PRICE, activeChar, true);
final int newLevel = activeChar.getLevel() - 1;
activeChar.setExp(ExperienceData.getInstance().getExpForLevel(newLevel));
activeChar.getStat().setLevel((byte) newLevel);
activeChar.setCurrentHpMp(activeChar.getMaxHp(), activeChar.getMaxMp());
activeChar.setCurrentCp(activeChar.getMaxCp());
activeChar.broadcastUserInfo();
activeChar.checkPlayerSkills(); // Adjust skills according to new level.
returnHtml = HtmCache.getInstance().getHtm(activeChar, "data/html/CommunityBoard/Custom/delevel/complete.html");
}
}
else if (command.startsWith("_bbspremium"))
{
final String fullBypass = command.replace("_bbspremium;", "");