Jump to content

[Share]IL Command Fostress Register...


Recommended Posts

Command for register event Forstress Siege:

(.foson / .fosoff / .fosinfo )

 

Index: config/FS/FS-Mods.properties
===================================================================
--- config/FS/FS-Mods.properties (revision 66)
+++ config/FS/FS-Mods.properties (working copy)
@@ -93,14 +93,21 @@
AltDisableDagger = False
DisableDaggerForClasses =

-#Commands for register events
+# ---------------------------------------
+# Commands Custom for Rank and Events
+# ---------------------------------------
#.tvton / .tvtoff / .tvtinfo
AllowTvTCommands = False
+
#.ctfon / .ctfoff / .ctfinfo
AllowCTFCommands = False
+
#.rank Show Top PvP Pk Server
AllowRankCommand = False

+#.foson / .fosoff / .fosinfo
+AllowFOSCommands = False
+
#Put the number you want to PvP so that players have to use chat
#0 = disabled
PvPsUseChat = 0
Index: src/main/java/net/sf/l2j/Config.java
===================================================================
--- src/main/java/net/sf/l2j/Config.java (revision 67)
+++ src/main/java/net/sf/l2j/Config.java (working copy)
@@ -353,6 +353,7 @@
    public static boolean  ALLOW_TVT_COMMANDS;
    public static boolean  ALLOW_CTF_COMMANDS;
    public static boolean  ALLOW_RANK_COMMAND;
+    public static boolean  ALLOW_FOS_COMMANDS;
    public static int     PVP_USE_CHAT;
    public static boolean  ALLOW_VIP_NCOLOR;
    public static int   VIP_NCOLOR;
@@ -502,6 +503,7 @@
             ALLOW_TVT_COMMANDS    = Boolean.parseBoolean(FSSettings.getProperty("AllowTvTCommands", "False"));
             ALLOW_CTF_COMMANDS    = Boolean.parseBoolean(FSSettings.getProperty("AllowCTFCommands", "False"));
             ALLOW_RANK_COMMAND    = Boolean.parseBoolean(FSSettings.getProperty("AllowRankCommand", "False"));
+            ALLOW_FOS_COMMANDS    = Boolean.parseBoolean(FSSettings.getProperty("AllowFOSCommands", "False"));
             PVP_USE_CHAT    = Integer.parseInt(FSSettings.getProperty("PvPsUseChat", "0"));
             ALLOW_VIP_NCOLOR    = Boolean.parseBoolean(FSSettings.getProperty("AllowVipNameColor", "True"));
             VIP_NCOLOR    = Integer.decode("0x" + FSSettings.getProperty("VipNameColor", "0088FF"));
Index: src/main/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 66)
+++ src/main/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy)
@@ -22,6 +22,7 @@
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.CastleDoors;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.CTFCmd;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.FOSCmd;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.pmoff;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.rank;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.tradeoff;
@@ -57,6 +58,8 @@
       registerVoicedCommandHandler(new CastleDoors());
       if(Config.ALLOW_CTF_COMMANDS)
          registerVoicedCommandHandler(new CTFCmd());
+       if(Config.ALLOW_FOS_COMMANDS)
+          registerVoicedCommandHandler(new FOSCmd());
       registerVoicedCommandHandler(new pmoff());
  if(Config.ALLOW_RANK_COMMAND)
          registerVoicedCommandHandler(new rank());
Index: src/main/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/FOSCmd.java
===================================================================
--- src/main/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/FOSCmd.java (revision 0)
+++ src/main/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/FOSCmd.java (revision 0)
@@ -0,0 +1,195 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.instancemanager.ZoneManager;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.entity.events.FortressSiege;
+import net.sf.l2j.gameserver.model.zone.ZoneEnum;
+import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
+
+/*
+ * Adaptado por (Fast)-(Slow). Baseado no .jointvt!
+ * Favor nao retirar os creditos!
+ */
+
+public class FOSCmd implements IVoicedCommandHandler
+{
+       private static final String[] VOICED_COMMANDS = { "foson", "fosoff", "fosinfo" };
+
+       public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+       {
+             if (command.startsWith("foson"))
+             {
+                   CadastrarFOS(activeChar);
+             }
+             else if(command.startsWith("fosoff"))
+             {
+                   DescadastrarFOS(activeChar);
+             }
+
+             else if(command.startsWith("fosinfo"))
+             {
+                   FOSinfo(activeChar);
+             }
+
+             return true;
+       }
+
+       public String[] getVoicedCommandList()
+       {
+             return VOICED_COMMANDS;
+       }
+
+       public boolean CadastrarFOS (L2PcInstance activeChar)
+       {
+             if ( activeChar == null)
+             {
+                   return false;
+             }
+             NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
+
+            
+             if (!FortressSiege._joining)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Nao ha nenhum evento Fortress Siege ocorrendo no momento.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if (FortressSiege._joining && activeChar._inEventFOS)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce ja esta registrado.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if ( activeChar.isCursedWeaponEquiped() && !Config.FortressSiege_JOIN_CURSED)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode participar deste evento:<br>Porque tem uma Cursed Weapon.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if ( activeChar.isInOlympiadMode())
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode participar deste evento:<br>Porque esta na Olympiada.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if ( activeChar.isInJail() )
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode participar deste evento:<br>Porque esta na Jail.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if (activeChar.getLevel() < FortressSiege._minlvl)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode participar deste evento:<br>Porque seu level e muito baixo.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if (activeChar.getKarma() > 0)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode participar deste evento:<br>Porque voce esta com karma.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if (FortressSiege._teleport || FortressSiege._started)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Acabou o periodo de cadastro do Fortress Siege.<br>Voce nao pode se registrar agora.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else
+             {
+                   npcHtmlMessage.setHtml("<html><body>Sua participacao no Fortress Siege, foi aceita.<br>Se prepare para sumonar as bandeiras.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   FortressSiege.addPlayer(activeChar,"");
+                   return false;
+             }
+       }
+
+       public boolean DescadastrarFOS (L2PcInstance activeChar)
+       {
+             if ( activeChar == null)
+             {
+                   return false;
+             }
+
+             NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
+
+             if (!FortressSiege._joining)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Nao ha nenhum evento Fortress Siege ocorrendo no momento.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if ((FortressSiege._teleport || FortressSiege._started) && activeChar._inEventFOS)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode sair, pois o Evento ja iniciou.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if (FortressSiege._joining && !activeChar._inEventFOS)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao esta registrado em um evento.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else
+             {
+                   npcHtmlMessage.setHtml("<html><body>Sua participacao no evento foi cancelada.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   FortressSiege.removePlayer(activeChar);
+                   return true;
+             }
+       }
+       public boolean FOSinfo (L2PcInstance activeChar)
+       {
+             if ( activeChar == null)
+             {
+                   return false;
+             }
+
+             NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );
+
+             if (!FortressSiege._joining)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Nao ha nenhum evento Fortress Siege ocorrendo no momento.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else if (FortressSiege._teleport || FortressSiege._started)
+             {
+                   npcHtmlMessage.setHtml("<html><body>Voce nao pode saber informacoes.<br>Este comando so funciona no periodo de cadastro do evento.</body></html>");
+                   activeChar.sendPacket( npcHtmlMessage );
+                   return false;
+             }
+             else
+             {
+                   if (FortressSiege._playersShuffle.size() == 1)
+                   {
+                         npcHtmlMessage.setHtml("<html><body>Tem " + FortressSiege._playersShuffle.size() + " player participando deste evento.</body></html>");
+                         activeChar.sendPacket( npcHtmlMessage );
+                   }
+                   else
+                   {
+                         npcHtmlMessage.setHtml("<html><body>Temos " + FortressSiege._playersShuffle.size() + " players participando deste evento.</body></html>");
+                         activeChar.sendPacket( npcHtmlMessage );
+                   }
+                   return true;
+             }
+       }
+}
\ No newline at end of file

Sorry my bad engilsh. rs

 

Credits: Me (Fast)-(Slow)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...