Jump to content
  • 0

Question

9 answers to this question

Recommended Posts

  • 0
Posted

java.lang.NullPointerException

        at ai.individual.QueenAnt.onKill(QueenAnt.java:312)

        at com.l2jserver.gameserver.model.quest.Quest.notifyKill(Quest.java:476)

 

        at com.l2jserver.gameserver.model.actor.L2Attackable$OnKillNotifyTask.ru

n(L2Attackable.java:572)

        at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(Thread

PoolManager.java:86)

        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

        at java.util.concurrent.FutureTask.run(Unknown Source)

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.

access$201(Unknown Source)

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.

run(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

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

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

 

That is the error

  • 0
Posted

Post the AI scripts.

Probably is missing something like:

if (st == null){return "";}

in the

@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
{

  • 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 ai.individual;

import java.util.List;

import javolution.util.FastList;

import ai.group_template.L2AttackableAIScript;

import com.l2jserver.Config;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.model.L2Skill;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
import com.l2jserver.gameserver.network.serverpackets.SocialAction;
import com.l2jserver.gameserver.skills.SkillHolder;
import com.l2jserver.gameserver.templates.StatsSet;
import com.l2jserver.util.Rnd;

/**
* Queen Ant AI
* 
* @author Emperorc
* 
*/
public class QueenAnt extends L2AttackableAIScript
{

private static final int QUEEN = 29001;
private static final int LARVA = 29002;
private static final int NURSE = 29003;
private static final int GUARD = 29004;
private static final int ROYAL = 29005;

private static final int[] MOBS = { QUEEN, LARVA, NURSE, GUARD, ROYAL };

private static final int QUEEN_X = -21610;
private static final int QUEEN_Y = 181594;
private static final int QUEEN_Z = -5734;

//QUEEN Status Tracking :
private static final byte ALIVE = 0; //Queen Ant is spawned.
private static final byte DEAD = 1; //Queen Ant has been killed.

private static L2BossZone _zone;

private static SkillHolder HEAL1 = new SkillHolder(4020, 1);
private static SkillHolder HEAL2 = new SkillHolder(4024, 1);

private L2MonsterInstance _queen = null;
private L2MonsterInstance _larva = null;
private List<L2MonsterInstance> _nurses = new FastList<L2MonsterInstance>(5);

public QueenAnt(int questId, String name, String descr)
{
	super(questId, name, descr);

	registerMobs(MOBS, QuestEventType.ON_SPAWN, QuestEventType.ON_KILL, QuestEventType.ON_AGGRO_RANGE_ENTER);
	addFactionCallId(NURSE);

	_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);

	StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
	int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
	if (status == DEAD)
	{
		// load the unlock date and time for queen ant from DB
		long temp = info.getLong("respawn_time") - System.currentTimeMillis();
		// if queen ant is locked until a certain time, mark it so and start the unlock timer
		// the unlock time has not yet expired.
		if (temp > 0)
			startQuestTimer("queen_unlock", temp, null, null);
		else
		{
			// the time has already expired while the server was offline. Immediately spawn queen ant.
			L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
			GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
			spawnBoss(queen);
		}
	}
	else
	{
		int loc_x = info.getInteger("loc_x");
		int loc_y = info.getInteger("loc_y");
		int loc_z = info.getInteger("loc_z");
		int heading = info.getInteger("heading");
		int hp = info.getInteger("currentHP");
		int mp = info.getInteger("currentMP");
		if (!_zone.isInsideZone(loc_x, loc_y, loc_z))
		{
			loc_x = QUEEN_X;
			loc_y = QUEEN_Y;
			loc_z = QUEEN_Z;
		}
		L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
		queen.setCurrentHpMp(hp, mp);
		spawnBoss(queen);
	}
}

private void spawnBoss(L2GrandBossInstance npc)
{
	GrandBossManager.getInstance().addBoss(npc);
	if (Rnd.get(100) < 33)
		_zone.movePlayersTo(-19480, 187344, -5600);
	else if (Rnd.get(100) < 50)
		_zone.movePlayersTo(-17928, 180912, -5520);
	else
		_zone.movePlayersTo(-23808, 182368, -5600);
	GrandBossManager.getInstance().addBoss(npc);
	startQuestTimer("action", 10000, npc, null, true);
	startQuestTimer("heal", 1000, null, null, true);
	npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
	_queen = npc;
	_larva = (L2MonsterInstance)addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0);
}

@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
	if (event.equalsIgnoreCase("heal"))
	{
		boolean notCasting;
		final boolean larvaNeedHeal = _larva != null && _larva.getCurrentHp() < _larva.getMaxHp();
		final boolean queenNeedHeal = _queen != null && _queen.getCurrentHp() < _queen.getMaxHp();
		for (L2MonsterInstance nurse : _nurses)
		{
			if (nurse == null || nurse.isDead() || nurse.isCastingNow())
				continue;

			notCasting = nurse.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST;
			if (larvaNeedHeal)
			{
				if (nurse.getTarget() != _larva || notCasting)
				{
					nurse.setTarget(_larva);
					nurse.useMagic(Rnd.nextBoolean() ? HEAL1.getSkill() : HEAL2.getSkill());
				}
				continue;
			}
			if (queenNeedHeal)
			{
				if (nurse.getLeader() == _larva) // skip larva's minions
					continue;

				if (nurse.getTarget() != _queen || notCasting)
				{
					nurse.setTarget(_queen);
					nurse.useMagic(HEAL1.getSkill());						
				}
				continue;
			}
			// if nurse not casting - remove target
			if (notCasting && nurse.getTarget() != null)
				nurse.setTarget(null);
		}
	}
	else if (event.equalsIgnoreCase("action") && npc != null)
	{
		if (Rnd.get(3) == 0)
		{
			if (Rnd.get(2) == 0)
			{
				npc.broadcastPacket(new SocialAction(npc, 3));
			}
			else
			{
				npc.broadcastPacket(new SocialAction(npc, 4));
			}
		}
	}
	else if (event.equalsIgnoreCase("queen_unlock"))
	{
		L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
		GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
		spawnBoss(queen);
	}
	return super.onAdvEvent(event, npc, player);
}

@Override
public String onSpawn(L2Npc npc)
{
	final L2MonsterInstance mob = (L2MonsterInstance)npc;
	switch (npc.getNpcId())
	{
		case LARVA:
			mob.setIsImmobilized(true);
			mob.setIsMortal(false);
			mob.setIsRaidMinion(true);
			break;
		case NURSE:
			mob.disableCoreAI(true);
			mob.setIsRaidMinion(true);
			_nurses.add(mob);
			break;
		case ROYAL:
		case GUARD:
			mob.setIsRaidMinion(true);
			break;
	}

	return super.onSpawn(npc);
}

@Override
public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet)
{
	if (caller == null || npc == null)
		return super.onFactionCall(npc, caller, attacker, isPet);

	if (!npc.isCastingNow() && npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)
	{
		if (caller.getCurrentHp() < caller.getMaxHp())
		{
			npc.setTarget(caller);
			((L2Attackable)npc).useMagic(HEAL1.getSkill());
		}
	}
	return null;
}

@Override
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
{
	if (npc == null)
		return null;

	final boolean isMage;
	final L2Playable character;
	if (isPet)
	{
		isMage = false;
		character = player.getPet();
	}
	else
	{
		isMage = player.isMageClass();
		character = player;
	}

	if (character == null)
		return null;

	if (!Config.RAID_DISABLE_CURSE && character.getLevel() - npc.getLevel() > 8)
	{
		L2Skill curse = null;
		if (isMage)
		{
			if (!character.isMuted() && Rnd.get(4) == 0)
				curse = SkillTable.FrequentSkill.RAID_CURSE.getSkill();
		}
		else
		{
			if (!character.isParalyzed() && Rnd.get(4) == 0)
				curse = SkillTable.FrequentSkill.RAID_CURSE2.getSkill();
		}

		if (curse != null)
		{
			npc.broadcastPacket(new MagicSkillUse(npc, character, curse.getId(), curse.getLevel(), 300, 0));
			curse.getEffects(npc, character);
		}

		((L2Attackable) npc).stopHating(character); // for calling again
		return null;
	}

	return super.onAggroRangeEnter(npc, player, isPet);
}

@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
{
	int npcId = npc.getNpcId();
	if (npcId == QUEEN)
	{
		npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
		GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);
		//time is 36hour	+/- 17hour
		long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + Rnd.get(Config.Random_Of_QueenAnt_Spawn);
		startQuestTimer("queen_unlock", respawnTime, null, null);
		cancelQuestTimer("action", npc, null);
		cancelQuestTimer("heal", null, null);
		// also save the respawn time so that the info is maintained past reboots
		StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
		info.set("respawn_time", System.currentTimeMillis() + respawnTime);
		GrandBossManager.getInstance().setStatsSet(QUEEN, info);
		_nurses.clear();
		_larva.deleteMe();
		_larva = null;
		_queen = null;
	}
	else if (_queen != null && !_queen.isAlikeDead())
	{
		if (npcId == ROYAL)
		{
			L2MonsterInstance mob = (L2MonsterInstance)npc;
			if (mob.getLeader() != null)
				mob.getLeader().getMinionList().onMinionDie(mob, (280 + Rnd.get(40)) * 1000);
		}
		else if (npcId == NURSE)
		{
			L2MonsterInstance mob = (L2MonsterInstance)npc;
			_nurses.remove(mob);
			if (mob.getLeader() != null)
				mob.getLeader().getMinionList().onMinionDie(mob, 10000);
		}
	}
	return super.onKill(npc, killer, isPet);
}

public static void main(String[] args)
{
	// now call the constructor (starts up the ai)
	new QueenAnt(-1, "queen_ant", "ai");
}
}

  • 0
Posted

That issue has been fixed on aCis months ago, it's when you try to spawn multiple queen ant, the script can't follow on larva stuff if I remember.

 

This issue still exist on regular L2J (hi5).

  • 0
Posted

@author

Could you dump your `grandboss_data` from your db and show it to us?

 

pd: did u changed anything related with grandbosses? or is it default like?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2 ASAGONIUM - High Five heavily customised PVE Server [OPEN BETA] Website: http://l2asagonium.eu/ Hello everyone, After months of development, tuning and a lot of late nights, I'd like to introduce you to L2 Asagonium - a Lineage 2 High Five server built around one simple idea: a fair, long-lasting world where your time and skill matter more than your wallet. We are currently in OPEN BETA, which means the server is fully online, fully playable, and we are actively listening to feedback to polish the final experience before the official launch. ----------------------------------------------------------- ABOUT THE SERVER - Chronicle: High Five (Mobius) - Type: Really hard PVE with custom content - Status: Open Beta - join, test, shape the server - Mentality: No Pay-to-Win. Ever. ----------------------------------------------------------- WHAT MAKES ASAGONIUM DIFFERENT 1) Custom Armor & Weapon Sets We have introduced new tiers of equipment (Twilight, Cronos, Olympus, Exodus, Leviathan, Ixion, Assassin, Odyssey, Chaos, Immortal) with their own visuals, set bonuses and passive skills. Each set has a clear identity and a real role in the meta - no "one best set wins everything". 2) Custom Passive Skills New Asagonium passive skills (P.Atk, M.Atk, HP, Haste and more) tied to gear and progression, so character building has more depth than just stacking enchants. 3) Live Leaderboards on the Website This is the part I'm most proud of. Our website is connected directly to the game database in real time. You can browse all characters and see: - Level + exact % to next level - Online / Offline / Offline Farming status - "You Died" status (Dark Souls style, stays until next login) - Death counter per character - Total time played (days / hours / minutes) - Top Adena, Top PvP, Top PK - Max Enchant on equipped weapons - Hover a character name to see their passive skills with icons - Hover an enchant value to see the weapon name, P.Atk and set It updates live. Anyone can check the rankings without logging in. ----------------------------------------------------------- NO PAY-TO-WIN - SERIOUSLY I'm tired of servers that promise "balanced donations" and then sell the best items in the cash shop two weeks later. On Asagonium: - No donation items that affect gameplay balance. - No paid enchants, no paid stats, no paid gear. - No "VIP" buffs that make you stronger than free players. Donations (if/when they exist) will be strictly cosmetic and quality-of-life only. The goal is a server that survives because people enjoy playing it, not because a few whales fund it. ----------------------------------------------------------- OPEN BETA - WHY YOU SHOULD JOIN NOW - The server is fully online and stable. - Your feedback directly shapes the final balance. - You get to learn the custom content before everyone else. - Active development - bugs get fixed, ideas get tested fast. ----------------------------------------------------------- HOW TO JOIN 1. Go to http://l2asagonium.eu/ 2. Open "How to Connect" - it walks you through the client download, the 64-bit patch and the system config in 5 simple steps. ----------------------------------------------------------- LINKS http://l2asagonium.eu/ ----------------------------------------------------------- Thanks for reading. If you give Asagonium a try during the beta, please drop your feedback - good or bad. That's exactly what this phase is for. See you in-game.
    • Please note:i will provide you with forum address for registration once buyer sends money(my commission) to forum guarantor's payment details. You can register on forum in any day and in any time,which are convenient for you,send code word in private message to forum guarantor(you will receive code word from buyer). If buyer does not purchase your product,you will need to wait private message(answer) from forum guarantor to compare code word. I will invite you in "forum deal". I will add your name,which you registered on forum,in "forum deal". Then you write in "forum deal": "buyer did not purchase product" and add code word(you will have this right according to clause in forum questionnaire). Forum guarantor will refund buyer((in full amount). If buyer purchases your product,buyer notifies forum guarantor and forum guarantor will send money to my payment details.   Sports exercise machines,jacuzzi,building materials,cosmetics,perfumes,shoes,clothing,furniture,bags,televisions,music centers,telephones,laptops,tablet computers,refrigerators,washing machines,microwaves,fans.  
    • Here is a L2JMobius Classic Interlude FULL server. The share includes full server source+datapack, patch, interface and the P110 client. The original build is L2JMobius. However it was bought from a user called "ClassicLude (https://classic-lude.org/)" which is also a huge scammer, selling free Mobius files for $500. I could not believe someone actually bought this, yet here we are.    Unfortunately the admin is a scammer and refused to pay his remaining balance of over $150 to me since he is too busy "working for Bill Gates" and opening the next big mega mall in ChatGPT city therefore not having enough money. The server itself garnered a massive 30 players so I can't really tell you if this is usable. Knowing its backstory and that it is Mobius based i can surmise that it is NOT suitable for serious users. This build is the result of typical AI slop and vibecode "admins" thinking they just "one shotted L2J" because they discovered how to prompt an agent.   I have made the following changes, some of which were regrettably butchered by the admin after he discovered how to download Cursor. Not much more was done due to the absolute displeasure and misery of having to work on a Mobius server.   - Updated files to JDK 22 - Added l2 reborn community board - Added preview system for skins including mounts/agathions - Added AIO npc (buffer/store/teleporter) - Added QuickVar system - Added Ranking system (pvp/pk/online/level and moar) - Added raid boss list on community board - Added drop search+shift click with itemtooltip on community board and npc - Added l2 reborn styled flash windows and window borders and L2UI_CT1 - Added custom donate coin icon in the store swf - Fixed some random bugs like Hot Springs monsters not giving the disease     Links Source+Datapack: https://drive.google.com/file/d/1uMaTzSxKtnLxXC-VoZyHYW_OXq7Oof5L/view?usp=sharing Interface+Compiler+Client tools: https://drive.google.com/file/d/14IJWyYSDOjMycHnJ749H9dRXuv2JeYK3/view?usp=sharing Full Client: https://drive.google.com/file/d/1P7Yd9wI0XcWlLMFDPSdfTZgWhW_9JEii/view?usp=sharing
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..