Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java
- ===================================================================
- --- dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java (nonexistent)
- +++ dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesGoldberg.java (working copy)
- @@ -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 <http://www.gnu.org/licenses/>.
- + */
- +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();
- + }
- +}
- Index: dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java
- ===================================================================
- --- dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java (nonexistent)
- +++ dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesMaryReed.java (working copy)
- @@ -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 <http://www.gnu.org/licenses/>.
- + */
- +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();
- + }
- +}
- Index: dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java
- ===================================================================
- --- dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java (nonexistent)
- +++ dist/game/data/scripts/instances/ThroneOfHeroes/ThroneOfHeroesTauti.java (working copy)
- @@ -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 <http://www.gnu.org/licenses/>.
- + */
- +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();
- + }
- +}
- Index: dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html
- ===================================================================
- --- dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html (nonexistent)
- +++ dist/game/data/scripts/instances/ThroneOfHeroes/condBigGroup.html (working copy)
- @@ -0,0 +1,4 @@
- +<html><body>Roiental:<br>
- +That many people can't be moved.<br>
- +(A maximum of 100 people can participate.)
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html
- ===================================================================
- --- dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html (nonexistent)
- +++ dist/game/data/scripts/instances/ThroneOfHeroes/condNoGroup.html (working copy)
- @@ -0,0 +1,3 @@
- +<html><body>Roiental:<br>
- +As I explained earlier, you can enter only by forming an association.
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html
- ===================================================================
- --- dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html (nonexistent)
- +++ dist/game/data/scripts/instances/ThroneOfHeroes/condNoLevel.html (working copy)
- @@ -0,0 +1,4 @@
- +<html><body>Roiental:<br>
- +You are too weak. I won't let you enter.<br>
- +(Only players of at least level 110 may participate.)
- +</body></html>
- \ No newline at end of file
Add Comment
Please, Sign In to add comment