Jump to content

Question

Posted (edited)

Hey guys.

 

So I wanted to ask about this NPC that I found in one (pre-configured) pack (Excess to be exact), I added it to my own server, but I don't understand how do I change/edit the info on this NPC, like remove or add RaidBoss info.

 

This NPC has an id of 93000.

 

And this is what I get when I open 93000.xml in the directory of ->gameserver/data/html/default/93000.xml

 

It's clearly not the right code for the one I see in game.
 

I saw this line :

Quote

<button value="Bosses Info" action="bypass -h custom_raidinfo" width=90 height=15 back="sek.cbui94" fore="sek.cbui94">

 

I searched everywhere, for whole 3 to 4 hours, for smth called "raidinfo", and nothing. Correct me if I'm wrong, but I think that I need to fiddle with JAVA files in order to change the RBInfo list ? If so, can anyone tell me how to do it? BTW.. I'm still a newbie with coding JAVA files, so if it's hard to change anything, I may let this one slide, and go on without it.

 

EDIT: I know that in the second screenshot the opened file is called 90001.xml, It's just because I renamed it to check if the NPC will fail to show anything at all like html is missing or smth.. But it didn't work
 

Using L2jFrozen.

Chronicle - Interlude.

Edited by Thrusteris

Recommended Posts

  • 0
Posted (edited)

indeed, you have to make some changes in your sources (if this manager is coded in java and not python.)

Open your eclipse and click at Search in your tools. then write the bypass in text box. something like that

fbe45734b8e005476589309d203efd45.png

 

and paste in code tag what you found in order to help you

Edited by melron
  • Upvote 1
  • 0
Posted
3 minutes ago, Thrusteris said:

Any info or links to where I can find a tutorial on how to de-compile .jar files and after I'm done editing them to compile them again ?

decompiling .jar can be done,but it can give you some errors or changes to the codes.

Anyways the pack you talk about already has a link for the sources,download import them on eclipse,and start edit

  • 0
Posted
1 hour ago, Thrusteris said:

 

So I wanted to ask about this NPC that I found in one (pre-configured) pack (Excess to be exact), I added it to my own server, but I don't understand how do I change/edit the info on this NPC, like remove or add RaidBoss info.

 

 

Wait, As i can understand by your words, you found this npc in another pre-configured pack? And added it to your own server? Without sources? How is that possible? 

  • 0
Posted
Just now, melron said:

 

Wait, As i can understand by your words, you found this npc in another pre-configured pack? And added it to your own server? Without sources? How is that possible? 

 

probably installed it in the db, and it's htmls,can be done, but ofc without working,he just installed the npc but without it's features.

  • 0
Posted
Spoiler

package com.l2jfrozen.gameserver.model.actor.instance;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.ai.L2CharacterAI;
import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
import com.l2jfrozen.gameserver.managers.GrandBossManager;
import com.l2jfrozen.gameserver.managers.RaidBossSpawnManager;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
import com.l2jfrozen.gameserver.powerpak.RaidInfo.RaidInfoHandler;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.gameserver.templates.StatsSet;
import java.util.Iterator;
import java.util.logging.Logger;
import javolution.text.TextBuilder;
import javolution.util.FastList;

public class L2RBManagerInstance
  extends L2FolkInstance
{
  private static Logger _log = Logger.getLogger(RaidInfoHandler.class.getName());
  
  public L2RBManagerInstance(int objectId, L2NpcTemplate template)
  {
    super(objectId, template);
  }
  
  public void onAction(L2PcInstance activeChar)
  {
    if (!canTarget(activeChar)) {
      return;
    }
    if (this != activeChar.getTarget())
    {
      activeChar.setTarget(this);
      
      activeChar.sendPacket(new MyTargetSelected(getObjectId(), 0));
      
      activeChar.sendPacket(new ValidateLocation(this));
    }
    else if (!canInteract(activeChar))
    {
      activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
    }
    else
    {
      showHtmlWindow(activeChar);
    }
    activeChar.sendPacket(new ActionFailed());
  }
  
  private void showHtmlWindow(L2PcInstance activeChar)
  {
    TextBuilder tb = new TextBuilder();
    tb.append("<html>");
    tb.append("<body>");
    tb.append("<title>RaidBoss Manager</title>");
    tb.append("<br1>");
    tb.append("<img src=\"l2excess.npclogo\" width=250 height=80>");
    tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
    tb.append("<table bgcolor=\"000000\" width=310>");
    for (Iterator i$ = Config.RAID_INFO_IDS_LIST.iterator(); i$.hasNext();)
    {
      int boss = ((Integer)i$.next()).intValue();
      
      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 = 0L;
      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")) {
          continue;
        }
        actual_boss_stat = GrandBossManager.getInstance().getStatsSet(boss);
        if (actual_boss_stat != null) {
          delay = actual_boss_stat.getLong("respawn_time");
        }
      }
      if (delay <= System.currentTimeMillis())
      {
        tb.append("<tr>");
        tb.append("<td><font color=\"005C7E\">" + name + "</font></td>");
        tb.append("<td><center><font color=\"00FF00\">Is Alive</font></td>");
        tb.append("</tr>");
      }
      else
      {
        int hours = (int)((delay - System.currentTimeMillis()) / 1000L / 60L / 60L);
        int mins = (int)((delay - hours * 60 * 60 * 1000 - System.currentTimeMillis()) / 1000L / 60L);
        int seconts = (int)((delay - (hours * 60 * 60 * 1000 + mins * 60 * 1000) - System.currentTimeMillis()) / 1000L);
        tb.append("<tr>");
        tb.append("<td><font color=\"005C7E\">" + name + "</font></td>");
        tb.append("<td><center>Respawn in: " + hours + " : " + mins + " : " + seconts + "</td>");
        tb.append("</tr>");
      }
    }
    tb.append("</table>");
    tb.append("</body>");
    tb.append("</html>

Found this, can I change anything in this file ?

  • 0
Posted (edited)
6 minutes ago, camenomat0 said:

 

probably installed it in the db, and it's htmls,can be done, but ofc without working,he just installed the npc but without it's features.

well no, just look at the html he posted . To appear the html with all the raidbosses names/status , a bypass must be launched . So something is wrong here :D

Edited by melron
  • 0
Posted
2 minutes ago, Thrusteris said:

Found this, can I change anything in this file ?

 

Even if you used decompiler to search for it, As you can see the results are not correct. But, as i can see a config is there to handle all the id's.

Config.RAID_INFO_IDS_LIST 

Search again with the decompiler in Config.java and search RAID_INFO_IDS_LIST  = bla bla ... You will see how the config name is written

  • 0
Posted (edited)

Oh god.. There's no way for me to do this now, I guess I will stop fiddling with eclipse before I break anything, Guys, thanks for the info now, I will save everything you wrote and leave it for later. Time for me to watch some tutorials of Eclipse editing, cuz I had no idea what I was doing.. :D 

Edited by Thrusteris
  • 0
Posted (edited)
1 hour ago, Thrusteris said:

Oh god.. There's no way for me to do this now, I guess I will stop fiddling with eclipse before I break anything, Guys, thanks for the info now, I will save everything you wrote and leave it for later. Time for me to watch some tutorials of Eclipse editing, cuz I had no idea what I was doing.. :D 

1st of all ignore Melron, he is in love lately and he don't know what he is talking about. Last code he did contained hearts, kisses and bdsm.

2nd without source simply, close the server, close the maxcheaters, close the computer and go out for a coffee cause you can't do a shit. 

 

Now if you decide to get a source you simply can create a new Instance (Copy paste an existed template) and inside at showHtmlWindow(player) 

write a code like: 

 

private static int[] RAID = { };

private static String getColor(int i)
{
	if (i==0)
		return "FFFFFF";
	if (i==1)
		return "55555";
	return "00000";	
}

@Override
public void showChatWindow(final L2PcInstance player)
{
	StringBuilder st = new StringBuilder();
	st.append("<html><body><title>Raid Info</title>");
    st.append("<table width=420>");
    int index = 0;
      
    st.append("<tr>");
    st.append("<td width=30>Pos.</td>");
    st.append("<td width=30>Name</td>");
    st.append("</tr>");
      
    for (final int boss : RAID)
    {
      	index ++;
        String name = NpcTable.getInstance().getTemplate(boss).getName();
        int status = GrandBossManager.getInstance().getBossStatus(boss);

      	st.append("<tr>");
     	st.append("<td width=30>" + index + "</td>");
        st.append("<td width=30><font color= "+ getColor(status) + ">" + name + "</font></td>");
        st.append("</tr>");
     }
      
      st.append("</table>");
      
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      html.setHtml(tb.toString());
	  player.sendPacket(html);
}

 

Don't bother just copy paste the code without adjusting i wrote it in Sublime and i dont even know if syntax is ok. (especially for html part)... Just to give you

the idea of how to make your code.

Edited by Evie Frye
  • 0
Posted (edited)
18 hours ago, Evie Frye said:

1st of all ignore Melron, he is in love lately and he don't know what he is talking about. Last code he did contained hearts, kisses and bdsm.

2nd without source simply, close the server, close the maxcheaters, close the computer and go out for a coffee cause you can't do a shit. 

 

Don't bother just copy paste the code without adjusting i wrote it in Sublime and i dont even know if syntax is ok. (especially for html part)... Just to give you

the idea of how to make your code.

 

Me and Boolean hate you too... <3

 

getColor(status == 1)

private static String getColor(boolean alive) 
{
	return alive ? "FFFFFF" : "55555";
}

 

Edited by melron
  • 0
Posted
6 hours ago, melron said:

 

Me and Boolean hate you too... <3

 


getColor(status == 1)

private static String getColor(boolean alive) 
{
	return alive ? "FFFFFF" : "55555";
}

 

 

I made it like this cause there are 4 Stages of boss. 

 

0 = Normal

1 = Waiting

2  = Fighting

3 = Dead

  • 0
Posted
2 hours ago, Evie Frye said:

 

I made it like this cause there are 4 Stages of boss. 

 

0 = Normal

1 = Waiting

2  = Fighting

3 = Dead

Who cares about the other states except dead/alive :P

Do you have it like this in your own unique server with unique farm areas ?

  • 0
Posted
1 minute ago, melron said:

Who cares about the other states except dead/alive :P

Do you have it like this in your own unique server with unique farm areas ?

 

At least i have 100% balanced server, No curruption, FULL anti-ddos server, Unique farm zone that change every 1 hour, No bug No lag server

do you?? DO YOU????????

Guest
This topic is now closed to further replies.
×
×
  • Create New...