Jump to content

Question

Posted (edited)

I need some help with 2 comands in game: 

.offensive

.defensive

 

here is the skills:

http://pastebin.com/CbkgKkSR

 

Here is the Voiced Comand:

 

http://pastebin.com/3J4Cssb1

 

 

and here is a video explaining what im experiencing:

https://copy.com/8g3GgfREPW0Y

 

basically, when i type .offensive or .diffensive

the effect last just few seconds, but i need it to last forever or untill the player restarts or the server restarts.

 

I would like to thank in advance whoever will help me.

 

I've tried different types of conditions and settings for the skills, but all gives the same result, i fear its a Java problem?

please help!

Edited by A-Style

12 answers to this question

Recommended Posts

  • 0
Posted
        if (command.equalsIgnoreCase("offensive"))

        {

            activeChar.stopSkillEffects(26075);

            L2Skill offensive;

            offensive = SkillTable.getInstance().getInfo(26074, 1);

            offensive.getEffects(activeChar, activeChar);

            activeChar.sendMessage("You are in offensive mode.");

        }

        else if (command.equalsIgnoreCase("defensive"))

        {

            activeChar.stopSkillEffects(26074);

            L2Skill deffensive;

            deffensive = SkillTable.getInstance().getInfo(26075, 1);

            deffensive.getEffects(activeChar, activeChar);

            activeChar.sendMessage("You are in defensive mode.");

        }

Try like that.

  • 0
Posted

Try to make it as a toogle skill.

 

on the first skill, .offensive its on toggle . <set name="operateType" val="T" />

which is the new standard typos for the latest L2J Hi5.

 

dunno what else to try.

 

 

Cobra: Its not about hitTime, its about the effect it gives and disapears after few seconds....

  • 0
Posted (edited)

Oh, I didn't knew that. Well, so maybe show us the code. Or at least the piece where it's applying the buff / take it off.

 

Btw, the movie can be just downloaded and I'm lazy to do it. Next time upload it where we can watch it :D or it's just me.. "Your browser cannot play this file" :rage:

Edited by SweeTs
  • 0
Posted

Oh, I didn't knew that. Well, so maybe show us the code. Or at least the piece where it's applying the buff / take it off.

 

Btw, the movie can be just downloaded and I'm lazy to do it. Next time upload it where we can watch it :D or it's just me.. "Your browser cannot play this file" :rage:

 

the code is already in the 1st post.

 

 

anyway this is the code shared on l2jforums : I've tried to adapt it to the latest hi5 release:

 

Core:

### 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

DP: 

### 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

  • 0
Posted

Well, I don't use H5 so dunno how works dat doSimultaneousCast.. So, try like that. Make the skill toogle and change it to activeChar.doCast(offensiveSkill); - Interlude way :D

 

Also, from my pov dat looks kinda weird

activeChar.stopSkillEffects(26074);
L2Skill offensiveSkill = SkillTable.getInstance().getInfo(26074, 1);
Stop and launch ? :-\
I mean, shouldn't dat stopSkillEffects from defense if active and then launch offensive? I think dat was supposed to be.. Or try to delete dat line about stopSkillEffects and see if this cause the problem or not.
 
Or make it like that
 
L2Skill offensiveSkill = SkillTable.getInstance().getInfo(26074, 1);
activeChar.doSimultaneousCast(offensiveSkill);
 
to
 
L2Skill offensive;
offensive = SkillTable.getInstance().getInfo(26074, 1);
offensive.getEffects(activeChar, activeChar);
 

Some advices how I would do that, I guess.. :P

  • 0
Posted

your Edit, and this modification made the trick : http://pastebin.com/ChPtRhSJ

Now its working stable, I might try to use the previous version, the one I was using, maybe works with these setup of skill model.

 

thanks for the moment!

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock