New Throne of Heroes Instances.

Contributed by CostyKiller.
This commit is contained in:
MobiusDevelopment
2021-03-20 07:14:16 +00:00
parent 534289035c
commit caf165521e
54 changed files with 2514 additions and 370 deletions

View File

@@ -0,0 +1,9 @@
<html><body>Roiental:<br>
Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.<br>
If you want to challenge Goldberg, you need to be a member of a <font color="LEVEL">Lv. 7 clan</font>. To fight Mary Reed your clan needs to be at least <font color="LEVEL">Lv. 10</font>, while Tauti can only be confronted by a <font color="LEVEL">Lv. 13 clan</font>.<br>
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.<br>
So, what would you like?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Roiental enterGoldberg">Go to Throne of Heroes - Goldberg</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Roiental enterMaryReed">Go to Throne of Heroes - Mary Reed</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Roiental enterTauti">Go to Throne of Heroes - Tauti</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Roiental:<br>
Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.<br>
If you want to challenge Goldberg, you need to be a member of a <font color="LEVEL">Lv. 7 clan</font>.<br>
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.<br>
So, would you like to enter?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ThroneOfHeroesGoldberg enterInstance">Yes go to Throne of Heroes - Goldberg</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Roiental:<br>
Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.<br>
If you want to challenge Mary Reed your clan needs to be at least <font color="LEVEL">Lv. 10</font>.<br>
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.<br>
So, would you like to enter?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ThroneOfHeroesMaryReed enterInstance">Yes go to Throne of Heroes - Mary Reed</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Roiental:<br>
Heroes whose strength grows day after day can put their abilities to the test and ascend the renovated Throne of Heroes.<br>
If you want to challenge Tauti, you need to be a member of a <font color="LEVEL">Lv. 13 clan</font>.<br>
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.<br>
So, would you like to enter?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ThroneOfHeroesTauti enterInstance">Yes go to Throne of Heroes - Tauti</Button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
Your party members are participating in battle. I'll move you to them.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ThroneOfHeroesGoldberg reenterInstance">"Thanks!"</Button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
Your party members are participating in battle. I'll move you to them.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ThroneOfHeroesMaryReed reenterInstance">"Thanks!"</Button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
Your party members are participating in battle. I'll move you to them.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ThroneOfHeroesTauti reenterInstance">"Thanks!"</Button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
You are not a clan member or your clan hasn't reached Lv. 7 yet.<br>
(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.)
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
You are not a clan member or your clan hasn't reached Lv. 10 yet.<br>
(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.)
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
You are not a clan member or your clan hasn't reached Lv. 13 yet.<br>
(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.)
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Roiental:<br>
Your clan mates already challenged one of the Throne of Heroes raids today.<br>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Roiental:<br>
You are not strong enough yet.<br>
(The Throne of Heroes can only be ascended by characters of level 110 or above.)
</body></html>

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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>

View File

@@ -0,0 +1,3 @@
<html><body>Roiental:<br>
As I explained earlier, you can enter only by forming an association.
</body></html>

View File

@@ -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>