Jump to content
  • 0

Some Problems


Question

Posted (edited)

I got some questions :

 

Question about Beleth Instance.

Where can I change the required amount of players?
I have configured 2 people via the L2Config.
But when I port in immediately get ported out.
And about Baium zone, idk if its an instance.
I can get ported in every minute and can wakeup baium
everytime. Infinity baiums can be done. Its just takes
my blooded fabric and lets me port in, how do I change these?

 

-Can't walk while talking to NPCs

-I want to disable attacking of NPCs
-Can't go alone into seed of destruction

-Can warp through everything

 

I already change the required amount of players but I still can't get in

/* * Copyright (C) 2004-2013 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack 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.
 * 
 * L2J DataPack 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 instances.SeedOfDestruction;


import java.io.File;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;


import javax.xml.parsers.DocumentBuilderFactory;


import javolution.util.FastList;
import javolution.util.FastMap;


import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;


import com.l2jserver.Config;
import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.instancemanager.GraciaSeedsManager;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.L2CharPosition;
import com.l2jserver.gameserver.model.L2CommandChannel;
import com.l2jserver.gameserver.model.L2Object.InstanceType;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.L2Territory;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.L2Trap;
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.skills.L2Skill;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.util.Util;


/**
 * Seed of Destruction instance zone.<br>
 * TODO:
 * <ul>
 * <li>No random mob spawns after mob kill.</li>
 * <li>Implement Seed of Destruction Defense state and one party instances.</li>
 * <li>Use proper zone spawn system.</li>
 * </ul>
 * Please maintain consistency between the Seed scripts.
 * @author Gigiikun
 */
public class Stage1 extends Quest
{
protected class SOD1World extends InstanceWorld
{
public Map<L2Npc, Boolean> npcList = new FastMap<>();
public int deviceSpawnedMobCount = 0;
public Lock lock = new ReentrantLock();
}


protected static class SODSpawn
{
public boolean isZone = false;
public boolean isNeededNextFlag = false;
public int npcId;
public int x = 0;
public int y = 0;
public int z = 0;
public int h = 0;
public int zone = 0;
public int count = 0;
}


private static final String qn = "SoDStage1";
private static final int INSTANCEID = 110; // this is the client number
private static final int MIN_PLAYERS = 1;
private static final int MAX_PLAYERS = 1;
private static final int MAX_DEVICESPAWNEDMOBCOUNT = 100; // prevent too much mob spawn


private final Map<Integer, L2Territory> _spawnZoneList = new HashMap<>();
private final Map<Integer, List<SODSpawn>> _spawnList = new HashMap<>();
private final List<Integer> _mustKillMobsId = new FastList<>();


// teleports
private static final Location ENTER_TELEPORT_1 = new Location(-242759, 219981, -9986);
private static final Location ENTER_TELEPORT_2 = new Location(-245800, 220488, -12112);
private static final Location CENTER_TELEPORT = new Location(-245802, 220528, -12104);


// Traps/Skills
private static final SkillHolder TRAP_HOLD = new SkillHolder(4186, 9); // 18720-18728
private static final SkillHolder TRAP_STUN = new SkillHolder(4072, 10); // 18729-18736
private static final SkillHolder TRAP_DAMAGE = new SkillHolder(5340, 4); // 18737-18770
private static final SkillHolder TRAP_SPAWN = new SkillHolder(10002, 1); // 18771-18774 : handled in this script
private static final int[] TRAP_18771_NPCS =
{
22541,
22544,
22541,
22544
};
private static final int[] TRAP_OTHER_NPCS =
{
22546,
22546,
22538,
22537
};


// NPCs
private static final int ALENOS = 32526;
private static final int TELEPORT = 32601;


// mobs
private static final int OBELISK = 18776;
private static final int POWERFUL_DEVICE = 18777;
private static final int THRONE_POWERFUL_DEVICE = 18778;
private static final int SPAWN_DEVICE = 18696;
private static final int TIAT = 29163;
private static final int TIAT_GUARD = 29162;
private static final int TIAT_GUARD_NUMBER = 5;
private static final int TIAT_VIDEO_NPC = 29169;
private static final L2CharPosition MOVE_TO_TIAT = new L2CharPosition(-250403, 207273, -11952, 16384);
private static final L2CharPosition MOVE_TO_DOOR = new L2CharPosition(-251432, 214905, -12088, 16384);


// TODO: handle this better
private static final int[] SPAWN_MOB_IDS =
{
22536,
22537,
22538,
22539,
22540,
22541,
22542,
22543,
22544,
22547,
22550,
22551,
22552,
22596
};


// Doors/Walls/Zones
private static final int[] ATTACKABLE_DOORS =
{
12240005,
12240006,
12240007,
12240008,
12240009,
12240010,
12240013,
12240014,
12240015,
12240016,
12240017,
12240018,
12240021,
12240022,
12240023,
12240024,
12240025,
12240026,
12240028,
12240029,
12240030
};
private static final int[] ENTRANCE_ROOM_DOORS =
{
12240001,
12240002
};
private static final int[] SQUARE_DOORS =
{
12240003,
12240004,
12240011,
12240012,
12240019,
12240020
};
private static final int SCOUTPASS_DOOR = 12240027;
private static final int FORTRESS_DOOR = 12240030;
private static final int THRONE_DOOR = 12240031;


// spawns


// Initialization at 6:30 am on Wednesday and Saturday
private static final int RESET_HOUR = 6;
private static final int RESET_MIN = 30;
private static final int RESET_DAY_1 = 4;
private static final int RESET_DAY_2 = 7;


private void load()
{
int spawnCount = 0;
try
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);


File file = new File(Config.DATAPACK_ROOT + "/data/spawnZones/seed_of_destruction.xml");
if (!file.exists())
{
_log.severe("[Seed of Destruction] Missing seed_of_destruction.xml. The quest wont work without it!");
return;
}


Document doc = factory.newDocumentBuilder().parse(file);
Node first = doc.getFirstChild();
if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
{
for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("npc".equalsIgnoreCase(n.getNodeName()))
{
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if ("spawn".equalsIgnoreCase(d.getNodeName()))
{
NamedNodeMap attrs = d.getAttributes();
Node att = attrs.getNamedItem("npcId");
if (att == null)
{
_log.severe("[Seed of Destruction] Missing npcId in npc List, skipping");
continue;
}
int npcId = Integer.parseInt(attrs.getNamedItem("npcId").getNodeValue());


att = attrs.getNamedItem("flag");
if (att == null)
{
_log.severe("[Seed of Destruction] Missing flag in npc List npcId: " + npcId + ", skipping");
continue;
}
int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
if (!_spawnList.containsKey(flag))
{
_spawnList.put(flag, new FastList<SODSpawn>());
}


for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{
if ("loc".equalsIgnoreCase(cd.getNodeName()))
{
attrs = cd.getAttributes();
SODSpawn spw = new SODSpawn();
spw.npcId = npcId;


att = attrs.getNamedItem("x");
if (att != null)
{
spw.x = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("y");
if (att != null)
{
spw.y = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("z");
if (att != null)
{
spw.z = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("heading");
if (att != null)
{
spw.h = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("mustKill");
if (att != null)
{
spw.isNeededNextFlag = Boolean.parseBoolean(att.getNodeValue());
}
if (spw.isNeededNextFlag)
{
_mustKillMobsId.add(npcId);
}
_spawnList.get(flag).add(spw);
spawnCount++;
}
else if ("zone".equalsIgnoreCase(cd.getNodeName()))
{
attrs = cd.getAttributes();
SODSpawn spw = new SODSpawn();
spw.npcId = npcId;
spw.isZone = true;


att = attrs.getNamedItem("id");
if (att != null)
{
spw.zone = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("count");
if (att != null)
{
spw.count = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("mustKill");
if (att != null)
{
spw.isNeededNextFlag = Boolean.parseBoolean(att.getNodeValue());
}
if (spw.isNeededNextFlag)
{
_mustKillMobsId.add(npcId);
}
_spawnList.get(flag).add(spw);
spawnCount++;
}
}
}
}
}
else if ("spawnZones".equalsIgnoreCase(n.getNodeName()))
{
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if ("zone".equalsIgnoreCase(d.getNodeName()))
{
NamedNodeMap attrs = d.getAttributes();
Node att = attrs.getNamedItem("id");
if (att == null)
{
_log.severe("[Seed of Destruction] Missing id in spawnZones List, skipping");
continue;
}
int id = Integer.parseInt(att.getNodeValue());
att = attrs.getNamedItem("minZ");
if (att == null)
{
_log.severe("[Seed of Destruction] Missing minZ in spawnZones List id: " + id + ", skipping");
continue;
}
int minz = Integer.parseInt(att.getNodeValue());
att = attrs.getNamedItem("maxZ");
if (att == null)
{
_log.severe("[Seed of Destruction] Missing maxZ in spawnZones List id: " + id + ", skipping");
continue;
}
int maxz = Integer.parseInt(att.getNodeValue());
L2Territory ter = new L2Territory(id);


for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
{
if ("point".equalsIgnoreCase(cd.getNodeName()))
{
attrs = cd.getAttributes();
int x, y;
att = attrs.getNamedItem("x");
if (att != null)
{
x = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}
att = attrs.getNamedItem("y");
if (att != null)
{
y = Integer.parseInt(att.getNodeValue());
}
else
{
continue;
}


ter.add(x, y, minz, maxz, 0);
}
}


_spawnZoneList.put(id, ter);
}
}
}
}
}
}
catch (Exception e)
{
_log.log(Level.WARNING, "[Seed of Destruction] Could not parse data.xml file: " + e.getMessage(), e);
}
if (Config.DEBUG)
{
_log.info("[Seed of Destruction] Loaded " + spawnCount + " spawns data.");
_log.info("[Seed of Destruction] Loaded " + _spawnZoneList.size() + " spawn zones data.");
}
}


private boolean checkConditions(L2PcInstance player)
{
final L2Party party = player.getParty();
if (party == null)
{
player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER);
return false;
}
final L2CommandChannel channel = player.getParty().getCommandChannel();
if (channel == null)
{
player.sendPacket(SystemMessageId.NOT_IN_COMMAND_CHANNEL_CANT_ENTER);
return false;
}
else if (channel.getLeader() != player)
{
player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER);
return false;
}
else if ((channel.getMemberCount() < MIN_PLAYERS) || (channel.getMemberCount() > MAX_PLAYERS))
{
player.sendPacket(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER);
return false;
}
for (L2PcInstance partyMember : channel.getMembers())
{
if (partyMember.getLevel() < 75)
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT);
sm.addPcName(partyMember);
party.broadcastPacket(sm);
return false;
}
if (!Util.checkIfInRange(1000, player, partyMember, false))
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED);
sm.addPcName(partyMember);
party.broadcastPacket(sm);
return false;
}
Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
if (System.currentTimeMillis() < reentertime)
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_REENTER_YET);
sm.addPcName(partyMember);
party.broadcastPacket(sm);
return false;
}
}
return true;
}


protected int enterInstance(L2PcInstance player, String template, Location loc)
{
int instanceId = 0;
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof SOD1World))
{
player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
return world.getInstanceId();
}
// New instance
if (!checkConditions(player))
{
return 0;
}
instanceId = InstanceManager.getInstance().createDynamicInstance(template);
world = new SOD1World();
world.setTemplateId(INSTANCEID);
world.setInstanceId(instanceId);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
spawnState((SOD1World) world);
for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors())
{
if (Util.contains(ATTACKABLE_DOORS, door.getDoorId()))
{
door.setIsAttackableDoor(true);
}
}
_log.info("Seed of Destruction started " + template + " Instance: " + instanceId + " created by player: " + player.getName());
// teleport players
if ((player.getParty() == null) || (player.getParty().getCommandChannel() == null))
{
teleportPlayer(player, loc, instanceId, false);
world.addAllowed(player.getObjectId());
}
else
{
for (L2PcInstance channelMember : player.getParty().getCommandChannel().getMembers())
{
teleportPlayer(channelMember, loc, instanceId, false);
world.addAllowed(channelMember.getObjectId());
}
}
return instanceId;
}


protected boolean checkKillProgress(L2Npc mob, SOD1World world)
{
if (world.npcList.containsKey(mob))
{
world.npcList.put(mob, true);
}
for (boolean isDead : world.npcList.values())
{
if (!isDead)
{
return false;
}
}
return true;
}


private void spawnFlaggedNPCs(SOD1World world, int flag)
{
if (world.lock.tryLock())
{
try
{
for (SODSpawn spw : _spawnList.get(flag))
{
if (spw.isZone)
{
for (int i = 0; i < spw.count; i++)
{
if (_spawnZoneList.containsKey(spw.zone))
{
int[] point = _spawnZoneList.get(spw.zone).getRandomPoint();
spawn(world, spw.npcId, point[0], point[1], GeoData.getInstance().getSpawnHeight(point[0], point[1], point[2], point[3], null), getRandom(65535), spw.isNeededNextFlag);
}
else
{
_log.info("[Seed of Destruction] Missing zone: " + spw.zone);
}
}
}
else
{
spawn(world, spw.npcId, spw.x, spw.y, spw.z, spw.h, spw.isNeededNextFlag);
}
}
}
finally
{
world.lock.unlock();
}
}
}


protected boolean spawnState(SOD1World world)
{
if (world.lock.tryLock())
{
try
{
world.npcList.clear();
switch (world.getStatus())
{
case 0:
spawnFlaggedNPCs(world, 0);
break;
case 1:
ExShowScreenMessage message1 = new ExShowScreenMessage(NpcStringId.THE_ENEMIES_HAVE_ATTACKED_EVERYONE_COME_OUT_AND_FIGHT_URGH, 5, 1);
sendScreenMessage(world, message1);
for (int i : ENTRANCE_ROOM_DOORS)
{
openDoor(i, world.getInstanceId());
}
spawnFlaggedNPCs(world, 1);
break;
case 2:
case 3:
// handled elsewhere
return true;
case 4:
ExShowScreenMessage message2 = new ExShowScreenMessage(NpcStringId.OBELISK_HAS_COLLAPSED_DONT_LET_THE_ENEMIES_JUMP_AROUND_WILDLY_ANYMORE, 5, 1);
sendScreenMessage(world, message2);
for (int i : SQUARE_DOORS)
{
openDoor(i, world.getInstanceId());
}
spawnFlaggedNPCs(world, 4);
break;
case 5:
openDoor(SCOUTPASS_DOOR, world.getInstanceId());
spawnFlaggedNPCs(world, 3);
spawnFlaggedNPCs(world, 5);
break;
case 6:
openDoor(THRONE_DOOR, world.getInstanceId());
break;
case 7:
spawnFlaggedNPCs(world, 7);
break;
case 8:
ExShowScreenMessage message4 = new ExShowScreenMessage(NpcStringId.COME_OUT_WARRIORS_PROTECT_SEED_OF_DESTRUCTION, 5, 1);
sendScreenMessage(world, message4);
world.deviceSpawnedMobCount = 0;
spawnFlaggedNPCs(world, 8);
break;
case 9:
// instance end
break;
}
world.incStatus();
return true;
}
finally
{
world.lock.unlock();
}
}
return false;
}


protected void spawn(SOD1World world, int npcId, int x, int y, int z, int h, boolean addToKillTable)
{
// traps
if ((npcId >= 18720) && (npcId <= 18774))
{
L2Skill skill = null;
if (npcId <= 18728)
{
skill = TRAP_HOLD.getSkill();
}
else if (npcId <= 18736)
{
skill = TRAP_STUN.getSkill();
}
else if (npcId <= 18770)
{
skill = TRAP_DAMAGE.getSkill();
}
else
{
skill = TRAP_SPAWN.getSkill();
}
addTrap(npcId, x, y, z, h, skill, world.getInstanceId());
return;
}
L2Npc npc = addSpawn(npcId, x, y, z, h, false, 0, false, world.getInstanceId());
if (addToKillTable)
{
world.npcList.put(npc, false);
}
npc.setIsNoRndWalk(true);
if (npc.isInstanceType(InstanceType.L2Attackable))
{
((L2Attackable) npc).setSeeThroughSilentMove(true);
}
if (npcId == TIAT_VIDEO_NPC)
{
startQuestTimer("DoorCheck", 10000, npc, null);
}
else if (npcId == SPAWN_DEVICE)
{
npc.disableCoreAI(true);
startQuestTimer("Spawn", 10000, npc, null, true);
}
else if (npcId == TIAT)
{
for (int i = 0; i < TIAT_GUARD_NUMBER; i++)
{
addMinion((L2MonsterInstance) npc, TIAT_GUARD);
}
}
}


protected void setInstanceTimeRestrictions(SOD1World world)
{
Calendar reenter = Calendar.getInstance();
reenter.set(Calendar.MINUTE, RESET_MIN);
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
// if time is >= RESET_HOUR - roll to the next day
if (reenter.getTimeInMillis() <= System.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 1);
}
if (reenter.get(Calendar.DAY_OF_WEEK) <= RESET_DAY_1)
{
while (reenter.get(Calendar.DAY_OF_WEEK) != RESET_DAY_1)
{
reenter.add(Calendar.DAY_OF_MONTH, 1);
}
}
else
{
while (reenter.get(Calendar.DAY_OF_WEEK) != RESET_DAY_2)
{
reenter.add(Calendar.DAY_OF_MONTH, 1);
}
}


SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_RESTRICTED);
sm.addInstanceName(INSTANCEID);


// set instance reenter time for all allowed players
for (int objectId : world.getAllowed())
{
L2PcInstance player = L2World.getInstance().getPlayer(objectId);
InstanceManager.getInstance().setInstanceTime(objectId, INSTANCEID, reenter.getTimeInMillis());
if ((player != null) && player.isOnline())
{
player.sendPacket(sm);
}
}
}


private void sendScreenMessage(SOD1World world, ExShowScreenMessage message)
{
for (int objId : world.getAllowed())
{
L2PcInstance player = L2World.getInstance().getPlayer(objId);
if (player != null)
{
player.sendPacket(message);
}
}
}


@Override
public String onSpawn(L2Npc npc)
{
if (npc.getNpcId() == TIAT_GUARD)
{
startQuestTimer("GuardThink", 2500 + getRandom(-200, 200), npc, null, true);
}
else
{
npc.disableCoreAI(true);
}
return super.onSpawn(npc);
}


@Override
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if ((isSummon == false) && (player != null))
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
if (tmpworld instanceof SOD1World)
{
SOD1World world = (SOD1World) tmpworld;
if (world.getStatus() == 7)
{
if (spawnState(world))
{
for (int objId : world.getAllowed())
{
L2PcInstance pl = L2World.getInstance().getPlayer(objId);
if (pl != null)
{
pl.showQuestMovie(5);
}
}
npc.deleteMe();
}
}
}
}
return null;
}


@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, L2Skill skill)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof SOD1World)
{
SOD1World world = (SOD1World) tmpworld;
if ((world.getStatus() == 2) && (npc.getNpcId() == OBELISK))
{
world.setStatus(4);
spawnFlaggedNPCs(world, 3);
}
else if ((world.getStatus() == 3) && (npc.getNpcId() == OBELISK))
{
world.setStatus(4);
spawnFlaggedNPCs(world, 2);
}
else if ((world.getStatus() <= 8) && (npc.getNpcId() == TIAT))
{
if (npc.getCurrentHp() < (npc.getMaxHp() / 2))
{
if (spawnState(world))
{
startQuestTimer("TiatFullHp", 3000, npc, null);
setInstanceTimeRestrictions(world);
}
}
}
}
return null;
}


@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof SOD1World)
{
SOD1World world = (SOD1World) tmpworld;
if (event.equalsIgnoreCase("Spawn"))
{
L2PcInstance target = L2World.getInstance().getPlayer(world.getAllowed().get(getRandom(world.getAllowed().size())));
if ((world.deviceSpawnedMobCount < MAX_DEVICESPAWNEDMOBCOUNT) && (target != null) && (target.getInstanceId() == npc.getInstanceId()) && !target.isDead())
{
L2Attackable mob = (L2Attackable) addSpawn(SPAWN_MOB_IDS[getRandom(SPAWN_MOB_IDS.length)], npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), npc.getSpawn().getHeading(), false, 0, false, world.getInstanceId());
world.deviceSpawnedMobCount++;
mob.setSeeThroughSilentMove(true);
mob.setRunning();
if (world.getStatus() >= 7)
{
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MOVE_TO_TIAT);
}
else
{
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, MOVE_TO_DOOR);
}
}
}
else if (event.equalsIgnoreCase("DoorCheck"))
{
L2DoorInstance tmp = getDoor(FORTRESS_DOOR, npc.getInstanceId());
if (tmp.getCurrentHp() < tmp.getMaxHp())
{
world.deviceSpawnedMobCount = 0;
spawnFlaggedNPCs(world, 6);
ExShowScreenMessage message3 = new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1);
sendScreenMessage(world, message3);
}
else
{
startQuestTimer("DoorCheck", 10000, npc, null);
}
}
else if (event.equalsIgnoreCase("TiatFullHp"))
{
if (!npc.isStunned() && !npc.isInvul())
{
npc.setCurrentHp(npc.getMaxHp());
}
}
else if (event.equalsIgnoreCase("BodyGuardThink"))
{
L2Character mostHate = ((L2Attackable) npc).getMostHated();
if (mostHate != null)
{
double dist = Util.calculateDistance(mostHate.getXdestination(), mostHate.getYdestination(), npc.getSpawn().getLocx(), npc.getSpawn().getLocy());
if (dist > 900)
{
((L2Attackable) npc).reduceHate(mostHate, ((L2Attackable) npc).getHating(mostHate));
}
mostHate = ((L2Attackable) npc).getMostHated();
if ((mostHate != null) || (((L2Attackable) npc).getHating(mostHate) < 5))
{
((L2Attackable) npc).returnHome();
}
}
}
}
return "";
}


@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if (npc.getNpcId() == SPAWN_DEVICE)
{
cancelQuestTimer("Spawn", npc, null);
return "";
}
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof SOD1World)
{
SOD1World world = (SOD1World) tmpworld;
if (world.getStatus() == 1)
{
if (checkKillProgress(npc, world))
{
spawnState(world);
}
}
else if (world.getStatus() == 2)
{
if (checkKillProgress(npc, world))
{
world.incStatus();
}
}
else if ((world.getStatus() == 4) && (npc.getNpcId() == OBELISK))
{
spawnState(world);
}
else if ((world.getStatus() == 5) && (npc.getNpcId() == POWERFUL_DEVICE))
{
if (checkKillProgress(npc, world))
{
spawnState(world);
}
}
else if ((world.getStatus() == 6) && (npc.getNpcId() == THRONE_POWERFUL_DEVICE))
{
if (checkKillProgress(npc, world))
{
spawnState(world);
}
}
else if (world.getStatus() >= 7)
{
if (npc.getNpcId() == TIAT)
{
world.incStatus();
for (int objId : world.getAllowed())
{
L2PcInstance pl = L2World.getInstance().getPlayer(objId);
if (pl != null)
{
pl.showQuestMovie(6);
}
}
for (L2Npc mob : InstanceManager.getInstance().getInstance(world.getInstanceId()).getNpcs())
{
mob.deleteMe();
}


GraciaSeedsManager.getInstance().increaseSoDTiatKilled();
}
else if (npc.getNpcId() == TIAT_GUARD)
{
addMinion(((L2MonsterInstance) npc).getLeader(), TIAT_GUARD);
}
}
}
return "";
}


@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
int npcId = npc.getNpcId();
QuestState st = player.getQuestState(qn);
if (st == null)
{
st = newQuestState(player);
}
if (npcId == ALENOS)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if ((GraciaSeedsManager.getInstance().getSoDState() == 1) || ((world != null) && (world instanceof SOD1World)))
{
enterInstance(player, "SeedOfDestructionStage1.xml", ENTER_TELEPORT_1);
}
else if (GraciaSeedsManager.getInstance().getSoDState() == 2)
{
teleportPlayer(player, ENTER_TELEPORT_2, 0, false);
}
}
else if (npcId == TELEPORT)
{
teleportPlayer(player, CENTER_TELEPORT, player.getInstanceId(), false);
}
return "";
}


@Override
public String onTrapAction(L2Trap trap, L2Character trigger, TrapAction action)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
if (tmpworld instanceof SOD1World)
{
SOD1World world = (SOD1World) tmpworld;
switch (action)
{
case TRAP_TRIGGERED:
if (trap.getNpcId() == 18771)
{
for (int npcId : TRAP_18771_NPCS)
{
addSpawn(npcId, trap.getX(), trap.getY(), trap.getZ(), trap.getHeading(), true, 0, true, world.getInstanceId());
}
}
else
{
for (int npcId : TRAP_OTHER_NPCS)
{
addSpawn(npcId, trap.getX(), trap.getY(), trap.getZ(), trap.getHeading(), true, 0, true, world.getInstanceId());
}
}
break;
}
}
return null;
}


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


load();
addStartNpc(ALENOS);
addTalkId(ALENOS);
addStartNpc(TELEPORT);
addTalkId(TELEPORT);
addAttackId(OBELISK);
addSpawnId(OBELISK);
addKillId(OBELISK);
addSpawnId(POWERFUL_DEVICE);
addKillId(POWERFUL_DEVICE);
addSpawnId(THRONE_POWERFUL_DEVICE);
addKillId(THRONE_POWERFUL_DEVICE);
addAttackId(TIAT);
addKillId(TIAT);
addKillId(SPAWN_DEVICE);
addSpawnId(TIAT_GUARD);
addKillId(TIAT_GUARD);
addAggroRangeEnterId(TIAT_VIDEO_NPC);
// registering spawn traps which handled in this script
for (int i = 18771; i <= 18774; i++)
{
addTrapActionId(i);
}
for (int mobId : _mustKillMobsId)
{
addKillId(mobId);
}
}


public static void main(String[] args)
{
// now call the constructor (starts up the)
new Stage1(-1, qn, "instances");
}
}
Edited by II337

5 answers to this question

Recommended Posts

  • 0
Posted

And about Baium zone, idk if its an instance.

I can get ported in every minute and can wakeup baium

everytime. Infinity baiums can be done. Its just takes

my blooded fabric and lets me port in, how do I change these?

 

-Can't walk while talking to NPCs

-I want to disable attacking of NPCs

-Can't go alone into seed of destruction

 

I already change the required amount of players but I still can't get in

About baium add a simple check. (The wake up issue)

&& !isAlive

About Seed of destruction , change the number of players taht required for you to join.

About attacking to npc's i think you should check l2attackable if i am not wrong.

  • 0
Posted

Where I have to add 

&& !isAlive

As you can seed I post the codes underneath about seed of destruction.

I did change the required amount of playes.

private static final String qn = "SoDStage1";
private static final int INSTANCEID = 110; // this is the client number
private static final int MIN_PLAYERS = 1;
private static final int MAX_PLAYERS = 1;
private static final int MAX_DEVICESPAWNEDMOBCOUNT = 100; // prevent too much mob spawn
  • 0
Posted

I just deleted the instance and it work.

Can someone help me to some other problems?

 

How do I enter Valakas Lair without doing any quests?

How can I setup these things

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

    • General Trackers :   IPTorrents invite IPTorrents account 1 tb TorrentLeech invite Torrentleech account 1 tb buffer  InTheShaDow ( ITS ) account Acid-lounge invite Torrentday invite Crnaberza account Abn.Lol account Limit-of-eden account Norbits account Xspeeds account Xspeeds invite Bemaniso invite Wigornot account Turkseed.com account Bithumen invite Filelist account Funfile invite AvistaZ invite Potuk.net invite ResurrectThe.Net invite GrabThe.Info invite Greek-Team invite LinkoManija invite Fano.in account tracker.czech-server.com Speed.cd invite Arab-torrents.net account Arabscene.me account Scenetime account 4thd.xyz invite Btarg.com.ar account Dedbit invite Estone.cc account Speedapp invite Finvip invite Fluxzone account GigaTorrents account Gimmepeers account Haidan.video invite Mojblink account Mycarpathians invite Newinsane.info account Oscarworld.xyz account Peers.FM invite Pt.msg.vg account Ransackedcrew account Redemption invite Scene-rush account Seedfile.io invite Teracod invite Torrent.ai account Torrentmasters invite Ttsweb invite X-files invite X-ite invite Ncore account TorrentHR account Rptorrents account BwTorrents account Superbits invite Krazyzone account Immortalseed account Tntracker invite Pt.eastgame.org account Bitturk account Rstorrent account Tracker.btnext invite Torrent-turk.de account BeiTai.PT account Pt.keepfrds account 52pt.site account Pthome account Torrentseeds account Aystorrent account Blues-brothers.biz invite Divteam account Thesceneplace invite CinemaMovies.pl account Brasiltracker account Patiodebutacas account Newheaven.nl account  Swarmazon.club invite Bc-reloaded account Crazyspirits account Silentground invite Omg.wtftrackr invite Milkie.cc invite Breathetheword invite Madsrevolution account Chilebt account Yubraca account Uniongang.tv account Frboard account Exvagos account Diablotorrent account Microbit account Carp-hunter.hu account Majomparade.eu account Theshinning.me account Youiv.info account Dragonworld-reloaded account Sharewood.tv account Partis.si account Digitalcore.club invite Fuzer.me account R3vuk.wtf invite Ztracker account 1 tb buffer 3changtrai account Best-core.info account Bitsite.us account Eliteunitedcrew invite Exitorrent.org account Tophos invite Torrent.lt account Sktorrent.eu account Oshen account Pirata.digital account Esharenet account Ohmenarikgi.la Pirate-share account Immortuos account Kiesbits account Cliente.amigos-share.club account Broadcity invite Ilovetorzz account Torrentbytes account Polishsource account Portugas account Shareisland account ArabaFenice account Hudbt.hust.edu.cn account Audiences account Nanyangpt account Pt.sjtu.edu.cn account Pt.zhixing.bjtu.edu.cn account Byr.pt invite Ptfiles invite Red-bits account Pt.hdpost.top account Irrenhaus.dyndns.dk (NewPropaganda) account Mnvv2.info (MaxNewVision V2) account 1ptba.com account Spidertk.top account Film-paleis account Generation-free account Aftershock-tracker account Twilightsdreams account Back-ups.me invite Sor-next.tk ( Spirit Of Revolution ) account Tfa.tf ( The Falling Angels ) account Hdmayi account S-f-p.dyndns.dk ( Share Friends Projekt ) account Unlimitz.biz account Pttime account St-tracker.eu account New-retro.eu account Zbbit account Tigers-dl.net account Jptvts.us account Lat-team account Club.hares.top account Falkonvision-team account Concen account Drugari account T.ceskeforum account Peeratiko.org account Zamunda.se account Central-torrent.eu account h-o-d.org account Torrentleech.pl account Demonoid invite Lst.gg account Fakedoor.store account LaidBackManor account Vrbsharezone.co.uk invite Torrenteros account Arenaelite account Datascene account Tracker.0day.community Tapochek.net invite Ptchina invite Lesaloon account Exyusubs account Therebels.tv account Ubits.club invite Zmpt.cc account Turktorrent.us account Dasunerwarte account Hawke.uno account Monikadesign account Fearnopeer account Alpharatio account Wukongwendao.top account Chinapyg account Azusa.wiki account Yggtorrent.top account Torrentdd account Cyanbug.net invite Hhanclub.top account Wintersakura.net account Xthor account Tctg.pm account Finelite invite Agsvpt.com account Pt.0ff.cc invite Qingwapt.com account Xingtan.one account Ptcafe.club invite W-o-t.pro account Coastal-crew.bounceme.net account Darkpeers.org account Pianyuan.org account Seedpool.org  account Tempelbox account Pt.itzmx.com account Itatorrents.xyz  account Letseed.org account The-new-fun.com  account Malayabits.cc account Trellas.me account Yu-scene.net account Futuretorrent.org account Bitpt.cn account Tocashare.biz  account Videoteka.org  account White-angel.hu account Xbytesv2.li account Torr9  account Desitorrents account Okpt.net account Samaritano.cc account Polishtorrent.top  account C411.org account Bigcore.eu account Infinitylibrary.net account Beload.org account Emuwarez.com account Yhpp.cc account Rastastugan account Tlzdigital account account Upscalevault account Bluraytracker.cz account Torrenting.com account Infire.si account Dasunerwartete.biz invite The-torrent-trader account New-asgard.xyz account Pandapt account Deildu account Tmpt.top invite Pt.gtk.pw account Media.slo-bitcloud.eu account P.t-baozi.cc account 13city.org account Cangbao.ge account Cc.mypt.cc invite Dubhe.site invite Hdbao.cc account Kufei.org invite Mooko.org account Pt.aling.de invite Pt.lajidui.top invite Longpt.org invite Pt.luckpt.de invite Ptlover.cc invite Raingfh.top account Sewerpt.com account Huntorrent.org account Xtremebytes.net account Bitbazis.net account Mundo-pirata.org account Homiehelpdesk.net account Torrentheaven.org account   Movies Trackers :   Secret-cinema account Anthelion account Pixelhd account Cinemageddon account Cinemaz account Retroflix account Classix-unlimited - invite Movie-Torrentz (m2g.link) invite Punck-tracker.net account Tmghub account Cathode-ray.tube account Greatposterwall account Arabicsource.net account Upload.cx account Crabpt.vip invite Onlyencodes.cc account Exyusubs account Hellashut.net invite Nordichd.sytes.net invite Locadora.cc account Retro-movies.club account HD Trackers :   Blutopia buffered account Hd-olimpo buffered account Hdf.world account Torrentland.li account HdSky account Hdchina account Chdbits account Totheglory account Hdroute account Hdhome account TorrentCCF aka et8.org account 3DTorrents invite HD-Torrents account Bit-HDTV account HDME.eu invite Hdarea.co account Asiancinema.me account JoyHD invite HDSpace invite CrazyHD invite Bluebird-hd invite Htpt.cc account Hdtime invite Ourbits.club account Hd4fans account Siambit account Privatehd account Springsunday account Tjupt account Hdcity.leniter invite Ccfbits account Discfan account Pt.btschool.club account Ptsbao.club invite Hdzone.me invite Danishbytes account Zonaq.pw account Tracker.tekno3d account Arabp2p account Hd-united account Reelflix.xyz account Hdatmos.club account Anasch.cc invite Tigris-t account Nethd.org account Hd.ai invite Hitpt.com account Hdmonkey account Dragonhd.xyz account Hdclub.eu account Forum.bluraycd.com account Carpt account Hdfun.me invite Pt.hdupt invite Puntotorrent account Ultrahd account Rousi.zip account Bearbit account Hdturk.club account Asiandvdclub account Star-space.net account Nordicq.org account Hdkyl.in account Utp.to account Hdzero account Novahd account Hdtorrents.eu account 4k3dyptt account Duckboobee.org invite Si-qi.xyz account   Music Trackers :   Dicmusic account Music-Vid account Open.cd account LzTr account ProAudioTorrents invite Jpopsuki invite TranceTraffic invite Audionews invite Kraytracker invite Libble.me invite Losslessclub invite Indietorrents.com invite Dimeadozen account Funkytorrents invite Karaokedl account zombtracker.the-zomb account Concertos account Sugoimusic account Satclubbing.club invite Metal.iplay invite Psyreactor invite Panda.cd account Adamsfile account Freehardmusic account Tracker.hqmusic.vn accouunt Twilightzoom account 3 tb buffer Hiresmusic account Metalguru account Musictorrents.org account Musebootlegs.com invite Zappateers.com account Jungleland.dnsalias.com account Naftamusic account Bemusic account   E-Learning Trackers :   Theplace account Thevault account Myanonamouse account Libranet account 420Project account Learnflakes account Pt.soulvoice.club account P2pelite account Aaaaarg.fail invite Ebooks-shares.org account Abtorrents account Pt.tu88.men invite Docspedia.world invite TV-Trackers : Skipthecommercials.xyz account Cryptichaven account TV-Vault invite Shazbat.TV account Myspleen account Tasmanit.es invite Tvstore.me account Tvchaosuk account Jptv.club account   XXX - Porn Trackers :   Homeporntorrents.club account FemdomCult account Pussytorrents account Adult-cinema-network account Bootytape account 1 Tb buffer Exoticaz account Bitporn account Kufirc account Gaytorrent.ru invite Nicept account Gay-torrents.org invite Ourgtn account Pt.hdbd.us account BitSexy account Happyfappy.org account Kamept.com account Lesbians4u.org account Fappaizuri.me account Sextorrent.myds.me account   Gaming Trackers :   Pixelcove account Mteam.fr account BitGamer invite Retrowithin invite Gamegamept account Cartoon/Anime/Comic Trackers : Animeworld account Oldtoons.world account U2.dmhy account CartoonChaos invite Mononoke account Totallykids.tv account Bakabt.me invite Revanime account Ansktracker account Tracker.shakaw.com.br invite Bt.mdan.org account Skyey2.com account Animetracker.cc Adbt.it.cx invite Tracker.uniotaku.com account Mousebits.com account   Sports Trackers :   MMA-Tracker invite T3nnis.tv invite AcrossTheTasman account RacingForMe invite Sportscult invite Ultimatewrestlingtorrents account Worldboxingvideoarchive invite CyclingTorrents account Xtremewrestlingtorrents account Tc-boxing invite Mma-torrents account Aussierul invite Xwt-classics account Racing4everyone account Talk.tenyardtracker account Stalker.societyglitch invite Extremebits invite Rgfootball.net account F1carreras.xyz account   Software/Apps Trackers :   Brokenstones account Appzuniverse invite Teamos.xyz account Macbb.org account Phoenixproject.app account Tormac.org account Graphics Trackers: Forum.Cgpersia account Cgfxw account   Others   Hduse.net account Fora.snahp.eu account Makingoff.org/forum account Xrel.to account Undergunz.su account Corebay account Endoftheinter.net ( EOTI ) account Thismight.be invite Skull.facefromouter.space account Avxhm.se (AvaxHome) account Ssdforum account Notfake.vip account Intotheinter.net account Tildes.net invite Thetoonz account Usinavirtual account Hdclasico invite HispaShare account Valentine.wtf account Adit-hd account Forum-andr.net account Warezforums account Justanothermusic.site account Forbiddenlibrary.moe account Senturion.to account Movieparadise account Dcdnet.ru account Sftdevils.net account Heavy-r.com account New-team.org account Ddl.tv account Filewarez.club account Hispamula.org account Hubwarez.tv account Ultim-zone.in account Leprosorium.ru account Planet-ultima.org account The-dark-warez.com account Koyi.pub account Tehparadox.net account Forumophilia account Torrentinvite.fr account Gmgard.com account Board4all.biz account Gentoo-zh.org account Releasyee.to account   NZB :   Ninjacentral account Tabula-rasa.pw account Drunkenslug account Drunkenslug invite Usenet-4all account Dognzb.cr invite Kleverig account Nzb.cat account Nzbplanet.net invite Ng4you.com account NZB.to account Samuraiplace account Abhdtv.net account Abook.link account Comix.pw account House-of-usenet Secretbinaries.net account Vnext.to account Stockboxx.top account Sky-of-use.net account Indexer.codeshy.com account Oldboys.pw account Uhd100.com account   Prices start from 3 $ to 100 $   Payment methods: Crypto, Neteller, Revolut   If you want to buy something send me a pm or contact me on:   Email: morrison2102@gmail.com   Discord: LFC4LIFE#4173   Telegram: https://t.me/LFC4LIFE4173   Skype: morrison2102@hotmail.com
    • Probably too late but here you go, https://gofile.io/d/5NHzSL  
    • Automatic saving of ALL Community Board pages, NPC dialogs, and quests in newer chronicles (where HTML is present; may duplicate content depending on your internet connection and server). Do you actually understand what you're doing? Do you know basic HTML? Can you open a file in something other than Paint? Then this tool is for you. It works on its own. Doesn't ask stupid questions. If you don't understand (HTML/CB), don't waste my time or yours. Supports all clients from 746 to 557 Works with AA protection without issues HWID binding Price: $150 USDT Contact TG: @kiselevwv https://youtu.be/CtpscVobyqs?si=rTCALrzw3orOjlVF https://youtu.be/ULsufOUpwbo?si=JjzThZR9qeWIZJnX https://youtu.be/Fzt7_CNj91o?si=aRNL4NGnxK9rI5r1 https://youtu.be/DGWEP5CXQhA?si=Tzhuww9SHEgznw8q
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server! Create your free account here  
  • 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..