From 0c769cafd573ebc6d1681748fdc009def3f657c9 Mon Sep 17 00:00:00 2001 From: Zealar <Zealar@users.noreply.github.com> Date: Thu, 7 Aug 2014 18:03:23 +0000 Subject: [PATCH] BETA: Few AI fixes: Dorian, Rooney AI * Timer checkArea replaced by onSeeCreature listener Isle of Prayer AI * Fixed drop chance (getRandom(1000) -> getRandom(10000)) * Slightly updated code ;) Tar Beetle AI * Added support for reloading script * Reworked spawn system Patch by: malyelfik Reviewed by: UnAfraid, Zealar --- .../ai/group_template/IsleOfPrayer.java | 129 ++----- .../data/scripts/ai/npc/Dorian/Dorian.java | 46 +-- .../scripts/ai/npc/ForgeOfTheGods/Rooney.java | 69 ++-- .../ai/npc/ForgeOfTheGods/TarBeetle.java | 35 +- .../ai/npc/ForgeOfTheGods/TarBeetleSpawn.java | 283 ++++++++------- .../dist/game/data/spawnZones/tar_beetle.xml | 322 +++++++++--------- .../dist/game/data/xsd/tar_beetle.xsd | 38 ++- 7 files changed, 411 insertions(+), 511 deletions(-) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/IsleOfPrayer.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/IsleOfPrayer.java index fef05c228d..348999c8a8 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/IsleOfPrayer.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/IsleOfPrayer.java @@ -18,10 +18,14 @@ */ package ai.group_template; +import java.util.HashMap; +import java.util.Map; + import ai.npc.AbstractNpcAI; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.holders.ItemChanceHolder; /** * Isle of Prayer AI. @@ -35,122 +39,43 @@ public final class IsleOfPrayer extends AbstractNpcAI private static final int BLUE_SEED_OF_EVIL_SHARD = 9595; private static final int RED_SEED_OF_EVIL_SHARD = 9596; // Monsters - private static final int ISLAND_GUARDIAN = 22257; - private static final int WHITE_SAND_MIRAGE = 22258; - private static final int MUDDY_CORAL = 22259; - private static final int KLEOPORA = 22260; - private static final int SEYCHELLES = 22261; - private static final int NAIAD = 22262; - private static final int SONNERATIA = 22263; - private static final int CASTALIA = 22264; - private static final int CHRYSOCOLLA = 22265; - private static final int PYTHIA = 22266; - private static final int DARK_WATER_DRAGON = 22267; - private static final int SHADE1 = 22268; - private static final int SHADE2 = 22269; - private static final int WATER_DRAGON_DETRACTOR1 = 22270; - private static final int WATER_DRAGON_DETRACTOR2 = 22271; + private static final Map<Integer, ItemChanceHolder> MONSTERS = new HashMap<>(); + static + { + MONSTERS.put(22257, new ItemChanceHolder(YELLOW_SEED_OF_EVIL_SHARD, 2087)); // Island Guardian + MONSTERS.put(22258, new ItemChanceHolder(YELLOW_SEED_OF_EVIL_SHARD, 2147)); // White Sand Mirage + MONSTERS.put(22259, new ItemChanceHolder(YELLOW_SEED_OF_EVIL_SHARD, 2642)); // Muddy Coral + MONSTERS.put(22260, new ItemChanceHolder(YELLOW_SEED_OF_EVIL_SHARD, 2292)); // Kleopora + MONSTERS.put(22261, new ItemChanceHolder(GREEN_SEED_OF_EVIL_SHARD, 1171)); // Seychelles + MONSTERS.put(22262, new ItemChanceHolder(GREEN_SEED_OF_EVIL_SHARD, 1173)); // Naiad + MONSTERS.put(22263, new ItemChanceHolder(GREEN_SEED_OF_EVIL_SHARD, 1403)); // Sonneratia + MONSTERS.put(22264, new ItemChanceHolder(GREEN_SEED_OF_EVIL_SHARD, 1207)); // Castalia + MONSTERS.put(22265, new ItemChanceHolder(RED_SEED_OF_EVIL_SHARD, 575)); // Chrysocolla + MONSTERS.put(22266, new ItemChanceHolder(RED_SEED_OF_EVIL_SHARD, 493)); // Pythia + MONSTERS.put(22267, new ItemChanceHolder(RED_SEED_OF_EVIL_SHARD, 770)); // Dark Water Dragon + MONSTERS.put(22268, new ItemChanceHolder(BLUE_SEED_OF_EVIL_SHARD, 987)); // Shade + MONSTERS.put(22269, new ItemChanceHolder(BLUE_SEED_OF_EVIL_SHARD, 995)); // Shade + MONSTERS.put(22270, new ItemChanceHolder(BLUE_SEED_OF_EVIL_SHARD, 1008)); // Water Dragon Detractor + MONSTERS.put(22271, new ItemChanceHolder(BLUE_SEED_OF_EVIL_SHARD, 1008)); // Water Dragon Detractor + } private IsleOfPrayer() { super(IsleOfPrayer.class.getSimpleName(), "ai/group_template"); - addKillId(ISLAND_GUARDIAN, WHITE_SAND_MIRAGE, MUDDY_CORAL, KLEOPORA, SEYCHELLES, NAIAD, SONNERATIA, CASTALIA, CHRYSOCOLLA, PYTHIA, DARK_WATER_DRAGON, SHADE1, SHADE2, WATER_DRAGON_DETRACTOR1, WATER_DRAGON_DETRACTOR2); + addKillId(MONSTERS.keySet()); } @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { - switch (npc.getId()) + final ItemChanceHolder holder = MONSTERS.get(npc.getId()); + if (getRandom(10000) <= holder.getChance()) { - case ISLAND_GUARDIAN: - { - doDrop(killer, npc, YELLOW_SEED_OF_EVIL_SHARD, 2087); - break; - } - case WHITE_SAND_MIRAGE: - { - doDrop(killer, npc, YELLOW_SEED_OF_EVIL_SHARD, 2147); - break; - } - case MUDDY_CORAL: - { - doDrop(killer, npc, YELLOW_SEED_OF_EVIL_SHARD, 2642); - break; - } - case KLEOPORA: - { - doDrop(killer, npc, YELLOW_SEED_OF_EVIL_SHARD, 2292); - break; - } - case SEYCHELLES: - { - doDrop(killer, npc, GREEN_SEED_OF_EVIL_SHARD, 1171); - break; - } - case NAIAD: - { - doDrop(killer, npc, GREEN_SEED_OF_EVIL_SHARD, 1173); - break; - } - case SONNERATIA: - { - doDrop(killer, npc, GREEN_SEED_OF_EVIL_SHARD, 1403); - break; - } - case CASTALIA: - { - doDrop(killer, npc, GREEN_SEED_OF_EVIL_SHARD, 1207); - break; - } - case CHRYSOCOLLA: - { - doDrop(killer, npc, RED_SEED_OF_EVIL_SHARD, 575); - break; - } - case PYTHIA: - { - doDrop(killer, npc, RED_SEED_OF_EVIL_SHARD, 493); - break; - } - case DARK_WATER_DRAGON: - { - doDrop(killer, npc, RED_SEED_OF_EVIL_SHARD, 770); - break; - } - case SHADE1: - { - doDrop(killer, npc, BLUE_SEED_OF_EVIL_SHARD, 987); - break; - } - case SHADE2: - { - doDrop(killer, npc, BLUE_SEED_OF_EVIL_SHARD, 995); - break; - } - case WATER_DRAGON_DETRACTOR1: - case WATER_DRAGON_DETRACTOR2: - { - doDrop(killer, npc, BLUE_SEED_OF_EVIL_SHARD, 1008); - break; - } + npc.dropItem(killer, holder); } return super.onKill(npc, killer, isSummon); } - /** - * @param killer the player that kills the NPC - * @param npc the killed NPC that will drop - * @param itemId the item Id to drop - * @param chance the chance of this NPC to drop the item - */ - private static final void doDrop(L2PcInstance killer, L2Npc npc, int itemId, int chance) - { - if (getRandom(1000) <= chance) - { - npc.dropItem(killer, itemId, 1); - } - } - public static void main(String[] args) { new IsleOfPrayer(); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java index 61e2779d4b..a72c010e76 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java @@ -21,8 +21,7 @@ package ai.npc.Dorian; import quests.Q00024_InhabitantsOfTheForestOfTheDead.Q00024_InhabitantsOfTheForestOfTheDead; import ai.npc.AbstractNpcAI; -import com.l2jserver.gameserver.datatables.SpawnTable; -import com.l2jserver.gameserver.model.L2Spawn; +import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.QuestState; @@ -44,46 +43,25 @@ public final class Dorian extends AbstractNpcAI private Dorian() { super(Dorian.class.getSimpleName(), "ai/npc"); - addSpawnId(DORIAN); - - for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(DORIAN)) - { - startQuestTimer("checkArea", 3000, spawn.getLastSpawn(), null, true); - } + addSeeCreatureId(DORIAN); } @Override - public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) { - if (event.equals("checkArea")) + if (creature.isPlayer()) { - if (npc.isDecayed()) - { - cancelQuestTimers("checkArea"); - } - else + final L2PcInstance pl = creature.getActingPlayer(); + final QuestState qs = pl.getQuestState(Q00024_InhabitantsOfTheForestOfTheDead.class.getSimpleName()); + if ((qs != null) && qs.isCond(3)) { - for (L2PcInstance pl : npc.getKnownList().getKnownPlayersInRadius(300)) - { - final QuestState qs = pl.getQuestState(Q00024_InhabitantsOfTheForestOfTheDead.class.getSimpleName()); - if ((qs != null) && qs.isCond(3)) - { - qs.takeItems(SILVER_CROSS, -1); - qs.giveItems(BROKEN_SILVER_CROSS, 1); - qs.setCond(4, true); - broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.THAT_SIGN); - } - } + takeItems(pl, SILVER_CROSS, -1); + giveItems(pl, BROKEN_SILVER_CROSS, 1); + qs.setCond(4, true); + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.THAT_SIGN); } } - return null; - } - - @Override - public String onSpawn(L2Npc npc) - { - startQuestTimer("checkArea", 3000, npc, null, true); - return null; + return super.onSeeCreature(npc, creature, isSummon); } public static void main(String[] args) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java index 8e3eae5787..0f1d946824 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java @@ -21,6 +21,7 @@ package ai.npc.ForgeOfTheGods; import ai.npc.AbstractNpcAI; import com.l2jserver.gameserver.model.Location; +import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.NpcStringId; @@ -81,47 +82,53 @@ public final class Rooney extends AbstractNpcAI private Rooney() { super(Rooney.class.getSimpleName(), "ai/npc"); - final L2Npc npc = addSpawn(ROONEY, LOCATIONS[getRandom(LOCATIONS.length)], false, 0); - startQuestTimer("checkArea", 1000, npc, null, true); + addSeeCreatureId(ROONEY); + addSpawn(ROONEY, LOCATIONS[getRandom(LOCATIONS.length)], false, 0); } @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { - switch (event) + if (event.equals("teleport") && !npc.isDecayed()) { - case "checkArea": - if (!npc.getKnownList().getKnownPlayersInRadius(300).isEmpty()) - { - cancelQuestTimers("checkArea"); - broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WELCOME); - startQuestTimer("say1", 60000, npc, null); - } - break; - case "say1": - broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.HURRY_HURRY); - startQuestTimer("say2", 60000, npc, null); - break; - case "say2": - broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME); - startQuestTimer("say3", 60000, npc, null); - break; - case "say3": - broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.ITS_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS); - startQuestTimer("say4", 60000, npc, null); - break; - case "say4": - broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WHY_DONT_I_GO_THAT_WAY_THIS_TIME); - startQuestTimer("teleport", 60000, npc, null); - break; - case "teleport": - npc.teleToLocation(LOCATIONS[getRandom(LOCATIONS.length)], false); - startQuestTimer("checkArea", 1000, npc, null, true); - break; + final int aiVal = npc.getScriptValue(); + switch (aiVal) + { + case 1: + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.HURRY_HURRY); + break; + case 2: + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME); + break; + case 3: + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.ITS_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS); + break; + case 4: + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WHY_DONT_I_GO_THAT_WAY_THIS_TIME); + break; + default: + npc.teleToLocation(LOCATIONS[getRandom(LOCATIONS.length)], false); + npc.setScriptValue(0); + return null; + } + npc.setScriptValue(aiVal + 1); + startQuestTimer("teleport", 60000, npc, null); } return null; } + @Override + public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) + { + if (creature.isPlayer() && npc.isScriptValue(0)) + { + broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WELCOME); + startQuestTimer("teleport", 60000, npc, null); + npc.setScriptValue(1); + } + return super.onSeeCreature(npc, creature, isSummon); + } + public static void main(String[] args) { new Rooney(); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetle.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetle.java index 7fed55ec06..dc0b68fd37 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetle.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetle.java @@ -50,25 +50,23 @@ public final class TarBeetle extends AbstractNpcAI super(TarBeetle.class.getSimpleName(), "ai/npc"); addAggroRangeEnterId(TAR_BEETLE); addSpellFinishedId(TAR_BEETLE); - spawn.startTasks(); } @Override public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) { - if ((spawn.getBeetle(npc).getScriptValue() > 0) && canCastSkill(npc)) + if (npc.getScriptValue() > 0) { - int level = 0; final BuffInfo info = player.getEffectList().getBuffInfoBySkillId(TAR_SPITE); - if (info != null) - { - level = info.getSkill().getAbnormalLvl(); - } + final int level = (info != null) ? info.getSkill().getAbnormalLvl() : 0; if (level < 3) { - - npc.setTarget(player); - npc.doCast(SKILLS[level].getSkill()); + final Skill skill = SKILLS[level].getSkill(); + if (!npc.isSkillDisabled(skill)) + { + npc.setTarget(player); + npc.doCast(skill); + } } } return super.onAggroRangeEnter(npc, player, isSummon); @@ -79,29 +77,24 @@ public final class TarBeetle extends AbstractNpcAI { if ((skill != null) && (skill.getId() == TAR_SPITE)) { - int val = spawn.getBeetle(npc).getScriptValue() - 1; + final int val = npc.getScriptValue() - 1; if ((val <= 0) || (SKILLS[0].getSkill().getMpConsume() > npc.getCurrentMp())) { spawn.removeBeetle(npc); } else { - spawn.getBeetle(npc).isScriptValue(val); + npc.setScriptValue(val); } } return super.onSpellFinished(npc, player, skill); } - private boolean canCastSkill(L2Npc npc) + @Override + public boolean unload() { - for (SkillHolder holder : SKILLS) - { - if (npc.isSkillDisabled(holder.getSkill())) - { - return false; - } - } - return true; + spawn.unload(); + return super.unload(); } public static void main(String[] args) diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java index 98b803dfdc..c3351fdf86 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java @@ -19,13 +19,10 @@ package ai.npc.ForgeOfTheGods; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; -import java.util.Map; +import java.util.concurrent.ScheduledFuture; -import javolution.util.FastMap; +import javolution.util.FastList; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -45,14 +42,9 @@ import com.l2jserver.util.Rnd; */ public class TarBeetleSpawn extends DocumentParser { - private static final Map<Integer, SpawnZone> _spawnZoneList = new HashMap<>(); - private static final Map<Integer, L2Npc> _spawnList = new FastMap<>(); - - public static List<Integer> lowerZones = new ArrayList<>(); - public static List<Integer> upperZones = new ArrayList<>(); - - public static int lowerNpcCount = 0; - public static int upperNpcCount = 0; + private final List<SpawnZone> zones = new ArrayList<>(); + private ScheduledFuture<?> spawnTask; + private ScheduledFuture<?> shotTask; public TarBeetleSpawn() { @@ -62,139 +54,101 @@ public class TarBeetleSpawn extends DocumentParser @Override public void load() { - _spawnZoneList.clear(); - _spawnList.clear(); parseDatapackFile("data/spawnZones/tar_beetle.xml"); - _log.info(TarBeetleSpawn.class.getSimpleName() + ": Loaded " + _spawnZoneList.size() + " spawn zones."); + if (!zones.isEmpty()) + { + spawnTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(() -> zones.forEach(SpawnZone::refreshSpawn), 1000, 60000); + shotTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(() -> zones.forEach(SpawnZone::refreshShots), 300000, 300000); + } } @Override protected void parseDocument() { - final Node n = getCurrentDocument().getFirstChild(); - for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) + int i = 0; + for (Node d = getCurrentDocument().getFirstChild(); d != null; d = d.getNextSibling()) { - if (d.getNodeName().equals("spawnZones")) + if (d.getNodeName().equals("list")) { for (Node r = d.getFirstChild(); r != null; r = r.getNextSibling()) { - if (r.getNodeName().equals("zone")) + if (r.getNodeName().equals("spawnZone")) { NamedNodeMap attrs = r.getAttributes(); - int id = parseInteger(attrs, "id"); - int minZ = parseInteger(attrs, "minZ"); - int maxZ = parseInteger(attrs, "maxZ"); - String type = parseString(attrs, "type"); - if (type.equals("upper")) - { - upperZones.add(id); - } - else if (type.equals("lower")) - { - lowerZones.add(id); - } - - int[] bZones = null; - String bZonesStr = parseString(attrs, "bZones", ""); - if (!bZonesStr.isEmpty()) + final int npcCount = parseInteger(attrs, "maxNpcCount"); + final SpawnZone sp = new SpawnZone(npcCount, i); + for (Node b = r.getFirstChild(); b != null; b = b.getNextSibling()) { - String[] str = bZonesStr.split(";"); - bZones = new int[str.length]; - for (int i = 0; i < str.length; i++) + if (b.getNodeName().equals("zone")) { - bZones[i] = Integer.parseInt(str[i]); + attrs = b.getAttributes(); + final int minZ = parseInteger(attrs, "minZ"); + final int maxZ = parseInteger(attrs, "maxZ"); + final Zone zone = new Zone(); + for (Node c = b.getFirstChild(); c != null; c = c.getNextSibling()) + { + attrs = c.getAttributes(); + if (c.getNodeName().equals("point")) + { + final int x = parseInteger(attrs, "x"); + final int y = parseInteger(attrs, "y"); + zone.add(x, y, minZ, maxZ, 0); + } + else if (c.getNodeName().equals("bannedZone")) + { + final Zone bannedZone = new Zone(); + final int bMinZ = parseInteger(attrs, "minZ"); + final int bMaxZ = parseInteger(attrs, "maxZ"); + for (Node f = c.getFirstChild(); f != null; f = f.getNextSibling()) + { + if (f.getNodeName().equals("point")) + { + attrs = f.getAttributes(); + int x = parseInteger(attrs, "x"); + int y = parseInteger(attrs, "y"); + bannedZone.add(x, y, bMinZ, bMaxZ, 0); + } + } + zone.addBannedZone(bannedZone); + } + } + sp.addZone(zone); } } - - SpawnZone zone = new SpawnZone(id, bZones); - for (Node c = r.getFirstChild(); c != null; c = c.getNextSibling()) - { - if (c.getNodeName().equals("point")) - { - attrs = c.getAttributes(); - int x = parseInteger(attrs, "x"); - int y = parseInteger(attrs, "y"); - zone.add(x, y, minZ, maxZ, 0); - } - } - _spawnZoneList.put(id, zone); + zones.add(i++, sp); } } } } } - public void removeBeetle(L2Npc npc) + public final void unload() { - npc.deleteMe(); - _spawnList.remove(npc.getObjectId()); - if (npc.getSpawn().getZ() < -5000) + if (spawnTask != null) { - lowerNpcCount--; + spawnTask.cancel(false); } - else + if (shotTask != null) { - upperNpcCount--; + shotTask.cancel(false); } + zones.forEach(SpawnZone::unload); + zones.clear(); } - public void spawn(List<Integer> zone) - { - try - { - Collections.shuffle(zone); - int[] loc = getSpawnZoneById(zone.get(0)).getRandomPoint(); - - final L2Spawn spawn = new L2Spawn(NpcData.getInstance().getTemplate(18804)); - spawn.setHeading(Rnd.get(65535)); - spawn.setX(loc[0]); - spawn.setY(loc[1]); - spawn.setZ(GeoData.getInstance().getSpawnHeight(loc[0], loc[1], loc[2], loc[3])); - - final L2Npc npc = spawn.doSpawn(); - npc.setIsNoRndWalk(true); - npc.setIsImmobilized(true); - npc.setIsInvul(true); - npc.disableCoreAI(true); - npc.setScriptValue(5); - - _spawnList.put(npc.getObjectId(), npc); - } - catch (Exception e) - { - _log.warning(TarBeetleSpawn.class.getSimpleName() + ": Could not spawn npc! Error: " + e.getMessage()); - } - } - - public void startTasks() - { - ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new SpawnTask(), 1000, 60000); - ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new NumShotTask(), 300000, 300000); - } - - public SpawnZone getSpawnZoneById(int id) - { - return _spawnZoneList.get(id); - } - - public L2Npc getBeetle(L2Npc npc) - { - return _spawnList.get(npc.getObjectId()); - } - - public static Map<Integer, L2Npc> getSpawnList() + public final void removeBeetle(L2Npc npc) { - return _spawnList; + zones.get(npc.getVariables().getInt("zoneIndex", 0)).removeSpawn(npc); + npc.deleteMe(); } - private class SpawnZone extends L2Territory + private final class Zone extends L2Territory { - private final int[] _bZones; + private List<Zone> _bannedZones; - public SpawnZone(int terr, int[] bZones) + public Zone() { - super(terr); - _bZones = bZones; + super(1); } @Override @@ -208,13 +162,22 @@ public class TarBeetleSpawn extends DocumentParser return loc; } - private boolean isInsideBannedZone(int[] loc) + public final void addBannedZone(Zone bZone) + { + if (_bannedZones == null) + { + _bannedZones = new ArrayList<>(); + } + _bannedZones.add(bZone); + } + + private final boolean isInsideBannedZone(int[] loc) { - if (_bZones != null) + if (_bannedZones != null) { - for (int i : _bZones) + for (Zone z : _bannedZones) { - if (getSpawnZoneById(i).isInside(loc[0], loc[1])) + if (z.isInside(loc[0], loc[1])) { return true; } @@ -224,52 +187,82 @@ public class TarBeetleSpawn extends DocumentParser } } - public class SpawnTask implements Runnable + private final class SpawnZone { - @Override - public void run() + private final List<Zone> _zones = new ArrayList<>(); + private final List<L2Npc> _spawn = new FastList<>(); + private final int _maxNpcCount; + private final int _index; + + public SpawnZone(int maxNpcCount, int index) { - while (lowerNpcCount < 4) + _maxNpcCount = maxNpcCount; + _index = index; + } + + public final void addZone(Zone zone) + { + _zones.add(zone); + } + + public final void removeSpawn(L2Npc obj) + { + _spawn.remove(obj); + } + + public final void unload() + { + _spawn.forEach(L2Npc::deleteMe); + _spawn.clear(); + _zones.clear(); + } + + public final void refreshSpawn() + { + try { - spawn(lowerZones); - lowerNpcCount++; + while (_spawn.size() < _maxNpcCount) + { + final int[] loc = _zones.get(Rnd.get(_zones.size())).getRandomPoint(); + final L2Spawn spawn = new L2Spawn(NpcData.getInstance().getTemplate(18804)); + spawn.setHeading(Rnd.get(65535)); + spawn.setX(loc[0]); + spawn.setY(loc[1]); + spawn.setZ(GeoData.getInstance().getSpawnHeight(loc[0], loc[1], loc[2], loc[3])); + + final L2Npc npc = spawn.doSpawn(); + npc.setIsNoRndWalk(true); + npc.setIsImmobilized(true); + npc.setIsInvul(true); + npc.disableCoreAI(true); + npc.setScriptValue(5); + npc.getVariables().set("zoneIndex", _index); + _spawn.add(npc); + } } - - while (upperNpcCount < 12) + catch (Exception e) { - spawn(upperZones); - upperNpcCount++; + e.printStackTrace(); } } - } - - public class NumShotTask implements Runnable - { - @Override - public void run() + + public final void refreshShots() { - Iterator<L2Npc> iterator = getSpawnList().values().iterator(); - while (iterator.hasNext()) + if (_spawn.size() > 0) { - L2Npc npc = iterator.next(); - int val = npc.getScriptValue(); - if (val == 5) + for (L2Npc npc : _spawn) { - npc.deleteMe(); - iterator.remove(); - if (npc.getSpawn().getZ() < -5000) + final int val = npc.getScriptValue(); + if (val == 5) { - lowerNpcCount--; + npc.deleteMe(); + _spawn.remove(npc); } else { - upperNpcCount--; + npc.setScriptValue(val + 1); } } - else - { - npc.setScriptValue(val + 1); - } } } } diff --git a/L2J_DataPack_BETA/dist/game/data/spawnZones/tar_beetle.xml b/L2J_DataPack_BETA/dist/game/data/spawnZones/tar_beetle.xml index ac44cce635..262b4898a3 100644 --- a/L2J_DataPack_BETA/dist/game/data/spawnZones/tar_beetle.xml +++ b/L2J_DataPack_BETA/dist/game/data/spawnZones/tar_beetle.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/tar_beetle.xsd"> - <spawnZones> - <!-- Forge of the Gods lower level - Spawn Zones --> - <zone id="1" minZ="-5565" maxZ="-5365" type="lower"> + <!-- Forge of the Gods lower level - Spawn Zones --> + <spawnZone maxNpcCount="4"> + <zone minZ="-5565" maxZ="-5365"> <point x="175828" y="-111714" /> <point x="175528" y="-111346" /> <point x="175204" y="-111434" /> @@ -11,7 +11,7 @@ <point x="176132" y="-112826" /> <point x="176376" y="-111850" /> </zone> - <zone id="2" minZ="-5876" maxZ="-5676" type="lower"> + <zone minZ="-5876" maxZ="-5676"> <point x="177666" y="-112338" /> <point x="178118" y="-111838" /> <point x="178330" y="-112266" /> @@ -22,7 +22,7 @@ <point x="178126" y="-113266" /> <point x="177678" y="-113122" /> </zone> - <zone id="3" minZ="-6170" maxZ="-5970" type="lower"> + <zone minZ="-6170" maxZ="-5970"> <point x="181013" y="-115006" /> <point x="180393" y="-114762" /> <point x="179989" y="-115202" /> @@ -33,7 +33,7 @@ <point x="180633" y="-117142" /> <point x="181181" y="-116262" /> </zone> - <zone id="4" minZ="-6174" maxZ="-5974" type="lower" bZones="10"> + <zone minZ="-6174" maxZ="-5974"> <point x="183192" y="-115568" /> <point x="184072" y="-114860" /> <point x="183688" y="-113956" /> @@ -44,24 +44,42 @@ <point x="182476" y="-115908" /> <point x="182544" y="-115452" /> <point x="182952" y="-115396" /> - </zone> - <zone id="5" minZ="-6182" maxZ="-5982" type="lower" bZones="11"> + <bannedZone minZ="-6244" maxZ="-5744"> + <point x="183260" y="-114708" /> + <point x="183460" y="-114708" /> + <point x="183460" y="-114508" /> + <point x="183260" y="-114508" /> + </bannedZone> + </zone> + <zone minZ="-6182" maxZ="-5982"> <point x="184908" y="-118019" /> <point x="185328" y="-117263" /> <point x="184756" y="-115907" /> <point x="184036" y="-115735" /> <point x="183016" y="-116807" /> <point x="183856" y="-118115" /> - </zone> - <zone id="6" minZ="-5894" maxZ="-5694" type="lower" bZones="12"> + <bannedZone minZ="-6184" maxZ="-5684"> + <point x="184140" y="-117188" /> + <point x="184340" y="-117188" /> + <point x="184340" y="-116988" /> + <point x="184140" y="-116988" /> + </bannedZone> + </zone> + <zone minZ="-5894" maxZ="-5694"> <point x="182031" y="-111122" /> <point x="182679" y="-110114" /> <point x="181971" y="-108898" /> <point x="180651" y="-109022" /> <point x="180367" y="-109346" /> <point x="180639" y="-111170" /> - </zone> - <zone id="7" minZ="-5886" maxZ="-5686" type="lower"> + <bannedZone minZ="-5912" maxZ="-5412"> + <point x="181064" y="-109780" /> + <point x="181548" y="-110184" /> + <point x="181656" y="-109952" /> + <point x="181180" y="-109564" /> + </bannedZone> + </zone> + <zone minZ="-5886" maxZ="-5686"> <point x="179604" y="-108013" /> <point x="179592" y="-107193" /> <point x="178728" y="-106757" /> @@ -72,7 +90,7 @@ <point x="178728" y="-108877" /> <point x="178716" y="-108093" /> </zone> - <zone id="8" minZ="-5896" maxZ="-5676" type="lower"> + <zone minZ="-5896" maxZ="-5676"> <point x="178913" y="-110527" /> <point x="179358" y="-110192" /> <point x="178971" y="-109536" /> @@ -82,7 +100,7 @@ <point x="178203" y="-110941" /> <point x="178678" y="-110925" /> </zone> - <zone id="9" minZ="-6101" maxZ="-5901" type="lower"> + <zone minZ="-6101" maxZ="-5901"> <point x="181981" y="-105685" /> <point x="180989" y="-105901" /> <point x="180745" y="-106253" /> @@ -95,27 +113,10 @@ <point x="183445" y="-106453" /> <point x="182797" y="-105761" /> </zone> - <!-- Forge of the Gods lower level - Banned Zones --> - <zone id="10" minZ="-6244" maxZ="-5744" type="bZone"> - <point x="183260" y="-114708" /> - <point x="183460" y="-114708" /> - <point x="183460" y="-114508" /> - <point x="183260" y="-114508" /> - </zone> - <zone id="11" minZ="-6184" maxZ="-5684" type="bZone"> - <point x="184140" y="-117188" /> - <point x="184340" y="-117188" /> - <point x="184340" y="-116988" /> - <point x="184140" y="-116988" /> - </zone> - <zone id="12" minZ="-5912" maxZ="-5412" type="bZone"> - <point x="181064" y="-109780" /> - <point x="181548" y="-110184" /> - <point x="181656" y="-109952" /> - <point x="181180" y="-109564" /> - </zone> - <!-- Forge of the Gods upper level - Spawn Zones --> - <zone id="13" minZ="-3647" maxZ="-3447" type="upper"> + </spawnZone> + <!-- Forge of the Gods upper level - Spawn Zones --> + <spawnZone maxNpcCount="12"> + <zone minZ="-3647" maxZ="-3447"> <point x="179651" y="-116994" /> <point x="179519" y="-116706" /> <point x="179231" y="-116702" /> @@ -124,7 +125,7 @@ <point x="179143" y="-117374" /> <point x="179679" y="-117146" /> </zone> - <zone id="14" minZ="-3675" maxZ="-3475" type="upper"> + <zone minZ="-3675" maxZ="-3475"> <point x="180621" y="-115487" /> <point x="180461" y="-115247" /> <point x="180181" y="-114811" /> @@ -134,7 +135,7 @@ <point x="179373" y="-116223" /> <point x="180349" y="-116003" /> </zone> - <zone id="15" minZ="-4165" maxZ="-3965" type="upper"> + <zone minZ="-4165" maxZ="-3965"> <point x="178529" y="-119994" /> <point x="178734" y="-119409" /> <point x="177546" y="-119205" /> @@ -142,15 +143,21 @@ <point x="177614" y="-120055" /> <point x="178102" y="-120227" /> </zone> - <zone id="16" minZ="-4148" maxZ="-3948" type="upper" bZones="42"> + <zone minZ="-4148" maxZ="-3948"> <point x="176164" y="-121387" /> <point x="177436" y="-121403" /> <point x="177544" y="-120827" /> <point x="177068" y="-120007" /> <point x="176824" y="-119927" /> <point x="176092" y="-120371" /> - </zone> - <zone id="17" minZ="-3710" maxZ="-3510" type="upper"> + <bannedZone minZ="-4272" maxZ="-3772"> + <point x="176380" y="-121148" /> + <point x="176992" y="-121156" /> + <point x="176948" y="-120492" /> + <point x="176388" y="-120516" /> + </bannedZone> + </zone> + <zone minZ="-3710" maxZ="-3510"> <point x="181328" y="-119542" /> <point x="181328" y="-119542" /> <point x="180572" y="-119854" /> @@ -160,7 +167,7 @@ <point x="181792" y="-120418" /> <point x="181600" y="-119602" /> </zone> - <zone id="18" minZ="-3382" maxZ="-3182" type="upper"> + <zone minZ="-3382" maxZ="-3182"> <point x="182415" y="-117705" /> <point x="182059" y="-117521" /> <point x="181819" y="-117529" /> @@ -170,7 +177,7 @@ <point x="182307" y="-118405" /> <point x="182567" y="-118041" /> </zone> - <zone id="19" minZ="-3329" maxZ="-3129" type="upper" bZones="43"> + <zone minZ="-3329" maxZ="-3129"> <point x="185977" y="-118936" /> <point x="186445" y="-118884" /> <point x="186637" y="-118496" /> @@ -178,8 +185,14 @@ <point x="186797" y="-116776" /> <point x="186141" y="-117316" /> <point x="185537" y="-118260" /> - </zone> - <zone id="20" minZ="-3124" maxZ="-2924" type="upper" bZones="44"> + <bannedZone minZ="-3320" maxZ="-2820"> + <point x="186284" y="-117708" /> + <point x="186888" y="-117844" /> + <point x="186912" y="-117220" /> + <point x="186404" y="-117204" /> + </bannedZone> + </zone> + <zone minZ="-3124" maxZ="-2924"> <point x="184154" y="-118553" /> <point x="184534" y="-119217" /> <point x="184262" y="-119741" /> @@ -187,8 +200,14 @@ <point x="183410" y="-120093" /> <point x="182942" y="-119373" /> <point x="183138" y="-118873" /> - </zone> - <zone id="21" minZ="-3136" maxZ="-2936" type="upper" bZones="45"> + <bannedZone minZ="-3176" maxZ="-2676"> + <point x="183608" y="-119784" /> + <point x="184028" y="-119792" /> + <point x="184048" y="-119332" /> + <point x="183572" y="-119344" /> + </bannedZone> + </zone> + <zone minZ="-3136" maxZ="-2936"> <point x="185916" y="-120861" /> <point x="185920" y="-120505" /> <point x="185592" y="-119957" /> @@ -196,8 +215,14 @@ <point x="184440" y="-120325" /> <point x="184384" y="-121241" /> <point x="185336" y="-121453" /> - </zone> - <zone id="22" minZ="-3136" maxZ="-2936" type="upper" bZones="46"> + <bannedZone minZ="-3116" maxZ="-2916"> + <point x="184868" y="-120920" /> + <point x="185360" y="-120904" /> + <point x="185316" y="-120480" /> + <point x="184900" y="-120460" /> + </bannedZone> + </zone> + <zone minZ="-3136" maxZ="-2936"> <point x="187906" y="-121665" /> <point x="188526" y="-121049" /> <point x="188438" y="-120549" /> @@ -205,8 +230,14 @@ <point x="187106" y="-120665" /> <point x="186926" y="-120909" /> <point x="187190" y="-121453" /> - </zone> - <zone id="23" minZ="-3134" maxZ="-2934" type="upper" bZones="47"> + <bannedZone minZ="-3196" maxZ="-2696"> + <point x="187352" y="-121108" /> + <point x="187832" y="-121092" /> + <point x="187800" y="-120620" /> + <point x="187328" y="-120640" /> + </bannedZone> + </zone> + <zone minZ="-3134" maxZ="-2934"> <point x="190497" y="-120846" /> <point x="190353" y="-120154" /> <point x="189941" y="-119750" /> @@ -214,8 +245,14 @@ <point x="188885" y="-120602" /> <point x="189037" y="-120946" /> <point x="189737" y="-121322" /> - </zone> - <zone id="24" minZ="-3352" maxZ="-3152" type="upper" bZones="48"> + <bannedZone minZ="-3124" maxZ="-2624"> + <point x="188864" y="-120616" /> + <point x="189216" y="-120844" /> + <point x="189448" y="-120412" /> + <point x="189016" y="-120248" /> + </bannedZone> + </zone> + <zone minZ="-3352" maxZ="-3152"> <point x="189260" y="-119154" /> <point x="189252" y="-118574" /> <point x="188992" y="-118366" /> @@ -224,8 +261,14 @@ <point x="187552" y="-119134" /> <point x="188156" y="-119758" /> <point x="188876" y="-119542" /> - </zone> - <zone id="25" minZ="-3332" maxZ="-3132" type="upper" bZones="49"> + <bannedZone minZ="-3384" maxZ="-2884"> + <point x="188308" y="-119220" /> + <point x="188740" y="-119084" /> + <point x="188568" y="-118608" /> + <point x="188140" y="-118824" /> + </bannedZone> + </zone> + <zone minZ="-3332" maxZ="-3132"> <point x="190058" y="-118093" /> <point x="190590" y="-117357" /> <point x="190522" y="-116457" /> @@ -233,8 +276,14 @@ <point x="189178" y="-116405" /> <point x="189122" y="-117733" /> <point x="189486" y="-118229" /> - </zone> - <zone id="26" minZ="-3328" maxZ="-3128" type="upper"> + <bannedZone minZ="-3432" maxZ="-2932"> + <point x="189588" y="-117368" /> + <point x="190052" y="-117368" /> + <point x="190028" y="-116868" /> + <point x="189560" y="-116892" /> + </bannedZone> + </zone> + <zone minZ="-3328" maxZ="-3128"> <point x="189479" y="-115830" /> <point x="188663" y="-115174" /> <point x="187479" y="-115006" /> @@ -243,14 +292,20 @@ <point x="187123" y="-116466" /> <point x="188635" y="-116454" /> </zone> - <zone id="27" minZ="-3365" maxZ="-3165" type="upper" bZones="50"> + <zone minZ="-3365" maxZ="-3165"> <point x="186172" y="-115111" /> <point x="186508" y="-115355" /> <point x="186776" y="-115159" /> <point x="186728" y="-113727" /> <point x="185872" y="-114111" /> - </zone> - <zone id="28" minZ="-3398" maxZ="-3198" type="upper"> + <bannedZone minZ="-3336" maxZ="-2836"> + <point x="186008" y="-114824" /> + <point x="186264" y="-114624" /> + <point x="186180" y="-114284" /> + <point x="185872" y="-114276" /> + </bannedZone> + </zone> + <zone minZ="-3398" maxZ="-3198"> <point x="186055" y="-113599" /> <point x="185827" y="-112719" /> <point x="185031" y="-112127" /> @@ -260,7 +315,7 @@ <point x="185311" y="-114243" /> <point x="185643" y="-113967" /> </zone> - <zone id="29" minZ="-3324" maxZ="-3124" type="upper"> + <zone minZ="-3324" maxZ="-3124"> <point x="188291" y="-112601" /> <point x="187787" y="-112253" /> <point x="187527" y="-112505" /> @@ -270,7 +325,7 @@ <point x="187631" y="-113773" /> <point x="188255" y="-113413" /> </zone> - <zone id="30" minZ="-3332" maxZ="-3132" type="upper"> + <zone minZ="-3332" maxZ="-3132"> <point x="190463" y="-113751" /> <point x="190315" y="-112971" /> <point x="189711" y="-112835" /> @@ -279,7 +334,7 @@ <point x="189119" y="-113707" /> <point x="189383" y="-114015" /> </zone> - <zone id="31" minZ="-3336" maxZ="-3136" type="upper"> + <zone minZ="-3336" maxZ="-3136"> <point x="188937" y="-112731" /> <point x="188337" y="-112335" /> <point x="188845" y="-111415" /> @@ -290,7 +345,7 @@ <point x="189869" y="-112031" /> <point x="189217" y="-112387" /> </zone> - <zone id="32" minZ="-3332" maxZ="-3182" type="upper" bZones="51;52;53"> + <zone minZ="-3332" maxZ="-3182"> <point x="191193" y="-109008" /> <point x="190785" y="-107960" /> <point x="189741" y="-107664" /> @@ -299,8 +354,26 @@ <point x="189241" y="-110192" /> <point x="190469" y="-110088" /> <point x="190557" y="-109808" /> - </zone> - <zone id="33" minZ="-3340" maxZ="-3140" type="upper"> + <bannedZone minZ="-3320" maxZ="-2820"> + <point x="189916" y="-109236" /> + <point x="190116" y="-109236" /> + <point x="190116" y="-109036" /> + <point x="189916" y="-109036" /> + </bannedZone> + <bannedZone minZ="-3320" maxZ="-2820"> + <point x="190708" y="-109304" /> + <point x="190852" y="-109260" /> + <point x="190760" y="-108940" /> + <point x="190624" y="-108964" /> + </bannedZone> + <bannedZone minZ="-3340" maxZ="-3140"> + <point x="189532" y="-108100" /> + <point x="189732" y="-108100" /> + <point x="189732" y="-107900" /> + <point x="189532" y="-107900" /> + </bannedZone> + </zone> + <zone minZ="-3340" maxZ="-3140"> <point x="187762" y="-109743" /> <point x="187082" y="-110095" /> <point x="187326" y="-110235" /> @@ -309,7 +382,7 @@ <point x="188242" y="-111219" /> <point x="188346" y="-110015" /> </zone> - <zone id="34" minZ="-3332" maxZ="-3132" type="upper"> + <zone minZ="-3332" maxZ="-3132"> <point x="186200" y="-109243" /> <point x="186144" y="-108607" /> <point x="185284" y="-108971" /> @@ -322,7 +395,7 @@ <point x="186848" y="-110387" /> <point x="186720" y="-109351" /> </zone> - <zone id="35" minZ="-3719" maxZ="-3569" type="upper"> + <zone minZ="-3719" maxZ="-3569"> <point x="181914" y="-108363" /> <point x="181850" y="-107951" /> <point x="180786" y="-108159" /> @@ -332,7 +405,7 @@ <point x="182790" y="-109271" /> <point x="182710" y="-108739" /> </zone> - <zone id="36" minZ="-3740" maxZ="-3540" type="upper"> + <zone minZ="-3740" maxZ="-3540"> <point x="183803" y="-112187" /> <point x="183867" y="-111743" /> <point x="184235" y="-111391" /> @@ -341,7 +414,7 @@ <point x="182891" y="-111819" /> <point x="183191" y="-112159" /> </zone> - <zone id="37" minZ="-3707" maxZ="-3507" type="upper"> + <zone minZ="-3707" maxZ="-3507"> <point x="182600" y="-112042" /> <point x="181652" y="-111582" /> <point x="181564" y="-112110" /> @@ -352,7 +425,7 @@ <point x="182108" y="-113290" /> <point x="182720" y="-112842" /> </zone> - <zone id="38" minZ="-3751" maxZ="-3551" type="upper" bZones="54"> + <zone minZ="-3751" maxZ="-3551"> <point x="180780" y="-112379" /> <point x="180276" y="-112003" /> <point x="179224" y="-111995" /> @@ -363,8 +436,14 @@ <point x="179444" y="-113707" /> <point x="180224" y="-113687" /> <point x="180728" y="-113107" /> - </zone> - <zone id="39" minZ="-3711" maxZ="-3511" type="upper"> + <bannedZone minZ="-3728" maxZ="-3228"> + <point x="179636" y="-113000" /> + <point x="179836" y="-113000" /> + <point x="179836" y="-112800" /> + <point x="179636" y="-112800" /> + </bannedZone> + </zone> + <zone minZ="-3711" maxZ="-3511"> <point x="179861" y="-108287" /> <point x="180049" y="-107871" /> <point x="179689" y="-107411" /> @@ -376,7 +455,7 @@ <point x="179773" y="-109695" /> <point x="180113" y="-108735" /> </zone> - <zone id="40" minZ="-3703" maxZ="-3503" type="upper" bZones="55"> + <zone minZ="-3703" maxZ="-3503"> <point x="176861" y="-108117" /> <point x="176021" y="-107829" /> <point x="175861" y="-108193" /> @@ -389,8 +468,14 @@ <point x="176429" y="-110853" /> <point x="176961" y="-110469" /> <point x="176917" y="-109365" /> - </zone> - <zone id="41" minZ="-3531" maxZ="-3331" type="upper"> + <bannedZone minZ="-3720" maxZ="-3220"> + <point x="175800" y="-110104" /> + <point x="176340" y="-110260" /> + <point x="176480" y="-109660" /> + <point x="175864" y="-109528" /> + </bannedZone> + </zone> + <zone minZ="-3531" maxZ="-3331"> <point x="176442" y="-111822" /> <point x="176002" y="-111794" /> <point x="175786" y="-112090" /> @@ -404,90 +489,5 @@ <point x="176306" y="-112434" /> <point x="176306" y="-112434" /> </zone> - <!-- Forge of the Gods upper level - Banned Zones --> - <zone id="42" minZ="-4272" maxZ="-3772" type="bZone"> - <point x="176380" y="-121148" /> - <point x="176992" y="-121156" /> - <point x="176948" y="-120492" /> - <point x="176388" y="-120516" /> - </zone> - <zone id="43" minZ="-3320" maxZ="-2820" type="bZone"> - <point x="186284" y="-117708" /> - <point x="186888" y="-117844" /> - <point x="186912" y="-117220" /> - <point x="186404" y="-117204" /> - </zone> - <zone id="44" minZ="-3176" maxZ="-2676" type="bZone"> - <point x="183608" y="-119784" /> - <point x="184028" y="-119792" /> - <point x="184048" y="-119332" /> - <point x="183572" y="-119344" /> - </zone> - <zone id="45" minZ="-3116" maxZ="-2916" type="bZone"> - <point x="184868" y="-120920" /> - <point x="185360" y="-120904" /> - <point x="185316" y="-120480" /> - <point x="184900" y="-120460" /> - </zone> - <zone id="46" minZ="-3196" maxZ="-2696" type="bZone"> - <point x="187352" y="-121108" /> - <point x="187832" y="-121092" /> - <point x="187800" y="-120620" /> - <point x="187328" y="-120640" /> - </zone> - <zone id="47" minZ="-3124" maxZ="-2624" type="bZone"> - <point x="188864" y="-120616" /> - <point x="189216" y="-120844" /> - <point x="189448" y="-120412" /> - <point x="189016" y="-120248" /> - </zone> - <zone id="48" minZ="-3384" maxZ="-2884" type="bZone"> - <point x="188308" y="-119220" /> - <point x="188740" y="-119084" /> - <point x="188568" y="-118608" /> - <point x="188140" y="-118824" /> - </zone> - <zone id="49" minZ="-3432" maxZ="-2932" type="bZone"> - <point x="189588" y="-117368" /> - <point x="190052" y="-117368" /> - <point x="190028" y="-116868" /> - <point x="189560" y="-116892" /> - </zone> - <zone id="50" minZ="-3336" maxZ="-2836" type="bZone"> - <point x="186008" y="-114824" /> - <point x="186264" y="-114624" /> - <point x="186180" y="-114284" /> - <point x="185872" y="-114276" /> - </zone> - <zone id="51" minZ="-3320" maxZ="-2820" type="bZone"> - <point x="189916" y="-109236" /> - <point x="190116" y="-109236" /> - <point x="190116" y="-109036" /> - <point x="189916" y="-109036" /> - </zone> - <zone id="52" minZ="-3320" maxZ="-2820" type="bZone"> - <point x="190708" y="-109304" /> - <point x="190852" y="-109260" /> - <point x="190760" y="-108940" /> - <point x="190624" y="-108964" /> - </zone> - <zone id="53" minZ="-3340" maxZ="-3140" type="bZone"> - <point x="189532" y="-108100" /> - <point x="189732" y="-108100" /> - <point x="189732" y="-107900" /> - <point x="189532" y="-107900" /> - </zone> - <zone id="54" minZ="-3728" maxZ="-3228" type="bZone"> - <point x="179636" y="-113000" /> - <point x="179836" y="-113000" /> - <point x="179836" y="-112800" /> - <point x="179636" y="-112800" /> - </zone> - <zone id="55" minZ="-3720" maxZ="-3220" type="bZone"> - <point x="175800" y="-110104" /> - <point x="176340" y="-110260" /> - <point x="176480" y="-109660" /> - <point x="175864" y="-109528" /> - </zone> - </spawnZones> + </spawnZone> </list> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/xsd/tar_beetle.xsd b/L2J_DataPack_BETA/dist/game/data/xsd/tar_beetle.xsd index c46aa8a5f4..0a945ebc5e 100644 --- a/L2J_DataPack_BETA/dist/game/data/xsd/tar_beetle.xsd +++ b/L2J_DataPack_BETA/dist/game/data/xsd/tar_beetle.xsd @@ -2,36 +2,40 @@ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="list"> <xs:complexType> - <xs:sequence minOccurs="1" maxOccurs="1"> - <xs:element name="spawnZones" minOccurs="1" maxOccurs="1"> + <xs:sequence> + <xs:element name="spawnZone" maxOccurs="2"> <xs:complexType> - <xs:sequence minOccurs="1" maxOccurs="1"> - <xs:element name="zone" minOccurs="1" maxOccurs="unbounded"> + <xs:sequence> + <xs:element name="zone" maxOccurs="unbounded"> <xs:complexType> - <xs:sequence minOccurs="1" maxOccurs="1"> - <xs:element name="point" maxOccurs="unbounded" minOccurs="1"> + <xs:sequence> + <xs:element name="point" maxOccurs="unbounded" > <xs:complexType> <xs:attribute name="x" type="xs:integer" use="required" /> <xs:attribute name="y" type="xs:integer" use="required" /> </xs:complexType> </xs:element> + <xs:element name="bannedZone" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="point" maxOccurs="unbounded"> + <xs:complexType> + <xs:attribute name="x" type="xs:integer" use="required" /> + <xs:attribute name="y" type="xs:integer" use="required" /> + </xs:complexType> + </xs:element> + </xs:sequence> + <xs:attribute name="maxZ" type="xs:integer" use="required" /> + <xs:attribute name="minZ" type="xs:integer" use="required" /> + </xs:complexType> + </xs:element> </xs:sequence> - <xs:attribute name="id" type="xs:nonNegativeInteger" use="required" /> <xs:attribute name="maxZ" type="xs:integer" use="required" /> <xs:attribute name="minZ" type="xs:integer" use="required" /> - <xs:attribute name="type" use="required"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="upper" /> - <xs:enumeration value="lower" /> - <xs:enumeration value="bZone" /> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="bZones" type="xs:normalizedString" /> </xs:complexType> </xs:element> </xs:sequence> + <xs:attribute name="maxNpcCount" type="xs:integer" use="required" /> </xs:complexType> </xs:element> </xs:sequence> -- GitLab