Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 1)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
- @@ -20,18 +20,29 @@
- import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.BuffCommand;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- @@ -89,10 +100,218 @@
- else if (_command.startsWith("player_help "))
- {
- playerHelp(activeChar, _command.substring(12));
- }
- + // start voiced .buff command
- + else if (_command.startsWith("buffCommandFight"))
- + {
- + BuffCommand.getFullBuff(activeChar, false);
- + }
- + else if (_command.startsWith("buffCommandMage"))
- + {
- + BuffCommand.getFullBuff(activeChar, true);
- + }
- + else if (_command.startsWith("buffCommand") && BuffCommand.check(activeChar))
- + {
- + String idBuff = _command.substring(12);
- + int parseIdBuff = Integer.parseInt(idBuff);
- + SkillTable.getInstance().getInfo(parseIdBuff, SkillTable.getInstance().getMaxLevel(parseIdBuff)).getEffects(activeChar, activeChar);
- + BuffCommand.showHtml(activeChar);
- + }
- + else if (_command.startsWith("cancelBuffs") && BuffCommand.check(activeChar))
- + {
- + activeChar.stopAllEffectsExceptThoseThatLastThroughDeath();
- + BuffCommand.showHtml(activeChar);
- + }
- + // end voiced .buff command
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/BuffCommand.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/BuffCommand.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/BuffCommand.java (working copy)
- @@ -0,0 +1,59 @@
- +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.model.zone.ZoneId;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +
- +/**
- + *
- + * @author Bluur
- + *
- + */
- +public class BuffCommand implements IVoicedCommandHandler
- +{
- + private final String[] _voicedCommands =
- + {
- + "buff"
- + };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + if (check(activeChar)) //retorna
- + showHtml(activeChar);
- +
- + return true;
- + }
- +
- + public static void getFullBuff(L2PcInstance p, boolean isClassMage)
- + {
- + if (check(p))
- + {
- + if (isClassMage)
- + {
- + for (int b : Config.BUFF_COMMAND_MAGE_IDBUFFS)
- + SkillTable.getInstance().getInfo(b, SkillTable.getInstance().getMaxLevel(b)).getEffects(p, p);
- + }
- + else
- + {
- + for (int b : Config.BUFF_COMMAND_FIGHT_IDBUFFS)
- + SkillTable.getInstance().getInfo(b, SkillTable.getInstance().getMaxLevel(b)).getEffects(p, p);
- + }
- + p.sendMessage("[Buff Command]: Voce foi buffado!");
- + }
- + }
- +
- + public static boolean check(L2PcInstance p)
- + {
- + return p.isInsideZone(ZoneId.PEACE) && !p.isInCombat() && !p.isInOlympiadMode(); //restrições
- + }
- +
- + public static void showHtml(L2PcInstance player)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile("data/html/mods/buffCommand.htm");
- + html.replace("%currentBuffs%", player.getBuffCount());
- + html.replace("%getMaxBuffs%", player.getMaxBuffCount());
- + player.sendPacket(html);
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return _voicedCommands;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -0,0 +1,94 @@
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Online;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.BuffCommand;
- protected VoicedCommandHandler()
- {
- registerHandler(new Online());
- + registerHandler(new BuffCommand());
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 1)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -484,6 +484,11 @@
- public static boolean STORE_SKILL_COOLTIME;
- public static int BUFFS_MAX_AMOUNT;
- + /** Voiced buff command */
- + public static String LIST_BUFF_COMMAND;
- + public static int[] BUFF_COMMAND_FIGHT_IDBUFFS;
- + public static int[] BUFF_COMMAND_MAGE_IDBUFFS;
- +
- STORE_SKILL_COOLTIME = players.getProperty("StoreSkillCooltime", true);
- +
- + LIST_BUFF_COMMAND = players.getProperty("buffCommandFightBuffsID", "123,456");
- +
- + String[] buffCommand = LIST_BUFF_COMMAND.split(",");
- + BUFF_COMMAND_FIGHT_IDBUFFS = new int[buffCommand.length];
- + for (int i = 0; i < buffCommand.length; i++)
- + BUFF_COMMAND_FIGHT_IDBUFFS[i] = Integer.parseInt(buffCommand[i]);
- +
- + LIST_BUFF_COMMAND = players.getProperty("buffCommandMageBuffsID", "789,1011112");
- +
- + buffCommand = LIST_BUFF_COMMAND.split(",");
- + BUFF_COMMAND_MAGE_IDBUFFS = new int[buffCommand.length];
- + for (int i = 0; i < buffCommand.length; i++)
- + BUFF_COMMAND_MAGE_IDBUFFS[i] = Integer.parseInt(buffCommand[i]);
- Index: config/players.properties
- ===================================================================
- --- config/players.properties (revision 1)
- +++ config/players.properties (working copy)
- @@ -288,4 +288,14 @@
- StoreSkillCooltime = True
- +
- +#=============================================================
- +# Voiced .buff Command by Bluur
- +#=============================================================
- +
- +# List of ID buffs - FIGHT -
- +buffCommandFightBuffsID = 1204,1040,1035,1045,1062,1048,1036,1303,1085,1059,1078,264,267,268,304,349,273,276,365,1363
- +
- +# List of ID buffs - MAGE -
- +buffCommandMageBuffsID = 1204,1068,1040,1035,1036,1045,1086,1077,1240,1242,264,267,268,269,304,364,271,274,275,1363
- HTM
Advertisement
Add Comment
Please, Sign In to add comment