Additions for Throne of Heroes instances.
Contributed by CostyKiller.
This commit is contained in:
parent
fe7b406bba
commit
3c99e73eee
@ -4,8 +4,7 @@
|
||||
<time duration="60" empty="1" />
|
||||
<locations>
|
||||
<enter type="FIXED">
|
||||
<location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
|
||||
<!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
|
||||
<location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
|
||||
</enter>
|
||||
<exit type="ORIGIN" />
|
||||
</locations>
|
||||
@ -39,10 +38,10 @@
|
||||
<npc id="26250" x="11704" y="-86511" z="-10929" heading="0" /> <!-- Goldberg -->
|
||||
</group>
|
||||
<group name="GOLDBERG_MINIONS" spawnByDefault="false">
|
||||
<npc id="26251" x="11797" y="-86046" z="-10964" heading="0" respawnTime="1min" /> <!-- Handy Cannon Gunner -->
|
||||
<npc id="26252" x="11704" y="-86904" z="-10964" heading="0" respawnTime="1min" /> <!-- Anchor Warrior -->
|
||||
<npc id="26253" x="11303" y="-86510" z="-10964" heading="0" respawnTime="1min" /> <!-- Operator -->
|
||||
<npc id="26254" x="12136" y="-86488" z="-10964" heading="0" respawnTime="1min" /> <!-- Axe Warrior -->
|
||||
<npc id="26251" x="11797" y="-86046" z="-10964" heading="0" /> <!-- Handy Cannon Gunner -->
|
||||
<npc id="26252" x="11704" y="-86904" z="-10964" heading="0" /> <!-- Anchor Warrior -->
|
||||
<npc id="26253" x="11303" y="-86510" z="-10964" heading="0" /> <!-- Operator -->
|
||||
<npc id="26254" x="12136" y="-86488" z="-10964" heading="0" /> <!-- Axe Warrior -->
|
||||
</group>
|
||||
</spawnlist>
|
||||
</instance>
|
@ -4,8 +4,7 @@
|
||||
<time duration="60" empty="1" />
|
||||
<locations>
|
||||
<enter type="FIXED">
|
||||
<location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
|
||||
<!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
|
||||
<location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
|
||||
</enter>
|
||||
<exit type="ORIGIN" />
|
||||
</locations>
|
||||
@ -38,11 +37,8 @@
|
||||
<group name="MARY_REED" spawnByDefault="false">
|
||||
<npc id="26267" x="11704" y="-86511" z="-10929" heading="0" /> <!-- Mary Reed -->
|
||||
</group>
|
||||
<group name="MARY_REED_MINIONS" spawnByDefault="false">
|
||||
<npc id="26268" x="11797" y="-86046" z="-10964" heading="0" respawnTime="1min" /> <!-- Shield Master -->
|
||||
<npc id="26269" x="11704" y="-86904" z="-10964" heading="0" respawnTime="1min" /> <!-- Spear Master -->
|
||||
<npc id="26270" x="11303" y="-86510" z="-10964" heading="0" respawnTime="1min" /> <!-- Bow Master -->
|
||||
<npc id="26271" x="12136" y="-86488" z="-10964" heading="0" respawnTime="1min" /> <!-- Magic Master -->
|
||||
<group name="MARY_REED_MINION_ZAKEN" spawnByDefault="false">
|
||||
<npc id="26255" x="11797" y="-86046" z="-10964" heading="0" /> <!-- Zaken -->
|
||||
</group>
|
||||
</spawnlist>
|
||||
</instance>
|
@ -4,8 +4,7 @@
|
||||
<time duration="60" empty="1" />
|
||||
<locations>
|
||||
<enter type="FIXED">
|
||||
<location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
|
||||
<!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
|
||||
<location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
|
||||
</enter>
|
||||
<exit type="ORIGIN" />
|
||||
</locations>
|
||||
|
@ -152,18 +152,17 @@ public class ThroneOfHeroesGoldberg extends AbstractInstance
|
||||
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))
|
||||
if ((hpPer <= 50) && world.isStatus(0))
|
||||
{
|
||||
startQuestTimer("SPAWN_GOLDBERG_MINIONS", 10000, npc, null);
|
||||
npc.setScriptValue(1);
|
||||
world.setStatus(1);
|
||||
}
|
||||
else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
|
||||
else if ((hpPer <= 30) && world.isStatus(1))
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(2);
|
||||
world.setStatus(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,18 +185,21 @@ public class ThroneOfHeroesGoldberg extends AbstractInstance
|
||||
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);
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
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, world.getId());
|
||||
}
|
||||
// Finish instance
|
||||
world.finishInstance(2);
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -36,14 +35,8 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
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 -->
|
||||
};
|
||||
private static final int MARY_REED_MINION_ZAKEN = 26255;
|
||||
|
||||
// Throne's Treasure Chest Mary Reed
|
||||
private static final int TREASURE_CHEST = 26456;
|
||||
|
||||
@ -54,7 +47,7 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
private static final int TEMPLATE_ID = 308;
|
||||
|
||||
// Npc Dialogs
|
||||
private static final NpcStringId[] MINIONS_MESSAGES =
|
||||
private static final NpcStringId[] ZAKEN_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,
|
||||
@ -68,7 +61,7 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
addInstanceCreatedId(TEMPLATE_ID);
|
||||
addStartNpc(ROIENTAL);
|
||||
addTalkId(ROIENTAL);
|
||||
addAttackId(MARY_REED);
|
||||
addAttackId(MARY_REED, MARY_REED_MINION_ZAKEN);
|
||||
addKillId(MARY_REED);
|
||||
}
|
||||
|
||||
@ -114,31 +107,31 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
case "ANNOUNCE_5":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_4", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_4", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_4":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_3", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_3", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_3":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_2", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_2", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_2":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_1", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_1", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_1":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("SPAWN_MARY_REED", 2000, null, player);
|
||||
startQuestTimer("SPAWN_MARY_REED", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_MARY_REED":
|
||||
@ -147,10 +140,16 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
world.spawnGroup("MARY_REED");
|
||||
break;
|
||||
}
|
||||
case "SPAWN_MARY_REED_MINIONS":
|
||||
case "ANNOUNCE_MARY_REED_SPAWNS_ZAKEN":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.MARY_REED_SUMMONS_ZAKEN, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
world.spawnGroup("MARY_REED_MINIONS");
|
||||
startQuestTimer("MARY_REED_SPAWNS_ZAKEN", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case "MARY_REED_SPAWNS_ZAKEN":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.ZAKEN_YOUR_TIME_HAS_COME, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
world.spawnGroup("MARY_REED_MINION_ZAKEN");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -164,23 +163,22 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
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))
|
||||
if ((hpPer <= 50) && world.isStatus(0))
|
||||
{
|
||||
startQuestTimer("SPAWN_MARY_REED_MINIONS", 10000, npc, null);
|
||||
npc.setScriptValue(1);
|
||||
startQuestTimer("ANNOUNCE_MARY_REED_SPAWNS_ZAKEN", 10000, npc, null);
|
||||
world.setStatus(1);
|
||||
}
|
||||
else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
|
||||
else if ((hpPer <= 30) && world.isStatus(1))
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(2);
|
||||
world.setStatus(2);
|
||||
}
|
||||
}
|
||||
else if (CommonUtil.contains(MARY_REED_MINIONS, npc.getId()) && world.getNpc(MARY_REED).isScriptValue(2))
|
||||
else if ((npc.getId() == MARY_REED_MINION_ZAKEN) && world.isStatus(2))
|
||||
{
|
||||
showOnScreenMsg(world, MINIONS_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
showOnScreenMsg(world, ZAKEN_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
@ -195,25 +193,28 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
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));
|
||||
cancelQuestTimer("ANNOUNCE_MARY_REED_SPAWNS_ZAKEN", npc, killer);
|
||||
world.getAliveNpcs(MARY_REED_MINION_ZAKEN).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);
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
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, world.getId());
|
||||
}
|
||||
// Finish instance
|
||||
world.finishInstance(2);
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
|
@ -104,31 +104,31 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
case "ANNOUNCE_5":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_4", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_4", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_4":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_3", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_3", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_3":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_2", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_2", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_2":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_1", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_1", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_1":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("SPAWN_TAUTI", 2000, null, player);
|
||||
startQuestTimer("SPAWN_TAUTI", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_TAUTI":
|
||||
@ -137,12 +137,6 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
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);
|
||||
}
|
||||
@ -154,19 +148,17 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
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))
|
||||
if ((hpPer <= 50) && world.isStatus(0))
|
||||
{
|
||||
// startQuestTimer("SPAWN_TAUTI_MINIONS", 10000, npc, null);
|
||||
showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(1);
|
||||
world.setStatus(1);
|
||||
}
|
||||
else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
|
||||
else if ((hpPer <= 30) && world.isStatus(1))
|
||||
{
|
||||
showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(2);
|
||||
world.setStatus(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -181,26 +173,25 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
{
|
||||
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);
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
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, world.getId());
|
||||
}
|
||||
// Finish instance
|
||||
world.finishInstance(2);
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
|
@ -3050,7 +3050,7 @@
|
||||
<height normal="35" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="26255" level="108" type="RaidBoss" name="Zaken">
|
||||
<npc id="26255" level="120" type="RaidBoss" name="Zaken">
|
||||
<race>UNDEAD</race>
|
||||
<sex>MALE</sex>
|
||||
<acquire exp="3766456368864" sp="3389803344" raidPoints="21" />
|
||||
@ -3066,7 +3066,7 @@
|
||||
<status attackable="true" />
|
||||
<ai type="BALANCED" clanHelpRange="2000" aggroRange="2000">
|
||||
<clanList>
|
||||
<clan>ZAKEN_TOH</clan>
|
||||
<clan>MARY_REED_TOH</clan>
|
||||
</clanList>
|
||||
</ai>
|
||||
<collision>
|
||||
|
@ -19,7 +19,9 @@ package org.l2jmobius.gameserver.instancemanager;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@ -67,6 +69,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
resetRecommends();
|
||||
resetWorldChatPoints();
|
||||
resetTrainingCamp();
|
||||
resetThroneOfHeroes();
|
||||
}
|
||||
|
||||
@ScheduleTarget
|
||||
@ -252,6 +255,41 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
DailyMissionData.getInstance().getDailyMissionData().forEach(DailyMissionDataHolder::reset);
|
||||
}
|
||||
|
||||
public void resetThroneOfHeroes()
|
||||
{
|
||||
// Update data for offline players.
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
{
|
||||
ps.setString(1, "TOH_DONE");
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Throne of Heroes Reenter: " + e);
|
||||
}
|
||||
|
||||
// Update data for online players.
|
||||
final Set<Clan> clans = new HashSet<>();
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final Clan clan = player.getClan();
|
||||
if (clan != null)
|
||||
{
|
||||
clans.add(clan);
|
||||
}
|
||||
}
|
||||
for (Clan clan : clans)
|
||||
{
|
||||
clan.getVariables().remove("TOH_DONE");
|
||||
clan.getVariables().storeMe();
|
||||
}
|
||||
|
||||
LOGGER.info("Throne of Heroes Entry has been resetted.");
|
||||
}
|
||||
|
||||
public static DailyTaskManager getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
|
@ -38717,7 +38717,7 @@ public class NpcStringId
|
||||
public static NpcStringId ANTHARAS_HAS_SUFFERED_CRITICAL_INJURIES;
|
||||
|
||||
@ClientString(id = 1803449, message = "Zaken! Your time has come! Kill them all!")
|
||||
public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
|
||||
public static NpcStringId ZAKEN_YOUR_TIME_HAS_COME;
|
||||
|
||||
@ClientString(id = 1803450, message = "Mary Reed reveals her true power.")
|
||||
public static NpcStringId MARY_REED_REVEALS_HER_TRUE_POWER;
|
||||
@ -39082,8 +39082,8 @@ public class NpcStringId
|
||||
@ClientString(id = 1803599, message = "The fourth challenge begins.")
|
||||
public static NpcStringId THE_FOURTH_CHALLENGE_BEGINS;
|
||||
|
||||
@ClientString(id = 1803600, message = "The fourth challenge has been completed successfully.")
|
||||
public static NpcStringId THE_FOURTH_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY;
|
||||
@ClientString(id = 1803600, message = "Mary Reed summons Zaken.\nZaken will be here very soon.")
|
||||
public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
|
||||
|
||||
@ClientString(id = 1803601, message = "Ekimus summons his minions.")
|
||||
public static NpcStringId EKIMUS_SUMMONS_HIS_MINIONS;
|
||||
|
@ -4,8 +4,7 @@
|
||||
<time duration="60" empty="1" />
|
||||
<locations>
|
||||
<enter type="FIXED">
|
||||
<location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
|
||||
<!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
|
||||
<location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
|
||||
</enter>
|
||||
<exit type="ORIGIN" />
|
||||
</locations>
|
||||
@ -39,10 +38,10 @@
|
||||
<npc id="26250" x="11704" y="-86511" z="-10929" heading="0" /> <!-- Goldberg -->
|
||||
</group>
|
||||
<group name="GOLDBERG_MINIONS" spawnByDefault="false">
|
||||
<npc id="26251" x="11797" y="-86046" z="-10964" heading="0" respawnTime="1min" /> <!-- Handy Cannon Gunner -->
|
||||
<npc id="26252" x="11704" y="-86904" z="-10964" heading="0" respawnTime="1min" /> <!-- Anchor Warrior -->
|
||||
<npc id="26253" x="11303" y="-86510" z="-10964" heading="0" respawnTime="1min" /> <!-- Operator -->
|
||||
<npc id="26254" x="12136" y="-86488" z="-10964" heading="0" respawnTime="1min" /> <!-- Axe Warrior -->
|
||||
<npc id="26251" x="11797" y="-86046" z="-10964" heading="0" /> <!-- Handy Cannon Gunner -->
|
||||
<npc id="26252" x="11704" y="-86904" z="-10964" heading="0" /> <!-- Anchor Warrior -->
|
||||
<npc id="26253" x="11303" y="-86510" z="-10964" heading="0" /> <!-- Operator -->
|
||||
<npc id="26254" x="12136" y="-86488" z="-10964" heading="0" /> <!-- Axe Warrior -->
|
||||
</group>
|
||||
</spawnlist>
|
||||
</instance>
|
@ -4,8 +4,7 @@
|
||||
<time duration="60" empty="1" />
|
||||
<locations>
|
||||
<enter type="FIXED">
|
||||
<location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
|
||||
<!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
|
||||
<location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
|
||||
</enter>
|
||||
<exit type="ORIGIN" />
|
||||
</locations>
|
||||
@ -38,11 +37,8 @@
|
||||
<group name="MARY_REED" spawnByDefault="false">
|
||||
<npc id="26267" x="11704" y="-86511" z="-10929" heading="0" /> <!-- Mary Reed -->
|
||||
</group>
|
||||
<group name="MARY_REED_MINIONS" spawnByDefault="false">
|
||||
<npc id="26268" x="11797" y="-86046" z="-10964" heading="0" respawnTime="1min" /> <!-- Shield Master -->
|
||||
<npc id="26269" x="11704" y="-86904" z="-10964" heading="0" respawnTime="1min" /> <!-- Spear Master -->
|
||||
<npc id="26270" x="11303" y="-86510" z="-10964" heading="0" respawnTime="1min" /> <!-- Bow Master -->
|
||||
<npc id="26271" x="12136" y="-86488" z="-10964" heading="0" respawnTime="1min" /> <!-- Magic Master -->
|
||||
<group name="MARY_REED_MINION_ZAKEN" spawnByDefault="false">
|
||||
<npc id="26255" x="11797" y="-86046" z="-10964" heading="0" /> <!-- Zaken -->
|
||||
</group>
|
||||
</spawnlist>
|
||||
</instance>
|
@ -4,8 +4,7 @@
|
||||
<time duration="60" empty="1" />
|
||||
<locations>
|
||||
<enter type="FIXED">
|
||||
<location x="11722" y="-85014" z="-10972" /> <!-- battle location -->
|
||||
<!-- <location x="11715" y="-84303" z="-11030" /> behind the door -->
|
||||
<location x="11722" y="-85014" z="-10972" heading="52300" /> <!-- battle location -->
|
||||
</enter>
|
||||
<exit type="ORIGIN" />
|
||||
</locations>
|
||||
|
@ -152,18 +152,17 @@ public class ThroneOfHeroesGoldberg extends AbstractInstance
|
||||
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))
|
||||
if ((hpPer <= 50) && world.isStatus(0))
|
||||
{
|
||||
startQuestTimer("SPAWN_GOLDBERG_MINIONS", 10000, npc, null);
|
||||
npc.setScriptValue(1);
|
||||
world.setStatus(1);
|
||||
}
|
||||
else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
|
||||
else if ((hpPer <= 30) && world.isStatus(1))
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.GOLDBERG_BRINGS_OUT_ALL_OF_THE_POWER_WITHIN_HIM, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(2);
|
||||
world.setStatus(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,18 +185,21 @@ public class ThroneOfHeroesGoldberg extends AbstractInstance
|
||||
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);
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
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, world.getId());
|
||||
}
|
||||
// Finish instance
|
||||
world.finishInstance(2);
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -36,14 +35,8 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
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 -->
|
||||
};
|
||||
private static final int MARY_REED_MINION_ZAKEN = 26255;
|
||||
|
||||
// Throne's Treasure Chest Mary Reed
|
||||
private static final int TREASURE_CHEST = 26456;
|
||||
|
||||
@ -54,7 +47,7 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
private static final int TEMPLATE_ID = 308;
|
||||
|
||||
// Npc Dialogs
|
||||
private static final NpcStringId[] MINIONS_MESSAGES =
|
||||
private static final NpcStringId[] ZAKEN_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,
|
||||
@ -68,7 +61,7 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
addInstanceCreatedId(TEMPLATE_ID);
|
||||
addStartNpc(ROIENTAL);
|
||||
addTalkId(ROIENTAL);
|
||||
addAttackId(MARY_REED);
|
||||
addAttackId(MARY_REED, MARY_REED_MINION_ZAKEN);
|
||||
addKillId(MARY_REED);
|
||||
}
|
||||
|
||||
@ -114,31 +107,31 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
case "ANNOUNCE_5":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_4", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_4", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_4":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_3", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_3", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_3":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_2", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_2", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_2":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_1", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_1", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_1":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("SPAWN_MARY_REED", 2000, null, player);
|
||||
startQuestTimer("SPAWN_MARY_REED", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_MARY_REED":
|
||||
@ -147,10 +140,16 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
world.spawnGroup("MARY_REED");
|
||||
break;
|
||||
}
|
||||
case "SPAWN_MARY_REED_MINIONS":
|
||||
case "ANNOUNCE_MARY_REED_SPAWNS_ZAKEN":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.MARY_REED_SUMMONS_ZAKEN, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
world.spawnGroup("MARY_REED_MINIONS");
|
||||
startQuestTimer("MARY_REED_SPAWNS_ZAKEN", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case "MARY_REED_SPAWNS_ZAKEN":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.ZAKEN_YOUR_TIME_HAS_COME, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
world.spawnGroup("MARY_REED_MINION_ZAKEN");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -164,23 +163,22 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
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))
|
||||
if ((hpPer <= 50) && world.isStatus(0))
|
||||
{
|
||||
startQuestTimer("SPAWN_MARY_REED_MINIONS", 10000, npc, null);
|
||||
npc.setScriptValue(1);
|
||||
startQuestTimer("ANNOUNCE_MARY_REED_SPAWNS_ZAKEN", 10000, npc, null);
|
||||
world.setStatus(1);
|
||||
}
|
||||
else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
|
||||
else if ((hpPer <= 30) && world.isStatus(1))
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.DO_YOU_THINK_YOU_CAN_EVADE_MY_STRIKE_TAKE_THAT, ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(2);
|
||||
world.setStatus(2);
|
||||
}
|
||||
}
|
||||
else if (CommonUtil.contains(MARY_REED_MINIONS, npc.getId()) && world.getNpc(MARY_REED).isScriptValue(2))
|
||||
else if ((npc.getId() == MARY_REED_MINION_ZAKEN) && world.isStatus(2))
|
||||
{
|
||||
showOnScreenMsg(world, MINIONS_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
showOnScreenMsg(world, ZAKEN_MESSAGES[getRandom(4)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
@ -195,25 +193,28 @@ public class ThroneOfHeroesMaryReed extends AbstractInstance
|
||||
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));
|
||||
cancelQuestTimer("ANNOUNCE_MARY_REED_SPAWNS_ZAKEN", npc, killer);
|
||||
world.getAliveNpcs(MARY_REED_MINION_ZAKEN).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);
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
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, world.getId());
|
||||
}
|
||||
// Finish instance
|
||||
world.finishInstance(2);
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
|
@ -104,31 +104,31 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
case "ANNOUNCE_5":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FIVE_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_4", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_4", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_4":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.FOUR_SECONDS, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_3", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_3", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_3":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.THREE_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_2", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_2", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_2":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.TWO_SECONDS_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("ANNOUNCE_1", 2000, null, player);
|
||||
startQuestTimer("ANNOUNCE_1", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "ANNOUNCE_1":
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.ONE_SECOND_2, ExShowScreenMessage.TOP_CENTER, 1000, true);
|
||||
startQuestTimer("SPAWN_TAUTI", 2000, null, player);
|
||||
startQuestTimer("SPAWN_TAUTI", 1000, null, player);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_TAUTI":
|
||||
@ -137,12 +137,6 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
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);
|
||||
}
|
||||
@ -154,19 +148,17 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
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))
|
||||
if ((hpPer <= 50) && world.isStatus(0))
|
||||
{
|
||||
// startQuestTimer("SPAWN_TAUTI_MINIONS", 10000, npc, null);
|
||||
showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(1);
|
||||
world.setStatus(1);
|
||||
}
|
||||
else if ((hpPer < (maxHp * 0.30)) && npc.isScriptValue(1))
|
||||
else if ((hpPer <= 30) && world.isStatus(1))
|
||||
{
|
||||
showOnScreenMsg(world, TAUTI_MESSAGES[getRandom(2)], ExShowScreenMessage.TOP_CENTER, 5000, true);
|
||||
npc.setScriptValue(2);
|
||||
world.setStatus(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -181,26 +173,25 @@ public class ThroneOfHeroesTauti extends AbstractInstance
|
||||
{
|
||||
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);
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
addSpawn(TREASURE_CHEST, killer.getX() + getRandom(-150, 150), killer.getY() + getRandom(-150, 150), killer.getZ() + 10, 0, false, 0, true, world.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
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, world.getId());
|
||||
}
|
||||
// Finish instance
|
||||
world.finishInstance(2);
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
if (!killer.isGM())
|
||||
{
|
||||
// Set clan variable
|
||||
killer.getClan().getVariables().set("TOH_DONE", Chronos.currentTimeMillis());
|
||||
killer.getClan().getVariables().storeMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
|
@ -3050,7 +3050,7 @@
|
||||
<height normal="35" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="26255" level="108" type="RaidBoss" name="Zaken">
|
||||
<npc id="26255" level="120" type="RaidBoss" name="Zaken">
|
||||
<race>UNDEAD</race>
|
||||
<sex>MALE</sex>
|
||||
<acquire exp="3766456368864" sp="3389803344" raidPoints="21" />
|
||||
@ -3066,7 +3066,7 @@
|
||||
<status attackable="true" />
|
||||
<ai type="BALANCED" clanHelpRange="2000" aggroRange="2000">
|
||||
<clanList>
|
||||
<clan>ZAKEN_TOH</clan>
|
||||
<clan>MARY_REED_TOH</clan>
|
||||
</clanList>
|
||||
</ai>
|
||||
<collision>
|
||||
|
@ -19,7 +19,9 @@ package org.l2jmobius.gameserver.instancemanager;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@ -67,6 +69,7 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
resetRecommends();
|
||||
resetWorldChatPoints();
|
||||
resetTrainingCamp();
|
||||
resetThroneOfHeroes();
|
||||
}
|
||||
|
||||
@ScheduleTarget
|
||||
@ -252,6 +255,41 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
DailyMissionData.getInstance().getDailyMissionData().forEach(DailyMissionDataHolder::reset);
|
||||
}
|
||||
|
||||
public void resetThroneOfHeroes()
|
||||
{
|
||||
// Update data for offline players.
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM clan_variables WHERE var=?"))
|
||||
{
|
||||
ps.setString(1, "TOH_DONE");
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Could not reset Throne of Heroes Reenter: " + e);
|
||||
}
|
||||
|
||||
// Update data for online players.
|
||||
final Set<Clan> clans = new HashSet<>();
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
final Clan clan = player.getClan();
|
||||
if (clan != null)
|
||||
{
|
||||
clans.add(clan);
|
||||
}
|
||||
}
|
||||
for (Clan clan : clans)
|
||||
{
|
||||
clan.getVariables().remove("TOH_DONE");
|
||||
clan.getVariables().storeMe();
|
||||
}
|
||||
|
||||
LOGGER.info("Throne of Heroes Entry has been resetted.");
|
||||
}
|
||||
|
||||
public static DailyTaskManager getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
|
@ -38717,7 +38717,7 @@ public class NpcStringId
|
||||
public static NpcStringId ANTHARAS_HAS_SUFFERED_CRITICAL_INJURIES;
|
||||
|
||||
@ClientString(id = 1803449, message = "Zaken! Your time has come! Kill them all!")
|
||||
public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
|
||||
public static NpcStringId ZAKEN_YOUR_TIME_HAS_COME;
|
||||
|
||||
@ClientString(id = 1803450, message = "Mary Reed reveals her true power.")
|
||||
public static NpcStringId MARY_REED_REVEALS_HER_TRUE_POWER;
|
||||
@ -39082,8 +39082,8 @@ public class NpcStringId
|
||||
@ClientString(id = 1803599, message = "The fourth challenge begins.")
|
||||
public static NpcStringId THE_FOURTH_CHALLENGE_BEGINS;
|
||||
|
||||
@ClientString(id = 1803600, message = "The fourth challenge has been completed successfully.")
|
||||
public static NpcStringId THE_FOURTH_CHALLENGE_HAS_BEEN_COMPLETED_SUCCESSFULLY;
|
||||
@ClientString(id = 1803600, message = "Mary Reed summons Zaken.\nZaken will be here very soon.")
|
||||
public static NpcStringId MARY_REED_SUMMONS_ZAKEN;
|
||||
|
||||
@ClientString(id = 1803601, message = "Ekimus summons his minions.")
|
||||
public static NpcStringId EKIMUS_SUMMONS_HIS_MINIONS;
|
||||
|
Loading…
Reference in New Issue
Block a user