Instance related adjustments.

This commit is contained in:
MobiusDevelopment
2020-02-26 10:56:19 +00:00
parent 740acfdbd8
commit a6fc6eb2cd
81 changed files with 7566 additions and 6403 deletions

View File

@@ -43,17 +43,17 @@ public class ResidenceOfKingIgnis extends AbstractInstance
private static final int FREYA = 29109;
private static final int IGNIS = 29105;
// Skills
private static SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
// Misc
private static final int TEMPLATE_ID = 195;
private static final Map<PlayerInstance, Integer> _playerFireRage = new ConcurrentHashMap<>();

View File

@@ -18,9 +18,7 @@ package instances.ResidenceOfKingPetram;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -28,7 +26,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
* @TODO: Petram Skills and minion skills
@@ -41,17 +39,11 @@ public class ResidenceOfKingPetram extends AbstractInstance
private static final int PETRAM_PIECE = 29116;
private static final int PETRAM_FRAGMENT = 29117;
// Skills
private static SkillHolder EARTh_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static SkillHolder EARTh_FURY = new SkillHolder(50059, 1); // When change invul state.
private static SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
// Misc
private static final int TEMPLATE_ID = 198;
private RaidBossInstance _petram = null;
private MonsterInstance _minion_1 = null;
private MonsterInstance _minion_2 = null;
private MonsterInstance _minion_3 = null;
private MonsterInstance _minion_4 = null;
private boolean _spawned_minions;
public ResidenceOfKingPetram()
{
@@ -70,54 +62,63 @@ public class ResidenceOfKingPetram extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
_petram = (RaidBossInstance) player.getInstanceWorld().getNpc(PETRAM);
}
break;
}
case "SPAWN_MINION":
{
_petram.useMagic(EARTh_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!_spawned_minions)
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_minion_1 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId());
_minion_2 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId());
_minion_3 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId());
_minion_4 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId());
_spawned_minions = true;
world.getNpc(PETRAM).doCast(EARTH_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!world.getParameters().getBoolean("spawnedMinions", false))
{
world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
world.getParameters().set("spawnedMinions", true);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
break;
}
case "SUPPORT_PETRAM":
{
_minion_1.setTarget(_petram);
_minion_1.useMagic(TEST.getSkill());
_minion_2.setTarget(_petram);
_minion_2.useMagic(TEST.getSkill());
_minion_3.setTarget(_petram);
_minion_3.useMagic(TEST.getSkill());
_minion_4.setTarget(_petram);
_minion_4.useMagic(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.getParameters().getObject("minion1", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion1", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion2", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion2", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion3", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion3", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion4", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion4", Npc.class).doCast(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
}
break;
}
case "INVUL_MODE":
{
_petram.useMagic(EARTh_FURY.getSkill());
if (_petram.isInvul())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_petram.setInvul(false);
_petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
_petram.setInvul(true);
_petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
final Npc petram = world.getNpc(PETRAM);
petram.doCast(EARTH_FURY.getSkill());
if (petram.isInvul())
{
petram.setInvul(false);
petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
petram.setInvul(true);
petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
}
}
break;
}
@@ -157,18 +158,20 @@ public class ResidenceOfKingPetram extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PETRAM)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.finishInstance();
}
world.finishInstance();
}
else if ((_minion_1.isDead()) && (_minion_2.isDead()) && (_minion_3.isDead()) && (_minion_4.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
{
startQuestTimer("INVUL_MODE", 3000, _petram, null);
_spawned_minions = false;
startQuestTimer("INVUL_MODE", 3000, world.getNpc(PETRAM), null);
world.getParameters().set("spawnedMinions", false);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -17,9 +17,7 @@
package instances.ResidenceOfKingProcella;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.SkillCaster;
@@ -27,7 +25,7 @@ import org.l2jmobius.gameserver.model.skills.SkillCaster;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
*/
@@ -46,12 +44,7 @@ public class ResidenceOfKingProcella extends AbstractInstance
private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
// Misc
private static final int TEMPLATE_ID = 197;
private static int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
private int _procellaStormCount;
private RaidBossInstance _procella;
private MonsterInstance _minion1;
private MonsterInstance _minion2;
private MonsterInstance _minion3;
private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
public ResidenceOfKingProcella()
{
@@ -69,46 +62,56 @@ public class ResidenceOfKingProcella extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
_procella = (RaidBossInstance) addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
startQuestTimer("SPAWN_STORM", 5000, _procella, player);
_procellaStormCount = 0;
final Instance world = player.getInstanceWorld();
if (world != null)
{
final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
startQuestTimer("SPAWN_STORM", 5000, procella, player);
world.setParameter("stormCount", 0);
}
break;
}
case "SPAWN_MINION":
{
if (npc.getId() == PROCELLA)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (npc.getId() == PROCELLA))
{
_minion1 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId());
_minion2 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId());
_minion3 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId());
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
break;
}
case "SPAWN_STORM":
{
if (_procellaStormCount < STORM_MAX_COUNT)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
{
_procella.useMagic(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, _procella.getX() + getRandom(-500, 500), _procella.getY() + getRandom(-500, 500), _procella.getZ(), 31011, true, 0, true, npc.getInstanceId());
world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
procellaStorm.setRandomWalking(true);
_procellaStormCount++;
startQuestTimer("SPAWN_STORM", 60000, _procella, null);
world.getParameters().increaseInt("stormCount", 1);
startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
}
break;
}
case "HIDE_PROCELLA":
{
if (_procella.isInvisible())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_procella.setInvisible(false);
}
else
{
_procella.setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
if (world.getNpc(PROCELLA).isInvisible())
{
world.getNpc(PROCELLA).setInvisible(false);
}
else
{
world.getNpc(PROCELLA).setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
}
}
break;
}
@@ -151,21 +154,24 @@ public class ResidenceOfKingProcella extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PROCELLA)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
else if ((_minion1.isDead()) && (_minion2.isDead()) && (_minion3.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
{
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -41,12 +41,12 @@ public class ResidenceOfQueenNebula extends AbstractInstance
private static final int WATER_SLIME = 29111;
// Skills
private static final int AQUA_RAGE = 50036;
private static SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
// Misc
private static final int TEMPLATE_ID = 196;

View File

@@ -47,10 +47,10 @@ public class SevenSignsRBs extends AbstractInstance
private static final int ANAKIM_TEMPLATE_ID = 200;
private static final int LILITH_TEMPLATE_ID = 199;
private static int MAX_PLAYERS_IN_ZONE = 300;
private static final int MAX_PLAYERS_IN_ZONE = 300;
private static final NoRestartZone _anakim_zone = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone _lilith_zone = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
private static final NoRestartZone ANAKIM_ZONE = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone LILITH_ZONE = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
// TELEPORTS
private static final Location[] TELEPORT_TO_DARK_ELVEN =
@@ -89,7 +89,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _anakim_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - ANAKIM_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -128,7 +128,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _lilith_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - LILITH_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -161,7 +161,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_ANAKIM":
{
for (Creature charInside : _anakim_zone.getCharactersInside())
for (Creature charInside : ANAKIM_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{
@@ -172,7 +172,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_LILITH":
{
for (Creature charInside : _lilith_zone.getCharactersInside())
for (Creature charInside : LILITH_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{