- 0
[Help] InvocationTargetException Queen Ant
-
Posts
-
You should buy it then I’ll make a discount
-
Hi everyone, In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then. LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform. The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required. My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more. Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords) I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
-
Topics

Question
Escalofrios
Hi all, look, i have this problem with the Queen Ant, she cannot respawn...
Queen Ant Report Error:
--
Error on: C:\Server\GameServer\data\scripts\ai\individual\QueenAnt.java.error.log
Line: -1 - Column: -1
java.lang.reflect.InvocationTargetException
--
QueenAnt.java
/*
* 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 net.sf.l2j.ExternalConfig;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.model.L2Attackable;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
import net.sf.l2j.gameserver.templates.StatsSet;
import net.sf.l2j.util.Rnd;
import ai.group_template.L2AttackableAIScript;
/**
* 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;
//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 List<L2Attackable> _Minions = new FastList<L2Attackable>();
public QueenAnt (int questId, String name, String descr)
{
super(questId,name,descr);
int[] mobs = {QUEEN, LARVA, NURSE, GUARD, ROYAL};
registerMobs(mobs);
_Zone = GrandBossManager.getInstance().getZone(-21610,181594,-5734);
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,-21610,181594,-5734,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");
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN,loc_x,loc_y,loc_z,heading,false,0);
queen.setCurrentHpMp(hp,mp);
spawnBoss(queen);
}
}
public 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);
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
//Spawn minions
addSpawn(LARVA,-21600,179482,-5846,Rnd.get(360),false,0).setIsRaidMinion(true);
addSpawn(NURSE,-22000,179482,-5846,0,false,0).setIsRaidMinion(true);
addSpawn(NURSE,-21200,179482,-5846,0,false,0).setIsRaidMinion(true);
int radius = 400;
for (int i=0;i<6;i++)
{
int x = (int) (radius*Math.cos(i*1.407)); //1.407~2pi/6
int y = (int) (radius*Math.sin(i*1.407));
addSpawn(NURSE,npc.getX()+x,npc.getY()+y,npc.getZ(),0,false,0).setIsRaidMinion(true);
}
for (int i=0;i<8;i++)
{
int x = (int) (radius*Math.cos(i*.7854)); //.7854~2pi/8
int y = (int) (radius*Math.sin(i*.7854));
L2NpcInstance mob = addSpawn(ROYAL,npc.getX()+x,npc.getY()+y,npc.getZ(),0,false,0);
mob.setIsRaidMinion(true);
_Minions.add((L2Attackable)mob);
}
startQuestTimer("check_royal__Zone",120000,npc,null,true);
}
public String onAdvEvent (String event, L2NpcInstance npc, L2PcInstance player)
{
if (event.equalsIgnoreCase("action") && npc != null)
{
if (Rnd.get(3)==0)
{
if (Rnd.get(2)==0)
{
npc.broadcastPacket(new SocialAction(npc.getObjectId(),3));
}
else
{
npc.broadcastPacket(new SocialAction(npc.getObjectId(),4));
}
}
}
else if (event.equalsIgnoreCase("queen_unlock"))
{
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN,-21610,181594,-5734,0,false,0);
GrandBossManager.getInstance().setBossStatus(QUEEN,ALIVE);
spawnBoss(queen);
}
else if (event.equalsIgnoreCase("check_royal__Zone") && npc != null)
{
for (int i=0;i<_Minions.size();i++)
{
L2Attackable mob = _Minions.get(i);
if (mob != null && !_Zone.isInsideZone(mob))
{
mob.teleToLocation(npc.getX(),npc.getY(),npc.getZ());
}
}
}
else if (event.equalsIgnoreCase("despawn_royals"))
{
for (int i=0;i<_Minions.size();i++)
{
L2Attackable mob = _Minions.get(i);
if (mob != null)
{
mob.decayMe();
}
}
_Minions.clear();
}
else if (event.equalsIgnoreCase("spawn_royal"))
{
L2NpcInstance mob = addSpawn(ROYAL,npc.getX(),npc.getY(),npc.getZ(),0,false,0);
mob.setIsRaidMinion(true);
_Minions.add((L2Attackable)mob);
}
else if (event.equalsIgnoreCase("spawn_nurse"))
{
addSpawn(NURSE,npc.getX(),npc.getY(),npc.getZ(),0,false,0).setIsRaidMinion(true);
}
return super.onAdvEvent(event, npc, player);
}
public String onFactionCall (L2NpcInstance npc, L2NpcInstance caller, L2PcInstance attacker, boolean isPet)
{
if (caller == null || npc == null)
return super.onFactionCall(npc, caller, attacker, isPet);
int npcId = npc.getNpcId();
int callerId = caller.getNpcId();
if (npcId == NURSE)
{
if (callerId == LARVA)
{
npc.setTarget(caller);
npc.doCast(SkillTable.getInstance().getInfo(4020,1));
npc.doCast(SkillTable.getInstance().getInfo(4024,1));
return null;
}
else if (callerId == QUEEN)
{
if (npc.getTarget() != null && npc.getTarget() instanceof L2NpcInstance)
{
if (((L2NpcInstance) npc.getTarget()).getNpcId() == LARVA)
{
return null;
}
}
npc.setTarget(caller);
npc.doCast(SkillTable.getInstance().getInfo(4020,1));
return null;
}
}
return super.onFactionCall(npc, caller, attacker, isPet);
}
public String onAttack (L2NpcInstance npc, L2PcInstance attacker, int damage, boolean isPet)
{
int npcId = npc.getNpcId();
if (npcId == NURSE)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
return null;
}
return super.onAttack(npc, attacker, damage, isPet);
}
public String onKill (L2NpcInstance 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 = ExternalConfig.Interval_Of_QueenAnt_Spawn + Rnd.get(ExternalConfig.Random_Of_QueenAnt_Spawn);
startQuestTimer("queen_unlock", respawnTime, null, null);
cancelQuestTimer("action", npc, 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);
startQuestTimer("despawn_royals",20000,null,null);
this.cancelQuestTimers("spawn_minion");
}
else if (GrandBossManager.getInstance().getBossStatus(QUEEN) == ALIVE)
{
if (npcId == ROYAL)
{
_Minions.remove(npc);
this.startQuestTimer("spawn_royal",(280+Rnd.get(40))*1000,npc,null);
}
else if (npcId == NURSE)
{
startQuestTimer("spawn_nurse",10000,npc,null);
}
}
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");
}
}
How i can repair this? Thanks to all!!
Chronicle: C6 (Interlude - L2J)
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now