Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/java/L2JDev/World/gameserver/Community_L2JDev/Buffer/SpecialBBSManager.java b/java/L2JDev/World/gameserver/Community_L2JDev/Buffer/SpecialBBSManager.java
- new file mode 100644
- index 0000000..bedd6cd
- --- /dev/null
- +++ b/java/L2JDev/World/gameserver/Community_L2JDev/Buffer/SpecialBBSManager.java
- @@ -0,0 +1,135 @@
- +package L2JDev.World.gameserver.Community_L2JDev.Buffer;
- +
- +import java.util.StringTokenizer;
- +
- +import L2JDev.World.Config;
- +import L2JDev.World.gameserver.communitybbs.manager.BaseBBSManager;
- +import L2JDev.World.gameserver.data.SkillTable;
- +import L2JDev.World.gameserver.data.cache.HtmCache;
- +import L2JDev.World.gameserver.data.xml.ItemData;
- +import L2JDev.World.gameserver.enums.ZoneId;
- +import L2JDev.World.gameserver.model.actor.Player;
- +import L2JDev.World.gameserver.model.entity.TeamVsTeam.TvTEvent;
- +import L2JDev.World.gameserver.model.item.instance.ItemInstance;
- +import L2JDev.World.gameserver.model.olympiad.OlympiadManager;
- +import L2JDev.World.gameserver.network.SystemMessageId;
- +import L2JDev.World.gameserver.network.serverpackets.MagicSkillUse;
- +import L2JDev.World.gameserver.network.serverpackets.SystemMessage;
- +import L2JDev.World.gameserver.skills.L2Skill;
- +
- +/**
- + * @author Juvenil Walker
- + *
- + */
- +public class SpecialBBSManager extends BaseBBSManager
- +{
- + @Override
- + public void parseCmd(String command, Player activeChar)
- + {
- + if (command.startsWith("_bbsexe"))
- + {
- +
- + String val2 = command.substring(8);
- + StringTokenizer st2 = new StringTokenizer(val2, " ");
- +
- + String a2 = st2.nextToken();
- + int id2 = Integer.parseInt(a2);
- + String b2 = st2.nextToken();
- + int lvl2 = Integer.parseInt(b2);
- + String valor = st2.nextToken();
- + int Prince = Integer.parseInt(valor);
- + String itemname = ItemData.getInstance().getTemplate(Config.BUFF_CONST_ITEM).getName();
- + if (!checkAllowed(activeChar))
- + return;
- +
- + ItemInstance itemInstance = activeChar.getInventory().getItemByItemId(Config.BUFF_CONST_ITEM);
- + if (itemInstance == null || !itemInstance.isStackable() && activeChar.getInventory().getItemCount(Config.BUFF_CONST_ITEM, -1) < (Prince))
- + {
- + activeChar.sendMessage("you not enough item " + itemname);
- + return;
- + }
- + else if (itemInstance.isStackable())
- + {
- + if (!activeChar.destroyItemByItemId("Adena", Config.BUFF_CONST_ITEM, Prince, activeChar.getTarget(), true))
- + {
- + activeChar.sendMessage("you not enough item " + itemname);
- + return;
- + }
- + }
- + L2Skill skill2 = SkillTable.getInstance().getInfo(id2, lvl2);
- + if (skill2 != null)
- + {
- + skill2.getEffects(activeChar, activeChar);
- + MagicSkillUse mgc = new MagicSkillUse(activeChar, activeChar, id2, lvl2, 1150, 0);
- + activeChar.sendPacket(mgc);
- + activeChar.broadcastPacket(mgc);
- + activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(id2, lvl2));
- + }
- +
- + String filename = "data/html/CommunityBoard/top/extra.htm";
- + String content = HtmCache.getInstance().getHtm(filename, activeChar);
- + content.replace("%ServerName%", Config.ServerName);
- + separateAndSend(content, activeChar);
- +
- + }
- + }
- + public boolean checkAllowed(Player activeChar)
- + {
- + final Player player = activeChar.getActingPlayer();
- + int charId = player.getObjectId();
- + String msg = null;
- + if (activeChar.isSitting())
- + msg = "You can't use Community Buffer when you sit!";
- + else if (activeChar.isDead())
- + msg = "You can't use Community Buffer when you dead!";
- + else if (activeChar.isInCombat())
- + msg = "You can't use Community Buffer when you in combat!";
- + else if(player.isInOlympiadMode() || player.isInsideZone(ZoneId.PVP) || OlympiadManager.getInstance().isRegistered(activeChar) || OlympiadManager.getInstance().isRegisteredInComp(activeChar))
- + msg = "You can't use Community Buffer when you on event!";
- + else if(player.isInJail() || player.isInsideZone(ZoneId.JAIL))
- + msg = "You can't use Community Buffer when you on Jail";
- + else if(player.getPvpFlag() > 1 || player.isInsideZone(ZoneId.CHAOTIC))
- + msg = "You can't use Community Buffer when you on Chaotic";
- + else if(player.getPvpFlag() > 0 || player.isInsideZone(ZoneId.CHAOTIC))
- + msg = "You can't use Community Buffer when you on Chaotic";
- + else if(player.isInsideZone(ZoneId.CHAOTIC))
- + msg = "You can't use Community Buffer when you on Chaotic";
- + else if(player.isCursedWeaponEquipped())
- + msg = "You can't use Community Buffer when you have Cursed Weapon!";
- + else if(player.isInsideZone(ZoneId.BOSS))
- + msg = "You can't use Community Buffer when you on Boss Zone!";
- + else if(player.isInArenaEvent() || player.isInsideZone(ZoneId.ARENA_EVENT))
- + msg = "You can't use Community Buffer when you on Tour!";
- + if (TvTEvent.isPlayerParticipant(charId))
- + msg = "You can't use Community Buffer while participating on Event TvT!.";
- + if (msg != null)
- + {
- + activeChar.sendMessage(msg);
- + String path = "data/html/CommunityBoard/top/";
- + String filepath = "";
- + String content = "";
- +
- + filepath = path + "extra.htm";
- + content = HtmCache.getInstance().getHtm(filepath, player);
- + separateAndSend(content, player);
- + // ===========================================================================
- + if (content != null)
- + {
- + content = content.replace("%ServerName%", String.valueOf(Config.ServerName));
- + content = content.replace("%name%", String.valueOf(player.getName()));
- + BaseBBSManager.separateAndSend(content, player);
- + }
- + }
- + return msg == null;
- + }
- +
- + public static SpecialBBSManager getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final SpecialBBSManager INSTANCE = new SpecialBBSManager();
- + }
- +}
- \ No newline at end of file
- diff --git a/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java b/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java
- index ae50aef..5582834 100644
- --- a/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java
- +++ b/java/L2JDev/World/gameserver/communitybbs/CommunityBoard.java
- @@ -1,278 +1,278 @@
- + else if (command.startsWith("_bbsexe"))
- + SpecialBBSManager.getInstance().parseCmd(command, player);
- }
- \ No newline at end of file
- diff --git a/java/L2JDev/World/gameserver/data/html/CommunityBoard/top/extra.HTML
- b/java/L2JDev/World/gameserver/data/html/CommunityBoard/top/extra.HTML
- index ae50aef..5582834 100644
- +<html>
- +<body>
- +<center>
- + <br>
- + <table cellspacing="0" cellpadding="1" border="0" width="610">
- + <tr>
- + <td width=1 align=center></td>
- + <td width=1 align=center></td>
- + <td width=1 align=center><button value="Home" action="bypass _bbshome" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Shop" action="bypass _bbspag;shop.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Buffer" action="bypass _bbspag;buffer.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Teleport" action="bypass _bbspag;teleport.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Character" action="bypass _bbsMenu" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Skins" action="bypass _bbsSkinHtml" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Boss" action="bypass _bbsranking;boss" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td width=1 align=center><button value="Donate" action="bypass _bbsEnchantIndex" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + </tr>
- + </table>
- + <br><br>
- + <font color="58CC00">L2JDev</font> - Community Special's
- + <br>
- + <img src="Icons.breaker" width=260 height=16>
- + <br>
- + <table>
- + <tr>
- + <td><button value="Cancel" action="bypass _bbscancelbuff" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><button value="Heal" action="bypass _bbsheal" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + </tr>
- + </table>
- + <br><br>
- + <table cellspacing="0" cellpadding="1" border="0" width="610">
- + <tr>
- + <td><img src=icon.skill1164 width=32 height=23 align=left></td>
- + <td><button value="Rheumatism" action="bypass _bbsexe 4551 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><img src=icon.skill1164 width=32 height=23 align=left></td>
- + <td><button value="Cholera" action="bypass _bbsexe 4552 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><img src=icon.skill1164 width=32 height=23 align=left></td>
- + <td><button value="Flu" action="bypass _bbsexe 4553 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><img src=icon.skill1164 width=32 height=23 align=left></td>
- + <td><button value="Malaria" action="bypass _bbsexe 4554 4 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td></td>
- + <td></td>
- + </tr>
- + <tr>
- + <td><img src=icon.skill0341 width=32 height=23 align=left></td>
- + <td><button value="T. of Life" action="bypass _bbsexe 341 1 1" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><img src=icon.skill1410 width=32 height=23 align=left></td>
- + <td><button value="Salvation" action="bypass _bbsexe 1410 1 10" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><img src=icon.skill1374 width=32 height=23 align=left></td>
- + <td><button value="H. Valor" action="bypass _bbsexe 1374 1 10" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><img src=icon.skill0396 width=32 height=23 align=left></td>
- + <td><button value="H. Berserker" action="bypass _bbsexe 396 1 10" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td></td>
- + <td></td>
- + </tr>
- + </table>
- + <br>
- + <br>
- + <br>
- + <img src="Icons.breaker" width=260 height=16>
- + <br>
- + <table>
- + <tr>
- + <td><button value="Buff" action="bypass _bbspag;buffer.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><button value="Song" action="bypass _bbspag;songs.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><button value="Dance" action="bypass _bbspag;dance.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + <td><button value="Extra" action="bypass _bbspag;extra.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalOn"></td>
- + <td><button value="VIP" action="bypass _bbspag;VipBuffer.htm" width=75 height=21 back="L2UI_CH3.Btn1_normalOn" fore="L2UI_CH3.Btn1_normalDisable"></td>
- + </tr>
- + </table>
- +</center>
- +</body>
- +</html>
Add Comment
Please, Sign In to add comment