Jump to content
  • 0

Question

Posted

I need an NPC with a list of respawn remaining time from Grand Bosses. Can someone help me to make it ?

I have a starting code ready but i need help on npc delegation code.

Recommended Posts

  • 0
Posted

heres an attempt. Dunno if is correct (writted it down with notepad)

class BossDelay extends Quest {

private static final int NPC_ID = 0;
private static final int[] BOSSES = {
	//fill by yourself
}

public BossDelay(int questid, Stirng name, String descr) {
	super(questid, name, descr);
	addFirstTalkId(NPC_ID);
}

public String onFirstTalk(L2Npc npc, L2PcInstance pc) {
	if(npc == null || pc == null)
		return null;

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

private void sendInfo(L2PcInstance activeChar) {
	TextBuilder tb = new TextBuilder();
	tb.append("<html><body><center><br>");

	GrandBossManager manager = GrandBossManager.getInstance();

	for(int boss : BOSSES) {
		String name = manager.getBoss(boss).getName();
		long delay = manager.getStatsSet(boss).getLong("respawn_time");
		String time = new Timestampt(delay).toString();
		tb.append(name + ": "+time+"<br1>");
	}

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

	NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
	msg.setHtml(tb.toString());
	activeChar.sendPacket(msg);
}
}

  • 0
Posted

Hello BB. Sorry for the delay but just arrived at my home from a work trip.

First of all i want to THANK you verry mutch for everything you do for ALL of us !

Its verry nice attempt to solve the problem and i try to use it tomorow and i give

you the results. Btw as i see with my first meet you have two typos.

First public BossDelay(int questid, Stirng name, String descr) on String and second

String time = new Timestampt(delay).toString(); on Timestamp... (I think the Import is sql part right ?)

Btw we will talk again tomorow about results..

 

Thanks again !

  • 0
Posted

I have some problems with script.... Pls take a look:

package custom.BossRespawn;

import java.sql.Timestamp;

import javolution.text.TextBuilder;

import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;

public class BossRespawn extends Quest {

private static final int NPC_ID = 93000;
private static final int[] BOSSES = {29001, 29006, 29014, 29019, 29020, 29022, 29028, 29045, 29066};

public BossRespawn(int questid, String name, String descr) {
	super(questid, name, descr);
	addFirstTalkId(NPC_ID);
}

public String onFirstTalk(L2Npc npc, L2PcInstance pc) {
	if(npc == null || pc == null)
		return null;

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

private void sendInfo(L2PcInstance activeChar) {
	TextBuilder tb = new TextBuilder();
	tb.append("<html><body><center><br>");

	GrandBossManager manager = GrandBossManager.getInstance();

	for(int boss : BOSSES) {
		String name = manager.getBoss(boss).getName();
		long delay = manager.getStatsSet(boss).getLong("respawn_time");
		String time = new Timestamp(delay).toString();
		tb.append(name + ": "+time+"<br1>");
	}

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

	NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
	msg.setHtml(tb.toString());
	activeChar.sendPacket(msg);
}
}

 

And here is what i got when i run it:

Failed executing script: C:\l2jserverTEST\gameserver\data\scripts\custom\BossRespawn\BossRespawn.java. See BossRespawn.java.error.log for details.

 

and here is what i got from error.log:

Error on: C:\l2jserverTEST\gameserver\data\scripts\custom\BossRespawn\BossRespawn.java.error.log

Line: -1 - Column: -1

 

no main method in custom.BossRespawn.BossRespawn

 

What is going on ?

  • 0
Posted

Ok i add main void at the end of script and now is running:

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

 

But now i have error on first talk

Here is the error:

C:\l2jserverTEST\gameserver\data\scripts\custom\BossRespawn\BossRespawn.java

java.lang.NullPointerException

        at custom.BossRespawn.BossRespawn.sendInfo(BossRespawn.java:59)

        at custom.BossRespawn.BossRespawn.onFirstTalk(BossRespawn.java:45)

        at com.l2jserver.gameserver.model.quest.Quest.notifyFirstTalk(Quest.java:464)

        at handlers.actionhandlers.L2NpcAction.action(L2NpcAction.java:137)

        at com.l2jserver.gameserver.model.actor.L2Character.onAction(L2Character.java:2445)

        at com.l2jserver.gameserver.model.L2Object.onAction(L2Object.java:264)

        at com.l2jserver.gameserver.network.clientpackets.Action.runImpl(Action.java:126)

        at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:92)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        at java.lang.Thread.run(Unknown Source)

 

Any idea ?

  • 0
Posted

RaidBossSpawnManager manager = RaidBossSpawnManager.getInstance();

 

String name = manager.getBossInstance(boss).getName();

 

lol wrong

RaidBossSpawnManager take data from raidboss_spawnlist, grand bosses are not added into that table

  • 0
Posted

Well finaly i change some things and almost working...

private void sendInfo(L2PcInstance activeChar)
{
	TextBuilder tb = new TextBuilder();
	tb.append("<html><body><center><br>");

	for(int boss : BOSSES)
	{
		String name = NpcTable.getInstance().getTemplate(boss).getName();
		long delay = GrandBossManager.getInstance().getStatsSet(boss).getLong("respawn_time");
		String time = new Timestamp(delay).toString();
		tb.append(name + ": "+time+"<br1>");
	}

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

	NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
	msg.setHtml(tb.toString());
	activeChar.sendPacket(msg);
}

 

So we are in good way to complete it...

So now we need a check and if its allready spawned to say "Alive"

Also this script is show when the boss become alive and we need i think the remaining time

to be alive

So lets complete it guys !

  • 0
Posted

L2NpcInstance npcul = RaidBossSpawnManager.getInstance().getBosses().get(npcId);

if (npcul == null) //means DEAD

{

    //yourcode

}

Guest
This topic is now closed to further replies.


  • Posts

    • TELEGRAM SEO TRAINING (Bot Ranking in Search) I teach a complete system for ranking Telegram bots at the top of search results by keywords and countries. The method works for services, shops, crypto projects, and any type of Telegram bot. You can also direct the traffic to your groups, channels, websites, or sales funnels. ⸻  Countries I work with USA, Israel, Russia, India, Turkey, China, Ukraine, Uzbekistan. If you need another country — message me, we’ll find a solution. ⸻ ️ Results First search results appear in 2–3 days. ⸻  What’s included in the training • how the Telegram search algorithm works and key ranking factors • keyword research for your country and niche • bot optimization: description, settings, greeting text • fixing and maintaining positions • specific promotion nuances for different countries ⸻  What you will receive • a complete system for ranking bots in search • understanding how to work with keywords, traffic, and positions • a skill you can use to promote your own projects or earn from clients ⸻  Who this training is for • beginners with zero experience — I explain everything from scratch • those who don’t have a bot — I provide a ready one for practice • anyone who wants to learn promotion and earn from this service ⸻  Why learn from me • doing Telegram SEO since 2021 • over 1000 successful orders • my own panel SMMTG.PRO and private databases • experience working with markets of Russia, Uzbekistan, Ukraine, Israel, USA, Turkey, China, India, Vietnam, Europe, and more ⸻  For pricing — message me t.me/smmtg_link
    • Hey everyone, I was wondering if anyone knows where the client loads all the .dat files. Is there some kind of manifest or list you can specify which dat files the client loads?
    • 🔥 Welcome to Lineage 2 Haruna x3 – True Classic Interlude Experience 🔥 At Haruna x3, we’re bringing back the true essence of Interlude – slow, meaningful progression where every level matters, every item has value, and PvP is real. We’re not about fast servers, pay-to-win advantages, or fake populations. Our goal is simple: create a fair, stable, and long-term server where players can enjoy real competition, strategic clan warfare, and the thrill of open-world PvP. 💎 What Makes Haruna x3 Special? x3 Rates – Perfect for steady, rewarding progression Classic Interlude Mechanics – Relive the nostalgia of Interlude Stable & Lag-Free Gameplay – Optimized for thousands of players online Fair & Balanced – No pay-to-win, every victory is earned PvP & Clan Warfare Focused – Every battle counts 🌟 Quality of Life Features to Enhance Your Experience We keep the classic feel while adding features that make the game more convenient and enjoyable, including: Shift + Click to view monster droplists Free item mail and buy/sell via Adena Daily login rewards & Stream Rewards ALT+K Skill Panel & Alt+Click buffs removal Offline shop system Captcha for security Donate Coins currency (cannot be traded, dropped, or destroyed) Classic P110 client – no custom interface 🏰 Our Philosophy We believe Lineage 2 is about the journey, not just the destination. Haruna x3 is designed for months and years of growth, not weeks. We provide a community-driven environment where honest gameplay, fair competition, and strategic teamwork are at the forefront. 🌍 Join Our Community Whether you’re a veteran of Interlude or a returning player seeking a true classic experience, Haruna x3 offers a place to fight, trade, and grow alongside dedicated players. Step into the world of Haruna x3 – where every decision matters, every fight counts, and every victory is yours to earn. Discord: https://discord.gg/7DDC9Dsxnh Website : www.l2haruna.com
    • No, the real purpose is cheating and custom  development for games.  I'm building a custom AI moderator specially for checking illegal activity and flag current topica.
  • 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