Merged with released L2J-Unity files.
This commit is contained in:
3
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32111-no.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32111-no.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Orahochin:<br>
|
||||
Oh ho -- you have sought me out while battling the dinosaurs, have you? And now you ask me to teleport you to that place? That island was created as as a sanctuary; it is my duty is to protect its inhabitants from external harm. I certainly have no intention of making that place a refuge for reckless adventurers! It is my policy not to teleport any who are engaged in battle, so return after the battle has ended.
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32111.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32111.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Orahochin:<br>
|
||||
Welcome! I am Orahochin, proud warrior of the Elroki tribe! I was sent here to guard this place. In truth, I guard the hope and future of the tribe itself. You don't understand? Ah, my young friend, I hope your feet are quicker than your wits! Ha ha!<br>
|
||||
See the island over there? There you will find a village of innocent, peaceful Elroki natives. They are far different than the degraded Elrokhians you find here, that I can assure you.<br>
|
||||
To protect them, I will transport only those to the island that mean them no harm. Ah... You don't seem like the dangerous sort -- I will teleport you to the island if you wish.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest ElrokiTeleporters">Teleport.</a>
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32112-no.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32112-no.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Gariachin:<br>
|
||||
Oh, no! This is not good, not good at all. My sincerest apologies -- I cannot tell you what happened in detail -- but I cannot teleport you to your destination at the moment. I'm terribly sorry for the inconvenience.
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32112.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/32112.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Gariachin:<br>
|
||||
Welcome! I am Gariachin. I am entrusted with the teleportation of visitors to this island. It may sound strange to you, but I've come to love this island and respect its people. It is a precious place, housing the hope, wisdom and future of the Elroki tribe.<br>
|
||||
I will transport you to the southern beach of the Primeval Plains. If you have the chance, will you send my regards to my friend, Orahochin?<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest ElrokiTeleporters">Teleport.</a>
|
||||
</body></html>
|
63
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/ElrokiTeleporters.java
vendored
Normal file
63
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/ElrokiTeleporters/ElrokiTeleporters.java
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.PrimevalIsle.ElrokiTeleporters;
|
||||
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Elroki teleport AI.
|
||||
* @author Plim
|
||||
*/
|
||||
public final class ElrokiTeleporters extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int ORAHOCHIN = 32111;
|
||||
private static final int GARIACHIN = 32112;
|
||||
// Locations
|
||||
private static final Location TELEPORT_ORAHOCIN = new Location(4990, -1879, -3178);
|
||||
private static final Location TELEPORT_GARIACHIN = new Location(7557, -5513, -3221);
|
||||
|
||||
private ElrokiTeleporters()
|
||||
{
|
||||
addFirstTalkId(ORAHOCHIN, GARIACHIN);
|
||||
addStartNpc(ORAHOCHIN, GARIACHIN);
|
||||
addTalkId(ORAHOCHIN, GARIACHIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance talker)
|
||||
{
|
||||
if (!talker.isInCombat())
|
||||
{
|
||||
talker.teleToLocation((npc.getId() == ORAHOCHIN) ? TELEPORT_ORAHOCIN : TELEPORT_GARIACHIN);
|
||||
}
|
||||
else
|
||||
{
|
||||
return npc.getId() + "-no.html";
|
||||
}
|
||||
return super.onTalk(npc, talker);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ElrokiTeleporters();
|
||||
}
|
||||
}
|
4
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-01.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-01.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
Wait.. It doesn't seem as though you are the one destined for the front lines in this battle. I was supposed to open a passage to Sailren's lair only to the leader of one party. If you wish to teleport, bring your party leader to me or return here as a party leader.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">"Tell me about entry requirements and battle method."</button>
|
||||
</body></html>
|
8
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-01a.html
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-01a.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
You know that in the past, Mother Shilen paid a great sacrifice to lock Sailren here.<br>
|
||||
Afterward, she created a stone likeness of herself and bestowed upon it the power to seal, making it a guardian of this place to ensure that Sailren remained imprisoned.<br>
|
||||
I am that stone statue of Shilen.<br>
|
||||
Mother Shilen also entrusted the power to seal to those who wield the sacred ax Gazkh.<br>
|
||||
I will only open the gate for those who have Gazkh and their friends. When the seal is at its weakest, however, I allow a warrior to enter in order to minimize the sacrifice.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-02a.html">"Tell me more details about that."</button>
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-02.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-02.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Shilen's Stone Statue:<br>You have the heart to fight Sailren, of that there can be no doubt. But if you do not have Gazkh given to you by Shilen, Sailren will certainly kill you. If you want to teleport within, complete my quest and obtain Gazkh.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">"Tell me about entry requirements and battle method."</button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-02a.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-02a.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
Only a party whose leader wields Gazkh can enter Sailren's Stronghold and battle the creature.<br>
|
||||
Be aware that any party member who is far away at the time of entry cannot enter the Stronghold. Nor can another party enter until the first party has exited.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-03a.html">"I want to hear more about Sailren's power and how to fight it."</button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-03.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-03.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
Shilen's protection is not with you -- go away! You are not qualified to fight against Sailren...<br>
|
||||
If you want to enter Sailren's nest, then you should find a party leader who can fight against Sailren and join his party. Or you can complete my quest to become a party leader, form your own party, and then return here.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">"Tell me about entry requirements and battle method."</button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-03a.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-03a.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
There are not many of them, but Sailren is protected by its dinosaur followers. Combined with my enchantment and the power of the other statues, we are restraining Sailren and its followers from escaping. But as they begin to break free of our control, their power and magic also begins to extend beyond the Lost Nest, affecting even the Primeval Plains!<br>
|
||||
If the powers of the Stone Statues are completely broken, Sailren and its followers will escape and this island and everything on it will perish.<br>
|
||||
Alas, Shilen is not here to protect us! In order to re-seal that horrifying dinosaur, you must defeat its followers first, and then work as a team to defeat Sailren.
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-04.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-04.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
Currently the magic power of Sailren and its followers is very strong. I do not think you can win solely with your own power, especially given how weak the seal stones have become.<br>
|
||||
My counsel is that you first recover the power to seal and wait 'til Sailren's strength lessens a bit. Then you will have your best chance of entering the nest and defeating this ancient evil.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">"Tell me about entry requirements and battle method."</button>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-05.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109-05.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
There is another brave party fighting against Sailren right now, so I cannot teleport you into the nest. When they return, I will teleport you.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01a.html">"Tell me about entry requirements and battle method."</button>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/32109.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
(Just like it proves the fact that it has protected this place for a long time, the appearance of the statue shows abrasion here and there. However, the statue is exerting its dignity. When you stand before the statue, the response is detected.)<br>
|
||||
Hey, stranger... What do you want from Shilen's Stone Statue, the Evil Thoughts of Mother Shilen and the Final Watcher of Sailen?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01.html">"Tell me about entry requirements and battle method."</button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren enter">"I'd like to participate in missions to mop up Sailen and its group."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
327
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/Sailren.java
vendored
Normal file
327
trunk/dist/game/data/scripts/ai/areas/PrimevalIsle/Sailren/Sailren.java
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.PrimevalIsle.Sailren;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jmobius.gameserver.model.TeleportWhereType;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2RaidBossInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.zone.type.L2NoRestartZone;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Sailren AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class Sailren extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int STATUE = 32109; // Shilen's Stone Statue
|
||||
private static final int MOVIE_NPC = 32110; // Invisible NPC for movie
|
||||
private static final int SAILREN = 29065; // Sailren
|
||||
private static final int VELOCIRAPTOR = 22218; // Velociraptor
|
||||
private static final int PTEROSAUR = 22199; // Pterosaur
|
||||
private static final int TREX = 22217; // Tyrannosaurus
|
||||
private static final int CUBIC = 32107; // Teleportation Cubic
|
||||
// Item
|
||||
private static final int GAZKH = 8784; // Gazkh
|
||||
// Skill
|
||||
private static final SkillHolder ANIMATION = new SkillHolder(5090, 1);
|
||||
// Zone
|
||||
private static final L2NoRestartZone zone = ZoneManager.getInstance().getZoneById(70049, L2NoRestartZone.class);
|
||||
// Misc
|
||||
private static final int RESPAWN = 1; // Respawn time (in hours)
|
||||
private static final int MAX_TIME = 3200; // Max time for Sailren fight (in minutes)
|
||||
private static Status STATUS = Status.ALIVE;
|
||||
private static int _killCount = 0;
|
||||
private static long _lastAttack = 0;
|
||||
|
||||
private static enum Status
|
||||
{
|
||||
ALIVE,
|
||||
IN_FIGHT,
|
||||
DEAD
|
||||
}
|
||||
|
||||
private Sailren()
|
||||
{
|
||||
addStartNpc(STATUE, CUBIC);
|
||||
addTalkId(STATUE, CUBIC);
|
||||
addFirstTalkId(STATUE);
|
||||
addKillId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
|
||||
addAttackId(VELOCIRAPTOR, PTEROSAUR, TREX, SAILREN);
|
||||
|
||||
final long remain = GlobalVariablesManager.getInstance().getLong("SailrenRespawn", 0) - System.currentTimeMillis();
|
||||
if (remain > 0)
|
||||
{
|
||||
STATUS = Status.DEAD;
|
||||
startQuestTimer("CLEAR_STATUS", remain, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "32109-01.html":
|
||||
case "32109-01a.html":
|
||||
case "32109-02a.html":
|
||||
case "32109-03a.html":
|
||||
{
|
||||
return event;
|
||||
}
|
||||
case "enter":
|
||||
{
|
||||
String htmltext = null;
|
||||
if (!player.isInParty())
|
||||
{
|
||||
htmltext = "32109-01.html";
|
||||
}
|
||||
else if (STATUS == Status.DEAD)
|
||||
{
|
||||
htmltext = "32109-04.html";
|
||||
}
|
||||
else if (STATUS == Status.IN_FIGHT)
|
||||
{
|
||||
htmltext = "32109-05.html";
|
||||
}
|
||||
else if (!player.getParty().isLeader(player))
|
||||
{
|
||||
htmltext = "32109-03.html";
|
||||
}
|
||||
else if (!hasQuestItems(player, GAZKH))
|
||||
{
|
||||
htmltext = "32109-02.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
takeItems(player, GAZKH, 1);
|
||||
STATUS = Status.IN_FIGHT;
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
for (L2PcInstance member : player.getParty().getMembers())
|
||||
{
|
||||
if (member.isInsideRadius(npc, 1000, true, false))
|
||||
{
|
||||
member.teleToLocation(27549, -6638, -2008);
|
||||
}
|
||||
}
|
||||
startQuestTimer("SPAWN_VELOCIRAPTOR", 60000, null, null);
|
||||
startQuestTimer("TIME_OUT", MAX_TIME * 1000, null, null);
|
||||
startQuestTimer("CHECK_ATTACK", 120000, null, null);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
case "teleportOut":
|
||||
{
|
||||
player.teleToLocation(TeleportWhereType.TOWN);
|
||||
break;
|
||||
}
|
||||
case "SPAWN_VELOCIRAPTOR":
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
addSpawn(VELOCIRAPTOR, 27313 + getRandom(150), -6766 + getRandom(150), -1975, 0, false, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SPAWN_SAILREN":
|
||||
{
|
||||
final L2RaidBossInstance sailren = (L2RaidBossInstance) addSpawn(SAILREN, 27549, -6638, -2008, 0, false, 0);
|
||||
final L2Npc movieNpc = addSpawn(MOVIE_NPC, sailren.getX(), sailren.getY(), sailren.getZ() + 30, 0, false, 26000);
|
||||
sailren.setIsInvul(true);
|
||||
sailren.setIsImmobilized(true);
|
||||
zone.broadcastPacket(new SpecialCamera(movieNpc, 60, 110, 30, 4000, 1500, 20000, 0, 65, 1, 0, 0));
|
||||
|
||||
startQuestTimer("ATTACK", 24600, sailren, null);
|
||||
startQuestTimer("ANIMATION", 2000, movieNpc, null);
|
||||
startQuestTimer("CAMERA_1", 4100, movieNpc, null);
|
||||
break;
|
||||
}
|
||||
case "ANIMATION":
|
||||
{
|
||||
if (npc != null)
|
||||
{
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(ANIMATION.getSkill());
|
||||
startQuestTimer("ANIMATION", 2000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CAMERA_1":
|
||||
{
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 100, 180, 30, 3000, 1500, 20000, 0, 50, 1, 0, 0));
|
||||
startQuestTimer("CAMERA_2", 3000, npc, null);
|
||||
break;
|
||||
}
|
||||
case "CAMERA_2":
|
||||
{
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 150, 270, 25, 3000, 1500, 20000, 0, 30, 1, 0, 0));
|
||||
startQuestTimer("CAMERA_3", 3000, npc, null);
|
||||
break;
|
||||
}
|
||||
case "CAMERA_3":
|
||||
{
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 160, 360, 20, 3000, 1500, 20000, 10, 15, 1, 0, 0));
|
||||
startQuestTimer("CAMERA_4", 3000, npc, null);
|
||||
break;
|
||||
}
|
||||
case "CAMERA_4":
|
||||
{
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 160, 450, 10, 3000, 1500, 20000, 0, 10, 1, 0, 0));
|
||||
startQuestTimer("CAMERA_5", 3000, npc, null);
|
||||
break;
|
||||
}
|
||||
case "CAMERA_5":
|
||||
{
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 160, 560, 0, 3000, 1500, 20000, 0, 10, 1, 0, 0));
|
||||
startQuestTimer("CAMERA_6", 7000, npc, null);
|
||||
break;
|
||||
}
|
||||
case "CAMERA_6":
|
||||
{
|
||||
zone.broadcastPacket(new SpecialCamera(npc, 70, 560, 0, 500, 1500, 7000, -15, 20, 1, 0, 0));
|
||||
break;
|
||||
}
|
||||
case "ATTACK":
|
||||
{
|
||||
npc.setIsInvul(false);
|
||||
npc.setIsImmobilized(false);
|
||||
break;
|
||||
}
|
||||
case "CLEAR_STATUS":
|
||||
{
|
||||
STATUS = Status.ALIVE;
|
||||
break;
|
||||
}
|
||||
case "TIME_OUT":
|
||||
{
|
||||
if (STATUS == Status.IN_FIGHT)
|
||||
{
|
||||
STATUS = Status.ALIVE;
|
||||
}
|
||||
for (L2Character charInside : zone.getCharactersInside())
|
||||
{
|
||||
if (charInside != null)
|
||||
{
|
||||
if (charInside.isPlayer())
|
||||
{
|
||||
charInside.teleToLocation(TeleportWhereType.TOWN);
|
||||
}
|
||||
else if (charInside.isNpc())
|
||||
{
|
||||
charInside.deleteMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CHECK_ATTACK":
|
||||
{
|
||||
if (!zone.getPlayersInside().isEmpty() && ((_lastAttack + 600000) < System.currentTimeMillis()))
|
||||
{
|
||||
cancelQuestTimer("TIME_OUT", null, null);
|
||||
notifyEvent("TIME_OUT", null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("CHECK_ATTACK", 120000, null, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
if (zone.isCharacterInZone(attacker))
|
||||
{
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
if (zone.isCharacterInZone(killer))
|
||||
{
|
||||
switch (npc.getId())
|
||||
{
|
||||
case SAILREN:
|
||||
{
|
||||
STATUS = Status.DEAD;
|
||||
addSpawn(CUBIC, 27644, -6638, -2008, 0, false, 300000);
|
||||
final long respawnTime = RESPAWN * 3600000;
|
||||
GlobalVariablesManager.getInstance().set("SailrenRespawn", System.currentTimeMillis() + respawnTime);
|
||||
cancelQuestTimer("CHECK_ATTACK", null, null);
|
||||
cancelQuestTimer("TIME_OUT", null, null);
|
||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||
startQuestTimer("TIME_OUT", 300000, null, null);
|
||||
break;
|
||||
}
|
||||
case VELOCIRAPTOR:
|
||||
{
|
||||
_killCount++;
|
||||
if (_killCount == 3)
|
||||
{
|
||||
final L2Npc pterosaur = addSpawn(PTEROSAUR, 27313, -6766, -1975, 0, false, 0);
|
||||
addAttackPlayerDesire(pterosaur, killer);
|
||||
_killCount = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PTEROSAUR:
|
||||
{
|
||||
final L2Npc trex = addSpawn(TREX, 27313, -6766, -1975, 0, false, 0);
|
||||
addAttackPlayerDesire(trex, killer);
|
||||
break;
|
||||
}
|
||||
case TREX:
|
||||
{
|
||||
startQuestTimer("SPAWN_SAILREN", 180000, null, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unload(boolean removeFromList)
|
||||
{
|
||||
if (STATUS == Status.IN_FIGHT)
|
||||
{
|
||||
_log.info(getClass().getSimpleName() + ": Script is being unloaded while Sailren is active, clearing zone.");
|
||||
notifyEvent("TIME_OUT", null, null);
|
||||
}
|
||||
return super.unload(removeFromList);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Sailren();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user