diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackMarketeerOfMammon/BlackMarketeerOfMammon.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackMarketeerOfMammon/BlackMarketeerOfMammon.java index 0a6b03aae491a4e2f6369b48d300be173b75775b..b2ecca9261eb26f54d797e14ef3cfeed964a0db3 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackMarketeerOfMammon/BlackMarketeerOfMammon.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/BlackMarketeerOfMammon/BlackMarketeerOfMammon.java @@ -36,7 +36,7 @@ public class BlackMarketeerOfMammon extends AbstractNpcAI // Misc private static final int MIN_LEVEL = 60; - public BlackMarketeerOfMammon(String name, String descr) + private BlackMarketeerOfMammon(String name, String descr) { super(name, descr); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java index c775ef393f2573eac686e26d9a4c1a1a804c05d7..a8f38de043530456d6b5528c2c986dc44cf0e567 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Dorian/Dorian.java @@ -15,7 +15,6 @@ package ai.npc.Dorian; import quests.Q00024_InhabitantsOfTheForestOfTheDead.Q00024_InhabitantsOfTheForestOfTheDead; - import ai.npc.AbstractNpcAI; import com.l2jserver.gameserver.datatables.SpawnTable; @@ -32,7 +31,11 @@ import com.l2jserver.gameserver.network.clientpackets.Say2; */ public class Dorian extends AbstractNpcAI { - private static final int ID = 25332; + // NPC + private static final int DORIAN = 25332; + // Items + private static final int SILVER_CROSS = 7153; + private static final int BROKEN_SILVER_CROSS = 7154; @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) @@ -50,8 +53,8 @@ public class Dorian extends AbstractNpcAI final QuestState qs = pl.getQuestState(Q00024_InhabitantsOfTheForestOfTheDead.class.getSimpleName()); if ((qs != null) && qs.isCond(3)) { - qs.takeItems(7153, -1); - qs.giveItems(7154, 1); + qs.takeItems(SILVER_CROSS, -1); + qs.giveItems(BROKEN_SILVER_CROSS, 1); qs.setCond(4, true); broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.THAT_SIGN); } @@ -71,11 +74,11 @@ public class Dorian extends AbstractNpcAI public Dorian(String name, String descr) { super(name, descr); - addSpawnId(ID); + addSpawnId(DORIAN); for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable()) { - if ((spawn != null) && (spawn.getNpcid() == ID)) + if ((spawn != null) && (spawn.getNpcid() == DORIAN)) { startQuestTimer("checkArea", 3000, spawn.getLastSpawn(), null, true); } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ToIVortex/ToIVortex.java b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ToIVortex/ToIVortex.java index 180b264755c1a5173bdbbe2beed8cde7889ae77c..02d1b5b64773fa68d472d5d22ea6e53d64bb61e6 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ToIVortex/ToIVortex.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/ai/npc/Teleports/ToIVortex/ToIVortex.java @@ -18,7 +18,7 @@ import ai.npc.AbstractNpcAI; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; -import com.l2jserver.gameserver.model.quest.QuestState; +import com.l2jserver.gameserver.model.itemcontainer.PcInventory; /** * Tower of Insolence Vortex teleport AI.<br> @@ -34,213 +34,200 @@ public class ToIVortex extends AbstractNpcAI private static final int DIMENSION_VORTEX_1 = 30952; private static final int DIMENSION_VORTEX_2 = 30953; private static final int DIMENSION_VORTEX_3 = 30954; - - // ITEMS - private static final int ADENA = 57; - private static final int BLUE_DIMENSION_STONE = 4402; + // Items private static final int GREEN_DIMENSION_STONE = 4401; + private static final int BLUE_DIMENSION_STONE = 4402; private static final int RED_DIMENSION_STONE = 4403; @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { - String htmltext = ""; - QuestState st = player.getQuestState(getName()); - int npcId = npc.getNpcId(); - // 1st Floor - if (event.equalsIgnoreCase("1")) - { - if (st.hasQuestItems(GREEN_DIMENSION_STONE)) - { - st.takeItems(GREEN_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(114356, 13423, -5096); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 2nd Floor - else if (event.equalsIgnoreCase("2")) - { - if (st.hasQuestItems(GREEN_DIMENSION_STONE)) - { - st.takeItems(GREEN_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(114666, 13380, -3608); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 3rd Floor - else if (event.equalsIgnoreCase("3")) - { - if (st.hasQuestItems(GREEN_DIMENSION_STONE)) - { - st.takeItems(GREEN_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(111982, 16028, -2120); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 4th Floor - else if (event.equalsIgnoreCase("4")) - { - if (st.hasQuestItems(BLUE_DIMENSION_STONE)) - { - st.takeItems(BLUE_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(114636, 13413, -640); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 5th Floor - else if (event.equalsIgnoreCase("5")) - { - if (st.hasQuestItems(BLUE_DIMENSION_STONE)) - { - st.takeItems(BLUE_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(114152, 19902, 928); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 6th Floor - else if (event.equalsIgnoreCase("6")) - { - if (st.hasQuestItems(BLUE_DIMENSION_STONE)) - { - st.takeItems(BLUE_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(117131, 16044, 1944); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 7th Floor - else if (event.equalsIgnoreCase("7")) - { - if (st.hasQuestItems(RED_DIMENSION_STONE)) - { - st.takeItems(RED_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(113026, 17687, 2952); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 8th Floor - else if (event.equalsIgnoreCase("8")) - { - if (st.hasQuestItems(RED_DIMENSION_STONE)) - { - st.takeItems(RED_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(115571, 13723, 3960); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 9th Floor - else if (event.equalsIgnoreCase("9")) - { - if (st.hasQuestItems(RED_DIMENSION_STONE)) - { - st.takeItems(RED_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(114649, 14144, 4976); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - // 10 Floor - else if (event.equalsIgnoreCase("10")) - { - if (st.hasQuestItems(RED_DIMENSION_STONE)) - { - st.takeItems(RED_DIMENSION_STONE, 1); - st.getPlayer().teleToLocation(118507, 16605, 5984); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = "no-stones.htm"; - } - } - else if (event.equalsIgnoreCase("GREEN")) - { - if (st.getQuestItemsCount(ADENA) >= 10000) - { - st.takeItems(ADENA, 10000); - st.giveItems(GREEN_DIMENSION_STONE, 1); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = npcId + "no-adena.htm"; - } - } - else if (event.equalsIgnoreCase("BLUE")) - { - if (st.getQuestItemsCount(ADENA) >= 10000) - { - st.takeItems(ADENA, 10000); - st.giveItems(BLUE_DIMENSION_STONE, 1); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = npcId + "no-adena.htm"; - } - } - else if (event.equalsIgnoreCase("RED")) + + switch (event) { - if (st.getQuestItemsCount(ADENA) >= 10000) - { - st.takeItems(ADENA, 10000); - st.giveItems(RED_DIMENSION_STONE, 1); - st.exitQuest(true); - } - else - { - st.exitQuest(true); - htmltext = npcId + "no-adena.htm"; + case "1": + { + // 1st Floor + if (hasQuestItems(player, GREEN_DIMENSION_STONE)) + { + takeItems(player, GREEN_DIMENSION_STONE, 1); + player.teleToLocation(114356, 13423, -5096, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "2": + { + // 2nd Floor + if (hasQuestItems(player, GREEN_DIMENSION_STONE)) + { + takeItems(player, GREEN_DIMENSION_STONE, 1); + player.teleToLocation(114666, 13380, -3608, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "3": + { + // 3rd Floor + if (hasQuestItems(player, GREEN_DIMENSION_STONE)) + { + takeItems(player, GREEN_DIMENSION_STONE, 1); + player.teleToLocation(111982, 16028, -2120, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "4": + { + // 4th Floor + if (hasQuestItems(player, BLUE_DIMENSION_STONE)) + { + takeItems(player, BLUE_DIMENSION_STONE, 1); + player.teleToLocation(114636, 13413, -640, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "5": + { + // 5th Floor + if (hasQuestItems(player, BLUE_DIMENSION_STONE)) + { + takeItems(player, BLUE_DIMENSION_STONE, 1); + player.teleToLocation(114152, 19902, 928, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "6": + { + // 6th Floor + if (hasQuestItems(player, BLUE_DIMENSION_STONE)) + { + takeItems(player, BLUE_DIMENSION_STONE, 1); + player.teleToLocation(117131, 16044, 1944, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "7": + { + // 7th Floor + if (hasQuestItems(player, RED_DIMENSION_STONE)) + { + takeItems(player, RED_DIMENSION_STONE, 1); + player.teleToLocation(113026, 17687, 2952, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "8": + { + // 8th Floor + if (hasQuestItems(player, RED_DIMENSION_STONE)) + { + takeItems(player, RED_DIMENSION_STONE, 1); + player.teleToLocation(115571, 13723, 3960, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "9": + { + // 9th Floor + if (hasQuestItems(player, RED_DIMENSION_STONE)) + { + takeItems(player, RED_DIMENSION_STONE, 1); + player.teleToLocation(114649, 14144, 4976, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "10": + { + // 10 Floor + if (hasQuestItems(player, RED_DIMENSION_STONE)) + { + takeItems(player, RED_DIMENSION_STONE, 1); + player.teleToLocation(118507, 16605, 5984, true); + } + else + { + return "no-stones.htm"; + } + break; + } + case "GREEN": + { + if (player.getAdena() >= 10000) + { + takeItems(player, PcInventory.ADENA_ID, 10000); + giveItems(player, GREEN_DIMENSION_STONE, 1); + } + else + { + return npcId + "no-adena.htm"; + } + break; + } + case "BLUE": + { + if (player.getAdena() >= 10000) + { + takeItems(player, PcInventory.ADENA_ID, 10000); + giveItems(player, BLUE_DIMENSION_STONE, 1); + } + else + { + return npcId + "no-adena.htm"; + } + break; + } + case "RED": + { + if (player.getAdena() >= 10000) + { + takeItems(player, PcInventory.ADENA_ID, 10000); + giveItems(player, RED_DIMENSION_STONE, 1); + } + else + { + return npcId + "no-adena.htm"; + } + break; } } - return htmltext; + + return super.onAdvEvent(event, npc, player); } private ToIVortex(String name, String descr)