Jump to content
  • 0

Custom Scripts In Last Acis Rev


Question

Posted

Hello guys. How i can add this script ("Announce spawn RB") in acis rev 352. In 340 rev this work perfectly.

Sorry 4 my bad english.

 

The script:

package custom.NpcScriptThree;

import net.sf.l2j.gameserver.util.Broadcast;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.scripting.Quest;

public class NpcScriptThree extends Quest
{
	//Ид боссов
	private static final int[] BossId =
	{
		25035,
		25220,
		25054,
		25126,
		25325,
		25309,
		25312,
		25299,
		25302,
		25269,
		25163,
		25453,
		25328,
		25202,
		25109,
		25319,
	};
	
	public NpcScriptThree(int questId, String descr)
	{
		super(questId, descr);
		for (int BossIds : BossId)
			addSpawnId(BossIds);
	}
	
	@Override
	public String onSpawn(L2Npc raidboss)
	{
		int npcId = raidboss.getNpcId();
		for (int id : BossId)
			if (npcId == id)
				Broadcast.announceToOnlinePlayers("RaidBoss : " + raidboss.getName() + " spawn in the world!");
		return super.onSpawn(raidboss);
	}
	
	public static void main(String[] args)
	{
		new NpcScriptThree(-1, "custom");
	}
}

I need put this to source or not? Help pls

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Drop "main" method, edit constructor to remove parameters, edit package, add on scripts.xml and voila.

 

Finally your for loop is pointless on onSpawn, because possible ids are already managed inside constructor via addSpawnId.

	@Override
	public String onSpawn(L2Npc raidboss)
	{
		Broadcast.announceToOnlinePlayers("RaidBoss : " + raidboss.getName() + " spawn in the world!");
		return super.onSpawn(raidboss);
	}
Edited by Tryskell
  • 0
Posted

 

Drop "main" method, edit constructor to remove parameters, edit package, add on scripts.xml and voila.

 

Finally your for loop is pointless on onSpawn, because possible ids are already managed inside constructor via addSpawnId.

	@Override
	public String onSpawn(L2Npc raidboss)
	{
		Broadcast.announceToOnlinePlayers("RaidBoss : " + raidboss.getName() + " spawn in the world!");
		return super.onSpawn(raidboss);
	}

 

How about this?

package net.sf.l2j.gameserver.scripting.scripts.custom;

import net.sf.l2j.gameserver.util.Broadcast;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.scripting.Quest;

public class NpcScriptThree extends Quest
{
	//Ид боссов
	private final static int[] BossIds =
	{
		25035,
		25220,
		25054,
		25126,
		25325,
		25309,
		25312,
		25299,
		25302,
		25269,
		25163,
		25453,
		25328,
		25202,
		25109,
		25319,
	};
	
	public NpcScriptThree()
	{
		super(-1, "custom");
		for (int BossId : BossIds)
			addSpawnId(BossId);
	}
	
	@Override
	public String onSpawn(L2Npc raidboss)
	{
		int npcId = raidboss.getNpcId();
		for (int id : BossIds)
			if (npcId == id)
				Broadcast.announceToOnlinePlayers("RaidBoss : " + raidboss.getName() + " spawn in the world!");
		return super.onSpawn(raidboss);
	}
}

i don't very good know java :( But i wan't it... and teach english too :D

  • 0
Posted

I copy pasted what should be onSpawn section on my previous post.

 

Otherwise, it looks good.

Oh yes, don't see changes. Ty man, it works! 

Guest
This topic is now closed to further replies.


  • Posts

    • You are the thiefs here and im not, you take my source from banshee and he never told me, you can share it i don't have problem. I will share also every had from gold. I never take anything like a thief like you do. Im selling something because i have order it like halcyon, Banshee tell me to do whatever i like also with this project because i have order it. anyway better to have all enemys because Skylord he tell me before years one good word, *Noone is friends on lineage2 game, all only something needs* it was correct. From now my friendship stops also for banshee because he make sells behind me.   Soon i will share Classic Source P110, to see ppl if i put inside bacldoor or mix codes oe have any bugs. im the ONLY ORIGINAL L2OFFA HERE. Have a nice day. 
    • everyone got your ‘files’, if we can even call them yours. you copy code, mix broken crap and sell it to noobs. backdoors, bugs and crashes all over the place. you steal other people’s work and act like you made it. no need to prove anything, it’s all right there in your garbage. you keep watching what others do, hoping to copy them. try making something of your own, and only then will you actually earn real money. until that day comes, all you’re doing is pulling 200€ from some clueless fool. good luck with "your sales" 😂 next Black Friday and your ‘amazing’ discounts… can’t wait to watch idiots throw money at your garbage again i've had those files for a long time and never sold or shared them. don't test me, it wasn't worth it then and it still isn't. http://prntscr.com/DipGc-Tv1eD2
    • The way you treat others is the way life treats you.   It’s a simple rule we truly believe in. We value every user the same way we’d like to be valued ourselves. Warmth and attention always come back as your trust and loyalty. That’s why we’re sure  when you put your heart into what you do, the best always returns.   VibeSMS - we value you and your words. ⚡ 🌐 Visit us: https://vibe-sms.net/ 📱 Join our Telegram channel: https://t.me/vibe_sms
    • I used voice chat before during events and PvP and it made coordination way easier. Just make sure everyone’s cool with talking and has a mic that doesn’t create noise.
    • Donations can provide anything that can be obtained through normal gameplay. There are no augmentations on armors, no stuck skills, and no custom items. Therefore, donations do not affect the game balance.     thank you!
  • 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