Ir para conteúdo
  • Cadastre-se
  • 0

raidinfo command problema l2jfrozen1132


Kef95

Pergunta

Hello everyone, use this code for ".raidinfo" voicecommand. L2jfrozen 1132

Spoiler

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src / com / l2jfrozen / gameserver / handler / VoicedCommandHandler.java
======================= ============================================
--- head-src /com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java (revision 1132)
+++ head-src / com / l2jfrozen / gameserver / handler / VoicedCommandHandler.java (working copy)
@@ -33.6 +33.7 @@
 import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.CTFCmd;
 import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.DMCmd;
 import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
+ import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.GrandBossSpawn;
 import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.OfflineShop;
 import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
 import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
@@ -68.6 +69.7 @@
  _datatable = new FastMap <> ();
  
  registerVoicedCommandHandler (new Voting ());
+ registerVoicedCommandHandler (new GrandBossSpawn ());
  
  if (Config.BANKING_SYSTEM_ENABLED)
  {
Index: head-src / com / l2jfrozen / gameserver / handler / voicedcommandhandlers / GrandBossSpawn.java
======================== ===========================================
--- head-src / com / l2jfrozen / gameserver / handler / voicedcommandhandlers / GrandBossSpawn.java (nonexistent)
+++ head-src / com / l2jfrozen / gameserver / handler / voicedcommandhandlers / GrandBossSpawn.java (working copy)
@@ -0.0 +1,106 @@
+
+ package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+ import java.util.logging.Logger;
+
+ import com.l2jfrozen.Config;
+ import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+ import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+ import com.l2jfrozen.gameserver.managers.GrandBossManager;
+ import com.l2jfrozen.gameserver.managers.RaidBossSpawnManager;
+ import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+ import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
+ import com.l2jfrozen.gameserver.powerpak.RaidInfo.RaidInfoHandler;
+ import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+ import com.l2jfrozen.gameserver.templates.StatsSet;
+
+ import javolution.text.TextBuilder;
+
+ public class GrandBossSpawn implements IVoicedCommandHandler
+ {
+ private static Logger _log = Logger.getLogger (RaidInfoHandler.class.getName ());
+ private static final String [] _voicedCommands = 
+ { 
+ "raidinfo" 
+};

+ @Override
+ public boolean useVoicedCommand (String command, L2PcInstance activeChar, String target)
+ {
+ if (command.startsWith ("raidinfo")) 
+ {
+ showMainPage (activeChar);
+}
+
+ return true;
+}
+
+ private static void showMainPage (L2PcInstance activeChar)
+ {
+ TextBuilder tb = new TextBuilder ();
+ tb.append ("<html> <title> Boss Spawn </title> <body> <center>");
+ tb.append ("<img src = \" L2UI_CH3.herotower_deco \ "width = 256 height = 32> <br>");
+ tb.append ("Epic's Boss respawn time <br>");
+ tb.append ("<img src = \" sek.cbui32 \ "width = 210 height = 1> <br>");
+        
+ for (int boss: Config.RAID_INFO_IDS_LIST)
+ {
+ String name = "";

+ if ((template = NpcTable.getInstance (). getTemplate (boss))! = null) {
+ name = template.getName ();
+}
+ else
+ {
+ _log.warning ("[RaidInfoHandler] [sendInfo] Raid Boss with ID" + boss + "is not defined into NpcTable");
+ continue;
+}

+ StatsSet actual_boss_stat = null;
+ GrandBossManager.getInstance (). GetStatsSet (boss);
+ long delay = 0;

+ if (NpcTable.getInstance (). getTemplate (boss) .type.equals ("L2RaidBoss"))
+ {
+ actual_boss_stat = RaidBossSpawnManager.getInstance (). getStatsSet (boss);
+ if (actual_boss_stat! = null)
+ delay = actual_boss_stat.getLong ("respawnTime");
+}
+ else if (NpcTable.getInstance (). getTemplate (boss) .type.equals ("L2GrandBoss"))
+ {
+ actual_boss_stat = GrandBossManager.getInstance (). getStatsSet (boss);
+ if (actual_boss_stat! = null)
+ delay = actual_boss_stat.getLong ("respawn_time");
+}
+ else
+ continue;

+ if (delay <= System.currentTimeMillis ())
+ {
+ tb.append ("<font color = \" 00C3FF \ ">" + name + "</font>:" + "<font color = \" 9CC300 \ "> Is Alive </font>" + "<br1>");
+}
+ else
+ {
+ int hours = (int) ((delay - System.currentTimeMillis ()) / 1000/60/60);

+ int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis ()) / 1000);
+ tb.append ("<font color = \" 00C3FF \ ">" + name + "</font>" + "<font color = \" FFFFFF \ ">" + "" + "Respawn in: </ font > "+" "+" <font color = \ "32C332 \"> "+ hours +": "+ mins +": "+ seconts +" </font> <br1> ");
+}
+}

+ tb.append ("<img src = \" sek.cbui32 \ "width = 210 height = 1> <br>");
+ tb.append ("<img src = \" L2UI_CH3.herotower_deco \ "width = 256 height = 32>");
+ tb.append ("</center> </body> </html>

but I have many mistakes in this code 

https://ibb.co/p4T9nLZ
https://ibb.co/rdkCczM

 

any help?

Editado por Kef95
Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts recomendados


  • 0
1 hora atrás, Kef95 disse:

up

test

Spoiler

package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;

import java.util.logging.Logger;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.managers.GrandBossManager;
import com.l2jfrozen.gameserver.managers.RaidBossSpawnManager;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.gameserver.templates.StatsSet;

import javolution.text.TextBuilder;

public class GrandBossSpawn implements IVoicedCommandHandler
{
 private static final String[] _voicedCommands = 
 { 
 "raidinfo" 
 };
 
 @Override
 public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
 {
         if (command.startsWith("raidinfo")) 
         {
             showMainPage(activeChar);
         }

      return true;
 }

    private static void showMainPage(L2PcInstance activeChar)
 {
 TextBuilder tb = new TextBuilder();
 tb.append("<html><title>Boss Spawn</title><body><center>");
 tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");
 tb.append("Epic's Boss respawn time<br>");
        tb.append("<img src=\"sek.cbui32\" width=210 height=1><br>");
        
 for(int boss : Config.RAID_INFO_IDS_LIST)
 {
 String name = "";
 L2NpcTemplate template = null;
 if((template = NpcTable.getInstance().getTemplate(boss)) != null){
 name = template.getName();
 }
 else
 {

 continue;
 }
 
 StatsSet actual_boss_stat = null;
 GrandBossManager.getInstance().getStatsSet(boss);
 long delay = 0;
 
 if(NpcTable.getInstance().getTemplate(boss).type.equals("L2RaidBoss"))
 {
 actual_boss_stat=RaidBossSpawnManager.getInstance().getStatsSet(boss);
 if(actual_boss_stat!=null)
 delay = actual_boss_stat.getLong("respawnTime");
 }
 else if(NpcTable.getInstance().getTemplate(boss).type.equals("L2GrandBoss"))
 {
 actual_boss_stat=GrandBossManager.getInstance().getStatsSet(boss);
 if(actual_boss_stat!=null)
 delay = actual_boss_stat.getLong("respawn_time");
 }
 else
 continue;
 
 if (delay <= System.currentTimeMillis())
 {
 tb.append("<font color=\"00C3FF\">" + name + "</font>: " + "<font color=\"9CC300\">Is Alive</font>"+"<br1>");
 }
 else
 {
 int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
 int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
 int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis()) / 1000);
 tb.append("<font color=\"00C3FF\">" + name + "</font>" + "<font color=\"FFFFFF\">" +" " + "Respawn in :</font>" + " " + " <font color=\"32C332\">" + hours + " : " + mins + " : " + seconts + "</font><br1>");
 }
 }
 
        tb.append("<img src=\"sek.cbui32\" width=210 height=1><br>");
 tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32>");
 tb.append("</center></body></html>

 

Link para o comentário
Compartilhar em outros sites

  • 0
8 minutes ago, Sarada said:

test

  Show hidden content

package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;

import java.util.logging.Logger;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.managers.GrandBossManager;
import com.l2jfrozen.gameserver.managers.RaidBossSpawnManager;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.gameserver.templates.StatsSet;

import javolution.text.TextBuilder;

public class GrandBossSpawn implements IVoicedCommandHandler
{
 private static final String [] _voicedCommands = 
 { 
 "raidinfo" 
 };
 
 @Override
 public boolean useVoicedCommand (String command, L2PcInstance activeChar, String target)
 {
         if (command.startsWith ("raidinfo")) 
         {
             showMainPage (activeChar);
         }

      return true;
 }

    private static void showMainPage (L2PcInstance activeChar)
 {
 TextBuilder tb = new TextBuilder ();
 tb.append ("<html> <title> Boss Spawn </title> <body> <center>");
 tb.append ("<img src = \" L2UI_CH3.herotower_deco \ "width = 256 height = 32> <br>");
 tb.append ("Epic's Boss respawn time <br>");
        tb.append ("<img src = \" sek.cbui32 \ "width = 210 height = 1> <br>");
        
 for (int boss: Config.RAID_INFO_IDS_LIST)
 {
 String name = "";
 L2NpcTemplate template = null;
 if ((template = NpcTable.getInstance (). getTemplate (boss))! = null) {
 name = template.getName ();

 

 continues;
 }
 
 StatsSet actual_boss_stat = null;
 GrandBossManager.getInstance (). GetStatsSet (boss);
 long delay = 0;
 
 if (NpcTable.getInstance (). getTemplate (boss) .type.equals ("L2RaidBoss"))
 {
 actual_boss_stat = RaidBossSpawnManager.getInstance (). getStatsSet (boss);
 if (actual_boss_stat! = null)
 delay = actual_boss_stat.getLong ("respawnTime");
 }
 else if (NpcTable.getInstance (). getTemplate (boss) .type.equals ("L2GrandBoss"))
 {
 actual_boss_stat = GrandBossManager.getInstance (). getStatsSet (boss);
 if (actual_boss_stat! = null)
 delay = actual_boss_stat.getLong ("respawn_time");


 continues;
 
 if (delay <= System.currentTimeMillis ())
 {
 tb.append ("<font color = \" 00C3FF \ ">" + name + "</font>:" + "<font color = \" 9CC300 \ "> Is Alive </font> "+" <br1> ");
 }
 else
 {
 int hours = (int) ((delay - System.currentTimeMillis ()) / 1000/60/60);
 int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis ()) / 1000/60);
 int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis ()) / 1000);
 tb.append ("<font color = \" 00C3FF \ ">" + name + "</font>" + "<font color = \" FFFFFF \ ">


 


 tb.append ("</center> </body> </html>

 

same errors. I solved some mistakes but there

Spoiler

+ package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+ import java.util.logging.Logger;
+
+ import com.l2jfrozen.Config;
+ import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+ import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+ import com.l2jfrozen.gameserver.managers.GrandBossManager;
+ import com.l2jfrozen.gameserver.managers.RaidBossSpawnManager;
+ import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+ import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
+ import com.l2jfrozen.gameserver.powerpak.RaidInfo.RaidInfoHandler;
+ import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+ import com.l2jfrozen.gameserver.templates.StatsSet;
+
+ import javolution.text.TextBuilder;
+
+ public class GrandBossSpawn implements IVoicedCommandHandler
+ {
+ private static Logger _log = Logger.getLogger (RaidInfoHandler.class.getName ());
+ private static final String [] _voicedCommands = 
+ { 
+ "raidinfo" 
+};

+ @Override
+ public boolean useVoicedCommand (String command, L2PcInstance activeChar, String target)
+ {
+ if (command.startsWith ("raidinfo")) 
+ {
+ showMainPage (activeChar);
+}
+
+ return true;
+}
+
+ private static void showMainPage (L2PcInstance activeChar)
+ {
+ TextBuilder tb = new TextBuilder ();
+ tb.append ("<html> <title> Boss Spawn </title> <body> <center>");
+ tb.append ("<img src = \" L2UI_CH3.herotower_deco \ "width = 256 height = 32> <br>");
+ tb.append ("Epic's Boss respawn time <br>");
+ tb.append ("<img src = \" sek.cbui32 \ "width = 210 height = 1> <br>");
+        
+ for (int boss: Config.RAID_INFO_IDS_LIST)
+ {
+ String name = "";
+ L2NpcTemplate template = null;
+ if ((template = NpcTable.getInstance (). getTemplate (boss))!




+ _log.warning ("[RaidInfoHandler] [sendInfo] Raid Boss with ID" + boss + "is not defined into NpcTable");
+ continue;
+}

+ StatsSet actual_boss_stat = null;
+ GrandBossManager.getInstance (). GetStatsSet (boss);
+ long delay = 0;

+ if (NpcTable.getInstance (). getTemplate (boss) .type.equals ("L2RaidBoss"))
+ {
+ actual_boss_stat = RaidBossSpawnManager.getInstance (). getStatsSet (boss);
+ if (actual_boss_stat! = null)
+ delay = actual_boss_stat.getLong ("respawnTime");
+}
+ else if (NpcTable.getInstance (). getTemplate (boss) .type.equals ("L2GrandBoss"))
+ {
+ actual_boss_stat = GrandBossManager.getInstance (). getStatsSet (boss);
+ if (actual_boss_stat! = null)
+ delay = actual_boss_stat.getLong ("respawn_time");
+}
+ else
+ continue;

+ if (delay <= System.currentTimeMillis ())
+ {
+ tb.append ("<font color = \" 00C3FF \ ">" + name + "</font>:" + "<font color = \" 9CC300 \ "> Is Alive </font>" + "<br1>");
+}
+ else
+ {
+ int hours = (int) ((delay - System.currentTimeMillis ()) / 1000/60/60);
+ int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis ()) / 1000/60);
+ int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis ()) / 1000);
+ tb.append ("<font color = \" 00C3FF \ ">" + name + "</font>" + "<font color = \" FFFFFF \ ">" + "" + "Respawn in: </ font > "+" "+" <font color = \ "32C332 \"> "+ hours +": "+ mins +": "+ seconts +" </font> <br1> ");
+}
+}

+ tb.append ("<img src = \" sek.cbui32 \ "width = 210 height = 1> <br>");
+ tb.append ("<img src = \" L2UI_CH3.herotower_deco \ "width = 256 height = 32>");
+ tb.append ("</center></body></html>");

+}
+}

errors now:  https://ibb.co/fYGpQfP

Editado por Kef95
Link para o comentário
Compartilhar em outros sites

  • 0
4 minutos atrás, Kef95 disse:

mismos errores. Me las arreglé para arreglar un par de ellos 

  Ocultar conteúdo

+package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+import java.util.logging.Logger;
+
+import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.managers.GrandBossManager;
+import com.l2jfrozen.gameserver.managers.RaidBossSpawnManager;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jfrozen.gameserver.powerpak.RaidInfo.RaidInfoHandler;
+import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
+import com.l2jfrozen.gameserver.templates.StatsSet;
+
+import javolution.text.TextBuilder;
+
+public class GrandBossSpawn implements IVoicedCommandHandler
+{
+ private static Logger _log = Logger.getLogger(RaidInfoHandler.class.getName());
+ private static final String[] _voicedCommands = 
+ { 
+ "raidinfo" 
+ };

+ @Override
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+         if (command.startsWith("raidinfo")) 
+         {
+             showMainPage(activeChar);
+         }
+
+      return true;
+ }
+
+    private static void showMainPage(L2PcInstance activeChar)
+ {
+ TextBuilder tb = new TextBuilder();
+ tb.append("<html><title>Boss Spawn</title><body><center>");
+ tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");
+ tb.append("Epic's Boss respawn time<br>");
+        tb.append("<img src=\"sek.cbui32\" width=210 height=1><br>");
+        
+ for(int boss : Config.RAID_INFO_IDS_LIST)
+ {
+ String name = "";
+ L2NpcTemplate template = null;
+ if((template = NpcTable.getInstance().getTemplate(boss)) != null){
+ name = template.getName();
+ }
+ else
+ {
+ _log.warning("[RaidInfoHandler][sendInfo] Raid Boss with ID "+boss+" is not defined into NpcTable");
+ continue;
+ }

+ StatsSet actual_boss_stat = null;
+ GrandBossManager.getInstance().getStatsSet(boss);
+ long delay = 0;

+ if(NpcTable.getInstance().getTemplate(boss).type.equals("L2RaidBoss"))
+ {
+ actual_boss_stat=RaidBossSpawnManager.getInstance().getStatsSet(boss);
+ if(actual_boss_stat!=null)
+ delay = actual_boss_stat.getLong("respawnTime");
+ }
+ else if(NpcTable.getInstance().getTemplate(boss).type.equals("L2GrandBoss"))
+ {
+ actual_boss_stat=GrandBossManager.getInstance().getStatsSet(boss);
+ if(actual_boss_stat!=null)
+ delay = actual_boss_stat.getLong("respawn_time");
+ }
+ else
+ continue;

+ if (delay <= System.currentTimeMillis())
+ {
+ tb.append("<font color=\"00C3FF\">" + name + "</font>: " + "<font color=\"9CC300\">Is Alive</font>"+"<br1>");
+ }
+ else
+ {
+ int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
+ int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
+ int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis()) / 1000);
+ tb.append("<font color=\"00C3FF\">" + name + "</font>" + "<font color=\"FFFFFF\">" +" " + "Respawn in :</font>" + " " + " <font color=\"32C332\">" + hours + " : " + mins + " : " + seconts + "</font><br1>");
+ }
+ }

+        tb.append("<img src=\"sek.cbui32\" width=210 height=1><br>");
+ tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32>");
+ tb.append("</center></body></html>");

+}
+}

errors now: https://ibb.co/fYGpQfP

 

Link para o comentário
Compartilhar em outros sites

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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  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.

Processando...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.





×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.