Moved Primeval Isle scripts to zones package.
This commit is contained in:
3
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/ElrokiTeleporters/32111-no.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/zones/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/zones/PrimevalIsle/ElrokiTeleporters/32111.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/zones/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>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest ElrokiTeleporters">Teleport.</Button>
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/ElrokiTeleporters/32112-no.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/zones/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/zones/PrimevalIsle/ElrokiTeleporters/32112.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/zones/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>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest ElrokiTeleporters">Teleport.</Button>
|
||||
</body></html>
|
64
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/ElrokiTeleporters/ElrokiTeleporters.java
vendored
Normal file
64
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/ElrokiTeleporters/ElrokiTeleporters.java
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.zones.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
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super(ElrokiTeleporters.class.getSimpleName(), "ai/zones/PrimevalIsle");
|
||||
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();
|
||||
}
|
||||
}
|
499
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/PrimevalIsle.java
vendored
Normal file
499
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/PrimevalIsle.java
vendored
Normal file
@@ -0,0 +1,499 @@
|
||||
/*
|
||||
* 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.zones.PrimevalIsle;
|
||||
|
||||
import com.l2jmobius.gameserver.GeoData;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import com.l2jmobius.gameserver.handler.ItemHandler;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Primeval Isle AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
final class PrimevalIsle extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int EGG = 18344; // Ancient Egg
|
||||
private static final int SAILREN = 29065; // Sailren
|
||||
private static final int ORNIT = 22742; // Ornithomimus
|
||||
private static final int DEINO = 22743; // Deinonychus
|
||||
private static final int[] SPRIGNANT =
|
||||
{
|
||||
18345, // Sprigant (Anesthesia)
|
||||
18346, // Sprigant (Deadly Poison)
|
||||
};
|
||||
private static final int[] MONSTERS =
|
||||
{
|
||||
22196, // Velociraptor
|
||||
22198, // Velociraptor
|
||||
22200, // Ornithomimus
|
||||
22202, // Ornithomimus
|
||||
22203, // Deinonychus
|
||||
22205, // Deinonychus
|
||||
22208, // Pachycephalosaurus
|
||||
22210, // Pachycephalosaurus
|
||||
22211, // Wild Strider
|
||||
22213, // Wild Strider
|
||||
22223, // Velociraptor
|
||||
22224, // Ornithomimus
|
||||
22225, // Deinonychus
|
||||
22226, // Pachycephalosaurus
|
||||
22227, // Wild Strider
|
||||
22742, // Ornithomimus
|
||||
22743, // Deinonychus
|
||||
};
|
||||
private static final int[] TREX =
|
||||
{
|
||||
22215, // Tyrannosaurus
|
||||
22216, // Tyrannosaurus
|
||||
22217, // Tyrannosaurus
|
||||
};
|
||||
private static final int[] VEGETABLE =
|
||||
{
|
||||
22200, // Ornithomimus
|
||||
22201, // Ornithomimus
|
||||
22202, // Ornithomimus
|
||||
22203, // Deinonychus
|
||||
22204, // Deinonychus
|
||||
22205, // Deinonychus
|
||||
22224, // Ornithomimus
|
||||
22225, // Deinonychus
|
||||
};
|
||||
// Item
|
||||
private static final int DEINONYCHUS = 14828; // Deinonychus Mesozoic Stone
|
||||
// Skill
|
||||
private static final SkillHolder ANESTHESIA = new SkillHolder(5085, 1); // Anesthesia
|
||||
private static final SkillHolder DEADLY_POISON = new SkillHolder(5086, 1); // Deadly Poison
|
||||
private static final SkillHolder SELFBUFF1 = new SkillHolder(5087, 1); // Berserk
|
||||
private static final SkillHolder SELFBUFF2 = new SkillHolder(5087, 2); // Berserk
|
||||
private static final SkillHolder LONGRANGEDMAGIC1 = new SkillHolder(5120, 1); // Stun
|
||||
private static final SkillHolder PHYSICALSPECIAL1 = new SkillHolder(5083, 4); // Stun
|
||||
private static final SkillHolder PHYSICALSPECIAL2 = new SkillHolder(5081, 4); // Silence
|
||||
private static final SkillHolder PHYSICALSPECIAL3 = new SkillHolder(5082, 4); // NPC Spinning, Slashing Trick
|
||||
private static final SkillHolder CREW_SKILL = new SkillHolder(6172, 1); // Presentation - Tyranno
|
||||
private static final SkillHolder INVIN_BUFF_ON = new SkillHolder(5225, 1); // Invincible
|
||||
|
||||
private PrimevalIsle()
|
||||
{
|
||||
super(PrimevalIsle.class.getSimpleName(), "ai/zones/PrimevalIsle");
|
||||
addSpawnId(TREX);
|
||||
addSpawnId(SPRIGNANT);
|
||||
addSpawnId(MONSTERS);
|
||||
addAggroRangeEnterId(TREX);
|
||||
addSpellFinishedId(TREX);
|
||||
addAttackId(EGG);
|
||||
addAttackId(TREX);
|
||||
addAttackId(MONSTERS);
|
||||
addKillId(EGG, SAILREN, DEINO, ORNIT);
|
||||
addSeeCreatureId(TREX);
|
||||
addSeeCreatureId(MONSTERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(L2Npc npc, L2PcInstance player, Skill skill)
|
||||
{
|
||||
if (skill.getId() == CREW_SKILL.getSkillId())
|
||||
{
|
||||
startQuestTimer("START_INVUL", 4000, npc, null);
|
||||
final L2Npc target = (L2Npc) npc.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
target.doDie(npc);
|
||||
}
|
||||
}
|
||||
if (npc.isInCombat())
|
||||
{
|
||||
final L2Character target = ((L2Attackable) npc).getMostHated();
|
||||
if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) < 60)
|
||||
{
|
||||
if (skill.getId() == SELFBUFF1.getSkillId())
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
if (target != null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) < 30)
|
||||
{
|
||||
if (skill.getId() == SELFBUFF1.getSkillId())
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
if (target != null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
else if (skill.getId() == SELFBUFF2.getSkillId())
|
||||
{
|
||||
npc.setScriptValue(5);
|
||||
if (target != null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "USE_SKILL":
|
||||
{
|
||||
if ((npc != null) && !npc.isDead())
|
||||
{
|
||||
npc.doCast(npc.getId() == SPRIGNANT[0] ? ANESTHESIA.getSkill() : DEADLY_POISON.getSkill());
|
||||
startQuestTimer("USE_SKILL", 15000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "GHOST_DESPAWN":
|
||||
{
|
||||
if ((npc != null) && !npc.isDead())
|
||||
{
|
||||
if (!npc.isInCombat())
|
||||
{
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("GHOST_DESPAWN", 1800000, npc, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "TREX_ATTACK":
|
||||
{
|
||||
if ((npc != null) && (player != null))
|
||||
{
|
||||
npc.setScriptValue(0);
|
||||
if (player.isInsideRadius(npc, 800, true, false))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(LONGRANGEDMAGIC1.getSkill());
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "START_INVUL":
|
||||
{
|
||||
if ((npc != null) && !npc.isDead())
|
||||
{
|
||||
npc.doCast(INVIN_BUFF_ON.getSkill());
|
||||
startQuestTimer("START_INVUL_2", 30000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "START_INVUL_2":
|
||||
{
|
||||
if ((npc != null) && !npc.isDead())
|
||||
{
|
||||
INVIN_BUFF_ON.getSkill().applyEffects(npc, npc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
|
||||
{
|
||||
if (Util.contains(MONSTERS, npc.getId()))
|
||||
{
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final L2Attackable mob = (L2Attackable) npc;
|
||||
final int ag_type = npc.getTemplate().getParameters().getInt("ag_type", 0);
|
||||
final int probPhysicalSpecial1 = npc.getTemplate().getParameters().getInt("ProbPhysicalSpecial1", 0);
|
||||
final int probPhysicalSpecial2 = npc.getTemplate().getParameters().getInt("ProbPhysicalSpecial2", 0);
|
||||
final SkillHolder physicalSpecial1 = npc.getTemplate().getParameters().getObject("PhysicalSpecial1", SkillHolder.class);
|
||||
final SkillHolder physicalSpecial2 = npc.getTemplate().getParameters().getObject("PhysicalSpecial2", SkillHolder.class);
|
||||
|
||||
if (((getRandom(100) < 30) && (npc.getId() == DEINO)) || ((npc.getId() == ORNIT) && npc.isScriptValue(0)))
|
||||
{
|
||||
mob.clearAggroList();
|
||||
npc.setScriptValue(1);
|
||||
npc.setRunning();
|
||||
|
||||
final int distance = 3000;
|
||||
final int heading = Util.calculateHeadingFrom(creature, npc);
|
||||
final double angle = Util.convertHeadingToDegree(heading);
|
||||
final double radian = Math.toRadians(angle);
|
||||
final double sin = Math.sin(radian);
|
||||
final double cos = Math.cos(radian);
|
||||
final int newX = (int) (npc.getX() + (cos * distance));
|
||||
final int newY = (int) (npc.getY() + (sin * distance));
|
||||
final Location loc = GeoData.getInstance().moveCheck(npc.getX(), npc.getY(), npc.getZ(), newX, newY, npc.getZ(), npc.getInstanceId());
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, loc, 0);
|
||||
}
|
||||
else if (ag_type == 1)
|
||||
{
|
||||
if (getRandom(100) <= (probPhysicalSpecial1 * npc.getVariables().getInt("SKILL_MULTIPLER")))
|
||||
{
|
||||
if (!npc.isSkillDisabled(physicalSpecial1.getSkillId()))
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
npc.doCast(physicalSpecial1.getSkill());
|
||||
}
|
||||
}
|
||||
else if (getRandom(100) <= (probPhysicalSpecial2 * npc.getVariables().getInt("SKILL_MULTIPLER")))
|
||||
{
|
||||
if (!npc.isSkillDisabled(physicalSpecial2.getSkill()))
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
npc.doCast(physicalSpecial2.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Util.contains(VEGETABLE, creature.getId()))
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
npc.doCast(CREW_SKILL.getSkill());
|
||||
npc.setIsRunning(true);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, creature);
|
||||
}
|
||||
return super.onSeeCreature(npc, creature, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
|
||||
{
|
||||
if (npc.isScriptValue(0))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, "?");
|
||||
((L2Attackable) npc).clearAggroList();
|
||||
startQuestTimer("TREX_ATTACK", 6000, npc, player);
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
if (npc.getId() == EGG)
|
||||
{
|
||||
if ((getRandom(100) <= 80) && npc.isScriptValue(0))
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
final L2Playable playable = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(500))
|
||||
{
|
||||
if ((characters != null) && characters.isAttackable() && getRandomBoolean())
|
||||
{
|
||||
addAttackDesire((L2Attackable) characters, playable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Util.contains(TREX, npc.getId()))
|
||||
{
|
||||
final L2Attackable mob = (L2Attackable) npc;
|
||||
final L2Character target = mob.getMostHated();
|
||||
|
||||
if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 30)
|
||||
{
|
||||
if (npc.isScriptValue(3))
|
||||
{
|
||||
if (!npc.isSkillDisabled(SELFBUFF1.getSkill()))
|
||||
{
|
||||
npc.doCast(SELFBUFF1.getSkill());
|
||||
}
|
||||
}
|
||||
else if (npc.isScriptValue(1))
|
||||
{
|
||||
if (!npc.isSkillDisabled(SELFBUFF2.getSkill()))
|
||||
{
|
||||
npc.doCast(SELFBUFF2.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 60) && npc.isScriptValue(3))
|
||||
{
|
||||
if (!npc.isSkillDisabled(SELFBUFF1.getSkill()))
|
||||
{
|
||||
npc.doCast(SELFBUFF1.getSkill());
|
||||
}
|
||||
}
|
||||
|
||||
if (Util.calculateDistance(npc, attacker, true, false) > 100)
|
||||
{
|
||||
if (!npc.isSkillDisabled(LONGRANGEDMAGIC1.getSkill()) && (getRandom(100) <= (10 * npc.getScriptValue())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(LONGRANGEDMAGIC1.getSkill());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!npc.isSkillDisabled(LONGRANGEDMAGIC1.getSkill()) && (getRandom(100) <= (10 * npc.getScriptValue())))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.doCast(LONGRANGEDMAGIC1.getSkill());
|
||||
}
|
||||
if (!npc.isSkillDisabled(PHYSICALSPECIAL1.getSkill()) && (getRandom(100) <= (5 * npc.getScriptValue())))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.doCast(PHYSICALSPECIAL1.getSkill());
|
||||
}
|
||||
if (!npc.isSkillDisabled(PHYSICALSPECIAL2.getSkill()) && (getRandom(100) <= (3 * npc.getScriptValue())))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.doCast(PHYSICALSPECIAL2.getSkill());
|
||||
}
|
||||
if (!npc.isSkillDisabled(PHYSICALSPECIAL3.getSkill()) && (getRandom(100) <= (5 * npc.getScriptValue())))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.doCast(PHYSICALSPECIAL3.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
L2Character target = null;
|
||||
final int probPhysicalSpecial1 = npc.getTemplate().getParameters().getInt("ProbPhysicalSpecial1", 0);
|
||||
final int probPhysicalSpecial2 = npc.getTemplate().getParameters().getInt("ProbPhysicalSpecial2", 0);
|
||||
final SkillHolder selfRangeBuff1 = npc.getTemplate().getParameters().getObject("SelfRangeBuff1", SkillHolder.class);
|
||||
final SkillHolder physicalSpecial1 = npc.getTemplate().getParameters().getObject("PhysicalSpecial1", SkillHolder.class);
|
||||
final SkillHolder physicalSpecial2 = npc.getTemplate().getParameters().getObject("PhysicalSpecial2", SkillHolder.class);
|
||||
|
||||
if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 50)
|
||||
{
|
||||
npc.getVariables().set("SKILL_MULTIPLER", 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.getVariables().set("SKILL_MULTIPLER", 1);
|
||||
}
|
||||
|
||||
if ((((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 30) && (npc.getVariables().getInt("SELFBUFF_USED") == 0))
|
||||
{
|
||||
final L2Attackable mob = (L2Attackable) npc;
|
||||
target = mob.getMostHated();
|
||||
mob.clearAggroList();
|
||||
if (!npc.isSkillDisabled(selfRangeBuff1.getSkillId()))
|
||||
{
|
||||
npc.getVariables().set("SELFBUFF_USED", 1);
|
||||
npc.doCast(selfRangeBuff1.getSkill());
|
||||
npc.setIsRunning(true);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
}
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
if ((getRandom(100) <= (probPhysicalSpecial1 * npc.getVariables().getInt("SKILL_MULTIPLER"))) && !npc.isSkillDisabled(physicalSpecial1.getSkill()))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.doCast(physicalSpecial1.getSkill());
|
||||
}
|
||||
if ((getRandom(100) <= (probPhysicalSpecial2 * npc.getVariables().getInt("SKILL_MULTIPLER"))) && !npc.isSkillDisabled(physicalSpecial2.getSkill()))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.doCast(physicalSpecial2.getSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
if ((npc.getId() == DEINO) || ((npc.getId() == ORNIT) && !npc.isScriptValue(1)))
|
||||
{
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
if ((npc.getId() == SAILREN) || (getRandom(100) < 3))
|
||||
{
|
||||
final L2PcInstance player = npc.getId() == SAILREN ? getRandomPartyMember(killer) : killer;
|
||||
if (player.getInventory().getSize(false) <= (player.getInventoryLimit() * 0.8))
|
||||
{
|
||||
giveItems(player, DEINONYCHUS, 1);
|
||||
final L2ItemInstance summonItem = player.getInventory().getItemByItemId(DEINONYCHUS);
|
||||
final IItemHandler handler = ItemHandler.getInstance().getHandler(summonItem.getEtcItem());
|
||||
if ((handler != null) && !player.hasPet())
|
||||
{
|
||||
handler.useItem(player, summonItem, true);
|
||||
}
|
||||
showOnScreenMsg(player, NpcStringId.LIFE_STONE_FROM_THE_BEGINNING_ACQUIRED, 2, 6000);
|
||||
}
|
||||
else
|
||||
{
|
||||
showOnScreenMsg(player, NpcStringId.WHEN_INVENTORY_WEIGHT_NUMBER_ARE_MORE_THAN_80_THE_LIFE_STONE_FROM_THE_BEGINNING_CANNOT_BE_ACQUIRED, 2, 6000);
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
if (Util.contains(SPRIGNANT, npc.getId()))
|
||||
{
|
||||
startQuestTimer("USE_SKILL", 15000, npc, null);
|
||||
}
|
||||
else if (Util.contains(TREX, npc.getId()))
|
||||
{
|
||||
final int collectGhost = npc.getTemplate().getParameters().getInt("CollectGhost", 0);
|
||||
final int collectDespawn = npc.getTemplate().getParameters().getInt("CollectGhostDespawnTime", 30);
|
||||
|
||||
if (collectGhost == 1)
|
||||
{
|
||||
startQuestTimer("GHOST_DESPAWN", collectDespawn * 60000, npc, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.getVariables().set("SELFBUFF_USED", 0);
|
||||
npc.getVariables().set("SKILL_MULTIPLER", 1);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new PrimevalIsle();
|
||||
}
|
||||
}
|
4
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-01.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/zones/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">Prep for battle.</Button>
|
||||
</body></html>
|
8
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-01a.html
vendored
Normal file
8
trunk/dist/game/data/scripts/ai/zones/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">Listen to the conditions to enter in detail.</Button>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-02.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-02.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<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">Prep for battle.</Button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-02a.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-02a.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Shilen's Stone Statue:<br>
|
||||
Only a party whose leader weilds 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">Learn more about Sailren's power and how to fight it.</Button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-03.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/zones/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">Listen to the entry requirements and battle method.</Button>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-03a.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/zones/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/zones/PrimevalIsle/Sailren/32109-04.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/zones/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">Prep for battle.</Button>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109-05.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/zones/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">Prep for battle.</Button>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/32109.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Stone Statue of Shilen:<br>
|
||||
(The statue is worn in places by wind and rain -- proof that it has stood guard here a long, long time. Despite its weatherbeaten appearance, it feels somehow dignified and majestic. Standing before it, you sense a presence.)<br>
|
||||
You, outsider... Why have you come here to this statue? For I am Mother Shilen's avatar and the last guard of Sailren!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren 32109-01.html">Prep for battle.</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest Sailren enter">"I wish to participate in clearing out Sailren and its followers."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest.</Button>
|
||||
</body></html>
|
328
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/Sailren.java
vendored
Normal file
328
trunk/dist/game/data/scripts/ai/zones/PrimevalIsle/Sailren/Sailren.java
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
* 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.zones.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
|
||||
*/
|
||||
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()
|
||||
{
|
||||
super(Sailren.class.getSimpleName(), "ai/zones/PrimevalIsle");
|
||||
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);
|
||||
addAttackDesire(pterosaur, killer);
|
||||
_killCount = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PTEROSAUR:
|
||||
{
|
||||
final L2Npc trex = addSpawn(TREX, 27313, -6766, -1975, 0, false, 0);
|
||||
addAttackDesire(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