Jump to content
  • 0

Grand Boss Infos For Acis And Normal Raid Bosses


Question

Posted

How i can put in the npc normal raid bosses ?

 

This is the topic and npc who is im using. -> http://www.maxcheaters.com/topic/169025-grand-boss-infos-for-acis/

 

I tried to change normal raid bosses to grand bosses but i have problem with respawn. They have 0sec respawn. Then i need to change grand bosses to raid bosses but i need to change something in the code.Anyone can help me with something?

10 answers to this question

Recommended Posts

  • 0
Posted


/*

* 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 custom.BossRespawn;

 

 

import net.sf.l2j.gameserver.datatables.NpcTable;

import net.sf.l2j.gameserver.instancemanager.GrandBossManager;

import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;

import net.sf.l2j.gameserver.model.actor.L2Npc;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;

import net.sf.l2j.gameserver.model.quest.Quest;

import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

import net.sf.l2j.gameserver.templates.StatsSet;

 

public class BossRespawn extends Quest

{

private static final int NPC_ID = 50022;

private static final int[] BOSSES = {25325, 29006, 29014, 29019, 29020, 29022, 29028, 29045};

 

public BossRespawn(int questid, String name, String descr)

{

super(questid, name, descr);

addFirstTalkId(NPC_ID);

}

 

@Override

public String onFirstTalk(L2Npc npc, L2PcInstance pc)

{

if(npc == null || pc == null)

return null;

 

if(npc.getNpcId() == NPC_ID)

{

sendInfo(pc);

}

return null;

}

 

private static void sendInfo(L2PcInstance activeChar)

{

StringBuilder tb = new StringBuilder();

tb.append("<html><head><title>Lineage II Addicted - Bosses Spectate</title></head><body>");

tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("<table bgcolor=000000 width=300 height=40>");

tb.append("<tr>");

tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Welcome " + activeChar.getName() +" in Lineage II</font><font color=\"FF9900\"> -Addicted-</font></td>");

tb.append("</tr>");

tb.append("</table>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("<br>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("</center>");

tb.append("<center>");

tb.append("<table bgcolor=000000 width=300 height=12>");

tb.append("<tr>");

tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Bosses Spectate}</font></td>");

tb.append("</tr>");

tb.append("<tr>");

tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Online bosses status</font></td>");

tb.append("</tr>");

tb.append("</table>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("<br>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("<table border=0 bgcolor=000000 width=300 height=30>");

 

for(int boss : BOSSES)

{

String name = "";

NpcTemplate 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).isType("L2RaidBoss")){

actual_boss_stat=RaidBossSpawnManager.getInstance().getStatsSet(boss);

if(actual_boss_stat!=null)

delay = actual_boss_stat.getLong("respawn_time");

}else if(NpcTable.getInstance().getTemplate(boss).isType("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("<tr><td width=\"300\" align=\"center\"><font color=\"FF9900\">" + name + " is</font>" + "<font color=\"5EA82E\"> Alive</font></td></tr>");

}

else

{

int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);

int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);

tb.append("<tr><td width=\"300\" align=\"center\"><font color=\"FF9900\">" + name + " is respawning in</font>" +"<font color=\"FF0000\"> " + hours + "h and " + mins + "min</font></td></tr>");

}

}

 

tb.append("</table>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("</center>");

tb.append("<br>");

tb.append("<center>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("<table border=0 bgcolor=000000 width=300 height=20>");

tb.append("<tr>");

tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>");

tb.append("</tr>");

tb.append("</table>");

tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");

tb.append("</center>");

tb.append("</body></html>");

 

 

NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);

msg.setHtml(tb.toString());

 

activeChar.sendPacket(msg);

 

}

 

public static void main(String[] args)

{

new BossRespawn(-1, "BossRespawn", "custom");

}

}

  • 0
Posted
/*
 * 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 custom.BossRespawn;


import net.sf.l2j.gameserver.datatables.NpcTable;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.templates.StatsSet;

public class BossRespawn extends Quest
{
	private static final int NPC_ID = 50022;
	private static final int[] BOSSES = {25325, 29006, 29014, 29019, 29020, 29022, 29028, 29045};

	public BossRespawn(int questid, String name, String descr)
	{
		super(questid, name, descr);
		addFirstTalkId(NPC_ID);
	}
	
	@Override
	public String onFirstTalk(L2Npc npc, L2PcInstance pc)
	{
		if(npc == null || pc == null)
			return null;

		if(npc.getNpcId() == NPC_ID)
		{
			sendInfo(pc);
		}
			return null;
	}

	private static void sendInfo(L2PcInstance activeChar)
	{
		StringBuilder tb = new StringBuilder();
		tb.append("<html><head><title>Lineage II Addicted - Bosses Spectate</title></head><body>");
		tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<table bgcolor=000000 width=300 height=40>");
		tb.append("<tr>");
		tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Welcome " + activeChar.getName() +" in Lineage II</font><font color=\"FF9900\"> -Addicted-</font></td>");
		tb.append("</tr>");
		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<br>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("</center>");
		tb.append("<center>");
		tb.append("<table bgcolor=000000 width=300 height=12>");
		tb.append("<tr>");
		tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Bosses Spectate}</font></td>");
		tb.append("</tr>");
		tb.append("<tr>");
		tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Online bosses status</font></td>");
		tb.append("</tr>");
		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<br>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<table border=0 bgcolor=000000 width=300 height=30>");

		for(int boss : BOSSES)
		{
			String name = "";
			NpcTemplate 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).isType("L2RaidBoss")){
				actual_boss_stat=RaidBossSpawnManager.getInstance().getStatsSet(boss);
				if(actual_boss_stat!=null)
					delay = actual_boss_stat.getLong("respawn_time");
			}else if(NpcTable.getInstance().getTemplate(boss).isType("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("<tr><td width=\"300\" align=\"center\"><font color=\"FF9900\">" + name + " is</font>" + "<font color=\"5EA82E\"> Alive</font></td></tr>");
			}
			else
			{
				int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
				int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
				tb.append("<tr><td width=\"300\" align=\"center\"><font color=\"FF9900\">" + name + " is respawning in</font>" +"<font color=\"FF0000\"> " + hours + "h and " + mins + "min</font></td></tr>");
			}
		}

		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("</center>");
		tb.append("<br>");
		tb.append("<center>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<table border=0 bgcolor=000000 width=300 height=20>");
		tb.append("<tr>");
		tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>");
		tb.append("</tr>");
		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("</center>");
		tb.append("</body></html>");
		
		
		NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
		msg.setHtml(tb.toString());
		
		activeChar.sendPacket(msg);
		
	}

	public static void main(String[] args)
	{
		new BossRespawn(-1, "BossRespawn", "custom");
	}
}

That is good code but i have problem , actual_boss_stat=RaidBossSpawnManager.getInstance().getStatsSet(boss); 

getstatsset... This method is wrong , do you know something for it?

  • 0
Posted

That is good code but i have problem , actual_boss_stat=RaidBossSpawnManager.getInstance().getStatsSet(boss); 

getstatsset... This method is wrong , do you know something for it?

hmm try to add these on RaidBossSpawnManager

	public StatsSet getStatsSet(int bossId)
	{
		return _storedInfo.get(bossId);
	}
	
	public L2RaidBossInstance getBoss(int bossId)
	{
		return _bosses.get(bossId);
	}
  • 0
Posted (edited)

 

hmm try to add these on RaidBossSpawnManager

	public StatsSet getStatsSet(int bossId)
	{
		return _storedInfo.get(bossId);
	}
	
	public L2RaidBossInstance getBoss(int bossId)
	{
		return _bosses.get(bossId);
	}

StatsSet : Long value required , but found: null for key: respawn_time.

Edited by rlfem123
  • 0
Posted (edited)

?

I edited my post read it again. 

StatsSet : Long value required , but found: null for key: respawn_time.

Edited by rlfem123
  • 0
Posted

I edited my post read it again. 

StatsSet : Long value required , but found: null for key: respawn_time.

for a reason i changed the respawn_time when i gave it to u but in mine i got it like this.

/*
 * 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 custom.BossRespawn;


import net.sf.l2j.gameserver.datatables.NpcTable;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.templates.StatsSet;

public class BossRespawn extends Quest
{
	private static final int NPC_ID = 50022;
	private static final int[] BOSSES = {25325, 29006, 29014, 29019, 29020, 29022, 29028, 29045};

	public BossRespawn(int questid, String name, String descr)
	{
		super(questid, name, descr);
		addFirstTalkId(NPC_ID);
	}
	
	@Override
	public String onFirstTalk(L2Npc npc, L2PcInstance pc)
	{
		if(npc == null || pc == null)
			return null;

		if(npc.getNpcId() == NPC_ID)
		{
			sendInfo(pc);
		}
			return null;
	}

	private static void sendInfo(L2PcInstance activeChar)
	{
		StringBuilder tb = new StringBuilder();
		tb.append("<html><head><title>Lineage II Addicted - Bosses Spectate</title></head><body>");
		tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<table bgcolor=000000 width=300 height=40>");
		tb.append("<tr>");
		tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Welcome " + activeChar.getName() +" in Lineage II</font><font color=\"FF9900\"> -Addicted-</font></td>");
		tb.append("</tr>");
		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<br>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("</center>");
		tb.append("<center>");
		tb.append("<table bgcolor=000000 width=300 height=12>");
		tb.append("<tr>");
		tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Bosses Spectate}</font></td>");
		tb.append("</tr>");
		tb.append("<tr>");
		tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Online bosses status</font></td>");
		tb.append("</tr>");
		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<br>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<table border=0 bgcolor=000000 width=300 height=30>");

		for(int boss : BOSSES)
		{
			String name = "";
			NpcTemplate 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).isType("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).isType("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("<tr><td width=\"300\" align=\"center\"><font color=\"FF9900\">" + name + " is</font>" + "<font color=\"5EA82E\"> Alive</font></td></tr>");
			}
			else
			{
				int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
				int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
				tb.append("<tr><td width=\"300\" align=\"center\"><font color=\"FF9900\">" + name + " is respawning in</font>" +"<font color=\"FF0000\"> " + hours + "h and " + mins + "min</font></td></tr>");
			}
		}

		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("</center>");
		tb.append("<br>");
		tb.append("<center>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("<table border=0 bgcolor=000000 width=300 height=20>");
		tb.append("<tr>");
		tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>");
		tb.append("</tr>");
		tb.append("</table>");
		tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>");
		tb.append("</center>");
		tb.append("</body></html>");
		
		
		NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
		msg.setHtml(tb.toString());
		
		activeChar.sendPacket(msg);
		
	}

	public static void main(String[] args)
	{
		new BossRespawn(-1, "BossRespawn", "custom");
	}
}

try this one

Guest
This topic is now closed to further replies.


×
×
  • Create New...