Autor Tema: [Comando] .expoff / .expon  (Leído 1274 veces)

Abril 25, 2016, 06:07:38 pm

Desconectado Jerry

  • Vips
  • Usuario
  • *
  • Mensajes: 125
  • Karma: 0
  • Sexo: Masculino
Citar
CORE:

Código: You are not allowed to view links. Register or Login
Index: java/com/l2jserver/gameserver/model/actor/stat/PcStat.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/stat/PcStat.java (revision 5757)
+++ java/com/l2jserver/gameserver/model/actor/stat/PcStat.java (working copy)
@@ -82,6 +82,12 @@
  {
  return false;
  }
+
+ // Check, if exp gain isn't disabled by voiced command
+ if (activeChar.canOverrideCond(PcCondOverride.DISABLE_EXP_GAIN))
+ {
+ return false;
+ }
 
  if (!super.addExp(value))
  {
@@ -133,7 +139,13 @@
  {
  return false;
  }
-
+
+ // Check, if exp gain isn't disabled by voiced command
+ if (activeChar.canOverrideCond(PcCondOverride.DISABLE_EXP_GAIN))
+ {
+ addToExp = 0;
+ }
+
  long baseExp = addToExp;
  int baseSp = addToSp;
 
Index: java/com/l2jserver/gameserver/model/PcCondOverride.java
===================================================================
--- java/com/l2jserver/gameserver/model/PcCondOverride.java (revision 5757)
+++ java/com/l2jserver/gameserver/model/PcCondOverride.java (working copy)
@@ -38,7 +38,8 @@
  DESTROY_ALL_ITEMS(12, "Overrides item destroy conditions"),
  SEE_ALL_PLAYERS(13, "Overrides the conditions to see hidden players"),
  TARGET_ALL(14, "Overrides target conditions"),
- DROP_ALL_ITEMS(15, "Overrides item drop conditions");
+ DROP_ALL_ITEMS(15, "Overrides item drop conditions"),
+ DISABLE_EXP_GAIN(16, "Disables experience gain");
 
  private final int _mask;
  private final String _descr;

Citar
DATA:

Código: You are not allowed to view links. Register or Login
Index: dist/game/data/scripts/handlers/MasterHandler.java
===================================================================
--- dist/game/data/scripts/handlers/MasterHandler.java (revision 9395)
+++ dist/game/data/scripts/handlers/MasterHandler.java (working copy)
@@ -315,6 +315,7 @@
 import handlers.voicedcommandhandlers.Lang;
 import handlers.voicedcommandhandlers.StatsVCmd;
 import handlers.voicedcommandhandlers.TvTVoicedInfo;
+import handlers.voicedcommandhandlers.UserOptions;
 import handlers.voicedcommandhandlers.Wedding;
 
 /**
@@ -601,6 +602,7 @@
  {
  // Voiced Command Handlers
  StatsVCmd.class,
+ UserOptions.class,
  // TODO: Add configuration options for this voiced commands:
  // CastleVCmd.class,
  // SetVCmd.class,
Index: dist/game/data/scripts/handlers/voicedcommandhandlers/UserOptions.java
===================================================================
--- dist/game/data/scripts/handlers/voicedcommandhandlers/UserOptions.java (revision 0)
+++ dist/game/data/scripts/handlers/voicedcommandhandlers/UserOptions.java (working copy)
@@ -0,0 +1,44 @@
+package handlers.voicedcommandhandlers;
+
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.PcCondOverride;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author GKR, Mr.Deff
+ */
+public class UserOptions implements IVoicedCommandHandler
+{
+ private static final String[] _voicedCommands =
+ {
+ "expon",
+ "expoff",
+ };
+
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+ if (activeChar == null)
+ {
+ return false;
+ }
+
+ switch(command)
+ {
+ case "expoff":
+ activeChar.addOverrideCond(PcCondOverride.DISABLE_EXP_GAIN);
+ activeChar.sendMessage("Exp gain disabled.");
+ break;
+ case "expon":
+ activeChar.removeOverridedCond(PcCondOverride.DISABLE_EXP_GAIN);
+ activeChar.sendMessage("Exp gain restored.");
+ break;
+ }
+
+ return true;
+ }
+
+ public String[] getVoicedCommandList()
+ {
+ return _voicedCommands;
+ }
+}

Febrero 05, 2019, 06:51:57 pm
Respuesta #1

Desconectado medinso33

  • Usuario
  • *
  • Mensajes: 1
  • Karma: 0
HOLA AMIGO UNA PREGUNTA EN QUE PARTE VAN ESAS LINEAS DE CODIGO DAME LA RUTA

Febrero 09, 2019, 05:33:12 pm
Respuesta #2

Conectado swarlog

  • Desarrollador
  • Usuario
  • *
  • Mensajes: 1.585
  • Karma: 3
  • Sexo: Masculino
    • U3Games
lo pone en cada parche arriba, ejemplo:

Código: You are not allowed to view links. Register or Login
Index: java/com/l2jserver/gameserver/model/actor/stat/PcStat.java
eso te indica la ruta a tratar, en este caso es dentro del core si no lo tienes compilado.