From 82606870c0046438dae6008b1d59e722b6b34534 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 25 Mar 2015 06:48:51 +0000 Subject: [PATCH] Sync with L2jServer HighFive Mar 25th 2015. --- .../data/scripts/ai/fantasy_isle/MC_Show.java | 222 ++-- .../scripts/ai/group_template/BeastFarm.java | 73 +- .../ai/group_template/FeedableBeasts.java | 151 +-- .../ai/group_template/RandomSpawn.java | 2 +- .../data/scripts/ai/individual/Beleth.java | 1103 +++++++++-------- .../ai/individual/DarkWaterDragon.java | 5 +- .../data/scripts/ai/individual/Orfen.java | 26 +- .../data/scripts/ai/individual/QueenAnt.java | 4 +- .../scripts/ai/individual/SinWardens.java | 4 +- .../ai/npc/ForgeOfTheGods/TarBeetleSpawn.java | 2 +- .../ai/npc/MentorGuide/MentorGuide.java | 2 +- .../ai/npc/NpcBuffers/NpcBuffersData.java | 2 +- .../NewbieTravelToken/NewbieTravelToken.java | 3 +- .../data/scripts/gracia/AI/EnergySeeds.java | 620 ++++----- .../SeedOfAnnihilation.java | 16 +- .../admincommandhandlers/AdminBuffs.java | 2 +- .../admincommandhandlers/AdminCHSiege.java | 3 +- .../effecthandlers/MagicalAttackMp.java | 20 +- .../handlers/telnethandlers/DebugHandler.java | 78 ++ .../scripts/instances/AbstractInstance.java | 12 +- .../CrystalCaverns/CrystalCaverns.java | 30 +- .../DarkCloudMansion/DarkCloudMansion.java | 8 +- .../DisciplesNecropolisPast.java | 7 +- .../FinalEmperialTomb/FinalEmperialTomb.java | 23 +- .../KaraphonHabitat/KaraphonHabitat.java | 1 - .../game/data/stats/skills/01400-01499.xml | 1 - trunk/java/com/l2jserver/Config.java | 2 +- .../gameserver/ItemsAutoDestroy.java | 32 +- .../gameserver/LoginServerThread.java | 3 +- .../gameserver/RecipeController.java | 1 + .../gameserver/ai/L2ControllableMobAI.java | 14 +- .../gameserver/communitybbs/BB/Forum.java | 21 +- .../gameserver/communitybbs/BB/Post.java | 28 +- .../Manager/ForumsBBSManager.java | 23 +- .../communitybbs/Manager/PostBBSManager.java | 4 +- .../communitybbs/Manager/TopicBBSManager.java | 11 +- .../gameserver/data/sql/impl/ClanTable.java | 8 +- .../data/xml/impl/AbilityPointsData.java | 2 +- .../gameserver/data/xml/impl/AdminData.java | 2 +- .../data/xml/impl/AppearanceItemData.java | 4 +- .../data/xml/impl/ArmorSetsData.java | 2 +- .../data/xml/impl/BeautyShopData.java | 2 +- .../gameserver/data/xml/impl/BuyListData.java | 2 +- .../gameserver/data/xml/impl/CastleData.java | 2 +- .../data/xml/impl/CategoryData.java | 2 +- .../data/xml/impl/ClassListData.java | 2 +- .../gameserver/data/xml/impl/DoorData.java | 2 +- .../data/xml/impl/EnchantItemData.java | 2 +- .../data/xml/impl/EnchantItemGroupsData.java | 4 +- .../data/xml/impl/EnchantItemHPBonusData.java | 2 +- .../data/xml/impl/EnchantItemOptionsData.java | 2 +- .../data/xml/impl/EnchantSkillGroupsData.java | 2 +- .../data/xml/impl/ExperienceData.java | 2 +- .../gameserver/data/xml/impl/FishData.java | 2 +- .../data/xml/impl/FishingMonstersData.java | 2 +- .../data/xml/impl/FishingRodsData.java | 2 +- .../gameserver/data/xml/impl/HennaData.java | 2 +- .../data/xml/impl/HitConditionBonusData.java | 2 +- .../data/xml/impl/InitialEquipmentData.java | 2 +- .../data/xml/impl/InitialShortcutData.java | 2 +- .../data/xml/impl/ItemCrystalizationData.java | 2 +- .../gameserver/data/xml/impl/KarmaData.java | 2 +- .../data/xml/impl/MultisellData.java | 2 +- .../gameserver/data/xml/impl/NpcData.java | 2 +- .../gameserver/data/xml/impl/OptionData.java | 2 +- .../data/xml/impl/PetDataTable.java | 2 +- .../data/xml/impl/PlayerTemplateData.java | 2 +- .../xml/impl/PlayerXpPercentLostData.java | 2 +- .../data/xml/impl/PrimeShopData.java | 2 +- .../gameserver/data/xml/impl/RecipeData.java | 2 +- .../data/xml/impl/SecondaryAuthData.java | 2 +- .../gameserver/data/xml/impl/ShuttleData.java | 2 +- .../data/xml/impl/SiegeScheduleData.java | 2 +- .../data/xml/impl/SkillLearnData.java | 2 +- .../data/xml/impl/SkillTreesData.java | 2 +- .../data/xml/impl/StaticObjectData.java | 2 +- .../data/xml/impl/TeleportersData.java | 2 +- .../data/xml/impl/TransformData.java | 2 +- .../gameserver/data/xml/impl/UIData.java | 2 +- .../gameserver/datatables/EventDroplist.java | 10 +- .../gameserver/datatables/ItemTable.java | 83 +- .../gameserver/datatables/SpawnTable.java | 2 +- .../gameserver/engines/DocumentBase.java | 9 +- .../engines/items/DocumentItem.java | 3 - .../instancemanager/BoatManager.java | 9 +- .../instancemanager/CHSiegeManager.java | 4 +- .../instancemanager/CastleManager.java | 32 +- .../instancemanager/CastleManorManager.java | 2 +- .../instancemanager/ClanHallManager.java | 14 +- .../instancemanager/CoupleManager.java | 29 +- .../instancemanager/DayNightSpawnManager.java | 15 +- .../instancemanager/FortManager.java | 32 +- .../FortSiegeGuardManager.java | 13 +- .../instancemanager/FortSiegeManager.java | 55 +- .../FourSepulchersManager.java | 36 +- .../instancemanager/GrandBossManager.java | 16 +- .../instancemanager/InstanceManager.java | 36 +- .../instancemanager/ItemsOnGroundManager.java | 4 +- .../instancemanager/MapRegionManager.java | 2 +- .../instancemanager/MercTicketManager.java | 27 +- .../RaidBossPointsManager.java | 19 +- .../instancemanager/RaidBossSpawnManager.java | 10 +- .../instancemanager/SiegeGuardManager.java | 6 +- .../instancemanager/SiegeManager.java | 2 +- .../instancemanager/WalkingManager.java | 2 +- .../instancemanager/ZoneManager.java | 2 +- .../gameserver/model/AutoSpawnHandler.java | 37 +- .../l2jserver/gameserver/model/BlockList.java | 16 +- .../gameserver/model/CharEffectList.java | 255 ++-- .../l2jserver/gameserver/model/L2Clan.java | 93 +- .../gameserver/model/L2CommandChannel.java | 8 +- .../gameserver/model/L2ContactList.java | 3 +- .../l2jserver/gameserver/model/L2Object.java | 1 - .../l2jserver/gameserver/model/L2Party.java | 45 +- .../l2jserver/gameserver/model/L2Radar.java | 6 +- .../gameserver/model/L2SiegeClan.java | 37 +- .../l2jserver/gameserver/model/L2Spawn.java | 31 +- .../gameserver/model/L2Territory.java | 13 +- .../l2jserver/gameserver/model/L2World.java | 34 +- .../gameserver/model/L2WorldRegion.java | 32 +- .../l2jserver/gameserver/model/MobGroup.java | 8 +- .../gameserver/model/MobGroupTable.java | 4 +- .../gameserver/model/PartyMatchRoomList.java | 6 +- .../model/PartyMatchWaitingList.java | 4 +- .../l2jserver/gameserver/model/Petition.java | 4 +- .../l2jserver/gameserver/model/StatsSet.java | 4 +- .../l2jserver/gameserver/model/TradeList.java | 16 +- .../gameserver/model/actor/L2Attackable.java | 17 +- .../gameserver/model/actor/L2Character.java | 8 +- .../gameserver/model/actor/L2Vehicle.java | 25 +- .../actor/instance/L2AuctioneerInstance.java | 4 +- .../instance/L2ControlTowerInstance.java | 8 +- .../model/actor/instance/L2DoorInstance.java | 10 +- .../instance/L2FortCommanderInstance.java | 4 +- .../model/actor/instance/L2PcInstance.java | 41 +- .../model/actor/instance/L2PetInstance.java | 11 +- .../actor/instance/L2RaceManagerInstance.java | 3 - .../actor/instance/L2ServitorInstance.java | 9 +- .../actor/instance/L2TamedBeastInstance.java | 4 +- .../model/actor/knownlist/CharKnownList.java | 6 +- .../model/actor/status/CharStatus.java | 10 +- .../model/actor/tasks/cubics/CubicAction.java | 2 +- .../gameserver/model/entity/Auction.java | 6 +- .../model/entity/BlockCheckerEngine.java | 28 +- .../gameserver/model/entity/Castle.java | 10 +- .../gameserver/model/entity/ClanHall.java | 10 +- .../gameserver/model/entity/Duel.java | 5 +- .../gameserver/model/entity/Fort.java | 18 +- .../gameserver/model/entity/FortSiege.java | 41 +- .../gameserver/model/entity/Hero.java | 284 ++--- .../gameserver/model/entity/Instance.java | 15 +- .../gameserver/model/entity/L2Event.java | 18 +- .../gameserver/model/entity/Siege.java | 71 +- .../gameserver/model/entity/TvTEvent.java | 6 +- .../gameserver/model/entity/TvTEventTeam.java | 46 +- .../entity/clanhall/ClanHallSiegeEngine.java | 77 +- .../model/events/AbstractScript.java | 17 +- .../model/holders/PlayerEventHolder.java | 6 +- .../model/instancezone/InstanceWorld.java | 4 +- .../model/itemcontainer/ItemContainer.java | 4 +- .../model/itemcontainer/PcInventory.java | 18 +- .../gameserver/model/items/L2Item.java | 2 +- .../items/appearance/AppearanceStone.java | 2 +- .../multisell/PreparedListContainer.java | 7 +- .../gameserver/model/olympiad/Olympiad.java | 148 +-- .../model/olympiad/OlympiadManager.java | 5 +- .../gameserver/model/skills/BuffInfo.java | 2 +- .../gameserver/model/skills/Skill.java | 3 +- .../gameserver/model/stats/Formulas.java | 15 +- .../model/variables/AbstractVariables.java | 6 - .../gameserver/model/zone/L2ZoneType.java | 2 +- .../model/zone/type/L2BossZone.java | 10 +- .../model/zone/type/L2EffectZone.java | 3 +- .../l2jserver/gameserver/network/Debug.java | 2 +- .../gameserver/network/L2GameClient.java | 13 +- .../clientpackets/MultiSellChoose.java | 372 +++--- .../clientpackets/RequestPrivateStoreBuy.java | 7 +- .../serverpackets/CharSelectionInfo.java | 24 +- .../serverpackets/ExEnchantSkillInfo.java | 4 +- .../serverpackets/ExGetPremiumItemList.java | 8 +- .../serverpackets/ExShowFortressMapInfo.java | 4 +- .../ExShowFortressSiegeInfo.java | 4 +- .../serverpackets/PledgeSkillList.java | 6 +- .../serverpackets/PrivateStoreListBuy.java | 10 +- .../serverpackets/RelationChanged.java | 1 - .../network/serverpackets/SellList.java | 4 - .../pathfinding/cellnodes/CellNodeBuffer.java | 9 +- .../cellnodes/CellPathFinding.java | 19 +- .../pathfinding/geonodes/GeoPathFinding.java | 22 +- .../KnownListUpdateTaskManager.java | 11 +- .../tasks/TaskRaidPointsReset.java | 3 +- .../loginserver/GameServerTable.java | 97 +- trunk/java/com/l2jserver/status/Status.java | 6 +- .../data/xml/IXmlReader.java | 25 +- 194 files changed, 2619 insertions(+), 2869 deletions(-) rename trunk/java/com/l2jserver/{gameserver => util}/data/xml/IXmlReader.java (92%) diff --git a/trunk/dist/game/data/scripts/ai/fantasy_isle/MC_Show.java b/trunk/dist/game/data/scripts/ai/fantasy_isle/MC_Show.java index 35805586fc..86aacf8f05 100644 --- a/trunk/dist/game/data/scripts/ai/fantasy_isle/MC_Show.java +++ b/trunk/dist/game/data/scripts/ai/fantasy_isle/MC_Show.java @@ -166,8 +166,8 @@ public class MC_Show extends AbstractNpcAI } } - private static Map talks = new HashMap<>(); - private static Map walks = new HashMap<>(); + private static final Map TALKS = new HashMap<>(); + private static final Map WALKS = new HashMap<>(); private MC_Show() { @@ -180,112 +180,112 @@ public class MC_Show extends AbstractNpcAI private void load() { // TODO put this stuff in Routes.xml - talks.put("1", new ShoutInfo(MESSAGES[1], "2", 1000)); - talks.put("2", new ShoutInfo(MESSAGES[2], "3", 6000)); - talks.put("3", new ShoutInfo(MESSAGES[3], "4", 4000)); - talks.put("4", new ShoutInfo(MESSAGES[4], "5", 5000)); - talks.put("5", new ShoutInfo(MESSAGES[5], "6", 3000)); - talks.put("8", new ShoutInfo(MESSAGES[9], "9", 5000)); - talks.put("9", new ShoutInfo(MESSAGES[10], "10", 5000)); - talks.put("12", new ShoutInfo(MESSAGES[12], "13", 5000)); - talks.put("13", new ShoutInfo(MESSAGES[13], "14", 5000)); - talks.put("15", new ShoutInfo(MESSAGES[14], "16", 5000)); - talks.put("16", new ShoutInfo(MESSAGES[15], "17", 5000)); - talks.put("18", new ShoutInfo(MESSAGES[17], "19", 5000)); - talks.put("19", new ShoutInfo(MESSAGES[18], "20", 5000)); - talks.put("21", new ShoutInfo(MESSAGES[19], "22", 5000)); - talks.put("22", new ShoutInfo(MESSAGES[20], "23", 400)); - talks.put("25", new ShoutInfo(MESSAGES[21], "26", 5000)); - talks.put("26", new ShoutInfo(MESSAGES[22], "27", 5400)); + TALKS.put("1", new ShoutInfo(MESSAGES[1], "2", 1000)); + TALKS.put("2", new ShoutInfo(MESSAGES[2], "3", 6000)); + TALKS.put("3", new ShoutInfo(MESSAGES[3], "4", 4000)); + TALKS.put("4", new ShoutInfo(MESSAGES[4], "5", 5000)); + TALKS.put("5", new ShoutInfo(MESSAGES[5], "6", 3000)); + TALKS.put("8", new ShoutInfo(MESSAGES[9], "9", 5000)); + TALKS.put("9", new ShoutInfo(MESSAGES[10], "10", 5000)); + TALKS.put("12", new ShoutInfo(MESSAGES[12], "13", 5000)); + TALKS.put("13", new ShoutInfo(MESSAGES[13], "14", 5000)); + TALKS.put("15", new ShoutInfo(MESSAGES[14], "16", 5000)); + TALKS.put("16", new ShoutInfo(MESSAGES[15], "17", 5000)); + TALKS.put("18", new ShoutInfo(MESSAGES[17], "19", 5000)); + TALKS.put("19", new ShoutInfo(MESSAGES[18], "20", 5000)); + TALKS.put("21", new ShoutInfo(MESSAGES[19], "22", 5000)); + TALKS.put("22", new ShoutInfo(MESSAGES[20], "23", 400)); + TALKS.put("25", new ShoutInfo(MESSAGES[21], "26", 5000)); + TALKS.put("26", new ShoutInfo(MESSAGES[22], "27", 5400)); - walks.put("npc1_1", new WalkInfo(new Location(-56546, -56384, -2008, 0), "npc1_2", 1200)); - walks.put("npc1_2", new WalkInfo(new Location(-56597, -56384, -2008, 0), "npc1_3", 1200)); - walks.put("npc1_3", new WalkInfo(new Location(-56596, -56428, -2008, 0), "npc1_4", 1200)); - walks.put("npc1_4", new WalkInfo(new Location(-56593, -56474, -2008, 0), "npc1_5", 1000)); - walks.put("npc1_5", new WalkInfo(new Location(-56542, -56474, -2008, 0), "npc1_6", 1000)); - walks.put("npc1_6", new WalkInfo(new Location(-56493, -56473, -2008, 0), "npc1_7", 2000)); - walks.put("npc1_7", new WalkInfo(new Location(-56495, -56425, -2008, 0), "npc1_1", 4000)); - walks.put("npc2_1", new WalkInfo(new Location(-56550, -56291, -2008, 0), "npc2_2", 1200)); - walks.put("npc2_2", new WalkInfo(new Location(-56601, -56293, -2008, 0), "npc2_3", 1200)); - walks.put("npc2_3", new WalkInfo(new Location(-56603, -56247, -2008, 0), "npc2_4", 1200)); - walks.put("npc2_4", new WalkInfo(new Location(-56605, -56203, -2008, 0), "npc2_5", 1000)); - walks.put("npc2_5", new WalkInfo(new Location(-56553, -56202, -2008, 0), "npc2_6", 1100)); - walks.put("npc2_6", new WalkInfo(new Location(-56504, -56200, -2008, 0), "npc2_7", 2000)); - walks.put("npc2_7", new WalkInfo(new Location(-56503, -56243, -2008, 0), "npc2_1", 4000)); - walks.put("npc3_1", new WalkInfo(new Location(-56500, -56290, -2008, 0), "npc3_2", 1200)); - walks.put("npc3_2", new WalkInfo(new Location(-56551, -56313, -2008, 0), "npc3_3", 1200)); - walks.put("npc3_3", new WalkInfo(new Location(-56601, -56293, -2008, 0), "npc3_4", 1200)); - walks.put("npc3_4", new WalkInfo(new Location(-56651, -56294, -2008, 0), "npc3_5", 1200)); - walks.put("npc3_5", new WalkInfo(new Location(-56653, -56250, -2008, 0), "npc3_6", 1200)); - walks.put("npc3_6", new WalkInfo(new Location(-56654, -56204, -2008, 0), "npc3_7", 1200)); - walks.put("npc3_7", new WalkInfo(new Location(-56605, -56203, -2008, 0), "npc3_8", 1200)); - walks.put("npc3_8", new WalkInfo(new Location(-56554, -56202, -2008, 0), "npc3_9", 1200)); - walks.put("npc3_9", new WalkInfo(new Location(-56503, -56200, -2008, 0), "npc3_10", 1200)); - walks.put("npc3_10", new WalkInfo(new Location(-56502, -56244, -2008, 0), "npc3_1", 900)); - walks.put("npc4_1", new WalkInfo(new Location(-56495, -56381, -2008, 0), "npc4_2", 1200)); - walks.put("npc4_2", new WalkInfo(new Location(-56548, -56383, -2008, 0), "npc4_3", 1200)); - walks.put("npc4_3", new WalkInfo(new Location(-56597, -56383, -2008, 0), "npc4_4", 1200)); - walks.put("npc4_4", new WalkInfo(new Location(-56643, -56385, -2008, 0), "npc4_5", 1200)); - walks.put("npc4_5", new WalkInfo(new Location(-56639, -56436, -2008, 0), "npc4_6", 1200)); - walks.put("npc4_6", new WalkInfo(new Location(-56639, -56473, -2008, 0), "npc4_7", 1200)); - walks.put("npc4_7", new WalkInfo(new Location(-56589, -56473, -2008, 0), "npc4_8", 1200)); - walks.put("npc4_8", new WalkInfo(new Location(-56541, -56473, -2008, 0), "npc4_9", 1200)); - walks.put("npc4_9", new WalkInfo(new Location(-56496, -56473, -2008, 0), "npc4_10", 1200)); - walks.put("npc4_10", new WalkInfo(new Location(-56496, -56429, -2008, 0), "npc4_1", 900)); - walks.put("npc5_1", new WalkInfo(new Location(-56549, -56335, -2008, 0), "npc5_2", 1000)); - walks.put("npc5_2", new WalkInfo(new Location(-56599, -56337, -2008, 0), "npc5_3", 2000)); - walks.put("npc5_3", new WalkInfo(new Location(-56649, -56341, -2008, 0), "npc5_4", 26000)); - walks.put("npc5_4", new WalkInfo(new Location(-56600, -56341, -2008, 0), "npc5_5", 1000)); - walks.put("npc5_5", new WalkInfo(new Location(-56553, -56341, -2008, 0), "npc5_6", 1000)); - walks.put("npc5_6", new WalkInfo(new Location(-56508, -56331, -2008, 0), "npc5_2", 8000)); - walks.put("npc6_1", new WalkInfo(new Location(-56595, -56428, -2008, 0), "npc6_2", 1000)); - walks.put("npc6_2", new WalkInfo(new Location(-56596, -56383, -2008, 0), "npc6_3", 1000)); - walks.put("npc6_3", new WalkInfo(new Location(-56648, -56384, -2008, 0), "npc6_4", 1000)); - walks.put("npc6_4", new WalkInfo(new Location(-56645, -56429, -2008, 0), "npc6_5", 1000)); - walks.put("npc6_5", new WalkInfo(new Location(-56644, -56475, -2008, 0), "npc6_6", 1000)); - walks.put("npc6_6", new WalkInfo(new Location(-56595, -56473, -2008, 0), "npc6_7", 1000)); - walks.put("npc6_7", new WalkInfo(new Location(-56542, -56473, -2008, 0), "npc6_8", 1000)); - walks.put("npc6_8", new WalkInfo(new Location(-56492, -56472, -2008, 0), "npc6_9", 1200)); - walks.put("npc6_9", new WalkInfo(new Location(-56495, -56426, -2008, 0), "npc6_10", 2000)); - walks.put("npc6_10", new WalkInfo(new Location(-56540, -56426, -2008, 0), "npc6_1", 3000)); - walks.put("npc7_1", new WalkInfo(new Location(-56603, -56249, -2008, 0), "npc7_2", 1000)); - walks.put("npc7_2", new WalkInfo(new Location(-56601, -56294, -2008, 0), "npc7_3", 1000)); - walks.put("npc7_3", new WalkInfo(new Location(-56651, -56295, -2008, 0), "npc7_4", 1000)); - walks.put("npc7_4", new WalkInfo(new Location(-56653, -56248, -2008, 0), "npc7_5", 1000)); - walks.put("npc7_5", new WalkInfo(new Location(-56605, -56203, -2008, 0), "npc7_6", 1000)); - walks.put("npc7_6", new WalkInfo(new Location(-56554, -56202, -2008, 0), "npc7_7", 1000)); - walks.put("npc7_7", new WalkInfo(new Location(-56504, -56201, -2008, 0), "npc7_8", 1000)); - walks.put("npc7_8", new WalkInfo(new Location(-56502, -56247, -2008, 0), "npc7_9", 1200)); - walks.put("npc7_9", new WalkInfo(new Location(-56549, -56248, -2008, 0), "npc7_10", 2000)); - walks.put("npc7_10", new WalkInfo(new Location(-56549, -56248, -2008, 0), "npc7_1", 3000)); - walks.put("npc8_1", new WalkInfo(new Location(-56493, -56426, -2008, 0), "npc8_2", 1000)); - walks.put("npc8_2", new WalkInfo(new Location(-56497, -56381, -2008, 0), "npc8_3", 1200)); - walks.put("npc8_3", new WalkInfo(new Location(-56544, -56381, -2008, 0), "npc8_4", 1200)); - walks.put("npc8_4", new WalkInfo(new Location(-56596, -56383, -2008, 0), "npc8_5", 1200)); - walks.put("npc8_5", new WalkInfo(new Location(-56594, -56428, -2008, 0), "npc8_6", 900)); - walks.put("npc8_6", new WalkInfo(new Location(-56645, -56429, -2008, 0), "npc8_7", 1200)); - walks.put("npc8_7", new WalkInfo(new Location(-56647, -56384, -2008, 0), "npc8_8", 1200)); - walks.put("npc8_8", new WalkInfo(new Location(-56649, -56362, -2008, 0), "npc8_9", 9200)); - walks.put("npc8_9", new WalkInfo(new Location(-56654, -56429, -2008, 0), "npc8_10", 1200)); - walks.put("npc8_10", new WalkInfo(new Location(-56644, -56474, -2008, 0), "npc8_11", 900)); - walks.put("npc8_11", new WalkInfo(new Location(-56593, -56473, -2008, 0), "npc8_12", 1100)); - walks.put("npc8_12", new WalkInfo(new Location(-56543, -56472, -2008, 0), "npc8_13", 1200)); - walks.put("npc8_13", new WalkInfo(new Location(-56491, -56471, -2008, 0), "npc8_1", 1200)); - walks.put("npc9_1", new WalkInfo(new Location(-56505, -56246, -2008, 0), "npc9_2", 1000)); - walks.put("npc9_2", new WalkInfo(new Location(-56504, -56291, -2008, 0), "npc9_3", 1200)); - walks.put("npc9_3", new WalkInfo(new Location(-56550, -56291, -2008, 0), "npc9_4", 1200)); - walks.put("npc9_4", new WalkInfo(new Location(-56600, -56292, -2008, 0), "npc9_5", 1200)); - walks.put("npc9_5", new WalkInfo(new Location(-56603, -56248, -2008, 0), "npc9_6", 900)); - walks.put("npc9_6", new WalkInfo(new Location(-56653, -56249, -2008, 0), "npc9_7", 1200)); - walks.put("npc9_7", new WalkInfo(new Location(-56651, -56294, -2008, 0), "npc9_8", 1200)); - walks.put("npc9_8", new WalkInfo(new Location(-56650, -56316, -2008, 0), "npc9_9", 9200)); - walks.put("npc9_9", new WalkInfo(new Location(-56660, -56250, -2008, 0), "npc9_10", 1200)); - walks.put("npc9_10", new WalkInfo(new Location(-56656, -56205, -2008, 0), "npc9_11", 900)); - walks.put("npc9_11", new WalkInfo(new Location(-56606, -56204, -2008, 0), "npc9_12", 1100)); - walks.put("npc9_12", new WalkInfo(new Location(-56554, -56203, -2008, 0), "npc9_13", 1200)); - walks.put("npc9_13", new WalkInfo(new Location(-56506, -56203, -2008, 0), "npc9_1", 1200)); - walks.put("24", new WalkInfo(new Location(-56730, -56340, -2008, 0), "25", 1800)); - walks.put("27", new WalkInfo(new Location(-56702, -56340, -2008, 0), "29", 1800)); + WALKS.put("npc1_1", new WalkInfo(new Location(-56546, -56384, -2008, 0), "npc1_2", 1200)); + WALKS.put("npc1_2", new WalkInfo(new Location(-56597, -56384, -2008, 0), "npc1_3", 1200)); + WALKS.put("npc1_3", new WalkInfo(new Location(-56596, -56428, -2008, 0), "npc1_4", 1200)); + WALKS.put("npc1_4", new WalkInfo(new Location(-56593, -56474, -2008, 0), "npc1_5", 1000)); + WALKS.put("npc1_5", new WalkInfo(new Location(-56542, -56474, -2008, 0), "npc1_6", 1000)); + WALKS.put("npc1_6", new WalkInfo(new Location(-56493, -56473, -2008, 0), "npc1_7", 2000)); + WALKS.put("npc1_7", new WalkInfo(new Location(-56495, -56425, -2008, 0), "npc1_1", 4000)); + WALKS.put("npc2_1", new WalkInfo(new Location(-56550, -56291, -2008, 0), "npc2_2", 1200)); + WALKS.put("npc2_2", new WalkInfo(new Location(-56601, -56293, -2008, 0), "npc2_3", 1200)); + WALKS.put("npc2_3", new WalkInfo(new Location(-56603, -56247, -2008, 0), "npc2_4", 1200)); + WALKS.put("npc2_4", new WalkInfo(new Location(-56605, -56203, -2008, 0), "npc2_5", 1000)); + WALKS.put("npc2_5", new WalkInfo(new Location(-56553, -56202, -2008, 0), "npc2_6", 1100)); + WALKS.put("npc2_6", new WalkInfo(new Location(-56504, -56200, -2008, 0), "npc2_7", 2000)); + WALKS.put("npc2_7", new WalkInfo(new Location(-56503, -56243, -2008, 0), "npc2_1", 4000)); + WALKS.put("npc3_1", new WalkInfo(new Location(-56500, -56290, -2008, 0), "npc3_2", 1200)); + WALKS.put("npc3_2", new WalkInfo(new Location(-56551, -56313, -2008, 0), "npc3_3", 1200)); + WALKS.put("npc3_3", new WalkInfo(new Location(-56601, -56293, -2008, 0), "npc3_4", 1200)); + WALKS.put("npc3_4", new WalkInfo(new Location(-56651, -56294, -2008, 0), "npc3_5", 1200)); + WALKS.put("npc3_5", new WalkInfo(new Location(-56653, -56250, -2008, 0), "npc3_6", 1200)); + WALKS.put("npc3_6", new WalkInfo(new Location(-56654, -56204, -2008, 0), "npc3_7", 1200)); + WALKS.put("npc3_7", new WalkInfo(new Location(-56605, -56203, -2008, 0), "npc3_8", 1200)); + WALKS.put("npc3_8", new WalkInfo(new Location(-56554, -56202, -2008, 0), "npc3_9", 1200)); + WALKS.put("npc3_9", new WalkInfo(new Location(-56503, -56200, -2008, 0), "npc3_10", 1200)); + WALKS.put("npc3_10", new WalkInfo(new Location(-56502, -56244, -2008, 0), "npc3_1", 900)); + WALKS.put("npc4_1", new WalkInfo(new Location(-56495, -56381, -2008, 0), "npc4_2", 1200)); + WALKS.put("npc4_2", new WalkInfo(new Location(-56548, -56383, -2008, 0), "npc4_3", 1200)); + WALKS.put("npc4_3", new WalkInfo(new Location(-56597, -56383, -2008, 0), "npc4_4", 1200)); + WALKS.put("npc4_4", new WalkInfo(new Location(-56643, -56385, -2008, 0), "npc4_5", 1200)); + WALKS.put("npc4_5", new WalkInfo(new Location(-56639, -56436, -2008, 0), "npc4_6", 1200)); + WALKS.put("npc4_6", new WalkInfo(new Location(-56639, -56473, -2008, 0), "npc4_7", 1200)); + WALKS.put("npc4_7", new WalkInfo(new Location(-56589, -56473, -2008, 0), "npc4_8", 1200)); + WALKS.put("npc4_8", new WalkInfo(new Location(-56541, -56473, -2008, 0), "npc4_9", 1200)); + WALKS.put("npc4_9", new WalkInfo(new Location(-56496, -56473, -2008, 0), "npc4_10", 1200)); + WALKS.put("npc4_10", new WalkInfo(new Location(-56496, -56429, -2008, 0), "npc4_1", 900)); + WALKS.put("npc5_1", new WalkInfo(new Location(-56549, -56335, -2008, 0), "npc5_2", 1000)); + WALKS.put("npc5_2", new WalkInfo(new Location(-56599, -56337, -2008, 0), "npc5_3", 2000)); + WALKS.put("npc5_3", new WalkInfo(new Location(-56649, -56341, -2008, 0), "npc5_4", 26000)); + WALKS.put("npc5_4", new WalkInfo(new Location(-56600, -56341, -2008, 0), "npc5_5", 1000)); + WALKS.put("npc5_5", new WalkInfo(new Location(-56553, -56341, -2008, 0), "npc5_6", 1000)); + WALKS.put("npc5_6", new WalkInfo(new Location(-56508, -56331, -2008, 0), "npc5_2", 8000)); + WALKS.put("npc6_1", new WalkInfo(new Location(-56595, -56428, -2008, 0), "npc6_2", 1000)); + WALKS.put("npc6_2", new WalkInfo(new Location(-56596, -56383, -2008, 0), "npc6_3", 1000)); + WALKS.put("npc6_3", new WalkInfo(new Location(-56648, -56384, -2008, 0), "npc6_4", 1000)); + WALKS.put("npc6_4", new WalkInfo(new Location(-56645, -56429, -2008, 0), "npc6_5", 1000)); + WALKS.put("npc6_5", new WalkInfo(new Location(-56644, -56475, -2008, 0), "npc6_6", 1000)); + WALKS.put("npc6_6", new WalkInfo(new Location(-56595, -56473, -2008, 0), "npc6_7", 1000)); + WALKS.put("npc6_7", new WalkInfo(new Location(-56542, -56473, -2008, 0), "npc6_8", 1000)); + WALKS.put("npc6_8", new WalkInfo(new Location(-56492, -56472, -2008, 0), "npc6_9", 1200)); + WALKS.put("npc6_9", new WalkInfo(new Location(-56495, -56426, -2008, 0), "npc6_10", 2000)); + WALKS.put("npc6_10", new WalkInfo(new Location(-56540, -56426, -2008, 0), "npc6_1", 3000)); + WALKS.put("npc7_1", new WalkInfo(new Location(-56603, -56249, -2008, 0), "npc7_2", 1000)); + WALKS.put("npc7_2", new WalkInfo(new Location(-56601, -56294, -2008, 0), "npc7_3", 1000)); + WALKS.put("npc7_3", new WalkInfo(new Location(-56651, -56295, -2008, 0), "npc7_4", 1000)); + WALKS.put("npc7_4", new WalkInfo(new Location(-56653, -56248, -2008, 0), "npc7_5", 1000)); + WALKS.put("npc7_5", new WalkInfo(new Location(-56605, -56203, -2008, 0), "npc7_6", 1000)); + WALKS.put("npc7_6", new WalkInfo(new Location(-56554, -56202, -2008, 0), "npc7_7", 1000)); + WALKS.put("npc7_7", new WalkInfo(new Location(-56504, -56201, -2008, 0), "npc7_8", 1000)); + WALKS.put("npc7_8", new WalkInfo(new Location(-56502, -56247, -2008, 0), "npc7_9", 1200)); + WALKS.put("npc7_9", new WalkInfo(new Location(-56549, -56248, -2008, 0), "npc7_10", 2000)); + WALKS.put("npc7_10", new WalkInfo(new Location(-56549, -56248, -2008, 0), "npc7_1", 3000)); + WALKS.put("npc8_1", new WalkInfo(new Location(-56493, -56426, -2008, 0), "npc8_2", 1000)); + WALKS.put("npc8_2", new WalkInfo(new Location(-56497, -56381, -2008, 0), "npc8_3", 1200)); + WALKS.put("npc8_3", new WalkInfo(new Location(-56544, -56381, -2008, 0), "npc8_4", 1200)); + WALKS.put("npc8_4", new WalkInfo(new Location(-56596, -56383, -2008, 0), "npc8_5", 1200)); + WALKS.put("npc8_5", new WalkInfo(new Location(-56594, -56428, -2008, 0), "npc8_6", 900)); + WALKS.put("npc8_6", new WalkInfo(new Location(-56645, -56429, -2008, 0), "npc8_7", 1200)); + WALKS.put("npc8_7", new WalkInfo(new Location(-56647, -56384, -2008, 0), "npc8_8", 1200)); + WALKS.put("npc8_8", new WalkInfo(new Location(-56649, -56362, -2008, 0), "npc8_9", 9200)); + WALKS.put("npc8_9", new WalkInfo(new Location(-56654, -56429, -2008, 0), "npc8_10", 1200)); + WALKS.put("npc8_10", new WalkInfo(new Location(-56644, -56474, -2008, 0), "npc8_11", 900)); + WALKS.put("npc8_11", new WalkInfo(new Location(-56593, -56473, -2008, 0), "npc8_12", 1100)); + WALKS.put("npc8_12", new WalkInfo(new Location(-56543, -56472, -2008, 0), "npc8_13", 1200)); + WALKS.put("npc8_13", new WalkInfo(new Location(-56491, -56471, -2008, 0), "npc8_1", 1200)); + WALKS.put("npc9_1", new WalkInfo(new Location(-56505, -56246, -2008, 0), "npc9_2", 1000)); + WALKS.put("npc9_2", new WalkInfo(new Location(-56504, -56291, -2008, 0), "npc9_3", 1200)); + WALKS.put("npc9_3", new WalkInfo(new Location(-56550, -56291, -2008, 0), "npc9_4", 1200)); + WALKS.put("npc9_4", new WalkInfo(new Location(-56600, -56292, -2008, 0), "npc9_5", 1200)); + WALKS.put("npc9_5", new WalkInfo(new Location(-56603, -56248, -2008, 0), "npc9_6", 900)); + WALKS.put("npc9_6", new WalkInfo(new Location(-56653, -56249, -2008, 0), "npc9_7", 1200)); + WALKS.put("npc9_7", new WalkInfo(new Location(-56651, -56294, -2008, 0), "npc9_8", 1200)); + WALKS.put("npc9_8", new WalkInfo(new Location(-56650, -56316, -2008, 0), "npc9_9", 9200)); + WALKS.put("npc9_9", new WalkInfo(new Location(-56660, -56250, -2008, 0), "npc9_10", 1200)); + WALKS.put("npc9_10", new WalkInfo(new Location(-56656, -56205, -2008, 0), "npc9_11", 900)); + WALKS.put("npc9_11", new WalkInfo(new Location(-56606, -56204, -2008, 0), "npc9_12", 1100)); + WALKS.put("npc9_12", new WalkInfo(new Location(-56554, -56203, -2008, 0), "npc9_13", 1200)); + WALKS.put("npc9_13", new WalkInfo(new Location(-56506, -56203, -2008, 0), "npc9_1", 1200)); + WALKS.put("24", new WalkInfo(new Location(-56730, -56340, -2008, 0), "25", 1800)); + WALKS.put("27", new WalkInfo(new Location(-56702, -56340, -2008, 0), "29", 1800)); } private void scheduleTimer() @@ -487,18 +487,18 @@ public class MC_Show extends AbstractNpcAI } else { - if (talks.containsKey(event)) + if (TALKS.containsKey(event)) { - final ShoutInfo si = talks.get(event); + final ShoutInfo si = TALKS.get(event); if (si != null) { autoChat(npc, si.getNpcStringId(), ChatType.NPC_SHOUT); startQuestTimer(si.getNextEvent(), si.getTime(), npc, null); } } - else if (walks.containsKey(event)) + else if (WALKS.containsKey(event)) { - final WalkInfo wi = walks.get(event); + final WalkInfo wi = WALKS.get(event); if (wi != null) { npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, wi.getCharPos()); diff --git a/trunk/dist/game/data/scripts/ai/group_template/BeastFarm.java b/trunk/dist/game/data/scripts/ai/group_template/BeastFarm.java index 8e9129ae52..fa94d74421 100644 --- a/trunk/dist/game/data/scripts/ai/group_template/BeastFarm.java +++ b/trunk/dist/game/data/scripts/ai/group_template/BeastFarm.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import quests.Q00020_BringUpWithLove.Q00020_BringUpWithLove; import ai.npc.AbstractNpcAI; @@ -104,8 +105,8 @@ public final class BeastFarm extends AbstractNpcAI 18900 }; - private static Map _FeedInfo = new HashMap<>(); - private static Map _GrowthCapableMobs = new HashMap<>(); + private static final Map FEED_INFO = new ConcurrentHashMap<>(); + private static final Map GROWTH_CAPABLE_MONSTERS = new HashMap<>(); private static List TAMED_BEAST_DATA = new ArrayList<>(); private BeastFarm() @@ -124,23 +125,23 @@ public final class BeastFarm extends AbstractNpcAI temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18869); temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18878); temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18879); - _GrowthCapableMobs.put(18873, temp); + GROWTH_CAPABLE_MONSTERS.put(18873, temp); temp = new GrowthCapableMob(40, 1, 18869); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18876); - _GrowthCapableMobs.put(18874, temp); + GROWTH_CAPABLE_MONSTERS.put(18874, temp); temp = new GrowthCapableMob(40, 1, 18869); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18877); - _GrowthCapableMobs.put(18875, temp); + GROWTH_CAPABLE_MONSTERS.put(18875, temp); temp = new GrowthCapableMob(25, 2, 18869); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18878); - _GrowthCapableMobs.put(18876, temp); + GROWTH_CAPABLE_MONSTERS.put(18876, temp); temp = new GrowthCapableMob(25, 2, 18869); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18879); - _GrowthCapableMobs.put(18877, temp); + GROWTH_CAPABLE_MONSTERS.put(18877, temp); // Cougar temp = new GrowthCapableMob(100, 0, 18870); @@ -150,23 +151,23 @@ public final class BeastFarm extends AbstractNpcAI temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18870); temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18885); temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18886); - _GrowthCapableMobs.put(18880, temp); + GROWTH_CAPABLE_MONSTERS.put(18880, temp); temp = new GrowthCapableMob(40, 1, 18870); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18883); - _GrowthCapableMobs.put(18881, temp); + GROWTH_CAPABLE_MONSTERS.put(18881, temp); temp = new GrowthCapableMob(40, 1, 18870); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18884); - _GrowthCapableMobs.put(18882, temp); + GROWTH_CAPABLE_MONSTERS.put(18882, temp); temp = new GrowthCapableMob(25, 2, 18870); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18885); - _GrowthCapableMobs.put(18883, temp); + GROWTH_CAPABLE_MONSTERS.put(18883, temp); temp = new GrowthCapableMob(25, 2, 18870); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18886); - _GrowthCapableMobs.put(18884, temp); + GROWTH_CAPABLE_MONSTERS.put(18884, temp); // Buffalo temp = new GrowthCapableMob(100, 0, 18871); @@ -176,23 +177,23 @@ public final class BeastFarm extends AbstractNpcAI temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18871); temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18892); temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18893); - _GrowthCapableMobs.put(18887, temp); + GROWTH_CAPABLE_MONSTERS.put(18887, temp); temp = new GrowthCapableMob(40, 1, 18871); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18890); - _GrowthCapableMobs.put(18888, temp); + GROWTH_CAPABLE_MONSTERS.put(18888, temp); temp = new GrowthCapableMob(40, 1, 18871); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18891); - _GrowthCapableMobs.put(18889, temp); + GROWTH_CAPABLE_MONSTERS.put(18889, temp); temp = new GrowthCapableMob(25, 2, 18871); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18892); - _GrowthCapableMobs.put(18890, temp); + GROWTH_CAPABLE_MONSTERS.put(18890, temp); temp = new GrowthCapableMob(25, 2, 18871); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18893); - _GrowthCapableMobs.put(18891, temp); + GROWTH_CAPABLE_MONSTERS.put(18891, temp); // Grendel temp = new GrowthCapableMob(100, 0, 18872); @@ -202,23 +203,23 @@ public final class BeastFarm extends AbstractNpcAI temp.addNpcIdForSkillId(SKILL_BLESSED_CRYSTAL_SPICE, 18872); temp.addNpcIdForSkillId(SKILL_SGRADE_GOLDEN_SPICE, 18899); temp.addNpcIdForSkillId(SKILL_SGRADE_CRYSTAL_SPICE, 18900); - _GrowthCapableMobs.put(18894, temp); + GROWTH_CAPABLE_MONSTERS.put(18894, temp); temp = new GrowthCapableMob(40, 1, 18872); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18897); - _GrowthCapableMobs.put(18895, temp); + GROWTH_CAPABLE_MONSTERS.put(18895, temp); temp = new GrowthCapableMob(40, 1, 18872); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18898); - _GrowthCapableMobs.put(18896, temp); + GROWTH_CAPABLE_MONSTERS.put(18896, temp); temp = new GrowthCapableMob(25, 2, 18872); temp.addNpcIdForSkillId(SKILL_GOLDEN_SPICE, 18899); - _GrowthCapableMobs.put(18897, temp); + GROWTH_CAPABLE_MONSTERS.put(18897, temp); temp = new GrowthCapableMob(25, 2, 18872); temp.addNpcIdForSkillId(SKILL_CRYSTAL_SPICE, 18900); - _GrowthCapableMobs.put(18898, temp); + GROWTH_CAPABLE_MONSTERS.put(18898, temp); // Tamed beasts data TAMED_BEAST_DATA.add(new TamedBeast("%name% of Focus", new SkillHolder(6432, 1), new SkillHolder(6668, 1))); @@ -232,11 +233,11 @@ public final class BeastFarm extends AbstractNpcAI public void spawnNext(L2Npc npc, L2PcInstance player, int nextNpcId, int food) { // remove the feedinfo of the mob that got despawned, if any - if (_FeedInfo.containsKey(npc.getObjectId())) + if (FEED_INFO.containsKey(npc.getObjectId())) { - if (_FeedInfo.get(npc.getObjectId()) == player.getObjectId()) + if (FEED_INFO.get(npc.getObjectId()) == player.getObjectId()) { - _FeedInfo.remove(npc.getObjectId()); + FEED_INFO.remove(npc.getObjectId()); } } // despawn the old mob @@ -289,7 +290,7 @@ public final class BeastFarm extends AbstractNpcAI L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc); // register the player in the feedinfo for the mob that just spawned - _FeedInfo.put(nextNpc.getObjectId(), player.getObjectId()); + FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId()); nextNpc.setRunning(); nextNpc.addDamageHate(player, 0, 99999); nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); @@ -319,19 +320,19 @@ public final class BeastFarm extends AbstractNpcAI // first gather some values on local variables int objectId = npc.getObjectId(); int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3) - if (_GrowthCapableMobs.containsKey(npcId)) + if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId)) { - growthLevel = _GrowthCapableMobs.get(npcId).getGrowthLevel(); + growthLevel = GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel(); } // prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast // If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder! - if ((growthLevel == 0) && _FeedInfo.containsKey(objectId)) + if ((growthLevel == 0) && FEED_INFO.containsKey(objectId)) { return super.onSkillSee(npc, caster, skill, targets, isSummon); } - _FeedInfo.put(objectId, caster.getObjectId()); + FEED_INFO.put(objectId, caster.getObjectId()); // display the social action of the beast eating the food. npc.broadcastSocialAction(2); @@ -347,22 +348,22 @@ public final class BeastFarm extends AbstractNpcAI } // if this pet can't grow, it's all done. - if (_GrowthCapableMobs.containsKey(npcId)) + if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId)) { // do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect). - int newNpcId = _GrowthCapableMobs.get(npcId).getLeveledNpcId(skillId); + int newNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getLeveledNpcId(skillId); if (newNpcId == -1) { if (growthLevel == 0) { - _FeedInfo.remove(objectId); + FEED_INFO.remove(objectId); npc.setRunning(); ((L2Attackable) npc).addDamageHate(caster, 0, 1); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster); } return super.onSkillSee(npc, caster, skill, targets, isSummon); } - else if ((growthLevel > 0) && (_FeedInfo.get(objectId) != caster.getObjectId())) + else if ((growthLevel > 0) && (FEED_INFO.get(objectId) != caster.getObjectId())) { // check if this is the same player as the one who raised it from growth 0. // if no, then do not allow a chance to raise the pet (food gets consumed but has no effect). @@ -382,9 +383,9 @@ public final class BeastFarm extends AbstractNpcAI public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { // remove the feedinfo of the mob that got killed, if any - if (_FeedInfo.containsKey(npc.getObjectId())) + if (FEED_INFO.containsKey(npc.getObjectId())) { - _FeedInfo.remove(npc.getObjectId()); + FEED_INFO.remove(npc.getObjectId()); } return super.onKill(npc, killer, isSummon); } diff --git a/trunk/dist/game/data/scripts/ai/group_template/FeedableBeasts.java b/trunk/dist/game/data/scripts/ai/group_template/FeedableBeasts.java index 261dde0a07..a22f74a9a0 100644 --- a/trunk/dist/game/data/scripts/ai/group_template/FeedableBeasts.java +++ b/trunk/dist/game/data/scripts/ai/group_template/FeedableBeasts.java @@ -20,6 +20,7 @@ package ai.group_template; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import quests.Q00020_BringUpWithLove.Q00020_BringUpWithLove; import quests.Q00655_AGrandPlanForTamingWildBeasts.Q00655_AGrandPlanForTamingWildBeasts; @@ -129,8 +130,8 @@ public final class FeedableBeasts extends AbstractNpcAI NpcStringId.ANIMALS_NEED_LOVE_TOO }; - private static Map _FeedInfo = new HashMap<>(); - private static Map _GrowthCapableMobs = new HashMap<>(); + private static final Map FEED_INFO = new ConcurrentHashMap<>(); + private static final Map GROWTH_CAPABLE_MONSTERS = new HashMap<>(); // all mobs that grow by eating private static class GrowthCapableMob @@ -221,139 +222,139 @@ public final class FeedableBeasts extends AbstractNpcAI temp = new GrowthCapableMob(0, 100); temp.addMobs(GOLDEN_SPICE, Kookabura_0_Gold); temp.addMobs(CRYSTAL_SPICE, Kookabura_0_Crystal); - _GrowthCapableMobs.put(21451, temp); + GROWTH_CAPABLE_MONSTERS.put(21451, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_1); - _GrowthCapableMobs.put(21452, temp); - _GrowthCapableMobs.put(21454, temp); + GROWTH_CAPABLE_MONSTERS.put(21452, temp); + GROWTH_CAPABLE_MONSTERS.put(21454, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_2); - _GrowthCapableMobs.put(21453, temp); - _GrowthCapableMobs.put(21455, temp); + GROWTH_CAPABLE_MONSTERS.put(21453, temp); + GROWTH_CAPABLE_MONSTERS.put(21455, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_1); - _GrowthCapableMobs.put(21456, temp); - _GrowthCapableMobs.put(21458, temp); + GROWTH_CAPABLE_MONSTERS.put(21456, temp); + GROWTH_CAPABLE_MONSTERS.put(21458, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_2); - _GrowthCapableMobs.put(21457, temp); - _GrowthCapableMobs.put(21459, temp); + GROWTH_CAPABLE_MONSTERS.put(21457, temp); + GROWTH_CAPABLE_MONSTERS.put(21459, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(GOLDEN_SPICE, Kookabura_2_1); - _GrowthCapableMobs.put(21460, temp); - _GrowthCapableMobs.put(21462, temp); + GROWTH_CAPABLE_MONSTERS.put(21460, temp); + GROWTH_CAPABLE_MONSTERS.put(21462, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(GOLDEN_SPICE, Kookabura_2_2); - _GrowthCapableMobs.put(21461, temp); - _GrowthCapableMobs.put(21463, temp); + GROWTH_CAPABLE_MONSTERS.put(21461, temp); + GROWTH_CAPABLE_MONSTERS.put(21463, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(CRYSTAL_SPICE, Kookabura_2_1); - _GrowthCapableMobs.put(21464, temp); - _GrowthCapableMobs.put(21466, temp); + GROWTH_CAPABLE_MONSTERS.put(21464, temp); + GROWTH_CAPABLE_MONSTERS.put(21466, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(CRYSTAL_SPICE, Kookabura_2_2); - _GrowthCapableMobs.put(21465, temp); - _GrowthCapableMobs.put(21467, temp); + GROWTH_CAPABLE_MONSTERS.put(21465, temp); + GROWTH_CAPABLE_MONSTERS.put(21467, temp); // Alpen Buffalo temp = new GrowthCapableMob(0, 100); temp.addMobs(GOLDEN_SPICE, Buffalo_0_Gold); temp.addMobs(CRYSTAL_SPICE, Buffalo_0_Crystal); - _GrowthCapableMobs.put(21470, temp); + GROWTH_CAPABLE_MONSTERS.put(21470, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_1); - _GrowthCapableMobs.put(21471, temp); - _GrowthCapableMobs.put(21473, temp); + GROWTH_CAPABLE_MONSTERS.put(21471, temp); + GROWTH_CAPABLE_MONSTERS.put(21473, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_2); - _GrowthCapableMobs.put(21472, temp); - _GrowthCapableMobs.put(21474, temp); + GROWTH_CAPABLE_MONSTERS.put(21472, temp); + GROWTH_CAPABLE_MONSTERS.put(21474, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_1); - _GrowthCapableMobs.put(21475, temp); - _GrowthCapableMobs.put(21477, temp); + GROWTH_CAPABLE_MONSTERS.put(21475, temp); + GROWTH_CAPABLE_MONSTERS.put(21477, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_2); - _GrowthCapableMobs.put(21476, temp); - _GrowthCapableMobs.put(21478, temp); + GROWTH_CAPABLE_MONSTERS.put(21476, temp); + GROWTH_CAPABLE_MONSTERS.put(21478, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(GOLDEN_SPICE, Buffalo_2_1); - _GrowthCapableMobs.put(21479, temp); - _GrowthCapableMobs.put(21481, temp); + GROWTH_CAPABLE_MONSTERS.put(21479, temp); + GROWTH_CAPABLE_MONSTERS.put(21481, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(GOLDEN_SPICE, Buffalo_2_2); - _GrowthCapableMobs.put(21480, temp); - _GrowthCapableMobs.put(21482, temp); + GROWTH_CAPABLE_MONSTERS.put(21480, temp); + GROWTH_CAPABLE_MONSTERS.put(21482, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(CRYSTAL_SPICE, Buffalo_2_1); - _GrowthCapableMobs.put(21483, temp); - _GrowthCapableMobs.put(21485, temp); + GROWTH_CAPABLE_MONSTERS.put(21483, temp); + GROWTH_CAPABLE_MONSTERS.put(21485, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(CRYSTAL_SPICE, Buffalo_2_2); - _GrowthCapableMobs.put(21484, temp); - _GrowthCapableMobs.put(21486, temp); + GROWTH_CAPABLE_MONSTERS.put(21484, temp); + GROWTH_CAPABLE_MONSTERS.put(21486, temp); // Alpen Cougar temp = new GrowthCapableMob(0, 100); temp.addMobs(GOLDEN_SPICE, Cougar_0_Gold); temp.addMobs(CRYSTAL_SPICE, Cougar_0_Crystal); - _GrowthCapableMobs.put(21489, temp); + GROWTH_CAPABLE_MONSTERS.put(21489, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_1); - _GrowthCapableMobs.put(21490, temp); - _GrowthCapableMobs.put(21492, temp); + GROWTH_CAPABLE_MONSTERS.put(21490, temp); + GROWTH_CAPABLE_MONSTERS.put(21492, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_2); - _GrowthCapableMobs.put(21491, temp); - _GrowthCapableMobs.put(21493, temp); + GROWTH_CAPABLE_MONSTERS.put(21491, temp); + GROWTH_CAPABLE_MONSTERS.put(21493, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_1); - _GrowthCapableMobs.put(21494, temp); - _GrowthCapableMobs.put(21496, temp); + GROWTH_CAPABLE_MONSTERS.put(21494, temp); + GROWTH_CAPABLE_MONSTERS.put(21496, temp); temp = new GrowthCapableMob(1, 40); temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_2); - _GrowthCapableMobs.put(21495, temp); - _GrowthCapableMobs.put(21497, temp); + GROWTH_CAPABLE_MONSTERS.put(21495, temp); + GROWTH_CAPABLE_MONSTERS.put(21497, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(GOLDEN_SPICE, Cougar_2_1); - _GrowthCapableMobs.put(21498, temp); - _GrowthCapableMobs.put(21500, temp); + GROWTH_CAPABLE_MONSTERS.put(21498, temp); + GROWTH_CAPABLE_MONSTERS.put(21500, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(GOLDEN_SPICE, Cougar_2_2); - _GrowthCapableMobs.put(21499, temp); - _GrowthCapableMobs.put(21501, temp); + GROWTH_CAPABLE_MONSTERS.put(21499, temp); + GROWTH_CAPABLE_MONSTERS.put(21501, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(CRYSTAL_SPICE, Cougar_2_1); - _GrowthCapableMobs.put(21502, temp); - _GrowthCapableMobs.put(21504, temp); + GROWTH_CAPABLE_MONSTERS.put(21502, temp); + GROWTH_CAPABLE_MONSTERS.put(21504, temp); temp = new GrowthCapableMob(2, 25); temp.addMobs(CRYSTAL_SPICE, Cougar_2_2); - _GrowthCapableMobs.put(21503, temp); - _GrowthCapableMobs.put(21505, temp); + GROWTH_CAPABLE_MONSTERS.put(21503, temp); + GROWTH_CAPABLE_MONSTERS.put(21505, temp); } private void spawnNext(L2Npc npc, int growthLevel, L2PcInstance player, int food) @@ -369,11 +370,11 @@ public final class FeedableBeasts extends AbstractNpcAI { if (player.getClassId().isMage()) { - nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 1, 1); + nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 1, 1); } else { - nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 1, 0); + nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 1, 0); } } else @@ -382,26 +383,26 @@ public final class FeedableBeasts extends AbstractNpcAI // that is a stronger-than-normal animal that attacks its feeder if (getRandom(5) == 0) { - nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 0, 1); + nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 1); } else { - nextNpcId = _GrowthCapableMobs.get(npcId).getMob(food, 0, 0); + nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 0); } } } else { // all other levels of growth are straight-forward - nextNpcId = _GrowthCapableMobs.get(npcId).getRandomMob(food); + nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getRandomMob(food); } // remove the feedinfo of the mob that got despawned, if any - if (_FeedInfo.containsKey(npc.getObjectId())) + if (FEED_INFO.containsKey(npc.getObjectId())) { - if (_FeedInfo.get(npc.getObjectId()) == player.getObjectId()) + if (FEED_INFO.get(npc.getObjectId()) == player.getObjectId()) { - _FeedInfo.remove(npc.getObjectId()); + FEED_INFO.remove(npc.getObjectId()); } } // despawn the old mob @@ -476,7 +477,7 @@ public final class FeedableBeasts extends AbstractNpcAI } // register the player in the feedinfo for the mob that just spawned - _FeedInfo.put(nextNpc.getObjectId(), player.getObjectId()); + FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId()); nextNpc.setRunning(); nextNpc.addDamageHate(player, 0, 99999); nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); @@ -491,9 +492,9 @@ public final class FeedableBeasts extends AbstractNpcAI if (MAD_COW_POLYMORPH.containsKey(npc.getId())) { // remove the feed info from the previous mob - if (_FeedInfo.get(npc.getObjectId()) == player.getObjectId()) + if (FEED_INFO.get(npc.getObjectId()) == player.getObjectId()) { - _FeedInfo.remove(npc.getObjectId()); + FEED_INFO.remove(npc.getObjectId()); } // despawn the mad cow npc.deleteMe(); @@ -501,7 +502,7 @@ public final class FeedableBeasts extends AbstractNpcAI L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc); // register the player in the feedinfo for the mob that just spawned - _FeedInfo.put(nextNpc.getObjectId(), player.getObjectId()); + FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId()); nextNpc.setRunning(); nextNpc.addDamageHate(player, 0, 99999); nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); @@ -531,19 +532,19 @@ public final class FeedableBeasts extends AbstractNpcAI // first gather some values on local variables int objectId = npc.getObjectId(); int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3) - if (_GrowthCapableMobs.containsKey(npcId)) + if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId)) { - growthLevel = _GrowthCapableMobs.get(npcId).getGrowthLevel(); + growthLevel = GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel(); } // prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast // If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder! - if ((growthLevel == 0) && _FeedInfo.containsKey(objectId)) + if ((growthLevel == 0) && FEED_INFO.containsKey(objectId)) { return super.onSkillSee(npc, caster, skill, targets, isSummon); } - _FeedInfo.put(objectId, caster.getObjectId()); + FEED_INFO.put(objectId, caster.getObjectId()); int food = 0; if (skillId == SKILL_GOLDEN_SPICE) @@ -559,10 +560,10 @@ public final class FeedableBeasts extends AbstractNpcAI npc.broadcastSocialAction(2); // if this pet can't grow, it's all done. - if (_GrowthCapableMobs.containsKey(npcId)) + if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId)) { // do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect). - if (_GrowthCapableMobs.get(npcId).getMob(food, 0, 0) == null) + if (GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 0) == null) { return super.onSkillSee(npc, caster, skill, targets, isSummon); } @@ -579,7 +580,7 @@ public final class FeedableBeasts extends AbstractNpcAI npc.broadcastPacket(packet); } - if ((growthLevel > 0) && (_FeedInfo.get(objectId) != caster.getObjectId())) + if ((growthLevel > 0) && (FEED_INFO.get(objectId) != caster.getObjectId())) { // check if this is the same player as the one who raised it from growth 0. // if no, then do not allow a chance to raise the pet (food gets consumed but has no effect). @@ -587,7 +588,7 @@ public final class FeedableBeasts extends AbstractNpcAI } // Polymorph the mob, with a certain chance, given its current growth level - if (getRandom(100) < _GrowthCapableMobs.get(npcId).getChance()) + if (getRandom(100) < GROWTH_CAPABLE_MONSTERS.get(npcId).getChance()) { spawnNext(npc, growthLevel, caster, food); } @@ -614,9 +615,9 @@ public final class FeedableBeasts extends AbstractNpcAI public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { // remove the feedinfo of the mob that got killed, if any - if (_FeedInfo.containsKey(npc.getObjectId())) + if (FEED_INFO.containsKey(npc.getObjectId())) { - _FeedInfo.remove(npc.getObjectId()); + FEED_INFO.remove(npc.getObjectId()); } return super.onKill(npc, killer, isSummon); } diff --git a/trunk/dist/game/data/scripts/ai/group_template/RandomSpawn.java b/trunk/dist/game/data/scripts/ai/group_template/RandomSpawn.java index 117e1c144b..bc6eac78d6 100644 --- a/trunk/dist/game/data/scripts/ai/group_template/RandomSpawn.java +++ b/trunk/dist/game/data/scripts/ai/group_template/RandomSpawn.java @@ -33,7 +33,7 @@ import com.l2jserver.gameserver.model.actor.L2Npc; */ public final class RandomSpawn extends AbstractNpcAI { - private static Map SPAWN_POINTS = new HashMap<>(); + private static final Map SPAWN_POINTS = new HashMap<>(); static { // Keltas diff --git a/trunk/dist/game/data/scripts/ai/individual/Beleth.java b/trunk/dist/game/data/scripts/ai/individual/Beleth.java index e5926c5b3b..1f50ef102d 100644 --- a/trunk/dist/game/data/scripts/ai/individual/Beleth.java +++ b/trunk/dist/game/data/scripts/ai/individual/Beleth.java @@ -20,16 +20,13 @@ package ai.individual; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ScheduledFuture; import ai.npc.AbstractNpcAI; import com.l2jserver.Config; -import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.cache.HtmCache; import com.l2jserver.gameserver.data.xml.impl.DoorData; -import com.l2jserver.gameserver.enums.ChatType; import com.l2jserver.gameserver.instancemanager.GrandBossManager; import com.l2jserver.gameserver.instancemanager.ZoneManager; import com.l2jserver.gameserver.model.L2Object; @@ -41,10 +38,10 @@ import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.effects.L2EffectType; +import com.l2jserver.gameserver.model.holders.ItemHolder; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.skills.Skill; import com.l2jserver.gameserver.model.zone.L2ZoneType; -import com.l2jserver.gameserver.network.serverpackets.CreatureSay; import com.l2jserver.gameserver.network.serverpackets.DoorStatusUpdate; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.PlaySound; @@ -55,292 +52,76 @@ import com.l2jserver.gameserver.util.Util; /** * Beleth's AI. - * @author Treat + * @author Treat, Sahar */ public final class Beleth extends AbstractNpcAI { + // Status + private static final int ALIVE = 0; + private static final int INIT = 1; + private static final int FIGHT = 2; + private static final int DEAD = 3; // NPCs - private static final int BELETH_ID_1 = 29118; - private static final int BELETH_ID_2 = 29119; // Fake Beleth - protected static L2Npc CAMERA; - protected static L2Npc CAMERA2; - protected static L2Npc CAMERA3; - protected static L2Npc CAMERA4; - protected static L2Npc BELETH; - protected static L2Npc PRIEST; - protected static L2ZoneType ZONE = null; - private static L2PcInstance BELETH_KILLER; - private static boolean DEBUG = false; - protected static boolean MOVIE = false; - private static boolean ATTACKED = false; - private static int ALLOW_OBJECT_ID = 0; - private static int KILLED = 0; - protected static ScheduledFuture SPAWN_TIMER = null; - protected static final List MINIONS = new CopyOnWriteArrayList<>(); + private static final int REAL_BELETH = 29118; + private static final int FAKE_BELETH = 29119; + private static final int STONE_COFFIN = 32470; + private static final int ELF = 29128; + private static final int WHIRPOOL = 29125; + // Zones + private static final L2ZoneType ZONE = ZoneManager.getInstance().getZoneById(12018); + private static final Location BELETH_SPAWN = new Location(16323, 213059, -9357, 49152); + // Skills private static final SkillHolder BLEED = new SkillHolder(5495, 1); private static final SkillHolder FIREBALL = new SkillHolder(5496, 1); private static final SkillHolder HORN_OF_RISING = new SkillHolder(5497, 1); private static final SkillHolder LIGHTENING = new SkillHolder(5499, 1); - - protected static final Location BELETH_SPAWN = new Location(16323, 213059, -9357, 49152); + // Doors + private static final int DOOR1 = 20240001; + private static final int DOOR2 = 20240002; + private static final int DOOR3 = 20240003; + // Items + private static final ItemHolder RING = new ItemHolder(10314, 1); + // Variables + private L2Npc _camera1; + private L2Npc _camera2; + private L2Npc _camera3; + private L2Npc _camera4; + private L2Npc _whirpool; + private L2Npc _beleth; + private L2Npc _priest; + private L2Npc _stone; + private L2PcInstance _killer; + private int _allowedObjId; + private int _killedCount; + private final List _minions = new CopyOnWriteArrayList<>(); private Beleth() { super(Beleth.class.getSimpleName(), "ai/individual"); - ZONE = ZoneManager.getInstance().getZoneById(12018); - addEnterZoneId(12018); - registerMobs(BELETH_ID_1, BELETH_ID_2); - addStartNpc(32470); - addTalkId(32470); - addFirstTalkId(29128); - StatsSet info = GrandBossManager.getInstance().getStatsSet(BELETH_ID_1); - int status = GrandBossManager.getInstance().getBossStatus(BELETH_ID_1); - if (status == 3) + addEnterZoneId(ZONE.getId()); + registerMobs(REAL_BELETH, FAKE_BELETH); + addStartNpc(STONE_COFFIN); + addTalkId(STONE_COFFIN); + addFirstTalkId(ELF); + StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH); + int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH); + if (status == DEAD) { final long time = (info.getLong("respawn_time") - System.currentTimeMillis()); if (time > 0) { - startQuestTimer("UNLOCK", time, null, null); + startQuestTimer("BELETH_UNLOCK", time, null, null); } else { - GrandBossManager.getInstance().setBossStatus(BELETH_ID_1, 0); + GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE); } } - else if (status != 0) + else if (status != ALIVE) { - GrandBossManager.getInstance().setBossStatus(BELETH_ID_1, 0); - } - DoorData.getInstance().getDoor(20240001).openMe(); - } - - public static void startSpawnTask() - { - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(1), DEBUG ? 10000 : 300000); - } - - private static class Spawn implements Runnable - { - private int _taskId = 0; - - public Spawn(int taskId) - { - _taskId = taskId; - } - - @Override - public void run() - { - try - { - int instanceId = 0; - switch (_taskId) - { - case 1: - MOVIE = true; - for (L2Character npc : ZONE.getCharactersInside()) - { - if (npc.isNpc()) - { - npc.deleteMe(); - } - } - CAMERA = addSpawn(29120, new Location(16323, 213142, -9357, 0, instanceId)); - CAMERA2 = addSpawn(29121, new Location(16323, 210741, -9357, 0, instanceId)); - CAMERA3 = addSpawn(29122, new Location(16323, 213170, -9357, 0, instanceId)); - CAMERA4 = addSpawn(29123, new Location(16323, 214917, -9356, 0, instanceId)); - ZONE.broadcastPacket(new PlaySound(1, "BS07_A", 1, CAMERA.getObjectId(), CAMERA.getX(), CAMERA.getY(), CAMERA.getZ())); - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 75, -25, 0, 2500, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 75, -25, 0, 2500, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(2), 300); - break; - case 2: - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 1800, -45, -45, 5000, 5000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(3), 4900); - break; - case 3: - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 2500, -120, -45, 5000, 5000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(4), 4900); - break; - case 4: - ZONE.broadcastPacket(new SpecialCamera(CAMERA2, 2200, 130, 0, 0, 1500, -20, 15, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(5), 1400); - break; - case 5: - ZONE.broadcastPacket(new SpecialCamera(CAMERA2, 2300, 100, 0, 2000, 4500, 0, 10, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(6), 2500); - break; - case 6: - L2DoorInstance door = DoorData.getInstance().getDoor(20240001); - door.closeMe(); - ZONE.broadcastPacket(new StaticObject(door, false)); - ZONE.broadcastPacket(new DoorStatusUpdate(door)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(7), 1700); - break; - case 7: - ZONE.broadcastPacket(new SpecialCamera(CAMERA4, 1500, 210, 0, 0, 1500, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA4, 900, 255, 0, 5000, 6500, 0, 10, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(8), 6000); - break; - case 8: - addSpawn(29125, new Location(16323, 214917, -9356, 0, instanceId)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA4, 900, 255, 0, 0, 1500, 0, 10, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(9), 1000); - break; - case 9: - ZONE.broadcastPacket(new SpecialCamera(CAMERA4, 1000, 255, 0, 7000, 17000, 0, 25, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(10), 3000); - break; - case 10: - BELETH = addSpawn(BELETH_ID_1, new Location(16321, 214211, -9352, 49369, instanceId)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(11), 200); - break; - case 11: - ZONE.broadcastPacket(new SocialAction(BELETH.getObjectId(), 1)); - for (int i = 0; i < 6; i++) - { - int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323); - int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059); - L2Npc minion = addSpawn(BELETH_ID_2, new Location(x, y, -9357, 49152, BELETH.getInstanceId())); - minion.setShowSummonAnimation(true); - minion.deleteMe(); - MINIONS.add(minion); - } - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(12), 6800); - break; - case 12: - ZONE.broadcastPacket(new SpecialCamera(BELETH, 0, 270, -5, 0, 4000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(13), 3500); - break; - case 13: - ZONE.broadcastPacket(new SpecialCamera(BELETH, 800, 270, 10, 3000, 6000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(14), 5000); - break; - case 14: - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 100, 270, 15, 0, 5000, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 100, 270, 15, 0, 5000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(15), 100); - break; - case 15: - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 100, 270, 15, 3000, 6000, 0, 5, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(16), 1400); - break; - case 16: - BELETH.teleToLocation(BELETH_SPAWN); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(17), 200); - break; - case 17: - ZONE.broadcastPacket(new MagicSkillUse(BELETH, BELETH, 5532, 1, 2000, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(18), 2000); - break; - case 18: - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 700, 270, 20, 1500, 8000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(19), 6900); - break; - case 19: - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 40, 260, 0, 0, 4000, 0, 0, 1, 0, 0)); - for (L2Npc fakeBeleth : MINIONS) - { - fakeBeleth.spawnMe(); - } - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(20), 3000); - break; - case 20: - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 40, 280, 0, 0, 4000, 5, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(21), 3000); - break; - case 21: - ZONE.broadcastPacket(new SpecialCamera(CAMERA3, 5, 250, 5, 0, 13000, 20, 15, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(22), 1000); - break; - case 22: - ZONE.broadcastPacket(new SocialAction(BELETH.getObjectId(), 3)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(23), 4000); - break; - case 23: - ZONE.broadcastPacket(new MagicSkillUse(BELETH, BELETH, 5533, 1, 2000, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(24), 6800); - break; - case 24: - BELETH.deleteMe(); - for (L2Npc fakeBeleth : MINIONS) - { - fakeBeleth.deleteMe(); - } - MINIONS.clear(); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(25), 1000); - break; - case 25: - CAMERA.deleteMe(); - CAMERA2.deleteMe(); - CAMERA3.deleteMe(); - CAMERA4.deleteMe(); - MOVIE = false; - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(26), 60000); - break; - case 26: - if (SPAWN_TIMER != null) - { - SPAWN_TIMER.cancel(false); - setSpawnTimer(0); - } - SpawnBeleths(); - break; - case 27: - BELETH.doDie(null); - CAMERA = addSpawn(29122, new Location(16323, 213170, -9357, 0, instanceId)); - CAMERA.broadcastPacket(new PlaySound(1, "BS07_D", 1, CAMERA.getObjectId(), CAMERA.getX(), CAMERA.getY(), CAMERA.getZ())); - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 290, 25, 0, 10000, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 290, 25, 0, 10000, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 110, 25, 4000, 10000, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SocialAction(BELETH.getObjectId(), 5)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(28), 4000); - break; - case 28: - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 295, 25, 4000, 5000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(29), 4500); - break; - case 29: - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 400, 295, 10, 4000, 11000, 0, 25, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(30), 9000); - break; - case 30: - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 250, 90, 25, 0, 1000, 0, 0, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA, 250, 90, 25, 0, 10000, 0, 0, 1, 0, 0)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(31), 2000); - break; - case 31: - PRIEST.spawnMe(); - BELETH.deleteMe(); - CAMERA2 = addSpawn(29121, new Location(14056, 213170, -9357, 0, instanceId)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(32), 3500); - break; - case 32: - ZONE.broadcastPacket(new SpecialCamera(CAMERA2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0)); - ZONE.broadcastPacket(new SpecialCamera(CAMERA2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0)); - L2DoorInstance door2 = DoorData.getInstance().getDoor(20240002); - door2.openMe(); - ZONE.broadcastPacket(new StaticObject(door2, false)); - ZONE.broadcastPacket(new DoorStatusUpdate(door2)); - DoorData.getInstance().getDoor(20240003).openMe(); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(33), 4000); - break; - case 33: - CAMERA.deleteMe(); - CAMERA2.deleteMe(); - MOVIE = false; - break; - case 333: - BELETH = addSpawn(BELETH_ID_1, new Location(16323, 213170, -9357, 49152)); - break; - - } - } - catch (Exception e) - { - e.printStackTrace(); - } + GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE); } + DoorData.getInstance().getDoor(DOOR1).openMe(); } @Override @@ -348,10 +129,10 @@ public final class Beleth extends AbstractNpcAI { switch (event) { - case "UNLOCK": + case "BELETH_UNLOCK": { - GrandBossManager.getInstance().setBossStatus(BELETH_ID_1, 0); - DoorData.getInstance().getDoor(20240001).openMe(); + GrandBossManager.getInstance().setBossStatus(REAL_BELETH, ALIVE); + DoorData.getInstance().getDoor(DOOR1).openMe(); break; } case "CAST": @@ -363,6 +144,396 @@ public final class Beleth extends AbstractNpcAI } break; } + case "SPAWN1": + { + ZONE.getCharactersInside().forEach(c -> + { + c.disableAllSkills(); + c.setIsInvul(true); + c.setIsImmobilized(true); + }); + + _camera1 = addSpawn(29120, new Location(16323, 213142, -9357)); + _camera2 = addSpawn(29121, new Location(16323, 210741, -9357)); + _camera3 = addSpawn(29122, new Location(16323, 213170, -9357)); + _camera4 = addSpawn(29123, new Location(16323, 214917, -9356)); + + ZONE.broadcastPacket(new PlaySound(1, "BS07_A", 1, _camera1.getObjectId(), _camera1.getX(), _camera1.getY(), _camera1.getZ())); + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 75, -25, 0, 2500, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 75, -25, 0, 2500, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN2", 300, null, null); + break; + } + case "SPAWN2": + { + ZONE.broadcastPacket(new SpecialCamera(_camera1, 1800, -45, -45, 5000, 5000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN3", 4900, null, null); + break; + } + case "SPAWN3": + { + ZONE.broadcastPacket(new SpecialCamera(_camera1, 2500, -120, -45, 5000, 5000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN4", 4900, null, null); + break; + } + case "SPAWN4": + { + ZONE.broadcastPacket(new SpecialCamera(_camera2, 2200, 130, 0, 0, 1500, -20, 15, 1, 0, 0)); + + startQuestTimer("SPAWN5", 1400, null, null); + break; + } + case "SPAWN5": + { + ZONE.broadcastPacket(new SpecialCamera(_camera2, 2300, 100, 0, 2000, 4500, 0, 10, 1, 0, 0)); + + startQuestTimer("SPAWN6", 2500, null, null); + break; + } + case "SPAWN6": + { + final L2DoorInstance door = DoorData.getInstance().getDoor(DOOR1); + door.closeMe(); + + ZONE.broadcastPacket(new StaticObject(door, false)); + ZONE.broadcastPacket(new DoorStatusUpdate(door)); + + startQuestTimer("SPAWN7", 1700, null, null); + break; + } + case "SPAWN7": + { + ZONE.broadcastPacket(new SpecialCamera(_camera4, 1500, 210, 0, 0, 1500, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera4, 900, 255, 0, 5000, 6500, 0, 10, 1, 0, 0)); + + startQuestTimer("SPAWN8", 6000, null, null); + break; + } + case "SPAWN8": + { + _whirpool = addSpawn(WHIRPOOL, new Location(16323, 214917, -9356)); + + ZONE.broadcastPacket(new SpecialCamera(_camera4, 900, 255, 0, 0, 1500, 0, 10, 1, 0, 0)); + + startQuestTimer("SPAWN9", 1000, null, null); + break; + } + case "SPAWN9": + { + ZONE.broadcastPacket(new SpecialCamera(_camera4, 1000, 255, 0, 7000, 17000, 0, 25, 1, 0, 0)); + + startQuestTimer("SPAWN10", 3000, null, null); + break; + } + case "SPAWN10": + { + _beleth = addSpawn(REAL_BELETH, new Location(16321, 214211, -9352, 49369)); + _beleth.disableAllSkills(); + _beleth.setIsInvul(true); + _beleth.setIsImmobilized(true); + + startQuestTimer("SPAWN11", 200, null, null); + break; + } + case "SPAWN11": + { + ZONE.broadcastPacket(new SocialAction(_beleth.getObjectId(), 1)); + + for (int i = 0; i < 6; i++) + { + int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323); + int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059); + L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152)); + minion.setShowSummonAnimation(true); + minion.decayMe(); + + _minions.add(minion); + } + + startQuestTimer("SPAWN12", 6800, null, null); + break; + } + case "SPAWN12": + { + ZONE.broadcastPacket(new SpecialCamera(_beleth, 0, 270, -5, 0, 4000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN13", 3500, null, null); + break; + } + case "SPAWN13": + { + ZONE.broadcastPacket(new SpecialCamera(_beleth, 800, 270, 10, 3000, 6000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN14", 5000, null, null); + break; + } + case "SPAWN14": + { + ZONE.broadcastPacket(new SpecialCamera(_camera3, 100, 270, 15, 0, 5000, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera3, 100, 270, 15, 0, 5000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN15", 100, null, null); + break; + } + case "SPAWN15": + { + ZONE.broadcastPacket(new SpecialCamera(_camera3, 100, 270, 15, 3000, 6000, 0, 5, 1, 0, 0)); + + startQuestTimer("SPAWN16", 1400, null, null); + break; + } + case "SPAWN16": + { + _beleth.teleToLocation(BELETH_SPAWN); + + startQuestTimer("SPAWN17", 200, null, null); + break; + } + case "SPAWN17": + { + ZONE.broadcastPacket(new MagicSkillUse(_beleth, _beleth, 5532, 1, 2000, 0)); + + startQuestTimer("SPAWN18", 2000, null, null); + break; + } + case "SPAWN18": + { + ZONE.broadcastPacket(new SpecialCamera(_camera3, 700, 270, 20, 1500, 8000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN19", 6900, null, null); + break; + } + case "SPAWN19": + { + ZONE.broadcastPacket(new SpecialCamera(_camera3, 40, 260, 0, 0, 4000, 0, 0, 1, 0, 0)); + + for (L2Npc fakeBeleth : _minions) + { + fakeBeleth.spawnMe(); + fakeBeleth.disableAllSkills(); + fakeBeleth.setIsInvul(true); + fakeBeleth.setIsImmobilized(true); + } + + startQuestTimer("SPAWN20", 3000, null, null); + break; + } + case "SPAWN20": + { + ZONE.broadcastPacket(new SpecialCamera(_camera3, 40, 280, 0, 0, 4000, 5, 0, 1, 0, 0)); + + startQuestTimer("SPAWN21", 3000, null, null); + break; + } + case "SPAWN21": + { + ZONE.broadcastPacket(new SpecialCamera(_camera3, 5, 250, 5, 0, 13000, 20, 15, 1, 0, 0)); + + startQuestTimer("SPAWN22", 1000, null, null); + break; + } + case "SPAWN22": + { + ZONE.broadcastPacket(new SocialAction(_beleth.getObjectId(), 3)); + + startQuestTimer("SPAWN23", 4000, null, null); + break; + } + case "SPAWN23": + { + ZONE.broadcastPacket(new MagicSkillUse(_beleth, _beleth, 5533, 1, 2000, 0)); + + startQuestTimer("SPAWN24", 6800, null, null); + break; + } + case "SPAWN24": + { + _beleth.deleteMe(); + _beleth = null; + + for (L2Npc fakeBeleth : _minions) + { + fakeBeleth.deleteMe(); + } + _minions.clear(); + + _camera1.deleteMe(); + _camera2.deleteMe(); + _camera3.deleteMe(); + _camera4.deleteMe(); + + for (L2Character c : ZONE.getCharactersInside()) + { + c.enableAllSkills(); + c.setIsInvul(false); + c.setIsImmobilized(false); + } + + startQuestTimer("SPAWN25", 60000, null, null); + break; + } + case "SPAWN25": + { + int a = 0; + for (int i = 0; i < 16; i++) + { + a++; + + int x = (int) ((650 * Math.cos(i * 0.39)) + 16323); + int y = (int) ((650 * Math.sin(i * 0.39)) + 213170); + + npc = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152)); + _minions.add(npc); + + if (a >= 2) + { + npc.setIsOverloaded(true); + a = 0; + } + } + + int[] xm = new int[16]; + int[] ym = new int[16]; + for (int i = 0; i < 4; i++) + { + xm[i] = (int) ((1700 * Math.cos((i * 1.57) + 0.78)) + 16323); + ym[i] = (int) ((1700 * Math.sin((i * 1.57) + 0.78)) + 213170); + + npc = addSpawn(FAKE_BELETH, new Location(xm[i], ym[i], -9357, 49152)); + npc.setIsImmobilized(true); + + _minions.add(npc); + } + + xm[4] = (xm[0] + xm[1]) / 2; + ym[4] = (ym[0] + ym[1]) / 2; + npc = addSpawn(FAKE_BELETH, new Location(xm[4], ym[4], -9357, 49152)); + npc.setIsImmobilized(true); + _minions.add(npc); + xm[5] = (xm[1] + xm[2]) / 2; + ym[5] = (ym[1] + ym[2]) / 2; + npc = addSpawn(FAKE_BELETH, new Location(xm[5], ym[5], -9357, 49152)); + npc.setIsImmobilized(true); + _minions.add(npc); + xm[6] = (xm[2] + xm[3]) / 2; + ym[6] = (ym[2] + ym[3]) / 2; + npc = addSpawn(FAKE_BELETH, new Location(xm[6], ym[6], -9357, 49152)); + npc.setIsImmobilized(true); + _minions.add(npc); + xm[7] = (xm[3] + xm[0]) / 2; + ym[7] = (ym[3] + ym[0]) / 2; + npc = addSpawn(FAKE_BELETH, new Location(xm[7], ym[7], -9357, 49152)); + npc.setIsImmobilized(true); + _minions.add(npc); + + xm[8] = (xm[0] + xm[4]) / 2; + ym[8] = (ym[0] + ym[4]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[8], ym[8], -9357, 49152))); + xm[9] = (xm[4] + xm[1]) / 2; + ym[9] = (ym[4] + ym[1]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[9], ym[9], -9357, 49152))); + xm[10] = (xm[1] + xm[5]) / 2; + ym[10] = (ym[1] + ym[5]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[10], ym[10], -9357, 49152))); + xm[11] = (xm[5] + xm[2]) / 2; + ym[11] = (ym[5] + ym[2]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[11], ym[11], -9357, 49152))); + xm[12] = (xm[2] + xm[6]) / 2; + ym[12] = (ym[2] + ym[6]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[12], ym[12], -9357, 49152))); + xm[13] = (xm[6] + xm[3]) / 2; + ym[13] = (ym[6] + ym[3]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[13], ym[13], -9357, 49152))); + xm[14] = (xm[3] + xm[7]) / 2; + ym[14] = (ym[3] + ym[7]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[14], ym[14], -9357, 49152))); + xm[15] = (xm[7] + xm[0]) / 2; + ym[15] = (ym[7] + ym[0]) / 2; + _minions.add(addSpawn(FAKE_BELETH, new Location(xm[15], ym[15], -9357, 49152))); + + _allowedObjId = _minions.get(getRandom(_minions.size())).getObjectId(); + break; + } + case "SPAWN_REAL": + { + _beleth = addSpawn(REAL_BELETH, new Location(16323, 213170, -9357, 49152)); + break; + } + case "SPAWN26": + { + _beleth.doDie(null); + + _camera1 = addSpawn(29122, new Location(16323, 213170, -9357)); + _camera1.broadcastPacket(new PlaySound(1, "BS07_D", 1, _camera1.getObjectId(), _camera1.getX(), _camera1.getY(), _camera1.getZ())); + + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 290, 25, 0, 10000, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 290, 25, 0, 10000, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 110, 25, 4000, 10000, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SocialAction(_beleth.getObjectId(), 5)); + + startQuestTimer("SPAWN27", 4000, null, null); + break; + } + case "SPAWN27": + { + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 295, 25, 4000, 5000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN28", 4500, null, null); + break; + } + case "SPAWN28": + { + ZONE.broadcastPacket(new SpecialCamera(_camera1, 400, 295, 10, 4000, 11000, 0, 25, 1, 0, 0)); + + startQuestTimer("SPAWN29", 9000, null, null); + break; + } + case "SPAWN29": + { + ZONE.broadcastPacket(new SpecialCamera(_camera1, 250, 90, 25, 0, 1000, 0, 0, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera1, 250, 90, 25, 0, 10000, 0, 0, 1, 0, 0)); + + startQuestTimer("SPAWN30", 2000, null, null); + break; + } + case "SPAWN30": + { + _priest.spawnMe(); + _beleth.deleteMe(); + + _camera2 = addSpawn(29121, new Location(14056, 213170, -9357)); + + startQuestTimer("SPAWN31", 3500, null, null); + break; + } + case "SPAWN31": + { + ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0)); + ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0)); + + L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2); + door2.openMe(); + + ZONE.broadcastPacket(new StaticObject(door2, false)); + ZONE.broadcastPacket(new DoorStatusUpdate(door2)); + + DoorData.getInstance().getDoor(DOOR3).openMe(); + + _camera1.deleteMe(); + _camera2.deleteMe(); + _whirpool.deleteMe(); + + for (L2Character c : ZONE.getCharactersInside()) + { + c.enableAllSkills(); + c.setIsInvul(false); + c.setIsImmobilized(false); + } + break; + } } return super.onAdvEvent(event, npc, player); } @@ -370,142 +541,62 @@ public final class Beleth extends AbstractNpcAI @Override public String onEnterZone(L2Character character, L2ZoneType zone) { - if (((character.isPlayer()) && (GrandBossManager.getInstance().getBossStatus(BELETH_ID_1) == 1)) || (DEBUG && (GrandBossManager.getInstance().getBossStatus(BELETH_ID_1) != 2) && (character.isPlayer()))) + if (character.isPlayer() && (GrandBossManager.getInstance().getBossStatus(REAL_BELETH) == INIT)) { - startSpawnTask(); - GrandBossManager.getInstance().setBossStatus(BELETH_ID_1, 2); + if (_priest != null) + { + _priest.deleteMe(); + } + if (_stone != null) + { + _stone.deleteMe(); + } + + GrandBossManager.getInstance().setBossStatus(REAL_BELETH, FIGHT); + startQuestTimer("SPAWN1", 300000, null, null); } return super.onEnterZone(character, zone); } - @Override - public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) - { - if ((npc.getId() == BELETH_ID_1) && (killer != null)) - { - setBelethKiller(killer); - GrandBossManager.getInstance().setBossStatus(BELETH_ID_1, 3); - // Calculate Min and Max respawn times randomly. - final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000; - StatsSet info = GrandBossManager.getInstance().getStatsSet(BELETH_ID_1); - info.set("respawn_time", System.currentTimeMillis() + respawnTime); - GrandBossManager.getInstance().setStatsSet(BELETH_ID_1, info); - startQuestTimer("UNLOCK", respawnTime, null, null); - deleteAll(); - npc.deleteMe(); - MOVIE = true; - BELETH = addSpawn(BELETH_ID_1, new Location(16323, 213170, -9357, 49152)); - BELETH.setIsInvul(true); - BELETH.setIsImmobilized(true); - BELETH.disableAllSkills(); - PRIEST = addSpawn(29128, new Location(BELETH)); - PRIEST.setShowSummonAnimation(true); - PRIEST.decayMe(); - addSpawn(32470, new Location(12470, 215607, -9381, 49152)); - ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(27), 1000); - } - else if (npc.getId() == BELETH_ID_2) - { - if (npc.getObjectId() == ALLOW_OBJECT_ID) - { - MINIONS.remove(npc); - KILLED++; - if (KILLED >= 5) - { - deleteAll(); - setSpawnTimer(1); - } - else - { - ALLOW_OBJECT_ID = MINIONS.get(getRandom(MINIONS.size())).getObjectId(); - ATTACKED = false; - } - } - else if (SPAWN_TIMER == null) - { - deleteAll(); - setSpawnTimer(2); - KILLED = 0; - } - npc.abortCast(); - npc.setTarget(null); - npc.deleteMe(); - } - return null; - } - @Override public String onSkillSee(L2Npc npc, L2PcInstance player, Skill skill, L2Object[] targets, boolean isSummon) { - if ((npc != null) && !npc.isDead() && ((npc.getId() == BELETH_ID_1) || (npc.getId() == BELETH_ID_2)) && !npc.isCastingNow() && skill.hasEffectType(L2EffectType.HEAL) && (getRandom(100) < 80)) + if (!npc.isDead() && (npc.getId() == REAL_BELETH) && !npc.isCastingNow() && skill.hasEffectType(L2EffectType.HEAL) && (getRandom(100) < 80)) { npc.setTarget(player); npc.doCast(HORN_OF_RISING.getSkill()); } + return null; } @Override - public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon) + public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) { - if (npc == null) + if (!npc.isDead() && !npc.isCastingNow()) { - return super.onAttack(npc, attacker, damage, isSummon); - } - - if ((npc.getId() == BELETH_ID_1) || (npc.getId() == BELETH_ID_2)) - { - if ((npc.getObjectId() == ALLOW_OBJECT_ID) && !ATTACKED) - { - ATTACKED = true; - L2Npc fakeBeleth = MINIONS.get(getRandom(MINIONS.size())); - while (fakeBeleth.getObjectId() == ALLOW_OBJECT_ID) - { - fakeBeleth = MINIONS.get(getRandom(MINIONS.size())); - } - ZONE.broadcastPacket(new CreatureSay(fakeBeleth.getObjectId(), ChatType.NPC_GENERAL, fakeBeleth.getName(), "Miss text.")); - } if (getRandom(100) < 40) - { - return null; - } - final double distance = npc.calculateDistance(attacker, false, false); - if ((distance > 500) || (getRandom(100) < 80)) - { - for (L2Npc beleth : MINIONS) - { - if ((beleth != null) && !beleth.isDead() && Util.checkIfInRange(900, beleth, attacker, false) && !beleth.isCastingNow()) - { - beleth.setTarget(attacker); - beleth.doCast(FIREBALL.getSkill()); - } - } - if ((BELETH != null) && !BELETH.isDead() && Util.checkIfInRange(900, BELETH, attacker, false) && !BELETH.isCastingNow()) - { - BELETH.setTarget(attacker); - BELETH.doCast(FIREBALL.getSkill()); - } - } - else if (!npc.isDead() && !npc.isCastingNow()) { if (!npc.getKnownList().getKnownPlayersInRadius(200).isEmpty()) { - npc.doCast(LIGHTENING.getSkill()); + npc.doCast(BLEED.getSkill()); return null; } - ((L2Attackable) npc).clearAggroList(); } + npc.setTarget(player); + npc.doCast(FIREBALL.getSkill()); } + return null; } @Override public String onSpellFinished(L2Npc npc, L2PcInstance player, Skill skill) { - if ((npc != null) && !npc.isDead() && ((npc.getId() == BELETH_ID_1) || (npc.getId() == BELETH_ID_2)) && !npc.isCastingNow()) + if (!npc.isDead() && !npc.isCastingNow()) { - if ((player != null) && !player.isDead()) + if (!player.isDead()) { final double distance2 = npc.calculateDistance(player, false, false); if ((distance2 > 890) && !npc.isMovementDisabled()) @@ -542,201 +633,173 @@ public final class Beleth extends AbstractNpcAI return null; } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if ((npc != null) && !npc.isDead() && ((npc.getId() == BELETH_ID_1) || (npc.getId() == BELETH_ID_2)) && !npc.isCastingNow() && !MOVIE) - { - if (getRandom(100) < 40) - { - if (!npc.getKnownList().getKnownPlayersInRadius(200).isEmpty()) - { - npc.doCast(BLEED.getSkill()); - return null; - } - } - npc.setTarget(player); - npc.doCast(FIREBALL.getSkill()); - } - return null; - } - @Override public String onSpawn(L2Npc npc) { - if ((npc.getId() == BELETH_ID_1) || (npc.getId() == BELETH_ID_2)) + npc.setRunning(); + if (!npc.getKnownList().getKnownPlayersInRadius(300).isEmpty() && (getRandom(100) < 60)) { - npc.setRunning(); - if (!MOVIE && !npc.getKnownList().getKnownPlayersInRadius(300).isEmpty() && (getRandom(100) < 60)) - { - npc.doCast(BLEED.getSkill()); - } - if (npc.getId() == BELETH_ID_1) - { - npc.getSpawn().setRespawnDelay(0);// setOnKillDelay - } + npc.doCast(BLEED.getSkill()); } + if (npc.getId() == REAL_BELETH) + { + npc.getSpawn().setRespawnDelay(0); + } + return null; } @Override public String onTalk(L2Npc npc, L2PcInstance player) { - final String html; - if ((BELETH_KILLER != null) && (player.getObjectId() == BELETH_KILLER.getObjectId())) + String html; + if ((_killer != null) && (player.getObjectId() == _killer.getObjectId())) { - player.addItem("Kill Beleth", 10314, 1, null, true);// giveItems(10314, 1, 0) - BELETH_KILLER = null; + _killer = null; + + giveItems(player, RING); + html = "32470a.htm"; } else { html = "32470b.htm"; } + return HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/default/" + html); } @Override public String onFirstTalk(L2Npc npc, L2PcInstance player) { + return onTalk(npc, player); + } + + @Override + public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon) + { + if (getRandom(100) < 40) + { + return null; + } + + final double distance = npc.calculateDistance(attacker, false, false); + if ((distance > 500) || (getRandom(100) < 80)) + { + for (L2Npc beleth : _minions) + { + if ((beleth != null) && !beleth.isDead() && Util.checkIfInRange(900, beleth, attacker, false) && !beleth.isCastingNow()) + { + beleth.setTarget(attacker); + beleth.doCast(FIREBALL.getSkill()); + } + } + if ((_beleth != null) && !_beleth.isDead() && Util.checkIfInRange(900, _beleth, attacker, false) && !_beleth.isCastingNow()) + { + _beleth.setTarget(attacker); + _beleth.doCast(FIREBALL.getSkill()); + } + } + else if (!npc.isDead() && !npc.isCastingNow()) + { + if (!npc.getKnownList().getKnownPlayersInRadius(200).isEmpty()) + { + npc.doCast(LIGHTENING.getSkill()); + return null; + } + ((L2Attackable) npc).clearAggroList(); + } + return null; } - private static void setBelethKiller(L2PcInstance killer) + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) + { + if (npc.getId() == REAL_BELETH) + { + setBelethKiller(killer); + GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD); + final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000; + StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH); + info.set("respawn_time", System.currentTimeMillis() + respawnTime); + GrandBossManager.getInstance().setStatsSet(REAL_BELETH, info); + startQuestTimer("BELETH_UNLOCK", respawnTime, null, null); + + deleteAll(); + npc.deleteMe(); + + for (L2Character c : ZONE.getCharactersInside()) + { + c.disableAllSkills(); + c.setIsInvul(true); + c.setIsImmobilized(true); + } + + _beleth = addSpawn(REAL_BELETH, new Location(16323, 213170, -9357, 49152)); + _beleth.disableAllSkills(); + _beleth.setIsInvul(true); + _beleth.setIsImmobilized(true); + + _priest = addSpawn(ELF, new Location(_beleth)); + _priest.setShowSummonAnimation(true); + _priest.decayMe(); + + _stone = addSpawn(STONE_COFFIN, new Location(12470, 215607, -9381, 49152)); + + startQuestTimer("SPAWN26", 1000, null, null); + } + else if ((npc.getId() == FAKE_BELETH) && (npc.getObjectId() == _allowedObjId)) + { + deleteAll(); + + _killedCount++; + if (_killedCount >= 5) + { + startQuestTimer("SPAWN_REAL", 60000, null, null); + } + else + { + startQuestTimer("SPAWN25", 60000, null, null); + } + } + + return null; + } + + private void setBelethKiller(L2PcInstance killer) { if (killer.getParty() != null) { if (killer.getParty().getCommandChannel() != null) { - BELETH_KILLER = killer.getParty().getCommandChannel().getLeader(); + _killer = killer.getParty().getCommandChannel().getLeader(); } else { - BELETH_KILLER = killer.getParty().getLeader(); + _killer = killer.getParty().getLeader(); } } else { - BELETH_KILLER = killer; + _killer = killer; } } - protected static void setSpawnTimer(int event) + private void deleteAll() { - switch (event) + _minions.stream().filter(n -> !n.isDead()).forEach(n -> { - case 0: - SPAWN_TIMER = null; - break; - case 1: - SPAWN_TIMER = ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(333), 60000); - break; - case 2: - SPAWN_TIMER = ThreadPoolManager.getInstance().scheduleGeneral(new Spawn(26), 60000); - break; - default: - break; - } - } - - private static void deleteAll() - { - if ((MINIONS != null) && !MINIONS.isEmpty()) - { - for (L2Npc npc : MINIONS) - { - if (npc.isDead()) - { - continue; - } - npc.abortCast(); - npc.setTarget(null); - npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); - npc.deleteMe(); - } - MINIONS.clear(); - } - ALLOW_OBJECT_ID = 0; - ATTACKED = false; - } - - protected static void SpawnBeleths() - { - int a = 0; - L2Npc npc; - for (int i = 0; i < 16; i++) - { - a++; - int x = (int) ((650 * Math.cos(i * 0.39)) + 16323); - int y = (int) ((650 * Math.sin(i * 0.39)) + 213170); - npc = addSpawn(BELETH_ID_2, new Location(x, y, -9357, 49152)); - MINIONS.add(npc); - if (a >= 2) - { - npc.setIsOverloaded(true); - a = 0; - } - } - int[] xm = new int[16]; - int[] ym = new int[16]; - for (int i = 0; i < 4; i++) - { - xm[i] = (int) ((1700 * Math.cos((i * 1.57) + 0.78)) + 16323); - ym[i] = (int) ((1700 * Math.sin((i * 1.57) + 0.78)) + 213170); - npc = addSpawn(BELETH_ID_2, new Location(xm[i], ym[i], -9357, 49152)); - npc.setIsImmobilized(true); - MINIONS.add(npc); - } - xm[4] = (xm[0] + xm[1]) / 2; - ym[4] = (ym[0] + ym[1]) / 2; - npc = addSpawn(BELETH_ID_2, new Location(xm[4], ym[4], -9357, 49152)); - npc.setIsImmobilized(true); - MINIONS.add(npc); - xm[5] = (xm[1] + xm[2]) / 2; - ym[5] = (ym[1] + ym[2]) / 2; - npc = addSpawn(BELETH_ID_2, new Location(xm[5], ym[5], -9357, 49152)); - npc.setIsImmobilized(true); - MINIONS.add(npc); - xm[6] = (xm[2] + xm[3]) / 2; - ym[6] = (ym[2] + ym[3]) / 2; - npc = addSpawn(BELETH_ID_2, new Location(xm[6], ym[6], -9357, 49152)); - npc.setIsImmobilized(true); - MINIONS.add(npc); - xm[7] = (xm[3] + xm[0]) / 2; - ym[7] = (ym[3] + ym[0]) / 2; - npc = addSpawn(BELETH_ID_2, new Location(xm[7], ym[7], -9357, 49152)); - npc.setIsImmobilized(true); - MINIONS.add(npc); - xm[8] = (xm[0] + xm[4]) / 2; - ym[8] = (ym[0] + ym[4]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[8], ym[8], -9357, 49152))); - xm[9] = (xm[4] + xm[1]) / 2; - ym[9] = (ym[4] + ym[1]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[9], ym[9], -9357, 49152))); - xm[10] = (xm[1] + xm[5]) / 2; - ym[10] = (ym[1] + ym[5]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[10], ym[10], -9357, 49152))); - xm[11] = (xm[5] + xm[2]) / 2; - ym[11] = (ym[5] + ym[2]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[11], ym[11], -9357, 49152))); - xm[12] = (xm[2] + xm[6]) / 2; - ym[12] = (ym[2] + ym[6]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[12], ym[12], -9357, 49152))); - xm[13] = (xm[6] + xm[3]) / 2; - ym[13] = (ym[6] + ym[3]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[13], ym[13], -9357, 49152))); - xm[14] = (xm[3] + xm[7]) / 2; - ym[14] = (ym[3] + ym[7]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[14], ym[14], -9357, 49152))); - xm[15] = (xm[7] + xm[0]) / 2; - ym[15] = (ym[7] + ym[0]) / 2; - MINIONS.add(addSpawn(BELETH_ID_2, new Location(xm[15], ym[15], -9357, 49152))); - ALLOW_OBJECT_ID = MINIONS.get(getRandom(MINIONS.size())).getObjectId(); - ATTACKED = false; + n.abortCast(); + n.setTarget(null); + n.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); + n.deleteMe(); + }); + _allowedObjId = 0; } public static void main(String[] args) { new Beleth(); } -} +} \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/ai/individual/DarkWaterDragon.java b/trunk/dist/game/data/scripts/ai/individual/DarkWaterDragon.java index dfbe061e68..37910e06eb 100644 --- a/trunk/dist/game/data/scripts/ai/individual/DarkWaterDragon.java +++ b/trunk/dist/game/data/scripts/ai/individual/DarkWaterDragon.java @@ -18,7 +18,6 @@ */ package ai.individual; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -43,8 +42,8 @@ public final class DarkWaterDragon extends AbstractNpcAI private static final int FAFURION = 18482; private static final int DETRACTOR1 = 22270; private static final int DETRACTOR2 = 22271; - private static Set SECOND_SPAWN = new HashSet<>(); // Used to track if second Shades were already spawned - private static Set MY_TRACKING_SET = new HashSet<>(); // Used to track instances of npcs + private static final Set SECOND_SPAWN = ConcurrentHashMap.newKeySet(); // Used to track if second Shades were already spawned + private static Set MY_TRACKING_SET = ConcurrentHashMap.newKeySet(); // Used to track instances of npcs private static Map ID_MAP = new ConcurrentHashMap<>(); // Used to track instances of npcs private DarkWaterDragon() diff --git a/trunk/dist/game/data/scripts/ai/individual/Orfen.java b/trunk/dist/game/data/scripts/ai/individual/Orfen.java index b51599de2a..22ea60bcda 100644 --- a/trunk/dist/game/data/scripts/ai/individual/Orfen.java +++ b/trunk/dist/game/data/scripts/ai/individual/Orfen.java @@ -18,8 +18,8 @@ */ package ai.individual; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import ai.npc.AbstractNpcAI; @@ -72,7 +72,7 @@ public final class Orfen extends AbstractNpcAI private static final int RIBA_IREN = 29018; private static boolean _IsTeleported; - private static List _Minions = new ArrayList<>(); + private static final List MINIONS = new CopyOnWriteArrayList<>(); private static L2BossZone ZONE; private static final byte ALIVE = 0; @@ -158,16 +158,16 @@ public final class Orfen extends AbstractNpcAI L2Attackable mob; mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x + 100, y + 100, npc.getZ(), 0, false, 0); mob.setIsRaidMinion(true); - _Minions.add(mob); + MINIONS.add(mob); mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x + 100, y - 100, npc.getZ(), 0, false, 0); mob.setIsRaidMinion(true); - _Minions.add(mob); + MINIONS.add(mob); mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x - 100, y + 100, npc.getZ(), 0, false, 0); mob.setIsRaidMinion(true); - _Minions.add(mob); + MINIONS.add(mob); mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x - 100, y - 100, npc.getZ(), 0, false, 0); mob.setIsRaidMinion(true); - _Minions.add(mob); + MINIONS.add(mob); startQuestTimer("check_minion_loc", 10000, npc, null, true); } @@ -208,9 +208,9 @@ public final class Orfen extends AbstractNpcAI } else if (event.equalsIgnoreCase("check_minion_loc")) { - for (int i = 0; i < _Minions.size(); i++) + for (int i = 0; i < MINIONS.size(); i++) { - L2Attackable mob = _Minions.get(i); + L2Attackable mob = MINIONS.get(i); if (!npc.isInsideRadius(mob, 3000, false, false)) { mob.teleToLocation(npc.getLocation()); @@ -221,21 +221,21 @@ public final class Orfen extends AbstractNpcAI } else if (event.equalsIgnoreCase("despawn_minions")) { - for (int i = 0; i < _Minions.size(); i++) + for (int i = 0; i < MINIONS.size(); i++) { - L2Attackable mob = _Minions.get(i); + L2Attackable mob = MINIONS.get(i); if (mob != null) { mob.decayMe(); } } - _Minions.clear(); + MINIONS.clear(); } else if (event.equalsIgnoreCase("spawn_minion")) { L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); mob.setIsRaidMinion(true); - _Minions.add(mob); + MINIONS.add(mob); } return super.onAdvEvent(event, npc, player); } @@ -344,7 +344,7 @@ public final class Orfen extends AbstractNpcAI } else if ((GrandBossManager.getInstance().getBossStatus(ORFEN) == ALIVE) && (npc.getId() == RAIKEL_LEOS)) { - _Minions.remove(npc); + MINIONS.remove(npc); startQuestTimer("spawn_minion", 360000, npc, null); } return super.onKill(npc, killer, isSummon); diff --git a/trunk/dist/game/data/scripts/ai/individual/QueenAnt.java b/trunk/dist/game/data/scripts/ai/individual/QueenAnt.java index 0228ca5b98..a798bc4dca 100644 --- a/trunk/dist/game/data/scripts/ai/individual/QueenAnt.java +++ b/trunk/dist/game/data/scripts/ai/individual/QueenAnt.java @@ -18,8 +18,8 @@ */ package ai.individual; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import ai.npc.AbstractNpcAI; @@ -83,7 +83,7 @@ public final class QueenAnt extends AbstractNpcAI L2MonsterInstance _queen = null; private L2MonsterInstance _larva = null; - private final List _nurses = new ArrayList<>(5); + private final List _nurses = new CopyOnWriteArrayList<>(); ScheduledFuture _task = null; private QueenAnt() diff --git a/trunk/dist/game/data/scripts/ai/individual/SinWardens.java b/trunk/dist/game/data/scripts/ai/individual/SinWardens.java index fee3b6e7ea..c74dafb0eb 100644 --- a/trunk/dist/game/data/scripts/ai/individual/SinWardens.java +++ b/trunk/dist/game/data/scripts/ai/individual/SinWardens.java @@ -18,8 +18,8 @@ */ package ai.individual; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import ai.npc.AbstractNpcAI; @@ -54,7 +54,7 @@ public final class SinWardens extends AbstractNpcAI 22438 }; - private final Map killedMinionsCount = new HashMap<>(); + private final Map killedMinionsCount = new ConcurrentHashMap<>(); private SinWardens() { diff --git a/trunk/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java b/trunk/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java index 82d7e00921..e682d77663 100644 --- a/trunk/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java +++ b/trunk/dist/game/data/scripts/ai/npc/ForgeOfTheGods/TarBeetleSpawn.java @@ -29,12 +29,12 @@ import org.w3c.dom.Node; import com.l2jserver.gameserver.GeoData; import com.l2jserver.gameserver.ThreadPoolManager; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.L2Territory; import com.l2jserver.gameserver.model.Location; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.util.Rnd; +import com.l2jserver.util.data.xml.IXmlReader; /** * Tar Beetle zone spawn diff --git a/trunk/dist/game/data/scripts/ai/npc/MentorGuide/MentorGuide.java b/trunk/dist/game/data/scripts/ai/npc/MentorGuide/MentorGuide.java index ee09d35849..0ea1ee188d 100644 --- a/trunk/dist/game/data/scripts/ai/npc/MentorGuide/MentorGuide.java +++ b/trunk/dist/game/data/scripts/ai/npc/MentorGuide/MentorGuide.java @@ -29,7 +29,6 @@ import org.w3c.dom.Node; import ai.npc.AbstractNpcAI; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.CategoryType; import com.l2jserver.gameserver.enums.MailType; import com.l2jserver.gameserver.instancemanager.MailManager; @@ -57,6 +56,7 @@ import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.network.serverpackets.mentoring.ExMentorList; import com.l2jserver.gameserver.util.Util; +import com.l2jserver.util.data.xml.IXmlReader; /** * Mentor Guide. diff --git a/trunk/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java b/trunk/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java index c35a2a4480..042b6de657 100644 --- a/trunk/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java +++ b/trunk/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java @@ -28,8 +28,8 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/dist/game/data/scripts/ai/npc/Teleports/NewbieTravelToken/NewbieTravelToken.java b/trunk/dist/game/data/scripts/ai/npc/Teleports/NewbieTravelToken/NewbieTravelToken.java index 9d17edc204..83897db400 100644 --- a/trunk/dist/game/data/scripts/ai/npc/Teleports/NewbieTravelToken/NewbieTravelToken.java +++ b/trunk/dist/game/data/scripts/ai/npc/Teleports/NewbieTravelToken/NewbieTravelToken.java @@ -30,8 +30,7 @@ import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.util.Util; /** - * Newbie Travel Token AI.
- * Original Jython script by DrLecter. + * Newbie Travel Token AI. * @author Plim */ public final class NewbieTravelToken extends AbstractNpcAI diff --git a/trunk/dist/game/data/scripts/gracia/AI/EnergySeeds.java b/trunk/dist/game/data/scripts/gracia/AI/EnergySeeds.java index 110c40bd9c..6094232bdc 100644 --- a/trunk/dist/game/data/scripts/gracia/AI/EnergySeeds.java +++ b/trunk/dist/game/data/scripts/gracia/AI/EnergySeeds.java @@ -53,8 +53,8 @@ public class EnergySeeds extends AbstractNpcAI private static final int RATE = 1; private static final int RESPAWN = 480000; private static final int RANDOM_RESPAWN_OFFSET = 180000; - private static Map _spawns = new HashMap<>(); - protected static Map _spawnedNpcs = new ConcurrentHashMap<>(); + private static final Map SPAWNS = new HashMap<>(); + protected static final Map _spawnedNpcs = new ConcurrentHashMap<>(); private static final int TEMPORARY_TELEPORTER = 32602; // @formatter:off @@ -128,9 +128,9 @@ public class EnergySeeds extends AbstractNpcAI npc.deleteMe(); - if (_spawnedNpcs.containsKey(npc) && _spawns.containsKey(_spawnedNpcs.get(npc))) + if (_spawnedNpcs.containsKey(npc) && SPAWNS.containsKey(_spawnedNpcs.get(npc))) { - ESSpawn spawn = _spawns.get(_spawnedNpcs.get(npc)); + ESSpawn spawn = SPAWNS.get(_spawnedNpcs.get(npc)); spawn.scheduleRespawn(RESPAWN + getRandom(RANDOM_RESPAWN_OFFSET)); _spawnedNpcs.remove(npc); if (isSeedActive(spawn._seedId)) @@ -239,9 +239,9 @@ public class EnergySeeds extends AbstractNpcAI @Override public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) { - if (_spawnedNpcs.containsKey(npc) && _spawns.containsKey(_spawnedNpcs.get(npc))) + if (_spawnedNpcs.containsKey(npc) && SPAWNS.containsKey(_spawnedNpcs.get(npc))) { - _spawns.get(_spawnedNpcs.get(npc)).scheduleRespawn(RESPAWN + getRandom(RANDOM_RESPAWN_OFFSET)); + SPAWNS.get(_spawnedNpcs.get(npc)).scheduleRespawn(RESPAWN + getRandom(RANDOM_RESPAWN_OFFSET)); _spawnedNpcs.remove(npc); } return super.onKill(npc, player, isSummon); @@ -273,7 +273,7 @@ public class EnergySeeds extends AbstractNpcAI public void startAI() { // spawn all NPCs - for (ESSpawn spawn : _spawns.values()) + for (ESSpawn spawn : SPAWNS.values()) { if (isSeedActive(spawn._seedId)) { @@ -285,7 +285,7 @@ public class EnergySeeds extends AbstractNpcAI public void startAI(GraciaSeeds type) { // spawn all NPCs - for (ESSpawn spawn : _spawns.values()) + for (ESSpawn spawn : SPAWNS.values()) { if (spawn._seedId == type) { @@ -298,7 +298,7 @@ public class EnergySeeds extends AbstractNpcAI { for (L2Npc seed : _spawnedNpcs.keySet()) { - if (type == _spawns.get(_spawnedNpcs.get(seed))._seedId) + if (type == SPAWNS.get(_spawnedNpcs.get(seed))._seedId) { seed.deleteMe(); } @@ -361,336 +361,336 @@ public class EnergySeeds extends AbstractNpcAI // Seed of Destruction // Temporary Teleporters //@formatter:off - _spawns.put(1, new ESSpawn(1, GraciaSeeds.DESTRUCTION, new Location(-245790,220320,-12104), new int[]{TEMPORARY_TELEPORTER})); - _spawns.put(2, new ESSpawn(2, GraciaSeeds.DESTRUCTION, new Location(-249770,207300,-11952), new int[]{TEMPORARY_TELEPORTER})); + SPAWNS.put(1, new ESSpawn(1, GraciaSeeds.DESTRUCTION, new Location(-245790,220320,-12104), new int[]{TEMPORARY_TELEPORTER})); + SPAWNS.put(2, new ESSpawn(2, GraciaSeeds.DESTRUCTION, new Location(-249770,207300,-11952), new int[]{TEMPORARY_TELEPORTER})); //Energy Seeds - _spawns.put(3, new ESSpawn(3, GraciaSeeds.DESTRUCTION, new Location(-248360,219272,-12448), new int[]{18678,18679,18680})); - _spawns.put(4, new ESSpawn(4, GraciaSeeds.DESTRUCTION, new Location(-249448,219256,-12448), new int[]{18678,18679,18680})); - _spawns.put(5, new ESSpawn(5, GraciaSeeds.DESTRUCTION, new Location(-249432,220872,-12448), new int[]{18678,18679,18680})); - _spawns.put(6, new ESSpawn(6, GraciaSeeds.DESTRUCTION, new Location(-248360,220888,-12448), new int[]{18678,18679,18680})); + SPAWNS.put(3, new ESSpawn(3, GraciaSeeds.DESTRUCTION, new Location(-248360,219272,-12448), new int[]{18678,18679,18680})); + SPAWNS.put(4, new ESSpawn(4, GraciaSeeds.DESTRUCTION, new Location(-249448,219256,-12448), new int[]{18678,18679,18680})); + SPAWNS.put(5, new ESSpawn(5, GraciaSeeds.DESTRUCTION, new Location(-249432,220872,-12448), new int[]{18678,18679,18680})); + SPAWNS.put(6, new ESSpawn(6, GraciaSeeds.DESTRUCTION, new Location(-248360,220888,-12448), new int[]{18678,18679,18680})); - _spawns.put(7, new ESSpawn(7, GraciaSeeds.DESTRUCTION, new Location(-250088,219256,-12448), new int[]{18681,18682})); - _spawns.put(8, new ESSpawn(8, GraciaSeeds.DESTRUCTION, new Location(-250600,219272,-12448), new int[]{18681,18682})); - _spawns.put(9, new ESSpawn(9, GraciaSeeds.DESTRUCTION, new Location(-250584,220904,-12448), new int[]{18681,18682})); - _spawns.put(10, new ESSpawn(10, GraciaSeeds.DESTRUCTION, new Location(-250072,220888,-12448), new int[]{18681,18682})); + SPAWNS.put(7, new ESSpawn(7, GraciaSeeds.DESTRUCTION, new Location(-250088,219256,-12448), new int[]{18681,18682})); + SPAWNS.put(8, new ESSpawn(8, GraciaSeeds.DESTRUCTION, new Location(-250600,219272,-12448), new int[]{18681,18682})); + SPAWNS.put(9, new ESSpawn(9, GraciaSeeds.DESTRUCTION, new Location(-250584,220904,-12448), new int[]{18681,18682})); + SPAWNS.put(10, new ESSpawn(10, GraciaSeeds.DESTRUCTION, new Location(-250072,220888,-12448), new int[]{18681,18682})); - _spawns.put(11, new ESSpawn(11, GraciaSeeds.DESTRUCTION, new Location(-253096,217704,-12296), new int[]{18683,18678})); - _spawns.put(12, new ESSpawn(12, GraciaSeeds.DESTRUCTION, new Location(-253112,217048,-12288), new int[]{18683,18678})); - _spawns.put(13, new ESSpawn(13, GraciaSeeds.DESTRUCTION, new Location(-251448,217032,-12288), new int[]{18683,18678})); - _spawns.put(14, new ESSpawn(14, GraciaSeeds.DESTRUCTION, new Location(-251416,217672,-12296), new int[]{18683,18678})); + SPAWNS.put(11, new ESSpawn(11, GraciaSeeds.DESTRUCTION, new Location(-253096,217704,-12296), new int[]{18683,18678})); + SPAWNS.put(12, new ESSpawn(12, GraciaSeeds.DESTRUCTION, new Location(-253112,217048,-12288), new int[]{18683,18678})); + SPAWNS.put(13, new ESSpawn(13, GraciaSeeds.DESTRUCTION, new Location(-251448,217032,-12288), new int[]{18683,18678})); + SPAWNS.put(14, new ESSpawn(14, GraciaSeeds.DESTRUCTION, new Location(-251416,217672,-12296), new int[]{18683,18678})); - _spawns.put(15, new ESSpawn(15, GraciaSeeds.DESTRUCTION, new Location(-251416,217672,-12296), new int[]{18679,18680})); - _spawns.put(16, new ESSpawn(16, GraciaSeeds.DESTRUCTION, new Location(-251416,217016,-12280), new int[]{18679,18680})); - _spawns.put(17, new ESSpawn(17, GraciaSeeds.DESTRUCTION, new Location(-249752,217016,-12280), new int[]{18679,18680})); - _spawns.put(18, new ESSpawn(18, GraciaSeeds.DESTRUCTION, new Location(-249736,217688,-12296), new int[]{18679,18680})); + SPAWNS.put(15, new ESSpawn(15, GraciaSeeds.DESTRUCTION, new Location(-251416,217672,-12296), new int[]{18679,18680})); + SPAWNS.put(16, new ESSpawn(16, GraciaSeeds.DESTRUCTION, new Location(-251416,217016,-12280), new int[]{18679,18680})); + SPAWNS.put(17, new ESSpawn(17, GraciaSeeds.DESTRUCTION, new Location(-249752,217016,-12280), new int[]{18679,18680})); + SPAWNS.put(18, new ESSpawn(18, GraciaSeeds.DESTRUCTION, new Location(-249736,217688,-12296), new int[]{18679,18680})); - _spawns.put(19, new ESSpawn(19, GraciaSeeds.DESTRUCTION, new Location(-252472,215208,-12120), new int[]{18681,18682})); - _spawns.put(20, new ESSpawn(20, GraciaSeeds.DESTRUCTION, new Location(-252552,216760,-12248), new int[]{18681,18682})); - _spawns.put(21, new ESSpawn(21, GraciaSeeds.DESTRUCTION, new Location(-253160,216744,-12248), new int[]{18681,18682})); - _spawns.put(22, new ESSpawn(22, GraciaSeeds.DESTRUCTION, new Location(-253128,215160,-12096), new int[]{18681,18682})); + SPAWNS.put(19, new ESSpawn(19, GraciaSeeds.DESTRUCTION, new Location(-252472,215208,-12120), new int[]{18681,18682})); + SPAWNS.put(20, new ESSpawn(20, GraciaSeeds.DESTRUCTION, new Location(-252552,216760,-12248), new int[]{18681,18682})); + SPAWNS.put(21, new ESSpawn(21, GraciaSeeds.DESTRUCTION, new Location(-253160,216744,-12248), new int[]{18681,18682})); + SPAWNS.put(22, new ESSpawn(22, GraciaSeeds.DESTRUCTION, new Location(-253128,215160,-12096), new int[]{18681,18682})); - _spawns.put(23, new ESSpawn(23, GraciaSeeds.DESTRUCTION, new Location(-250392,215208,-12120), new int[]{18683,18678})); - _spawns.put(24, new ESSpawn(24, GraciaSeeds.DESTRUCTION, new Location(-250264,216744,-12248), new int[]{18683,18678})); - _spawns.put(25, new ESSpawn(25, GraciaSeeds.DESTRUCTION, new Location(-249720,216744,-12248), new int[]{18683,18678})); - _spawns.put(26, new ESSpawn(26, GraciaSeeds.DESTRUCTION, new Location(-249752,215128,-12096), new int[]{18683,18678})); + SPAWNS.put(23, new ESSpawn(23, GraciaSeeds.DESTRUCTION, new Location(-250392,215208,-12120), new int[]{18683,18678})); + SPAWNS.put(24, new ESSpawn(24, GraciaSeeds.DESTRUCTION, new Location(-250264,216744,-12248), new int[]{18683,18678})); + SPAWNS.put(25, new ESSpawn(25, GraciaSeeds.DESTRUCTION, new Location(-249720,216744,-12248), new int[]{18683,18678})); + SPAWNS.put(26, new ESSpawn(26, GraciaSeeds.DESTRUCTION, new Location(-249752,215128,-12096), new int[]{18683,18678})); - _spawns.put(27, new ESSpawn(27, GraciaSeeds.DESTRUCTION, new Location(-250280,216760,-12248), new int[]{18679,18680,18681})); - _spawns.put(28, new ESSpawn(28, GraciaSeeds.DESTRUCTION, new Location(-250344,216152,-12248), new int[]{18679,18680,18681})); - _spawns.put(29, new ESSpawn(29, GraciaSeeds.DESTRUCTION, new Location(-252504,216152,-12248), new int[]{18679,18680,18681})); - _spawns.put(30, new ESSpawn(30, GraciaSeeds.DESTRUCTION, new Location(-252520,216792,-12248), new int[]{18679,18680,18681})); + SPAWNS.put(27, new ESSpawn(27, GraciaSeeds.DESTRUCTION, new Location(-250280,216760,-12248), new int[]{18679,18680,18681})); + SPAWNS.put(28, new ESSpawn(28, GraciaSeeds.DESTRUCTION, new Location(-250344,216152,-12248), new int[]{18679,18680,18681})); + SPAWNS.put(29, new ESSpawn(29, GraciaSeeds.DESTRUCTION, new Location(-252504,216152,-12248), new int[]{18679,18680,18681})); + SPAWNS.put(30, new ESSpawn(30, GraciaSeeds.DESTRUCTION, new Location(-252520,216792,-12248), new int[]{18679,18680,18681})); - _spawns.put(31, new ESSpawn(31, GraciaSeeds.DESTRUCTION, new Location(-242520,217272,-12384), new int[]{18681,18682,18683})); - _spawns.put(32, new ESSpawn(32, GraciaSeeds.DESTRUCTION, new Location(-241432,217288,-12384), new int[]{18681,18682,18683})); - _spawns.put(33, new ESSpawn(33, GraciaSeeds.DESTRUCTION, new Location(-241432,218936,-12384), new int[]{18681,18682,18683})); - _spawns.put(34, new ESSpawn(34, GraciaSeeds.DESTRUCTION, new Location(-242536,218936,-12384), new int[]{18681,18682,18683})); + SPAWNS.put(31, new ESSpawn(31, GraciaSeeds.DESTRUCTION, new Location(-242520,217272,-12384), new int[]{18681,18682,18683})); + SPAWNS.put(32, new ESSpawn(32, GraciaSeeds.DESTRUCTION, new Location(-241432,217288,-12384), new int[]{18681,18682,18683})); + SPAWNS.put(33, new ESSpawn(33, GraciaSeeds.DESTRUCTION, new Location(-241432,218936,-12384), new int[]{18681,18682,18683})); + SPAWNS.put(34, new ESSpawn(34, GraciaSeeds.DESTRUCTION, new Location(-242536,218936,-12384), new int[]{18681,18682,18683})); - _spawns.put(35, new ESSpawn(35, GraciaSeeds.DESTRUCTION, new Location(-240808,217272,-12384), new int[]{18678,18679})); - _spawns.put(36, new ESSpawn(36, GraciaSeeds.DESTRUCTION, new Location(-240280,217272,-12384), new int[]{18678,18679})); - _spawns.put(37, new ESSpawn(37, GraciaSeeds.DESTRUCTION, new Location(-240280,218952,-12384), new int[]{18678,18679})); - _spawns.put(38, new ESSpawn(38, GraciaSeeds.DESTRUCTION, new Location(-240792,218936,-12384), new int[]{18678,18679})); + SPAWNS.put(35, new ESSpawn(35, GraciaSeeds.DESTRUCTION, new Location(-240808,217272,-12384), new int[]{18678,18679})); + SPAWNS.put(36, new ESSpawn(36, GraciaSeeds.DESTRUCTION, new Location(-240280,217272,-12384), new int[]{18678,18679})); + SPAWNS.put(37, new ESSpawn(37, GraciaSeeds.DESTRUCTION, new Location(-240280,218952,-12384), new int[]{18678,18679})); + SPAWNS.put(38, new ESSpawn(38, GraciaSeeds.DESTRUCTION, new Location(-240792,218936,-12384), new int[]{18678,18679})); - _spawns.put(39, new ESSpawn(39, GraciaSeeds.DESTRUCTION, new Location(-239576,217240,-12640), new int[]{18680,18681,18682})); - _spawns.put(40, new ESSpawn(40, GraciaSeeds.DESTRUCTION, new Location(-239560,216168,-12640), new int[]{18680,18681,18682})); - _spawns.put(41, new ESSpawn(41, GraciaSeeds.DESTRUCTION, new Location(-237896,216152,-12640), new int[]{18680,18681,18682})); - _spawns.put(42, new ESSpawn(42, GraciaSeeds.DESTRUCTION, new Location(-237912,217256,-12640), new int[]{18680,18681,18682})); + SPAWNS.put(39, new ESSpawn(39, GraciaSeeds.DESTRUCTION, new Location(-239576,217240,-12640), new int[]{18680,18681,18682})); + SPAWNS.put(40, new ESSpawn(40, GraciaSeeds.DESTRUCTION, new Location(-239560,216168,-12640), new int[]{18680,18681,18682})); + SPAWNS.put(41, new ESSpawn(41, GraciaSeeds.DESTRUCTION, new Location(-237896,216152,-12640), new int[]{18680,18681,18682})); + SPAWNS.put(42, new ESSpawn(42, GraciaSeeds.DESTRUCTION, new Location(-237912,217256,-12640), new int[]{18680,18681,18682})); - _spawns.put(43, new ESSpawn(43, GraciaSeeds.DESTRUCTION, new Location(-237896,215528,-12640), new int[]{18683,18678})); - _spawns.put(44, new ESSpawn(44, GraciaSeeds.DESTRUCTION, new Location(-239560,215528,-12640), new int[]{18683,18678})); - _spawns.put(45, new ESSpawn(45, GraciaSeeds.DESTRUCTION, new Location(-239560,214984,-12640), new int[]{18683,18678})); - _spawns.put(46, new ESSpawn(46, GraciaSeeds.DESTRUCTION, new Location(-237896,215000,-12640), new int[]{18683,18678})); + SPAWNS.put(43, new ESSpawn(43, GraciaSeeds.DESTRUCTION, new Location(-237896,215528,-12640), new int[]{18683,18678})); + SPAWNS.put(44, new ESSpawn(44, GraciaSeeds.DESTRUCTION, new Location(-239560,215528,-12640), new int[]{18683,18678})); + SPAWNS.put(45, new ESSpawn(45, GraciaSeeds.DESTRUCTION, new Location(-239560,214984,-12640), new int[]{18683,18678})); + SPAWNS.put(46, new ESSpawn(46, GraciaSeeds.DESTRUCTION, new Location(-237896,215000,-12640), new int[]{18683,18678})); - _spawns.put(47, new ESSpawn(47, GraciaSeeds.DESTRUCTION, new Location(-237896,213640,-12768), new int[]{18678,18679,18680})); - _spawns.put(48, new ESSpawn(48, GraciaSeeds.DESTRUCTION, new Location(-239560,213640,-12768), new int[]{18678,18679,18680})); - _spawns.put(49, new ESSpawn(49, GraciaSeeds.DESTRUCTION, new Location(-239544,212552,-12768), new int[]{18678,18679,18680})); - _spawns.put(50, new ESSpawn(50, GraciaSeeds.DESTRUCTION, new Location(-237912,212552,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(47, new ESSpawn(47, GraciaSeeds.DESTRUCTION, new Location(-237896,213640,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(48, new ESSpawn(48, GraciaSeeds.DESTRUCTION, new Location(-239560,213640,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(49, new ESSpawn(49, GraciaSeeds.DESTRUCTION, new Location(-239544,212552,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(50, new ESSpawn(50, GraciaSeeds.DESTRUCTION, new Location(-237912,212552,-12768), new int[]{18678,18679,18680})); - _spawns.put(51, new ESSpawn(51, GraciaSeeds.DESTRUCTION, new Location(-237912,211912,-12768), new int[]{18681,18682})); - _spawns.put(52, new ESSpawn(52, GraciaSeeds.DESTRUCTION, new Location(-237912,211400,-12768), new int[]{18681,18682})); - _spawns.put(53, new ESSpawn(53, GraciaSeeds.DESTRUCTION, new Location(-239560,211400,-12768), new int[]{18681,18682})); - _spawns.put(54, new ESSpawn(54, GraciaSeeds.DESTRUCTION, new Location(-239560,211912,-12768), new int[]{18681,18682})); + SPAWNS.put(51, new ESSpawn(51, GraciaSeeds.DESTRUCTION, new Location(-237912,211912,-12768), new int[]{18681,18682})); + SPAWNS.put(52, new ESSpawn(52, GraciaSeeds.DESTRUCTION, new Location(-237912,211400,-12768), new int[]{18681,18682})); + SPAWNS.put(53, new ESSpawn(53, GraciaSeeds.DESTRUCTION, new Location(-239560,211400,-12768), new int[]{18681,18682})); + SPAWNS.put(54, new ESSpawn(54, GraciaSeeds.DESTRUCTION, new Location(-239560,211912,-12768), new int[]{18681,18682})); - _spawns.put(55, new ESSpawn(55, GraciaSeeds.DESTRUCTION, new Location(-241960,214536,-12512), new int[]{18683,18678,18679})); - _spawns.put(56, new ESSpawn(56, GraciaSeeds.DESTRUCTION, new Location(-241976,213448,-12512), new int[]{18683,18678,18679})); - _spawns.put(57, new ESSpawn(57, GraciaSeeds.DESTRUCTION, new Location(-243624,213448,-12512), new int[]{18683,18678,18679})); - _spawns.put(58, new ESSpawn(58, GraciaSeeds.DESTRUCTION, new Location(-243624,214520,-12512), new int[]{18683,18678,18679})); + SPAWNS.put(55, new ESSpawn(55, GraciaSeeds.DESTRUCTION, new Location(-241960,214536,-12512), new int[]{18683,18678,18679})); + SPAWNS.put(56, new ESSpawn(56, GraciaSeeds.DESTRUCTION, new Location(-241976,213448,-12512), new int[]{18683,18678,18679})); + SPAWNS.put(57, new ESSpawn(57, GraciaSeeds.DESTRUCTION, new Location(-243624,213448,-12512), new int[]{18683,18678,18679})); + SPAWNS.put(58, new ESSpawn(58, GraciaSeeds.DESTRUCTION, new Location(-243624,214520,-12512), new int[]{18683,18678,18679})); - _spawns.put(59, new ESSpawn(59, GraciaSeeds.DESTRUCTION, new Location(-241976,212808,-12504), new int[]{18680,18681})); - _spawns.put(60, new ESSpawn(60, GraciaSeeds.DESTRUCTION, new Location(-241960,212280,-12504), new int[]{18680,18681})); - _spawns.put(61, new ESSpawn(61, GraciaSeeds.DESTRUCTION, new Location(-243624,212264,-12504), new int[]{18680,18681})); - _spawns.put(62, new ESSpawn(62, GraciaSeeds.DESTRUCTION, new Location(-243624,212792,-12504), new int[]{18680,18681})); + SPAWNS.put(59, new ESSpawn(59, GraciaSeeds.DESTRUCTION, new Location(-241976,212808,-12504), new int[]{18680,18681})); + SPAWNS.put(60, new ESSpawn(60, GraciaSeeds.DESTRUCTION, new Location(-241960,212280,-12504), new int[]{18680,18681})); + SPAWNS.put(61, new ESSpawn(61, GraciaSeeds.DESTRUCTION, new Location(-243624,212264,-12504), new int[]{18680,18681})); + SPAWNS.put(62, new ESSpawn(62, GraciaSeeds.DESTRUCTION, new Location(-243624,212792,-12504), new int[]{18680,18681})); - _spawns.put(63, new ESSpawn(63, GraciaSeeds.DESTRUCTION, new Location(-243640,210920,-12640), new int[]{18682,18683,18678})); - _spawns.put(64, new ESSpawn(64, GraciaSeeds.DESTRUCTION, new Location(-243624,209832,-12640), new int[]{18682,18683,18678})); - _spawns.put(65, new ESSpawn(65, GraciaSeeds.DESTRUCTION, new Location(-241976,209832,-12640), new int[]{18682,18683,18678})); - _spawns.put(66, new ESSpawn(66, GraciaSeeds.DESTRUCTION, new Location(-241976,210920,-12640), new int[]{18682,18683,18678})); + SPAWNS.put(63, new ESSpawn(63, GraciaSeeds.DESTRUCTION, new Location(-243640,210920,-12640), new int[]{18682,18683,18678})); + SPAWNS.put(64, new ESSpawn(64, GraciaSeeds.DESTRUCTION, new Location(-243624,209832,-12640), new int[]{18682,18683,18678})); + SPAWNS.put(65, new ESSpawn(65, GraciaSeeds.DESTRUCTION, new Location(-241976,209832,-12640), new int[]{18682,18683,18678})); + SPAWNS.put(66, new ESSpawn(66, GraciaSeeds.DESTRUCTION, new Location(-241976,210920,-12640), new int[]{18682,18683,18678})); - _spawns.put(67, new ESSpawn(67, GraciaSeeds.DESTRUCTION, new Location(-241976,209192,-12640), new int[]{18679,18680})); - _spawns.put(68, new ESSpawn(68, GraciaSeeds.DESTRUCTION, new Location(-241976,208664,-12640), new int[]{18679,18680})); - _spawns.put(69, new ESSpawn(69, GraciaSeeds.DESTRUCTION, new Location(-243624,208664,-12640), new int[]{18679,18680})); - _spawns.put(70, new ESSpawn(70, GraciaSeeds.DESTRUCTION, new Location(-243624,209192,-12640), new int[]{18679,18680})); + SPAWNS.put(67, new ESSpawn(67, GraciaSeeds.DESTRUCTION, new Location(-241976,209192,-12640), new int[]{18679,18680})); + SPAWNS.put(68, new ESSpawn(68, GraciaSeeds.DESTRUCTION, new Location(-241976,208664,-12640), new int[]{18679,18680})); + SPAWNS.put(69, new ESSpawn(69, GraciaSeeds.DESTRUCTION, new Location(-243624,208664,-12640), new int[]{18679,18680})); + SPAWNS.put(70, new ESSpawn(70, GraciaSeeds.DESTRUCTION, new Location(-243624,209192,-12640), new int[]{18679,18680})); - _spawns.put(71, new ESSpawn(71, GraciaSeeds.DESTRUCTION, new Location(-241256,208664,-12896), new int[]{18681,18682,18683})); - _spawns.put(72, new ESSpawn(72, GraciaSeeds.DESTRUCTION, new Location(-240168,208648,-12896), new int[]{18681,18682,18683})); - _spawns.put(73, new ESSpawn(73, GraciaSeeds.DESTRUCTION, new Location(-240168,207000,-12896), new int[]{18681,18682,18683})); - _spawns.put(74, new ESSpawn(74, GraciaSeeds.DESTRUCTION, new Location(-241256,207000,-12896), new int[]{18681,18682,18683})); + SPAWNS.put(71, new ESSpawn(71, GraciaSeeds.DESTRUCTION, new Location(-241256,208664,-12896), new int[]{18681,18682,18683})); + SPAWNS.put(72, new ESSpawn(72, GraciaSeeds.DESTRUCTION, new Location(-240168,208648,-12896), new int[]{18681,18682,18683})); + SPAWNS.put(73, new ESSpawn(73, GraciaSeeds.DESTRUCTION, new Location(-240168,207000,-12896), new int[]{18681,18682,18683})); + SPAWNS.put(74, new ESSpawn(74, GraciaSeeds.DESTRUCTION, new Location(-241256,207000,-12896), new int[]{18681,18682,18683})); - _spawns.put(75, new ESSpawn(75, GraciaSeeds.DESTRUCTION, new Location(-239528,208648,-12896), new int[]{18678,18679})); - _spawns.put(76, new ESSpawn(76, GraciaSeeds.DESTRUCTION, new Location(-238984,208664,-12896), new int[]{18678,18679})); - _spawns.put(77, new ESSpawn(77, GraciaSeeds.DESTRUCTION, new Location(-239000,207000,-12896), new int[]{18678,18679})); - _spawns.put(78, new ESSpawn(78, GraciaSeeds.DESTRUCTION, new Location(-239512,207000,-12896), new int[]{18678,18679})); + SPAWNS.put(75, new ESSpawn(75, GraciaSeeds.DESTRUCTION, new Location(-239528,208648,-12896), new int[]{18678,18679})); + SPAWNS.put(76, new ESSpawn(76, GraciaSeeds.DESTRUCTION, new Location(-238984,208664,-12896), new int[]{18678,18679})); + SPAWNS.put(77, new ESSpawn(77, GraciaSeeds.DESTRUCTION, new Location(-239000,207000,-12896), new int[]{18678,18679})); + SPAWNS.put(78, new ESSpawn(78, GraciaSeeds.DESTRUCTION, new Location(-239512,207000,-12896), new int[]{18678,18679})); - _spawns.put(79, new ESSpawn(79, GraciaSeeds.DESTRUCTION, new Location(-245064,213144,-12384), new int[]{18680,18681,18682})); - _spawns.put(80, new ESSpawn(80, GraciaSeeds.DESTRUCTION, new Location(-245064,212072,-12384), new int[]{18680,18681,18682})); - _spawns.put(81, new ESSpawn(81, GraciaSeeds.DESTRUCTION, new Location(-246696,212072,-12384), new int[]{18680,18681,18682})); - _spawns.put(82, new ESSpawn(82, GraciaSeeds.DESTRUCTION, new Location(-246696,213160,-12384), new int[]{18680,18681,18682})); + SPAWNS.put(79, new ESSpawn(79, GraciaSeeds.DESTRUCTION, new Location(-245064,213144,-12384), new int[]{18680,18681,18682})); + SPAWNS.put(80, new ESSpawn(80, GraciaSeeds.DESTRUCTION, new Location(-245064,212072,-12384), new int[]{18680,18681,18682})); + SPAWNS.put(81, new ESSpawn(81, GraciaSeeds.DESTRUCTION, new Location(-246696,212072,-12384), new int[]{18680,18681,18682})); + SPAWNS.put(82, new ESSpawn(82, GraciaSeeds.DESTRUCTION, new Location(-246696,213160,-12384), new int[]{18680,18681,18682})); - _spawns.put(83, new ESSpawn(83, GraciaSeeds.DESTRUCTION, new Location(-245064,211416,-12384), new int[]{18683,18678})); - _spawns.put(84, new ESSpawn(84, GraciaSeeds.DESTRUCTION, new Location(-245048,210904,-12384), new int[]{18683,18678})); - _spawns.put(85, new ESSpawn(85, GraciaSeeds.DESTRUCTION, new Location(-246712,210888,-12384), new int[]{18683,18678})); - _spawns.put(86, new ESSpawn(86, GraciaSeeds.DESTRUCTION, new Location(-246712,211416,-12384), new int[]{18683,18678})); + SPAWNS.put(83, new ESSpawn(83, GraciaSeeds.DESTRUCTION, new Location(-245064,211416,-12384), new int[]{18683,18678})); + SPAWNS.put(84, new ESSpawn(84, GraciaSeeds.DESTRUCTION, new Location(-245048,210904,-12384), new int[]{18683,18678})); + SPAWNS.put(85, new ESSpawn(85, GraciaSeeds.DESTRUCTION, new Location(-246712,210888,-12384), new int[]{18683,18678})); + SPAWNS.put(86, new ESSpawn(86, GraciaSeeds.DESTRUCTION, new Location(-246712,211416,-12384), new int[]{18683,18678})); - _spawns.put(87, new ESSpawn(87, GraciaSeeds.DESTRUCTION, new Location(-245048,209544,-12512), new int[]{18679,18680,18681})); - _spawns.put(88, new ESSpawn(88, GraciaSeeds.DESTRUCTION, new Location(-245064,208456,-12512), new int[]{18679,18680,18681})); - _spawns.put(89, new ESSpawn(89, GraciaSeeds.DESTRUCTION, new Location(-246696,208456,-12512), new int[]{18679,18680,18681})); - _spawns.put(90, new ESSpawn(90, GraciaSeeds.DESTRUCTION, new Location(-246712,209544,-12512), new int[]{18679,18680,18681})); + SPAWNS.put(87, new ESSpawn(87, GraciaSeeds.DESTRUCTION, new Location(-245048,209544,-12512), new int[]{18679,18680,18681})); + SPAWNS.put(88, new ESSpawn(88, GraciaSeeds.DESTRUCTION, new Location(-245064,208456,-12512), new int[]{18679,18680,18681})); + SPAWNS.put(89, new ESSpawn(89, GraciaSeeds.DESTRUCTION, new Location(-246696,208456,-12512), new int[]{18679,18680,18681})); + SPAWNS.put(90, new ESSpawn(90, GraciaSeeds.DESTRUCTION, new Location(-246712,209544,-12512), new int[]{18679,18680,18681})); - _spawns.put(91, new ESSpawn(91, GraciaSeeds.DESTRUCTION, new Location(-245048,207816,-12512), new int[]{18682,18683})); - _spawns.put(92, new ESSpawn(92, GraciaSeeds.DESTRUCTION, new Location(-245048,207288,-12512), new int[]{18682,18683})); - _spawns.put(93, new ESSpawn(93, GraciaSeeds.DESTRUCTION, new Location(-246696,207304,-12512), new int[]{18682,18683})); - _spawns.put(94, new ESSpawn(94, GraciaSeeds.DESTRUCTION, new Location(-246712,207816,-12512), new int[]{18682,18683})); + SPAWNS.put(91, new ESSpawn(91, GraciaSeeds.DESTRUCTION, new Location(-245048,207816,-12512), new int[]{18682,18683})); + SPAWNS.put(92, new ESSpawn(92, GraciaSeeds.DESTRUCTION, new Location(-245048,207288,-12512), new int[]{18682,18683})); + SPAWNS.put(93, new ESSpawn(93, GraciaSeeds.DESTRUCTION, new Location(-246696,207304,-12512), new int[]{18682,18683})); + SPAWNS.put(94, new ESSpawn(94, GraciaSeeds.DESTRUCTION, new Location(-246712,207816,-12512), new int[]{18682,18683})); - _spawns.put(95, new ESSpawn(95, GraciaSeeds.DESTRUCTION, new Location(-244328,207272,-12768), new int[]{18678,18679,18680})); - _spawns.put(96, new ESSpawn(96, GraciaSeeds.DESTRUCTION, new Location(-243256,207256,-12768), new int[]{18678,18679,18680})); - _spawns.put(97, new ESSpawn(97, GraciaSeeds.DESTRUCTION, new Location(-243256,205624,-12768), new int[]{18678,18679,18680})); - _spawns.put(98, new ESSpawn(98, GraciaSeeds.DESTRUCTION, new Location(-244328,205608,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(95, new ESSpawn(95, GraciaSeeds.DESTRUCTION, new Location(-244328,207272,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(96, new ESSpawn(96, GraciaSeeds.DESTRUCTION, new Location(-243256,207256,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(97, new ESSpawn(97, GraciaSeeds.DESTRUCTION, new Location(-243256,205624,-12768), new int[]{18678,18679,18680})); + SPAWNS.put(98, new ESSpawn(98, GraciaSeeds.DESTRUCTION, new Location(-244328,205608,-12768), new int[]{18678,18679,18680})); - _spawns.put(99, new ESSpawn(99, GraciaSeeds.DESTRUCTION, new Location(-242616,207272,-12768), new int[]{18681,18682})); - _spawns.put(100, new ESSpawn(100, GraciaSeeds.DESTRUCTION, new Location(-242104,207272,-12768), new int[]{18681,18682})); - _spawns.put(101, new ESSpawn(101, GraciaSeeds.DESTRUCTION, new Location(-242088,205624,-12768), new int[]{18681,18682})); - _spawns.put(102, new ESSpawn(102, GraciaSeeds.DESTRUCTION, new Location(-242600,205608,-12768), new int[]{18681,18682})); + SPAWNS.put(99, new ESSpawn(99, GraciaSeeds.DESTRUCTION, new Location(-242616,207272,-12768), new int[]{18681,18682})); + SPAWNS.put(100, new ESSpawn(100, GraciaSeeds.DESTRUCTION, new Location(-242104,207272,-12768), new int[]{18681,18682})); + SPAWNS.put(101, new ESSpawn(101, GraciaSeeds.DESTRUCTION, new Location(-242088,205624,-12768), new int[]{18681,18682})); + SPAWNS.put(102, new ESSpawn(102, GraciaSeeds.DESTRUCTION, new Location(-242600,205608,-12768), new int[]{18681,18682})); // Seed of Annihilation - _spawns.put(103, new ESSpawn(103, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184519,183007,-10456), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(104, new ESSpawn(104, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184873,181445,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(105, new ESSpawn(105, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184009,180962,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(106, new ESSpawn(106, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185321,181641,-10448), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(107, new ESSpawn(107, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184035,182775,-10512), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(108, new ESSpawn(108, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185433,181935,-10424), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(109, new ESSpawn(109, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183309,183007,-10560), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(110, new ESSpawn(110, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184929,181886,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(111, new ESSpawn(111, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184009,180392,-10424), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(112, new ESSpawn(112, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183793,183239,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(113, new ESSpawn(113, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184245,180848,-10464), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(114, new ESSpawn(114, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-182704,183761,-10528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(115, new ESSpawn(115, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184705,181886,-10504), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(116, new ESSpawn(116, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184304,181076,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(117, new ESSpawn(117, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183596,180430,-10424), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(118, new ESSpawn(118, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184422,181038,-10480), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(119, new ESSpawn(119, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184929,181543,-10496), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(120, new ESSpawn(120, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184398,182891,-10472), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(121, new ESSpawn(121, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177606,182848,-10584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(122, new ESSpawn(122, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178104,183224,-10560), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(123, new ESSpawn(123, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177274,182284,-10600), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(124, new ESSpawn(124, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177772,183224,-10560), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(125, new ESSpawn(125, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181532,180364,-10504), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(126, new ESSpawn(126, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181802,180276,-10496), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(127, new ESSpawn(127, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178429,180444,-10512), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(128, new ESSpawn(128, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177606,182190,-10600), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(129, new ESSpawn(129, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177357,181908,-10576), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(130, new ESSpawn(130, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178747,179534,-10408), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(131, new ESSpawn(131, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178429,179534,-10392), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(132, new ESSpawn(132, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178853,180094,-10472), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(133, new ESSpawn(133, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181937,179660,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(134, new ESSpawn(134, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-180992,179572,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(135, new ESSpawn(135, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185552,179252,-10368), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(136, new ESSpawn(136, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184572,178913,-10400), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(137, new ESSpawn(137, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184768,178348,-10312), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(138, new ESSpawn(138, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184572,178574,-10352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(139, new ESSpawn(139, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185062,178913,-10384), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(140, new ESSpawn(140, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181397,179484,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(141, new ESSpawn(141, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181667,179044,-10408), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(142, new ESSpawn(142, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185258,177896,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(143, new ESSpawn(143, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183506,176570,-10280), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(144, new ESSpawn(144, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183719,176804,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(145, new ESSpawn(145, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183648,177116,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(146, new ESSpawn(146, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183932,176492,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(147, new ESSpawn(147, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183861,176570,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(148, new ESSpawn(148, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183790,175946,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(149, new ESSpawn(149, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178641,179604,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(150, new ESSpawn(150, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178959,179814,-10432), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(151, new ESSpawn(151, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-176367,178456,-10376), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(152, new ESSpawn(152, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-175845,177172,-10264), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(153, new ESSpawn(153, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-175323,177600,-10248), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(154, new ESSpawn(154, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-174975,177172,-10216), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(155, new ESSpawn(155, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-176019,178242,-10352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(156, new ESSpawn(156, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-174801,178456,-10264), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(103, new ESSpawn(103, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184519,183007,-10456), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(104, new ESSpawn(104, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184873,181445,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(105, new ESSpawn(105, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184009,180962,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(106, new ESSpawn(106, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185321,181641,-10448), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(107, new ESSpawn(107, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184035,182775,-10512), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(108, new ESSpawn(108, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185433,181935,-10424), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(109, new ESSpawn(109, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183309,183007,-10560), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(110, new ESSpawn(110, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184929,181886,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(111, new ESSpawn(111, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184009,180392,-10424), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(112, new ESSpawn(112, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183793,183239,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(113, new ESSpawn(113, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184245,180848,-10464), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(114, new ESSpawn(114, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-182704,183761,-10528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(115, new ESSpawn(115, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184705,181886,-10504), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(116, new ESSpawn(116, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184304,181076,-10488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(117, new ESSpawn(117, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183596,180430,-10424), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(118, new ESSpawn(118, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184422,181038,-10480), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(119, new ESSpawn(119, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184929,181543,-10496), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(120, new ESSpawn(120, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184398,182891,-10472), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(121, new ESSpawn(121, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177606,182848,-10584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(122, new ESSpawn(122, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178104,183224,-10560), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(123, new ESSpawn(123, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177274,182284,-10600), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(124, new ESSpawn(124, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177772,183224,-10560), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(125, new ESSpawn(125, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181532,180364,-10504), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(126, new ESSpawn(126, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181802,180276,-10496), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(127, new ESSpawn(127, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178429,180444,-10512), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(128, new ESSpawn(128, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177606,182190,-10600), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(129, new ESSpawn(129, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177357,181908,-10576), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(130, new ESSpawn(130, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178747,179534,-10408), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(131, new ESSpawn(131, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178429,179534,-10392), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(132, new ESSpawn(132, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178853,180094,-10472), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(133, new ESSpawn(133, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181937,179660,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(134, new ESSpawn(134, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-180992,179572,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(135, new ESSpawn(135, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185552,179252,-10368), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(136, new ESSpawn(136, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184572,178913,-10400), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(137, new ESSpawn(137, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184768,178348,-10312), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(138, new ESSpawn(138, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184572,178574,-10352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(139, new ESSpawn(139, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185062,178913,-10384), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(140, new ESSpawn(140, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181397,179484,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(141, new ESSpawn(141, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181667,179044,-10408), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(142, new ESSpawn(142, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185258,177896,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(143, new ESSpawn(143, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183506,176570,-10280), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(144, new ESSpawn(144, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183719,176804,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(145, new ESSpawn(145, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183648,177116,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(146, new ESSpawn(146, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183932,176492,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(147, new ESSpawn(147, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183861,176570,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(148, new ESSpawn(148, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183790,175946,-10240), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(149, new ESSpawn(149, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178641,179604,-10416), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(150, new ESSpawn(150, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178959,179814,-10432), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(151, new ESSpawn(151, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-176367,178456,-10376), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(152, new ESSpawn(152, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-175845,177172,-10264), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(153, new ESSpawn(153, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-175323,177600,-10248), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(154, new ESSpawn(154, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-174975,177172,-10216), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(155, new ESSpawn(155, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-176019,178242,-10352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(156, new ESSpawn(156, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-174801,178456,-10264), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(157, new ESSpawn(157, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185648,183384,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(158, new ESSpawn(158, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186740,180908,-15528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(159, new ESSpawn(159, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185297,184658,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(160, new ESSpawn(160, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185697,181601,-15488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(161, new ESSpawn(161, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186684,182744,-15536), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(162, new ESSpawn(162, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184908,183384,-15616), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(163, new ESSpawn(163, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184994,185572,-15784), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(164, new ESSpawn(164, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185796,182616,-15608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(165, new ESSpawn(165, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184970,184385,-15648), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(166, new ESSpawn(166, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185995,180809,-15512), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(167, new ESSpawn(167, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185352,182872,-15632), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(168, new ESSpawn(168, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185624,184294,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(169, new ESSpawn(169, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184486,185774,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(170, new ESSpawn(170, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186496,184112,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(171, new ESSpawn(171, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184232,185976,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(172, new ESSpawn(172, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184994,185673,-15792), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(173, new ESSpawn(173, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185733,184203,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(174, new ESSpawn(174, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185079,184294,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(175, new ESSpawn(175, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184803,180710,-15528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(176, new ESSpawn(176, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186293,180413,-15528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(177, new ESSpawn(177, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185352,182936,-15632), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(178, new ESSpawn(178, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184356,180611,-15496), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(179, new ESSpawn(179, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185375,186784,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(180, new ESSpawn(180, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184867,186784,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(181, new ESSpawn(181, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180553,180454,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(182, new ESSpawn(182, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180422,180454,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(183, new ESSpawn(183, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-181863,181138,-15120), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(184, new ESSpawn(184, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-181732,180454,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(185, new ESSpawn(185, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180684,180397,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(186, new ESSpawn(186, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-182256,180682,-15112), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(187, new ESSpawn(187, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185492,179492,-15392), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(188, new ESSpawn(188, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185894,178538,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(189, new ESSpawn(189, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186028,178856,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(190, new ESSpawn(190, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185224,179068,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(191, new ESSpawn(191, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185492,178538,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(192, new ESSpawn(192, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185894,178538,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(193, new ESSpawn(193, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180619,178855,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(194, new ESSpawn(194, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180255,177892,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(195, new ESSpawn(195, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185804,176472,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(196, new ESSpawn(196, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184580,176370,-15320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(197, new ESSpawn(197, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184308,176166,-15320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(198, new ESSpawn(198, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-183764,177186,-15304), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(199, new ESSpawn(199, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180801,177571,-15144), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(200, new ESSpawn(200, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184716,176064,-15320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(201, new ESSpawn(201, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184444,175452,-15296), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(202, new ESSpawn(202, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180164,177464,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(203, new ESSpawn(203, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180164,178213,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(204, new ESSpawn(204, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-179982,178320,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(205, new ESSpawn(205, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176925,177757,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(206, new ESSpawn(206, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176164,179282,-15720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(207, new ESSpawn(207, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175692,177613,-15800), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(208, new ESSpawn(208, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175418,178117,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(209, new ESSpawn(209, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176103,177829,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(210, new ESSpawn(210, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175966,177325,-15792), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(211, new ESSpawn(211, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174778,179732,-15664), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(212, new ESSpawn(212, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175692,178261,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(213, new ESSpawn(213, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176038,179192,-15736), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(214, new ESSpawn(214, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175660,179462,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(215, new ESSpawn(215, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175912,179732,-15664), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(216, new ESSpawn(216, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175156,180182,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(217, new ESSpawn(217, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174240,182059,-15664), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(218, new ESSpawn(218, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175590,181478,-15640), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(219, new ESSpawn(219, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174510,181561,-15616), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(220, new ESSpawn(220, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174240,182391,-15688), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(221, new ESSpawn(221, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174105,182806,-15672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(222, new ESSpawn(222, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174645,182806,-15712), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(157, new ESSpawn(157, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185648,183384,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(158, new ESSpawn(158, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186740,180908,-15528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(159, new ESSpawn(159, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185297,184658,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(160, new ESSpawn(160, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185697,181601,-15488), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(161, new ESSpawn(161, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186684,182744,-15536), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(162, new ESSpawn(162, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184908,183384,-15616), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(163, new ESSpawn(163, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184994,185572,-15784), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(164, new ESSpawn(164, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185796,182616,-15608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(165, new ESSpawn(165, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184970,184385,-15648), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(166, new ESSpawn(166, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185995,180809,-15512), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(167, new ESSpawn(167, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185352,182872,-15632), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(168, new ESSpawn(168, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185624,184294,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(169, new ESSpawn(169, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184486,185774,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(170, new ESSpawn(170, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186496,184112,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(171, new ESSpawn(171, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184232,185976,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(172, new ESSpawn(172, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184994,185673,-15792), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(173, new ESSpawn(173, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185733,184203,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(174, new ESSpawn(174, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185079,184294,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(175, new ESSpawn(175, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184803,180710,-15528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(176, new ESSpawn(176, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186293,180413,-15528), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(177, new ESSpawn(177, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185352,182936,-15632), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(178, new ESSpawn(178, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184356,180611,-15496), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(179, new ESSpawn(179, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185375,186784,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(180, new ESSpawn(180, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184867,186784,-15816), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(181, new ESSpawn(181, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180553,180454,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(182, new ESSpawn(182, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180422,180454,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(183, new ESSpawn(183, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-181863,181138,-15120), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(184, new ESSpawn(184, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-181732,180454,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(185, new ESSpawn(185, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180684,180397,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(186, new ESSpawn(186, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-182256,180682,-15112), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(187, new ESSpawn(187, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185492,179492,-15392), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(188, new ESSpawn(188, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185894,178538,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(189, new ESSpawn(189, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186028,178856,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(190, new ESSpawn(190, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185224,179068,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(191, new ESSpawn(191, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185492,178538,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(192, new ESSpawn(192, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185894,178538,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(193, new ESSpawn(193, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180619,178855,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(194, new ESSpawn(194, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180255,177892,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(195, new ESSpawn(195, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185804,176472,-15336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(196, new ESSpawn(196, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184580,176370,-15320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(197, new ESSpawn(197, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184308,176166,-15320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(198, new ESSpawn(198, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-183764,177186,-15304), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(199, new ESSpawn(199, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180801,177571,-15144), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(200, new ESSpawn(200, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184716,176064,-15320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(201, new ESSpawn(201, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184444,175452,-15296), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(202, new ESSpawn(202, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180164,177464,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(203, new ESSpawn(203, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180164,178213,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(204, new ESSpawn(204, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-179982,178320,-15152), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(205, new ESSpawn(205, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176925,177757,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(206, new ESSpawn(206, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176164,179282,-15720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(207, new ESSpawn(207, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175692,177613,-15800), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(208, new ESSpawn(208, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175418,178117,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(209, new ESSpawn(209, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176103,177829,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(210, new ESSpawn(210, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175966,177325,-15792), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(211, new ESSpawn(211, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174778,179732,-15664), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(212, new ESSpawn(212, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175692,178261,-15824), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(213, new ESSpawn(213, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176038,179192,-15736), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(214, new ESSpawn(214, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175660,179462,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(215, new ESSpawn(215, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175912,179732,-15664), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(216, new ESSpawn(216, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175156,180182,-15680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(217, new ESSpawn(217, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174240,182059,-15664), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(218, new ESSpawn(218, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175590,181478,-15640), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(219, new ESSpawn(219, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174510,181561,-15616), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(220, new ESSpawn(220, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174240,182391,-15688), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(221, new ESSpawn(221, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174105,182806,-15672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(222, new ESSpawn(222, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174645,182806,-15712), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(223, new ESSpawn(223, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214962,182403,-10992), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(224, new ESSpawn(224, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-215019,182493,-11000), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(225, new ESSpawn(225, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-211374,180793,-11672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(226, new ESSpawn(226, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-211198,180661,-11680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(227, new ESSpawn(227, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213097,178936,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(228, new ESSpawn(228, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213517,178936,-12712), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(229, new ESSpawn(229, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214105,179191,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(230, new ESSpawn(230, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213769,179446,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(231, new ESSpawn(231, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214021,179344,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(232, new ESSpawn(232, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-210582,180595,-11672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(233, new ESSpawn(233, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-210934,180661,-11696), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(234, new ESSpawn(234, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207058,178460,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(235, new ESSpawn(235, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207454,179151,-11368), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(236, new ESSpawn(236, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207422,181365,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(237, new ESSpawn(237, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207358,180627,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(238, new ESSpawn(238, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207230,180996,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(239, new ESSpawn(239, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-208515,184160,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(240, new ESSpawn(240, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207613,184000,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(241, new ESSpawn(241, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-208597,183760,-11352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(242, new ESSpawn(242, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206710,176142,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(243, new ESSpawn(243, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206361,178136,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(244, new ESSpawn(244, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206178,178630,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(245, new ESSpawn(245, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-205738,178715,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(246, new ESSpawn(246, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206442,178205,-12648), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(247, new ESSpawn(247, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206585,178874,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(248, new ESSpawn(248, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206073,179366,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(249, new ESSpawn(249, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206009,178628,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(250, new ESSpawn(250, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206155,181301,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(251, new ESSpawn(251, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206595,181641,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(252, new ESSpawn(252, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206507,181641,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(253, new ESSpawn(253, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206507,181471,-12640), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(254, new ESSpawn(254, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206974,175972,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(255, new ESSpawn(255, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206304,175130,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(256, new ESSpawn(256, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206886,175802,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(257, new ESSpawn(257, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207238,175972,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(258, new ESSpawn(258, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206386,174857,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(259, new ESSpawn(259, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206386,175039,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(260, new ESSpawn(260, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-205976,174584,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(261, new ESSpawn(261, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207367,184320,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(262, new ESSpawn(262, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219002,180419,-12608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(263, new ESSpawn(263, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218853,182790,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(264, new ESSpawn(264, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218853,183343,-12600), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(265, new ESSpawn(265, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218358,186247,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(266, new ESSpawn(266, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218358,186083,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(267, new ESSpawn(267, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-217574,185796,-11352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(268, new ESSpawn(268, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219178,181051,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(269, new ESSpawn(269, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-220171,180313,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(270, new ESSpawn(270, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219293,183738,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(271, new ESSpawn(271, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219381,182553,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(272, new ESSpawn(272, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219600,183024,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(273, new ESSpawn(273, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219940,182680,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(274, new ESSpawn(274, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219260,183884,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(275, new ESSpawn(275, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219855,183540,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(276, new ESSpawn(276, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218946,186575,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(277, new ESSpawn(277, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219882,180103,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(278, new ESSpawn(278, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219266,179787,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(279, new ESSpawn(279, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219201,178337,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(280, new ESSpawn(280, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219716,179875,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(281, new ESSpawn(281, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219716,180021,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(282, new ESSpawn(282, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219989,179437,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(283, new ESSpawn(283, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219078,178298,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(284, new ESSpawn(284, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218684,178954,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(285, new ESSpawn(285, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219089,178456,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(286, new ESSpawn(286, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-220266,177623,-12608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(287, new ESSpawn(287, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219201,178025,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(288, new ESSpawn(288, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219142,177044,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(289, new ESSpawn(289, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219690,177895,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(290, new ESSpawn(290, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219754,177623,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(291, new ESSpawn(291, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218791,177830,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(292, new ESSpawn(292, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218904,176219,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(293, new ESSpawn(293, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218768,176384,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(294, new ESSpawn(294, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218774,177626,-11320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(295, new ESSpawn(295, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218774,177792,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(296, new ESSpawn(296, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219880,175901,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(297, new ESSpawn(297, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219210,176054,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(298, new ESSpawn(298, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219850,175991,-12608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(299, new ESSpawn(299, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219079,175021,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(300, new ESSpawn(300, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218812,174229,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); - _spawns.put(301, new ESSpawn(301, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218723,174669,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(223, new ESSpawn(223, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214962,182403,-10992), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(224, new ESSpawn(224, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-215019,182493,-11000), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(225, new ESSpawn(225, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-211374,180793,-11672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(226, new ESSpawn(226, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-211198,180661,-11680), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(227, new ESSpawn(227, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213097,178936,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(228, new ESSpawn(228, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213517,178936,-12712), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(229, new ESSpawn(229, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214105,179191,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(230, new ESSpawn(230, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213769,179446,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(231, new ESSpawn(231, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214021,179344,-12720), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(232, new ESSpawn(232, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-210582,180595,-11672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(233, new ESSpawn(233, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-210934,180661,-11696), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(234, new ESSpawn(234, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207058,178460,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(235, new ESSpawn(235, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207454,179151,-11368), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(236, new ESSpawn(236, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207422,181365,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(237, new ESSpawn(237, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207358,180627,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(238, new ESSpawn(238, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207230,180996,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(239, new ESSpawn(239, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-208515,184160,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(240, new ESSpawn(240, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207613,184000,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(241, new ESSpawn(241, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-208597,183760,-11352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(242, new ESSpawn(242, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206710,176142,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(243, new ESSpawn(243, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206361,178136,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(244, new ESSpawn(244, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206178,178630,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(245, new ESSpawn(245, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-205738,178715,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(246, new ESSpawn(246, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206442,178205,-12648), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(247, new ESSpawn(247, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206585,178874,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(248, new ESSpawn(248, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206073,179366,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(249, new ESSpawn(249, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206009,178628,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(250, new ESSpawn(250, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206155,181301,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(251, new ESSpawn(251, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206595,181641,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(252, new ESSpawn(252, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206507,181641,-12656), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(253, new ESSpawn(253, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206507,181471,-12640), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(254, new ESSpawn(254, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206974,175972,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(255, new ESSpawn(255, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206304,175130,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(256, new ESSpawn(256, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206886,175802,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(257, new ESSpawn(257, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207238,175972,-12672), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(258, new ESSpawn(258, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206386,174857,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(259, new ESSpawn(259, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206386,175039,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(260, new ESSpawn(260, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-205976,174584,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(261, new ESSpawn(261, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207367,184320,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(262, new ESSpawn(262, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219002,180419,-12608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(263, new ESSpawn(263, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218853,182790,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(264, new ESSpawn(264, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218853,183343,-12600), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(265, new ESSpawn(265, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218358,186247,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(266, new ESSpawn(266, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218358,186083,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(267, new ESSpawn(267, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-217574,185796,-11352), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(268, new ESSpawn(268, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219178,181051,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(269, new ESSpawn(269, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-220171,180313,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(270, new ESSpawn(270, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219293,183738,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(271, new ESSpawn(271, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219381,182553,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(272, new ESSpawn(272, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219600,183024,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(273, new ESSpawn(273, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219940,182680,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(274, new ESSpawn(274, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219260,183884,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(275, new ESSpawn(275, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219855,183540,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(276, new ESSpawn(276, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218946,186575,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(277, new ESSpawn(277, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219882,180103,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(278, new ESSpawn(278, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219266,179787,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(279, new ESSpawn(279, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219201,178337,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(280, new ESSpawn(280, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219716,179875,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(281, new ESSpawn(281, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219716,180021,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(282, new ESSpawn(282, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219989,179437,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(283, new ESSpawn(283, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219078,178298,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(284, new ESSpawn(284, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218684,178954,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(285, new ESSpawn(285, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219089,178456,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(286, new ESSpawn(286, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-220266,177623,-12608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(287, new ESSpawn(287, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219201,178025,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(288, new ESSpawn(288, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219142,177044,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(289, new ESSpawn(289, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219690,177895,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(290, new ESSpawn(290, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219754,177623,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(291, new ESSpawn(291, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218791,177830,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(292, new ESSpawn(292, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218904,176219,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(293, new ESSpawn(293, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218768,176384,-12584), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(294, new ESSpawn(294, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218774,177626,-11320), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(295, new ESSpawn(295, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218774,177792,-11328), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(296, new ESSpawn(296, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219880,175901,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(297, new ESSpawn(297, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219210,176054,-12592), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(298, new ESSpawn(298, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219850,175991,-12608), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(299, new ESSpawn(299, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219079,175021,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(300, new ESSpawn(300, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218812,174229,-11344), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); + SPAWNS.put(301, new ESSpawn(301, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218723,174669,-11336), new int[]{ 18678, 18679, 18680, 18681, 18682, 18683 })); //@formatter:on } diff --git a/trunk/dist/game/data/scripts/gracia/AI/SeedOfAnnihilation/SeedOfAnnihilation.java b/trunk/dist/game/data/scripts/gracia/AI/SeedOfAnnihilation/SeedOfAnnihilation.java index 193a33b3b7..1daacab616 100644 --- a/trunk/dist/game/data/scripts/gracia/AI/SeedOfAnnihilation/SeedOfAnnihilation.java +++ b/trunk/dist/game/data/scripts/gracia/AI/SeedOfAnnihilation/SeedOfAnnihilation.java @@ -41,7 +41,7 @@ import com.l2jserver.gameserver.util.Util; */ public class SeedOfAnnihilation extends AbstractNpcAI { - private static final Map _teleportZones = new HashMap<>(); + private static final Map TELEPORT_ZONES = new HashMap<>(); private static final int ANNIHILATION_FURNACE = 18928; // Strength, Agility, Wisdom @@ -71,17 +71,17 @@ public class SeedOfAnnihilation extends AbstractNpcAI static { - _teleportZones.put(60002, new Location(-213175, 182648, -10992)); - _teleportZones.put(60003, new Location(-181217, 186711, -10528)); - _teleportZones.put(60004, new Location(-180211, 182984, -15152)); - _teleportZones.put(60005, new Location(-179275, 186802, -10720)); + TELEPORT_ZONES.put(60002, new Location(-213175, 182648, -10992)); + TELEPORT_ZONES.put(60003, new Location(-181217, 186711, -10528)); + TELEPORT_ZONES.put(60004, new Location(-180211, 182984, -15152)); + TELEPORT_ZONES.put(60005, new Location(-179275, 186802, -10720)); } public SeedOfAnnihilation() { super(SeedOfAnnihilation.class.getSimpleName(), "gracia/AI"); loadSeedRegionData(); - for (int i : _teleportZones.keySet()) + for (int i : TELEPORT_ZONES.keySet()) { addEnterZoneId(i); } @@ -340,9 +340,9 @@ public class SeedOfAnnihilation extends AbstractNpcAI @Override public String onEnterZone(L2Character character, L2ZoneType zone) { - if (_teleportZones.containsKey(zone.getId())) + if (TELEPORT_ZONES.containsKey(zone.getId())) { - Location teleLoc = _teleportZones.get(zone.getId()); + Location teleLoc = TELEPORT_ZONES.get(zone.getId()); character.teleToLocation(teleLoc, false); } return super.onEnterZone(character, zone); diff --git a/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 03c49f7d28..305189fff7 100644 --- a/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -247,7 +247,7 @@ public class AdminBuffs implements IAdminCommandHandler } else { - effects.addAll(target.getEffectList().getPassives().values()); + effects.addAll(target.getEffectList().getPassives()); } if ((page > ((effects.size() / PAGE_LIMIT) + 1)) || (page < 1)) diff --git a/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java b/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java index 884c11058c..cad6cd3947 100644 --- a/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java +++ b/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminCHSiege.java @@ -292,8 +292,7 @@ public final class AdminCHSiege implements IAdminCommandHandler } else { - ClanHallSiegeEngine siegable = hall.getSiege(); - siegable.getAttackers().clear(); + hall.getSiege().getAttackers().clear(); } } else if (split[0].equals(COMMANDS[7])) diff --git a/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java b/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java index 03ec285a17..57f7f30058 100644 --- a/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java +++ b/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java @@ -43,9 +43,23 @@ public final class MagicalAttackMp extends AbstractEffect @Override public boolean calcSuccess(BuffInfo info) { - if (info.getEffected().isInvul() || !Formulas.calcMagicAffected(info.getEffector(), info.getEffected(), info.getSkill())) + if (info.getEffected().isInvul()) { - info.getEffector().sendPacket(SystemMessageId.YOU_HAVE_MISSED); + return false; + } + if (!Formulas.calcMagicAffected(info.getEffector(), info.getEffected(), info.getSkill())) + { + if (info.getEffector().isPlayer()) + { + info.getEffector().sendPacket(SystemMessageId.YOUR_ATTACK_HAS_FAILED); + } + if (info.getEffected().isPlayer()) + { + SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_C2_S_MAGIC); + sm.addCharName(info.getEffected()); + sm.addCharName(info.getEffector()); + info.getEffected().sendPacket(sm); + } return false; } return true; @@ -102,4 +116,4 @@ public final class MagicalAttackMp extends AbstractEffect activeChar.sendPacket(sm2); } } -} +} \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java b/trunk/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java index d5ccb3e086..aea1064e7d 100644 --- a/trunk/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java +++ b/trunk/dist/game/data/scripts/handlers/telnethandlers/DebugHandler.java @@ -22,9 +22,17 @@ import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; import java.net.Socket; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.StringTokenizer; import com.l2jserver.gameserver.GameTimeController; @@ -194,6 +202,53 @@ public class DebugHandler implements ITelnetHandler sb.append('\n'); } + sb.append('\n'); + sb.append("## Threads Information ##\n"); + Map allThread = Thread.getAllStackTraces(); + + final List> entries = new ArrayList<>(allThread.entrySet()); + Collections.sort(entries, (e1, e2) -> e1.getKey().getName().compareTo(e2.getKey().getName())); + + for (Entry entry : entries) + { + StackTraceElement[] stes = entry.getValue(); + Thread t = entry.getKey(); + sb.append("--------------\n"); + sb.append(t.toString() + " (" + t.getId() + ")\n"); + sb.append("State: " + t.getState() + '\n'); + sb.append("isAlive: " + t.isAlive() + " | isDaemon: " + t.isDaemon() + " | isInterrupted: " + t.isInterrupted() + '\n'); + sb.append('\n'); + for (StackTraceElement ste : stes) + { + sb.append(ste.toString()); + sb.append('\n'); + } + sb.append('\n'); + } + + sb.append('\n'); + ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); + long[] ids = findDeadlockedThreads(mbean); + if ((ids != null) && (ids.length > 0)) + { + Thread[] threads = new Thread[ids.length]; + for (int i = 0; i < threads.length; i++) + { + threads[i] = findMatchingThread(mbean.getThreadInfo(ids[i])); + } + sb.append("Deadlocked Threads:\n"); + sb.append("-------------------\n"); + for (Thread thread : threads) + { + System.err.println(thread); + for (StackTraceElement ste : thread.getStackTrace()) + { + sb.append("\t" + ste); + sb.append('\n'); + } + } + } + sb.append("\n\n## Thread Pool Manager Statistics ##\n"); for (String line : ThreadPoolManager.getInstance().getStats()) { @@ -252,6 +307,29 @@ public class DebugHandler implements ITelnetHandler return false; } + private long[] findDeadlockedThreads(ThreadMXBean mbean) + { + // JDK 1.5 only supports the findMonitorDeadlockedThreads() + // method, so you need to comment out the following three lines + if (mbean.isSynchronizerUsageSupported()) + { + return mbean.findDeadlockedThreads(); + } + return mbean.findMonitorDeadlockedThreads(); + } + + private Thread findMatchingThread(ThreadInfo inf) + { + for (Thread thread : Thread.getAllStackTraces().keySet()) + { + if (thread.getId() == inf.getThreadId()) + { + return thread; + } + } + throw new IllegalStateException("Deadlocked Thread not found"); + } + public String getServerStatus() { int playerCount = 0, objectCount = 0; diff --git a/trunk/dist/game/data/scripts/instances/AbstractInstance.java b/trunk/dist/game/data/scripts/instances/AbstractInstance.java index 9010c8887d..2476a99b22 100644 --- a/trunk/dist/game/data/scripts/instances/AbstractInstance.java +++ b/trunk/dist/game/data/scripts/instances/AbstractInstance.java @@ -249,7 +249,7 @@ public abstract class AbstractInstance extends AbstractNpcAI } case WHITELIST: { - for (BuffInfo info : player.getEffectList().getBuffs().values()) + for (BuffInfo info : player.getEffectList().getBuffs()) { if (!inst.getBuffExceptionList().contains(info.getSkill().getId())) { @@ -259,7 +259,7 @@ public abstract class AbstractInstance extends AbstractNpcAI for (L2Summon summon : player.getServitors().values()) { - for (BuffInfo info : summon.getEffectList().getBuffs().values()) + for (BuffInfo info : summon.getEffectList().getBuffs()) { if (!inst.getBuffExceptionList().contains(info.getSkill().getId())) { @@ -271,7 +271,7 @@ public abstract class AbstractInstance extends AbstractNpcAI final L2Summon pet = player.getPet(); if (pet != null) { - for (BuffInfo info : pet.getEffectList().getBuffs().values()) + for (BuffInfo info : pet.getEffectList().getBuffs()) { if (!inst.getBuffExceptionList().contains(info.getSkill().getId())) { @@ -283,7 +283,7 @@ public abstract class AbstractInstance extends AbstractNpcAI } case BLACKLIST: { - for (BuffInfo info : player.getEffectList().getBuffs().values()) + for (BuffInfo info : player.getEffectList().getBuffs()) { if (inst.getBuffExceptionList().contains(info.getSkill().getId())) { @@ -293,7 +293,7 @@ public abstract class AbstractInstance extends AbstractNpcAI for (L2Summon summon : player.getServitors().values()) { - for (BuffInfo info : summon.getEffectList().getBuffs().values()) + for (BuffInfo info : summon.getEffectList().getBuffs()) { if (inst.getBuffExceptionList().contains(info.getSkill().getId())) { @@ -305,7 +305,7 @@ public abstract class AbstractInstance extends AbstractNpcAI final L2Summon pet = player.getPet(); if (pet != null) { - for (BuffInfo info : pet.getEffectList().getBuffs().values()) + for (BuffInfo info : pet.getEffectList().getBuffs()) { if (inst.getBuffExceptionList().contains(info.getSkill().getId())) { diff --git a/trunk/dist/game/data/scripts/instances/CrystalCaverns/CrystalCaverns.java b/trunk/dist/game/data/scripts/instances/CrystalCaverns/CrystalCaverns.java index b820efb5a0..3aea48392f 100644 --- a/trunk/dist/game/data/scripts/instances/CrystalCaverns/CrystalCaverns.java +++ b/trunk/dist/game/data/scripts/instances/CrystalCaverns/CrystalCaverns.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.Config; import com.l2jserver.gameserver.GeoData; @@ -107,7 +108,7 @@ public final class CrystalCaverns extends AbstractInstance 0, 0 }; // 0: not spawned, 1: spawned, 2: cleared - public Map openedDoors = new HashMap<>(); + public Map openedDoors = new ConcurrentHashMap<>(); public Map> npcList2 = new HashMap<>(); public Map oracles = new HashMap<>(); public List keyKeepers = new ArrayList<>(); @@ -1378,27 +1379,24 @@ public final class CrystalCaverns extends AbstractInstance { return ""; } + CrystalGolem cryGolem = world.crystalGolems.get(npc); - List crystals = new ArrayList<>(); + int minDist = 300000; for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300)) { - if ((object instanceof L2ItemInstance) && (object.getId() == CRYSTALFOOD)) + if (object.isItem() && (object.getId() == CRYSTALFOOD)) { - crystals.add(object); - } - } - int minDist = 300000; - for (L2Object crystal : crystals) - { - int dx = npc.getX() - crystal.getX(); - int dy = npc.getY() - crystal.getY(); - int d = (dx * dx) + (dy * dy); - if (d < minDist) - { - minDist = d; - cryGolem.foodItem = (L2ItemInstance) crystal; + int dx = npc.getX() - object.getX(); + int dy = npc.getY() - object.getY(); + int d = (dx * dx) + (dy * dy); + if (d < minDist) + { + minDist = d; + cryGolem.foodItem = (L2ItemInstance) object; + } } } + if (minDist != 300000) { startQuestTimer("getFood", 2000, npc, null); diff --git a/trunk/dist/game/data/scripts/instances/DarkCloudMansion/DarkCloudMansion.java b/trunk/dist/game/data/scripts/instances/DarkCloudMansion/DarkCloudMansion.java index c03c8ff7bd..c718f17e3b 100644 --- a/trunk/dist/game/data/scripts/instances/DarkCloudMansion/DarkCloudMansion.java +++ b/trunk/dist/game/data/scripts/instances/DarkCloudMansion/DarkCloudMansion.java @@ -21,7 +21,9 @@ package instances.DarkCloudMansion; import instances.AbstractInstance; import java.util.ArrayList; -import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.gameserver.enums.ChatType; import com.l2jserver.gameserver.instancemanager.InstanceManager; @@ -46,7 +48,7 @@ public final class DarkCloudMansion extends AbstractInstance { protected class DMCWorld extends InstanceWorld { - protected HashMap rooms = new HashMap<>(); + protected Map rooms = new ConcurrentHashMap<>(); } // NPCs @@ -230,7 +232,7 @@ public final class DarkCloudMansion extends AbstractInstance protected static class DMCRoom { - public ArrayList npcList = new ArrayList<>(); + public List npcList = new ArrayList<>(); public int counter = 0; public int reset = 0; public int founded = 0; diff --git a/trunk/dist/game/data/scripts/instances/DisciplesNecropolisPast/DisciplesNecropolisPast.java b/trunk/dist/game/data/scripts/instances/DisciplesNecropolisPast/DisciplesNecropolisPast.java index 0c42549383..f0940dc857 100644 --- a/trunk/dist/game/data/scripts/instances/DisciplesNecropolisPast/DisciplesNecropolisPast.java +++ b/trunk/dist/game/data/scripts/instances/DisciplesNecropolisPast/DisciplesNecropolisPast.java @@ -22,6 +22,7 @@ import instances.AbstractInstance; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import quests.Q00196_SevenSignsSealOfTheEmperor.Q00196_SevenSignsSealOfTheEmperor; @@ -47,8 +48,8 @@ public final class DisciplesNecropolisPast extends AbstractInstance { protected class DNPWorld extends InstanceWorld { - protected final ArrayList anakimGroup = new ArrayList<>(); - protected final ArrayList lilithGroup = new ArrayList<>(); + protected final List anakimGroup = new ArrayList<>(); + protected final List lilithGroup = new ArrayList<>(); protected int countKill = 0; } @@ -180,7 +181,7 @@ public final class DisciplesNecropolisPast extends AbstractInstance teleportPlayer(player, ENTER, world.getInstanceId()); } - private void makeCast(L2Npc npc, ArrayList targets) + private void makeCast(L2Npc npc, List targets) { npc.setTarget(targets.get(getRandom(targets.size()))); if (SKILLS.containsKey(npc.getId())) diff --git a/trunk/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java b/trunk/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java index a2b8597283..d7ee1d65dc 100644 --- a/trunk/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java +++ b/trunk/dist/game/data/scripts/instances/FinalEmperialTomb/FinalEmperialTomb.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.locks.Lock; @@ -82,10 +83,10 @@ import com.l2jserver.gameserver.util.Util; */ public final class FinalEmperialTomb extends AbstractInstance { - private class FETWorld extends InstanceWorld + protected class FETWorld extends InstanceWorld { protected Lock lock = new ReentrantLock(); - protected CopyOnWriteArrayList npcList = new CopyOnWriteArrayList<>(); + protected List npcList = new CopyOnWriteArrayList<>(); protected int darkChoirPlayerCount = 0; protected FrintezzaSong OnSong = null; protected ScheduledFuture songTask = null; @@ -98,17 +99,13 @@ public final class FinalEmperialTomb extends AbstractInstance protected L2Npc scarletDummy = null; protected L2GrandBossInstance frintezza = null; protected L2GrandBossInstance activeScarlet = null; - protected List demons = new ArrayList<>(); - protected Map portraits = new HashMap<>(); + protected List demons = new CopyOnWriteArrayList<>(); + protected Map portraits = new ConcurrentHashMap<>(); protected int scarlet_x = 0; protected int scarlet_y = 0; protected int scarlet_z = 0; protected int scarlet_h = 0; protected int scarlet_a = 0; - - protected FETWorld() - { - } } protected static class FETSpawn @@ -298,11 +295,9 @@ public final class FinalEmperialTomb extends AbstractInstance _log.severe("[Final Emperial Tomb] 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 ArrayList()); - } + _spawnList.putIfAbsent(flag, new ArrayList()); for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling()) { @@ -848,7 +843,7 @@ public final class FinalEmperialTomb extends AbstractInstance if ((_world.frintezza != null) && !_world.frintezza.isDead() && (_world.activeScarlet != null) && !_world.activeScarlet.isDead()) { - List targetList = new ArrayList<>(); + final List targetList = new ArrayList<>(); if (skill.hasEffectType(L2EffectType.STUN) || skill.isDebuff()) { for (int objId : _world.getAllowed()) @@ -879,7 +874,7 @@ public final class FinalEmperialTomb extends AbstractInstance { targetList.add(_world.activeScarlet); } - if (targetList.size() > 0) + if (!targetList.isEmpty()) { _world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()])); } diff --git a/trunk/dist/game/data/scripts/instances/KaraphonHabitat/KaraphonHabitat.java b/trunk/dist/game/data/scripts/instances/KaraphonHabitat/KaraphonHabitat.java index 53dd060ade..c9628f4d1c 100644 --- a/trunk/dist/game/data/scripts/instances/KaraphonHabitat/KaraphonHabitat.java +++ b/trunk/dist/game/data/scripts/instances/KaraphonHabitat/KaraphonHabitat.java @@ -19,7 +19,6 @@ package instances.KaraphonHabitat; import instances.AbstractInstance; - import quests.Q10745_TheSecretIngredients.Q10745_TheSecretIngredients; import com.l2jserver.gameserver.instancemanager.InstanceManager; diff --git a/trunk/dist/game/data/stats/skills/01400-01499.xml b/trunk/dist/game/data/stats/skills/01400-01499.xml index 99c109ebe4..3b1795f56a 100644 --- a/trunk/dist/game/data/stats/skills/01400-01499.xml +++ b/trunk/dist/game/data/stats/skills/01400-01499.xml @@ -994,7 +994,6 @@ - diff --git a/trunk/java/com/l2jserver/Config.java b/trunk/java/com/l2jserver/Config.java index cf3c4bd2c5..ed21c93f92 100644 --- a/trunk/java/com/l2jserver/Config.java +++ b/trunk/java/com/l2jserver/Config.java @@ -60,7 +60,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.ChatType; import com.l2jserver.gameserver.enums.IllegalActionPunishmentType; import com.l2jserver.gameserver.model.L2World; @@ -71,6 +70,7 @@ import com.l2jserver.gameserver.util.FloodProtectorConfig; import com.l2jserver.gameserver.util.Util; import com.l2jserver.util.PropertiesParser; import com.l2jserver.util.StringUtil; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class loads all the game server related configurations from files.
diff --git a/trunk/java/com/l2jserver/gameserver/ItemsAutoDestroy.java b/trunk/java/com/l2jserver/gameserver/ItemsAutoDestroy.java index a1956696c3..6899ee58f3 100644 --- a/trunk/java/com/l2jserver/gameserver/ItemsAutoDestroy.java +++ b/trunk/java/com/l2jserver/gameserver/ItemsAutoDestroy.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.Config; import com.l2jserver.gameserver.enums.ItemLocation; @@ -29,7 +29,7 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; public final class ItemsAutoDestroy { - private final List _items = new CopyOnWriteArrayList<>(); + private final Map _items = new ConcurrentHashMap<>(); protected ItemsAutoDestroy() { @@ -44,22 +44,22 @@ public final class ItemsAutoDestroy public synchronized void addItem(L2ItemInstance item) { item.setDropTime(System.currentTimeMillis()); - _items.add(item); + _items.put(item.getObjectId(), item); } public synchronized void removeItems() { - if (_items.isEmpty()) + final long curtime = System.currentTimeMillis(); + for (L2ItemInstance item : _items.values()) { - return; - } - - long curtime = System.currentTimeMillis(); - for (L2ItemInstance item : _items) - { - if ((item == null) || (item.getDropTime() == 0) || (item.getItemLocation() != ItemLocation.VOID)) + if (item == null) { - _items.remove(item); + continue; + } + + if ((item.getDropTime() == 0) || (item.getItemLocation() != ItemLocation.VOID)) + { + _items.remove(item.getObjectId()); } else { @@ -69,7 +69,7 @@ public final class ItemsAutoDestroy { L2World.getInstance().removeVisibleObject(item, item.getWorldRegion()); L2World.getInstance().removeObject(item); - _items.remove(item); + _items.remove(item.getObjectId()); if (Config.SAVE_DROPPED_ITEM) { ItemsOnGroundManager.getInstance().removeObject(item); @@ -82,7 +82,7 @@ public final class ItemsAutoDestroy { L2World.getInstance().removeVisibleObject(item, item.getWorldRegion()); L2World.getInstance().removeObject(item); - _items.remove(item); + _items.remove(item.getObjectId()); if (Config.SAVE_DROPPED_ITEM) { ItemsOnGroundManager.getInstance().removeObject(item); @@ -97,7 +97,7 @@ public final class ItemsAutoDestroy { L2World.getInstance().removeVisibleObject(item, item.getWorldRegion()); L2World.getInstance().removeObject(item); - _items.remove(item); + _items.remove(item.getObjectId()); if (Config.SAVE_DROPPED_ITEM) { ItemsOnGroundManager.getInstance().removeObject(item); diff --git a/trunk/java/com/l2jserver/gameserver/LoginServerThread.java b/trunk/java/com/l2jserver/gameserver/LoginServerThread.java index 6cfbdf2237..ffac9c5d1d 100644 --- a/trunk/java/com/l2jserver/gameserver/LoginServerThread.java +++ b/trunk/java/com/l2jserver/gameserver/LoginServerThread.java @@ -39,6 +39,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; @@ -134,7 +135,7 @@ public class LoginServerThread extends Thread _reserveHost = Config.RESERVE_HOST_ON_LOGIN; _subnets = Config.GAME_SERVER_SUBNETS; _hosts = Config.GAME_SERVER_HOSTS; - _waitingClients = new ArrayList<>(); + _waitingClients = new CopyOnWriteArrayList<>(); _maxPlayer = Config.MAXIMUM_ONLINE_USERS; } diff --git a/trunk/java/com/l2jserver/gameserver/RecipeController.java b/trunk/java/com/l2jserver/gameserver/RecipeController.java index 132d6c2f12..779c1ff25b 100644 --- a/trunk/java/com/l2jserver/gameserver/RecipeController.java +++ b/trunk/java/com/l2jserver/gameserver/RecipeController.java @@ -61,6 +61,7 @@ public class RecipeController protected RecipeController() { + // Prevent external initialization. } public void requestBookOpen(L2PcInstance player, boolean isDwarvenCraft) diff --git a/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java b/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java index e114d393d4..d6e4b6215f 100644 --- a/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java +++ b/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java @@ -451,16 +451,9 @@ public final class L2ControllableMobAI extends L2AttackableAI double dy, dx; double dblAggroRange = aggroRange * aggroRange; - List potentialTarget = new ArrayList<>(); - - Collection objs = npc.getKnownList().getKnownObjects().values(); - for (L2Object obj : objs) + final List potentialTarget = new ArrayList<>(); + for (L2Character obj : npc.getKnownList().getKnownCharacters()) { - if (!(obj instanceof L2Character)) - { - continue; - } - npcX = npc.getX(); npcY = npc.getY(); targetX = obj.getX(); @@ -474,8 +467,7 @@ public final class L2ControllableMobAI extends L2AttackableAI continue; } - L2Character target = (L2Character) obj; - + L2Character target = obj; if (checkAutoAttackCondition(target)) { potentialTarget.add(target); diff --git a/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Forum.java b/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Forum.java index 081cb20aa5..ff52fd4963 100644 --- a/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Forum.java +++ b/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Forum.java @@ -22,9 +22,9 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -48,8 +48,8 @@ public class Forum public static final int CLANMEMBERONLY = 2; public static final int OWNERONLY = 3; - private final List _children; - private final Map _topic; + private final List _children = new ArrayList<>(); + private final Map _topic = new ConcurrentHashMap<>(); private final int _forumId; private String _forumName; private int _forumType; @@ -68,8 +68,6 @@ public class Forum { _forumId = Forumid; _fParent = FParent; - _children = new ArrayList<>(); - _topic = new HashMap<>(); } /** @@ -88,8 +86,6 @@ public class Forum _forumPerm = perm; _fParent = parent; _ownerID = OwnerID; - _children = new ArrayList<>(); - _topic = new HashMap<>(); parent._children.add(this); ForumsBBSManager.getInstance().addForum(this); _loaded = true; @@ -151,7 +147,7 @@ public class Forum { while (rs.next()) { - Forum f = new Forum(rs.getInt("forum_id"), this); + final Forum f = new Forum(rs.getInt("forum_id"), this); _children.add(f); ForumsBBSManager.getInstance().addForum(f); } @@ -208,14 +204,7 @@ public class Forum public Forum getChildByName(String name) { vload(); - for (Forum f : _children) - { - if (f.getName().equals(name)) - { - return f; - } - } - return null; + return _children.stream().filter(f -> f.getName().equals(name)).findFirst().orElse(null); } /** diff --git a/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Post.java b/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Post.java index a7b3ed9646..e06d0060aa 100644 --- a/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Post.java +++ b/trunk/java/com/l2jserver/gameserver/communitybbs/BB/Post.java @@ -47,7 +47,7 @@ public class Post public String postTxt; } - private final List _post; + private final List _post = new ArrayList<>(); /** * @param _PostOwner @@ -59,8 +59,7 @@ public class Post */ public Post(String _PostOwner, int _PostOwnerID, long date, int tid, int _PostForumID, String txt) { - _post = new ArrayList<>(); - CPost cp = new CPost(); + final CPost cp = new CPost(); cp.postId = 0; cp.postOwner = _PostOwner; cp.postOwnerId = _PostOwnerID; @@ -73,6 +72,11 @@ public class Post } + public Post(Topic t) + { + load(t); + } + public void insertindb(CPost cp) { try (Connection con = L2DatabaseFactory.getInstance().getConnection(); @@ -93,23 +97,9 @@ public class Post } } - public Post(Topic t) - { - _post = new ArrayList<>(); - load(t); - } - public CPost getCPost(int id) { - int i = 0; - for (CPost cp : _post) - { - if (i++ == id) - { - return cp; - } - } - return null; + return _post.get(id); } public void deleteme(Topic t) @@ -142,7 +132,7 @@ public class Post { while (rs.next()) { - CPost cp = new CPost(); + final CPost cp = new CPost(); cp.postId = rs.getInt("post_id"); cp.postOwner = rs.getString("post_owner_name"); cp.postOwnerId = rs.getInt("post_ownerid"); diff --git a/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/ForumsBBSManager.java b/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/ForumsBBSManager.java index 7a63c666f0..fa0c87e579 100644 --- a/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/ForumsBBSManager.java +++ b/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/ForumsBBSManager.java @@ -63,10 +63,7 @@ public class ForumsBBSManager extends BaseBBSManager */ public void initRoot() { - for (Forum f : _table) - { - f.vload(); - } + _table.forEach(f -> f.vload()); _log.info("Loaded " + _table.size() + " forums. Last forum id used: " + _lastid); } @@ -101,14 +98,7 @@ public class ForumsBBSManager extends BaseBBSManager */ public Forum getForumByName(String name) { - for (Forum f : _table) - { - if (f.getName().equals(name)) - { - return f; - } - } - return null; + return _table.stream().filter(f -> f.getName().equals(name)).findFirst().orElse(null); } /** @@ -143,14 +133,7 @@ public class ForumsBBSManager extends BaseBBSManager */ public Forum getForumByID(int idf) { - for (Forum f : _table) - { - if (f.getID() == idf) - { - return f; - } - } - return null; + return _table.stream().filter(f -> f.getID() == idf).findFirst().orElse(null); } @Override diff --git a/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/PostBBSManager.java b/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/PostBBSManager.java index 75a8570830..773b677f16 100644 --- a/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/PostBBSManager.java +++ b/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/PostBBSManager.java @@ -20,10 +20,10 @@ package com.l2jserver.gameserver.communitybbs.Manager; import java.text.DateFormat; import java.util.Date; -import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.gameserver.communitybbs.BB.Forum; import com.l2jserver.gameserver.communitybbs.BB.Post; @@ -35,7 +35,7 @@ import com.l2jserver.util.StringUtil; public class PostBBSManager extends BaseBBSManager { - private final Map _postByTopic = new HashMap<>(); + private final Map _postByTopic = new ConcurrentHashMap<>(); public Post getGPosttByTopic(Topic t) { diff --git a/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/TopicBBSManager.java b/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/TopicBBSManager.java index 21773c0345..045a335259 100644 --- a/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/TopicBBSManager.java +++ b/trunk/java/com/l2jserver/gameserver/communitybbs/Manager/TopicBBSManager.java @@ -19,13 +19,13 @@ package com.l2jserver.gameserver.communitybbs.Manager; import java.text.DateFormat; -import java.util.ArrayList; import java.util.Calendar; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringTokenizer; -import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import com.l2jserver.gameserver.communitybbs.BB.Forum; import com.l2jserver.gameserver.communitybbs.BB.Post; @@ -37,13 +37,12 @@ import com.l2jserver.util.StringUtil; public class TopicBBSManager extends BaseBBSManager { - private final List _table; - private final Map _maxId; + private final List _table = new CopyOnWriteArrayList<>(); + private final Map _maxId = new HashMap<>(); protected TopicBBSManager() { - _table = new ArrayList<>(); - _maxId = new ConcurrentHashMap<>(); + // Prevent external initialization. } public void addTopic(Topic tt) diff --git a/trunk/java/com/l2jserver/gameserver/data/sql/impl/ClanTable.java b/trunk/java/com/l2jserver/gameserver/data/sql/impl/ClanTable.java index 56ceef7a1d..3ff7c6d814 100644 --- a/trunk/java/com/l2jserver/gameserver/data/sql/impl/ClanTable.java +++ b/trunk/java/com/l2jserver/gameserver/data/sql/impl/ClanTable.java @@ -378,8 +378,8 @@ public class ClanTable public void storeclanswars(int clanId1, int clanId2) { - final L2Clan clan1 = ClanTable.getInstance().getClan(clanId1); - final L2Clan clan2 = ClanTable.getInstance().getClan(clanId2); + final L2Clan clan1 = getClan(clanId1); + final L2Clan clan2 = getClan(clanId2); EventDispatcher.getInstance().notifyEventAsync(new OnClanWarStart(clan1, clan2)); @@ -419,8 +419,8 @@ public class ClanTable public void deleteclanswars(int clanId1, int clanId2) { - L2Clan clan1 = ClanTable.getInstance().getClan(clanId1); - L2Clan clan2 = ClanTable.getInstance().getClan(clanId2); + L2Clan clan1 = getClan(clanId1); + L2Clan clan2 = getClan(clanId2); EventDispatcher.getInstance().notifyEventAsync(new OnClanWarFinish(clan1, clan2)); diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/AbilityPointsData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/AbilityPointsData.java index 07b32aa4bc..b69d3f2518 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/AbilityPointsData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/AbilityPointsData.java @@ -27,8 +27,8 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.holders.RangeAbilityPointsHolder; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/AdminData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/AdminData.java index 8ff1a38648..d49c7d3bf7 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/AdminData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/AdminData.java @@ -30,7 +30,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2AccessLevel; import com.l2jserver.gameserver.model.L2AdminCommandAccessRight; import com.l2jserver.gameserver.model.StatsSet; @@ -38,6 +37,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads administrator access levels and commands. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/AppearanceItemData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/AppearanceItemData.java index 05cff1c7d6..02c6143544 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/AppearanceItemData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/AppearanceItemData.java @@ -26,13 +26,13 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.enums.Race; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.items.appearance.AppearanceStone; import com.l2jserver.gameserver.model.items.appearance.AppearanceTargetType; import com.l2jserver.gameserver.model.items.type.CrystalType; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid @@ -109,7 +109,7 @@ public class AppearanceItemData implements IXmlReader } case "bodyPart": { - final int part = ItemTable._slots.get(c.getTextContent()); + final int part = ItemTable.SLOTS.get(c.getTextContent()); stone.addBodyPart(part); break; } diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ArmorSetsData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ArmorSetsData.java index 07ed0b534a..59651d0fa1 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ArmorSetsData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ArmorSetsData.java @@ -25,10 +25,10 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2ArmorSet; import com.l2jserver.gameserver.model.holders.ArmorsetSkillHolder; import com.l2jserver.gameserver.model.holders.SkillHolder; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads armor set bonuses. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/BeautyShopData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/BeautyShopData.java index 8a0fe07dd6..6f4f14b5b3 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/BeautyShopData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/BeautyShopData.java @@ -25,12 +25,12 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.Race; import com.l2jserver.gameserver.enums.Sex; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.beautyshop.BeautyData; import com.l2jserver.gameserver.model.beautyshop.BeautyItem; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author Sdw diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/BuyListData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/BuyListData.java index 25c48f0b0c..6f97e71f24 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/BuyListData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/BuyListData.java @@ -33,11 +33,11 @@ import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.model.buylist.L2BuyList; import com.l2jserver.gameserver.model.buylist.Product; import com.l2jserver.gameserver.model.items.L2Item; +import com.l2jserver.util.data.xml.IXmlReader; import com.l2jserver.util.file.filter.NumericNameFilter; /** diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/CastleData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/CastleData.java index 1af35262cf..bc040a782d 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/CastleData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/CastleData.java @@ -29,9 +29,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.CastleSide; import com.l2jserver.gameserver.model.holders.CastleSpawnHolder; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author St3eT diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/CategoryData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/CategoryData.java index 17d59a05f8..226d25cfbc 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/CategoryData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/CategoryData.java @@ -29,8 +29,8 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.CategoryType; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads the category data with Class or NPC IDs. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ClassListData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ClassListData.java index aa7a5b0add..7c62ecdbb9 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ClassListData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ClassListData.java @@ -25,9 +25,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.base.ClassId; import com.l2jserver.gameserver.model.base.ClassInfo; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads the the list of classes and it's info. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/DoorData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/DoorData.java index 71736bfa93..96c8415760 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/DoorData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/DoorData.java @@ -30,13 +30,13 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.instancemanager.InstanceManager; import com.l2jserver.gameserver.instancemanager.MapRegionManager; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance; import com.l2jserver.gameserver.model.actor.templates.L2DoorTemplate; import com.l2jserver.gameserver.pathfinding.AbstractNodeLoc; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads doors. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemData.java index b0de38e285..0b2dcd4ba9 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemData.java @@ -26,11 +26,11 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.items.enchant.EnchantScroll; import com.l2jserver.gameserver.model.items.enchant.EnchantSupportItem; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads item enchant data. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemGroupsData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemGroupsData.java index 3af15eb6a5..29f90dbe46 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemGroupsData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemGroupsData.java @@ -26,7 +26,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.model.holders.RangeChanceHolder; import com.l2jserver.gameserver.model.items.L2Item; @@ -34,6 +33,7 @@ import com.l2jserver.gameserver.model.items.enchant.EnchantItemGroup; import com.l2jserver.gameserver.model.items.enchant.EnchantRateItem; import com.l2jserver.gameserver.model.items.enchant.EnchantScrollGroup; import com.l2jserver.gameserver.util.Util; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid @@ -117,7 +117,7 @@ public final class EnchantItemGroupsData implements IXmlReader final NamedNodeMap attrs = z.getAttributes(); if (attrs.getNamedItem("slot") != null) { - rateGroup.addSlot(ItemTable._slots.get(parseString(attrs, "slot"))); + rateGroup.addSlot(ItemTable.SLOTS.get(parseString(attrs, "slot"))); } if (attrs.getNamedItem("magicWeapon") != null) { diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemHPBonusData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemHPBonusData.java index cb2fac4046..75095bf693 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemHPBonusData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemHPBonusData.java @@ -27,7 +27,6 @@ import java.util.Map; import org.w3c.dom.Document; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.enums.StatFunction; import com.l2jserver.gameserver.model.items.L2Item; @@ -35,6 +34,7 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.model.items.type.CrystalType; import com.l2jserver.gameserver.model.stats.Stats; import com.l2jserver.gameserver.model.stats.functions.FuncTemplate; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Enchant HP Bonus Data. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemOptionsData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemOptionsData.java index 0e9488b901..213e11d3e8 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemOptionsData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantItemOptionsData.java @@ -25,10 +25,10 @@ import java.util.logging.Level; import org.w3c.dom.Document; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.model.options.EnchantOptions; import com.l2jserver.gameserver.util.Util; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantSkillGroupsData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantSkillGroupsData.java index b94e928a5e..9ba5d48ea9 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantSkillGroupsData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/EnchantSkillGroupsData.java @@ -27,13 +27,13 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2EnchantSkillGroup; import com.l2jserver.gameserver.model.L2EnchantSkillGroup.EnchantSkillHolder; import com.l2jserver.gameserver.model.L2EnchantSkillLearn; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.skills.Skill; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Enchant Groups information. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ExperienceData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ExperienceData.java index c06c57585f..648ef407c3 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ExperienceData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ExperienceData.java @@ -25,7 +25,7 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Experience points for each level for players and pets. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishData.java index c71922740f..a3daae4c03 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishData.java @@ -27,9 +27,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.fishing.L2Fish; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Fish information. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingMonstersData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingMonstersData.java index e22a285288..cae1f5214b 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingMonstersData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingMonstersData.java @@ -25,9 +25,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.fishing.L2FishingMonster; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Fishing Monsters information. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingRodsData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingRodsData.java index e001eb244b..7915a6878d 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingRodsData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/FishingRodsData.java @@ -25,9 +25,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.fishing.L2FishingRod; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Fishing Rods information. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/HennaData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/HennaData.java index 3c848aa0be..83d62fd0a7 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/HennaData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/HennaData.java @@ -27,10 +27,10 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.base.ClassId; import com.l2jserver.gameserver.model.items.L2Henna; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the henna related information.
diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/HitConditionBonusData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/HitConditionBonusData.java index 6ad985bc3f..f757d26b90 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/HitConditionBonusData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/HitConditionBonusData.java @@ -24,8 +24,8 @@ import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.gameserver.GameTimeController; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.actor.L2Character; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class load, holds and calculates the hit condition bonuses. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialEquipmentData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialEquipmentData.java index ccd67c4d5e..a78b0dbe5e 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialEquipmentData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialEquipmentData.java @@ -28,10 +28,10 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.base.ClassId; import com.l2jserver.gameserver.model.items.PcItemTemplate; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Initial Equipment information.
diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialShortcutData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialShortcutData.java index 4426161f52..9d02c6c337 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialShortcutData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/InitialShortcutData.java @@ -27,7 +27,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.MacroType; import com.l2jserver.gameserver.enums.ShortcutType; import com.l2jserver.gameserver.model.Macro; @@ -37,6 +36,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.base.ClassId; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.serverpackets.ShortCutRegister; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Initial Shortcuts information.
diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ItemCrystalizationData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ItemCrystalizationData.java index 0182970298..020d97b71d 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ItemCrystalizationData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ItemCrystalizationData.java @@ -26,9 +26,9 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.CrystalizationData; import com.l2jserver.gameserver.model.holders.ItemChanceHolder; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/KarmaData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/KarmaData.java index 7b13704280..8d5fc4aea3 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/KarmaData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/KarmaData.java @@ -26,7 +26,7 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java index cff97a2428..585c064d8e 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/MultisellData.java @@ -31,7 +31,6 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -45,6 +44,7 @@ import com.l2jserver.gameserver.network.serverpackets.MultiSellList; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.network.serverpackets.UserInfo; import com.l2jserver.gameserver.util.Util; +import com.l2jserver.util.data.xml.IXmlReader; import com.l2jserver.util.file.filter.NumericNameFilter; public final class MultisellData implements IXmlReader diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/NpcData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/NpcData.java index fa54a4151d..2b95490d80 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/NpcData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/NpcData.java @@ -36,7 +36,6 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.SkillData; import com.l2jserver.gameserver.enums.AISkillScope; import com.l2jserver.gameserver.model.StatsSet; @@ -51,6 +50,7 @@ import com.l2jserver.gameserver.model.holders.MinionHolder; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.skills.Skill; import com.l2jserver.gameserver.util.Util; +import com.l2jserver.util.data.xml.IXmlReader; /** * NPC data parser. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/OptionData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/OptionData.java index d979ef9876..c67eac625e 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/OptionData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/OptionData.java @@ -26,13 +26,13 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.options.Options; import com.l2jserver.gameserver.model.options.OptionsSkillHolder; import com.l2jserver.gameserver.model.options.OptionsSkillType; import com.l2jserver.gameserver.model.stats.Stats; import com.l2jserver.gameserver.model.stats.functions.FuncTemplate; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PetDataTable.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PetDataTable.java index a4240f0b9f..de30759cd7 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PetDataTable.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PetDataTable.java @@ -25,11 +25,11 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.MountType; import com.l2jserver.gameserver.model.L2PetData; import com.l2jserver.gameserver.model.L2PetLevelData; import com.l2jserver.gameserver.model.StatsSet; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class parse and hold all pet parameters.
diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerTemplateData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerTemplateData.java index 09d2695793..2f6c43b8a3 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerTemplateData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerTemplateData.java @@ -28,11 +28,11 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.Location; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate; import com.l2jserver.gameserver.model.base.ClassId; +import com.l2jserver.util.data.xml.IXmlReader; /** * Loads player's base stats. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerXpPercentLostData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerXpPercentLostData.java index f669fb20ad..b06738bde1 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerXpPercentLostData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PlayerXpPercentLostData.java @@ -24,7 +24,7 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class holds the Player Xp Percent Lost Data for each level for players. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PrimeShopData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PrimeShopData.java index 34fc2fc4d1..69cbff2971 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/PrimeShopData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/PrimeShopData.java @@ -27,7 +27,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -35,6 +34,7 @@ import com.l2jserver.gameserver.model.items.L2Item; import com.l2jserver.gameserver.model.primeshop.PrimeShopGroup; import com.l2jserver.gameserver.model.primeshop.PrimeShopItem; import com.l2jserver.gameserver.network.serverpackets.primeshop.ExBRProductInfo; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author Gnacik, UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/RecipeData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/RecipeData.java index 1074ce032b..b943d509b8 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/RecipeData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/RecipeData.java @@ -27,12 +27,12 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2RecipeInstance; import com.l2jserver.gameserver.model.L2RecipeList; import com.l2jserver.gameserver.model.L2RecipeStatInstance; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.util.data.xml.IXmlReader; /** * The Class RecipeData. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SecondaryAuthData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SecondaryAuthData.java index 0ffe07fe9c..ca4cbe60f5 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SecondaryAuthData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SecondaryAuthData.java @@ -26,7 +26,7 @@ import java.util.logging.Level; import org.w3c.dom.Document; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author NosBit diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ShuttleData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ShuttleData.java index c9d1ea7420..4e77e4e7b7 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/ShuttleData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/ShuttleData.java @@ -28,7 +28,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.Location; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.VehiclePathPoint; @@ -37,6 +36,7 @@ import com.l2jserver.gameserver.model.actor.templates.L2CharTemplate; import com.l2jserver.gameserver.model.shuttle.L2ShuttleData; import com.l2jserver.gameserver.model.shuttle.L2ShuttleEngine; import com.l2jserver.gameserver.model.shuttle.L2ShuttleStop; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SiegeScheduleData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SiegeScheduleData.java index 96186438ef..ccc36b3e2a 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SiegeScheduleData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SiegeScheduleData.java @@ -27,10 +27,10 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.SiegeScheduleDate; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.util.Util; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillLearnData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillLearnData.java index e14b6e1313..c9f9665650 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillLearnData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillLearnData.java @@ -26,8 +26,8 @@ import java.util.Map; import org.w3c.dom.Document; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.base.ClassId; +import com.l2jserver.util.data.xml.IXmlReader; /** * Holds all skill learn data for all npcs. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java index f37dd5eb4e..ccc5319ae4 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java @@ -36,7 +36,6 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.datatables.SkillData; import com.l2jserver.gameserver.enums.CategoryType; import com.l2jserver.gameserver.enums.Race; @@ -54,6 +53,7 @@ import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.interfaces.ISkillsHolder; import com.l2jserver.gameserver.model.skills.CommonSkill; import com.l2jserver.gameserver.model.skills.Skill; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class loads and manage the characters and pledges skills trees.
diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/StaticObjectData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/StaticObjectData.java index 0ea5bd5939..c8aefe4a8a 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/StaticObjectData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/StaticObjectData.java @@ -26,10 +26,10 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jserver.gameserver.model.actor.templates.L2CharTemplate; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class loads and holds all static object data. diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/TeleportersData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/TeleportersData.java index 4e9fcfff30..3fa8662b2b 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/TeleportersData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/TeleportersData.java @@ -26,11 +26,11 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.teleporter.TeleportHolder; import com.l2jserver.gameserver.model.teleporter.TeleportLocation; import com.l2jserver.gameserver.model.teleporter.TeleportType; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/TransformData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/TransformData.java index 1ea2e8202f..8089d36107 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/TransformData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/TransformData.java @@ -26,7 +26,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.transform.Transform; @@ -36,6 +35,7 @@ import com.l2jserver.gameserver.model.holders.AdditionalItemHolder; import com.l2jserver.gameserver.model.holders.AdditionalSkillHolder; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.network.serverpackets.ExBasicActionList; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author UnAfraid diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/UIData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/UIData.java index c0596c2789..343d0211fd 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/UIData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/UIData.java @@ -27,8 +27,8 @@ import java.util.logging.Logger; import org.w3c.dom.Document; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.ActionKey; +import com.l2jserver.util.data.xml.IXmlReader; /** * UI Data parser. diff --git a/trunk/java/com/l2jserver/gameserver/datatables/EventDroplist.java b/trunk/java/com/l2jserver/gameserver/datatables/EventDroplist.java index 6a55c6dc23..c13c7282e4 100644 --- a/trunk/java/com/l2jserver/gameserver/datatables/EventDroplist.java +++ b/trunk/java/com/l2jserver/gameserver/datatables/EventDroplist.java @@ -36,7 +36,7 @@ public class EventDroplist /** * The table containing all DataDrop object */ - private static final List _allNpcDateDrops = new ArrayList<>(); + private static final List ALL_NPC_DATE_DROPS = new ArrayList<>(); public static class DateDrop { @@ -75,7 +75,7 @@ public class EventDroplist */ public void addGlobalDrop(int[] itemIdList, int[] count, int chance, DateRange dateRange) { - _allNpcDateDrops.add(new DateDrop(dateRange, new EventDrop(itemIdList, count[0], count[1], chance))); + ALL_NPC_DATE_DROPS.add(new DateDrop(dateRange, new EventDrop(itemIdList, count[0], count[1], chance))); } /** @@ -87,7 +87,7 @@ public class EventDroplist */ public void addGlobalDrop(int itemId, long min, long max, int chance, DateRange dateRange) { - _allNpcDateDrops.add(new DateDrop(dateRange, new EventDrop(itemId, min, max, chance))); + ALL_NPC_DATE_DROPS.add(new DateDrop(dateRange, new EventDrop(itemId, min, max, chance))); } /** @@ -97,7 +97,7 @@ public class EventDroplist */ public void addGlobalDrop(DateRange dateRange, EventDrop eventDrop) { - _allNpcDateDrops.add(new DateDrop(dateRange, eventDrop)); + ALL_NPC_DATE_DROPS.add(new DateDrop(dateRange, eventDrop)); } /** @@ -107,7 +107,7 @@ public class EventDroplist { final List list = new ArrayList<>(); final Date currentDate = new Date(); - for (DateDrop drop : _allNpcDateDrops) + for (DateDrop drop : ALL_NPC_DATE_DROPS) { if (drop._dateRange.isWithinRange(currentDate)) { diff --git a/trunk/java/com/l2jserver/gameserver/datatables/ItemTable.java b/trunk/java/com/l2jserver/gameserver/datatables/ItemTable.java index 92b78459f7..3f63165399 100644 --- a/trunk/java/com/l2jserver/gameserver/datatables/ItemTable.java +++ b/trunk/java/com/l2jserver/gameserver/datatables/ItemTable.java @@ -60,53 +60,53 @@ public class ItemTable private static Logger LOGGER = Logger.getLogger(ItemTable.class.getName()); private static Logger LOGGER_ITEMS = Logger.getLogger("item"); - public static final Map _slots = new HashMap<>(); + public static final Map SLOTS = new HashMap<>(); private L2Item[] _allTemplates; - private final Map _etcItems; - private final Map _armors; - private final Map _weapons; + private final Map _etcItems = new HashMap<>(); + private final Map _armors = new HashMap<>(); + private final Map _weapons = new HashMap<>(); static { - _slots.put("shirt", L2Item.SLOT_UNDERWEAR); - _slots.put("lbracelet", L2Item.SLOT_L_BRACELET); - _slots.put("rbracelet", L2Item.SLOT_R_BRACELET); - _slots.put("talisman", L2Item.SLOT_DECO); - _slots.put("chest", L2Item.SLOT_CHEST); - _slots.put("fullarmor", L2Item.SLOT_FULL_ARMOR); - _slots.put("head", L2Item.SLOT_HEAD); - _slots.put("hair", L2Item.SLOT_HAIR); - _slots.put("hairall", L2Item.SLOT_HAIRALL); - _slots.put("underwear", L2Item.SLOT_UNDERWEAR); - _slots.put("back", L2Item.SLOT_BACK); - _slots.put("neck", L2Item.SLOT_NECK); - _slots.put("legs", L2Item.SLOT_LEGS); - _slots.put("feet", L2Item.SLOT_FEET); - _slots.put("gloves", L2Item.SLOT_GLOVES); - _slots.put("chest,legs", L2Item.SLOT_CHEST | L2Item.SLOT_LEGS); - _slots.put("belt", L2Item.SLOT_BELT); - _slots.put("rhand", L2Item.SLOT_R_HAND); - _slots.put("lhand", L2Item.SLOT_L_HAND); - _slots.put("lrhand", L2Item.SLOT_LR_HAND); - _slots.put("rear;lear", L2Item.SLOT_R_EAR | L2Item.SLOT_L_EAR); - _slots.put("rfinger;lfinger", L2Item.SLOT_R_FINGER | L2Item.SLOT_L_FINGER); - _slots.put("wolf", L2Item.SLOT_WOLF); - _slots.put("greatwolf", L2Item.SLOT_GREATWOLF); - _slots.put("hatchling", L2Item.SLOT_HATCHLING); - _slots.put("strider", L2Item.SLOT_STRIDER); - _slots.put("babypet", L2Item.SLOT_BABYPET); - _slots.put("brooch", L2Item.SLOT_BROOCH); - _slots.put("brooch_jewel", L2Item.SLOT_BROOCH_JEWEL); - _slots.put("none", L2Item.SLOT_NONE); + SLOTS.put("shirt", L2Item.SLOT_UNDERWEAR); + SLOTS.put("lbracelet", L2Item.SLOT_L_BRACELET); + SLOTS.put("rbracelet", L2Item.SLOT_R_BRACELET); + SLOTS.put("talisman", L2Item.SLOT_DECO); + SLOTS.put("chest", L2Item.SLOT_CHEST); + SLOTS.put("fullarmor", L2Item.SLOT_FULL_ARMOR); + SLOTS.put("head", L2Item.SLOT_HEAD); + SLOTS.put("hair", L2Item.SLOT_HAIR); + SLOTS.put("hairall", L2Item.SLOT_HAIRALL); + SLOTS.put("underwear", L2Item.SLOT_UNDERWEAR); + SLOTS.put("back", L2Item.SLOT_BACK); + SLOTS.put("neck", L2Item.SLOT_NECK); + SLOTS.put("legs", L2Item.SLOT_LEGS); + SLOTS.put("feet", L2Item.SLOT_FEET); + SLOTS.put("gloves", L2Item.SLOT_GLOVES); + SLOTS.put("chest,legs", L2Item.SLOT_CHEST | L2Item.SLOT_LEGS); + SLOTS.put("belt", L2Item.SLOT_BELT); + SLOTS.put("rhand", L2Item.SLOT_R_HAND); + SLOTS.put("lhand", L2Item.SLOT_L_HAND); + SLOTS.put("lrhand", L2Item.SLOT_LR_HAND); + SLOTS.put("rear;lear", L2Item.SLOT_R_EAR | L2Item.SLOT_L_EAR); + SLOTS.put("rfinger;lfinger", L2Item.SLOT_R_FINGER | L2Item.SLOT_L_FINGER); + SLOTS.put("wolf", L2Item.SLOT_WOLF); + SLOTS.put("greatwolf", L2Item.SLOT_GREATWOLF); + SLOTS.put("hatchling", L2Item.SLOT_HATCHLING); + SLOTS.put("strider", L2Item.SLOT_STRIDER); + SLOTS.put("babypet", L2Item.SLOT_BABYPET); + SLOTS.put("brooch", L2Item.SLOT_BROOCH); + SLOTS.put("brooch_jewel", L2Item.SLOT_BROOCH_JEWEL); + SLOTS.put("none", L2Item.SLOT_NONE); // retail compatibility - _slots.put("onepiece", L2Item.SLOT_FULL_ARMOR); - _slots.put("hair2", L2Item.SLOT_HAIR2); - _slots.put("dhair", L2Item.SLOT_HAIRALL); - _slots.put("alldress", L2Item.SLOT_ALLDRESS); - _slots.put("deco1", L2Item.SLOT_DECO); - _slots.put("waist", L2Item.SLOT_BELT); + SLOTS.put("onepiece", L2Item.SLOT_FULL_ARMOR); + SLOTS.put("hair2", L2Item.SLOT_HAIR2); + SLOTS.put("dhair", L2Item.SLOT_HAIRALL); + SLOTS.put("alldress", L2Item.SLOT_ALLDRESS); + SLOTS.put("deco1", L2Item.SLOT_DECO); + SLOTS.put("waist", L2Item.SLOT_BELT); } /** @@ -119,9 +119,6 @@ public class ItemTable protected ItemTable() { - _etcItems = new HashMap<>(); - _armors = new HashMap<>(); - _weapons = new HashMap<>(); load(); } diff --git a/trunk/java/com/l2jserver/gameserver/datatables/SpawnTable.java b/trunk/java/com/l2jserver/gameserver/datatables/SpawnTable.java index 8de9a9fffb..ab85f62e8a 100644 --- a/trunk/java/com/l2jserver/gameserver/datatables/SpawnTable.java +++ b/trunk/java/com/l2jserver/gameserver/datatables/SpawnTable.java @@ -37,13 +37,13 @@ import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.data.xml.impl.NpcData; import com.l2jserver.gameserver.instancemanager.DayNightSpawnManager; import com.l2jserver.gameserver.instancemanager.ZoneManager; import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate; +import com.l2jserver.util.data.xml.IXmlReader; /** * Spawn data retriever. diff --git a/trunk/java/com/l2jserver/gameserver/engines/DocumentBase.java b/trunk/java/com/l2jserver/gameserver/engines/DocumentBase.java index 07bfcdc6f0..838089ecba 100644 --- a/trunk/java/com/l2jserver/gameserver/engines/DocumentBase.java +++ b/trunk/java/com/l2jserver/gameserver/engines/DocumentBase.java @@ -148,12 +148,11 @@ public abstract class DocumentBase protected final Logger _log = Logger.getLogger(getClass().getName()); private final File _file; - protected Map _tables; + protected final Map _tables = new HashMap<>(); protected DocumentBase(File pFile) { _file = pFile; - _tables = new HashMap<>(); } public Document parse() @@ -184,7 +183,7 @@ public abstract class DocumentBase protected void resetTable() { - _tables = new HashMap<>(); + _tables.clear(); } protected void setTable(String name, String[] table) @@ -1189,9 +1188,9 @@ public abstract class DocumentBase { int old = mask; String item = st.nextToken().trim(); - if (ItemTable._slots.containsKey(item)) + if (ItemTable.SLOTS.containsKey(item)) { - mask |= ItemTable._slots.get(item); + mask |= ItemTable.SLOTS.get(item); } if (old == mask) diff --git a/trunk/java/com/l2jserver/gameserver/engines/items/DocumentItem.java b/trunk/java/com/l2jserver/gameserver/engines/items/DocumentItem.java index 04d2c77f0c..38ee9e46d9 100644 --- a/trunk/java/com/l2jserver/gameserver/engines/items/DocumentItem.java +++ b/trunk/java/com/l2jserver/gameserver/engines/items/DocumentItem.java @@ -176,9 +176,6 @@ public final class DocumentItem extends DocumentBase } } - /** - * @return - */ public List getItemList() { return _itemsInFile; diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/BoatManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/BoatManager.java index addd5457c3..e492b8043e 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/BoatManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/BoatManager.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.instancemanager; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.Config; import com.l2jserver.gameserver.model.L2World; @@ -32,7 +32,7 @@ import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket; public class BoatManager { - private final Map _boats = new HashMap<>(); + private final Map _boats = new ConcurrentHashMap<>(); private final boolean[] _docksBusy = new boolean[3]; public static final int TALKING_ISLAND = 1; @@ -103,11 +103,12 @@ public class BoatManager npcDat.set("basePDef", 100); npcDat.set("baseMDef", 100); - L2BoatInstance boat = new L2BoatInstance(new L2CharTemplate(npcDat)); - _boats.put(boat.getObjectId(), boat); + final L2BoatInstance boat = new L2BoatInstance(new L2CharTemplate(npcDat)); boat.setHeading(heading); boat.setXYZInvisible(x, y, z); boat.spawnMe(); + + _boats.put(boat.getObjectId(), boat); return boat; } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/CHSiegeManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/CHSiegeManager.java index d5488e6918..bd61a094c1 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/CHSiegeManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/CHSiegeManager.java @@ -45,7 +45,7 @@ public final class CHSiegeManager private static final Logger _log = Logger.getLogger(CHSiegeManager.class.getName()); private static final String SQL_LOAD_HALLS = "SELECT * FROM siegable_clanhall"; - private final HashMap _siegableHalls = new HashMap<>(); + private final Map _siegableHalls = new HashMap<>(); protected CHSiegeManager() { @@ -86,7 +86,7 @@ public final class CHSiegeManager } } - public HashMap getConquerableHalls() + public Map getConquerableHalls() { return _siegableHalls; } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManager.java index 483c986ae4..b664f8d122 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManager.java @@ -42,7 +42,7 @@ public final class CastleManager implements InstanceListManager { private static final Logger _log = Logger.getLogger(CastleManager.class.getName()); - private List _castles; + private final List _castles = new ArrayList<>(); private final Map _castleSiegeDate = new ConcurrentHashMap<>(); @@ -72,9 +72,9 @@ public final class CastleManager implements InstanceListManager { double distance; Castle castle; - for (int i = 0; i < getCastles().size(); i++) + for (int i = 0; i < _castles.size(); i++) { - castle = getCastles().get(i); + castle = _castles.get(i); if (castle == null) { continue; @@ -92,7 +92,7 @@ public final class CastleManager implements InstanceListManager public final Castle getCastleById(int castleId) { - for (Castle temp : getCastles()) + for (Castle temp : _castles) { if (temp.getResidenceId() == castleId) { @@ -104,7 +104,7 @@ public final class CastleManager implements InstanceListManager public final Castle getCastleByOwner(L2Clan clan) { - for (Castle temp : getCastles()) + for (Castle temp : _castles) { if (temp.getOwnerId() == clan.getId()) { @@ -116,7 +116,7 @@ public final class CastleManager implements InstanceListManager public final Castle getCastle(String name) { - for (Castle temp : getCastles()) + for (Castle temp : _castles) { if (temp.getName().equalsIgnoreCase(name.trim())) { @@ -128,7 +128,7 @@ public final class CastleManager implements InstanceListManager public final Castle getCastle(int x, int y, int z) { - for (Castle temp : getCastles()) + for (Castle temp : _castles) { if (temp.checkIfInZone(x, y, z)) { @@ -146,9 +146,9 @@ public final class CastleManager implements InstanceListManager public final int getCastleIndex(int castleId) { Castle castle; - for (int i = 0; i < getCastles().size(); i++) + for (int i = 0; i < _castles.size(); i++) { - castle = getCastles().get(i); + castle = _castles.get(i); if ((castle != null) && (castle.getResidenceId() == castleId)) { return i; @@ -165,9 +165,9 @@ public final class CastleManager implements InstanceListManager public final int getCastleIndex(int x, int y, int z) { Castle castle; - for (int i = 0; i < getCastles().size(); i++) + for (int i = 0; i < _castles.size(); i++) { - castle = getCastles().get(i); + castle = _castles.get(i); if ((castle != null) && castle.checkIfInZone(x, y, z)) { return i; @@ -178,17 +178,13 @@ public final class CastleManager implements InstanceListManager public final List getCastles() { - if (_castles == null) - { - _castles = new ArrayList<>(); - } return _castles; } public boolean hasOwnedCastle() { boolean hasOwnedCastle = false; - for (Castle castle : getCastles()) + for (Castle castle : _castles) { if (castle.getOwnerId() > 0) { @@ -279,9 +275,9 @@ public final class CastleManager implements InstanceListManager { while (rs.next()) { - getCastles().add(new Castle(rs.getInt("id"))); + _castles.add(new Castle(rs.getInt("id"))); } - _log.info(getClass().getSimpleName() + ": Loaded: " + getCastles().size() + " castles"); + _log.info(getClass().getSimpleName() + ": Loaded: " + _castles.size() + " castles"); } catch (Exception e) { diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java index 7b5e38ea93..9d6cee8173 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/CastleManorManager.java @@ -40,7 +40,6 @@ import org.w3c.dom.Node; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.ThreadPoolManager; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.ManorMode; import com.l2jserver.gameserver.model.CropProcure; import com.l2jserver.gameserver.model.L2Clan; @@ -53,6 +52,7 @@ import com.l2jserver.gameserver.model.interfaces.IStorable; import com.l2jserver.gameserver.model.itemcontainer.ItemContainer; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.util.Rnd; +import com.l2jserver.util.data.xml.IXmlReader; /** * Castle manor system. diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/ClanHallManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/ClanHallManager.java index 5d866779a6..a2bb4671e1 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/ClanHallManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/ClanHallManager.java @@ -23,6 +23,7 @@ import java.sql.ResultSet; import java.sql.Statement; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -44,9 +45,9 @@ public final class ClanHallManager { protected static final Logger _log = Logger.getLogger(ClanHallManager.class.getName()); - private final Map _clanHall; - private final Map _freeClanHall; - private final Map _allAuctionableClanHalls; + private final Map _clanHall = new ConcurrentHashMap<>(); + private final Map _freeClanHall = new ConcurrentHashMap<>(); + private final Map _allAuctionableClanHalls = new HashMap<>(); private static Map _allClanHalls = new HashMap<>(); private boolean _loaded = false; @@ -57,9 +58,6 @@ public final class ClanHallManager protected ClanHallManager() { - _clanHall = new HashMap<>(); - _freeClanHall = new HashMap<>(); - _allAuctionableClanHalls = new HashMap<>(); load(); } @@ -216,7 +214,7 @@ public final class ClanHallManager */ public final ClanHall getClanHall(int x, int y, int z) { - for (ClanHall temp : getAllClanHalls().values()) + for (ClanHall temp : _allClanHalls.values()) { if (temp.checkIfInZone(x, y, z)) { @@ -313,4 +311,4 @@ public final class ClanHallManager { protected static final ClanHallManager _instance = new ClanHallManager(); } -} \ No newline at end of file +} diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/CoupleManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/CoupleManager.java index c8bbf78697..220dfb881f 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/CoupleManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/CoupleManager.java @@ -21,7 +21,8 @@ package com.l2jserver.gameserver.instancemanager; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; -import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -37,7 +38,7 @@ public final class CoupleManager { private static final Logger _log = Logger.getLogger(CoupleManager.class.getName()); - private ArrayList _couples; + private final List _couples = new CopyOnWriteArrayList<>(); protected CoupleManager() { @@ -46,7 +47,7 @@ public final class CoupleManager public void reload() { - getCouples().clear(); + _couples.clear(); load(); } @@ -84,15 +85,15 @@ public final class CoupleManager { if ((player1.getPartnerId() == 0) && (player2.getPartnerId() == 0)) { - int _player1id = player1.getObjectId(); - int _player2id = player2.getObjectId(); + int player1id = player1.getObjectId(); + int player2id = player2.getObjectId(); - Couple _new = new Couple(player1, player2); - getCouples().add(_new); - player1.setPartnerId(_player2id); - player2.setPartnerId(_player1id); - player1.setCoupleId(_new.getId()); - player2.setCoupleId(_new.getId()); + Couple couple = new Couple(player1, player2); + getCouples().add(couple); + player1.setPartnerId(player2id); + player2.setPartnerId(player1id); + player1.setCoupleId(couple.getId()); + player2.setCoupleId(couple.getId()); } } } @@ -138,12 +139,8 @@ public final class CoupleManager return -1; } - public final ArrayList getCouples() + public final List getCouples() { - if (_couples == null) - { - _couples = new ArrayList<>(); - } return _couples; } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/DayNightSpawnManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/DayNightSpawnManager.java index 0bb844f72e..a25558f39c 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/DayNightSpawnManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/DayNightSpawnManager.java @@ -19,9 +19,9 @@ package com.l2jserver.gameserver.instancemanager; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -38,9 +38,9 @@ public final class DayNightSpawnManager private static Logger _log = Logger.getLogger(DayNightSpawnManager.class.getName()); - private final List _dayCreatures; - private final List _nightCreatures; - private final Map _bosses; + private final List _dayCreatures = new ArrayList<>(); + private final List _nightCreatures = new ArrayList<>(); + private final Map _bosses = new ConcurrentHashMap<>(); // private static int _currentState; // 0 = Day, 1 = Night @@ -51,9 +51,7 @@ public final class DayNightSpawnManager protected DayNightSpawnManager() { - _dayCreatures = new ArrayList<>(); - _nightCreatures = new ArrayList<>(); - _bosses = new HashMap<>(); + // Prevent external initialization. } public void addDayCreature(L2Spawn spawnDat) @@ -202,7 +200,6 @@ public final class DayNightSpawnManager { boss = (L2RaidBossInstance) spawn.doSpawn(); RaidBossSpawnManager.getInstance().notifySpawnNightBoss(boss); - _bosses.remove(spawn); _bosses.put(spawn, boss); continue; } @@ -257,8 +254,6 @@ public final class DayNightSpawnManager return raidboss; } - - _bosses.put(spawnDat, null); return null; } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/FortManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/FortManager.java index ff3cac0dbc..357659e2ed 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/FortManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/FortManager.java @@ -36,7 +36,7 @@ public final class FortManager implements InstanceListManager { protected static final Logger _log = Logger.getLogger(FortManager.class.getName()); - private List _forts; + private final List _forts = new ArrayList<>(); public final int findNearestFortIndex(L2Object obj) { @@ -50,9 +50,9 @@ public final class FortManager implements InstanceListManager { double distance; Fort fort; - for (int i = 0; i < getForts().size(); i++) + for (int i = 0; i < _forts.size(); i++) { - fort = getForts().get(i); + fort = _forts.get(i); if (fort == null) { continue; @@ -70,7 +70,7 @@ public final class FortManager implements InstanceListManager public final Fort getFortById(int fortId) { - for (Fort f : getForts()) + for (Fort f : _forts) { if (f.getResidenceId() == fortId) { @@ -82,7 +82,7 @@ public final class FortManager implements InstanceListManager public final Fort getFortByOwner(L2Clan clan) { - for (Fort f : getForts()) + for (Fort f : _forts) { if (f.getOwnerClan() == clan) { @@ -94,7 +94,7 @@ public final class FortManager implements InstanceListManager public final Fort getFort(String name) { - for (Fort f : getForts()) + for (Fort f : _forts) { if (f.getName().equalsIgnoreCase(name.trim())) { @@ -106,7 +106,7 @@ public final class FortManager implements InstanceListManager public final Fort getFort(int x, int y, int z) { - for (Fort f : getForts()) + for (Fort f : _forts) { if (f.checkIfInZone(x, y, z)) { @@ -124,9 +124,9 @@ public final class FortManager implements InstanceListManager public final int getFortIndex(int fortId) { Fort fort; - for (int i = 0; i < getForts().size(); i++) + for (int i = 0; i < _forts.size(); i++) { - fort = getForts().get(i); + fort = _forts.get(i); if ((fort != null) && (fort.getResidenceId() == fortId)) { return i; @@ -143,9 +143,9 @@ public final class FortManager implements InstanceListManager public final int getFortIndex(int x, int y, int z) { Fort fort; - for (int i = 0; i < getForts().size(); i++) + for (int i = 0; i < _forts.size(); i++) { - fort = getForts().get(i); + fort = _forts.get(i); if ((fort != null) && fort.checkIfInZone(x, y, z)) { return i; @@ -156,10 +156,6 @@ public final class FortManager implements InstanceListManager public final List getForts() { - if (_forts == null) - { - _forts = new ArrayList<>(); - } return _forts; } @@ -172,11 +168,11 @@ public final class FortManager implements InstanceListManager { while (rs.next()) { - getForts().add(new Fort(rs.getInt("id"))); + _forts.add(new Fort(rs.getInt("id"))); } - _log.info(getClass().getSimpleName() + ": Loaded: " + getForts().size() + " fortress"); - for (Fort fort : getForts()) + _log.info(getClass().getSimpleName() + ": Loaded: " + _forts.size() + " fortress"); + for (Fort fort : _forts) { fort.getSiege().getSiegeGuardManager().loadSiegeGuard(); } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java index 7396b6361a..5f062f3564 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeGuardManager.java @@ -23,6 +23,8 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -35,7 +37,7 @@ public final class FortSiegeGuardManager private static final Logger _log = Logger.getLogger(FortSiegeGuardManager.class.getName()); private final Fort _fort; - private final HashMap> _siegeGuards = new HashMap<>(); + private final Map> _siegeGuards = new HashMap<>(); public FortSiegeGuardManager(Fort fort) { @@ -49,7 +51,7 @@ public final class FortSiegeGuardManager { try { - final ArrayList monsterList = getSiegeGuardSpawn().get(getFort().getResidenceId()); + final List monsterList = _siegeGuards.get(getFort().getResidenceId()); if (monsterList != null) { for (L2Spawn spawnDat : monsterList) @@ -79,8 +81,7 @@ public final class FortSiegeGuardManager { try { - final ArrayList monsterList = getSiegeGuardSpawn().get(getFort().getResidenceId()); - + final List monsterList = _siegeGuards.get(getFort().getResidenceId()); if (monsterList != null) { for (L2Spawn spawnDat : monsterList) @@ -112,7 +113,7 @@ public final class FortSiegeGuardManager ps.setInt(1, fortId); try (ResultSet rs = ps.executeQuery()) { - ArrayList siegeGuardSpawns = new ArrayList<>(); + final List siegeGuardSpawns = new ArrayList<>(); while (rs.next()) { final L2Spawn spawn = new L2Spawn(rs.getInt("npcId")); @@ -140,7 +141,7 @@ public final class FortSiegeGuardManager return _fort; } - public final HashMap> getSiegeGuardSpawn() + public final Map> getSiegeGuardSpawn() { return _siegeGuards; } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java index da3cff866e..62a541498c 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java @@ -25,10 +25,11 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Properties; import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -53,15 +54,15 @@ public final class FortSiegeManager private int _attackerMaxClans = 500; // Max number of clans // Fort Siege settings - private HashMap> _commanderSpawnList; - private HashMap> _flagList; + private Map> _commanderSpawnList; + private Map> _flagList; private boolean _justToTerritory = true; // Changeable in fortsiege.properties private int _flagMaxCount = 1; // Changeable in fortsiege.properties private int _siegeClanMinLevel = 4; // Changeable in fortsiege.properties private int _siegeLength = 60; // Time in minute. Changeable in fortsiege.properties private int _countDownLength = 10; // Time in minute. Changeable in fortsiege.properties private int _suspiciousMerchantRespawnDelay = 180; // Time in minute. Changeable in fortsiege.properties - private List _sieges; + private final List _sieges = new ArrayList<>(); protected FortSiegeManager() { @@ -137,13 +138,13 @@ public final class FortSiegeManager _suspiciousMerchantRespawnDelay = Integer.decode(siegeSettings.getProperty("SuspiciousMerchantRespawnDelay", "180")); // Siege spawns settings - _commanderSpawnList = new HashMap<>(); - _flagList = new HashMap<>(); + _commanderSpawnList = new ConcurrentHashMap<>(); + _flagList = new ConcurrentHashMap<>(); for (Fort fort : FortManager.getInstance().getForts()) { - ArrayList _commanderSpawns = new ArrayList<>(); - ArrayList _flagSpawns = new ArrayList<>(); + List commanderSpawns = new ArrayList<>(); + List flagSpawns = new ArrayList<>(); for (int i = 1; i < 5; i++) { final String _spawnParams = siegeSettings.getProperty(fort.getName().replace(" ", "") + "Commander" + i, ""); @@ -161,7 +162,7 @@ public final class FortSiegeManager int heading = Integer.parseInt(st.nextToken()); int npc_id = Integer.parseInt(st.nextToken()); - _commanderSpawns.add(new FortSiegeSpawn(fort.getResidenceId(), x, y, z, heading, npc_id, i)); + commanderSpawns.add(new FortSiegeSpawn(fort.getResidenceId(), x, y, z, heading, npc_id, i)); } catch (Exception e) { @@ -169,7 +170,7 @@ public final class FortSiegeManager } } - _commanderSpawnList.put(fort.getResidenceId(), _commanderSpawns); + _commanderSpawnList.put(fort.getResidenceId(), commanderSpawns); for (int i = 1; i < 4; i++) { @@ -187,33 +188,25 @@ public final class FortSiegeManager int z = Integer.parseInt(st.nextToken()); int flag_id = Integer.parseInt(st.nextToken()); - _flagSpawns.add(new CombatFlag(fort.getResidenceId(), x, y, z, 0, flag_id)); + flagSpawns.add(new CombatFlag(fort.getResidenceId(), x, y, z, 0, flag_id)); } catch (Exception e) { _log.warning("Error while loading flag(s) for " + fort.getName() + " fort."); } } - _flagList.put(fort.getResidenceId(), _flagSpawns); + _flagList.put(fort.getResidenceId(), flagSpawns); } } - public final ArrayList getCommanderSpawnList(int _fortId) + public final List getCommanderSpawnList(int _fortId) { - if (_commanderSpawnList.containsKey(_fortId)) - { - return _commanderSpawnList.get(_fortId); - } - return null; + return _commanderSpawnList.get(_fortId); } - public final ArrayList getFlagList(int _fortId) + public final List getFlagList(int _fortId) { - if (_flagList.containsKey(_fortId)) - { - return _flagList.get(_fortId); - } - return null; + return _flagList.get(_fortId); } public final int getAttackerMaxClans() @@ -270,19 +263,11 @@ public final class FortSiegeManager public final List getSieges() { - if (_sieges == null) - { - _sieges = new ArrayList<>(); - } return _sieges; } public final void addSiege(FortSiege fortSiege) { - if (_sieges == null) - { - _sieges = new ArrayList<>(); - } _sieges.add(fortSiege); } @@ -300,7 +285,7 @@ public final class FortSiegeManager final Fort fort = FortManager.getInstance().getFort(player); - final ArrayList fcf = _flagList.get(fort.getResidenceId()); + final List fcf = _flagList.get(fort.getResidenceId()); for (CombatFlag cf : fcf) { if (cf.getCombatFlagInstance() == item) @@ -347,9 +332,7 @@ public final class FortSiegeManager public void dropCombatFlag(L2PcInstance player, int fortId) { final Fort fort = FortManager.getInstance().getFortById(fortId); - - final ArrayList fcf = _flagList.get(fort.getResidenceId()); - + final List fcf = _flagList.get(fort.getResidenceId()); for (CombatFlag cf : fcf) { if (cf.getPlayerObjectId() == player.getObjectId()) diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java index 51dcaaa922..d44a7e6760 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java @@ -24,10 +24,12 @@ import java.sql.ResultSet; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.logging.Level; import java.util.logging.Logger; @@ -120,9 +122,9 @@ public final class FourSepulchersManager }; // @formatter:on - protected Map _archonSpawned = new HashMap<>(); - protected Map _hallInUse = new HashMap<>(); - protected Map _challengers = new HashMap<>(); + protected Map _archonSpawned = new ConcurrentHashMap<>(); + protected Map _hallInUse = new ConcurrentHashMap<>(); + protected Map _challengers = new ConcurrentHashMap<>(); protected Map _startHallSpawns = new HashMap<>(); protected Map _hallGateKeepers = new HashMap<>(); protected Map _keyBoxNpc = new HashMap<>(); @@ -143,7 +145,7 @@ public final class FourSepulchersManager protected List _managers; protected List _dukeFinalSpawns; protected List _emperorsGraveSpawns; - protected List _allMobs = new ArrayList<>(); + protected List _allMobs = new CopyOnWriteArrayList<>(); private long _attackTimeEnd = 0; private long _coolDownTimeEnd = 0; @@ -260,19 +262,15 @@ public final class FourSepulchersManager _hallInUse.put(31923, false); _hallInUse.put(31924, false); - if (_archonSpawned.size() != 0) + for (int npcId : _archonSpawned.keySet()) { - Set npcIdSet = _archonSpawned.keySet(); - for (int npcId : npcIdSet) - { - _archonSpawned.put(npcId, false); - } + _archonSpawned.put(npcId, false); } } protected void spawnManagers() { - _managers = new ArrayList<>(); + _managers = new CopyOnWriteArrayList<>(); for (int npcId = 31921; npcId <= 31924; npcId++) { @@ -972,7 +970,7 @@ public final class FourSepulchersManager if (Config.FS_PARTY_MEMBER_COUNT > 1) { - List members = new ArrayList<>(); + final List members = new LinkedList<>(); for (L2PcInstance mem : player.getParty().getMembers()) { if (!mem.isDead() && Util.checkIfInRange(700, player, mem, true)) @@ -1006,7 +1004,7 @@ public final class FourSepulchersManager } if ((Config.FS_PARTY_MEMBER_COUNT <= 1) && player.isInParty()) { - List members = new ArrayList<>(); + final List members = new LinkedList<>(); for (L2PcInstance mem : player.getParty().getMembers()) { if (!mem.isDead() && Util.checkIfInRange(700, player, mem, true)) @@ -1084,9 +1082,8 @@ public final class FourSepulchersManager return; } - List monsterList; - List mobs = new ArrayList<>(); - + final List mobs = new CopyOnWriteArrayList<>(); + final List monsterList; if (Rnd.get(2) == 0) { monsterList = _physicalMonsters.get(npcId); @@ -1366,11 +1363,6 @@ public final class FourSepulchersManager { for (L2Npc mob : _allMobs) { - if (mob == null) - { - continue; - } - try { if (mob.getSpawn() != null) diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/GrandBossManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/GrandBossManager.java index c633e8174b..439938a3ff 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/GrandBossManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/GrandBossManager.java @@ -29,6 +29,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -59,13 +61,13 @@ public final class GrandBossManager implements IStorable protected static Logger _log = Logger.getLogger(GrandBossManager.class.getName()); - protected static Map _bosses = new HashMap<>(); + protected static final Map BOSSES = new ConcurrentHashMap<>(); protected static Map _storedInfo = new HashMap<>(); private final Map _bossStatus = new HashMap<>(); - private final List _zones = new ArrayList<>(); + private final List _zones = new CopyOnWriteArrayList<>(); protected GrandBossManager() { @@ -276,13 +278,13 @@ public final class GrandBossManager implements IStorable { if (boss != null) { - _bosses.put(boss.getId(), boss); + BOSSES.put(boss.getId(), boss); } } public L2GrandBossInstance getBoss(int bossId) { - return _bosses.get(bossId); + return BOSSES.get(bossId); } public StatsSet getStatsSet(int bossId) @@ -329,7 +331,7 @@ public final class GrandBossManager implements IStorable } for (Entry e : _storedInfo.entrySet()) { - final L2GrandBossInstance boss = _bosses.get(e.getKey()); + final L2GrandBossInstance boss = BOSSES.get(e.getKey()); StatsSet info = e.getValue(); if ((boss == null) || (info == null)) { @@ -379,7 +381,7 @@ public final class GrandBossManager implements IStorable { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { - L2GrandBossInstance boss = _bosses.get(bossId); + L2GrandBossInstance boss = BOSSES.get(bossId); StatsSet info = _storedInfo.get(bossId); if (statusOnly || (boss == null) || (info == null)) @@ -428,7 +430,7 @@ public final class GrandBossManager implements IStorable { storeMe(); - _bosses.clear(); + BOSSES.clear(); _storedInfo.clear(); _bossStatus.clear(); _zones.clear(); diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/InstanceManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/InstanceManager.java index 4b77cb81b6..9147151bde 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/InstanceManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/InstanceManager.java @@ -24,28 +24,29 @@ import java.sql.ResultSet; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.L2DatabaseFactory; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.Instance; import com.l2jserver.gameserver.model.instancezone.InstanceWorld; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author evill33t, GodKratos */ public final class InstanceManager implements IXmlReader { - private static final Map _instanceList = new HashMap<>(); - private final Map _instanceWorlds = new HashMap<>(); + private static final Map INSTANCES = new ConcurrentHashMap<>(); + private final Map _instanceWorlds = new ConcurrentHashMap<>(); private int _dynamic = 300000; // InstanceId Names private static final Map _instanceIdNames = new HashMap<>(); - private final Map> _playerInstanceTimes = new HashMap<>(); + private final Map> _playerInstanceTimes = new ConcurrentHashMap<>(); // SQL Queries private static final String ADD_INSTANCE_TIME = "INSERT INTO character_instance_time (charId,instanceId,time) values (?,?,?) ON DUPLICATE KEY UPDATE time=?"; private static final String RESTORE_INSTANCE_TIMES = "SELECT instanceId,time FROM character_instance_time WHERE charId=?"; @@ -54,10 +55,10 @@ public final class InstanceManager implements IXmlReader protected InstanceManager() { // Creates the multiverse. - _instanceList.put(-1, new Instance(-1, "multiverse")); + INSTANCES.put(-1, new Instance(-1, "multiverse")); LOGGER.info(getClass().getSimpleName() + ": Multiverse Instance created."); // Creates the universe. - _instanceList.put(0, new Instance(0, "universe")); + INSTANCES.put(0, new Instance(0, "universe")); LOGGER.info(getClass().getSimpleName() + ": Universe Instance created."); load(); } @@ -166,7 +167,7 @@ public final class InstanceManager implements IXmlReader { return; // already restored } - _playerInstanceTimes.put(playerObjId, new HashMap()); + _playerInstanceTimes.put(playerObjId, new ConcurrentHashMap<>()); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement(RESTORE_INSTANCE_TIMES)) { @@ -270,18 +271,15 @@ public final class InstanceManager implements IXmlReader { return; } - final Instance temp = _instanceList.get(instanceid); + final Instance temp = INSTANCES.get(instanceid); if (temp != null) { temp.removeNpcs(); temp.removePlayers(); temp.removeDoors(); temp.cancelTimer(); - _instanceList.remove(instanceid); - if (_instanceWorlds.containsKey(instanceid)) - { - _instanceWorlds.remove(instanceid); - } + INSTANCES.remove(instanceid); + _instanceWorlds.remove(instanceid); } } @@ -291,7 +289,7 @@ public final class InstanceManager implements IXmlReader */ public Instance getInstance(int instanceid) { - return _instanceList.get(instanceid); + return INSTANCES.get(instanceid); } /** @@ -299,7 +297,7 @@ public final class InstanceManager implements IXmlReader */ public Map getInstances() { - return _instanceList; + return INSTANCES; } /** @@ -308,7 +306,7 @@ public final class InstanceManager implements IXmlReader */ public int getPlayerInstance(int objectId) { - for (Instance temp : _instanceList.values()) + for (Instance temp : INSTANCES.values()) { if (temp == null) { @@ -336,7 +334,7 @@ public final class InstanceManager implements IXmlReader } final Instance instance = new Instance(id); - _instanceList.put(id, instance); + INSTANCES.put(id, instance); return true; } @@ -353,7 +351,7 @@ public final class InstanceManager implements IXmlReader } final Instance instance = new Instance(id); - _instanceList.put(id, instance); + INSTANCES.put(id, instance); instance.loadInstanceTemplate(template); return true; } @@ -375,7 +373,7 @@ public final class InstanceManager implements IXmlReader } } final Instance instance = new Instance(_dynamic); - _instanceList.put(_dynamic, instance); + INSTANCES.put(_dynamic, instance); if (template != null) { instance.loadInstanceTemplate(template); diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/ItemsOnGroundManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/ItemsOnGroundManager.java index da4bdaf509..bddc0edffd 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/ItemsOnGroundManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/ItemsOnGroundManager.java @@ -23,8 +23,8 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -43,7 +43,7 @@ public final class ItemsOnGroundManager implements Runnable { private static final Logger _log = Logger.getLogger(ItemsOnGroundManager.class.getName()); - private final List _items = new ArrayList<>(); + private final List _items = new CopyOnWriteArrayList<>(); protected ItemsOnGroundManager() { diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java index e0bee1e412..d9d49321f4 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java @@ -27,7 +27,6 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import com.l2jserver.Config; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2MapRegion; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.Location; @@ -42,6 +41,7 @@ import com.l2jserver.gameserver.model.entity.Instance; import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall; import com.l2jserver.gameserver.model.zone.type.L2ClanHallZone; import com.l2jserver.gameserver.model.zone.type.L2RespawnZone; +import com.l2jserver.util.data.xml.IXmlReader; /** * @author Nyaran diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java index b6fe4d2ddf..ca6b57ee06 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/MercTicketManager.java @@ -21,7 +21,6 @@ package com.l2jserver.gameserver.instancemanager; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; -import java.util.Iterator; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; @@ -49,7 +48,7 @@ public final class MercTicketManager { private static final Logger _log = Logger.getLogger(MercTicketManager.class.getName()); - private static final List _droppedTickets = new CopyOnWriteArrayList<>(); + private static final List DROPPED_TICKETS = new CopyOnWriteArrayList<>(); // TODO: move all these values into siege.properties // max tickets per merc type = 10 + (castleid * 2)? @@ -139,7 +138,7 @@ public final class MercTicketManager public void reload() { - _droppedTickets.clear(); + DROPPED_TICKETS.clear(); load(); } @@ -194,7 +193,7 @@ public final class MercTicketManager dropticket.dropMe(null, x, y, z); dropticket.setDropTime(0); // avoids it from being removed by the auto item destroyer L2World.getInstance().storeObject(dropticket); - _droppedTickets.add(dropticket); + DROPPED_TICKETS.add(dropticket); } break; } @@ -203,7 +202,7 @@ public final class MercTicketManager rs.close(); s.close(); - _log.info(getClass().getSimpleName() + ": Loaded: " + _droppedTickets.size() + " Mercenary Tickets"); + _log.info(getClass().getSimpleName() + ": Loaded: " + DROPPED_TICKETS.size() + " Mercenary Tickets"); } catch (Exception e) { @@ -235,7 +234,7 @@ public final class MercTicketManager } int count = 0; - for (L2ItemInstance ticket : _droppedTickets) + for (L2ItemInstance ticket : DROPPED_TICKETS) { if ((ticket != null) && (ticket.getId() == itemId)) { @@ -268,7 +267,7 @@ public final class MercTicketManager } int count = 0; - for (L2ItemInstance ticket : _droppedTickets) + for (L2ItemInstance ticket : DROPPED_TICKETS) { if ((ticket != null) && (getTicketCastleId(ticket.getId()) == castleId)) { @@ -289,7 +288,7 @@ public final class MercTicketManager public boolean isTooCloseToAnotherTicket(int x, int y, int z) { - for (L2ItemInstance item : _droppedTickets) + for (L2ItemInstance item : DROPPED_TICKETS) { double dx = x - item.getX(); double dy = y - item.getY(); @@ -339,7 +338,7 @@ public final class MercTicketManager dropticket.setDropTime(0); // avoids it from beeing removed by the auto item destroyer L2World.getInstance().storeObject(dropticket); // add to the world // and keep track of this ticket in the list - _droppedTickets.add(dropticket); + DROPPED_TICKETS.add(dropticket); return NPC_IDS[i]; } @@ -370,15 +369,13 @@ public final class MercTicketManager */ public void deleteTickets(int castleId) { - Iterator it = _droppedTickets.iterator(); - while (it.hasNext()) + for (L2ItemInstance item : DROPPED_TICKETS) { - L2ItemInstance item = it.next(); if ((item != null) && (getTicketCastleId(item.getId()) == castleId)) { item.decayMe(); L2World.getInstance().removeObject(item); - it.remove(); + DROPPED_TICKETS.remove(item); } } } @@ -409,7 +406,7 @@ public final class MercTicketManager (new SiegeGuardManager(castle)).removeMerc(npcId, item.getX(), item.getY(), item.getZ()); } - _droppedTickets.remove(item); + DROPPED_TICKETS.remove(item); } public int[] getItemIds() @@ -419,7 +416,7 @@ public final class MercTicketManager public final List getDroppedTickets() { - return _droppedTickets; + return DROPPED_TICKETS; } /** diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossPointsManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossPointsManager.java index f34a628b0b..4e5a50679d 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossPointsManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossPointsManager.java @@ -26,8 +26,10 @@ import java.sql.Statement; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -42,7 +44,7 @@ public class RaidBossPointsManager { private static final Logger _log = Logger.getLogger(RaidBossPointsManager.class.getName()); - private HashMap> _list; + private final Map> _list = new ConcurrentHashMap<>(); public RaidBossPointsManager() { @@ -51,7 +53,6 @@ public class RaidBossPointsManager private final void init() { - _list = new HashMap<>(); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("SELECT `charId`,`boss_id`,`points` FROM `character_raid_points`")) @@ -101,8 +102,7 @@ public class RaidBossPointsManager public final int getPointsByOwnerId(int ownerId) { - Map tmpPoint; - tmpPoint = _list.get(ownerId); + Map tmpPoint = _list.get(ownerId); int totalPoints = 0; if ((tmpPoint == null) || tmpPoint.isEmpty()) @@ -148,9 +148,7 @@ public class RaidBossPointsManager public Map getRankList() { - Map tmpRanking = new HashMap<>(); - Map tmpPoints = new HashMap<>(); - + final Map tmpPoints = new HashMap<>(); for (int ownerId : _list.keySet()) { int totalPoints = getPointsByOwnerId(ownerId); @@ -159,16 +157,15 @@ public class RaidBossPointsManager tmpPoints.put(ownerId, totalPoints); } } - ArrayList> list = new ArrayList<>(tmpPoints.entrySet()); + final List> list = new ArrayList<>(tmpPoints.entrySet()); list.sort(Comparator.comparing(Entry::getValue).reversed()); - int ranking = 1; - for (Map.Entry entry : list) + final Map tmpRanking = new HashMap<>(); + for (Entry entry : list) { tmpRanking.put(entry.getKey(), ranking++); } - return tmpRanking; } diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java index ee73b658e5..7088f12aeb 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java @@ -23,8 +23,8 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Calendar; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledFuture; import java.util.logging.Level; import java.util.logging.Logger; @@ -46,10 +46,10 @@ public class RaidBossSpawnManager { private static final Logger _log = Logger.getLogger(RaidBossSpawnManager.class.getName()); - protected static final Map _bosses = new HashMap<>(); - protected static final Map _spawns = new HashMap<>(); - protected static final Map _storedInfo = new HashMap<>(); - protected static final Map> _schedules = new HashMap<>(); + protected static final Map _bosses = new ConcurrentHashMap<>(); + protected static final Map _spawns = new ConcurrentHashMap<>(); + protected static final Map _storedInfo = new ConcurrentHashMap<>(); + protected static final Map> _schedules = new ConcurrentHashMap<>(); public static enum StatusEnum { diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeGuardManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeGuardManager.java index e4488e4ceb..2a163c34d8 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeGuardManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeGuardManager.java @@ -148,7 +148,7 @@ public final class SiegeGuardManager int hiredCount = 0, hiredMax = MercTicketManager.getInstance().getMaxAllowedMerc(_castle.getResidenceId()); boolean isHired = (getCastle().getOwnerId() > 0) ? true : false; loadSiegeGuard(); - for (L2Spawn spawn : getSiegeGuardSpawn()) + for (L2Spawn spawn : _siegeGuardSpawn) { if (spawn != null) { @@ -175,7 +175,7 @@ public final class SiegeGuardManager */ public void unspawnSiegeGuard() { - for (L2Spawn spawn : getSiegeGuardSpawn()) + for (L2Spawn spawn : _siegeGuardSpawn) { if ((spawn != null) && (spawn.getLastSpawn() != null)) { @@ -184,7 +184,7 @@ public final class SiegeGuardManager } } - getSiegeGuardSpawn().clear(); + _siegeGuardSpawn.clear(); } /** diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeManager.java index bbeb930203..24dec41b6d 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/SiegeManager.java @@ -268,7 +268,7 @@ public final class SiegeManager public final List getSieges() { - ArrayList sieges = new ArrayList<>(); + List sieges = new ArrayList<>(); for (Castle castle : CastleManager.getInstance().getCastles()) { sieges.add(castle.getSiege()); diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java index 43f5bac387..caf7eb9484 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/WalkingManager.java @@ -29,7 +29,6 @@ import org.w3c.dom.Node; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.ai.CtrlIntention; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.enums.ChatType; import com.l2jserver.gameserver.instancemanager.tasks.StartMovingTask; import com.l2jserver.gameserver.model.L2NpcWalkerNode; @@ -45,6 +44,7 @@ import com.l2jserver.gameserver.model.holders.NpcRoutesHolder; import com.l2jserver.gameserver.network.NpcStringId; import com.l2jserver.gameserver.network.serverpackets.NpcSay; import com.l2jserver.gameserver.util.Broadcast; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class manages walking monsters. diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/ZoneManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/ZoneManager.java index 361f2569b6..15eee950dc 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/ZoneManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/ZoneManager.java @@ -32,7 +32,6 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import com.l2jserver.gameserver.data.xml.IXmlReader; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.L2WorldRegion; @@ -49,6 +48,7 @@ import com.l2jserver.gameserver.model.zone.type.L2ArenaZone; import com.l2jserver.gameserver.model.zone.type.L2OlympiadStadiumZone; import com.l2jserver.gameserver.model.zone.type.L2RespawnZone; import com.l2jserver.gameserver.model.zone.type.NpcSpawnTerritory; +import com.l2jserver.util.data.xml.IXmlReader; /** * This class manages the zones diff --git a/trunk/java/com/l2jserver/gameserver/model/AutoSpawnHandler.java b/trunk/java/com/l2jserver/gameserver/model/AutoSpawnHandler.java index 1619361779..137e970542 100644 --- a/trunk/java/com/l2jserver/gameserver/model/AutoSpawnHandler.java +++ b/trunk/java/com/l2jserver/gameserver/model/AutoSpawnHandler.java @@ -23,9 +23,11 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.logging.Level; @@ -65,16 +67,13 @@ public class AutoSpawnHandler private static final int DEFAULT_RESPAWN = 3600000; // 1 hour in millisecs private static final int DEFAULT_DESPAWN = 3600000; // 1 hour in millisecs - protected Map _registeredSpawns; - protected Map> _runningSpawns; + protected Map _registeredSpawns = new ConcurrentHashMap<>(); + protected Map> _runningSpawns = new ConcurrentHashMap<>(); protected boolean _activeState = true; protected AutoSpawnHandler() { - _registeredSpawns = new HashMap<>(); - _runningSpawns = new HashMap<>(); - restoreSpawnData(); } @@ -108,8 +107,8 @@ public class AutoSpawnHandler } // create clean list - _registeredSpawns = new HashMap<>(); - _runningSpawns = new HashMap<>(); + _registeredSpawns.clear(); + _runningSpawns.clear(); // load restoreSpawnData(); @@ -367,19 +366,17 @@ public class AutoSpawnHandler return null; } - public Map getAutoSpawnInstances(int npcId) + public List getAutoSpawnInstances(int npcId) { - Map spawnInstList = new HashMap<>(); - + final List result = new LinkedList<>(); for (AutoSpawnInstance spawnInst : _registeredSpawns.values()) { if (spawnInst.getId() == npcId) { - spawnInstList.put(spawnInst.getObjectId(), spawnInst); + result.add(spawnInst); } } - - return spawnInstList; + return result; } /** @@ -595,9 +592,9 @@ public class AutoSpawnHandler protected int _lastLocIndex = -1; - private final List _npcList = new ArrayList<>(); + private final List _npcList = new CopyOnWriteArrayList<>(); - private final List _locList = new ArrayList<>(); + private final List _locList = new CopyOnWriteArrayList<>(); private boolean _spawnActive; @@ -680,16 +677,14 @@ public class AutoSpawnHandler return ret; } - public L2Spawn[] getSpawns() + public List getSpawns() { - List npcSpawns = new ArrayList<>(); - + final List npcSpawns = new ArrayList<>(); for (L2Npc npcInst : _npcList) { npcSpawns.add(npcInst.getSpawn()); } - - return npcSpawns.toArray(new L2Spawn[npcSpawns.size()]); + return npcSpawns; } public void setSpawnCount(int spawnCount) diff --git a/trunk/java/com/l2jserver/gameserver/model/BlockList.java b/trunk/java/com/l2jserver/gameserver/model/BlockList.java index cb7db7de1f..62587b7d08 100644 --- a/trunk/java/com/l2jserver/gameserver/model/BlockList.java +++ b/trunk/java/com/l2jserver/gameserver/model/BlockList.java @@ -35,14 +35,10 @@ import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.network.serverpackets.friend.BlockListPacket; -/** - * This class ... - * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $ - */ public class BlockList { private static Logger _log = Logger.getLogger(BlockList.class.getName()); - private static Map> _offlineList = new HashMap<>(); + private static Map> OFFLINE_LIST = new HashMap<>(); private final L2PcInstance _owner; private HashMap _blockList; @@ -51,7 +47,7 @@ public class BlockList public BlockList(L2PcInstance owner) { _owner = owner; - _blockList = _offlineList.get(owner.getObjectId()); + _blockList = OFFLINE_LIST.get(owner.getObjectId()); if (_blockList == null) { _blockList = loadList(_owner.getObjectId()); @@ -108,7 +104,7 @@ public class BlockList public void playerLogout() { - _offlineList.put(_owner.getObjectId(), _blockList); + OFFLINE_LIST.put(_owner.getObjectId(), _blockList); } private static HashMap loadList(int ObjId) @@ -303,10 +299,10 @@ public class BlockList { return BlockList.isBlocked(player, targetId); } - if (!_offlineList.containsKey(ownerId)) + if (!OFFLINE_LIST.containsKey(ownerId)) { - _offlineList.put(ownerId, loadList(ownerId)); + OFFLINE_LIST.put(ownerId, loadList(ownerId)); } - return _offlineList.get(ownerId).containsKey(targetId); + return OFFLINE_LIST.get(ownerId).containsKey(targetId); } } diff --git a/trunk/java/com/l2jserver/gameserver/model/CharEffectList.java b/trunk/java/com/l2jserver/gameserver/model/CharEffectList.java index d2b907dc1b..2725c97514 100644 --- a/trunk/java/com/l2jserver/gameserver/model/CharEffectList.java +++ b/trunk/java/com/l2jserver/gameserver/model/CharEffectList.java @@ -23,9 +23,10 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Queue; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import java.util.function.Function; @@ -62,18 +63,18 @@ import com.l2jserver.gameserver.network.serverpackets.ShortBuffStatusUpdate; public final class CharEffectList { private static final Logger _log = Logger.getLogger(CharEffectList.class.getName()); - /** Map containing all effects from buffs for this effect list. */ - private volatile ConcurrentHashMap _buffs; - /** Map containing all triggered skills for this effect list. */ - private volatile ConcurrentHashMap _triggered; - /** Map containing all dances/songs for this effect list. */ - private volatile ConcurrentHashMap _dances; - /** Map containing all toggle for this effect list. */ - private volatile ConcurrentHashMap _toggles; - /** Map containing all debuffs for this effect list. */ - private volatile ConcurrentHashMap _debuffs; - /** They bypass most of the actions, they are not included in most operations. */ - private volatile ConcurrentHashMap _passives; + /** Queue containing all effects from buffs for this effect list. */ + private volatile Queue _buffs; + /** Queue containing all triggered skills for this effect list. */ + private volatile Queue _triggered; + /** Queue containing all dances/songs for this effect list. */ + private volatile Queue _dances; + /** Queue containing all toggle for this effect list. */ + private volatile Queue _toggles; + /** Queue containing all debuffs for this effect list. */ + private volatile Queue _debuffs; + /** Queue containing all passives for this effect list. They bypass most of the actions and they are not included in most operations. */ + private volatile Queue _passives; /** Map containing the all stacked effect in progress for each abnormal type. */ private volatile Map _stackedEffects; /** Set containing all abnormal types that shouldn't be added to this creature effect list. */ @@ -108,7 +109,7 @@ public final class CharEffectList * Gets buff skills. * @return the buff skills */ - public Map getBuffs() + public Queue getBuffs() { if (_buffs == null) { @@ -116,7 +117,7 @@ public final class CharEffectList { if (_buffs == null) { - _buffs = new ConcurrentHashMap<>(); + _buffs = new ConcurrentLinkedQueue<>(); } } } @@ -127,7 +128,7 @@ public final class CharEffectList * Gets triggered skill skills. * @return the triggered skill skills */ - public Map getTriggered() + public Queue getTriggered() { if (_triggered == null) { @@ -135,7 +136,7 @@ public final class CharEffectList { if (_triggered == null) { - _triggered = new ConcurrentHashMap<>(); + _triggered = new ConcurrentLinkedQueue<>(); } } } @@ -146,7 +147,7 @@ public final class CharEffectList * Gets dance/song skills. * @return the dance/song skills */ - public Map getDances() + public Queue getDances() { if (_dances == null) { @@ -154,7 +155,7 @@ public final class CharEffectList { if (_dances == null) { - _dances = new ConcurrentHashMap<>(); + _dances = new ConcurrentLinkedQueue<>(); } } } @@ -165,7 +166,7 @@ public final class CharEffectList * Gets toggle skills. * @return the toggle skills */ - public Map getToggles() + public Queue getToggles() { if (_toggles == null) { @@ -173,7 +174,7 @@ public final class CharEffectList { if (_toggles == null) { - _toggles = new ConcurrentHashMap<>(); + _toggles = new ConcurrentLinkedQueue<>(); } } } @@ -184,7 +185,7 @@ public final class CharEffectList * Gets debuff skills. * @return the debuff skills */ - public Map getDebuffs() + public Queue getDebuffs() { if (_debuffs == null) { @@ -192,7 +193,7 @@ public final class CharEffectList { if (_debuffs == null) { - _debuffs = new ConcurrentHashMap<>(); + _debuffs = new ConcurrentLinkedQueue<>(); } } } @@ -203,7 +204,7 @@ public final class CharEffectList * Gets passive skills. * @return the passive skills */ - public Map getPassives() + public Queue getPassives() { if (_passives == null) { @@ -211,7 +212,7 @@ public final class CharEffectList { if (_passives == null) { - _passives = new ConcurrentHashMap<>(); + _passives = new ConcurrentLinkedQueue<>(); } } } @@ -232,27 +233,27 @@ public final class CharEffectList final List buffs = new ArrayList<>(); if (hasBuffs()) { - buffs.addAll(getBuffs().values()); + buffs.addAll(getBuffs()); } if (hasTriggered()) { - buffs.addAll(getTriggered().values()); + buffs.addAll(getTriggered()); } if (hasDances()) { - buffs.addAll(getDances().values()); + buffs.addAll(getDances()); } if (hasToggles()) { - buffs.addAll(getToggles().values()); + buffs.addAll(getToggles()); } if (hasDebuffs()) { - buffs.addAll(getDebuffs().values()); + buffs.addAll(getDebuffs()); } return buffs; } @@ -262,14 +263,14 @@ public final class CharEffectList * @param skill the skill * @return the effect list */ - private Map getEffectList(Skill skill) + private Queue getEffectList(Skill skill) { if (skill == null) { return null; } - final Map effects; + final Queue effects; if (skill.isPassive()) { effects = getPassives(); @@ -308,7 +309,7 @@ public final class CharEffectList { if (hasBuffs()) { - for (BuffInfo info : getBuffs().values()) + for (BuffInfo info : getBuffs()) { if (info != null) { @@ -325,7 +326,7 @@ public final class CharEffectList if (hasTriggered()) { - for (BuffInfo info : getTriggered().values()) + for (BuffInfo info : getTriggered()) { if (info != null) { @@ -342,7 +343,7 @@ public final class CharEffectList if (hasDances()) { - for (BuffInfo info : getDances().values()) + for (BuffInfo info : getDances()) { if (info != null) { @@ -359,7 +360,7 @@ public final class CharEffectList if (hasToggles()) { - for (BuffInfo info : getToggles().values()) + for (BuffInfo info : getToggles()) { if (info != null) { @@ -376,7 +377,7 @@ public final class CharEffectList if (hasDebuffs()) { - for (BuffInfo info : getDebuffs().values()) + for (BuffInfo info : getDebuffs()) { if (info != null) { @@ -401,7 +402,7 @@ public final class CharEffectList */ public boolean isAffectedBySkill(int skillId) { - return (hasBuffs() && getBuffs().containsKey(skillId)) || (hasDebuffs() && getDebuffs().containsKey(skillId)) || (hasTriggered() && getTriggered().containsKey(skillId)) || (hasDances() && getDances().containsKey(skillId)) || (hasToggles() && getToggles().containsKey(skillId)) || (hasPassives() && getPassives().containsKey(skillId)); + return getBuffInfoBySkillId(skillId) != null; } /** @@ -413,29 +414,34 @@ public final class CharEffectList public BuffInfo getBuffInfoBySkillId(int skillId) { BuffInfo info = null; - if (hasBuffs() && getBuffs().containsKey(skillId)) + if (hasBuffs()) { - info = getBuffs().get(skillId); + info = getBuffs().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null); } - else if (hasTriggered() && getTriggered().containsKey(skillId)) + + if (hasTriggered() && (info == null)) { - info = getTriggered().get(skillId); + info = getTriggered().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null); } - else if (hasDances() && getDances().containsKey(skillId)) + + if (hasDances() && (info == null)) { - info = getDances().get(skillId); + info = getDances().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null); } - else if (hasToggles() && getToggles().containsKey(skillId)) + + if (hasToggles() && (info == null)) { - info = getToggles().get(skillId); + info = getToggles().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null); } - else if (hasDebuffs() && getDebuffs().containsKey(skillId)) + + if (hasDebuffs() && (info == null)) { - info = getDebuffs().get(skillId); + info = getDebuffs().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null); } - else if (hasPassives() && getPassives().containsKey(skillId)) + + if (hasPassives() && (info == null)) { - info = getPassives().get(skillId); + info = getPassives().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null); } return info; } @@ -463,7 +469,7 @@ public final class CharEffectList { if (_blockedBuffSlots == null) { - _blockedBuffSlots = new CopyOnWriteArraySet<>(); + _blockedBuffSlots = ConcurrentHashMap.newKeySet(blockedBuffSlots.size()); } } } @@ -535,13 +541,8 @@ public final class CharEffectList return false; } - final Map effects = getEffectList(skill); - if ((effects == null) || effects.isEmpty()) - { - return false; - } - - for (BuffInfo info : effects.values()) + final Queue effects = getEffectList(skill); + for (BuffInfo info : effects) { if ((info != null) && (info.getSkill().getAbnormalType() == type)) { @@ -604,7 +605,7 @@ public final class CharEffectList * @param info the buff info * @param effects the effect list */ - protected void stopAndRemove(BuffInfo info, Map effects) + protected void stopAndRemove(BuffInfo info, Queue effects) { stopAndRemove(true, info, effects); } @@ -615,7 +616,7 @@ public final class CharEffectList * @param info the buff info * @param buffs the buff list */ - private void stopAndRemove(boolean removed, BuffInfo info, Map buffs) + private void stopAndRemove(boolean removed, BuffInfo info, Queue buffs) { if (info == null) { @@ -623,7 +624,7 @@ public final class CharEffectList } // Removes the buff from the given effect list. - buffs.remove(info.getSkill().getId()); + buffs.remove(info); // Stop the buff effects. info.stopAllEffects(removed); // If it's a hidden buff that ends, then decrease hidden buff count. @@ -640,7 +641,7 @@ public final class CharEffectList // If it's an herb that ends, check if there are hidden buffs. if (info.getSkill().isAbnormalInstant() && hasBuffs()) { - for (BuffInfo buff : getBuffs().values()) + for (BuffInfo buff : getBuffs()) { if ((buff != null) && (buff.getSkill().getAbnormalType() == info.getSkill().getAbnormalType()) && !buff.isInUse()) { @@ -698,31 +699,31 @@ public final class CharEffectList boolean update = false; if (hasBuffs()) { - getBuffs().values().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getBuffs())); + getBuffs().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getBuffs())); update = true; } if (hasTriggered()) { - getTriggered().values().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getTriggered())); + getTriggered().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getTriggered())); update = true; } if (hasDebuffs()) { - getDebuffs().values().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getDebuffs())); + getDebuffs().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getDebuffs())); update = true; } if (hasDances()) { - getDances().values().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getDances())); + getDances().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getDances())); update = true; } if (hasToggles()) { - getToggles().values().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getToggles())); + getToggles().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getToggles())); update = true; } @@ -738,31 +739,31 @@ public final class CharEffectList boolean update = false; if (hasBuffs()) { - getBuffs().values().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getBuffs())); + getBuffs().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getBuffs())); update = true; } if (hasTriggered()) { - getTriggered().values().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getTriggered())); + getTriggered().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getTriggered())); update = true; } if (hasDebuffs()) { - getDebuffs().values().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getDebuffs())); + getDebuffs().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getDebuffs())); update = true; } if (hasDances()) { - getDances().values().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getDances())); + getDances().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getDances())); update = true; } if (hasToggles()) { - getToggles().values().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getToggles())); + getToggles().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getToggles())); update = true; } @@ -779,12 +780,12 @@ public final class CharEffectList { if (hasBuffs()) { - getBuffs().forEach((k, info) -> stopAndRemove(info, getBuffs())); + getBuffs().forEach(b -> stopAndRemove(b, getBuffs())); } if (triggered && hasTriggered()) { - getTriggered().forEach((k, info) -> stopAndRemove(info, getTriggered())); + getTriggered().forEach(b -> stopAndRemove(b, getTriggered())); } // Update effect flags and icons. @@ -808,7 +809,7 @@ public final class CharEffectList { if (hasToggles()) { - getToggles().forEach((k, info) -> stopAndRemove(info, getToggles())); + getToggles().forEach(b -> stopAndRemove(b, getToggles())); // Update effect flags and icons. updateEffectList(update); } @@ -822,7 +823,7 @@ public final class CharEffectList { if (hasDances()) { - getDances().forEach((k, info) -> stopAndRemove(info, getDances())); + getDances().forEach(b -> stopAndRemove(b, getDances())); // Update effect flags and icons. updateEffectList(update); } @@ -836,7 +837,7 @@ public final class CharEffectList { if (hasDebuffs()) { - getDebuffs().forEach((k, info) -> stopAndRemove(info, getDebuffs())); + getDebuffs().forEach(b -> stopAndRemove(b, getDebuffs())); // Update effect flags and icons. updateEffectList(update); } @@ -860,31 +861,31 @@ public final class CharEffectList if (hasBuffs()) { - getBuffs().values().stream().filter(Objects::nonNull).forEach(action); + getBuffs().stream().filter(Objects::nonNull).forEach(action); update = true; } if (hasTriggered()) { - getTriggered().values().stream().filter(Objects::nonNull).forEach(action); + getTriggered().stream().filter(Objects::nonNull).forEach(action); update = true; } if (hasDances()) { - getDances().values().stream().filter(Objects::nonNull).forEach(action); + getDances().stream().filter(Objects::nonNull).forEach(action); update = true; } if (hasToggles()) { - getToggles().values().stream().filter(Objects::nonNull).forEach(action); + getToggles().stream().filter(Objects::nonNull).forEach(action); update = true; } if (hasDebuffs()) { - getDebuffs().values().stream().filter(Objects::nonNull).forEach(action); + getDebuffs().stream().filter(Objects::nonNull).forEach(action); update = true; } @@ -908,7 +909,7 @@ public final class CharEffectList final BuffInfo info = getBuffInfoBySkillId(skillId); if (info != null) { - stopSkillEffects(removed, info.getSkill()); + remove(removed, info); } } @@ -925,15 +926,9 @@ public final class CharEffectList */ public void stopSkillEffects(boolean removed, Skill skill) { - if ((skill == null) || !isAffectedBySkill(skill.getId())) + if (skill != null) { - return; - } - - final Map effects = getEffectList(skill); - if (effects != null) - { - remove(removed, effects.get(skill.getId())); + stopSkillEffects(removed, skill.getId()); } } @@ -972,31 +967,31 @@ public final class CharEffectList boolean update = false; if (hasBuffs()) { - getBuffs().values().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getBuffs())); + getBuffs().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getBuffs())); update = true; } if (hasTriggered()) { - getTriggered().values().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getTriggered())); + getTriggered().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getTriggered())); update = true; } if (hasDebuffs()) { - getDebuffs().values().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getDebuffs())); + getDebuffs().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getDebuffs())); update = true; } if (hasDances()) { - getDances().values().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getDances())); + getDances().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getDances())); update = true; } if (hasToggles()) { - getToggles().values().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getToggles())); + getToggles().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getToggles())); update = true; } @@ -1014,25 +1009,25 @@ public final class CharEffectList { if (hasBuffs()) { - getBuffs().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getBuffs())); + getBuffs().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getBuffs())); update = true; } if (hasTriggered()) { - getTriggered().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getTriggered())); + getTriggered().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getTriggered())); update = true; } if (hasDances()) { - getDances().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDances())); + getDances().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDances())); update = true; } if (hasToggles()) { - getToggles().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getToggles())); + getToggles().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getToggles())); update = true; } } @@ -1041,7 +1036,7 @@ public final class CharEffectList { if (hasDebuffs()) { - getDebuffs().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDebuffs())); + getDebuffs().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDebuffs())); update = true; } } @@ -1144,7 +1139,7 @@ public final class CharEffectList boolean update = false; if (hasBuffs()) { - for (BuffInfo info : getBuffs().values()) + for (BuffInfo info : getBuffs()) { update |= function.apply(info); } @@ -1152,7 +1147,7 @@ public final class CharEffectList if (hasTriggered()) { - for (BuffInfo info : getTriggered().values()) + for (BuffInfo info : getTriggered()) { update |= function.apply(info); } @@ -1160,7 +1155,7 @@ public final class CharEffectList if (dances && hasDances()) { - for (BuffInfo info : getDances().values()) + for (BuffInfo info : getDances()) { update |= function.apply(info); } @@ -1168,7 +1163,7 @@ public final class CharEffectList if (hasToggles()) { - for (BuffInfo info : getToggles().values()) + for (BuffInfo info : getToggles()) { update |= function.apply(info); } @@ -1176,7 +1171,7 @@ public final class CharEffectList if (hasDebuffs()) { - for (BuffInfo info : getDebuffs().values()) + for (BuffInfo info : getDebuffs()) { update |= function.apply(info); } @@ -1192,7 +1187,7 @@ public final class CharEffectList */ public void remove(boolean removed, BuffInfo info) { - if ((info == null) || !isAffectedBySkill(info.getSkill().getId())) + if (info == null) { return; } @@ -1237,13 +1232,15 @@ public final class CharEffectList } // Puts the effects in the list. - final BuffInfo infoToRemove = getPassives().put(skill.getId(), info); - if (infoToRemove != null) + getPassives().stream().filter(b -> b.getSkill().getId() == skill.getId()).forEach(b -> { // Removes the old stats from the creature if the skill was present. - infoToRemove.setInUse(false); - infoToRemove.removeStats(); - } + b.setInUse(false); + b.removeStats(); + getPassives().remove(b); + }); + + getPassives().add(info); // Initialize effects. info.initializeEffects(); @@ -1323,7 +1320,7 @@ public final class CharEffectList } // Select the map that holds the effects related to this skill. - final Map effects = getEffectList(skill); + final Queue effects = getEffectList(skill); // Remove first buff when buff list is full. if (!skill.isDebuff() && !skill.isToggle() && !skill.is7Signs() && !doesStack(skill)) { @@ -1341,7 +1338,7 @@ public final class CharEffectList buffsToRemove = getBuffCount() - _owner.getStat().getMaxBuffCount(); } - for (BuffInfo bi : effects.values()) + for (BuffInfo bi : effects) { if (buffsToRemove < 0) { @@ -1361,7 +1358,7 @@ public final class CharEffectList // After removing old buff (same ID) or stacked buff (same abnormal type), // Add the buff to the end of the effect list. - effects.put(skill.getId(), info); + effects.add(info); // Initialize effects. info.initializeEffects(); // Update effect flags and icons. @@ -1423,7 +1420,7 @@ public final class CharEffectList // Buffs. if (hasBuffs()) { - for (BuffInfo info : getBuffs().values()) + for (BuffInfo info : getBuffs()) { if (info.getSkill().isHealingPotionSkill()) { @@ -1439,7 +1436,7 @@ public final class CharEffectList // Triggered buffs. if (hasTriggered()) { - for (BuffInfo info : getTriggered().values()) + for (BuffInfo info : getTriggered()) { addIcon(info, asu, ps, psSummon, os, isSummon); } @@ -1448,7 +1445,7 @@ public final class CharEffectList // Songs and dances. if (hasDances()) { - for (BuffInfo info : getDances().values()) + for (BuffInfo info : getDances()) { addIcon(info, asu, ps, psSummon, os, isSummon); } @@ -1457,7 +1454,7 @@ public final class CharEffectList // Songs and dances. if (hasToggles()) { - for (BuffInfo info : getToggles().values()) + for (BuffInfo info : getToggles()) { addIcon(info, asu, ps, psSummon, os, isSummon); } @@ -1466,7 +1463,7 @@ public final class CharEffectList // Debuffs. if (hasDebuffs()) { - for (BuffInfo info : getDebuffs().values()) + for (BuffInfo info : getDebuffs()) { addIcon(info, asu, ps, psSummon, os, isSummon); } @@ -1583,7 +1580,7 @@ public final class CharEffectList { if (hasBuffs()) { - for (BuffInfo info : getBuffs().values()) + for (BuffInfo info : getBuffs()) { if (info == null) { @@ -1604,7 +1601,7 @@ public final class CharEffectList if (hasTriggered()) { - for (BuffInfo info : getTriggered().values()) + for (BuffInfo info : getTriggered()) { if (info == null) { @@ -1625,7 +1622,7 @@ public final class CharEffectList if (hasToggles()) { - for (BuffInfo info : getToggles().values()) + for (BuffInfo info : getToggles()) { if (info == null) { @@ -1646,7 +1643,7 @@ public final class CharEffectList if (hasDebuffs()) { - for (BuffInfo info : getDebuffs().values()) + for (BuffInfo info : getDebuffs()) { if ((info != null) && info.getSkill().isRemovedOnDamage()) { @@ -1665,7 +1662,7 @@ public final class CharEffectList int flags = 0; if (hasBuffs()) { - for (BuffInfo info : getBuffs().values()) + for (BuffInfo info : getBuffs()) { if (info != null) { @@ -1679,7 +1676,7 @@ public final class CharEffectList if (hasTriggered()) { - for (BuffInfo info : getTriggered().values()) + for (BuffInfo info : getTriggered()) { if (info != null) { @@ -1693,7 +1690,7 @@ public final class CharEffectList if (hasDebuffs()) { - for (BuffInfo info : getDebuffs().values()) + for (BuffInfo info : getDebuffs()) { if (info != null) { @@ -1707,7 +1704,7 @@ public final class CharEffectList if (hasDances()) { - for (BuffInfo info : getDances().values()) + for (BuffInfo info : getDances()) { if (info != null) { @@ -1721,7 +1718,7 @@ public final class CharEffectList if (hasToggles()) { - for (BuffInfo info : getToggles().values()) + for (BuffInfo info : getToggles()) { if (info != null) { diff --git a/trunk/java/com/l2jserver/gameserver/model/L2Clan.java b/trunk/java/com/l2jserver/gameserver/model/L2Clan.java index 6fe36b6394..2a09464ea7 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2Clan.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2Clan.java @@ -25,8 +25,11 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.logging.Logger; @@ -109,7 +112,7 @@ public class L2Clan implements IIdentifiable, INamable private String _name; private int _clanId; private L2ClanMember _leader; - private final Map _members = new HashMap<>(); + private final Map _members = new ConcurrentHashMap<>(); private String _allyName; private int _allyId; @@ -130,16 +133,16 @@ public class L2Clan implements IIdentifiable, INamable private int _bloodOathCount; private final ItemContainer _warehouse = new ClanWarehouse(this); - private final List _atWarWith = new ArrayList<>(); - private final List _atWarAttackers = new ArrayList<>(); + private final List _atWarWith = new CopyOnWriteArrayList<>(); + private final List _atWarAttackers = new CopyOnWriteArrayList<>(); private Forum _forum; - /** HashMap(Integer, L2Skill) containing all skills of the L2Clan */ - private final Map _skills = new HashMap<>(); - private final Map _privs = new HashMap<>(); - private final Map _subPledges = new HashMap<>(); - private final Map _subPledgeSkills = new HashMap<>(); + /** Map(Integer, L2Skill) containing all skills of the L2Clan */ + private final Map _skills = new ConcurrentHashMap<>(); + private final Map _privs = new ConcurrentHashMap<>(); + private final Map _subPledges = new ConcurrentHashMap<>(); + private final Map _subPledgeSkills = new ConcurrentHashMap<>(); private int _reputationScore = 0; private int _rank = 0; @@ -609,9 +612,9 @@ public class L2Clan implements IIdentifiable, INamable * @param exclude the object Id to exclude from list. * @return all online members excluding the one with object id {code exclude}. */ - public ArrayList getOnlineMembers(int exclude) + public List getOnlineMembers(int exclude) { - final ArrayList onlineMembers = new ArrayList<>(); + final List onlineMembers = new ArrayList<>(); for (L2ClanMember temp : _members.values()) { if ((temp != null) && temp.isOnline() && (temp.getObjectId() != exclude)) @@ -1596,59 +1599,32 @@ public class L2Clan implements IIdentifiable, INamable public boolean isAtWarWith(Integer id) { - if (!_atWarWith.isEmpty()) - { - if (_atWarWith.contains(id)) - { - return true; - } - } - return false; + return _atWarWith.contains(id); } public boolean isAtWarWith(L2Clan clan) { - if (clan == null) - { - return false; - } - if (!_atWarWith.isEmpty()) - { - if (_atWarWith.contains(clan.getId())) - { - return true; - } - } - return false; + return _atWarWith.contains(clan.getId()); } - public boolean isAtWarAttacker(Integer id) + public boolean isAtWarAttacker(int id) { - if ((_atWarAttackers != null) && !_atWarAttackers.isEmpty()) - { - if (_atWarAttackers.contains(id)) - { - return true; - } - } - return false; + return _atWarAttackers.contains(id); } public void setEnemyClan(L2Clan clan) { - Integer id = clan.getId(); - _atWarWith.add(id); + _atWarWith.add(clan.getId()); } - public void setEnemyClan(Integer clan) + public void setEnemyClan(int id) { - _atWarWith.add(clan); + _atWarWith.add(id); } public void setAttackerClan(L2Clan clan) { - Integer id = clan.getId(); - _atWarAttackers.add(id); + _atWarAttackers.add(clan.getId()); } public void setAttackerClan(Integer clan) @@ -1658,14 +1634,12 @@ public class L2Clan implements IIdentifiable, INamable public void deleteEnemyClan(L2Clan clan) { - Integer id = clan.getId(); - _atWarWith.remove(id); + _atWarWith.remove(clan.getId()); } public void deleteAttackerClan(L2Clan clan) { - Integer id = clan.getId(); - _atWarAttackers.remove(id); + _atWarAttackers.remove(clan.getId()); } public int getHiredGuards() @@ -1680,11 +1654,7 @@ public class L2Clan implements IIdentifiable, INamable public boolean isAtWar() { - if ((_atWarWith != null) && !_atWarWith.isEmpty()) - { - return true; - } - return false; + return (_atWarWith != null) && !_atWarWith.isEmpty(); } public List getWarList() @@ -1871,11 +1841,6 @@ public class L2Clan implements IIdentifiable, INamable */ public final SubPledge[] getAllSubPledges() { - if (_subPledges == null) - { - return new SubPledge[0]; - } - return _subPledges.values().toArray(new SubPledge[_subPledges.values().size()]); } @@ -2036,11 +2001,9 @@ public class L2Clan implements IIdentifiable, INamable public void initializePrivs() { - RankPrivs privs; for (int i = 1; i < 10; i++) { - privs = new RankPrivs(i, 0, new EnumIntBitmask<>(ClanPrivilege.class, false)); - _privs.put(i, privs); + _privs.put(i, new RankPrivs(i, 0, new EnumIntBitmask<>(ClanPrivilege.class, false))); } } @@ -2988,9 +2951,9 @@ public class L2Clan implements IIdentifiable, INamable return false; } - public SubPledgeSkill[] getAllSubSkills() + public List getAllSubSkills() { - final ArrayList list = new ArrayList<>(); + final List list = new LinkedList<>(); for (Skill skill : _subPledgeSkills.values()) { list.add(new SubPledgeSkill(0, skill.getId(), skill.getLevel())); @@ -3002,7 +2965,7 @@ public class L2Clan implements IIdentifiable, INamable list.add(new SubPledgeSkill(subunit.getId(), skill.getId(), skill.getLevel())); } } - return list.toArray(new SubPledgeSkill[list.size()]); + return list; } public void setNewLeaderId(int objectId, boolean storeInDb) diff --git a/trunk/java/com/l2jserver/gameserver/model/L2CommandChannel.java b/trunk/java/com/l2jserver/gameserver/model/L2CommandChannel.java index 63aad7996b..d4af459d57 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2CommandChannel.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2CommandChannel.java @@ -18,6 +18,7 @@ */ package com.l2jserver.gameserver.model; +import java.util.LinkedList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.function.Function; @@ -37,8 +38,8 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage; */ public class L2CommandChannel extends AbstractPlayerGroup { - private final List _parties; - private L2PcInstance _commandLeader = null; + private final List _parties = new CopyOnWriteArrayList<>(); + private L2PcInstance _commandLeader; private int _channelLvl; /** @@ -49,7 +50,6 @@ public class L2CommandChannel extends AbstractPlayerGroup { _commandLeader = leader; L2Party party = leader.getParty(); - _parties = new CopyOnWriteArrayList<>(); _parties.add(party); _channelLvl = party.getLevel(); party.setCommandChannel(this); @@ -163,7 +163,7 @@ public class L2CommandChannel extends AbstractPlayerGroup @Override public List getMembers() { - List members = new CopyOnWriteArrayList<>(); + final List members = new LinkedList<>(); for (L2Party party : getPartys()) { members.addAll(party.getMembers()); diff --git a/trunk/java/com/l2jserver/gameserver/model/L2ContactList.java b/trunk/java/com/l2jserver/gameserver/model/L2ContactList.java index 6d7429bcd2..033a3230fa 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2ContactList.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2ContactList.java @@ -43,7 +43,7 @@ public class L2ContactList { private final Logger _log = Logger.getLogger(getClass().getName()); private final L2PcInstance activeChar; - private final List _contacts; + private final List _contacts = new CopyOnWriteArrayList<>(); private static final String QUERY_ADD = "INSERT INTO character_contacts (charId, contactId) VALUES (?, ?)"; private static final String QUERY_REMOVE = "DELETE FROM character_contacts WHERE charId = ? and contactId = ?"; @@ -52,7 +52,6 @@ public class L2ContactList public L2ContactList(L2PcInstance player) { activeChar = player; - _contacts = new CopyOnWriteArrayList<>(); restore(); } diff --git a/trunk/java/com/l2jserver/gameserver/model/L2Object.java b/trunk/java/com/l2jserver/gameserver/model/L2Object.java index d97a9082f9..182eb2c278 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2Object.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2Object.java @@ -525,7 +525,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab { if (_scripts == null) { - // Double-checked locking synchronized (this) { if (_scripts == null) diff --git a/trunk/java/com/l2jserver/gameserver/model/L2Party.java b/trunk/java/com/l2jserver/gameserver/model/L2Party.java index 357f3fcd5e..281ebbdc43 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2Party.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2Party.java @@ -21,9 +21,9 @@ package com.l2jserver.gameserver.model; import java.time.Duration; import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.NoSuchElementException; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; @@ -83,7 +83,7 @@ public class L2Party extends AbstractPlayerGroup private static final Duration PARTY_POSITION_BROADCAST_INTERVAL = Duration.ofSeconds(12); private static final Duration PARTY_DISTRIBUTION_TYPE_REQUEST_TIMEOUT = Duration.ofSeconds(15); - private final List _members; + private final List _members = new CopyOnWriteArrayList<>(); private boolean _pendingInvitation = false; private long _pendingInviteTimeout; private int _partyLvl = 0; @@ -116,7 +116,6 @@ public class L2Party extends AbstractPlayerGroup */ public L2Party(L2PcInstance leader, PartyDistributionType partyDistributionType) { - _members = new CopyOnWriteArrayList<>(); _members.add(leader); _partyLvl = leader.getLevel(); _distributionType = partyDistributionType; @@ -768,33 +767,26 @@ public class L2Party extends AbstractPlayerGroup */ public void distributeAdena(L2PcInstance player, long adena, L2Character target) { - // Get all the party members - final List membersList = getMembers(); - // Check the number of party members that must be rewarded // (The party member must be in range to receive its reward) - final List ToReward = new ArrayList<>(); - for (L2PcInstance member : membersList) + final List toReward = new LinkedList<>(); + for (L2PcInstance member : getMembers()) { - if (!Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true)) + if (Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true)) { - continue; + toReward.add(member); } - ToReward.add(member); } - // Avoid null exceptions, if any - if (ToReward.isEmpty()) + if (!toReward.isEmpty()) { - return; - } - - // Now we can actually distribute the adena reward - // (Total adena splitted by the number of party members that are in range and must be rewarded) - final long count = adena / ToReward.size(); - for (L2PcInstance member : ToReward) - { - member.addAdena("Party", count, player, true); + // Now we can actually distribute the adena reward + // (Total adena splitted by the number of party members that are in range and must be rewarded) + long count = adena / toReward.size(); + for (L2PcInstance member : toReward) + { + member.addAdena("Party", count, player, true); + } } } @@ -1044,14 +1036,7 @@ public class L2Party extends AbstractPlayerGroup @Override public L2PcInstance getLeader() { - try - { - return _members.get(0); - } - catch (NoSuchElementException e) - { - return null; - } + return _members.get(0); } public synchronized void requestLootChange(PartyDistributionType partyDistributionType) diff --git a/trunk/java/com/l2jserver/gameserver/model/L2Radar.java b/trunk/java/com/l2jserver/gameserver/model/L2Radar.java index 0f6a7d2060..02d080449f 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2Radar.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2Radar.java @@ -18,7 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.serverpackets.RadarControl; @@ -29,12 +30,11 @@ import com.l2jserver.gameserver.network.serverpackets.RadarControl; public final class L2Radar { private final L2PcInstance _player; - private final ArrayList _markers; + private final List _markers = new CopyOnWriteArrayList<>(); public L2Radar(L2PcInstance player) { _player = player; - _markers = new ArrayList<>(); } // Add a marker to player's radar diff --git a/trunk/java/com/l2jserver/gameserver/model/L2SiegeClan.java b/trunk/java/com/l2jserver/gameserver/model/L2SiegeClan.java index 53ad3c957a..1aa52bf16b 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2SiegeClan.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2SiegeClan.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import com.l2jserver.gameserver.enums.SiegeClanType; import com.l2jserver.gameserver.model.actor.L2Npc; @@ -27,8 +27,7 @@ import com.l2jserver.gameserver.model.actor.L2Npc; public class L2SiegeClan { private int _clanId = 0; - private List _flag = new ArrayList<>(); - private int _numFlagsAdded = 0; + private final List _flag = new CopyOnWriteArrayList<>(); private SiegeClanType _type; public L2SiegeClan(int clanId, SiegeClanType type) @@ -39,43 +38,25 @@ public class L2SiegeClan public int getNumFlags() { - return _numFlagsAdded; + return _flag.size(); } public void addFlag(L2Npc flag) { - _numFlagsAdded++; - getFlag().add(flag); + _flag.add(flag); } public boolean removeFlag(L2Npc flag) { - if (flag == null) - { - return false; - } - boolean ret = getFlag().remove(flag); - // check if null objects or duplicates remain in the list. - // for some reason, this might be happening sometimes... - // delete false duplicates: if this flag got deleted, delete its copies too. - if (ret) - { - while (getFlag().remove(flag)) - { - // - } - } + boolean ret = _flag.remove(flag); flag.deleteMe(); - _numFlagsAdded--; return ret; } public void removeFlags() { - for (L2Npc flag : getFlag()) - { - removeFlag(flag); - } + _flag.forEach(f -> f.decayMe()); + _flag.clear(); } public final int getClanId() @@ -85,10 +66,6 @@ public class L2SiegeClan public final List getFlag() { - if (_flag == null) - { - _flag = new ArrayList<>(); - } return _flag; } diff --git a/trunk/java/com/l2jserver/gameserver/model/L2Spawn.java b/trunk/java/com/l2jserver/gameserver/model/L2Spawn.java index 16d555b35e..95c2ae6090 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2Spawn.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2Spawn.java @@ -19,10 +19,12 @@ package com.l2jserver.gameserver.model; import java.lang.reflect.Constructor; -import java.util.ArrayList; +import java.util.Deque; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedDeque; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -79,9 +81,8 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable private boolean _doRespawn; /** If true then spawn is custom */ private boolean _customSpawn; - private static List _spawnListeners = new ArrayList<>(); - private final ArrayList _spawnedNpcs = new ArrayList<>(); - private L2Npc _lastSpawn; + private static List _spawnListeners = new CopyOnWriteArrayList<>(); + private final Deque _spawnedNpcs = new ConcurrentLinkedDeque<>(); private Map _lastSpawnPoints; private boolean _isNoRndWalk = false; // Is no random walk @@ -688,7 +689,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable notifyNpcSpawned(mob); _spawnedNpcs.add(mob); - _lastSpawn = mob; if (_lastSpawnPoints != null) { _lastSpawnPoints.put(mob.getObjectId(), new Location(newlocx, newlocy, newlocz)); @@ -705,28 +705,19 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public static void addSpawnListener(SpawnListener listener) { - synchronized (_spawnListeners) - { - _spawnListeners.add(listener); - } + _spawnListeners.add(listener); } public static void removeSpawnListener(SpawnListener listener) { - synchronized (_spawnListeners) - { - _spawnListeners.remove(listener); - } + _spawnListeners.remove(listener); } public static void notifyNpcSpawned(L2Npc npc) { - synchronized (_spawnListeners) + for (SpawnListener listener : _spawnListeners) { - for (SpawnListener listener : _spawnListeners) - { - listener.npcSpawned(npc); - } + listener.npcSpawned(npc); } } @@ -791,10 +782,10 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable public L2Npc getLastSpawn() { - return _lastSpawn; + return _spawnedNpcs.peekLast(); } - public final ArrayList getSpawnedNpcs() + public final Deque getSpawnedNpcs() { return _spawnedNpcs; } diff --git a/trunk/java/com/l2jserver/gameserver/model/L2Territory.java b/trunk/java/com/l2jserver/gameserver/model/L2Territory.java index f1522488d2..5b576697bf 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2Territory.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2Territory.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Logger; import com.l2jserver.util.Rnd; @@ -46,7 +46,7 @@ public class L2Territory } } - private final List _points; + private final List _points = new CopyOnWriteArrayList<>(); private final int _terr; private int _xMin; private int _xMax; @@ -58,7 +58,6 @@ public class L2Territory public L2Territory(int terr) { - _points = new ArrayList<>(); _terr = terr; _xMin = 999999; _xMax = -999999; @@ -99,14 +98,6 @@ public class L2Territory _procMax += proc; } - public void print() - { - for (Point p : _points) - { - _log.info("(" + p._x + "," + p._y + ")"); - } - } - public boolean isIntersect(int x, int y, Point p1, Point p2) { double dy1 = p1._y - y; diff --git a/trunk/java/com/l2jserver/gameserver/model/L2World.java b/trunk/java/com/l2jserver/gameserver/model/L2World.java index 3116e94959..b4531cc118 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2World.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2World.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -446,15 +447,12 @@ public final class L2World return null; } - // Create an ArrayList in order to contain all visible L2Object - List result = new ArrayList<>(); - - // Go through the ArrayList of region + // Create a list in order to contain all visible objects. + final List result = new LinkedList<>(); for (L2WorldRegion regi : reg.getSurroundingRegions()) { // Go through visible objects of the selected region - Collection vObj = regi.getVisibleObjects().values(); - for (L2Object _object : vObj) + for (L2Object _object : regi.getVisibleObjects().values()) { if ((_object == null) || _object.equals(object)) { @@ -488,15 +486,12 @@ public final class L2World final int sqRadius = radius * radius; - // Create an ArrayList in order to contain all visible L2Object - List result = new ArrayList<>(); - - // Go through the ArrayList of region + // Create a list in order to contain all visible objects. + final List result = new LinkedList<>(); for (L2WorldRegion regi : object.getWorldRegion().getSurroundingRegions()) { // Go through visible objects of the selected region - Collection vObj = regi.getVisibleObjects().values(); - for (L2Object _object : vObj) + for (L2Object _object : regi.getVisibleObjects().values()) { if ((_object == null) || _object.equals(object)) { @@ -529,14 +524,11 @@ public final class L2World final int sqRadius = radius * radius; - // Create an ArrayList in order to contain all visible L2Object - List result = new ArrayList<>(); - - // Go through visible object of the selected region + // Create a list in order to contain all visible objects. + final List result = new LinkedList<>(); for (L2WorldRegion regi : object.getWorldRegion().getSurroundingRegions()) { - Collection vObj = regi.getVisibleObjects().values(); - for (L2Object _object : vObj) + for (L2Object _object : regi.getVisibleObjects().values()) { if ((_object == null) || _object.equals(object)) { @@ -567,10 +559,8 @@ public final class L2World return null; } - // Create an ArrayList in order to contain all visible L2Object - List result = new ArrayList<>(); - - // Go through the ArrayList of region + // Create a list in order to contain all visible objects. + final List result = new LinkedList<>(); for (L2WorldRegion regi : reg.getSurroundingRegions()) { // Create an Iterator to go through the visible L2Object of the L2WorldRegion diff --git a/trunk/java/com/l2jserver/gameserver/model/L2WorldRegion.java b/trunk/java/com/l2jserver/gameserver/model/L2WorldRegion.java index 27743bd6fa..d66f11318e 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2WorldRegion.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2WorldRegion.java @@ -18,11 +18,12 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.logging.Logger; @@ -43,29 +44,24 @@ public final class L2WorldRegion private static final Logger _log = Logger.getLogger(L2WorldRegion.class.getName()); /** Map containing all playable characters in game in this world region. */ - private final Map _allPlayable; + private final Map _allPlayable = new ConcurrentHashMap<>(); /** Map containing visible objects in this world region. */ - private final Map _visibleObjects; + private final Map _visibleObjects = new ConcurrentHashMap<>(); - private final List _surroundingRegions; + private final Queue _surroundingRegions = new ConcurrentLinkedQueue<>(); private final int _tileX, _tileY; private boolean _active = false; private ScheduledFuture _neighborsTask = null; - private final List _zones; + private final List _zones = new CopyOnWriteArrayList<>(); public L2WorldRegion(int pTileX, int pTileY) { - _allPlayable = new ConcurrentHashMap<>(); - _visibleObjects = new ConcurrentHashMap<>(); - _surroundingRegions = new ArrayList<>(); - _tileX = pTileX; _tileY = pTileY; // default a newly initialized region to inactive, unless always on is specified _active = Config.GRIDS_ALWAYS_ON; - _zones = new ArrayList<>(); } public List getZones() @@ -233,8 +229,7 @@ public final class L2WorldRegion int c = 0; if (!isOn) { - Collection vObj = _visibleObjects.values(); - for (L2Object o : vObj) + for (L2Object o : _visibleObjects.values()) { if (o instanceof L2Attackable) { @@ -272,9 +267,7 @@ public final class L2WorldRegion } else { - Collection vObj = _visibleObjects.values(); - - for (L2Object o : vObj) + for (L2Object o : _visibleObjects.values()) { if (o instanceof L2Attackable) { @@ -454,9 +447,9 @@ public final class L2WorldRegion } /** - * @return the ArrayList _surroundingRegions containing all L2WorldRegion around the current L2WorldRegion + * @return the list containing all L2WorldRegion around the current world region */ - public List getSurroundingRegions() + public Queue getSurroundingRegions() { return _surroundingRegions; } @@ -482,8 +475,7 @@ public final class L2WorldRegion public void deleteVisibleNpcSpawns() { _log.fine("Deleting all visible NPC's in Region: " + getName()); - Collection vNPC = _visibleObjects.values(); - for (L2Object obj : vNPC) + for (L2Object obj : _visibleObjects.values()) { if (obj instanceof L2Npc) { diff --git a/trunk/java/com/l2jserver/gameserver/model/MobGroup.java b/trunk/java/com/l2jserver/gameserver/model/MobGroup.java index 99688271ce..5b4186b49c 100644 --- a/trunk/java/com/l2jserver/gameserver/model/MobGroup.java +++ b/trunk/java/com/l2jserver/gameserver/model/MobGroup.java @@ -18,8 +18,9 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.ai.L2ControllableMobAI; @@ -67,7 +68,7 @@ public final class MobGroup { if (_mobs == null) { - _mobs = new ArrayList<>(); + _mobs = new CopyOnWriteArrayList<>(); } return _mobs; @@ -369,8 +370,7 @@ public final class MobGroup protected void removeDead() { - List deadMobs = new ArrayList<>(); - + List deadMobs = new LinkedList<>(); for (L2ControllableMobInstance mobInst : getMobs()) { if ((mobInst != null) && mobInst.isDead()) diff --git a/trunk/java/com/l2jserver/gameserver/model/MobGroupTable.java b/trunk/java/com/l2jserver/gameserver/model/MobGroupTable.java index ad4675bd48..bfafa0c5ec 100644 --- a/trunk/java/com/l2jserver/gameserver/model/MobGroupTable.java +++ b/trunk/java/com/l2jserver/gameserver/model/MobGroupTable.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.gameserver.model.actor.instance.L2ControllableMobInstance; @@ -35,7 +35,7 @@ public class MobGroupTable protected MobGroupTable() { - _groupMap = new HashMap<>(); + _groupMap = new ConcurrentHashMap<>(); } public static MobGroupTable getInstance() diff --git a/trunk/java/com/l2jserver/gameserver/model/PartyMatchRoomList.java b/trunk/java/com/l2jserver/gameserver/model/PartyMatchRoomList.java index 284ff492a3..04f84ed23f 100644 --- a/trunk/java/com/l2jserver/gameserver/model/PartyMatchRoomList.java +++ b/trunk/java/com/l2jserver/gameserver/model/PartyMatchRoomList.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.SystemMessageId; @@ -35,7 +35,7 @@ public class PartyMatchRoomList protected PartyMatchRoomList() { - _rooms = new HashMap<>(); + _rooms = new ConcurrentHashMap<>(); } public synchronized void addPartyMatchRoom(int id, PartyMatchRoom room) @@ -122,4 +122,4 @@ public class PartyMatchRoomList { protected static final PartyMatchRoomList _instance = new PartyMatchRoomList(); } -} +} \ No newline at end of file diff --git a/trunk/java/com/l2jserver/gameserver/model/PartyMatchWaitingList.java b/trunk/java/com/l2jserver/gameserver/model/PartyMatchWaitingList.java index 507e5138e6..488938a697 100644 --- a/trunk/java/com/l2jserver/gameserver/model/PartyMatchWaitingList.java +++ b/trunk/java/com/l2jserver/gameserver/model/PartyMatchWaitingList.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -32,7 +32,7 @@ public class PartyMatchWaitingList protected PartyMatchWaitingList() { - _members = new ArrayList<>(); + _members = new CopyOnWriteArrayList<>(); } public void addPlayer(L2PcInstance player) diff --git a/trunk/java/com/l2jserver/gameserver/model/Petition.java b/trunk/java/com/l2jserver/gameserver/model/Petition.java index 3d8cc1a33b..d7587c5544 100644 --- a/trunk/java/com/l2jserver/gameserver/model/Petition.java +++ b/trunk/java/com/l2jserver/gameserver/model/Petition.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import com.l2jserver.gameserver.enums.PetitionState; import com.l2jserver.gameserver.enums.PetitionType; @@ -43,7 +43,7 @@ public final class Petition private final PetitionType _type; private PetitionState _state = PetitionState.PENDING; private final String _content; - private final List _messageLog = new ArrayList<>(); + private final List _messageLog = new CopyOnWriteArrayList<>(); private final L2PcInstance _petitioner; private L2PcInstance _responder; diff --git a/trunk/java/com/l2jserver/gameserver/model/StatsSet.java b/trunk/java/com/l2jserver/gameserver/model/StatsSet.java index ae66c45291..afb7f178c8 100644 --- a/trunk/java/com/l2jserver/gameserver/model/StatsSet.java +++ b/trunk/java/com/l2jserver/gameserver/model/StatsSet.java @@ -21,7 +21,7 @@ package com.l2jserver.gameserver.model; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; @@ -47,7 +47,7 @@ public class StatsSet implements IParserAdvUtils public StatsSet() { - this(new HashMap()); + this(new LinkedHashMap<>()); } public StatsSet(Map map) diff --git a/trunk/java/com/l2jserver/gameserver/model/TradeList.java b/trunk/java/com/l2jserver/gameserver/model/TradeList.java index d8167a4c3b..3e42f7c4f7 100644 --- a/trunk/java/com/l2jserver/gameserver/model/TradeList.java +++ b/trunk/java/com/l2jserver/gameserver/model/TradeList.java @@ -20,9 +20,10 @@ package com.l2jserver.gameserver.model; import static com.l2jserver.gameserver.model.itemcontainer.Inventory.MAX_ADENA; -import java.util.ArrayList; -import java.util.HashSet; +import java.util.LinkedList; import java.util.List; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Logger; import com.l2jserver.Config; @@ -49,7 +50,7 @@ public class TradeList private final L2PcInstance _owner; private L2PcInstance _partner; - private final List _items; + private final List _items = new CopyOnWriteArrayList<>(); private String _title; private boolean _packaged; @@ -58,7 +59,6 @@ public class TradeList public TradeList(L2PcInstance owner) { - _items = new ArrayList<>(); _owner = owner; } @@ -120,9 +120,9 @@ public class TradeList * @param inventory * @return L2ItemInstance : items in inventory */ - public TradeItem[] getAvailableItems(PcInventory inventory) + public List getAvailableItems(PcInventory inventory) { - final ArrayList list = new ArrayList<>(); + final List list = new LinkedList<>(); for (TradeItem item : _items) { int el[] = new int[6]; @@ -134,7 +134,7 @@ public class TradeList inventory.adjustAvailableItem(item); list.add(item); } - return list.toArray(new TradeItem[list.size()]); + return list; } /** @@ -682,7 +682,7 @@ public class TradeList * @param items * @return int: result of trading. 0 - ok, 1 - canceled (no adena), 2 - failed (item error) */ - public synchronized int privateStoreBuy(L2PcInstance player, HashSet items) + public synchronized int privateStoreBuy(L2PcInstance player, Set items) { if (_locked) { diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/L2Attackable.java b/trunk/java/com/l2jserver/gameserver/model/actor/L2Attackable.java index 5863743254..5cda5c74a2 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/L2Attackable.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/L2Attackable.java @@ -109,6 +109,7 @@ public class L2Attackable extends L2Npc private final Map _absorbersList = new ConcurrentHashMap<>(); // Misc private boolean _mustGiveExpSp; + protected int _onKillDelay = 5000; /** * Creates an attackable NPC. @@ -347,7 +348,7 @@ public class L2Attackable extends L2Npc if ((killer != null) && killer.isPlayable()) { // Delayed notification - EventDispatcher.getInstance().notifyEventAsync(new OnAttackableKill(killer.getActingPlayer(), this, killer.isSummon()), this); + EventDispatcher.getInstance().notifyEventAsyncDelayed(new OnAttackableKill(killer.getActingPlayer(), this, killer.isSummon()), this, _onKillDelay); } // Notify to minions if there are. @@ -1547,6 +1548,20 @@ public class L2Attackable extends L2Npc return _seeded; } + /** + * Set delay for onKill() call, in ms Default: 5000 ms + * @param delay + */ + public final void setOnKillDelay(int delay) + { + _onKillDelay = delay; + } + + public final int getOnKillDelay() + { + return _onKillDelay; + } + /** * Check if the server allows Random Animation. */ diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java b/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java index fd530fb093..b2d2f3ce02 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java @@ -2715,7 +2715,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { if (_attackByList == null) { - _attackByList = new HashSet<>(); + _attackByList = ConcurrentHashMap.newKeySet(); } } } @@ -3178,7 +3178,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe */ public void resetCurrentAbnormalVisualEffects() { - final Collection passives = getEffectList().hasPassives() ? new ArrayList<>(getEffectList().getPassives().values()) : null; + final Collection passives = getEffectList().hasPassives() ? new ArrayList<>(getEffectList().getPassives()) : null; //@formatter:off final Set abnormalVisualEffects = Stream.concat(getEffectList().getEffects().stream(), passives != null ? passives.stream() : Stream.empty()) .filter(Objects::nonNull) @@ -5530,7 +5530,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe int _skiprange = 0; int _skipgeo = 0; int _skippeace = 0; - List targetList = new ArrayList<>(targets.length); + final List targetList = new ArrayList<>(); for (L2Object target : targets) { if (target instanceof L2Character) @@ -5564,7 +5564,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } } } - targetList.add((L2Character) target); + targetList.add(target); } } if (targetList.isEmpty()) diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java b/trunk/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java index b109da9f23..fd2858cb84 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/L2Vehicle.java @@ -18,10 +18,9 @@ */ package com.l2jserver.gameserver.model.actor; -import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import com.l2jserver.Config; @@ -53,7 +52,7 @@ import com.l2jserver.gameserver.util.Util; public abstract class L2Vehicle extends L2Character { protected int _dockId = 0; - protected final ArrayList _passengers = new ArrayList<>(); + protected final List _passengers = new CopyOnWriteArrayList<>(); protected Location _oustLoc = null; private Runnable _engine = null; @@ -231,19 +230,8 @@ public abstract class L2Vehicle extends L2Character public void oustPlayers() { - L2PcInstance player; - - // Use iterator because oustPlayer will try to remove player from _passengers - final Iterator iter = _passengers.iterator(); - while (iter.hasNext()) - { - player = iter.next(); - iter.remove(); - if (player != null) - { - oustPlayer(player); - } - } + _passengers.forEach(p -> oustPlayer(p)); + _passengers.clear(); } public void oustPlayer(L2PcInstance player) @@ -509,6 +497,11 @@ public abstract class L2Vehicle extends L2Character return false; } + @Override + public void detachAI() + { + } + @Override public boolean isVehicle() { diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2AuctioneerInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2AuctioneerInstance.java index 8ba3b21cab..b1f67a6dfb 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2AuctioneerInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2AuctioneerInstance.java @@ -22,10 +22,10 @@ import static com.l2jserver.gameserver.model.itemcontainer.Inventory.MAX_ADENA; import java.text.SimpleDateFormat; import java.util.Calendar; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; import com.l2jserver.Config; import com.l2jserver.gameserver.enums.InstanceType; @@ -46,7 +46,7 @@ public final class L2AuctioneerInstance extends L2Npc private static final int COND_BUSY_BECAUSE_OF_SIEGE = 1; private static final int COND_REGULAR = 3; - private final Map _pendingAuctions = new HashMap<>(); + private final Map _pendingAuctions = new ConcurrentHashMap<>(); public L2AuctioneerInstance(L2NpcTemplate template) { diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ControlTowerInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ControlTowerInstance.java index f52eca1c8c..d5f340fc7a 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ControlTowerInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ControlTowerInstance.java @@ -18,8 +18,8 @@ */ package com.l2jserver.gameserver.model.actor.instance; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import com.l2jserver.gameserver.enums.InstanceType; @@ -56,10 +56,6 @@ public class L2ControlTowerInstance extends L2Tower { for (L2Spawn spawn : _guards) { - if (spawn == null) - { - continue; - } try { spawn.stopRespawn(); @@ -89,7 +85,7 @@ public class L2ControlTowerInstance extends L2Tower { if (_guards == null) { - _guards = new ArrayList<>(); + _guards = new CopyOnWriteArrayList<>(); } } } diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java index 6ac4fa7a8b..ae0b92ac8c 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2DoorInstance.java @@ -20,6 +20,7 @@ package com.l2jserver.gameserver.model.actor.instance; import java.util.ArrayList; import java.util.Collection; +import java.util.List; import java.util.Set; import java.util.concurrent.Future; import java.util.logging.Level; @@ -574,19 +575,16 @@ public class L2DoorInstance extends L2Character return getTemplate().getNodeZ() + getTemplate().getHeight(); } - public Collection getKnownDefenders() + public List getKnownDefenders() { - ArrayList result = new ArrayList<>(); - - Collection objs = getKnownList().getKnownObjects().values(); - for (L2Object obj : objs) + final List result = new ArrayList<>(); + for (L2Object obj : getKnownList().getKnownObjects().values()) { if (obj instanceof L2DefenderInstance) { result.add((L2DefenderInstance) obj); } } - return result; } diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java index f40434dec7..79e2428636 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2FortCommanderInstance.java @@ -18,7 +18,7 @@ */ package com.l2jserver.gameserver.model.actor.instance; -import java.util.ArrayList; +import java.util.List; import com.l2jserver.Config; import com.l2jserver.gameserver.ThreadPoolManager; @@ -127,7 +127,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance L2Spawn spawn = getSpawn(); if ((spawn != null) && canTalk()) { - ArrayList commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getResidenceId()); + List commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getResidenceId()); for (FortSiegeSpawn spawn2 : commanders) { if (spawn2.getId() == spawn.getId()) diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java index 3942ffc420..39663b4c05 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java @@ -478,7 +478,7 @@ public final class L2PcInstance extends L2Playable private int _bookmarkslot = 0; // The Teleport Bookmark Slot - private final Map _tpbookmarks = new HashMap<>(); + private final Map _tpbookmarks = new ConcurrentHashMap<>(); private boolean _canFeed; private boolean _isInSiege; @@ -519,11 +519,11 @@ public final class L2PcInstance extends L2Playable private Transform _transformation; /** The table containing all L2RecipeList of the L2PcInstance */ - private final Map _dwarvenRecipeBook = new HashMap<>(); - private final Map _commonRecipeBook = new HashMap<>(); + private final Map _dwarvenRecipeBook = new ConcurrentHashMap<>(); + private final Map _commonRecipeBook = new ConcurrentHashMap<>(); /** Premium Items */ - private final Map _premiumItems = new HashMap<>(); + private final Map _premiumItems = new ConcurrentHashMap<>(); /** True if the L2PcInstance is sitting */ private boolean _waitTypeSitting; @@ -581,7 +581,7 @@ public final class L2PcInstance extends L2Playable private int _questNpcObject = 0; /** The table containing all Quests began by the L2PcInstance */ - private final Map _quests = new HashMap<>(); + private final Map _quests = new ConcurrentHashMap<>(); /** The list containing all shortCuts of this player. */ private final ShortCuts _shortCuts = new ShortCuts(this); @@ -589,8 +589,8 @@ public final class L2PcInstance extends L2Playable /** The list containing all macros of this player. */ private final MacroList _macros = new MacroList(this); - private final List _snoopListener = new ArrayList<>(); - private final List _snoopedPlayer = new ArrayList<>(); + private final Set _snoopListener = ConcurrentHashMap.newKeySet(1); + private final Set _snoopedPlayer = ConcurrentHashMap.newKeySet(1); // hennas private final L2Henna[] _henna = new L2Henna[3]; @@ -710,7 +710,7 @@ public final class L2PcInstance extends L2Playable /** The fists L2Weapon of the L2PcInstance (used when no weapon is equipped) */ private L2Weapon _fistsWeaponItem; - private final Map _chars = new HashMap<>(); + private final Map _chars = new LinkedHashMap<>(); // private byte _updateKnownCounter = 0; @@ -733,9 +733,9 @@ public final class L2PcInstance extends L2Playable protected boolean _inventoryDisable = false; /** Player's cubics. */ - private final Map _cubics = new ConcurrentSkipListMap<>(); + private final Map _cubics = new ConcurrentSkipListMap<>(); // TODO(Zoey76): This should be sorted in insert order. /** Active shots. */ - protected Set _activeSoulShots = ConcurrentHashMap.newKeySet(); + protected Set _activeSoulShots = ConcurrentHashMap.newKeySet(1); public final ReentrantLock soulShotLock = new ReentrantLock(); @@ -1535,7 +1535,7 @@ public final class L2PcInstance extends L2Playable { if (_notifyQuestOfDeathList == null) { - _notifyQuestOfDeathList = new ArrayList<>(); + _notifyQuestOfDeathList = new CopyOnWriteArrayList<>(); } } } @@ -5924,7 +5924,7 @@ public final class L2PcInstance extends L2Playable { if (_tamedBeast == null) { - _tamedBeast = new ArrayList<>(); + _tamedBeast = new CopyOnWriteArrayList<>(); } _tamedBeast.add(tamedBeast); } @@ -6875,8 +6875,7 @@ public final class L2PcInstance extends L2Playable su.addAttribute(StatusUpdate.KARMA, getKarma()); sendPacket(su); - final Collection plrs = getKnownList().getKnownPlayers().values(); - for (L2PcInstance player : plrs) + for (L2PcInstance player : getKnownList().getKnownPlayers().values()) { if ((player == null) || !isVisibleFor(player)) { @@ -8537,7 +8536,7 @@ public final class L2PcInstance extends L2Playable } // is AutoAttackable if both players are in the same duel and the duel is still going on - if (attacker.isPlayer() && (getDuelState() == Duel.DUELSTATE_DUELLING) && (getDuelId() == ((L2PcInstance) attacker).getDuelId())) + if (attacker.isPlayable() && (getDuelState() == Duel.DUELSTATE_DUELLING) && (getDuelId() == attacker.getActingPlayer().getDuelId())) { return true; } @@ -10491,7 +10490,7 @@ public final class L2PcInstance extends L2Playable { if (_subClasses == null) { - _subClasses = new HashMap<>(); + _subClasses = new ConcurrentSkipListMap<>(); } return _subClasses; @@ -11229,10 +11228,7 @@ public final class L2PcInstance extends L2Playable public void addSnooper(L2PcInstance pci) { - if (!_snoopListener.contains(pci)) - { _snoopListener.add(pci); - } } public void removeSnooper(L2PcInstance pci) @@ -11242,10 +11238,7 @@ public final class L2PcInstance extends L2Playable public void addSnooped(L2PcInstance pci) { - if (!_snoopedPlayer.contains(pci)) - { _snoopedPlayer.add(pci); - } } public void removeSnooped(L2PcInstance pci) @@ -13569,9 +13562,7 @@ public final class L2PcInstance extends L2Playable return (int) time; } - /** - * list of character friends - */ + /** Friend list. */ private final HashMap _friendList = new HashMap<>(); private final ArrayList _updateMemos = new ArrayList<>(); diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java index f527d58101..a9ca5d8d09 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PetInstance.java @@ -23,6 +23,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedList; import java.util.List; import java.util.concurrent.Future; import java.util.logging.Level; @@ -1024,7 +1025,7 @@ public class L2PetInstance extends L2Summon int buff_index = 0; - final List storedSkills = new ArrayList<>(); + final List storedSkills = new LinkedList<>(); // Store all effect data along with calculated remaining if (storeEffects) @@ -1068,11 +1069,7 @@ public class L2PetInstance extends L2Summon ps2.setInt(5, ++buff_index); ps2.execute(); - if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId())) - { - SummonEffectsTable.getInstance().getPetEffects().put(getControlObjectId(), new ArrayList()); - } - + SummonEffectsTable.getInstance().getPetEffects().putIfAbsent(getControlObjectId(), new ArrayList<>()); SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, info.getTime())); } } @@ -1109,7 +1106,7 @@ public class L2PetInstance extends L2Summon { if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId())) { - SummonEffectsTable.getInstance().getPetEffects().put(getControlObjectId(), new ArrayList()); + SummonEffectsTable.getInstance().getPetEffects().put(getControlObjectId(), new ArrayList<>()); } SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, effectCurTime)); diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2RaceManagerInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2RaceManagerInstance.java index bf08d7f63d..6ac34008a5 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2RaceManagerInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2RaceManagerInstance.java @@ -46,7 +46,6 @@ public class L2RaceManagerInstance extends L2Npc public static final int LANES = 8; public static final int WINDOW_START = 0; - // private static List _history; private static List _managers; protected static int _raceNumber = 4; @@ -104,7 +103,6 @@ public class L2RaceManagerInstance extends L2Npc { _notInitialized = false; - // _history = new ArrayList<>(); _managers = new ArrayList<>(); ThreadPoolManager s = ThreadPoolManager.getInstance(); @@ -128,7 +126,6 @@ public class L2RaceManagerInstance extends L2Npc s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (58 * SECOND), 10 * MINUTE); s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THE_RACE_WILL_BEGIN_IN_S1_SECOND_S), (8 * MINUTE) + (59 * SECOND), 10 * MINUTE); s.scheduleGeneralAtFixedRate(new Announcement(SystemMessageId.THEY_RE_OFF), 9 * MINUTE, 10 * MINUTE); - // */ } _managers.add(this); } diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ServitorInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ServitorInstance.java index 3b7b46e211..2806eae2d6 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ServitorInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2ServitorInstance.java @@ -21,11 +21,12 @@ package com.l2jserver.gameserver.model.actor.instance; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; -import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; @@ -292,7 +293,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable int buff_index = 0; - final List storedSkills = new ArrayList<>(); + final List storedSkills = new LinkedList<>(); // Store all effect data along with calculated remaining if (storeEffects) @@ -351,7 +352,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable } if (!SummonEffectsTable.getInstance().getServitorEffects(getOwner()).containsKey(getReferenceSkill())) { - SummonEffectsTable.getInstance().getServitorEffects(getOwner()).put(getReferenceSkill(), new ArrayList()); + SummonEffectsTable.getInstance().getServitorEffects(getOwner()).put(getReferenceSkill(), new CopyOnWriteArrayList()); } SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, info.getTime())); @@ -407,7 +408,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable } if (!SummonEffectsTable.getInstance().getServitorEffects(getOwner()).containsKey(getReferenceSkill())) { - SummonEffectsTable.getInstance().getServitorEffects(getOwner()).put(getReferenceSkill(), new ArrayList()); + SummonEffectsTable.getInstance().getServitorEffects(getOwner()).put(getReferenceSkill(), new CopyOnWriteArrayList()); } SummonEffectsTable.getInstance().getServitorEffects(getOwner()).get(getReferenceSkill()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, effectCurTime)); diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2TamedBeastInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2TamedBeastInstance.java index cf9d96a68b..1583927d79 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2TamedBeastInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2TamedBeastInstance.java @@ -20,8 +20,8 @@ package com.l2jserver.gameserver.model.actor.instance; import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE; -import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import com.l2jserver.gameserver.ThreadPoolManager; @@ -204,7 +204,7 @@ public final class L2TamedBeastInstance extends L2FeedableBeastInstance { if (_beastSkills == null) { - _beastSkills = new ArrayList<>(); + _beastSkills = new CopyOnWriteArrayList<>(); } _beastSkills.add(skill); } diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/knownlist/CharKnownList.java b/trunk/java/com/l2jserver/gameserver/model/actor/knownlist/CharKnownList.java index 3368dfac37..ffe18cd134 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/knownlist/CharKnownList.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/knownlist/CharKnownList.java @@ -21,6 +21,7 @@ package com.l2jserver.gameserver.model.actor.knownlist; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -204,10 +205,9 @@ public class CharKnownList extends ObjectKnownList return (L2Character) super.getActiveObject(); } - public Collection getKnownCharacters() + public List getKnownCharacters() { - ArrayList result = new ArrayList<>(); - + List result = new LinkedList<>(); final Collection objs = getKnownObjects().values(); for (L2Object obj : objs) { diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/status/CharStatus.java b/trunk/java/com/l2jserver/gameserver/model/actor/status/CharStatus.java index 2849bb95cd..6ba3efaafd 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/status/CharStatus.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/status/CharStatus.java @@ -19,7 +19,7 @@ package com.l2jserver.gameserver.model.actor.status; import java.util.Set; -import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; @@ -42,7 +42,7 @@ public class CharStatus private double _currentMp = 0; // Current MP of the L2Character /** Array containing all clients that need to be notified about hp/mp updates of the L2Character */ - private Set _StatusListener; + private Set _statusListener; private Future _regTask; @@ -106,11 +106,11 @@ public class CharStatus */ public final Set getStatusListener() { - if (_StatusListener == null) + if (_statusListener == null) { - _StatusListener = new CopyOnWriteArraySet<>(); + _statusListener = ConcurrentHashMap.newKeySet(); } - return _StatusListener; + return _statusListener; } // place holder, only PcStatus has CP diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/tasks/cubics/CubicAction.java b/trunk/java/com/l2jserver/gameserver/model/actor/tasks/cubics/CubicAction.java index a5fa723da1..9e466f418c 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/tasks/cubics/CubicAction.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/tasks/cubics/CubicAction.java @@ -100,7 +100,7 @@ public final class CubicAction implements Runnable boolean useCubicCure = false; if ((_cubic.getId() >= L2CubicInstance.SMART_CUBIC_EVATEMPLAR) && (_cubic.getId() <= L2CubicInstance.SMART_CUBIC_SPECTRALMASTER)) { - for (BuffInfo info : _cubic.getOwner().getEffectList().getDebuffs().values()) + for (BuffInfo info : _cubic.getOwner().getEffectList().getDebuffs()) { if (info.getSkill().canBeDispeled()) { diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/Auction.java b/trunk/java/com/l2jserver/gameserver/model/entity/Auction.java index 21e227e710..382b2a5f51 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/Auction.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/Auction.java @@ -25,8 +25,8 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Calendar; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -61,7 +61,7 @@ public class Auction private long _currentBid = 0; private long _startingBid = 0; - private final Map _bidders = new HashMap<>(); + private final Map _bidders = new ConcurrentHashMap<>(); private static final String[] ItemTypeName = { @@ -333,7 +333,7 @@ public class Auction { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { - if (getBidders().get(bidder.getClanId()) != null) + if (_bidders.get(bidder.getClanId()) != null) { try (PreparedStatement statement = con.prepareStatement("UPDATE auction_bid SET bidderId=?, bidderName=?, maxBid=?, time_bid=? WHERE auctionId=? AND bidderId=?")) { diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java b/trunk/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java index e135068228..5281e11818 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java @@ -18,9 +18,11 @@ */ package com.l2jserver.gameserver.model.entity; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.logging.Level; import java.util.logging.Logger; @@ -61,15 +63,15 @@ public final class BlockCheckerEngine // The object which holds all basic members info protected ArenaParticipantsHolder _holder; // Maps to hold player of each team and his points - protected HashMap _redTeamPoints = new HashMap<>(); - protected HashMap _blueTeamPoints = new HashMap<>(); + protected Map _redTeamPoints = new ConcurrentHashMap<>(); + protected Map _blueTeamPoints = new ConcurrentHashMap<>(); // The initial points of the event protected int _redPoints = 15; protected int _bluePoints = 15; // Current used arena protected int _arena = -1; // All blocks - protected ArrayList _spawns = new ArrayList<>(); + protected List _spawns = new CopyOnWriteArrayList<>(); // Sets if the red team won the event at the end of this (used for packets) protected boolean _isRedWinner; // Time when the event starts. Used on packet sending @@ -118,7 +120,7 @@ public final class BlockCheckerEngine // Common z coordinate private static final int _zCoord = -2405; // List of dropped items in event (for later deletion) - protected ArrayList _drops = new ArrayList<>(); + protected List _drops = new CopyOnWriteArrayList<>(); // Default arena private static final byte DEFAULT_ARENA = -1; // Event is started @@ -597,12 +599,6 @@ public final class BlockCheckerEngine for (L2ItemInstance item : _drops) { - // npe - if (item == null) - { - continue; - } - // a player has it, it will be deleted later if (!item.isVisible() || (item.getOwnerId() != 0)) { @@ -651,12 +647,12 @@ public final class BlockCheckerEngine } /** - * Reward the speicifed team as a winner team 1) Higher score - 8 extra 2) Higher score - 5 extra + * Reward the specified team as a winner team 1) Higher score - 8 extra 2) Higher score - 5 extra * @param isRed */ private void rewardAsWinner(boolean isRed) { - HashMap tempPoints = isRed ? _redTeamPoints : _blueTeamPoints; + Map tempPoints = isRed ? _redTeamPoints : _blueTeamPoints; // Main give for (Entry points : tempPoints.entrySet()) @@ -713,7 +709,7 @@ public final class BlockCheckerEngine */ private void rewardAsLooser(boolean isRed) { - HashMap tempPoints = isRed ? _redTeamPoints : _blueTeamPoints; + Map tempPoints = isRed ? _redTeamPoints : _blueTeamPoints; for (Entry entry : tempPoints.entrySet()) { @@ -726,7 +722,7 @@ public final class BlockCheckerEngine } /** - * Telport players back, give status back and send final packet + * Teleport players back, give status back and send final packet */ private void setPlayersBack() { diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/Castle.java b/trunk/java/com/l2jserver/gameserver/model/entity/Castle.java index ba6640e173..021ae556bd 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/Castle.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/Castle.java @@ -23,10 +23,10 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.Calendar; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -243,7 +243,7 @@ public final class Castle extends AbstractResidence { super(castleId); load(); - _function = new HashMap<>(); + _function = new ConcurrentHashMap<>(); initResidenceZone(); spawnSideNpcs(); if (getOwnerId() != 0) @@ -260,11 +260,7 @@ public final class Castle extends AbstractResidence */ public CastleFunction getFunction(int type) { - if (_function.containsKey(type)) - { - return _function.get(type); - } - return null; + return _function.get(type); } public synchronized void engrave(L2Clan clan, L2Object target, CastleSide side) diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/ClanHall.java b/trunk/java/com/l2jserver/gameserver/model/entity/ClanHall.java index 1fcf683bb0..554bbd02da 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/ClanHall.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/ClanHall.java @@ -22,8 +22,8 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -212,7 +212,7 @@ public abstract class ClanHall _ownerId = set.getInt("ownerId"); _desc = set.getString("desc"); _location = set.getString("location"); - _functions = new HashMap<>(); + _functions = new ConcurrentHashMap<>(); if (_ownerId > 0) { @@ -306,11 +306,7 @@ public abstract class ClanHall */ public ClanHallFunction getFunction(int type) { - if (_functions.get(type) != null) - { - return _functions.get(type); - } - return null; + return _functions.get(type); } /** diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/Duel.java b/trunk/java/com/l2jserver/gameserver/model/entity/Duel.java index 4f49ddca4c..cfc8c5421f 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/Duel.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/Duel.java @@ -18,7 +18,6 @@ */ package com.l2jserver.gameserver.model.entity; -import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @@ -108,7 +107,7 @@ public class Duel private double _cp; private boolean _paDuel; private int _x, _y, _z; - private ArrayList _debuffs; + private List _debuffs; public PlayerCondition(L2PcInstance player, boolean partyDuel) { @@ -160,7 +159,7 @@ public class Duel { if (_debuffs == null) { - _debuffs = new ArrayList<>(); + _debuffs = new CopyOnWriteArrayList<>(); } _debuffs.add(debuff); diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/Fort.java b/trunk/java/com/l2jserver/gameserver/model/entity/Fort.java index 745d42c3e5..86d1540cb8 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/Fort.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/Fort.java @@ -28,6 +28,8 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.logging.Level; @@ -76,14 +78,14 @@ public final class Fort extends AbstractResidence private int _state = 0; private int _castleId = 0; private int _supplyLvL = 0; - private final HashMap _function; + private final Map _function; private final ScheduledFuture[] _FortUpdater = new ScheduledFuture[2]; // Spawn Data private boolean _isSuspiciousMerchantSpawned = false; - private final ArrayList _siegeNpcs = new ArrayList<>(); - private final ArrayList _npcCommanders = new ArrayList<>(); - private final ArrayList _specialEnvoys = new ArrayList<>(); + private final List _siegeNpcs = new CopyOnWriteArrayList<>(); + private final List _npcCommanders = new CopyOnWriteArrayList<>(); + private final List _specialEnvoys = new CopyOnWriteArrayList<>(); private final Map _envoyCastles = new HashMap<>(2); private final Set _availableCastles = new HashSet<>(1); @@ -242,7 +244,7 @@ public final class Fort extends AbstractResidence super(fortId); load(); loadFlagPoles(); - _function = new HashMap<>(); + _function = new ConcurrentHashMap<>(); if (getOwnerClan() != null) { setVisibleFlag(true); @@ -268,11 +270,7 @@ public final class Fort extends AbstractResidence */ public FortFunction getFunction(int type) { - if (_function.get(type) != null) - { - return _function.get(type); - } - return null; + return _function.get(type); } public void endOfSiege(L2Clan clan) diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/FortSiege.java b/trunk/java/com/l2jserver/gameserver/model/entity/FortSiege.java index 60cbbeec60..6fe3b8f167 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/FortSiege.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/FortSiege.java @@ -21,9 +21,10 @@ package com.l2jserver.gameserver.model.entity; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; -import java.util.ArrayList; import java.util.Calendar; +import java.util.LinkedList; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ScheduledFuture; import java.util.logging.Level; import java.util.logging.Logger; @@ -224,10 +225,10 @@ public class FortSiege implements Siegable } } - private final List _attackerClans = new ArrayList<>(); + private final List _attackerClans = new CopyOnWriteArrayList<>(); // Fort setting - protected ArrayList _commanders = new ArrayList<>(); + protected List _commanders = new CopyOnWriteArrayList<>(); protected final Fort _fort; private boolean _isInProgress = false; private FortSiegeGuardManager _siegeGuardManager; @@ -364,10 +365,7 @@ public class FortSiege implements Siegable clan = ClanTable.getInstance().getClan(siegeclan.getClanId()); for (L2PcInstance member : clan.getOnlineMembers(0)) { - if (member != null) - { - member.sendPacket(sm); - } + member.sendPacket(sm); } } if (getFort().getOwnerClan() != null) @@ -397,11 +395,6 @@ public class FortSiege implements Siegable clan = ClanTable.getInstance().getClan(siegeclan.getClanId()); for (L2PcInstance member : clan.getOnlineMembers(0)) { - if (member == null) - { - continue; - } - if (clear) { member.setSiegeState((byte) 0); @@ -550,18 +543,12 @@ public class FortSiege implements Siegable @Override public List getAttackersInZone() { - List players = new ArrayList<>(); - L2Clan clan; + final List players = new LinkedList<>(); for (L2SiegeClan siegeclan : getAttackerClans()) { - clan = ClanTable.getInstance().getClan(siegeclan.getClanId()); + L2Clan clan = ClanTable.getInstance().getClan(siegeclan.getClanId()); for (L2PcInstance player : clan.getOnlineMembers(0)) { - if (player == null) - { - continue; - } - if (player.isInSiege()) { players.add(player); @@ -584,11 +571,10 @@ public class FortSiege implements Siegable */ public List getOwnersInZone() { - List players = new ArrayList<>(); - L2Clan clan; + final List players = new LinkedList<>(); if (getFort().getOwnerClan() != null) { - clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId()); + L2Clan clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId()); if (clan != getFort().getOwnerClan()) { return null; @@ -596,11 +582,6 @@ public class FortSiege implements Siegable for (L2PcInstance player : clan.getOnlineMembers(0)) { - if (player == null) - { - continue; - } - if (player.isInSiege()) { players.add(player); @@ -617,12 +598,12 @@ public class FortSiege implements Siegable */ public void killedCommander(L2FortCommanderInstance instance) { - if ((_commanders != null) && (getFort() != null) && (_commanders.size() != 0)) + if (!_commanders.isEmpty() && (getFort() != null)) { L2Spawn spawn = instance.getSpawn(); if (spawn != null) { - ArrayList commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getResidenceId()); + List commanders = FortSiegeManager.getInstance().getCommanderSpawnList(getFort().getResidenceId()); for (FortSiegeSpawn spawn2 : commanders) { if (spawn2.getId() == spawn.getId()) diff --git a/trunk/java/com/l2jserver/gameserver/model/entity/Hero.java b/trunk/java/com/l2jserver/gameserver/model/entity/Hero.java index 673f1752d2..4cc54d8751 100644 --- a/trunk/java/com/l2jserver/gameserver/model/entity/Hero.java +++ b/trunk/java/com/l2jserver/gameserver/model/entity/Hero.java @@ -28,11 +28,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.logging.Level; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Logger; import com.l2jserver.Config; @@ -76,14 +75,14 @@ public class Hero // delete hero items private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)"; - private static final Map _heroes = new HashMap<>(); - private static final Map _completeHeroes = new HashMap<>(); + private static final Map HEROES = new ConcurrentHashMap<>(); + private static final Map COMPLETE_HEROS = new ConcurrentHashMap<>(); - private static final Map _herocounts = new HashMap<>(); - private static final Map> _herofights = new HashMap<>(); + private static final Map HERO_COUNTS = new ConcurrentHashMap<>(); + private static final Map> HERO_FIGHTS = new ConcurrentHashMap<>(); - private static final Map> _herodiary = new HashMap<>(); - private static final Map _heroMessage = new HashMap<>(); + private static final Map> HERO_DIARY = new ConcurrentHashMap<>(); + private static final Map HERO_MESSAGE = new ConcurrentHashMap<>(); public static final String COUNT = "count"; public static final String PLAYED = "played"; @@ -97,11 +96,6 @@ public class Hero public static final int ACTION_HERO_GAINED = 2; public static final int ACTION_CASTLE_TAKEN = 3; - public static Hero getInstance() - { - return SingletonHolder._instance; - } - protected Hero() { init(); @@ -109,12 +103,12 @@ public class Hero private void init() { - _heroes.clear(); - _completeHeroes.clear(); - _herocounts.clear(); - _herofights.clear(); - _herodiary.clear(); - _heroMessage.clear(); + HEROES.clear(); + COMPLETE_HEROS.clear(); + HERO_COUNTS.clear(); + HERO_FIGHTS.clear(); + HERO_DIARY.clear(); + HERO_MESSAGE.clear(); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); Statement s1 = con.createStatement(); @@ -139,7 +133,7 @@ public class Hero processHeros(ps, charId, hero); - _heroes.put(charId, hero); + HEROES.put(charId, hero); } while (rset2.next()) @@ -154,16 +148,16 @@ public class Hero processHeros(ps, charId, hero); - _completeHeroes.put(charId, hero); + COMPLETE_HEROS.put(charId, hero); } } catch (SQLException e) { - _log.log(Level.WARNING, "Hero System: Couldnt load Heroes", e); + _log.warning("Hero System: Couldnt load Heroes: " + e.getMessage()); } - _log.info("Hero System: Loaded " + _heroes.size() + " Heroes."); - _log.info("Hero System: Loaded " + _completeHeroes.size() + " all time Heroes."); + _log.info("Hero System: Loaded " + HEROES.size() + " Heroes."); + _log.info("Hero System: Loaded " + COMPLETE_HEROS.size() + " all time Heroes."); } private void processHeros(PreparedStatement ps, int charId, StatsSet hero) throws SQLException @@ -222,19 +216,19 @@ public class Hero { if (rset.next()) { - _heroMessage.put(charId, rset.getString("message")); + HERO_MESSAGE.put(charId, rset.getString("message")); } } } catch (SQLException e) { - _log.log(Level.WARNING, "Hero System: Couldnt load Hero Message for CharId: " + charId, e); + _log.warning("Hero System: Couldnt load Hero Message for CharId: " + charId + ": " + e.getMessage()); } } public void loadDiary(int charId) { - final List _diary = new ArrayList<>(); + final List diary = new ArrayList<>(); int diaryentries = 0; try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT * FROM heroes_diary WHERE charId=? ORDER BY time ASC")) @@ -273,31 +267,31 @@ public class Hero _diaryentry.set("action", castle.getName() + " Castle was successfuly taken"); } } - _diary.add(_diaryentry); + diary.add(_diaryentry); diaryentries++; } } - _herodiary.put(charId, _diary); + HERO_DIARY.put(charId, diary); _log.info("Hero System: Loaded " + diaryentries + " diary entries for Hero: " + CharNameTable.getInstance().getNameById(charId)); } catch (SQLException e) { - _log.log(Level.WARNING, "Hero System: Couldnt load Hero Diary for CharId: " + charId, e); + _log.warning("Hero System: Couldnt load Hero Diary for CharId: " + charId + ": " + e.getMessage()); } } public void loadFights(int charId) { - final List _fights = new ArrayList<>(); - StatsSet _herocountdata = new StatsSet(); - Calendar _data = Calendar.getInstance(); - _data.set(Calendar.DAY_OF_MONTH, 1); - _data.set(Calendar.HOUR_OF_DAY, 0); - _data.set(Calendar.MINUTE, 0); - _data.set(Calendar.MILLISECOND, 0); + final List fights = new ArrayList<>(); + StatsSet heroCountData = new StatsSet(); + Calendar data = Calendar.getInstance(); + data.set(Calendar.DAY_OF_MONTH, 1); + data.set(Calendar.HOUR_OF_DAY, 0); + data.set(Calendar.MINUTE, 0); + data.set(Calendar.MILLISECOND, 0); - long from = _data.getTimeInMillis(); + long from = data.getTimeInMillis(); int numberoffights = 0; int _victorys = 0; int _losses = 0; @@ -361,7 +355,7 @@ public class Hero _draws++; } - _fights.add(fight); + fights.add(fight); numberoffights++; } @@ -397,7 +391,7 @@ public class Hero _draws++; } - _fights.add(fight); + fights.add(fight); numberoffights++; } @@ -405,29 +399,29 @@ public class Hero } } - _herocountdata.set("victory", _victorys); - _herocountdata.set("draw", _draws); - _herocountdata.set("loss", _losses); + heroCountData.set("victory", _victorys); + heroCountData.set("draw", _draws); + heroCountData.set("loss", _losses); - _herocounts.put(charId, _herocountdata); - _herofights.put(charId, _fights); + HERO_COUNTS.put(charId, heroCountData); + HERO_FIGHTS.put(charId, fights); _log.info("Hero System: Loaded " + numberoffights + " fights for Hero: " + CharNameTable.getInstance().getNameById(charId)); } catch (SQLException e) { - _log.log(Level.WARNING, "Hero System: Couldnt load Hero fights history for CharId: " + charId, e); + _log.warning("Hero System: Couldnt load Hero fights history for CharId: " + charId + ": " + e); } } public Map getHeroes() { - return _heroes; + return HEROES; } public int getHeroByClass(int classid) { - for (Entry e : _heroes.entrySet()) + for (Entry e : HEROES.entrySet()) { if (e.getValue().getInt(Olympiad.CLASS_ID) == classid) { @@ -439,42 +433,42 @@ public class Hero public void resetData() { - _herodiary.clear(); - _herofights.clear(); - _herocounts.clear(); - _heroMessage.clear(); + HERO_DIARY.clear(); + HERO_FIGHTS.clear(); + HERO_COUNTS.clear(); + HERO_MESSAGE.clear(); } public void showHeroDiary(L2PcInstance activeChar, int heroclass, int charid, int page) { final int perpage = 10; - if (_herodiary.containsKey(charid)) + final List mainList = HERO_DIARY.get(charid); + if (mainList != null) { - List _mainlist = _herodiary.get(charid); - final NpcHtmlMessage DiaryReply = new NpcHtmlMessage(); + final NpcHtmlMessage diaryReply = new NpcHtmlMessage(); final String htmContent = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/olympiad/herodiary.htm"); - if ((htmContent != null) && _heroMessage.containsKey(charid)) + final String heroMessage = HERO_MESSAGE.get(charid); + if ((htmContent != null) && (heroMessage != null)) { - DiaryReply.setHtml(htmContent); - DiaryReply.replace("%heroname%", CharNameTable.getInstance().getNameById(charid)); - DiaryReply.replace("%message%", _heroMessage.get(charid)); - DiaryReply.disableValidation(); + diaryReply.setHtml(htmContent); + diaryReply.replace("%heroname%", CharNameTable.getInstance().getNameById(charid)); + diaryReply.replace("%message%", heroMessage); + diaryReply.disableValidation(); - if (!_mainlist.isEmpty()) + if (!mainList.isEmpty()) { - final ArrayList _list = new ArrayList<>(); - _list.addAll(_mainlist); - Collections.reverse(_list); + final List list = new ArrayList<>(mainList); + Collections.reverse(list); boolean color = true; final StringBuilder fList = new StringBuilder(500); int counter = 0; int breakat = 0; - for (int i = ((page - 1) * perpage); i < _list.size(); i++) + for (int i = ((page - 1) * perpage); i < list.size(); i++) { breakat = i; - StatsSet _diaryentry = _list.get(i); + StatsSet diaryEntry = list.get(i); StringUtil.append(fList, ""); if (color) { @@ -484,8 +478,8 @@ public class Hero { StringUtil.append(fList, ""); } - StringUtil.append(fList, ""); - StringUtil.append(fList, ""); + StringUtil.append(fList, ""); + StringUtil.append(fList, ""); StringUtil.append(fList, "
" + _diaryentry.getString("date") + ":xx
" + _diaryentry.getString("action") + "
" + diaryEntry.getString("date") + ":xx
" + diaryEntry.getString("action") + "
 
"); StringUtil.append(fList, ""); color = !color; @@ -496,34 +490,34 @@ public class Hero } } - if (breakat < (_list.size() - 1)) + if (breakat < (list.size() - 1)) { - DiaryReply.replace("%buttprev%", "