Jump to content
  • 0

.xpon / .xpoff


EloBoost

Question

3 answers to this question

Recommended Posts

  • 0

adapt this it's not hard just some small changes on the imports

### Eclipse Workspace Patch 1.0
#P L2jxCine_GameServer
Index: head-src/net/xcine/Config.java
===================================================================
--- head-src/net/xcine/Config.java      (revision 59)
+++ head-src/net/xcine/Config.java      (working copy)
@@ -305,6 +305,7 @@
        public static String CHAT_FILTER_PUNISHMENT;
        public static ArrayList<String> FILTER_LIST = new ArrayList<>();

+       public static boolean NOXPGAIN_ENABLED;
        public static int FS_TIME_ATTACK;
        public static int FS_TIME_COOLDOWN;
        public static int FS_TIME_ENTRY;

        //Rates
@@ -2115,6 +2123,7 @@
                        CHAT_FILTER_PUNISHMENT = otherSettings.getProperty("ChatFilterPunishment", "off");
                        CHAT_FILTER_PUNISHMENT_PARAM1 = Integer.parseInt(otherSettings.getProperty("ChatFilterPunishmentParam1", "1"));
                        CHAT_FILTER_PUNISHMENT_PARAM2 = Integer.parseInt(otherSettings.getProperty("ChatFilterPunishmentParam2", "1000"));
+                       NOXPGAIN_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("NoXPGainEnable", "false"));
                        FS_TIME_ATTACK = Integer.parseInt(otherSettings.getProperty("TimeOfAttack", "50"));
                        FS_TIME_COOLDOWN = Integer.parseInt(otherSettings.getProperty("TimeOfCoolDown", "5"));
                        FS_TIME_ENTRY = Integer.parseInt(otherSettings.getProperty("TimeOfEntry", "3"));
Index: head-src/net/xcine/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- head-src/net/xcine/gameserver/model/actor/instance/L2PcInstance.java        (revision 59)
+++ head-src/net/xcine/gameserver/model/actor/instance/L2PcInstance.java        (working copy)
@@ -1362,6 +1362,17 @@

        private long timerToAttack;

+       private boolean _cantGainXP;
+      
+       public void cantGainXP(boolean b)
+       {
+               _cantGainXP = b;
+       }      
+          
+       public boolean cantGainXP()
+       {
+               return _cantGainXP;
+       }      
        //private boolean isInDangerArea;
        ////////////////////////////////////////////////////////////////////
        //START CHAT BAN SYSTEM
Index: head-src/net/xcine/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- head-src/net/xcine/gameserver/handler/VoicedCommandHandler.java     (revision 54)
+++ head-src/net/xcine/gameserver/handler/VoicedCommandHandler.java     (working copy)
@@ -27,6 +27,7 @@
 import net.xcine.gameserver.handler.voicedcommandhandlers.BankingCmd;
 import net.xcine.gameserver.handler.voicedcommandhandlers.CTFCmd;
 import net.xcine.gameserver.handler.voicedcommandhandlers.DMCmd;
+import net.xcine.gameserver.handler.voicedcommandhandlers.NoExp;
 import net.xcine.gameserver.handler.voicedcommandhandlers.OfflineShop;
 import net.xcine.gameserver.handler.voicedcommandhandlers.Online;
 import net.xcine.gameserver.handler.voicedcommandhandlers.StatsCmd;
@@ -98,7 +99,8 @@
                {
                        registerVoicedCommandHandler(new OfflineShop());
                }
-              
+        if (Config.NOXPGAIN_ENABLED)
+            VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new NoExp());
                _log.config("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");

        }
Index: head-src/net/xcine/gameserver/handler/voicedcommandhandlers/NoExp.java
===================================================================
--- head-src/net/xcine/gameserver/handler/voicedcommandhandlers/NoExp.java      (revision 0)
+++ head-src/net/xcine/gameserver/handler/voicedcommandhandlers/NoExp.java      (working copy)
@@ -0,0 +1,62 @@
+/*
+ * 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.xcine.gameserver.handler.voicedcommandhandlers;
+
+import net.xcine.gameserver.handler.IVoicedCommandHandler;
+import net.xcine.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * This class allows user to turn XP-gain off and on.
+ *
+ * @author Notorious
+ */
+public class NoExp implements IVoicedCommandHandler
+{
+   private static final String[] _voicedCommands =
+   {
+      "xpoff",
+      "xpon"
+   };
+
+   /**
+    *
+    * @see net.xcine.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.xcine.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
+    */
+   @Override
+   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
+   {
+      if (command.equalsIgnoreCase("xpoff"))
+      {
+         activeChar.cantGainXP(true);
+         activeChar.sendMessage("You have turned XP-gain OFF!");
+      }
+      else if (command.equalsIgnoreCase("xpon"))
+      {
+         activeChar.cantGainXP(false);
+         activeChar.sendMessage("You have turned XP-gain ON!");
+      }
+      return true;
+   }
+
+   /**
+    *
+    * @see net.xcine.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
+    */
+   @Override
+   public String[] getVoicedCommandList()
+   {
+      return _voicedCommands;
+   }
+}
\ No newline at end of file
Index: head-src/net/xcine/gameserver/model/actor/stat/PcStat.java
===================================================================
--- head-src/net/xcine/gameserver/model/actor/stat/PcStat.java  (revision 54)
+++ head-src/net/xcine/gameserver/model/actor/stat/PcStat.java  (working copy)
@@ -55,8 +55,8 @@
        {
                L2PcInstance activeChar = getActiveChar();

-               //Player is Gm and access level is below or equal to canGainExp and is in party, don't give Xp
-               if(!getActiveChar().getAccessLevel().canGainExp() && getActiveChar().isInParty())
+               // Allowed to gain exp?
+               if (!getActiveChar().getAccessLevel().canGainExp() && getActiveChar().isInParty() || (Config.NOXPGAIN_ENABLED && getActiveChar().cantGainXP()))
                        return false;

                if(!super.addExp(value))
@@ -109,7 +109,7 @@

                //Player is Gm and acces level is below or equal to GM_DONT_TAKE_EXPSP and is in party, don't give Xp/Sp
                L2PcInstance activeChar = getActiveChar();
-               if(!activeChar.getAccessLevel().canGainExp() && activeChar.isInParty())
+               if (!activeChar.getAccessLevel().canGainExp() && activeChar.isInParty() || (Config.NOXPGAIN_ENABLED && getActiveChar().cantGainXP()))
                        return false;

                // if this player has a pet that takes from the owner's Exp, give the pet Exp now
Index: config/main/other.properties
===================================================================
--- config/main/other.properties        (revision 54)
+++ config/main/other.properties        (working copy)
@@ -232,3 +232,10 @@
 # Enable Messages to GMs on 4-5 consecutive pvp of a player
 # Why? to see if a char are farming!
 EnableAntiPvpFarmMsg = true
+
+#==============================================================#
+#       Voice-command for turning off XP-gain                  #                                                        
+#==============================================================#
+# Player can use .xpoff to disable XP-gain, and .xpon to enable again.
+# Default: False
+NoXPGainEnable = False
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Многие анонсеры ла2 перестали быть актуальными в 2024 году,  https://l2-top.ru/  предоставляет возможность размещаться как бесплатно, так и на условиях vip, у нас: низкие цены огромный дневной охват трафика регулярная поддержка, мы помогаем вам с открытием вашего сервера л2 с удовольствием !   p.s Модерации если я нарушаю правила - то не специально, перенесите или удалите тему пожалуйста  если все хорошо я очень рад за размещение ❤️ 
    • Играл тоже здесь - хороший сервер Выбирал на анонсере серверов Lineage 2 https://l2-top.ru/
    • As a sidenote, it was added in aCis 408, under //find subcategory : AdminCommands - Revamp //tele panels. - Introduce //find item [name]. Ty melron for initial idea, StinkyMadness/CUCU23 for improvements. - Introduce //find npc [name], delete 6 related admincommands : - admin_show_spawns - admin_spawn_index - admin_spawn_reload - admin_npc_index - admin_spawn_once - admin_show_npcs
    • German Produced Hager Werken Embalming Compound Pink Powder in General it 1kg=R8000 Hager werken embalming powder +27839281381 made in Germany, available in Johannesburg South Africa. Embalming is the art and science of preserving human remains by treating them (in its modern form with chemicals) to forestall decomposition. The intention is to keep them suitable for public display at a funeral, for religious reasons, or for medical and scientific purposes such as their use as anatomical specimens.[1] The three goals of embalming are senitization, presentation and preservation (or restoration). Embalming has a very long and cross-cultural history, with many cultures giving the embalming processes a greater religious meaning. Specific uses are: sanitization, presentation and preservation (or restoration). Types of embalming powder types of embalming powder is dependent on the purity . Purity: 98%, 100% Hot Compound Origin: Germany Brand: Hager Werken PURITY ON COLOR. Pink: 98% White: 100% Hager werken products are sold through the Dental trade worldwide Please contact your pharmacist or dentist. Dealers if you are not currently a Hager werken Customer please contact our Customer Service Distributor direct in south Africa: +27839281381 contact: +27839281381 Email: ivanssente@gmail.com website: https://embalmingpowderfor.wixsite.com/mysite We transport them worldwide by DHL or by post office speed delivery
    • German Produced Hager Werken Embalming Compound Pink Powder in General it 1kg=R8000 Hager werken embalming powder +27839281381 made in Germany, available in Johannesburg South Africa. Embalming is the art and science of preserving human remains by treating them (in its modern form with chemicals) to forestall decomposition. The intention is to keep them suitable for public display at a funeral, for religious reasons, or for medical and scientific purposes such as their use as anatomical specimens.[1] The three goals of embalming are senitization, presentation and preservation (or restoration). Embalming has a very long and cross-cultural history, with many cultures giving the embalming processes a greater religious meaning. Specific uses are: sanitization, presentation and preservation (or restoration). Types of embalming powder types of embalming powder is dependent on the purity . Purity: 98%, 100% Hot Compound Origin: Germany Brand: Hager Werken PURITY ON COLOR. Pink: 98% White: 100% Hager werken products are sold through the Dental trade worldwide Please contact your pharmacist or dentist. Dealers if you are not currently a Hager werken Customer please contact our Customer Service Distributor direct in south Africa: +27839281381 contact: +27839281381 Email: ivanssente@gmail.com website: https://embalmingpowderfor.wixsite.com/mysite We transport them worldwide by DHL or by post office speed delivery
  • Topics

×
×
  • Create New...