Jump to content
  • 0

Grand boss


dleogr
 Share

Question

Recommended Posts

  • 0

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);
}
}

Link to comment
Share on other sites

  • 0

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 !

Link to comment
Share on other sites

  • 0

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 ?

Link to comment
Share on other sites

  • 0

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 ?

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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 !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



  • Posts

    • Hello! Can you please tell me to prohibit creating nicknames with one character?
    • No offense but, please try to use google translate, can't understand shit of what you're trying to say, otherwise people probably won't be able to help you
    • where is the second fix? only gave me the fix for announce, right?
    • Good luck sky been always decent server 🙂
    • Dear friends, We promised you an Interlude server towards the end of the year, now we are here to deliver.  The entire L2mid team is proud to present you, a returning legend! L2Mid Interlude Dynamic Rates X25 A traditional Interlude server most fitting for the upcoming Christmas Season!   Grand Opening: 26th December 2021  Website: https://l2mid.com   Let’s send off this year in a fitting way, by playing on the top Interlude mid-rate server!  You can seat tight and expect in the near future, when we will announce more information about other upcoming projects with whom we will be collaborating.       Merry Christmas, and may all your Christmases be white!     May the true spirit of Christmas shine in your heart and light your path.         Dynamic Rates x25 is a classic game with simplified development and with maximum approximation to massive PVP battles. Сlassic, but simplistic gameplay maintains a constant competition in all its manifestations. Here you will not achieve everything in just one day and you will not quietly develop because your competitors will disturb you all time. Dynamic Rates Experience and Skill Points from Monsters: 1-61 Level - x25   Dynamic Rates Experience and Skill Points from Monsters: 61-76 LEVEL - X15   Dynamic Rates Experience and Skill Points from Monsters: 76-80 LEVEL - X5 ADENA x15   SEAL STONES x10   DROP x15   SPOIL x15   MANOR x1   Raid Boss Experience, Skill Points and Drop x7   Epic Boss Experience, Skill Points and Drop x1   Quest Item Drop x3   Quest Item Reward x2   Daily Quest Every 24 hours
  • 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 Disbaled AdBlock