Jump to content

Recommended Posts

Posted

.7rb
This command shows you up which Raid Bosses you have killed in Dragon Valley Area and which you haven't. The quest is called ''Legendary Tales'' .It looks like the pictures below.
Tested and Working L2j High Five Chronicle!


fog94i.jpg

2eatlzp.jpg

 

Spoiler

 

diff --git a/Data Side/game/data/scripts/handlers/MasterHandler.java b/Data Side/game/data/scripts/handlers/MasterHandler.java
index e6dde0ef..dc81df32 100644
--- a/Data Side/game/data/scripts/handlers/MasterHandler.java    
+++ b/Data Side/game/data/scripts/handlers/MasterHandler.java    
@@ -284,6 +284,7 @@ import handlers.voicedcommandhandlers.Debug;
 import handlers.voicedcommandhandlers.Lang;
 import handlers.voicedcommandhandlers.StatsVCmd;
 import handlers.voicedcommandhandlers.CombineTalismans;
+import handlers.voicedcommandhandlers.SevenRB;
 import handlers.voicedcommandhandlers.MultiLang;
 import handlers.voicedcommandhandlers.Wedding;
 
@@ -548,6 +549,7 @@ public class MasterHandler
             (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
             (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
+            SevenRB.class,
         },
         {
diff --git a/Data Side/game/data/scripts/handlers/voicedcommandhandlers/SevenRB.java b/Data Side/game/data/scripts/handlers/voicedcommandhandlers/SevenRB.java
--- /dev/null
+++ b/Data Side/game/data/scripts/handlers/voicedcommandhandlers/SevenRB.java    
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2004-2016 L2J DataPack
+ *
+ * This file is part of L2J DataPack.
+ *
+ * L2J DataPack 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.
+ *
+ * L2J DataPack 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.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.quest.QuestState;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+
+/**
+ * Voiced command to show the player which raids have been killed<br>
+ * during Legendary Tales quest (7rb).<br>
+ * <br>
+ * Created for Share Competition 2018.
+ * @author Benman from MaxCheaters.com
+ */
+public class SevenRB implements IVoicedCommandHandler
+{
+    private static final String QUEST_NAME = "Q00254_LegendaryTales";
+    private static final String SERVER_NAME = "(Server Name)";
+    private static final String[] commands =
+    {
+        "7rb",
+    };
+    
+    @Override
+    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
+    {
+        if (command.equalsIgnoreCase("7rb"))
+        {
+            QuestState st = activeChar.getQuestState(QUEST_NAME);
+            NpcHtmlMessage m = new NpcHtmlMessage();
+            m.setHtml(buildHtml(st));
+            activeChar.sendPacket(m);
+        }
+        return true;
+    }
+    
+    private static final String buildHtml(QuestState st)
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append("<html><head>");
+        sb.append("<title>Lineage II " + SERVER_NAME + "</title>");
+        sb.append("</head>");
+        sb.append("<body><br>");
+        sb.append("<br>7 Rb Quest (Legendary Tales) status:<br>");
+        if (st == null)
+        {
+            sb.append("Quest is not started yet. Please visit Glimore in dragon valley in order to start it.");
+            sb.append("<br>");
+        }
+        else
+        {
+            if (st.isCond(1))
+            {
+                for (Bosses boss : Bosses.class.getEnumConstants())
+                {
+                    sb.append(boss.getName() + ": ");
+                    sb.append(checkMask(st, boss) ? "<font color=\"00FF00\">Killed.</font>" : "<font color=\"FF0000\">Not killed.</font>");
+                    sb.append("<br>");
+                }
+            }
+            else
+            {
+                sb.append("Legendary Tales quest is completed.");
+                sb.append("<br>");
+            }
+        }
+        sb.append("</body></html>");
+        return sb.toString();
+    }
+    
+    private static boolean checkMask(QuestState qs, Bosses boss)
+    {
+        int pos = boss.getMask();
+        return ((qs.getInt("raids") & pos) == pos);
+    }
+    
+    @Override
+    public String[] getVoicedCommandList()
+    {
+        return commands;
+    }
+    
+    public static enum Bosses
+    {
+        EMERALD_HORN("Emerald Horn"),
+        DUST_RIDER("Dust Rider"),
+        BLEEDING_FLY("Bleeding Fly"),
+        BLACK_DAGGER("Blackdagger Wing"),
+        SHADOW_SUMMONER("Shadow Summoner"),
+        SPIKE_SLASHER("Spike Slasher"),
+        MUSCLE_BOMBER("Muscle Bomber");
+        
+        private final String name;
+        private final int _mask;
+        
+        private Bosses(String name)
+        {
+            this.name = name;
+            _mask = 1 << ordinal();
+        }
+        
+        public int getMask()
+        {
+            return _mask;
+        }
+        
+        public String getName()
+        {
+            return name;
+        }
+    }
+}

 

 

 

  • Thanks 1
Posted
5 hours ago, Rengo said:

nice share mate

 

1 hour ago, Solomun said:

Nice idea aswell benman. Thanks for sharing these...

Thank you too both!

  • 2 years later...
Posted
package handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;

public class SevenRB implements IVoicedCommandHandler
{
	private static final String QUEST_NAME = "Q00254_LegendaryTales";
	  private static final String SERVER_NAME = "(NAME)";
	  private static final String[] commands =
		  {
				  "7rb",
		  };
	  
	  @Override
	  public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
	  {
		  if (command.equalsIgnoreCase("7rb"))
		  {
			  QuestState st = activeChar.getQuestState(QUEST_NAME);
			  NpcHtmlMessage m = new NpcHtmlMessage();
			  m.setHtml(buildHtml(st));
			  activeChar.sendPacket(m);
		  }
		  return true;
	  }
	  
	  private static final String buildHtml(QuestState st)
	  { 
		  StringBuilder sb = new StringBuilder();
		  sb.append("<html><head>");
		  sb.append("<title>" + SERVER_NAME + "</title>");
		  sb.append("</head>");
		  sb.append("<body><br>");
		  sb.append("<br>7Rb Quest (Legendary Tales) status:<br>");
		  if (st == null)
		  {
			  sb.append("Quest is not started yet. Please visit Glimore in dragon valley in order to start it.");
			  sb.append("<br>");
		  }
		  else
		  {
			  if (st.isCond(1))
			  {
				  for (Bosses boss : Bosses.class.getEnumConstants())
				  {
					  sb.append(boss.getName() + ": ");
					  sb.append(checkMask(st, boss) ? "<font color=\"00FF00\">Killed.</font>" : "<font color=\"FF0000\">Not killed.</font>");
					  sb.append("<br>");
				  }
			  }
			  else
			  {
				  sb.append("Legendary Tales quest is completed.");
				  sb.append("<br>");
			  }
		  }
		  sb.append("</body></html>");
		  return sb.toString();
	  }
	  
	  private static boolean checkMask(QuestState qs, Bosses boss)
	  {
		  int pos = boss.getMask();
		  return ((qs.getInt("raids") & pos) == pos);
	  }
	  @Override
	  public String[] getVoicedCommandList()
	  {
		  return commands;
	  }
	  
	  public static enum Bosses
	  {
		  EMERALD_HORN("Emerald Horn"),
		  DUST_RIDER("Dust Rider"),
		  BLEEDING_FLY("Bleeding Fly"),
		  BLACK_DAGGER("Blackdagger Wing"),
		  SHADOW_SUMMONER("Shadow Summoner"),
		  SPIKE_SLASHER("Spike Slasher"),
		  MUSCLE_BOMBER("Muscle Bomber");
		  
		  private final String name;
		  private final int _mask;
		  
		  private Bosses(String name)
		  {
			  this.name = name;
			  _mask = 1 << ordinal();
		  }
		  
		  public int getMask()
		  {
			  return _mask;
		  }
		  
		  public String getName()
		  {
			  return name;
		  }
	  }
}

Sorry but i needed to make it look right xD

  • Haha 1
  • 10 months later...
  • 4 months later...
Posted
On 11/7/2021 at 12:20 AM, barao45 said:

Do you know if its required another think to implements this voice comander?. im using L2jSunrise.

When i enter .7rb its nothing happen.

package handlers.voicedcommandhandlers;

import l2r.gameserver.handler.IVoicedCommandHandler;
import l2r.gameserver.model.actor.instance.L2PcInstance;
import l2r.gameserver.model.quest.QuestState;
import l2r.gameserver.network.serverpackets.NpcHtmlMessage;

/**
 * @author -Invoke
 */

public class CommandRaid implements IVoicedCommandHandler
{
    private static final String QUEST_NAME = "Q00254_LegendaryTales";
    private static final String SERVER_NAME = "7RB Quest";
    private static final String[] COMMANDS =
    {
        "7rb",
    };
    
    @Override
    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
    {
        if (command.equalsIgnoreCase("7rb"))
        {
            QuestState state = activeChar.getQuestState(QUEST_NAME);
            NpcHtmlMessage html = new NpcHtmlMessage();
            html.setHtml(buildHtml(state));
            activeChar.sendPacket(html);
        }
        return true;
    }
    
    private static final String buildHtml(QuestState st)
    {
        StringBuilder sb = new StringBuilder();
        sb.append("<html noscrollbar><head>");
        sb.append("<title>" + SERVER_NAME + "</title>");
        sb.append("</head>");
        sb.append("<body><br>");
        sb.append("<br>7 Rb Quest (Legendary Tales) status:<br>");
        if (st == null)
        {
            sb.append("Quest not found. Please visit Glimore in Dragon Valley in order to begin the quest.");
            sb.append("<br>");
        }
        else
        {
            if (st.isCond(1))
            {
                for (Bosses boss : Bosses.class.getEnumConstants())
                {
                    sb.append(boss.getName() + ": ");
                    sb.append(checkMask(st, boss) ? "<font color=\"00FF00\">Killed.</font>" : "<font color=\"FF0000\">Not killed.</font>");
                    sb.append("<br>");
                }
            }
            else
            {
                sb.append("Legendary Tales quest is completed.");
                sb.append("<br>");
            }
        }
        sb.append("</body></html>
On 11/7/2021 at 12:20 AM, barao45 said:

Do you know if its required another think to implements this voice comander?. im using L2jSunrise.

When i enter .7rb its nothing happen.

Make here "L2J_SunriseProject_Data\dist\game\data\scripts\handlers\voicedcommandhandlers\CommandRaid.java"
Paste the code above

Add it here "L2J_SunriseProject_Data\dist\game\data\scripts\handlers\MasterHandler.java"

"import handlers.voicedcommandhandlers.CommandRaid;"

and compile.

It should work from all chars using the .7rb command

12.02.2021-22.42.58

 

  • 9 months later...
Posted
On 1/1/2021 at 6:52 AM, JackCerutti said:
package handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;

public class SevenRB implements IVoicedCommandHandler
{
	private static final String QUEST_NAME = "Q00254_LegendaryTales";
	  private static final String SERVER_NAME = "(NAME)";
	  private static final String[] commands =
		  {
				  "7rb",
		  };
	  
	  @Override
	  public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
	  {
		  if (command.equalsIgnoreCase("7rb"))
		  {
			  QuestState st = activeChar.getQuestState(QUEST_NAME);
			  NpcHtmlMessage m = new NpcHtmlMessage();
			  m.setHtml(buildHtml(st));
			  activeChar.sendPacket(m);
		  }
		  return true;
	  }
	  
	  private static final String buildHtml(QuestState st)
	  { 
		  StringBuilder sb = new StringBuilder();
		  sb.append("<html><head>");
		  sb.append("<title>" + SERVER_NAME + "</title>");
		  sb.append("</head>");
		  sb.append("<body><br>");
		  sb.append("<br>7Rb Quest (Legendary Tales) status:<br>");
		  if (st == null)
		  {
			  sb.append("Quest is not started yet. Please visit Glimore in dragon valley in order to start it.");
			  sb.append("<br>");
		  }
		  else
		  {
			  if (st.isCond(1))
			  {
				  for (Bosses boss : Bosses.class.getEnumConstants())
				  {
					  sb.append(boss.getName() + ": ");
					  sb.append(checkMask(st, boss) ? "<font color=\"00FF00\">Killed.</font>" : "<font color=\"FF0000\">Not killed.</font>");
					  sb.append("<br>");
				  }
			  }
			  else
			  {
				  sb.append("Legendary Tales quest is completed.");
				  sb.append("<br>");
			  }
		  }
		  sb.append("</body></html>");
		  return sb.toString();
	  }
	  
	  private static boolean checkMask(QuestState qs, Bosses boss)
	  {
		  int pos = boss.getMask();
		  return ((qs.getInt("raids") & pos) == pos);
	  }
	  @Override
	  public String[] getVoicedCommandList()
	  {
		  return commands;
	  }
	  
	  public static enum Bosses
	  {
		  EMERALD_HORN("Emerald Horn"),
		  DUST_RIDER("Dust Rider"),
		  BLEEDING_FLY("Bleeding Fly"),
		  BLACK_DAGGER("Blackdagger Wing"),
		  SHADOW_SUMMONER("Shadow Summoner"),
		  SPIKE_SLASHER("Spike Slasher"),
		  MUSCLE_BOMBER("Muscle Bomber");
		  
		  private final String name;
		  private final int _mask;
		  
		  private Bosses(String name)
		  {
			  this.name = name;
			  _mask = 1 << ordinal();
		  }
		  
		  public int getMask()
		  {
			  return _mask;
		  }
		  
		  public String getName()
		  {
			  return name;
		  }
	  }
}

Sorry but i needed to make it look right xD

I can't use these commands for Fandc pack. do you have? or share please.

  • 1 month later...
Posted

Hello. Please guys, if you could help.  I am trying to implement .7rb command for sunrise but i get this error :

WARNING in C:\L2 Server\game\data\scripts\handlers\MasterHandler.java (at line 313)
        import handlers.voicedcommandhandlers.CommandRaid;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import handlers.voicedcommandhandlers.CommandRaid is never used
WARNING in C:\L2 Server\game\data\scripts\handlers\voicedcommandhandlers\CommandRaid.java (at line 16)
        private static final String[] COMMANDS =
                                      ^^^^^^^^
The value of the field CommandRaid.COMMANDS is not used
----------
ERROR in C:\L2 Server\game\data\scripts\handlers\voicedcommandhandlers\CommandRaid.java (at line 76)
        return commands;
               ^^^^^^^^
commands cannot be resolved to a variable

 

I got the first code with the 2nd code fix, for Sunrise.

Thank you

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...