Offensive - Defensive mod.

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
MeisterLampe
Posts: 14
Joined: Wed Dec 12, 2007 9:40 pm

Offensive - Defensive mod.

Post by MeisterLampe »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4092:
L2JDP Revision 7288:



Hi i found this Mod /viewtopic.php?f=73&t=15202&p=75622&hilit=offensive#p75622
You can type
.offensive +XX mAtk,pAtk -XX mDef,pDef
.defensive +XX mDef,pDef -XX mAtk,pAtk
.normal normal stats

I have apply the patches all works compile and start the server
i type .offensive

Nothing happens :)
someone can help me to understand this patches to patch it or can fix it with me?

Core.diff

Code: Select all

 ### Eclipse Workspace Patch 1.0#P L2_GameServerIndex: 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 
Datapack.diff

Code: Select all

### Eclipse Workspace Patch 1.0#P datapack_developmentIndex: 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 fileIndex: 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 
sry for my english :)
Lee
Posts: 102
Joined: Wed Sep 02, 2009 11:10 pm

Re: Offensive - Defensive mod.

Post by Lee »

Did you register the voiced command?
MeisterLampe
Posts: 14
Joined: Wed Dec 12, 2007 9:40 pm

Re: Offensive - Defensive mod.

Post by MeisterLampe »

Hmm bug? Someone can fix?
if (Config.ALLOW_SPECIAL_VOICED_COMMANDS)
VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new SpecialVoiced());
In config AllowSpecialVoicedCommands = True
Didnt work!

but if i (register the SpecialVoiced to the Banking System to load it too) add this line

if (Config.BANKING_SYSTEM_ENABLED)
VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Banking());
+ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new SpecialVoiced());
In config BankingSystemEnabled = True
It works -.- why? it didnt work at the normal Register as .ALLOW_SPECIAL_VOICED_COMMANDS ?

why? someone can help?
Post Reply