Hello here is my instance the problem is i go to the instance but the mobs dont spawn any help?
package net.sf.l2j.gameserver.instances.Tsarka;
import net.sf.l2j.gameserver.instancemanager.InstanceManager;
import net.sf.l2j.gameserver.instancemanager.InstanceManager.InstanceWorld;
import net.sf.l2j.gameserver.model.L2Party;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.L2Summon;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.olympiad.Olympiad;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
public class Tsarka extends Quest
{
//NPCs
private static int Kourampies = 96012;
private static int EXIT_TELEPORTER = 90013;
//BOSSES
private static final int[] BOSSES = {95602,95622,95623,95624,95644};
//final bosses
private static final int[] GRAND_BOSSES = {95634,95117};
//MOBS
private static final int[] MOBS = {22528,95132,22526,22363,21395,95107};
private static String qn = "Tsarka";
private static final int INSTANCEID = 2001;
//REQUIREMENTS
private static boolean debug = false;
private static int levelReq = 86;
private static int pvpReq = 100;
private static int fameReq = 0;
private static int pkReq = 0;
private class teleCoord {int instanceId; int x; int y; int z;}
public class TsarkaWorld extends InstanceWorld
{
public TsarkaWorld()
{
InstanceManager.getInstance().super();
}
}
public Tsarka(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(Kourampies);
addTalkId(Kourampies);
addTalkId(EXIT_TELEPORTER);
for (int boss : BOSSES)
addKillId(boss);
for (int mob : MOBS)
addKillId(mob);
for (int mob : GRAND_BOSSES)
addKillId(mob);
}
public static void main(String[] args)
{
new Tsarka(-1, qn, "instances");
}
private boolean checkConditions(L2PcInstance player, boolean single)
{
if (debug || player.isGM())
return true;
else
{
final L2Party party = player.getParty();
if (!single && (party == null || party.getMemberCount() < 4 || party.getMemberCount() > 7))
{
player.sendMessage("This is a 4-7 player party instance, so you must have a party of 4-7 people");
return false;
}
if (!single && party.getPartyLeaderOID() != player.getObjectId())
{
player.sendPacket(new SystemMessage(2185));
return false;
}
if (!single)
{
/*if (!checkIPs(party))
return false;*/
boolean canEnter = true;
for (L2PcInstance ptm : party.getPartyMembers())
{
if (ptm == null) return false;
if (ptm.getLevel() < levelReq)
{
ptm.sendMessage("You must be level "+levelReq+" to enter this instance");
canEnter = false;
}
else if (ptm.getPvpKills() < pvpReq)
{
ptm.sendMessage("You must have "+pvpReq+" PvPs to enter this instance");
canEnter = false;
}
else if (ptm.getPvpKills() < pkReq)
{
ptm.sendMessage("You must have "+pkReq+" PKs to enter this instance");
canEnter = false;
}
else if (ptm.getPvpKills() < fameReq)
{
ptm.sendMessage("You must have "+fameReq+" fame to enter this instance");
canEnter = false;
}
else if (ptm.getPvpFlag() != 0 || ptm.getKarma() > 0)
{
ptm.sendMessage("You can't enter the instance while in PVP mode or have karma");
canEnter = false;
}
else if (ptm.isInFunEvent())
{
ptm.sendMessage("You can't enter the instance while in an event");
canEnter = false;
}
else if (ptm.isInDuel() || ptm.isInOlympiadMode() || Olympiad.getInstance().isRegistered(ptm))
{
ptm.sendMessage("You can't enter the instance while in duel/oly");
canEnter = false;
}
else if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(ptm.getAccountName(), INSTANCEID))
{
ptm.sendMessage("You can only enter this instance once every day, wait until the next 12AM");
canEnter = false;
}
else if (!ptm.isInsideRadius(player, 500, true, false))
{
ptm.sendMessage("You're too far away from your party leader");
player.sendMessage("One of your party members is too far away");
canEnter = false;
}
else
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
ptm.sendMessage("You can't enter because you have entered into another instance that hasn't expired yet, try waiting 5 min");
canEnter = false;
}
}
if (!canEnter)
{
ptm.sendMessage("You're preventing your party from entering an instance");
if (ptm != player)
player.sendMessage(ptm.getName()+" is preventing you from entering the instance");
return false;
}
}
}
else
{
if (player.getLevel() < levelReq)
{
player.sendMessage("You must be level "+levelReq+" to enter this instance");
return false;
}
else if (player.getPvpKills() < pvpReq)
{
player.sendMessage("You must have "+pvpReq+" PvPs to enter this instance");
return false;
}
else if (player.getPvpFlag() != 0 || player.getKarma() > 0)
{
player.sendMessage("You can't enter the instance while in PVP mode or have karma");
return false;
}
else if (player.isInFunEvent())
{
player.sendMessage("You can't enter the instance while in an event");
return false;
}
else if (player.isInDuel() || player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player))
{
player.sendMessage("You can't enter the instance while in duel/oly");
return false;
}
}
return true;
}
}
private void teleportplayer(L2PcInstance player, teleCoord teleto)
{
player.setInstanceId(teleto.instanceId);
player.teleToLocation(teleto.x, teleto.y, teleto.z);
L2Summon pet = player.getPet();
if (pet != null)
{
pet.setInstanceId(teleto.instanceId);
pet.teleToLocation(teleto.x, teleto.y, teleto.z);
}
}
protected int enterInstance(L2PcInstance player, String template, teleCoord teleto)
{
int instanceId = 0;
//check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
//existing instance
if (world != null)
{
if (world.templateId != INSTANCEID)
{
player.sendPacket(new SystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER));
return 0;
}
if (!checkConditions(player, true))
return 0;
teleto.instanceId = world.instanceId;
teleportplayer(player,teleto);
return instanceId;
}
else //New instance
{
if (!checkConditions(player, false))
return 0;
instanceId = InstanceManager.getInstance().createDynamicInstance(template);
world = new TsarkaWorld();
world.instanceId = instanceId;
world.templateId = INSTANCEID;
InstanceManager.getInstance().addWorld(world);
_log.info("Tsarka: new " + template + " Instance: " + instanceId + " created by player: " + player.getName());
// teleport players
teleto.instanceId = instanceId;
L2Party party = player.getParty();
if (party == null)
{
if (!player.isGM())
return 0;
// this can happen only if debug is true
InstanceManager.getInstance().setInstanceTime(player.getAccountName(), INSTANCEID, getNextInstanceTime(TWODAYS));
world.allowed.add(player.getObjectId());
auditInstances(player, template, instanceId);
teleportplayer(player,teleto);
}
else
{
for (L2PcInstance partyMember : party.getPartyMembers())
{
partyMember.sendMessage("You have entered the Dragon Valley Caves");
InstanceManager.getInstance().setInstanceTime(partyMember.getAccountName(), INSTANCEID, getNextInstanceTime(TWODAYS));
world.allowed.add(partyMember.getObjectId());
auditInstances(partyMember, template, instanceId);
teleportplayer(partyMember,teleto);
}
spawnExitGK((TsarkaWorld) world, player);
}
return instanceId;
}
}
protected void exitInstance(L2PcInstance player, teleCoord tele)
{
player.setInstanceId(0);
player.teleToLocation(tele.x, tele.y, tele.z);
L2Summon pet = player.getPet();
if (pet != null)
{
pet.setInstanceId(0);
pet.teleToLocation(tele.x, tele.y, tele.z);
}
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final int npcId = npc.getNpcId();
QuestState st = player.getQuestState(qn);
if (st == null)
st = newQuestState(player);
if (npcId == Kourampies)
{
teleCoord teleto = new teleCoord();
teleto.x = 131175;
teleto.y = 114415;
teleto.z = -3715;
enterInstance(player, "Tsarka.xml", teleto);
}
else if (npcId == EXIT_TELEPORTER)
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world == null || !(world instanceof TsarkaWorld))
return null;
teleCoord teleto = new teleCoord();
teleto.x = -82993;
teleto.y = 150860;
teleto.z = -3129;
if (player.getParty() == null)
{
exitInstance(player, teleto);
player.sendPacket(new ExShowScreenMessage("You have completed the Tsarka instance", 6000));
}
else
{
for (L2PcInstance ptm : player.getParty().getPartyMembers())
{
exitInstance(ptm, teleto);
player.sendPacket(new ExShowScreenMessage("You have completed the Tsarka instance", 6000));
}
}
st.exitQuest(true);
}
return null;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
{
return null;
}
public void spawnExitGK(TsarkaWorld world, L2PcInstance player)
{
addSpawn(EXIT_TELEPORTER, 153073, 122107, -3805, 0, false, 0, false, world.instanceId);
}
}
Both are in-game bots. I'm looking for an out-of-game bot ((one that doesn’t require the L2 client).
Hmm, never heard about this bot. Will check, thank you
🎉 L2Mid is back!
After a 3-year pause, we’re launching a new Interlude server based on the original Interlude client (old school 😉).
What to expect
• The classic Interlude spirit
• Old friends, rival clans, and returning legends
• A season focused on pure nostalgia
This may be our final Interlude server. (maybe 😉)
🗓️ Opening: December 5, 2025 at 20:00 (GMT+2)
https://l2mid.com
Question
ThelwHelpRePaidia
Hello here is my instance the problem is i go to the instance but the mobs dont spawn any help?
package net.sf.l2j.gameserver.instances.Tsarka; import net.sf.l2j.gameserver.instancemanager.InstanceManager; import net.sf.l2j.gameserver.instancemanager.InstanceManager.InstanceWorld; import net.sf.l2j.gameserver.model.L2Party; import net.sf.l2j.gameserver.model.actor.L2Npc; import net.sf.l2j.gameserver.model.actor.L2Summon; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.olympiad.Olympiad; import net.sf.l2j.gameserver.model.quest.Quest; import net.sf.l2j.gameserver.model.quest.QuestState; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage; import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; public class Tsarka extends Quest { //NPCs private static int Kourampies = 96012; private static int EXIT_TELEPORTER = 90013; //BOSSES private static final int[] BOSSES = {95602,95622,95623,95624,95644}; //final bosses private static final int[] GRAND_BOSSES = {95634,95117}; //MOBS private static final int[] MOBS = {22528,95132,22526,22363,21395,95107}; private static String qn = "Tsarka"; private static final int INSTANCEID = 2001; //REQUIREMENTS private static boolean debug = false; private static int levelReq = 86; private static int pvpReq = 100; private static int fameReq = 0; private static int pkReq = 0; private class teleCoord {int instanceId; int x; int y; int z;} public class TsarkaWorld extends InstanceWorld { public TsarkaWorld() { InstanceManager.getInstance().super(); } } public Tsarka(int questId, String name, String descr) { super(questId, name, descr); addStartNpc(Kourampies); addTalkId(Kourampies); addTalkId(EXIT_TELEPORTER); for (int boss : BOSSES) addKillId(boss); for (int mob : MOBS) addKillId(mob); for (int mob : GRAND_BOSSES) addKillId(mob); } public static void main(String[] args) { new Tsarka(-1, qn, "instances"); } private boolean checkConditions(L2PcInstance player, boolean single) { if (debug || player.isGM()) return true; else { final L2Party party = player.getParty(); if (!single && (party == null || party.getMemberCount() < 4 || party.getMemberCount() > 7)) { player.sendMessage("This is a 4-7 player party instance, so you must have a party of 4-7 people"); return false; } if (!single && party.getPartyLeaderOID() != player.getObjectId()) { player.sendPacket(new SystemMessage(2185)); return false; } if (!single) { /*if (!checkIPs(party)) return false;*/ boolean canEnter = true; for (L2PcInstance ptm : party.getPartyMembers()) { if (ptm == null) return false; if (ptm.getLevel() < levelReq) { ptm.sendMessage("You must be level "+levelReq+" to enter this instance"); canEnter = false; } else if (ptm.getPvpKills() < pvpReq) { ptm.sendMessage("You must have "+pvpReq+" PvPs to enter this instance"); canEnter = false; } else if (ptm.getPvpKills() < pkReq) { ptm.sendMessage("You must have "+pkReq+" PKs to enter this instance"); canEnter = false; } else if (ptm.getPvpKills() < fameReq) { ptm.sendMessage("You must have "+fameReq+" fame to enter this instance"); canEnter = false; } else if (ptm.getPvpFlag() != 0 || ptm.getKarma() > 0) { ptm.sendMessage("You can't enter the instance while in PVP mode or have karma"); canEnter = false; } else if (ptm.isInFunEvent()) { ptm.sendMessage("You can't enter the instance while in an event"); canEnter = false; } else if (ptm.isInDuel() || ptm.isInOlympiadMode() || Olympiad.getInstance().isRegistered(ptm)) { ptm.sendMessage("You can't enter the instance while in duel/oly"); canEnter = false; } else if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(ptm.getAccountName(), INSTANCEID)) { ptm.sendMessage("You can only enter this instance once every day, wait until the next 12AM"); canEnter = false; } else if (!ptm.isInsideRadius(player, 500, true, false)) { ptm.sendMessage("You're too far away from your party leader"); player.sendMessage("One of your party members is too far away"); canEnter = false; } else { final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); if (world != null) { ptm.sendMessage("You can't enter because you have entered into another instance that hasn't expired yet, try waiting 5 min"); canEnter = false; } } if (!canEnter) { ptm.sendMessage("You're preventing your party from entering an instance"); if (ptm != player) player.sendMessage(ptm.getName()+" is preventing you from entering the instance"); return false; } } } else { if (player.getLevel() < levelReq) { player.sendMessage("You must be level "+levelReq+" to enter this instance"); return false; } else if (player.getPvpKills() < pvpReq) { player.sendMessage("You must have "+pvpReq+" PvPs to enter this instance"); return false; } else if (player.getPvpFlag() != 0 || player.getKarma() > 0) { player.sendMessage("You can't enter the instance while in PVP mode or have karma"); return false; } else if (player.isInFunEvent()) { player.sendMessage("You can't enter the instance while in an event"); return false; } else if (player.isInDuel() || player.isInOlympiadMode() || Olympiad.getInstance().isRegistered(player)) { player.sendMessage("You can't enter the instance while in duel/oly"); return false; } } return true; } } private void teleportplayer(L2PcInstance player, teleCoord teleto) { player.setInstanceId(teleto.instanceId); player.teleToLocation(teleto.x, teleto.y, teleto.z); L2Summon pet = player.getPet(); if (pet != null) { pet.setInstanceId(teleto.instanceId); pet.teleToLocation(teleto.x, teleto.y, teleto.z); } } protected int enterInstance(L2PcInstance player, String template, teleCoord teleto) { int instanceId = 0; //check for existing instances for this player InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); //existing instance if (world != null) { if (world.templateId != INSTANCEID) { player.sendPacket(new SystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER)); return 0; } if (!checkConditions(player, true)) return 0; teleto.instanceId = world.instanceId; teleportplayer(player,teleto); return instanceId; } else //New instance { if (!checkConditions(player, false)) return 0; instanceId = InstanceManager.getInstance().createDynamicInstance(template); world = new TsarkaWorld(); world.instanceId = instanceId; world.templateId = INSTANCEID; InstanceManager.getInstance().addWorld(world); _log.info("Tsarka: new " + template + " Instance: " + instanceId + " created by player: " + player.getName()); // teleport players teleto.instanceId = instanceId; L2Party party = player.getParty(); if (party == null) { if (!player.isGM()) return 0; // this can happen only if debug is true InstanceManager.getInstance().setInstanceTime(player.getAccountName(), INSTANCEID, getNextInstanceTime(TWODAYS)); world.allowed.add(player.getObjectId()); auditInstances(player, template, instanceId); teleportplayer(player,teleto); } else { for (L2PcInstance partyMember : party.getPartyMembers()) { partyMember.sendMessage("You have entered the Dragon Valley Caves"); InstanceManager.getInstance().setInstanceTime(partyMember.getAccountName(), INSTANCEID, getNextInstanceTime(TWODAYS)); world.allowed.add(partyMember.getObjectId()); auditInstances(partyMember, template, instanceId); teleportplayer(partyMember,teleto); } spawnExitGK((TsarkaWorld) world, player); } return instanceId; } } protected void exitInstance(L2PcInstance player, teleCoord tele) { player.setInstanceId(0); player.teleToLocation(tele.x, tele.y, tele.z); L2Summon pet = player.getPet(); if (pet != null) { pet.setInstanceId(0); pet.teleToLocation(tele.x, tele.y, tele.z); } } @Override public String onTalk(L2Npc npc, L2PcInstance player) { final int npcId = npc.getNpcId(); QuestState st = player.getQuestState(qn); if (st == null) st = newQuestState(player); if (npcId == Kourampies) { teleCoord teleto = new teleCoord(); teleto.x = 131175; teleto.y = 114415; teleto.z = -3715; enterInstance(player, "Tsarka.xml", teleto); } else if (npcId == EXIT_TELEPORTER) { final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); if (world == null || !(world instanceof TsarkaWorld)) return null; teleCoord teleto = new teleCoord(); teleto.x = -82993; teleto.y = 150860; teleto.z = -3129; if (player.getParty() == null) { exitInstance(player, teleto); player.sendPacket(new ExShowScreenMessage("You have completed the Tsarka instance", 6000)); } else { for (L2PcInstance ptm : player.getParty().getPartyMembers()) { exitInstance(ptm, teleto); player.sendPacket(new ExShowScreenMessage("You have completed the Tsarka instance", 6000)); } } st.exitQuest(true); } return null; } @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) { return null; } public void spawnExitGK(TsarkaWorld world, L2PcInstance player) { addSpawn(EXIT_TELEPORTER, 153073, 122107, -3805, 0, false, 0, false, world.instanceId); } }3 answers to this question
Recommended Posts