resuse
Posted: Mon Nov 02, 2009 4:57 pm
admin command to reset skill's reuse time? im ask for this guys 

Create the command by useing this method.remla wrote:admin command to reset skill's reuse time? im ask for this guys
Code: Select all
player.enableSkill([b]skillId[/b]);
Code: Select all
// enable skills with cool time <= 15 minutesfor (L2Skill skill : player.getAllSkills()) if (skill.getReuseDelay() <= 900000) player.enableSkill(skill.getId());
Code: Select all
Index: E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/voicedcommandhandlers/reuse.java===================================================================--- E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/voicedcommandhandlers/reuse.java (revision 0)+++ E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/voicedcommandhandlers/reuse.java (revision 0)@@ -0,0 +1,53 @@+/*+ * 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 net.sf.l2j.gameserver.handler.IVoicedCommandHandler;+import net.sf.l2j.gameserver.model.L2Skill;+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;+import net.sf.l2j.gameserver.network.serverpackets.SkillCoolTime;++/**+ * This class resets the cooltime of all skills.+ *+ * @author Cypher+ */++public class reuse implements IVoicedCommandHandler+{+ private static final String[] _voicedCommands =+ {+ "reuse"+ };+ + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)+ {+ if (command.equalsIgnoreCase("reuse"))+ {+ for (L2Skill skill : activeChar.getAllSkills())+ activeChar.enableSkill(skill.getId());+ activeChar.sendSkillList();+ activeChar.sendPacket(new SkillCoolTime(activeChar));+ activeChar.sendMessage("Skills cooltime removed!");+ }+ return true;+ }++ public String[] getVoicedCommandList()+ {+ return _voicedCommands;+ }+}\ No newline at end of fileIndex: E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/MasterHandler.java===================================================================--- E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/MasterHandler.java (revision 6775)+++ E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/MasterHandler.java (working copy)@@ -221,6 +221,7 @@ private static void loadVoicedHandlers() { VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());+ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new reuse()); if (Config.L2JMOD_ALLOW_WEDDING) VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding()); if (Config.BANKING_SYSTEM_ENABLED)\ No newline at end of file
Why wouldn't you make this an admin command? As you have it set up any player could use it.iamcypher wrote:Hello,
This command is used for testing purpoces. Players can`t use what they don`t know.
iamcypher.
Edit: Reading code:
Code: Select all
Index: E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/voicedcommandhandlers/reuse.java===================================================================--- E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/voicedcommandhandlers/reuse.java (revision 0)+++ E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/voicedcommandhandlers/reuse.java (revision 0)@@ -0,0 +1,53 @@+/*+ * 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 net.sf.l2j.gameserver.handler.IVoicedCommandHandler;+import net.sf.l2j.gameserver.model.L2Skill;+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;+import net.sf.l2j.gameserver.network.serverpackets.SkillCoolTime;++/**+ * This class resets the cooltime of all skills.+ *+ * @author Cypher+ */++public class reuse implements IVoicedCommandHandler+{+ private static final String[] _voicedCommands =+ {+ "reuse"+ };+ + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)+ {+ if (command.equalsIgnoreCase("reuse"))+ {+ for (L2Skill skill : activeChar.getAllSkills())+ activeChar.enableSkill(skill.getId());+ activeChar.sendSkillList();+ activeChar.sendPacket(new SkillCoolTime(activeChar));+ activeChar.sendMessage("Skills cooltime removed!");+ }+ return true;+ }++ public String[] getVoicedCommandList()+ {+ return _voicedCommands;+ }+}\ No newline at end of fileIndex: E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/MasterHandler.java===================================================================--- E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/MasterHandler.java (revision 6775)+++ E:/Projects/L2/Coding/eclipse/work/Clean Datapack/trunk/datapack_development/data/scripts/handlers/MasterHandler.java (working copy)@@ -221,6 +221,7 @@ private static void loadVoicedHandlers() { VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());+ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new reuse()); if (Config.L2JMOD_ALLOW_WEDDING) VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding()); if (Config.BANKING_SYSTEM_ENABLED)\ No newline at end of file