diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml new file mode 100644 index 0000000000..7e3f654c40 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml @@ -0,0 +1,48 @@ + + + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml new file mode 100644 index 0000000000..902cc8c4fc --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml @@ -0,0 +1,48 @@ + + + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml new file mode 100644 index 0000000000..c4f873ca00 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml @@ -0,0 +1,42 @@ + + + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01.html new file mode 100644 index 0000000000..99b844940b --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01.html @@ -0,0 +1,9 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Goldberg, you need to be a member of a Lv. 7 clan. To fight Mary Reed your clan needs to be at least Lv. 10, while Tauti can only be confronted by a Lv. 13 clan.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, what would you like?
+ + + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01a.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01a.html new file mode 100644 index 0000000000..cf74b23c1d --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01a.html @@ -0,0 +1,7 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Goldberg, you need to be a member of a Lv. 7 clan.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, would you like to enter?
+ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01b.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01b.html new file mode 100644 index 0000000000..3f6f839ea6 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01b.html @@ -0,0 +1,7 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Mary Reed your clan needs to be at least Lv. 10.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, would you like to enter?
+ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01c.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01c.html new file mode 100644 index 0000000000..37e938eb02 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01c.html @@ -0,0 +1,7 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Tauti, you need to be a member of a Lv. 13 clan.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, would you like to enter?
+ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02a.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02a.html new file mode 100644 index 0000000000..d0a1cc81b8 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02a.html @@ -0,0 +1,4 @@ +Roiental:
+Your party members are participating in battle. I'll move you to them.
+ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02b.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02b.html new file mode 100644 index 0000000000..a644855574 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02b.html @@ -0,0 +1,4 @@ +Roiental:
+Your party members are participating in battle. I'll move you to them.
+ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02c.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02c.html new file mode 100644 index 0000000000..f462750b0c --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02c.html @@ -0,0 +1,4 @@ +Roiental:
+Your party members are participating in battle. I'll move you to them.
+ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03a.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03a.html new file mode 100644 index 0000000000..29e2dbf269 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03a.html @@ -0,0 +1,4 @@ +Roiental:
+You are not a clan member or your clan hasn't reached Lv. 7 yet.
+(The Throne of Heroes can only be ascended by members of a command channel from the same clan (4-100 participants). The clan must have reached Lv. 7.) + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03b.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03b.html new file mode 100644 index 0000000000..b91c30765f --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03b.html @@ -0,0 +1,4 @@ +Roiental:
+You are not a clan member or your clan hasn't reached Lv. 10 yet.
+(The Throne of Heroes can only be ascended by members of a command channel from the same clan (4-100 participants). The clan must have reached Lv. 10.) + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03c.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03c.html new file mode 100644 index 0000000000..7b6a9ca066 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03c.html @@ -0,0 +1,4 @@ +Roiental:
+You are not a clan member or your clan hasn't reached Lv. 13 yet.
+(The Throne of Heroes can only be ascended by members of a command channel from the same clan (4-100 participants). The clan must have reached Lv. 13.) + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-AlreadyDone.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-AlreadyDone.html new file mode 100644 index 0000000000..23cd6faa33 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-AlreadyDone.html @@ -0,0 +1,3 @@ +Roiental:
+Your clan mates already challenged one of the Throne of Heroes raids today.
+ \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-NoLevel.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-NoLevel.html new file mode 100644 index 0000000000..722830900b --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-NoLevel.html @@ -0,0 +1,4 @@ +Roiental:
+You are not strong enough yet.
+(The Throne of Heroes can only be ascended by characters of level 110 or above.) + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental.java new file mode 100644 index 0000000000..1ed7f116c8 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental.java @@ -0,0 +1,142 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.areas.Rune.Roiental; + +import org.l2jmobius.gameserver.instancemanager.InstanceManager; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; + +import ai.AbstractNpcAI; + +/** + * Roiental AI. + * @author CostyKiller + */ +public class Roiental extends AbstractNpcAI +{ + // NPCs + private static final int ROIENTAL = 34571; + // Misc + private static final int TOH_GB_TEMPLATE_ID = 307; // Throne of Heroes - Goldberg + private static final int TOH_MR_TEMPLATE_ID = 308; // Throne of Heroes - Mary Reed + private static final int TOH_TA_TEMPLATE_ID = 309; // Throne of Heroes - Tauti + private static final int MIN_LVL = 110; + private static final int CLAN_MIN_LVL_GB = 7; + private static final int CLAN_MIN_LVL_MR = 10; + private static final int CLAN_MIN_LVL_TA = 13; + + private Roiental() + { + addStartNpc(ROIENTAL); + addFirstTalkId(ROIENTAL); + addTalkId(ROIENTAL); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + if (event.equals("enterGoldberg")) + { + if (player.getLevel() < MIN_LVL) + { + htmltext = "Roiental-NoLevel.html"; + } + else if ((player.getClan() == null) || (player.getClan().getLevel() < CLAN_MIN_LVL_GB)) + { + htmltext = "Roiental-03a.html"; + } + else if ((player.getClan() == null) || player.getClan().getVariables().hasVariable("TOH_DONE")) + { + htmltext = "Roiental-AlreadyDone.html"; + } + else + { + htmltext = "Roiental-01a.html"; + } + } + if (event.equals("enterMaryReed")) + { + if (player.getLevel() < MIN_LVL) + { + htmltext = "Roiental-NoLevel.html"; + } + else if ((player.getClan() == null) || (player.getClan().getLevel() < CLAN_MIN_LVL_MR)) + { + htmltext = "Roiental-03b.html"; + } + else if ((player.getClan() == null) || player.getClan().getVariables().hasVariable("TOH_DONE")) + { + htmltext = "Roiental-AlreadyDone.html"; + } + else + { + htmltext = "Roiental-01b.html"; + } + } + if (event.equals("enterTauti")) + { + if (player.getLevel() < MIN_LVL) + { + htmltext = "Roiental-NoLevel.html"; + } + else if ((player.getClan() == null) || (player.getClan().getLevel() < CLAN_MIN_LVL_TA)) + { + htmltext = "Roiental-03c.html"; + } + else if ((player.getClan() == null) || player.getClan().getVariables().hasVariable("TOH_DONE")) + { + htmltext = "Roiental-AlreadyDone.html"; + } + else + { + htmltext = "Roiental-01c.html"; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + String htmltext = null; + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && ((instance.getTemplateId() == TOH_GB_TEMPLATE_ID))) + { + htmltext = "Roiental-02a.html"; + } + else if ((instance != null) && ((instance.getTemplateId() == TOH_MR_TEMPLATE_ID))) + { + htmltext = "Roiental-02b.html"; + } + else if ((instance != null) && ((instance.getTemplateId() == TOH_TA_TEMPLATE_ID))) + { + htmltext = "Roiental-02c.html"; + } + else + { + htmltext = "Roiental-01.html"; + } + return htmltext; + } + + public static void main(String[] args) + { + new Roiental(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java new file mode 100644 index 0000000000..19e9818c7e --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java @@ -0,0 +1,210 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.ThroneOfHeroes; + +import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author CostyKiller // https://www.youtube.com/watch?v=fJWAWU5XpZk + */ +public class ThroneOfHeroesGoldberg extends AbstractInstance +{ + // NPCs + private static final int ROIENTAL = 34571; + // Monsters + private static final int GOLDBERG = 26250; + private static final int[] GOLDBERG_MINIONS = + { + 26251, // Handy Cannon Gunner + 26252, // Anchor Warrior + 26253, // Operator + 26254 // Axe Warrior + }; + // Throne's Treasure Chest Goldberg + private static final int TREASURE_CHEST = 26455; + + // World Instance + Instance world = null; + + // Misc + private static final int TEMPLATE_ID = 307; + + public ThroneOfHeroesGoldberg() + { + super(TEMPLATE_ID); + addInstanceCreatedId(TEMPLATE_ID); + addStartNpc(ROIENTAL); + addTalkId(ROIENTAL); + addAttackId(GOLDBERG); + addKillId(GOLDBERG); + } + + @Override + public void onInstanceCreated(Instance activeInstance, PlayerInstance player) + { + activeInstance.setStatus(0); + startQuestTimer("ANNOUNCE_RAID_START", 10000, null, player); + world = activeInstance; + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + switch (event) + { + case "enterInstance": + { + enterInstance(player, npc, TEMPLATE_ID); + startQuestTimer("ANNOUNCE_RAID_PREP", 20000, null, player); + break; + } + case "reenterInstance": + { + final Instance activeInstance = getPlayerInstance(player); + if (isInInstance(activeInstance)) + { + enterInstance(player, npc, activeInstance.getTemplateId()); + } + } + case "ANNOUNCE_RAID_START": + { + showOnScreenMsg(world, NpcStringId.THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_GOLDBERG_WILL_BEGIN_SHORTLY_PLEASE_GET_READY, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_RAID_PREP", 15000, null, player); + break; + } + case "ANNOUNCE_RAID_PREP": + { + showOnScreenMsg(world, NpcStringId.THE_FIGHTING_AGAINST_GOLDBERG_WILL_BEGIN_IN_10_SECONDS, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_5", 5000, null, player); + break; + } + case "ANNOUNCE_5": + { + showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_4", 1000, null, player); + break; + } + case "ANNOUNCE_4": + { + showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_3", 1000, null, player); + break; + } + case "ANNOUNCE_3": + { + showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_2", 1000, null, player); + break; + } + case "ANNOUNCE_2": + { + showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_1", 1000, null, player); + break; + } + case "ANNOUNCE_1": + { + showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("SPAWN_GOLDBERG", 1000, null, player); + break; + } + case "SPAWN_GOLDBERG": + { + showOnScreenMsg(world, NpcStringId.GOLDBERG_APPEARS, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("GOLDBERG"); + break; + } + case "SPAWN_GOLDBERG_MINIONS": + { + showOnScreenMsg(world, NpcStringId.GOLDBERG_SUMMONS_HIS_MINIONS, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("GOLDBERG_MINIONS"); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + final int hpPer = npc.getCurrentHpPercent(); + final int maxHp = npc.getMaxHp(); + if (npc.getId() == GOLDBERG) + { + if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0)) + { + startQuestTimer("SPAWN_GOLDBERG_MINIONS", 10000, npc, null); + npc.setScriptValue(1); + } + else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1)) + { + showOnScreenMsg(world, NpcStringId.GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM, ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(2); + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + if (npc.getId() == GOLDBERG) + { + // Despawn minions and stop timer + cancelQuestTimer("SPAWN_GOLDBERG_MINIONS", npc, killer); + world.getAliveNpcs(GOLDBERG_MINIONS).forEach(beast -> beast.doDie(null)); + + // Spawn treasure chests + boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8)); + if (killer.isGM() || eightCCMembersOrMore) + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + else + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + // Finish instance + world.finishInstance(2); + // Set clan variable + killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis()); + killer.getClan().getVariables().storeMe(); + } + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new ThroneOfHeroesGoldberg(); + } +} diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java new file mode 100644 index 0000000000..190fac7327 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java @@ -0,0 +1,226 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.ThroneOfHeroes; + +import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.commons.util.CommonUtil; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author CostyKiller + */ +public class ThroneOfHeroesMaryReed extends AbstractInstance +{ + + // NPCs + private static final int ROIENTAL = 34571; + // Monsters + private static final int MARY_REED = 26267; + private static final int[] MARY_REED_MINIONS = + { + // add Zaken as minion + 26268, // Shield Master --> + 26269, // Spear Master --> + 26270, // Bow Master --> + 26271 // Magic Master --> + }; + // Throne's Treasure Chest Mary Reed + private static final int TREASURE_CHEST = 26456; + + // World Instance + Instance world = null; + + // Misc + private static final int TEMPLATE_ID = 308; + + // Npc Dialogs + private static final NpcStringId[] MINIONS_MESSAGES = + { + NpcStringId.MARY_REED_THEY_ARE_JUST_INSECTS_HAHA_SHOW_THEM_YOUR_TRUE_POWER, + NpcStringId.MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_I_SHALL_REST_UP_A_BIT, + NpcStringId.MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_WATCH_OUT, + NpcStringId.MARY_REED_REVEALS_HER_TRUE_POWER + }; + + public ThroneOfHeroesMaryReed() + { + super(TEMPLATE_ID); + addInstanceCreatedId(TEMPLATE_ID); + addStartNpc(ROIENTAL); + addTalkId(ROIENTAL); + addAttackId(MARY_REED); + addKillId(MARY_REED); + } + + @Override + public void onInstanceCreated(Instance activeInstance, PlayerInstance player) + { + activeInstance.setStatus(0); + startQuestTimer("ANNOUNCE_RAID_START", 10000, null, player); + world = activeInstance; + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + switch (event) + { + case "enterInstance": + { + enterInstance(player, npc, TEMPLATE_ID); + startQuestTimer("ANNOUNCE_RAID_PREP", 20000, null, player); + break; + } + case "reenterInstance": + { + final Instance activeInstance = getPlayerInstance(player); + if (isInInstance(activeInstance)) + { + enterInstance(player, npc, activeInstance.getTemplateId()); + } + } + case "ANNOUNCE_RAID_START": + { + showOnScreenMsg(world, NpcStringId.THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_MARY_REED_WILL_BEGIN_SHORTLY, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_RAID_PREP", 15000, null, player); + break; + } + case "ANNOUNCE_RAID_PREP": + { + showOnScreenMsg(world, NpcStringId.THE_FIGHTING_AGAINST_MARY_REED_WILL_BEGIN_IN_10_SECONDS, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_5", 10000, null, player); + break; + } + case "ANNOUNCE_5": + { + showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_4", 2000, null, player); + break; + } + case "ANNOUNCE_4": + { + showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_3", 2000, null, player); + break; + } + case "ANNOUNCE_3": + { + showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_2", 2000, null, player); + break; + } + case "ANNOUNCE_2": + { + showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_1", 2000, null, player); + break; + } + case "ANNOUNCE_1": + { + showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("SPAWN_MARY_REED", 2000, null, player); + break; + } + case "SPAWN_MARY_REED": + { + showOnScreenMsg(world, NpcStringId.MARY_REED_GREETS_HEROES, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("MARY_REED"); + break; + } + case "SPAWN_MARY_REED_MINIONS": + { + showOnScreenMsg(world, NpcStringId.MARY_REED_SUMMONS_ZAKEN, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("MARY_REED_MINIONS"); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + final int hpPer = npc.getCurrentHpPercent(); + final int maxHp = npc.getMaxHp(); + if (npc.getId() == MARY_REED) + { + if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0)) + { + startQuestTimer("SPAWN_MARY_REED_MINIONS", 10000, npc, null); + npc.setScriptValue(1); + } + else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1)) + { + showOnScreenMsg(world, NpcStringId.DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT, ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(2); + } + } + else if (CommonUtil.contains(MARY_REED_MINIONS, npc.getId()) && world.getNpc(MARY_REED).isScriptValue(2)) + { + showOnScreenMsg(world, MINIONS_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true); + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + if (npc.getId() == MARY_REED) + { + // Despawn minions and stop timer + cancelQuestTimer("SPAWN_MARY_REED_MINIONS", npc, killer); + world.getAliveNpcs(MARY_REED_MINIONS).forEach(beast -> beast.doDie(null)); + + // Spawn treasure chests + boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8)); + if (killer.isGM() || eightCCMembersOrMore) + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + else + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + // Finish instance + world.finishInstance(2); + // Set clan variable + killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis()); + killer.getClan().getVariables().storeMe(); + } + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new ThroneOfHeroesMaryReed(); + } +} diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java new file mode 100644 index 0000000000..049d37f60e --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java @@ -0,0 +1,213 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.ThroneOfHeroes; + +import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author CostyKiller + */ +public class ThroneOfHeroesTauti extends AbstractInstance +{ + + // NPCs + private static final int ROIENTAL = 34571; + // Monsters + private static final int TAUTI = 26266; + + // Throne's Treasure Chest Tauti + private static final int TREASURE_CHEST = 26457; + + // World Instance + Instance world = null; + + // Misc + private static final int TEMPLATE_ID = 309; + + // Npc Dialogs + private static final NpcStringId[] TAUTI_MESSAGES = + { + NpcStringId.TAUTI_INTENDS_TO_SHOW_OFF_HIS_POWER_TO_HIS_FOLLOWERS, + NpcStringId.TAUTI_INTENDS_TO_SHOW_OFF_HIS_POWER_TO_THOSE_WHO_AVOID_HIM + }; + + public ThroneOfHeroesTauti() + { + super(TEMPLATE_ID); + addInstanceCreatedId(TEMPLATE_ID); + addStartNpc(ROIENTAL); + addTalkId(ROIENTAL); + addAttackId(TAUTI); + addKillId(TAUTI); + } + + @Override + public void onInstanceCreated(Instance activeInstance, PlayerInstance player) + { + activeInstance.setStatus(0); + startQuestTimer("ANNOUNCE_RAID_START", 10000, null, player); + world = activeInstance; + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + switch (event) + { + case "enterInstance": + { + enterInstance(player, npc, TEMPLATE_ID); + startQuestTimer("ANNOUNCE_RAID_PREP", 20000, null, player); + break; + } + case "reenterInstance": + { + final Instance activeInstance = getPlayerInstance(player); + if (isInInstance(activeInstance)) + { + enterInstance(player, npc, activeInstance.getTemplateId()); + } + } + case "ANNOUNCE_RAID_START": + { + showOnScreenMsg(world, NpcStringId.THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_TAUTI_WILL_BEGIN_SHORTLY, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_RAID_PREP", 15000, null, player); + break; + } + case "ANNOUNCE_RAID_PREP": + { + showOnScreenMsg(world, NpcStringId.THE_FIGHTING_AGAINST_TAUTI_WILL_BEGIN_IN_10_SECONDS, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_5", 10000, null, player); + break; + } + case "ANNOUNCE_5": + { + showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_4", 2000, null, player); + break; + } + case "ANNOUNCE_4": + { + showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_3", 2000, null, player); + break; + } + case "ANNOUNCE_3": + { + showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_2", 2000, null, player); + break; + } + case "ANNOUNCE_2": + { + showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_1", 2000, null, player); + break; + } + case "ANNOUNCE_1": + { + showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("SPAWN_TAUTI", 2000, null, player); + break; + } + case "SPAWN_TAUTI": + { + showOnScreenMsg(world, NpcStringId.TAUTI_IS_READY_TO_FIGHT, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("TAUTI"); + break; + } + // case "SPAWN_TAUTI_MINIONS": + // { + // showOnScreenMsg(world, NpcStringId.TAUTI_SUMMONS_HIS_MECHANICAL_CONTRAPTION, ExShowScreenMessage.TOP_CENTER, 5000, true); + // world.spawnGroup("TAUTI_MINIONS"); + // break; + // } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + final int hpPer = npc.getCurrentHpPercent(); + final int maxHp = npc.getMaxHp(); + if (npc.getId() == TAUTI) + { + if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0)) + { + // startQuestTimer("SPAWN_TAUTI_MINIONS", 10000, npc, null); + showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(1); + } + else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1)) + { + showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(2); + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + if (npc.getId() == TAUTI) + { + // Despawn minions and stop timer + // cancelQuestTimer("SPAWN_TAUTI_MINIONS", npc, killer); + // world.getAliveNpcs(TAUTI_MINIONS).forEach(beast -> beast.doDie(null)); + + // Spawn treasure chests + boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8)); + if (killer.isGM() || eightCCMembersOrMore) + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + else + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + // Finish instance + world.finishInstance(2); + // Set clan variable + killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis()); + killer.getClan().getVariables().storeMe(); + } + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new ThroneOfHeroesTauti(); + } +} diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html new file mode 100644 index 0000000000..8b6da8c9f0 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html @@ -0,0 +1,4 @@ +Roiental:
+That many people can't be moved.
+(A maximum of 100 people can participate.) + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html new file mode 100644 index 0000000000..c1ec97ef04 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html @@ -0,0 +1,3 @@ +Roiental:
+As I explained earlier, you can enter only by forming an association. + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html new file mode 100644 index 0000000000..c5f7d5499a --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html @@ -0,0 +1,4 @@ +Roiental:
+You are too weak. I won't let you enter.
+(Only players of at least level 110 may participate.) + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/spawns/Rune/TownOfRune.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/spawns/Rune/TownOfRune.xml index df4ec17638..0b2d3f1dfc 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/spawns/Rune/TownOfRune.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/spawns/Rune/TownOfRune.xml @@ -151,6 +151,7 @@ + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/npcs/26200-26299.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/npcs/26200-26299.xml index 1bf77c9ecc..55895b000e 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/npcs/26200-26299.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/npcs/26200-26299.xml @@ -2925,7 +2925,7 @@ - + UNDEAD MALE @@ -2939,6 +2939,11 @@ + + + GOLDBERG_TOH + + @@ -2948,32 +2953,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + ETC FEMALE @@ -2986,13 +2967,18 @@ - + + + + GOLDBERG_TOH + + - + ETC FEMALE @@ -3005,13 +2991,18 @@ - + + + + GOLDBERG_TOH + + - + ETC FEMALE @@ -3024,13 +3015,18 @@ - + + + + GOLDBERG_TOH + + - + ETC FEMALE @@ -3043,7 +3039,12 @@ - + + + + GOLDBERG_TOH + + @@ -3052,7 +3053,7 @@ UNDEAD MALE - + @@ -3063,6 +3064,11 @@ + + + ZAKEN_TOH + + @@ -3072,32 +3078,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + ETC FEMALE @@ -3110,13 +3092,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3130,13 +3117,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3149,13 +3141,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3168,13 +3165,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3187,35 +3189,46 @@ - + + + + ZAKEN_TOH + + - - DRAGON + + + ETC FEMALE - + + + - - - - - - - - + + + + TIAT_TOH + + + + + + + @@ -3241,12 +3254,13 @@ - + ETC FEMALE + - + @@ -3254,38 +3268,50 @@ - + + + + TIAT_TOH + + - + ETC FEMALE + - + - + - + + + + TIAT_TOH + + - + ETC FEMALE + - + @@ -3293,18 +3319,24 @@ - + + + + TIAT_TOH + + - + ETC FEMALE + - + @@ -3312,13 +3344,18 @@ - + + + + TIAT_TOH + + - + DEMONIC MALE @@ -3341,37 +3378,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + UNDEAD MALE - + @@ -3380,6 +3393,11 @@ + + + MARY_REED_TOH + + @@ -3389,37 +3407,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + ETC FEMALE + - + @@ -3427,18 +3422,24 @@ - + + + + MARY_REED_TOH + + - + ETC FEMALE + - + @@ -3446,19 +3447,25 @@ - + + + + MARY_REED_TOH + + - + ETC FEMALE + - + @@ -3466,18 +3473,24 @@ - + + + + MARY_REED_TOH + + - + ETC FEMALE + - + @@ -3485,7 +3498,12 @@ - + + + + MARY_REED_TOH + + diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/instance.xsd b/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/instance.xsd index 8c43060e41..4430bc9b58 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/instance.xsd +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/instance.xsd @@ -142,6 +142,7 @@ + diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionCommandChannelLeaderSameClan.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionCommandChannelLeaderSameClan.java new file mode 100644 index 0000000000..095e9df83e --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionCommandChannelLeaderSameClan.java @@ -0,0 +1,51 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.l2jmobius.gameserver.model.instancezone.conditions; + +import org.l2jmobius.gameserver.model.AbstractPlayerGroup; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.InstanceTemplate; +import org.l2jmobius.gameserver.network.SystemMessageId; + +/** + * Command channel leader same clan condition + * @author CostyKiller + */ +public class ConditionCommandChannelLeaderSameClan extends Condition +{ + public ConditionCommandChannelLeaderSameClan(InstanceTemplate template, StatSet parameters, boolean onlyLeader, boolean showMessageAndHtml) + { + super(template, parameters, true, showMessageAndHtml); + setSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER); + } + + @Override + public boolean test(PlayerInstance player, Npc npc) + { + final AbstractPlayerGroup group = player.getCommandChannel(); + return ((group != null) && group.isLeader(player) && group.forEachMember(m -> + { + if (m.getClan() == player.getClan()) + { + return true; + } + return false; + })); + } +} \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/NpcStringId.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/NpcStringId.java index 30c0aacdb7..296e607fed 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/NpcStringId.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/NpcStringId.java @@ -38590,11 +38590,11 @@ public class NpcStringId @ClientString(id = 1803406, message = "See? There's nothing you and I can't do when we're together!") public static NpcStringId SEE_THERE_S_NOTHING_YOU_AND_I_CAN_T_DO_WHEN_WE_RE_TOGETHER; - @ClientString(id = 1803407, message = "The challenge for the Throne of Heroes will begin shortly. Please get ready.") - public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_WILL_BEGIN_SHORTLY_PLEASE_GET_READY; + @ClientString(id = 1803407, message = "The challenge for the Throne of Heroes - Goldberg will begin shortly.\nPlease get ready, heroes!") + public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_GOLDBERG_WILL_BEGIN_SHORTLY_PLEASE_GET_READY; - @ClientString(id = 1803408, message = "The first challenge will begin in 10 seconds.") - public static NpcStringId THE_FIRST_CHALLENGE_WILL_BEGIN_IN_10_SECONDS; + @ClientString(id = 1803408, message = "The fighting against Goldberg will begin in 10 seconds.") + public static NpcStringId THE_FIGHTING_AGAINST_GOLDBERG_WILL_BEGIN_IN_10_SECONDS; @ClientString(id = 1803409, message = "5 seconds") public static NpcStringId FIVE_SECONDS; @@ -38611,41 +38611,41 @@ public class NpcStringId @ClientString(id = 1803413, message = "1 second") public static NpcStringId ONE_SECOND_2; - @ClientString(id = 1803414, message = "The first challenge begins.") - public static NpcStringId THE_FIRST_CHALLENGE_BEGINS; + @ClientString(id = 1803414, message = "Goldberg appears.") + public static NpcStringId GOLDBERG_APPEARS; @ClientString(id = 1803415, message = "Darion frees himself from the restraints that suppressed him and reveals his true power.") public static NpcStringId DARION_FREES_HIMSELF_FROM_THE_RESTRAINTS_THAT_SUPPRESSED_HIM_AND_REVEALS_HIS_TRUE_POWER; - @ClientString(id = 1803416, message = "The first challenge has been completed successfully. The second challenge will begin shortly.") - public static NpcStringId THE_FIRST_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY_THE_SECOND_CHALLENGE_WILL_BEGIN_SHORTLY; + @ClientString(id = 1803416, message = "The challenge for the Throne of Heroes - Mary Reed will begin shortly.\nPlease get ready, heroes!") + public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_MARY_REED_WILL_BEGIN_SHORTLY; - @ClientString(id = 1803417, message = "The second challenge will begin in 10 seconds.") - public static NpcStringId THE_SECOND_CHALLENGE_WILL_BEGIN_IN_10_SECONDS; + @ClientString(id = 1803417, message = "The fighting against Mary Reed will begin in 10 seconds.") + public static NpcStringId THE_FIGHTING_AGAINST_MARY_REED_WILL_BEGIN_IN_10_SECONDS; - @ClientString(id = 1803418, message = "The second challenge will begin.") - public static NpcStringId THE_SECOND_CHALLENGE_WILL_BEGIN; + @ClientString(id = 1803418, message = "Mary Reed greets heroes.") + public static NpcStringId MARY_REED_GREETS_HEROES; - @ClientString(id = 1803419, message = "Goldberg will summon his minions in 5 seconds.") - public static NpcStringId GOLDBERG_WILL_SUMMON_HIS_MINIONS_IN_5_SECONDS; + @ClientString(id = 1803419, message = "Goldberg summons his minions.") + public static NpcStringId GOLDBERG_SUMMONS_HIS_MINIONS; @ClientString(id = 1803420, message = "Goldberg brings out all of the power within him.") public static NpcStringId GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM; - @ClientString(id = 1803421, message = "The second challenge has been completed successfully. The third challenge will begin shortly.") - public static NpcStringId THE_SECOND_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY_THE_THIRD_CHALLENGE_WILL_BEGIN_SHORTLY; + @ClientString(id = 1803421, message = "The challenge for the Throne of Heroes - Tauti will begin shortly.\nPlease get ready, heroes!") + public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_TAUTI_WILL_BEGIN_SHORTLY; - @ClientString(id = 1803422, message = "The third challenge will begin in 10 seconds.") - public static NpcStringId THE_THIRD_CHALLENGE_WILL_BEGIN_IN_10_SECONDS; + @ClientString(id = 1803422, message = "The fighting against Tauti will begin in 10 seconds.") + public static NpcStringId THE_FIGHTING_AGAINST_TAUTI_WILL_BEGIN_IN_10_SECONDS; - @ClientString(id = 1803423, message = "The third challenge will begin.") - public static NpcStringId THE_THIRD_CHALLENGE_WILL_BEGIN; + @ClientString(id = 1803423, message = "Tauti is ready to fight.") + public static NpcStringId TAUTI_IS_READY_TO_FIGHT; - @ClientString(id = 1803424, message = "The third challenge has been completed successfully. The fourth challenge will begin in a moment.") - public static NpcStringId THE_THIRD_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY_THE_FOURTH_CHALLENGE_WILL_BEGIN_IN_A_MOMENT; + @ClientString(id = 1803424, message = "Mary Reed, they are just insects. Haha! Show them your true power!") + public static NpcStringId MARY_REED_THEY_ARE_JUST_INSECTS_HAHA_SHOW_THEM_YOUR_TRUE_POWER; - @ClientString(id = 1803425, message = "Zaken summons monsters from another world.") - public static NpcStringId ZAKEN_SUMMONS_MONSTERS_FROM_ANOTHER_WORLD; + @ClientString(id = 1803425, message = "Do you think you can evade my strike? Take that!") + public static NpcStringId DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT; @ClientString(id = 1803426, message = "Your blood is mine!") public static NpcStringId YOUR_BLOOD_IS_MINE; @@ -38656,11 +38656,11 @@ public class NpcStringId @ClientString(id = 1803428, message = "Zaken reveals his hidden power.") public static NpcStringId ZAKEN_REVEALS_HIS_HIDDEN_POWER; - @ClientString(id = 1803429, message = "Tiat summons his minions.") - public static NpcStringId TIAT_SUMMONS_HIS_MINIONS; + @ClientString(id = 1803429, message = "Mary Reed, these brats are pretty strong. I shall rest up a bit.") + public static NpcStringId MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_I_SHALL_REST_UP_A_BIT; - @ClientString(id = 1803430, message = "Tiat reveals his dignity.") - public static NpcStringId TIAT_REVEALS_HIS_DIGNITY; + @ClientString(id = 1803430, message = "Mary Reed, these brats are pretty strong. Watch out!") + public static NpcStringId MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_WATCH_OUT; @ClientString(id = 1803431, message = "Tauti summons his mechanical contraption.") public static NpcStringId TAUTI_SUMMONS_HIS_MECHANICAL_CONTRAPTION; @@ -38716,8 +38716,8 @@ public class NpcStringId @ClientString(id = 1803448, message = "Antharas has suffered critical injuries.") public static NpcStringId ANTHARAS_HAS_SUFFERED_CRITICAL_INJURIES; - @ClientString(id = 1803449, message = "Mary Reed summons her minions.") - public static NpcStringId MARY_REED_SUMMONS_HER_MINIONS; + @ClientString(id = 1803449, message = "Zaken! Your time has come! Kill them all!") + public static NpcStringId MARY_REED_SUMMONS_ZAKEN; @ClientString(id = 1803450, message = "Mary Reed reveals her true power.") public static NpcStringId MARY_REED_REVEALS_HER_TRUE_POWER; diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml new file mode 100644 index 0000000000..7e3f654c40 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.xml @@ -0,0 +1,48 @@ + + + + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml new file mode 100644 index 0000000000..902cc8c4fc --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.xml @@ -0,0 +1,48 @@ + + + + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml new file mode 100644 index 0000000000..c4f873ca00 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/instances/ThroneOfHeroes/ThroneOfHeroesTauti.xml @@ -0,0 +1,42 @@ + + + + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01.html new file mode 100644 index 0000000000..99b844940b --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01.html @@ -0,0 +1,9 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Goldberg, you need to be a member of a Lv. 7 clan. To fight Mary Reed your clan needs to be at least Lv. 10, while Tauti can only be confronted by a Lv. 13 clan.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, what would you like?
+ + + + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01a.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01a.html new file mode 100644 index 0000000000..cf74b23c1d --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01a.html @@ -0,0 +1,7 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Goldberg, you need to be a member of a Lv. 7 clan.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, would you like to enter?
+ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01b.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01b.html new file mode 100644 index 0000000000..3f6f839ea6 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01b.html @@ -0,0 +1,7 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Mary Reed your clan needs to be at least Lv. 10.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, would you like to enter?
+ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01c.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01c.html new file mode 100644 index 0000000000..37e938eb02 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-01c.html @@ -0,0 +1,7 @@ +Roiental:
+Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.
+If you want to challenge Tauti, you need to be a member of a Lv. 13 clan.
+The request to enter the Throne of Heroes can only be submitted by the clan leader of a clan member who has been granted the requisite authority.
+So, would you like to enter?
+ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02a.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02a.html new file mode 100644 index 0000000000..d0a1cc81b8 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02a.html @@ -0,0 +1,4 @@ +Roiental:
+Your party members are participating in battle. I'll move you to them.
+ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02b.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02b.html new file mode 100644 index 0000000000..a644855574 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02b.html @@ -0,0 +1,4 @@ +Roiental:
+Your party members are participating in battle. I'll move you to them.
+ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02c.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02c.html new file mode 100644 index 0000000000..f462750b0c --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-02c.html @@ -0,0 +1,4 @@ +Roiental:
+Your party members are participating in battle. I'll move you to them.
+ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03a.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03a.html new file mode 100644 index 0000000000..29e2dbf269 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03a.html @@ -0,0 +1,4 @@ +Roiental:
+You are not a clan member or your clan hasn't reached Lv. 7 yet.
+(The Throne of Heroes can only be ascended by members of a command channel from the same clan (4-100 participants). The clan must have reached Lv. 7.) + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03b.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03b.html new file mode 100644 index 0000000000..b91c30765f --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03b.html @@ -0,0 +1,4 @@ +Roiental:
+You are not a clan member or your clan hasn't reached Lv. 10 yet.
+(The Throne of Heroes can only be ascended by members of a command channel from the same clan (4-100 participants). The clan must have reached Lv. 10.) + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03c.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03c.html new file mode 100644 index 0000000000..7b6a9ca066 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-03c.html @@ -0,0 +1,4 @@ +Roiental:
+You are not a clan member or your clan hasn't reached Lv. 13 yet.
+(The Throne of Heroes can only be ascended by members of a command channel from the same clan (4-100 participants). The clan must have reached Lv. 13.) + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-AlreadyDone.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-AlreadyDone.html new file mode 100644 index 0000000000..23cd6faa33 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-AlreadyDone.html @@ -0,0 +1,3 @@ +Roiental:
+Your clan mates already challenged one of the Throne of Heroes raids today.
+ \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-NoLevel.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-NoLevel.html new file mode 100644 index 0000000000..722830900b --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental-NoLevel.html @@ -0,0 +1,4 @@ +Roiental:
+You are not strong enough yet.
+(The Throne of Heroes can only be ascended by characters of level 110 or above.) + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental.java new file mode 100644 index 0000000000..1ed7f116c8 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/areas/Rune/Roiental/Roiental.java @@ -0,0 +1,142 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.areas.Rune.Roiental; + +import org.l2jmobius.gameserver.instancemanager.InstanceManager; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; + +import ai.AbstractNpcAI; + +/** + * Roiental AI. + * @author CostyKiller + */ +public class Roiental extends AbstractNpcAI +{ + // NPCs + private static final int ROIENTAL = 34571; + // Misc + private static final int TOH_GB_TEMPLATE_ID = 307; // Throne of Heroes - Goldberg + private static final int TOH_MR_TEMPLATE_ID = 308; // Throne of Heroes - Mary Reed + private static final int TOH_TA_TEMPLATE_ID = 309; // Throne of Heroes - Tauti + private static final int MIN_LVL = 110; + private static final int CLAN_MIN_LVL_GB = 7; + private static final int CLAN_MIN_LVL_MR = 10; + private static final int CLAN_MIN_LVL_TA = 13; + + private Roiental() + { + addStartNpc(ROIENTAL); + addFirstTalkId(ROIENTAL); + addTalkId(ROIENTAL); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + if (event.equals("enterGoldberg")) + { + if (player.getLevel() < MIN_LVL) + { + htmltext = "Roiental-NoLevel.html"; + } + else if ((player.getClan() == null) || (player.getClan().getLevel() < CLAN_MIN_LVL_GB)) + { + htmltext = "Roiental-03a.html"; + } + else if ((player.getClan() == null) || player.getClan().getVariables().hasVariable("TOH_DONE")) + { + htmltext = "Roiental-AlreadyDone.html"; + } + else + { + htmltext = "Roiental-01a.html"; + } + } + if (event.equals("enterMaryReed")) + { + if (player.getLevel() < MIN_LVL) + { + htmltext = "Roiental-NoLevel.html"; + } + else if ((player.getClan() == null) || (player.getClan().getLevel() < CLAN_MIN_LVL_MR)) + { + htmltext = "Roiental-03b.html"; + } + else if ((player.getClan() == null) || player.getClan().getVariables().hasVariable("TOH_DONE")) + { + htmltext = "Roiental-AlreadyDone.html"; + } + else + { + htmltext = "Roiental-01b.html"; + } + } + if (event.equals("enterTauti")) + { + if (player.getLevel() < MIN_LVL) + { + htmltext = "Roiental-NoLevel.html"; + } + else if ((player.getClan() == null) || (player.getClan().getLevel() < CLAN_MIN_LVL_TA)) + { + htmltext = "Roiental-03c.html"; + } + else if ((player.getClan() == null) || player.getClan().getVariables().hasVariable("TOH_DONE")) + { + htmltext = "Roiental-AlreadyDone.html"; + } + else + { + htmltext = "Roiental-01c.html"; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + String htmltext = null; + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && ((instance.getTemplateId() == TOH_GB_TEMPLATE_ID))) + { + htmltext = "Roiental-02a.html"; + } + else if ((instance != null) && ((instance.getTemplateId() == TOH_MR_TEMPLATE_ID))) + { + htmltext = "Roiental-02b.html"; + } + else if ((instance != null) && ((instance.getTemplateId() == TOH_TA_TEMPLATE_ID))) + { + htmltext = "Roiental-02c.html"; + } + else + { + htmltext = "Roiental-01.html"; + } + return htmltext; + } + + public static void main(String[] args) + { + new Roiental(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java new file mode 100644 index 0000000000..19e9818c7e --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java @@ -0,0 +1,210 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.ThroneOfHeroes; + +import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author CostyKiller // https://www.youtube.com/watch?v=fJWAWU5XpZk + */ +public class ThroneOfHeroesGoldberg extends AbstractInstance +{ + // NPCs + private static final int ROIENTAL = 34571; + // Monsters + private static final int GOLDBERG = 26250; + private static final int[] GOLDBERG_MINIONS = + { + 26251, // Handy Cannon Gunner + 26252, // Anchor Warrior + 26253, // Operator + 26254 // Axe Warrior + }; + // Throne's Treasure Chest Goldberg + private static final int TREASURE_CHEST = 26455; + + // World Instance + Instance world = null; + + // Misc + private static final int TEMPLATE_ID = 307; + + public ThroneOfHeroesGoldberg() + { + super(TEMPLATE_ID); + addInstanceCreatedId(TEMPLATE_ID); + addStartNpc(ROIENTAL); + addTalkId(ROIENTAL); + addAttackId(GOLDBERG); + addKillId(GOLDBERG); + } + + @Override + public void onInstanceCreated(Instance activeInstance, PlayerInstance player) + { + activeInstance.setStatus(0); + startQuestTimer("ANNOUNCE_RAID_START", 10000, null, player); + world = activeInstance; + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + switch (event) + { + case "enterInstance": + { + enterInstance(player, npc, TEMPLATE_ID); + startQuestTimer("ANNOUNCE_RAID_PREP", 20000, null, player); + break; + } + case "reenterInstance": + { + final Instance activeInstance = getPlayerInstance(player); + if (isInInstance(activeInstance)) + { + enterInstance(player, npc, activeInstance.getTemplateId()); + } + } + case "ANNOUNCE_RAID_START": + { + showOnScreenMsg(world, NpcStringId.THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_GOLDBERG_WILL_BEGIN_SHORTLY_PLEASE_GET_READY, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_RAID_PREP", 15000, null, player); + break; + } + case "ANNOUNCE_RAID_PREP": + { + showOnScreenMsg(world, NpcStringId.THE_FIGHTING_AGAINST_GOLDBERG_WILL_BEGIN_IN_10_SECONDS, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_5", 5000, null, player); + break; + } + case "ANNOUNCE_5": + { + showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_4", 1000, null, player); + break; + } + case "ANNOUNCE_4": + { + showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_3", 1000, null, player); + break; + } + case "ANNOUNCE_3": + { + showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_2", 1000, null, player); + break; + } + case "ANNOUNCE_2": + { + showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_1", 1000, null, player); + break; + } + case "ANNOUNCE_1": + { + showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("SPAWN_GOLDBERG", 1000, null, player); + break; + } + case "SPAWN_GOLDBERG": + { + showOnScreenMsg(world, NpcStringId.GOLDBERG_APPEARS, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("GOLDBERG"); + break; + } + case "SPAWN_GOLDBERG_MINIONS": + { + showOnScreenMsg(world, NpcStringId.GOLDBERG_SUMMONS_HIS_MINIONS, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("GOLDBERG_MINIONS"); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + final int hpPer = npc.getCurrentHpPercent(); + final int maxHp = npc.getMaxHp(); + if (npc.getId() == GOLDBERG) + { + if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0)) + { + startQuestTimer("SPAWN_GOLDBERG_MINIONS", 10000, npc, null); + npc.setScriptValue(1); + } + else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1)) + { + showOnScreenMsg(world, NpcStringId.GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM, ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(2); + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + if (npc.getId() == GOLDBERG) + { + // Despawn minions and stop timer + cancelQuestTimer("SPAWN_GOLDBERG_MINIONS", npc, killer); + world.getAliveNpcs(GOLDBERG_MINIONS).forEach(beast -> beast.doDie(null)); + + // Spawn treasure chests + boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8)); + if (killer.isGM() || eightCCMembersOrMore) + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + else + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + // Finish instance + world.finishInstance(2); + // Set clan variable + killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis()); + killer.getClan().getVariables().storeMe(); + } + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new ThroneOfHeroesGoldberg(); + } +} diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java new file mode 100644 index 0000000000..190fac7327 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java @@ -0,0 +1,226 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.ThroneOfHeroes; + +import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.commons.util.CommonUtil; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author CostyKiller + */ +public class ThroneOfHeroesMaryReed extends AbstractInstance +{ + + // NPCs + private static final int ROIENTAL = 34571; + // Monsters + private static final int MARY_REED = 26267; + private static final int[] MARY_REED_MINIONS = + { + // add Zaken as minion + 26268, // Shield Master --> + 26269, // Spear Master --> + 26270, // Bow Master --> + 26271 // Magic Master --> + }; + // Throne's Treasure Chest Mary Reed + private static final int TREASURE_CHEST = 26456; + + // World Instance + Instance world = null; + + // Misc + private static final int TEMPLATE_ID = 308; + + // Npc Dialogs + private static final NpcStringId[] MINIONS_MESSAGES = + { + NpcStringId.MARY_REED_THEY_ARE_JUST_INSECTS_HAHA_SHOW_THEM_YOUR_TRUE_POWER, + NpcStringId.MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_I_SHALL_REST_UP_A_BIT, + NpcStringId.MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_WATCH_OUT, + NpcStringId.MARY_REED_REVEALS_HER_TRUE_POWER + }; + + public ThroneOfHeroesMaryReed() + { + super(TEMPLATE_ID); + addInstanceCreatedId(TEMPLATE_ID); + addStartNpc(ROIENTAL); + addTalkId(ROIENTAL); + addAttackId(MARY_REED); + addKillId(MARY_REED); + } + + @Override + public void onInstanceCreated(Instance activeInstance, PlayerInstance player) + { + activeInstance.setStatus(0); + startQuestTimer("ANNOUNCE_RAID_START", 10000, null, player); + world = activeInstance; + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + switch (event) + { + case "enterInstance": + { + enterInstance(player, npc, TEMPLATE_ID); + startQuestTimer("ANNOUNCE_RAID_PREP", 20000, null, player); + break; + } + case "reenterInstance": + { + final Instance activeInstance = getPlayerInstance(player); + if (isInInstance(activeInstance)) + { + enterInstance(player, npc, activeInstance.getTemplateId()); + } + } + case "ANNOUNCE_RAID_START": + { + showOnScreenMsg(world, NpcStringId.THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_MARY_REED_WILL_BEGIN_SHORTLY, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_RAID_PREP", 15000, null, player); + break; + } + case "ANNOUNCE_RAID_PREP": + { + showOnScreenMsg(world, NpcStringId.THE_FIGHTING_AGAINST_MARY_REED_WILL_BEGIN_IN_10_SECONDS, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_5", 10000, null, player); + break; + } + case "ANNOUNCE_5": + { + showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_4", 2000, null, player); + break; + } + case "ANNOUNCE_4": + { + showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_3", 2000, null, player); + break; + } + case "ANNOUNCE_3": + { + showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_2", 2000, null, player); + break; + } + case "ANNOUNCE_2": + { + showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_1", 2000, null, player); + break; + } + case "ANNOUNCE_1": + { + showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("SPAWN_MARY_REED", 2000, null, player); + break; + } + case "SPAWN_MARY_REED": + { + showOnScreenMsg(world, NpcStringId.MARY_REED_GREETS_HEROES, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("MARY_REED"); + break; + } + case "SPAWN_MARY_REED_MINIONS": + { + showOnScreenMsg(world, NpcStringId.MARY_REED_SUMMONS_ZAKEN, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("MARY_REED_MINIONS"); + break; + } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + final int hpPer = npc.getCurrentHpPercent(); + final int maxHp = npc.getMaxHp(); + if (npc.getId() == MARY_REED) + { + if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0)) + { + startQuestTimer("SPAWN_MARY_REED_MINIONS", 10000, npc, null); + npc.setScriptValue(1); + } + else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1)) + { + showOnScreenMsg(world, NpcStringId.DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT, ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(2); + } + } + else if (CommonUtil.contains(MARY_REED_MINIONS, npc.getId()) && world.getNpc(MARY_REED).isScriptValue(2)) + { + showOnScreenMsg(world, MINIONS_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true); + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + if (npc.getId() == MARY_REED) + { + // Despawn minions and stop timer + cancelQuestTimer("SPAWN_MARY_REED_MINIONS", npc, killer); + world.getAliveNpcs(MARY_REED_MINIONS).forEach(beast -> beast.doDie(null)); + + // Spawn treasure chests + boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8)); + if (killer.isGM() || eightCCMembersOrMore) + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + else + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + // Finish instance + world.finishInstance(2); + // Set clan variable + killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis()); + killer.getClan().getVariables().storeMe(); + } + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new ThroneOfHeroesMaryReed(); + } +} diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java new file mode 100644 index 0000000000..049d37f60e --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java @@ -0,0 +1,213 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package instances.ThroneOfHeroes; + +import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import instances.AbstractInstance; + +/** + * @author CostyKiller + */ +public class ThroneOfHeroesTauti extends AbstractInstance +{ + + // NPCs + private static final int ROIENTAL = 34571; + // Monsters + private static final int TAUTI = 26266; + + // Throne's Treasure Chest Tauti + private static final int TREASURE_CHEST = 26457; + + // World Instance + Instance world = null; + + // Misc + private static final int TEMPLATE_ID = 309; + + // Npc Dialogs + private static final NpcStringId[] TAUTI_MESSAGES = + { + NpcStringId.TAUTI_INTENDS_TO_SHOW_OFF_HIS_POWER_TO_HIS_FOLLOWERS, + NpcStringId.TAUTI_INTENDS_TO_SHOW_OFF_HIS_POWER_TO_THOSE_WHO_AVOID_HIM + }; + + public ThroneOfHeroesTauti() + { + super(TEMPLATE_ID); + addInstanceCreatedId(TEMPLATE_ID); + addStartNpc(ROIENTAL); + addTalkId(ROIENTAL); + addAttackId(TAUTI); + addKillId(TAUTI); + } + + @Override + public void onInstanceCreated(Instance activeInstance, PlayerInstance player) + { + activeInstance.setStatus(0); + startQuestTimer("ANNOUNCE_RAID_START", 10000, null, player); + world = activeInstance; + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + switch (event) + { + case "enterInstance": + { + enterInstance(player, npc, TEMPLATE_ID); + startQuestTimer("ANNOUNCE_RAID_PREP", 20000, null, player); + break; + } + case "reenterInstance": + { + final Instance activeInstance = getPlayerInstance(player); + if (isInInstance(activeInstance)) + { + enterInstance(player, npc, activeInstance.getTemplateId()); + } + } + case "ANNOUNCE_RAID_START": + { + showOnScreenMsg(world, NpcStringId.THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_TAUTI_WILL_BEGIN_SHORTLY, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_RAID_PREP", 15000, null, player); + break; + } + case "ANNOUNCE_RAID_PREP": + { + showOnScreenMsg(world, NpcStringId.THE_FIGHTING_AGAINST_TAUTI_WILL_BEGIN_IN_10_SECONDS, ExShowScreenMessage.TOP_CENTER, 5000, true); + startQuestTimer("ANNOUNCE_5", 10000, null, player); + break; + } + case "ANNOUNCE_5": + { + showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_4", 2000, null, player); + break; + } + case "ANNOUNCE_4": + { + showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_3", 2000, null, player); + break; + } + case "ANNOUNCE_3": + { + showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_2", 2000, null, player); + break; + } + case "ANNOUNCE_2": + { + showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("ANNOUNCE_1", 2000, null, player); + break; + } + case "ANNOUNCE_1": + { + showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true); + startQuestTimer("SPAWN_TAUTI", 2000, null, player); + break; + } + case "SPAWN_TAUTI": + { + showOnScreenMsg(world, NpcStringId.TAUTI_IS_READY_TO_FIGHT, ExShowScreenMessage.TOP_CENTER, 5000, true); + world.spawnGroup("TAUTI"); + break; + } + // case "SPAWN_TAUTI_MINIONS": + // { + // showOnScreenMsg(world, NpcStringId.TAUTI_SUMMONS_HIS_MECHANICAL_CONTRAPTION, ExShowScreenMessage.TOP_CENTER, 5000, true); + // world.spawnGroup("TAUTI_MINIONS"); + // break; + // } + } + return super.onAdvEvent(event, npc, player); + } + + @Override + public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + final int hpPer = npc.getCurrentHpPercent(); + final int maxHp = npc.getMaxHp(); + if (npc.getId() == TAUTI) + { + if ((hpPer < (maxHp * 0.50)) && npc.isScriptValue(0)) + { + // startQuestTimer("SPAWN_TAUTI_MINIONS", 10000, npc, null); + showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(1); + } + else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1)) + { + showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true); + npc.setScriptValue(2); + } + } + } + return super.onAttack(npc, attacker, damage, isSummon); + } + + @Override + public String onKill(Npc npc, PlayerInstance killer, boolean isSummon) + { + final Instance world = npc.getInstanceWorld(); + if (isInInstance(world)) + { + if (npc.getId() == TAUTI) + { + // Despawn minions and stop timer + // cancelQuestTimer("SPAWN_TAUTI_MINIONS", npc, killer); + // world.getAliveNpcs(TAUTI_MINIONS).forEach(beast -> beast.doDie(null)); + + // Spawn treasure chests + boolean eightCCMembersOrMore = ((killer.getCommandChannel() != null) && (killer.getCommandChannel().getMemberCount() >= 8)); + if (killer.isGM() || eightCCMembersOrMore) + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + else + { + addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true); + } + // Finish instance + world.finishInstance(2); + // Set clan variable + killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis()); + killer.getClan().getVariables().storeMe(); + } + } + return super.onKill(npc, killer, isSummon); + } + + public static void main(String[] args) + { + new ThroneOfHeroesTauti(); + } +} diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html new file mode 100644 index 0000000000..8b6da8c9f0 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html @@ -0,0 +1,4 @@ +Roiental:
+That many people can't be moved.
+(A maximum of 100 people can participate.) + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html new file mode 100644 index 0000000000..c1ec97ef04 --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html @@ -0,0 +1,3 @@ +Roiental:
+As I explained earlier, you can enter only by forming an association. + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html new file mode 100644 index 0000000000..c5f7d5499a --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html @@ -0,0 +1,4 @@ +Roiental:
+You are too weak. I won't let you enter.
+(Only players of at least level 110 may participate.) + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/spawns/Rune/TownOfRune.xml b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/spawns/Rune/TownOfRune.xml index df4ec17638..0b2d3f1dfc 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/spawns/Rune/TownOfRune.xml +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/spawns/Rune/TownOfRune.xml @@ -151,6 +151,7 @@ + \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/26200-26299.xml b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/26200-26299.xml index 1bf77c9ecc..55895b000e 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/26200-26299.xml +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/stats/npcs/26200-26299.xml @@ -2925,7 +2925,7 @@ - + UNDEAD MALE @@ -2939,6 +2939,11 @@ + + + GOLDBERG_TOH + + @@ -2948,32 +2953,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + ETC FEMALE @@ -2986,13 +2967,18 @@ - + + + + GOLDBERG_TOH + + - + ETC FEMALE @@ -3005,13 +2991,18 @@ - + + + + GOLDBERG_TOH + + - + ETC FEMALE @@ -3024,13 +3015,18 @@ - + + + + GOLDBERG_TOH + + - + ETC FEMALE @@ -3043,7 +3039,12 @@ - + + + + GOLDBERG_TOH + + @@ -3052,7 +3053,7 @@ UNDEAD MALE - + @@ -3063,6 +3064,11 @@ + + + ZAKEN_TOH + + @@ -3072,32 +3078,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + ETC FEMALE @@ -3110,13 +3092,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3130,13 +3117,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3149,13 +3141,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3168,13 +3165,18 @@ - + + + + ZAKEN_TOH + + - + ETC FEMALE @@ -3187,35 +3189,46 @@ - + + + + ZAKEN_TOH + + - - DRAGON + + + ETC FEMALE - + + + - - - - - - - - + + + + TIAT_TOH + + + + + + + @@ -3241,12 +3254,13 @@ - + ETC FEMALE + - + @@ -3254,38 +3268,50 @@ - + + + + TIAT_TOH + + - + ETC FEMALE + - + - + - + + + + TIAT_TOH + + - + ETC FEMALE + - + @@ -3293,18 +3319,24 @@ - + + + + TIAT_TOH + + - + ETC FEMALE + - + @@ -3312,13 +3344,18 @@ - + + + + TIAT_TOH + + - + DEMONIC MALE @@ -3341,37 +3378,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + UNDEAD MALE - + @@ -3380,6 +3393,11 @@ + + + MARY_REED_TOH + + @@ -3389,37 +3407,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + ETC FEMALE + - + @@ -3427,18 +3422,24 @@ - + + + + MARY_REED_TOH + + - + ETC FEMALE + - + @@ -3446,19 +3447,25 @@ - + + + + MARY_REED_TOH + + - + ETC FEMALE + - + @@ -3466,18 +3473,24 @@ - + + + + MARY_REED_TOH + + - + ETC FEMALE + - + @@ -3485,7 +3498,12 @@ - + + + + MARY_REED_TOH + + diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/xsd/instance.xsd b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/xsd/instance.xsd index 8c43060e41..4430bc9b58 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/xsd/instance.xsd +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/xsd/instance.xsd @@ -142,6 +142,7 @@ + diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionCommandChannelLeaderSameClan.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionCommandChannelLeaderSameClan.java new file mode 100644 index 0000000000..095e9df83e --- /dev/null +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/instancezone/conditions/ConditionCommandChannelLeaderSameClan.java @@ -0,0 +1,51 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.l2jmobius.gameserver.model.instancezone.conditions; + +import org.l2jmobius.gameserver.model.AbstractPlayerGroup; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.instancezone.InstanceTemplate; +import org.l2jmobius.gameserver.network.SystemMessageId; + +/** + * Command channel leader same clan condition + * @author CostyKiller + */ +public class ConditionCommandChannelLeaderSameClan extends Condition +{ + public ConditionCommandChannelLeaderSameClan(InstanceTemplate template, StatSet parameters, boolean onlyLeader, boolean showMessageAndHtml) + { + super(template, parameters, true, showMessageAndHtml); + setSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER); + } + + @Override + public boolean test(PlayerInstance player, Npc npc) + { + final AbstractPlayerGroup group = player.getCommandChannel(); + return ((group != null) && group.isLeader(player) && group.forEachMember(m -> + { + if (m.getClan() == player.getClan()) + { + return true; + } + return false; + })); + } +} \ No newline at end of file diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/NpcStringId.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/NpcStringId.java index 30c0aacdb7..296e607fed 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/NpcStringId.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/NpcStringId.java @@ -38590,11 +38590,11 @@ public class NpcStringId @ClientString(id = 1803406, message = "See? There's nothing you and I can't do when we're together!") public static NpcStringId SEE_THERE_S_NOTHING_YOU_AND_I_CAN_T_DO_WHEN_WE_RE_TOGETHER; - @ClientString(id = 1803407, message = "The challenge for the Throne of Heroes will begin shortly. Please get ready.") - public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_WILL_BEGIN_SHORTLY_PLEASE_GET_READY; + @ClientString(id = 1803407, message = "The challenge for the Throne of Heroes - Goldberg will begin shortly.\nPlease get ready, heroes!") + public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_GOLDBERG_WILL_BEGIN_SHORTLY_PLEASE_GET_READY; - @ClientString(id = 1803408, message = "The first challenge will begin in 10 seconds.") - public static NpcStringId THE_FIRST_CHALLENGE_WILL_BEGIN_IN_10_SECONDS; + @ClientString(id = 1803408, message = "The fighting against Goldberg will begin in 10 seconds.") + public static NpcStringId THE_FIGHTING_AGAINST_GOLDBERG_WILL_BEGIN_IN_10_SECONDS; @ClientString(id = 1803409, message = "5 seconds") public static NpcStringId FIVE_SECONDS; @@ -38611,41 +38611,41 @@ public class NpcStringId @ClientString(id = 1803413, message = "1 second") public static NpcStringId ONE_SECOND_2; - @ClientString(id = 1803414, message = "The first challenge begins.") - public static NpcStringId THE_FIRST_CHALLENGE_BEGINS; + @ClientString(id = 1803414, message = "Goldberg appears.") + public static NpcStringId GOLDBERG_APPEARS; @ClientString(id = 1803415, message = "Darion frees himself from the restraints that suppressed him and reveals his true power.") public static NpcStringId DARION_FREES_HIMSELF_FROM_THE_RESTRAINTS_THAT_SUPPRESSED_HIM_AND_REVEALS_HIS_TRUE_POWER; - @ClientString(id = 1803416, message = "The first challenge has been completed successfully. The second challenge will begin shortly.") - public static NpcStringId THE_FIRST_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY_THE_SECOND_CHALLENGE_WILL_BEGIN_SHORTLY; + @ClientString(id = 1803416, message = "The challenge for the Throne of Heroes - Mary Reed will begin shortly.\nPlease get ready, heroes!") + public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_MARY_REED_WILL_BEGIN_SHORTLY; - @ClientString(id = 1803417, message = "The second challenge will begin in 10 seconds.") - public static NpcStringId THE_SECOND_CHALLENGE_WILL_BEGIN_IN_10_SECONDS; + @ClientString(id = 1803417, message = "The fighting against Mary Reed will begin in 10 seconds.") + public static NpcStringId THE_FIGHTING_AGAINST_MARY_REED_WILL_BEGIN_IN_10_SECONDS; - @ClientString(id = 1803418, message = "The second challenge will begin.") - public static NpcStringId THE_SECOND_CHALLENGE_WILL_BEGIN; + @ClientString(id = 1803418, message = "Mary Reed greets heroes.") + public static NpcStringId MARY_REED_GREETS_HEROES; - @ClientString(id = 1803419, message = "Goldberg will summon his minions in 5 seconds.") - public static NpcStringId GOLDBERG_WILL_SUMMON_HIS_MINIONS_IN_5_SECONDS; + @ClientString(id = 1803419, message = "Goldberg summons his minions.") + public static NpcStringId GOLDBERG_SUMMONS_HIS_MINIONS; @ClientString(id = 1803420, message = "Goldberg brings out all of the power within him.") public static NpcStringId GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM; - @ClientString(id = 1803421, message = "The second challenge has been completed successfully. The third challenge will begin shortly.") - public static NpcStringId THE_SECOND_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY_THE_THIRD_CHALLENGE_WILL_BEGIN_SHORTLY; + @ClientString(id = 1803421, message = "The challenge for the Throne of Heroes - Tauti will begin shortly.\nPlease get ready, heroes!") + public static NpcStringId THE_CHALLENGE_FOR_THE_THRONE_OF_HEROES_TAUTI_WILL_BEGIN_SHORTLY; - @ClientString(id = 1803422, message = "The third challenge will begin in 10 seconds.") - public static NpcStringId THE_THIRD_CHALLENGE_WILL_BEGIN_IN_10_SECONDS; + @ClientString(id = 1803422, message = "The fighting against Tauti will begin in 10 seconds.") + public static NpcStringId THE_FIGHTING_AGAINST_TAUTI_WILL_BEGIN_IN_10_SECONDS; - @ClientString(id = 1803423, message = "The third challenge will begin.") - public static NpcStringId THE_THIRD_CHALLENGE_WILL_BEGIN; + @ClientString(id = 1803423, message = "Tauti is ready to fight.") + public static NpcStringId TAUTI_IS_READY_TO_FIGHT; - @ClientString(id = 1803424, message = "The third challenge has been completed successfully. The fourth challenge will begin in a moment.") - public static NpcStringId THE_THIRD_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY_THE_FOURTH_CHALLENGE_WILL_BEGIN_IN_A_MOMENT; + @ClientString(id = 1803424, message = "Mary Reed, they are just insects. Haha! Show them your true power!") + public static NpcStringId MARY_REED_THEY_ARE_JUST_INSECTS_HAHA_SHOW_THEM_YOUR_TRUE_POWER; - @ClientString(id = 1803425, message = "Zaken summons monsters from another world.") - public static NpcStringId ZAKEN_SUMMONS_MONSTERS_FROM_ANOTHER_WORLD; + @ClientString(id = 1803425, message = "Do you think you can evade my strike? Take that!") + public static NpcStringId DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT; @ClientString(id = 1803426, message = "Your blood is mine!") public static NpcStringId YOUR_BLOOD_IS_MINE; @@ -38656,11 +38656,11 @@ public class NpcStringId @ClientString(id = 1803428, message = "Zaken reveals his hidden power.") public static NpcStringId ZAKEN_REVEALS_HIS_HIDDEN_POWER; - @ClientString(id = 1803429, message = "Tiat summons his minions.") - public static NpcStringId TIAT_SUMMONS_HIS_MINIONS; + @ClientString(id = 1803429, message = "Mary Reed, these brats are pretty strong. I shall rest up a bit.") + public static NpcStringId MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_I_SHALL_REST_UP_A_BIT; - @ClientString(id = 1803430, message = "Tiat reveals his dignity.") - public static NpcStringId TIAT_REVEALS_HIS_DIGNITY; + @ClientString(id = 1803430, message = "Mary Reed, these brats are pretty strong. Watch out!") + public static NpcStringId MARY_REED_THESE_BRATS_ARE_PRETTY_STRONG_WATCH_OUT; @ClientString(id = 1803431, message = "Tauti summons his mechanical contraption.") public static NpcStringId TAUTI_SUMMONS_HIS_MECHANICAL_CONTRAPTION; @@ -38716,8 +38716,8 @@ public class NpcStringId @ClientString(id = 1803448, message = "Antharas has suffered critical injuries.") public static NpcStringId ANTHARAS_HAS_SUFFERED_CRITICAL_INJURIES; - @ClientString(id = 1803449, message = "Mary Reed summons her minions.") - public static NpcStringId MARY_REED_SUMMONS_HER_MINIONS; + @ClientString(id = 1803449, message = "Zaken! Your time has come! Kill them all!") + public static NpcStringId MARY_REED_SUMMONS_ZAKEN; @ClientString(id = 1803450, message = "Mary Reed reveals her true power.") public static NpcStringId MARY_REED_REVEALS_HER_TRUE_POWER;