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.


  • Posts

    • Wtb full account or items on l2 warland 
    • https://discord.gg/k53SZ4DM5z   Interlude Client L2Old Pride is a L2 Pride Interlude Based All functional skills (Not archer/mage server)   L2Old Pride Helper (Works like Woundrous Cubic) https://imgur.com/iYqmHQY Farm Zones: Cave of Trials and Elven Ruins (Chaotic) Olympiads: Every 15 days Various Cosmetic Items https://imgur.com/uoeU6Jw https://imgur.com/oCS2Zed PvP Zone: Gludin Village (No-Parties, Disguised) More than 100 new Skills https://imgur.com/6RaPsQV Max Level: 90 https://imgur.com/z4QVJKZ Gaining Xp by PVP https://imgur.com/LRqI31T Purchasable S-grade items +10 or +20 with random chance to enchant +5 Purchasable Custom Items Depends on Tier Mysterious Merchants https://imgur.com/2ZwWyPH Auto Enchant Via PvPing (with low chance) Custom Raid Bosses Siege Every Weekend (Aden, Rune, Giran) Autofarm / Drop Tracker https://imgur.com/Vz3rha6   RATES: • Start Level 80 • Max level 90  • EXP: 5000x • SP: 5000x • ADENA 6000x   ENCHANT: • Maximum enchant S Grade Items: +35. • Maximum enchant Unique/Epic Items: +25. • Maximum enchant Legendary Items: +18. • Maximum enchant Relic Items: +14. •Descriptions for rate at scrolls!   EVENTS: • TEAMS vs TEAMS • CAPTURE THE FLAG • DOMINATION • DEATH MATCH • DICE OF DEATH • CHAOTIC ZONE   OTHERS: Assistance system in pvps. Where support classes are enabled to receive pvp with a low chance, for supporting a party member during pvp. •  /sit to regen HP/MP/CP • Custom Shots Glows https://imgur.com/FLK0DmR • Achievements System • Daily Tasks System • Monthly Tasks System   CUSTOM ARMORS SETS Dread Armor/Titanium Armor Pride Armor Rykros Armor https://imgur.com/SPxoQp1   CUSTOM WEAPONS SETS Unique Weapons Pride Weapons Legendary Weapons Relic Weapons https://imgur.com/kOHNXhS   CUSTOM ACCESSORIES Standard Superior Legendary https://imgur.com/zPqNiiX   CUSTOM JEWELS/TATTOO Legendary Nightmarish https://imgur.com/gcqS28P There are many more features that you will only understand by playing and following. Beta testing server is currently open. Follow us on our discord and join our server to test it.
    • You shouldn't use rev 382, not sure why everyone keep using that.   I don't make changesets for fun, I don't make new revisions for nothing.   Follow the revisions.
    • Your issue isn't related to geoengine at all (as always), rev 410 got improved water movement management.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock