Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: dist/game/data/scripts/instances/RimKamaloka/32484.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/32484.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/32484.htm (working copy)
- @@ -0,0 +1,5 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a Action="bypass -h npc_%objectId%_Chat 3">Ask about Rim Kamaloka</a> <br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Delusion Chamber.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/32485.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/32485.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/32485.htm (working copy)
- @@ -0,0 +1,7 @@
- +<html><body>Pathfinder Worker:<br>
- +Battle is over!<br>
- +To you it seems strange that I appeared in you sleep? Don't warry! We, Pathfinders, are trained many skills, which heer occurs. I simply controlled your thoughts...<br>
- +I shall describe to you, what you reached, and I shall help to get out from here.<br>
- +With to know you results?<br>
- +<a action="bypass -h npc_%objectId%_Quest RimKamaloka">view results.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Dion.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Dion.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Dion.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 0">Enter Hall of Abyss (20~30 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 1">Enter Hall of Abyss (25~35 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 2">Enter Hall of Abyss (30~40 levels)</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Gludio.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Gludio.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Gludio.htm (working copy)
- @@ -0,0 +1,8 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 0">Enter Hall of Abyss (20~30 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 1">Enter Hall of Abyss (25~35 levels)</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/GradeA.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/GradeA.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/GradeA.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +Your result: %count%<br>
- +<center>Rank A</center><br>
- +It is magnificent. You strongly lowered the rate of the intrusion through Kamaloka.<br>
- +As in any other battle, the main thing to protect itself, when you inside the Environments of Kamaloka. We they must not attack rash.<br>
- +We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
- +You do want to obtain the reward, which corresponds to your level?<br>
- +<a action="bypass -h Quest RimKamaloka Reward">Obtain the reward.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/GradeB.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/GradeB.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/GradeB.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +Your result: %count%<br>
- +<center>Rank B</center><br>
- +Very well. Your experience will help other to the finders of adventures.<br>
- +Battle with Kanabions is deliberately weaker you.. You they are assured, it is worthwhile to enter precisely thus? We, pathfinders, consider that this is the simply waste of time.<br>
- +We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
- +You do want to obtain the reward, which corresponds to your level?<br>
- +<a action="bypass -h Quest RimKamaloka Reward">Obtain the reward.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/GradeC.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/GradeC.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/GradeC.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +Your result: %count%<br>
- +<center>Rank C</center><br>
- +Good work. If the remaining finders adventures will show such results, this it will return to us hope.<br>
- +It cannot be always rely on the aid of others. Sometimes for you it is necessary to act independently.<br>
- +We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
- +You do want to obtain the reward, which corresponds to your level?<br>
- +<a action="bypass -h Quest RimKamaloka Reward">Obtain the reward.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/GradeD.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/GradeD.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/GradeD.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +Your result: %count%<br>
- +<center>Rank D</center><br>
- +This is poor result.<br>
- +Me you seemed you will be better.<br>
- +We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
- +Do you want to obtain the reward, which corresponds to your level?<br>
- +<a action="bypass -h Quest RimKamaloka Reward">Obtain the reward.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/GradeF.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/GradeF.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/GradeF.htm (working copy)
- @@ -0,0 +1,8 @@
- +<html><body>Pathfinder Worker:<br>
- +Your result: %count%<br>
- +Here's your reward.<br>
- +We were able to collect some essences Kanabionov. Here, hold.<br>
- +We are in the chronology of your activities. If you want, we will tell you how effective the activities around Kamaloka, and who made the biggest contribution to our common cause.<br>
- +First, leave the area.<br>
- +<a Action="bypass -h Quest RimKamaloka Exit">Exit.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/GradeS.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/GradeS.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/GradeS.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +Your result: %count%<br>
- +<center>Rank S</center><br>
- +This... These are the great reaching, is worthy of the heroes legends!<br>
- +I see, you understood the essence of our matter and it is wonderful they managed the task assigned to you.<br>
- +We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
- +You do want to obtain the reward, which corresponds to your level?<br>
- +<a action="bypass -h Quest RimKamaloka Reward">Obtain the reward.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Heine.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Heine.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Heine.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 2">Enter Hall of Abyss (30~40 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 3">Enter Hall of Abyss (35~45 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 4">Enter Hall of Abyss (40~50 levels)</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Innadril.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Innadril.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Innadril.htm (working copy)
- @@ -0,0 +1,9 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 2">Enter Hall of Abyss (30~40 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 3">Enter Hall of Abyss (35~45 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 4">Enter Hall of Abyss (40~50 levels)</a>
- +</body></html>
- Index: dist/game/data/scripts/instances/RimKamaloka/Oren.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Oren.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Oren.htm (working copy)
- @@ -0,0 +1,10 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 3">Enter Hall of Abyss (35~45 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 4">Enter Hall of Abyss (40~50 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 5">Enter Hall of Abyss (45~55 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 6">Enter Hall of Abyss (50~60 levels)</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Rewarded.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Rewarded.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Rewarded.htm (working copy)
- @@ -0,0 +1,7 @@
- +<html><body>Pathfinder Worker:<br>
- +Here is your reward.<br>
- +We succeeded in gathering a little the essences devastated by you Kanabions. Here, you hold.<br>
- +We conduct the chronology of your activity. If you want, we will describe to you, to what extent is effective activity in the Environments of Kamaloka, and who made the largest contribution to our common work.<br>
- +First leave this place.<br>
- +<a action="bypass -h Quest RimKamaloka Exit">Exit.</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/RimKamaloka.java
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/RimKamaloka.java (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/RimKamaloka.java (working copy)
- @@ -0,0 +1,1122 @@
- +/*
- + * Copyright (C) 2004-2019 L2J DataPack
- + *
- + * This file is part of L2J DataPack.
- + *
- + * L2J DataPack 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.
- + *
- + * L2J DataPack 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.RimKamaloka;
- +
- +import java.util.ArrayList;
- +import java.util.Calendar;
- +import java.util.HashMap;
- +import java.util.List;
- +import java.util.Map;
- +import java.util.concurrent.ScheduledFuture;
- +import java.util.logging.Logger;
- +
- +import org.l2jmobius.commons.threads.ThreadPool;
- +import org.l2jmobius.commons.util.Rnd;
- +import org.l2jmobius.gameserver.ai.CtrlIntention;
- +import org.l2jmobius.gameserver.data.xml.NpcData;
- +import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
- +import org.l2jmobius.gameserver.instancemanager.InstanceManager;
- +import org.l2jmobius.gameserver.model.Location;
- +import org.l2jmobius.gameserver.model.Party;
- +import org.l2jmobius.gameserver.model.Spawn;
- +import org.l2jmobius.gameserver.model.World;
- +import org.l2jmobius.gameserver.model.actor.Attackable;
- +import org.l2jmobius.gameserver.model.actor.Npc;
- +import org.l2jmobius.gameserver.model.actor.Player;
- +import org.l2jmobius.gameserver.model.actor.instance.Monster;
- +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
- +import org.l2jmobius.gameserver.model.instancezone.Instance;
- +import org.l2jmobius.gameserver.model.instancezone.InstanceWorld;
- +import org.l2jmobius.gameserver.network.SystemMessageId;
- +import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
- +import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
- +
- +import instances.AbstractInstance;
- +
- +//@formatter:off
- +/**
- + * Instance Rim Pailaka.
- + * @author MaGa, GuruGel
- + * Instance level 80-85 is doesn't work because is not supported by the client.
- + */
- +public class RimKamaloka extends AbstractInstance
- +{
- + private static final Logger _log = Logger.getLogger(RimKamaloka.class.getName());
- + /*
- + * Reset time for all Rimkamaloka Default: 6:30AM on server time
- + */
- + private static final int RESET_HOUR = 6;
- + private static final int RESET_MIN = 30;
- +
- + // NPC
- + private static final int START_NPC = 32484;
- + private static final int REWARDER = 32485;
- +
- + /*
- + * Duration of the instance, minutes
- + */
- + private static final int DURATION = 20;
- +
- + /*
- + * Time after which instance without players will be destroyed Default: 5 minutes
- + */
- + private static final int EMPTY_DESTROY_TIME = 5;
- +
- + /*
- + * Time to destroy instance (and eject player away) Default: 5 minutes
- + */
- + private static final int EXIT_TIME = 5;
- +
- + /*
- + * Maximum level difference between players level and kamaloka level Default: 5
- + */
- + private static final int MAX_LEVEL_DIFFERENCE = 5;
- +
- + private static final int RESPAWN_DELAY = 10;
- +
- + private static final int DESPAWN_DELAY = 10000;
- +
- + /*
- + * Hardcoded instance ids for kamaloka
- + */
- + private static final int[] TEMPLATE_IDS =
- + {
- + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56
- + };
- +
- + /*
- + * Level of the kamaloka
- + */
- + private static final int[] LEVEL =
- + {
- + 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80
- + };
- +
- + /*
- + * Teleport points into instances x, y, z
- + */
- + private static final Location[] TELEPORTS =
- + {
- + new Location(9264, -220641, -8032), // 25 (Town of Gludio, Town of Dion)
- + new Location(16436, -220654, -8032), // 30 (Town of Gludio, Town of Dion)
- + new Location(23486, -220839, -7808), // 35 (Town of Dion, Heine)
- + new Location(9307, -213681, -7808), // 40 (Heine, Town of Oren)
- + new Location(16603, -213720, -7808), // 45 (Heine, Town of Oren)
- + new Location(23651, -213584, -8016), // 50 (Town of Oren, Town of Schuttgart)
- + new Location(9134, -206264, -8016), // 55 (Town of Oren, Town of Schuttgart)
- + new Location(16505, -206244, -8016), // 60 (Rune Township, Town of Schuttgart)
- + new Location(23246, -206950, -8000), // 65 (Rune Township, Town of Schuttgart)
- + new Location(42423, -220443, -8768), // 70 (Rune Township)
- + new Location(49050, -220440, -8768), // 75 (Rune Township)
- + new Location(49050, -220440, -8768) // 80 (Rune Township)
- + };
- +
- + private static final int[][] KANABIONS =
- + {
- + {22452,22453,22454}, // 25
- + {22455,22456,22457}, // 30
- + {22458,22459,22460}, // 35
- + {22461,22462,22463}, // 40
- + {22464,22465,22466}, // 45
- + {22467,22468,22469}, // 50
- + {22470,22471,22472}, // 55
- + {22473,22474,22475}, // 60
- + {22476,22477,22478}, // 65
- + {22479,22480,22481}, // 70
- + {22482,22483,22484}, // 75
- + {2081, 2082, 2083} //80
- + };
- +
- + private static final int[][][] SPAWNLIST =
- + {
- + {// 25 level
- + { 8971, -219546, -8021 },
- + { 9318, -219644, -8021 },
- + { 9266, -220208, -8021 },
- + { 9497, -220054, -8024 }
- + },
- + {// 30 level
- + { 16107, -219574, -8021 },
- + { 16769, -219885, -8021 },
- + { 16363, -220219, -8021 },
- + { 16610, -219523, -8021 }
- + },
- + {// 35 level
- + { 23019, -219730, -7803 },
- + { 23351, -220455, -7803 },
- + { 23900, -219864, -7803 },
- + { 23851, -220294, -7803 }
- + },
- + {// 40 level
- + { 9514, -212478, -7803 },
- + { 9236, -213348, -7803 },
- + { 8868, -212683, -7803 },
- + { 9719, -213042, -7803 }
- + },
- + {// 45 level
- + { 16925, -212811, -7803 },
- + { 16885, -213199, -7802 },
- + { 16487, -213339, -7803 },
- + { 16337, -212529, -7803 }
- + },
- + {// 50 level
- + { 23958, -213282, -8009 },
- + { 23292, -212782, -8012 },
- + { 23844, -212781, -8009 },
- + { 23533, -213301, -8009 }
- + },
- + {// 55 level
- + { 8828, -205518, -8009 },
- + { 8895, -205989, -8009 },
- + { 9398, -205967, -8009 },
- + { 9393, -205409, -8009 }
- + },
- + {// 60 level
- + { 16185, -205472, -8009 },
- + { 16808, -205929, -8009 },
- + { 16324, -206042, -8009 },
- + { 16782, -205454, -8009 }
- + },
- + {// 65 level
- + { 23476, -206310, -7991 },
- + { 23230, -205861, -7991 },
- + { 22644, -205888, -7994 },
- + { 23078, -206714, -7991 }
- + },
- + {// 70 level
- + { 42981, -219308, -8759 },
- + { 42320, -220160, -8759 },
- + { 42434, -219181, -8759 },
- + { 42101, -219550, -8759 },
- + { 41859, -220236, -8759 },
- + { 42881, -219942, -8759 }
- + },
- + {// 75 level
- + { 48770, -219304, -8759 },
- + { 49036, -220190, -8759 },
- + { 49363, -219814, -8759 },
- + { 49393, -219102, -8759 },
- + { 49618, -220490, -8759 },
- + { 48526, -220493, -8759 }
- + },
- + {// 80 level
- + { 48770, -219304, -8759 },
- + { 49036, -220190, -8759 },
- + { 49363, -219814, -8759 },
- + { 49393, -219102, -8759 },
- + { 49618, -220490, -8759 },
- + { 48526, -220493, -8759 }
- + }
- + };
- +
- + public static final int[][] REWARDERS =
- + {
- + {9252,-219908,-8032},// 25 level
- + {16419,-219934,-8032},// 30 level
- + {23479,-220080,-7808},// 35 level
- + {9296,-212995,-7808},// 40 level
- + {16594,-212997,-7808},// 45 level
- + {23655,-213043,-8016},// 50 level
- + {9137,-205732,-8016},// 55 level
- + {16510,-205735,-8016},// 60 level
- + {23244,-206317,-8000},// 65 level
- + {42429,-219785,-8768},// 70 level
- + {49052,-219762,-8768},// 75 level
- + {49052, -219762, -8768}// 80 level
- + };
- +
- + private static final int[][][] REWARDS =
- + {
- + { // 20-30
- + null,
- + {13002,6,12824,1},
- + {13002,12,10836,1},
- + {13002,19,10837,1},
- + {13002,26,10838,1},
- + {13002,32,10844,1}},
- + { // 25-35
- + null,
- + {13002,6,12825,1},
- + {13002,12,10837,1},
- + {13002,19,10838,1},
- + {13002,26,10841,1},
- + {13002,32,12827,1}},
- + { // 30-40
- + null,
- + {13002,6,10840,1},
- + {13002,12,10841,1},
- + {13002,19,10842,1},
- + {13002,26,10843,1},
- + {13002,32,10844,1}},
- + { // 35-45
- + null,
- + {13002,6,12826,1},
- + {13002,12,10842,1},
- + {13002,19,10843,1},
- + {13002,26,10846,1},
- + {13002,32,10829,1}},
- + { // 40-50
- + null,
- + {13002,6,10845,1},
- + {13002,12,10846,1},
- + {13002,19,10847,1},
- + {13002,26,10848,1},
- + {13002,32,10849,1}},
- + { // 45-55
- + null,
- + {13002,6,12828,1},
- + {13002,12,10847,1},
- + {13002,19,10848,1},
- + {13002,26,10851,1},
- + {13002,32,10831,1}},
- + { // 50-60
- + null,
- + {13002,6,10850,1},
- + {13002,12,10851,1},
- + {13002,19,10852,1},
- + {13002,26,10853,1},
- + {13002,32,10854,1}},
- + { // 55-65
- + null,
- + {13002,6,12830,1},
- + {13002,12,10852,1},
- + {13002,19,10853,1},
- + {13002,26,10856,1},
- + {13002,32,10833,1}},
- + { // 60-70
- + null,
- + {13002,6,12855,1},
- + {13002,12,10856,1},
- + {13002,19,10857,1},
- + {13002,26,10858,1},
- + {13002,32,10859,1}},
- + { // 65-75
- + null,
- + {13002,6,12832,1},
- + {13002,12,10857,1},
- + {13002,19,10858,1},
- + {13002,26,10861,1},
- + {13002,32,12834,1}},
- + { // 70-80
- + null,
- + {13002,6,10860,1},
- + {13002,12,10861,1},
- + {13002,19,10862,1},
- + {13002,26,10864,1},
- + {13002,32,10865,1}},
- + { // 80-85
- + null,
- + {13002,6,10864,1},
- + {13002,12,10865,1},
- + {13002,19,10865,1},
- + {13002,26,10865,1},
- + {13002,32,10865,1}}
- + };
- +
- + private class RimKamaWorld extends InstanceWorld
- + {
- + public int index;
- + public int KANABION;
- + public int DOPPLER;
- + public int VOIDER;
- +
- + public int kanabionsCount = 0;
- + public int dopplersCount = 0;
- + public int voidersCount = 0;
- + public int grade = 0;
- + public boolean isFinished = false;
- + public boolean isRewarded = false;
- +
- + public ScheduledFuture<?> finishTask = null;
- +
- + public List<Monster> spawnedMobs = new ArrayList<>();
- + public Map<Integer, Long> lastAttack = new HashMap<>();
- + public ScheduledFuture<?> despawnTask = null;
- + }
- +
- + private RimKamaloka()
- + {
- + addStartNpc(START_NPC);
- + addFirstTalkId(START_NPC);
- + addFirstTalkId(REWARDER);
- + addTalkId(START_NPC);
- + addTalkId(REWARDER);
- +
- + for (int[] list : KANABIONS)
- + {
- + addFactionCallId(list[0]);
- + for (int mob : list)
- + {
- + addAttackId(mob);
- + addKillId(mob);
- + }
- + }
- + LOGGER.info("RimKamaloka: is load");
- + }
- +
- + /**
- + * Check if party with player as leader allowed to enter
- + * @param player party leader
- + * @param index (0-17) index of the kamaloka in arrays
- + * @return true if party allowed to enter
- + */
- + protected boolean checkConditions(Player player, int index)
- + {
- + final Party party = player.getParty();
- + // player must not be in party
- + if (party != null)
- + {
- + player.sendPacket(SystemMessageId.YOU_CANNOT_ENTER_DUE_TO_THE_PARTY_HAVING_EXCEEDED_THE_LIMIT);
- + return false;
- + }
- +
- + // get level of the instance
- + final int level = LEVEL[index];
- + // and client name
- + final String instanceName = InstanceManager.getInstance().getInstanceIdName(TEMPLATE_IDS[index]);
- +
- + // player level must be in range
- + if (Math.abs(player.getLevel() - level) > MAX_LEVEL_DIFFERENCE)
- + {
- + SystemMessage sm = new SystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
- + sm.addPcName(player);
- + player.sendPacket(sm);
- + return false;
- + }
- + // get instances reenter times for player
- + final Map<Integer, Long> instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(player.getObjectId());
- + if (instanceTimes != null)
- + {
- + for (int id : instanceTimes.keySet())
- + {
- + // find instance with same name (kamaloka or labyrinth)
- + if (!instanceName.equals(InstanceManager.getInstance().getInstanceIdName(id)))
- + {
- + continue;
- + }
- + // if found instance still can't be reentered - exit
- + if (System.currentTimeMillis() < instanceTimes.get(id))
- + {
- + SystemMessage sm = new SystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
- + sm.addPcName(player);
- + player.sendPacket(sm);
- + return false;
- + }
- + }
- + }
- + return true;
- + }
- +
- + /**
- + * Handling enter of the players into kamaloka
- + * @param player party leader
- + * @param index (0-17) kamaloka index in arrays
- + */
- + @Override
- + protected synchronized final void enterInstance(Player player, int index)
- + {
- + int templateId;
- + try
- + {
- + templateId = TEMPLATE_IDS[index];
- + }
- + catch (ArrayIndexOutOfBoundsException e)
- + {
- + LOGGER.warning("Problem with RimKamaloka: " + e.getMessage());
- + return;
- + }
- +
- + // check for existing instances for this player
- + InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
- + // player already in the instance
- + if (world != null)
- + {
- + // but not in kamaloka
- + if (!(world instanceof RimKamaWorld) || (world.getTemplateId() != templateId))
- + {
- + player.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON));
- + return;
- + }
- + // check for level difference again on reenter
- + if (Math.abs(player.getLevel() - LEVEL[((RimKamaWorld) world).index]) > MAX_LEVEL_DIFFERENCE)
- + {
- + SystemMessage sm = new SystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
- + sm.addPcName(player);
- + player.sendPacket(sm);
- + return;
- + }
- + // check what instance still exist
- + Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
- + if (inst != null)
- + {
- + teleportPlayer(player, TELEPORTS[index], world.getInstanceId());
- + }
- + }
- + // Creating new RimKamaloka instance
- + if (!checkConditions(player, index))
- + {
- + return;
- + }
- +
- + // Creating new instanceWorld, using our instanceId and templateId
- + world = new RimKamaWorld();
- + final Instance instance = InstanceManager.getInstance().createDynamicInstance(templateId);
- + world.setInstance(instance);
- +
- + // set return location
- + instance.setExitLoc(new Location(player));
- + // disable summon friend into instance
- + instance.setAllowSummon(false);
- + // set duration and empty destroy time
- + instance.setDuration(DURATION * 60000);
- + instance.setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
- +
- + // set index for easy access to the arrays
- + ((RimKamaWorld) world).index = index;
- + InstanceManager.getInstance().addWorld(world);
- + // spawn npcs
- + spawnKama((RimKamaWorld) world);
- + // Task
- + ((RimKamaWorld) world).finishTask = ThreadPool.schedule(new FinishTask((RimKamaWorld) world), DURATION * 60000);
- + ((RimKamaWorld) world).despawnTask = ThreadPool.scheduleAtFixedRate(new DespawnTask((RimKamaWorld) world), 1000, 1000);
- +
- + InstanceManager.getInstance().addWorld(world);
- +
- + teleportPlayer(player, TELEPORTS[index], world.getInstanceId());
- + }
- +
- + /**
- + * Spawn all NPCs in kamaloka
- + * @param world instanceWorld
- + */
- + private static final void spawnKama(RimKamaWorld world)
- + {
- + int[][] spawnlist;
- + final int index = world.index;
- + world.KANABION = KANABIONS[index][0];
- + world.DOPPLER = KANABIONS[index][1];
- + world.VOIDER = KANABIONS[index][2];
- +
- + try
- + {
- + final NpcTemplate mob1 = NpcData.getInstance().getTemplate(world.KANABION);
- +
- + spawnlist = SPAWNLIST[index];
- + final int length = spawnlist.length;
- +
- + Spawn spawn;
- + for (int i = 0; i < length; i++)
- + {
- + final int[] loc = spawnlist[i];
- + spawn = new Spawn(mob1);
- + spawn.setInstanceId(world.getInstanceId());
- + spawn.setXYZ(loc[0], loc[1], loc[2]);
- + spawn.setHeading(-1);
- + spawn.setRespawnDelay(Rnd.get(RESPAWN_DELAY, 5));
- + spawn.setAmount(1);
- + spawn.startRespawn();
- + spawn.doSpawn();
- + }
- + }
- + catch (Exception e)
- + {
- + _log.warning("RimKamaloka: error during spawn: ");
- + }
- + }
- +
- + private static final void spawnNextMob(RimKamaWorld world, Npc oldNpc, int npcId, Player player)
- + {
- + if (world.isFinished)
- + {
- + return;
- + }
- +
- + Monster monster = null;
- + if (!world.spawnedMobs.isEmpty())
- + {
- + for (Monster mob : world.spawnedMobs)
- + {
- + if ((mob == null) || !mob.isDecayed() || (mob.getId() != npcId))
- + {
- + continue;
- + }
- + mob.setDecayed(false);
- + mob.setDead(false);
- + mob.overhitEnabled(false);
- + mob.refreshId();
- + monster = mob;
- + break;
- + }
- + }
- +
- + if (monster == null)
- + {
- + final NpcTemplate template = NpcData.getInstance().getTemplate(npcId);
- + monster = new Monster(template);
- + world.spawnedMobs.add(monster);
- + }
- +
- + synchronized (world.lastAttack)
- + {
- + world.lastAttack.put(monster.getObjectId(), System.currentTimeMillis());
- + }
- +
- + monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
- + monster.setHeading(oldNpc.getHeading());
- + monster.setInstanceId(oldNpc.getInstanceId());
- + monster.spawnMe(oldNpc.getX(), oldNpc.getY(), oldNpc.getZ() + 20);
- + monster.setRunning();
- + monster.addDamageHate(player, 0, 9999);
- + monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
- + }
- +
- + private synchronized final void rewardPlayer(RimKamaWorld world, Npc npc)
- + {
- + final Instance instance = InstanceManager.getInstance().getInstance(world.getInstanceId());
- + if (!world.isFinished || world.isRewarded)
- + {
- + return;
- + }
- + world.isRewarded = true;
- +
- + final int[][] allRewards = REWARDS[world.index];
- + world.grade = Math.min(world.grade, allRewards.length);
- + final int[] reward = allRewards[world.grade];
- + if (reward == null)
- + {
- + return;
- + }
- + for (int objectId : instance.getPlayers())
- + {
- + Player player = World.getInstance().getPlayer(objectId);
- + if ((player != null) && player.isOnline())
- + {
- + player.sendMessage("Grade:"+world.grade);
- + for (int i = 0; i < reward.length; i+=2)
- + {
- + player.addItem("Reward", reward[i], reward[i+1], npc, true);
- + }
- + }
- + }
- + }
- +
- + class LockTask implements Runnable
- + {
- + private final RimKamaWorld _world;
- +
- + LockTask(RimKamaWorld world)
- + {
- + _world = world;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_world != null)
- + {
- + Calendar reenter = Calendar.getInstance();
- + reenter.set(Calendar.MINUTE, RESET_MIN);
- + // if time is >= RESET_HOUR - roll to the next day
- + if (reenter.get(Calendar.HOUR_OF_DAY) >= RESET_HOUR)
- + {
- + reenter.roll(Calendar.DATE, true);
- + }
- + reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
- +
- + SystemMessage sm = new SystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
- + sm.addString(InstanceManager.getInstance().getInstanceIdName(_world.getTemplateId()));
- +
- + // set instance reenter time for all allowed players
- + boolean found = false;
- + for (Player plr : _world.getAllowed())
- + {
- + if (plr != null)
- + {
- + InstanceManager.getInstance().setInstanceTime(plr.getObjectId(), _world.getTemplateId(), reenter.getTimeInMillis());
- + if (plr.isOnline())
- + {
- + plr.sendPacket(sm);
- + }
- + }
- + }
- + if (!found)
- + {
- + _world.isFinished = true;
- + _world.spawnedMobs.clear();
- + _world.lastAttack.clear();
- + if (_world.finishTask != null)
- + {
- + _world.finishTask.cancel(false);
- + _world.finishTask = null;
- + }
- + if (_world.despawnTask != null)
- + {
- + _world.despawnTask.cancel(false);
- + _world.despawnTask = null;
- + }
- +
- + InstanceManager.getInstance().destroyInstance(_world.getInstanceId());
- + }
- + }
- + }
- + }
- +
- + class FinishTask implements Runnable
- + {
- + private final RimKamaWorld _world;
- +
- + FinishTask(RimKamaWorld world)
- + {
- + _world = world;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_world != null)
- + {
- + _world.isFinished = true;
- + if (_world.despawnTask != null)
- + {
- + _world.despawnTask.cancel(false);
- + _world.despawnTask = null;
- + }
- + _world.spawnedMobs.clear();
- + _world.lastAttack.clear();
- + // destroy instance after EXIT_TIME
- + final Instance inst = InstanceManager.getInstance().getInstance(_world.getInstanceId());
- + if (inst != null)
- + {
- + inst.removeNpcs();
- + inst.setDuration(EXIT_TIME * 60000);
- + if (inst.getPlayers().isEmpty())
- + {
- + inst.setDuration(EMPTY_DESTROY_TIME * 60000);
- + }
- + else
- + {
- + inst.setDuration(EXIT_TIME * 60000);
- + inst.setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
- + }
- + }
- +
- + // calculate reward
- + if ((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) < 20)
- + {
- + _world.grade = 0;
- + }
- + else if (((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) > 20) && ((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) < 40))
- + {
- + _world.grade = 1;
- + }
- + else if (((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) > 40) && ((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) < 50))
- + {
- + _world.grade = 2;
- + }
- + else if (((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) > 50) && ((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) < 100))
- + {
- + _world.grade = 3;
- + }
- + else if (((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) > 100) && ((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) < 200))
- + {
- + _world.grade = 4;
- + }
- + else if ((_world.kanabionsCount + _world.dopplersCount + _world.voidersCount) > 200)
- + {
- + _world.grade = 5;
- + }
- +
- + final int index = _world.index;
- + // spawn rewarder npc
- + addSpawn(REWARDER, REWARDERS[index][0], REWARDERS[index][1], REWARDERS[index][2], 0, false, 0, false, _world.getInstanceId());
- + }
- + }
- + }
- +
- + class DespawnTask implements Runnable
- + {
- + private final RimKamaWorld _world;
- +
- + DespawnTask(RimKamaWorld world)
- + {
- + _world = world;
- + }
- +
- + @Override
- + public void run()
- + {
- + if ((_world != null) && !_world.isFinished && !_world.lastAttack.isEmpty() && !_world.spawnedMobs.isEmpty())
- + {
- + final long time = System.currentTimeMillis();
- + for (Monster mob : _world.spawnedMobs)
- + {
- + if ((mob == null) || mob.isDead())
- + {
- + continue;
- + }
- + if (_world.lastAttack.containsKey(mob.getObjectId()) && ((time - _world.lastAttack.get(mob.getObjectId())) > DESPAWN_DELAY))
- + {
- + mob.deleteMe();
- + synchronized (_world.lastAttack)
- + {
- + _world.lastAttack.remove(mob.getObjectId());
- + }
- + }
- + }
- + }
- + }
- + }
- +
- + @Override
- + public final String onAdvEvent(String event, Npc npc, Player player)
- + {
- + if ((npc == null) || (player == null))
- + {
- + return null;
- + }
- +
- + if (event.equalsIgnoreCase("Exit"))
- + {
- + final InstanceWorld inst = InstanceManager.getInstance().getWorld(player);
- + if (inst instanceof RimKamaWorld)
- + {
- + final RimKamaWorld world = ((RimKamaWorld) inst);
- + Instance inst1 = InstanceManager.getInstance().getInstance(world.getInstanceId());
- + world.removeAllowed(player);
- + teleportPlayer(player, inst1.getExitLoc(), 0);
- + }
- + }
- + else if (event.equalsIgnoreCase("Reward"))
- + {
- + try
- + {
- + final InstanceWorld world = InstanceManager.getInstance().getWorld(npc.getInstanceId());
- + if ((world instanceof RimKamaWorld) && world.isAllowed(player))
- + {
- + rewardPlayer((RimKamaWorld)world, npc);
- + }
- + }
- + catch (Exception e)
- + {
- + _log.warning("RimKamaloka: problem with reward: ");
- + }
- + return "Rewarded.htm";
- + }
- + else if (event.equalsIgnoreCase("Winner"))
- + {
- + final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
- +
- + packet.setHtml(getHtm(player, "Winner.htm"));
- +
- + if(GlobalVariablesManager.getInstance().getInt(player.getName() + "_") < 50)
- + {
- + packet.replace("%name%", GlobalVariablesManager.getInstance().getString(player.getName()));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + }
- + else
- + {
- + packet.replace("%name%","No winner");
- + packet.replace("%count%","No winner");
- + }
- + if(GlobalVariablesManager.getInstance().getInt(player.getName() + "_") >= 200)
- + {
- + packet.replace("%name1%", GlobalVariablesManager.getInstance().getString(player.getName()));
- + }
- + else
- + {
- + packet.replace("%name1%","No winner");
- + packet.replace("%count1%","No winner");
- + }
- + if((GlobalVariablesManager.getInstance().getInt(player.getName() + "_") >= 100) && (GlobalVariablesManager.getInstance().getInt(player.getName() + "_") <= 200))
- + {
- + packet.replace("%name2%", GlobalVariablesManager.getInstance().getString(player.getName()));
- + }
- + else
- + {
- + packet.replace("%name2%","No winner");
- + packet.replace("%count2%","No winner");
- + }
- + if((GlobalVariablesManager.getInstance().getInt(player.getName() + "_") >= 50) && (GlobalVariablesManager.getInstance().getInt(player.getName() + "_") < 100))
- + {
- + packet.replace("%name3%", GlobalVariablesManager.getInstance().getString(player.getName()));
- + packet.replace("%count3%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + }
- + else
- + {
- + packet.replace("%name3%","No winner");
- + packet.replace("%count3%","No winner");
- + }
- +
- + player.sendPacket(packet);
- + }
- +
- + try
- + {
- + enterInstance(player, Integer.parseInt(event));
- + }
- + catch (Exception e)
- + {
- + }
- + return null;
- + }
- +
- + @Override
- + public final String onFactionCall(Npc npc, Npc caller, Player attacker, boolean isPet)
- + {
- + if ((npc == null) || (caller == null))
- + {
- + return null;
- + }
- +
- + if (npc.getId() == caller.getId())
- + {
- + return null;
- + }
- +
- + return super.onFactionCall(npc, caller, attacker, isPet);
- + }
- +
- + @Override
- + public final String onTalk(Npc npc, Player player)
- + {
- + if (npc == null)
- + {
- + return null;
- + }
- + if ((npc.getId() == START_NPC) && !player.hasPremiumStatus())
- + {
- + return "noPC.htm";
- + }
- +
- + if (npc.getId() == START_NPC)
- + {
- + return npc.getCastle().getName() + ".htm";
- + }
- + else if (npc.getId() == REWARDER)
- + {
- + final InstanceWorld tmpWorld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
- + if (tmpWorld instanceof RimKamaWorld)
- + {
- + final RimKamaWorld world = (RimKamaWorld) tmpWorld;
- + if (!world.isFinished)
- + {
- + return "";
- + }
- + final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
- + switch (world.grade)
- + {
- + case 0:
- + packet.setHtml(getHtm(player, "GradeF.htm"));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + case 1:
- + packet.setHtml(getHtm(player, "GradeD.htm"));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + case 2:
- + packet.setHtml(getHtm(player, "GradeC.htm"));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + case 3:
- + packet.setHtml(getHtm(player, "GradeB.htm"));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + case 4:
- + packet.setHtml(getHtm(player, "GradeA.htm"));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + case 5:
- + packet.setHtml(getHtm(player, "GradeS.htm"));
- + packet.replace("%count%", GlobalVariablesManager.getInstance().getInt(player.getName() + "_"));
- + }
- + player.sendPacket(packet);
- + }
- + }
- +
- + return null;
- + }
- +
- + @Override
- + public final String onFirstTalk(Npc npc, Player player)
- + {
- + return String.valueOf(npc.getId()) + ".htm";
- + }
- +
- + @Override
- + public final String onAttack(Npc npc, Player attacker, int damage, boolean isPet)
- + {
- + if ((npc == null) || (attacker == null))
- + {
- + return null;
- + }
- +
- + final InstanceWorld tmpWorld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
- + if (tmpWorld instanceof RimKamaWorld)
- + {
- + final RimKamaWorld world = (RimKamaWorld) tmpWorld;
- + synchronized (world.lastAttack)
- + {
- + world.lastAttack.put(npc.getObjectId(), System.currentTimeMillis());
- + }
- +
- + final int maxHp = npc.getMaxHp();
- + if (npc.getCurrentHp() == maxHp)
- + {
- + if (((damage * 100) / maxHp) > 40)
- + {
- + final int npcId = npc.getId();
- + final int chance = Rnd.get(100);
- + int nextId = 0;
- +
- + if (npcId == world.KANABION)
- + {
- + if (chance < 10)
- + {
- + nextId = world.DOPPLER;
- + }
- + }
- + else if (npcId == world.DOPPLER)
- + {
- + if (chance < 10)
- + {
- + nextId = world.DOPPLER;
- + }
- + else if (chance < 15)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- + else if (npcId == world.VOIDER)
- + {
- + if (chance < 10)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- +
- + if (nextId > 0)
- + {
- + spawnNextMob(world, npc, nextId, attacker);
- + }
- + }
- + }
- + }
- +
- + return super.onAttack(npc, attacker, damage, isPet);
- + }
- +
- + @Override
- + public final String onKill(Npc npc, Player player, boolean isPet)
- + {
- + if ((npc == null) || (player == null))
- + {
- + return null;
- + }
- +
- + final InstanceWorld tmpWorld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
- + if (tmpWorld instanceof RimKamaWorld)
- + {
- + final RimKamaWorld world = (RimKamaWorld) tmpWorld;
- + synchronized (world.lastAttack)
- + {
- + world.lastAttack.remove(npc.getObjectId());
- + }
- +
- + final int npcId = npc.getId();
- + final int chance = Rnd.get(100);
- + int nextId = 0;
- +
- + if (npcId == world.KANABION)
- + {
- + world.kanabionsCount++;
- + if (((Attackable) npc).isOverhit())
- + {
- + if (chance < 30)
- + {
- + nextId = world.DOPPLER;
- + }
- + else if (chance < 40)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- + else if (chance < 15)
- + {
- + nextId = world.DOPPLER;
- + }
- + }
- + else if (npcId == world.DOPPLER)
- + {
- + world.dopplersCount++;
- + if (((Attackable) npc).isOverhit())
- + {
- + if (chance < 30)
- + {
- + nextId = world.DOPPLER;
- + }
- + else if (chance < 60)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- + else
- + {
- + if (chance < 10)
- + {
- + nextId = world.DOPPLER;
- + }
- + else if (chance < 20)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- + }
- + else if (npcId == world.VOIDER)
- + {
- + world.voidersCount++;
- + if (((Attackable) npc).isOverhit())
- + {
- + if (chance < 50)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- + else if (chance < 20)
- + {
- + nextId = world.VOIDER;
- + }
- + }
- +
- + if (nextId > 0)
- + {
- + spawnNextMob(world, npc, nextId, player);
- + }
- + GlobalVariablesManager.getInstance().set(player.getName(), player.getName());
- + GlobalVariablesManager.getInstance().set(player.getName() + "_", world.voidersCount + world.dopplersCount + world.kanabionsCount);
- + }
- +
- + return super.onKill(npc, player, isPet);
- + }
- +
- + @Override
- + public void onEnterInstance(Player player, InstanceWorld world, boolean firstEntrance)
- + {
- + // Managed by script.
- + }
- +
- + public static void main(String[] args)
- + {
- + new RimKamaloka();
- + }
- +}
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Rune.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Rune.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Rune.htm (working copy)
- @@ -0,0 +1,11 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 7">Enter Hall of Abyss (55~65 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 8">Enter Hall of Abyss (60~70 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 9">Enter Hall of Abyss (65~75 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 10">Enter Hall of Abyss (70~80 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 11">Enter Hall of Abyss (80~85 levels)</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Schuttgart.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Schuttgart.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Schuttgart.htm (working copy)
- @@ -0,0 +1,10 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +hey are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
- +(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
- +<a action="bypass -h Quest RimKamaloka 5">Enter Hall of Abyss (45~55 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 6">Enter Hall of Abyss (50~60 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 7">Enter Hall of Abyss (55~65 levels)</a><br>
- +<a action="bypass -h Quest RimKamaloka 8">Enter Hall of Abyss (60~70 levels)</a>
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/Winner.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/Winner.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/Winner.htm (working copy)
- @@ -0,0 +1,8 @@
- +<html><body>Pathfinder Worker:<br>
- +Do you want to view the names of the adventurers who accomplished great things in battle against Rim Kamaloka<font color="LEVEL"> today</font>? If your name is among them, you are elegible to receive a special Blessing.<br>
- +<font color="LEVEL">Pathfinder Savior</font> %name1%<br><br>
- +<font color="LEVEL">Pathfinder Supporter</font> %name2%.<br>
- +<center> %name3% %count3%<br>
- + %name% %count%<br>
- +(These records are reset every day. It may take some time for updates to be posted.)
- +</body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/instances/RimKamaloka/noPC.htm
- ===================================================================
- --- dist/game/data/scripts/instances/RimKamaloka/noPC.htm (nonexistent)
- +++ dist/game/data/scripts/instances/RimKamaloka/noPC.htm (working copy)
- @@ -0,0 +1,8 @@
- +<html><body>Pathfinder Worker:<br>
- +We Pathfinders were dispatched by the Ivory Tower to defend dreams against attack. We have been waiting for an adventurer like you!<br>
- +<a action="bypass -h npc_%objectId%_Chat 1">Ask about the Chamber of Delusion.</a><br>
- +Only those who have already experienced dreams may enter the Rim Kamaloka. The dream of which I speak is that of the Darkness that seeks to destroy.<br>
- +If you have had that dream, a trace of it -- the "Piece of Dream" -- will have been left on your soul. Based on that trace, we can guide adventurers to the Rim Kamaloka.<br>
- +However...I sense no such trace in you...<br>
- +(You may only enter the Rim Kamaloka from a PC Cafe.)
- +</body></html>
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment