Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Mod Ofensiva / Defensivo

Iniciado por Swarlog, Jul 26, 2025, 11:29 PM

Tema anterior - Siguiente tema

Swarlog

CitarCORE:

### Eclipse Workspace Patch 1.0
#P L2_GameServer
Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java	(revision 3813)
+++ java/com/l2jserver/Config.java	(working copy)
@@ -647,6 +659,14 @@
 	public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
 	public static String ANNOUNCE_PK_MSG;
 	public static String ANNOUNCE_PVP_MSG;
+   public static boolean ALLOW_SPECIAL_VOICED_COMMANDS;
 
 	//--------------------------------------------------
 	// NPC Settings
@@ -2135,6 +2178,8 @@
 					ANNOUNCE_PK_MSG = L2JModSettings.getProperty("AnnouncePkMsg", "$killer has slaughtered $target");
 					ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target");
 					
+                   ALLOW_SPECIAL_VOICED_COMMANDS = Boolean.parseBoolean(L2JModSettings.getProperty("AllowSpecialVoicedCommands", "False"));
+					
 				}
 				catch (Exception e)
 				{
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 3813)
+++ java/config/l2jmods.properties	(working copy)
@@ -319,4 +350,61 @@
 
 # Pvp message template
 # variables: $killer, $target
-AnnouncePvpMsg = $killer has defeated $target
\ No newline at end of file
+AnnouncePvpMsg = $killer has defeated $target
+# ---------------------------------------------------------------------------
+# Special Commands
+# ---------------------------------------------------------------------------
+# Allow Special commands?
+# Usage: .offensive, .defensive, .normal
+# Offensive: +20% P/M.Atk -20% P/M.Def
+# Defensive: -20% P/M.Atk +20% P/M.Def
+# Normal: Back to normal mode.
+# Default: False
+AllowSpecialVoicedCommands = False	
\ No newline at end of file

CitarDATA:

### Eclipse Workspace Patch 1.0
#P datapack_development
Index: data/stats/skills/9000-9099.xml
===================================================================
--- data/stats/skills/9000-9099.xml	(revision 6891)
+++ data/stats/skills/9000-9099.xml	(working copy)
@@ -226,4 +226,30 @@
 		<set name="skillType" val="NOTDONE" />
 		<set name="operateType" val="OP_PASSIVE" />
 	</skill>
+	<skill id="9098" levels="1" name="Offensive">
+	    <set name="target" val="TARGET_SELF" />
+	    <set name="skillType" val="CONT" />
+	    <set name="operateType" val="OP_TOGGLE" />
+	    <for>
+	    <effect name="Buff" time="144000" val="0" noicon="1">
+	    <mul order="0x30" stat="pAtk" val="1.20" />
+	    <mul order="0x30" stat="mAtk" val="1.20" />
+	    <mul order="0x30" stat="pDef" val="0.80" />
+	    <mul order="0x30" stat="mDef" val="0.80" />
+	    </effect>
+	    </for>
+	 </skill>
+	 <skill id="9099" levels="1" name="Defensive">
+	    <set name="target" val="TARGET_SELF" />
+	    <set name="skillType" val="CONT" />
+	    <set name="operateType" val="OP_TOGGLE" />
+	    <for>
+	    <effect name="Buff" time="144000" val="0" noicon="1">
+	    <mul order="0x30" stat="pAtk" val="0.80" />
+	    <mul order="0x30" stat="mAtk" val="0.80" />
+	    <mul order="0x30" stat="pDef" val="1.20" />
+	    <mul order="0x30" stat="mDef" val="1.20" />
+	    </effect>
+	    </for>
+	  </skill>
 </list>
\ No newline at end of file
Index: data/scripts/handlers/MasterHandler.java
===================================================================
--- data/scripts/handlers/MasterHandler.java	(revision 6891)
+++ data/scripts/handlers/MasterHandler.java	(working copy)
@@ -225,12 +227,18 @@
 	private static void loadVoicedHandlers()
 	{
 		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());
 		if (Config.L2JMOD_ALLOW_WEDDING)
 			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());
 		if (Config.BANKING_SYSTEM_ENABLED)
 			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Banking());
 		if (Config.TVT_ALLOW_VOICED_COMMAND)
 			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new TvTVoicedInfo());
+		if (Config.ALLOW_SPECIAL_VOICED_COMMANDS)
+ 	 		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new SpecialVoiced());
 		_log.config("Loaded " + VoicedCommandHandler.getInstance().size() + " VoicedHandlers");
 	}
 	
Index: data/scripts/handlers/voicedcommandhandlers/SpecialVoiced.java
===================================================================
--- data/scripts/handlers/voicedcommandhandlers/SpecialVoiced.java	(revision 0)
+++ data/scripts/handlers/voicedcommandhandlers/SpecialVoiced.java	(revision 0)
@@ -0,0 +1,67 @@
+/*
+ * 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 handlers.voicedcommandhandlers;
+
+import com.l2jserver.gameserver.datatables.SkillTable;
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.L2Effect;
+import com.l2jserver.gameserver.model.L2Skill;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+public class SpecialVoiced implements IVoicedCommandHandler
+{
+	private static final String[] VOICED_COMMANDS = {
+		"offensive",
+		"defensive", 
+		"normal"
+	};
+
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+	{
+		if (command.equalsIgnoreCase("offensive"))
+		{
+			activeChar.stopSkillEffects(9098);
+			L2Skill offensiveSkill = SkillTable.getInstance().getInfo(9098, 1);
+			activeChar.doSimultaneousCast(offensiveSkill);
+			activeChar.sendMessage("You are in offensive mode.");
+		}
+		else if (command.equalsIgnoreCase("defensive"))
+		{
+			activeChar.stopSkillEffects(9099);
+			L2Skill deffensiveSkill = SkillTable.getInstance().getInfo(9099, 1);
+			activeChar.doSimultaneousCast(deffensiveSkill);
+			activeChar.sendMessage("You are in defensive mode.");
+		}
+		else if (command.equalsIgnoreCase("normal"))
+		{
+			if (activeChar != null)
+			{
+				L2Effect[] effects = activeChar.getAllEffects();
+
+				for (L2Effect e : effects) {
+					if ((e != null) && (e.getSkill().getId() == 9098) || (e.getSkill().getId() == 9099))
+						e.exit();
+				}
+				activeChar.sendMessage("You are in normal mode.");
+			}
+		}
+		return true;
+	}
+
+	public String[] getVoicedCommandList()
+	{
+		return VOICED_COMMANDS;
+	}
+}
\ No newline at end of file

By: MX