Addition of Dimensional Warp instance.

Contributed by gigilo1968.
This commit is contained in:
MobiusDev
2019-01-10 20:39:52 +00:00
parent fdf51df12a
commit 6c38b88b42
125 changed files with 28422 additions and 164 deletions

View File

@@ -0,0 +1,10 @@
<html><body>Einster:<br>
Proof must be shown to go upstairs quiuckly. The level of Dimensional Warp you completed determines which floor you can go to.<br>
Many accidents have happened on floors 31 and higher. To protect researchers, we are investigation those floors. For now, <font color="LEVEL">I can send you up to the 26th floor.</font><br>
Ah, you must <font color="LEVEL">determine how many Warp Crystals you will pay</font> before asking me to send you upstairs. Which floor do you want to go?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap send_6_f">"Send me to 6F."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap send_11_f">"Send me to 11F."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap send_16_f">"Send me to 16F."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap send_21_f">"Send me to 21F"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap send_26_f">"Send me to 26F"</Button>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Einster:<br>
You haven't paid Warp Crystals. I can't send you upstairs.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Einster:<br>
You didn't give me the number of Warp Crystals you promised.<br1>
Each member of the party must have <font color="LEVEL">%count% Warp Crystals</font>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Einster:<br>
You made it all the way here. Did you find ani Imps?<br>
You didn't uncover all the secrets yet. Secrets also exist in Abyssal Space. No explorers dared to go there yet.<br>
Please find out those secrets!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap jump_location">"Sure, sure. Let me move on"</Button>
</body></html>

View File

@@ -0,0 +1,9 @@
<html><body>Einster:<br>
There's someone who has not met the quest completion requirements, so I cannot send you.<br>
Check the list below to see which floor you can go to.<br><br>
Floor 6: Complete The Dimensional Warp, Part 1<br><br>
Floor 11: Complete The Dimensional Warp, Part 2<br><br>
Floor 16: Complete The Dimensional Warp, Part 3<br><br>
Floor 21: Complete The Dimensional Warp, Part 4<br><br>
Floor 26: Complete The Dimensional Warp, Part 5<br><br>
</body></html>

View File

@@ -0,0 +1,12 @@
<html><body>Einster:<br>
I was first one to explore Dimensional Wrap. I heard that the imps here carry materials we could use -- rare books, things to enchant bracelets with, and the like.<br>
The Expeditioners have discovered that the probability of imps appearing increases with our use of Warp Crystals, but we have to use a lot to even think about getting up there.<br>
All members of the team should carry Warp Crystals. I'll divide them up according to the number in your group.<br>
I recently discovered the key to going upstairs directly. If you want, I can send you there.<br>
Okay, let's get started.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap 12_warp_crystals">"I'll use 12 Warp Crystals."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap 240_warp_crystals">"I'll use 240 Warp Crystals."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap 1200_warp_crystals">"I'll use 1200 Warp Crystals."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 906">"I need Warp Crystals."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest DimensionalWrap 33975-01.html">"I want to go upstairs directly."</Button>
</body></html>

View File

@@ -0,0 +1,77 @@
/*
* 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.DimensionalWrap;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
/**
* Dimensional Archon AI
* @author Gigi
* @date 2018-09-08 - [18:09:02]
*/
public class DimensionalArchon extends AbstractNpcAI
{
// NPCs
private static final int DEMINSIONAL_ARCHON = 23469;
private static final int UNWORDLY_ARCHON = 23475;
private static final int ABYSSAL_ARCHON = 23482;
private static final NpcStringId[] ARCHON_MSG =
{
NpcStringId.DO_YOU_KNOW_WHO_IT_IS_THAT_YOU_FACE_IT_IS_BEST_THAT_YOU_RUN_NOW,
NpcStringId.LOOK_INTO_MY_EYES_AND_SEE_WHAT_COUNTLESS_OTHERS_HAVE_SEEN_BEFORE_THEIR_DEATH,
NpcStringId.I_COMMEND_YOUR_TENACITY_IN_COMING_THIS_FAR_BUT_NOW_IT_ENDS,
NpcStringId.DO_YOU_SEE_THIS_SWORD_THE_LIGHT_THAT_SCREAMS_WITH_THE_LIFE_OF_THOSE_IT_HAS_KILLED,
NpcStringId.I_WILL_SHOW_YOU_WHAT_TRUE_POWER_IS,
NpcStringId.YOU_WILL_NEED_TO_SURPASS_ME_EVENTUALLY_BUT_DON_T_FORGET_KNOWING_HOW_TO_FLEE_IS_AN_IMPORTANT_PART_OF_BATTLE
};
public DimensionalArchon()
{
super();
addSpawnId(DEMINSIONAL_ARCHON, UNWORDLY_ARCHON, ABYSSAL_ARCHON);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("NPC_SHOUT"))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), ARCHON_MSG[getRandom(ARCHON_MSG.length)]));
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(L2Npc npc)
{
npc.setShowSummonAnimation(true);
startQuestTimer("NPC_SHOUT", 2000, npc, null);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new DimensionalArchon();
}
}

View File

@@ -0,0 +1,169 @@
/*
* 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.DimensionalWrap;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import ai.AbstractNpcAI;
/**
* Dimensional Trap's AI
* @author Gigi
* @date 2018-09-07 - [17:39:04]
*/
public class DimensionalTrap extends AbstractNpcAI
{
private static final int DIMENSIONAL_DEBUFF_TRAP_1 = 19556; // Debuff trap, power 1
private static final int DIMENSIONAL_DEBUFF_TRAP_2 = 19557; // Debuff trap, power 2
private static final int DIMENSIONAL_DEBUFF_TRAP_3 = 19558; // Debuff trap, power 3
private static final int DIMENSIONAL_DEMAGE_TRAP_1 = 19559; // Damage trap, power 1
private static final int DIMENSIONAL_DEMAGE_TRAP_2 = 19560; // Damage trap, power 2
private static final int DIMENSIONAL_DEMAGE_TRAP_3 = 19561; // Damage trap, power 3
private static final int DIMENSIONAL_HEAL_LIGHT = 19562; // Heal Trap
// skill
private static final SkillHolder TRAP_HOLD = new SkillHolder(16409, 1);
private static final SkillHolder TRAP_ARIALL_YOKE = new SkillHolder(16410, 1);
private static final SkillHolder TRAP_STUN = new SkillHolder(16411, 1);
private static final SkillHolder TRAP_POYSON = new SkillHolder(16413, 1);
private static final SkillHolder PEACE_ZONE_CURE = new SkillHolder(16414, 1);
private int _type;
public DimensionalTrap()
{
super();
addSpawnId(DIMENSIONAL_DEBUFF_TRAP_1, DIMENSIONAL_DEBUFF_TRAP_2, DIMENSIONAL_DEBUFF_TRAP_3, DIMENSIONAL_DEMAGE_TRAP_1, DIMENSIONAL_DEMAGE_TRAP_2, DIMENSIONAL_DEMAGE_TRAP_3, DIMENSIONAL_HEAL_LIGHT);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (npc != null)
{
switch (event)
{
case "debuff_player":
{
L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, _type, p ->
{
if ((p != null) && p.isPlayer() && !p.isDead())
{
npc.setTarget(p);
npc.doCast((getRandom(10) < 5) ? TRAP_HOLD.getSkill() : TRAP_ARIALL_YOKE.getSkill());
}
});
startQuestTimer("debuff_player", 10000, npc, null);
break;
}
case "demage_player":
{
L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, _type, p ->
{
if ((p != null) && p.isPlayer() && !p.isDead())
{
npc.setTarget(p);
npc.doCast((getRandom(10) < 5) ? TRAP_STUN.getSkill() : TRAP_POYSON.getSkill());
}
});
startQuestTimer("demage_player", 10000, npc, null);
break;
}
case "heal_player":
{
L2World.getInstance().forEachVisibleObjectInRange(npc, L2PcInstance.class, _type, p ->
{
if ((p != null) && p.isPlayer() && !p.isDead())
{
npc.setTarget(p);
npc.doCast(PEACE_ZONE_CURE.getSkill());
}
});
startQuestTimer("heal_player", 10000, npc, null);
break;
}
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(L2Npc npc)
{
npc.setIsInvul(true);
switch (npc.getId())
{
case DIMENSIONAL_DEBUFF_TRAP_1:
{
npc.setDisplayEffect(1);
startQuestTimer("debuff_player", 3000, npc, null);
_type = 50;
break;
}
case DIMENSIONAL_DEBUFF_TRAP_2:
{
npc.setDisplayEffect(2);
startQuestTimer("debuff_player", 3000, npc, null);
_type = 100;
break;
}
case DIMENSIONAL_DEBUFF_TRAP_3:
{
npc.setDisplayEffect(3);
startQuestTimer("debuff_player", 3000, npc, null);
_type = 150;
break;
}
case DIMENSIONAL_DEMAGE_TRAP_1:
{
npc.setDisplayEffect(4);
startQuestTimer("demage_player", 3000, npc, null);
_type = 50;
break;
}
case DIMENSIONAL_DEMAGE_TRAP_2:
{
npc.setDisplayEffect(5);
startQuestTimer("demage_player", 3000, npc, null);
_type = 100;
break;
}
case DIMENSIONAL_DEMAGE_TRAP_3:
{
npc.setDisplayEffect(6);
startQuestTimer("demage_player", 3000, npc, null);
_type = 150;
break;
}
case DIMENSIONAL_HEAL_LIGHT:
{
npc.setDisplayEffect(7);
startQuestTimer("heal_player", 3000, npc, null);
_type = 150;
break;
}
}
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new DimensionalTrap();
}
}

View File

@@ -0,0 +1,676 @@
/*
* 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.DimensionalWrap;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.enums.CategoryType;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
/**
* Dimensional Wrap instance
* @URL https://l2wiki.com/Dimensional_Warp
* @Video https://www.youtube.com/watch?v=hOnzk0ELwIg
* @author Gigi
* @date 2018-09-04 - [14:33:31]
*/
public class DimensionalWrap extends AbstractInstance
{
// NPCs
private static final int RESED = 33974;
private static final int EINSTER = 33975;
// Monsters
private static final int DEMINSIONAL_INVISIBLE_FRAGMENT = 19564;
private static final int SALAMANDRA_GENERATOR = 19563;
private static final int SALAMANDRA_GENERATOR_DUMMY = 900112;
private static final int DIMENSIONAL_SALAMANDRA = 23466;
private static final int UNWORDLY_SALAMANDER = 23473;
private static final int DIMENSIONAL_IMP = 19553;
private static final int UNWORDLY_IMP = 19554;
private static final int ABYSSAL_IMP = 19555;
private static final int ABYSSAL_MAKKUM = 26090;
private static final int[] MONSTERS =
{
23462, // Dimensional Orc Butcher
23463, // Dimensional Orc Hunter
23464, // Dimensional Shaman
23465, // Dimensional Bugbear
23467, // Dimensional Binder
23468, // Dimensional Demon
23469, // Dimensional Archon
23470, // Unworldly Demon
23471, // Unworldly Etin
23472, // Unworldly Shaman
23474, // Unworldly Golem
23475, // Unworldly Archon
23476, // Unworldly Harpy
23477, // Abyssal Shaman
23478, // Abyssal Berserker
23480, // Abyssal Harpy
23481, // Abyssal Binder
23482, // Abyssal Archon
23483 // Abyssal Golem
};
private static final int[] TRAPS =
{
19556, // Debuff trap, power 1
19557, // Debuff trap, power 2
19558, // Debuff trap, power 3
19559, // Damage trap, power 1
19560, // Damage trap, power 2
19561, // Damage trap, power 3
19562 // Heal Trap
};
// Location
private static final Location TELEPORTS = new Location(-76136, -216216, 4040);
private static final Location FIRST_TELEPORT = new Location(-219544, 248776, 3360);
private static final Location SECOND_TELEPORT = new Location(-206756, 242009, 6584);
private static final Location THRID_TELEPORT = new Location(-219813, 248484, 9928);
private static final Location FOURTH_TELEPORT = new Location(-87191, -210129, 6984);
// Misc
private static final int TEMPLATE_ID = 250;
private static final int DIMENSIONAL_DARK_FORCES = 16415;
private static final int WARP_CRYSTAL = 39597;
protected double _chance = 0;
protected int _count = 0;
public int _skilllevel = 1;
public int _worldState = 0;
protected ScheduledFuture<?> _debufTask;
public DimensionalWrap()
{
super(TEMPLATE_ID);
addStartNpc(RESED);
addTalkId(EINSTER);
addKillId(MONSTERS);
addKillId(ABYSSAL_MAKKUM);
addSpawnId(SALAMANDRA_GENERATOR, DEMINSIONAL_INVISIBLE_FRAGMENT, SALAMANDRA_GENERATOR_DUMMY);
addFirstTalkId(EINSTER);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
final Instance world = npc.getInstanceWorld();
if (event.equals("enterInstance"))
{
if (!player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
{
htmltext = "no_awakened.html";
}
else if (!player.isInParty())
{
enterInstance(player, npc, TEMPLATE_ID);
}
else if (player.isInParty())
{
if (!player.getParty().isLeader(player))
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER));
}
else
{
final L2Party party = player.getParty();
final List<L2PcInstance> members = party.getMembers();
for (L2PcInstance member : members)
{
if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE))
{
enterInstance(member, npc, TEMPLATE_ID);
}
}
}
}
}
if (isInInstance(world))
{
switch (event)
{
case "33975-01.html":
{
htmltext = event;
break;
}
case "12_warp_crystals":
{
_chance = 0.3;
if (!player.isInParty())
{
_count = 12;
CheckCrystallCount(world, player, npc);
break;
}
else if (player.isInParty() && !player.getParty().isLeader(player))
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER));
break;
}
switch (player.getParty().getMemberCount())
{
case 2:
{
_count = 6;
CheckCrystallCount(world, player, npc);
break;
}
case 3:
{
_count = 4;
CheckCrystallCount(world, player, npc);
break;
}
case 4:
{
_count = 3;
CheckCrystallCount(world, player, npc);
break;
}
}
break;
}
case "240_warp_crystals":
{
_chance = 0.6;
if (!player.isInParty())
{
_count = 240;
CheckCrystallCount(world, player, npc);
break;
}
else if (player.isInParty() && !player.getParty().isLeader(player))
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER));
break;
}
switch (player.getParty().getMemberCount())
{
case 2:
{
_count = 120;
CheckCrystallCount(world, player, npc);
break;
}
case 3:
{
_count = 80;
CheckCrystallCount(world, player, npc);
break;
}
case 4:
{
_count = 60;
CheckCrystallCount(world, player, npc);
break;
}
}
break;
}
case "1200_warp_crystals":
{
_chance = 0.9;
if (!player.isInParty())
{
_count = 1200;
CheckCrystallCount(world, player, npc);
break;
}
else if (player.isInParty() && !player.getParty().isLeader(player))
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER));
break;
}
switch (player.getParty().getMemberCount())
{
case 2:
{
_count = 600;
CheckCrystallCount(world, player, npc);
break;
}
case 3:
{
_count = 400;
CheckCrystallCount(world, player, npc);
break;
}
case 4:
{
_count = 300;
CheckCrystallCount(world, player, npc);
break;
}
}
break;
}
case "send_6_f":
{
if (_worldState == 0)
{
htmltext = "33975-02.html";
break;
}
if (player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL", 0) == 0)
{
htmltext = "33975-05.html";
break;
}
for (L2Npc n : world.getAliveNpcs())
{
if (n.getId() != EINSTER)
{
n.deleteMe();
}
}
if (world.getStatus() < 5)
{
world.setStatus(5);
cancelQuestTimers("SECOND_SPAWN");
cancelQuestTimers("THRID_SPAWN");
startQuestTimer("START_STAGE", 5000, npc, null);
}
for (L2PcInstance pl : world.getPlayers())
{
pl.teleToLocation(FIRST_TELEPORT, world.getTemplateId());
}
break;
}
case "send_11_f":
{
if (_worldState == 0)
{
htmltext = "33975-02.html";
break;
}
if ((player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL", 0) == 0) || (player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL") < 2))
{
htmltext = "33975-05.html";
break;
}
for (L2Npc n : world.getAliveNpcs())
{
if (n.getId() != EINSTER)
{
n.deleteMe();
}
}
if (world.getStatus() < 10)
{
world.setStatus(10);
cancelQuestTimers("SECOND_SPAWN");
cancelQuestTimers("THRID_SPAWN");
startQuestTimer("START_STAGE", 5000, npc, null);
}
for (L2PcInstance pl : world.getPlayers())
{
pl.teleToLocation(SECOND_TELEPORT, world.getTemplateId());
}
break;
}
case "send_16_f":
{
if (_worldState == 0)
{
htmltext = "33975-02.html";
break;
}
if ((player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL", 0) == 0) || (player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL") < 3))
{
htmltext = "33975-05.html";
break;
}
for (L2Npc n : world.getAliveNpcs())
{
if (n.getId() != EINSTER)
{
n.deleteMe();
}
}
if (world.getStatus() < 15)
{
world.setStatus(15);
cancelQuestTimers("SECOND_SPAWN");
cancelQuestTimers("THRID_SPAWN");
startQuestTimer("START_STAGE", 5000, npc, null);
}
for (L2PcInstance pl : world.getPlayers())
{
pl.teleToLocation(THRID_TELEPORT, world.getTemplateId());
}
break;
}
case "send_21_f":
{
if (_worldState == 0)
{
htmltext = "33975-02.html";
break;
}
if ((player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL", 0) == 0) || (player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL") < 4))
{
htmltext = "33975-05.html";
break;
}
for (L2Npc n : world.getAliveNpcs())
{
if (n.getId() != EINSTER)
{
n.deleteMe();
}
}
if (world.getStatus() < 20)
{
world.setStatus(20);
cancelQuestTimers("SECOND_SPAWN");
cancelQuestTimers("THRID_SPAWN");
startQuestTimer("START_STAGE", 5000, npc, null);
}
for (L2PcInstance pl : world.getPlayers())
{
pl.teleToLocation(TELEPORTS, world.getTemplateId());
}
break;
}
case "send_26_f":
{
if (_worldState == 0)
{
htmltext = "33975-02.html";
break;
}
if ((player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL", 0) == 0) || (player.getVariables().getInt("DIMENSIONAL_WRAP_LEVEL") < 5))
{
htmltext = "33975-05.html";
break;
}
for (L2Npc n : world.getAliveNpcs())
{
if (n.getId() != EINSTER)
{
n.deleteMe();
}
}
if (world.getStatus() < 25)
{
world.setStatus(25);
cancelQuestTimers("SECOND_SPAWN");
cancelQuestTimers("THRID_SPAWN");
startQuestTimer("START_STAGE", 5000, npc, null);
}
for (L2PcInstance pl : world.getPlayers())
{
pl.teleToLocation(FOURTH_TELEPORT, world.getTemplateId());
}
break;
}
case "jump_location":
{
player.teleToLocation(TELEPORTS, world.getTemplateId());
break;
}
case "SALAMANDRA_SPAWN":
case "SALAMANDRA_SPAWN_DUMMY":
{
if (getRandom(100) < (_worldState / 2))
{
final L2Npc salamandra = addSpawn(_worldState < 17 ? DIMENSIONAL_SALAMANDRA : UNWORDLY_SALAMANDER, npc, false, 0, false, world.getId());
salamandra.setRunning();
L2World.getInstance().forEachVisibleObjectInRange(salamandra, L2PcInstance.class, 2500, p ->
{
if ((p != null) && !p.isDead())
{
addAttackPlayerDesire(salamandra, p);
}
});
}
break;
}
case "START_STAGE":
{
world.setStatus(world.getStatus() + 1);
_worldState = world.getStatus();
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_WARP_LV_S1, ExShowScreenMessage.TOP_CENTER, 10000, true, String.valueOf(world.getStatus())));
startQuestTimer("FIRST_SPAWN", 1500, npc, null);
break;
}
case "FIRST_SPAWN":
{
world.spawnGroup(_worldState + "_first_spawn");
world.spawnGroup(_worldState + "_trap_spawn");
startQuestTimer("SECOND_SPAWN", 40000, npc, null);
_debufTask = ThreadPool.scheduleAtFixedRate(() ->
{
if ((_worldState > 0) && (_worldState <= 11))
{
_skilllevel = 1;
}
else if ((_worldState > 11) && (_worldState <= 20))
{
_skilllevel = 2;
}
else if ((_worldState > 20) && (_worldState <= 30))
{
_skilllevel = 3;
}
else if (_worldState > 30)
{
_skilllevel = 4;
}
final Skill skill = SkillData.getInstance().getSkill(DIMENSIONAL_DARK_FORCES, _skilllevel);
for (L2PcInstance p : world.getPlayers())
{
if ((p != null) && !p.isDead())
{
skill.applyEffects(p, p);
}
}
}, 5000, 10000);
break;
}
case "SECOND_SPAWN":
{
world.spawnGroup(_worldState + "_second_spawn");
startQuestTimer("THRID_SPAWN", 40000, npc, null);
break;
}
case "THRID_SPAWN":
{
world.spawnGroup(_worldState + "_thred_spawn");
break;
}
case "CHANGE_LOCATION":
{
world.getAliveNpcs(TRAPS).forEach(t -> t.deleteMe());
world.spawnGroup(_worldState + "_trap_spawn");
startQuestTimer("CHANGE_LOCATION", 60000 - (_worldState * 1430), npc, null);
break;
}
case "SWITCH_STAGE":
{
if (world.getAliveNpcs(MONSTERS).isEmpty())
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_SURROUNDING_ENERGY_HAS_DISSIPATED, ExShowScreenMessage.TOP_CENTER, 5000, true));
world.broadcastPacket(new Earthquake(npc, 50, 5));
world.openCloseDoor(world.getTemplateParameters().getInt(_worldState + "_st_door"), true);
Clean();
if (_worldState < 35)
{
startQuestTimer("NEXT_STAGE", 5000, npc, null);
}
}
break;
}
case "NEXT_STAGE":
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_SECONDS_HAVE_BEEN_ADDED_TO_THE_INSTANCED_ZONE_DURATION, ExShowScreenMessage.TOP_CENTER, 5000, true, String.valueOf(180)));
world.setDuration((int) ((world.getRemainingTime() / 60000) + 3));
startQuestTimer("START_STAGE", 8000, npc, null);
for (L2Npc n : world.getAliveNpcs())
{
if (n.getId() != EINSTER)
{
n.deleteMe();
}
}
break;
}
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (isInInstance(world))
{
if (CommonUtil.contains(MONSTERS, npc.getId()) && (getRandom(100) < _chance))
{
if (_worldState < 9)
{
addSpawn(DIMENSIONAL_IMP, npc, true, 0, false, world.getId());
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.DIMENSIONAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true));
}
else if ((_worldState >= 9) && (_worldState < 20))
{
addSpawn(UNWORDLY_IMP, npc, true, 0, false, world.getId());
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.UNWORLDLY_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true));
}
else if (_worldState >= 20)
{
addSpawn(ABYSSAL_IMP, npc, true, 0, false, world.getId());
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.ABYSSAL_IMP, ExShowScreenMessage.TOP_CENTER, 5000, true));
}
}
else if (npc.getId() == ABYSSAL_MAKKUM)
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THE_INSTANCED_ZONE_WILL_CLOSE_SOON, ExShowScreenMessage.TOP_CENTER, 10000, true));
world.finishInstance(3);
Clean();
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
if (_worldState == 20)
{
return "33975-04.html";
}
return "33975.html";
}
@Override
public String onSpawn(L2Npc npc)
{
final Instance world = npc.getInstanceWorld();
if (isInInstance(world))
{
switch (npc.getId())
{
case SALAMANDRA_GENERATOR:
{
startQuestTimer("SALAMANDRA_SPAWN", 25000, npc, null, true);
startQuestTimer("CHANGE_LOCATION", 60000 - (_worldState * 1300), npc, null);
break;
}
case SALAMANDRA_GENERATOR_DUMMY:
{
startQuestTimer("SALAMANDRA_SPAWN_DUMMY", 20000, npc, null, true);
break;
}
case DEMINSIONAL_INVISIBLE_FRAGMENT:
{
startQuestTimer("SWITCH_STAGE", 5000, npc, null, true);
break;
}
}
}
return super.onSpawn(npc);
}
public void CheckCrystallCount(Instance world, L2PcInstance player, L2Npc npc)
{
boolean canStart = true;
for (L2PcInstance p : world.getPlayers())
{
if (p.getInventory().getInventoryItemCount(WARP_CRYSTAL, -1) < _count)
{
for (L2PcInstance ps : world.getPlayers())
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(ps, "33975-03.html"));
packet.replace("%count%", Integer.toString(_count));
ps.sendPacket(packet);
ps.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.C1_S_ITEM_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED).addString(ps.getName()));
canStart = false;
}
}
}
if (!canStart || (_worldState != 0))
{
return;
}
startQuestTimer("START_STAGE", 1000, npc, null);
for (L2PcInstance p : world.getPlayers())
{
takeItems(p, WARP_CRYSTAL, _count);
}
}
protected void Clean()
{
cancelQuestTimers("SWITCH_STAGE");
cancelQuestTimers("SALAMANDRA_SPAWN");
cancelQuestTimers("SALAMANDRA_SPAWN_DUMMY");
cancelQuestTimers("CHANGE_LOCATION");
if (_debufTask != null)
{
_debufTask.cancel(false);
_debufTask = null;
}
}
public static void main(String[] args)
{
new DimensionalWrap();
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Resed:<br>
Only those who have completed the 3rd Liberation or have Awakened can enter.
</body></html>