OpenJDK 12 Interlude set as default Interlude branch.
This commit is contained in:
108
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/areas/HotSprings/HotSprings.java
vendored
Normal file
108
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/areas/HotSprings/HotSprings.java
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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.HotSprings;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.model.Effect;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* Hot Springs AI.
|
||||
* @author Mobius
|
||||
*/
|
||||
public final class HotSprings extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int BANDERSNATCHLING = 21314;
|
||||
private static final int FLAVA = 21316;
|
||||
private static final int ATROXSPAWN = 21317;
|
||||
private static final int NEPENTHES = 21319;
|
||||
private static final int ATROX = 21321;
|
||||
private static final int BANDERSNATCH = 21322;
|
||||
// Skills
|
||||
private static final int RHEUMATISM = 4551;
|
||||
private static final int CHOLERA = 4552;
|
||||
private static final int FLU = 4553;
|
||||
private static final int MALARIA = 4554;
|
||||
// Misc
|
||||
private static final int DISEASE_CHANCE = 10;
|
||||
|
||||
private HotSprings()
|
||||
{
|
||||
super(-1, "HotSprings", "ai/areas");
|
||||
|
||||
addAttackId(BANDERSNATCHLING, FLAVA, ATROXSPAWN, NEPENTHES, ATROX, BANDERSNATCH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
if (Rnd.get(100) < DISEASE_CHANCE)
|
||||
{
|
||||
tryToInfect(npc, attacker, MALARIA);
|
||||
}
|
||||
|
||||
if (Rnd.get(100) < DISEASE_CHANCE)
|
||||
{
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case BANDERSNATCHLING:
|
||||
case ATROX:
|
||||
{
|
||||
tryToInfect(npc, attacker, RHEUMATISM);
|
||||
break;
|
||||
}
|
||||
case FLAVA:
|
||||
case NEPENTHES:
|
||||
{
|
||||
tryToInfect(npc, attacker, CHOLERA);
|
||||
break;
|
||||
}
|
||||
case ATROXSPAWN:
|
||||
case BANDERSNATCH:
|
||||
{
|
||||
tryToInfect(npc, attacker, FLU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
private void tryToInfect(NpcInstance npc, Creature creature, int diseaseId)
|
||||
{
|
||||
final Effect info = creature.getFirstEffect(diseaseId);
|
||||
final int skillLevel = (info == null) ? 1 : (info.getSkill().getLevel() < 10) ? info.getSkill().getLevel() + 1 : 10;
|
||||
final Skill skill = SkillTable.getInstance().getInfo(diseaseId, skillLevel);
|
||||
|
||||
if ((skill != null) && !npc.isCastingNow() && !npc.isSkillDisabled(skill))
|
||||
{
|
||||
npc.setTarget(creature);
|
||||
npc.doCast(skill);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new HotSprings();
|
||||
}
|
||||
}
|
20
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/areas/package-info.java
vendored
Normal file
20
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/areas/package-info.java
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
package ai.areas;
|
1014
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java
vendored
Normal file
1014
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Antharas.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
692
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java
vendored
Normal file
692
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Baium.java
vendored
Normal file
@@ -0,0 +1,692 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_FOLLOW;
|
||||
import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.Effect;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.Announcements;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestTimer;
|
||||
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.Earthquake;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.MoveToPawn;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.templates.StatsSet;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* Baium AI Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but players also lose their ability to wake baium up. However, should another person enter the room and wake him up, the players who had stayed inside may join the raid. This can be helpful for
|
||||
* players who became victims of a reboot (they only need 1 new player to enter and wake up baium) and is not too exploitable since any player wishing to exploit it would have to suffer 5 days of being parked in an empty room. Note2: Neither version of Baium should be a permanent spawn. This script
|
||||
* is fully capable of spawning the statue-version when the lock expires and switching it to the mob version promptly. Additional notes ( source http://aleenaresron.blogspot.com/2006_08_01_archive.html ): * Baium only first respawns five days after his last death. And from those five days he will
|
||||
* respawn within 1-8 hours of his last death. So, you have to know his last time of death. * If by some freak chance you are the only one in Baium's chamber and NO ONE comes in [ha, ha] you or someone else will have to wake Baium. There is a good chance that Baium will automatically kill whoever
|
||||
* wakes him. There are some people that have been able to wake him and not die, however if you've already gone through the trouble of getting the bloody fabric and camped him out and researched his spawn time, are you willing to take that chance that you'll wake him and not be able to finish your
|
||||
* quest? Doubtful. [ this powerful attack vs the player who wakes him up is NOT yet implemented here] * once someone starts attacking Baium no one else can port into the chamber where he is. Unlike with the other raid bosses, you can just show up at any time as long as you are there when they die.
|
||||
* Not true with Baium. Once he gets attacked, the port to Baium closes. byebye, see you in 5 days. If nobody attacks baium for 30 minutes, he auto-despawns and unlocks the vortex
|
||||
* @author Fulminus version 0.1
|
||||
*/
|
||||
public class Baium extends Quest
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(Baium.class.getName());
|
||||
|
||||
private Creature _target;
|
||||
private Skill _skill;
|
||||
private static final int STONE_BAIUM = 29025;
|
||||
private static final int ANGELIC_VORTEX = 31862;
|
||||
private static final int LIVE_BAIUM = 29020;
|
||||
private static final int ARCHANGEL = 29021;
|
||||
|
||||
// Baium status tracking,
|
||||
private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked,
|
||||
private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked.
|
||||
private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked,
|
||||
|
||||
// Archangel locations.
|
||||
// @formatter:off
|
||||
private static final int ANGEL_LOCATION[][] =
|
||||
{
|
||||
{114239, 17168, 10080, 63544},
|
||||
{115780, 15564, 10080, 13620},
|
||||
{114880, 16236, 10080, 5400},
|
||||
{115168, 17200, 10080, 0},
|
||||
{115792, 16608, 10080, 0},
|
||||
};
|
||||
// @formatter:on
|
||||
|
||||
private long _lastAttackVsBaiumTime = 0;
|
||||
private final List<NpcInstance> _minions = new CopyOnWriteArrayList<>();
|
||||
protected BossZone _zone;
|
||||
|
||||
public Baium(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
final int[] mob =
|
||||
{
|
||||
LIVE_BAIUM
|
||||
};
|
||||
registerMobs(mob);
|
||||
|
||||
// Quest NPC starter initialization
|
||||
addStartNpc(STONE_BAIUM);
|
||||
addStartNpc(ANGELIC_VORTEX);
|
||||
addTalkId(STONE_BAIUM);
|
||||
addTalkId(ANGELIC_VORTEX);
|
||||
_zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
|
||||
|
||||
final Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
|
||||
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for baium from DB
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
if (temp > 0)
|
||||
{
|
||||
// the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer
|
||||
// to fire at the correct time (calculate the time between now and the unlock time,
|
||||
// setup a timer to fire after that many msec)
|
||||
startQuestTimer("baium_unlock", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// the time has already expired while the server was offline. Delete the saved time and
|
||||
// immediately spawn the stone-baium. Also the state need not be changed from ASLEEP
|
||||
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
|
||||
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
|
||||
}
|
||||
}
|
||||
else if (status == AWAKE)
|
||||
{
|
||||
final int loc_x = info.getInteger("loc_x");
|
||||
final int loc_y = info.getInteger("loc_y");
|
||||
final int loc_z = info.getInteger("loc_z");
|
||||
final int heading = info.getInteger("heading");
|
||||
final int hp = info.getInteger("currentHP");
|
||||
final int mp = info.getInteger("currentMP");
|
||||
final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + baium.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().addBoss(baium);
|
||||
final NpcInstance _baium = baium;
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
try
|
||||
{
|
||||
_baium.setCurrentHpMp(hp, mp);
|
||||
_baium.setIsInvul(true);
|
||||
// _baium.setIsImobilised(true);
|
||||
_baium.broadcastPacket(new SocialAction(_baium.getObjectId(), 2));
|
||||
startQuestTimer("baium_wakeup", 15000, _baium, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}, 100L);
|
||||
}
|
||||
else
|
||||
{
|
||||
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equals("baium_unlock"))
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
|
||||
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
|
||||
}
|
||||
}
|
||||
else if (event.equals("skill_range") && (npc != null))
|
||||
{
|
||||
callSkillAI(npc);
|
||||
}
|
||||
else if (event.equals("clean_player"))
|
||||
{
|
||||
_target = getRandomTarget(npc);
|
||||
}
|
||||
else if (event.equals("baium_wakeup") && (npc != null))
|
||||
{
|
||||
if (npc.getNpcId() == LIVE_BAIUM)
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
|
||||
npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 5));
|
||||
// start monitoring baium's inactivity
|
||||
_lastAttackVsBaiumTime = System.currentTimeMillis();
|
||||
|
||||
if (!npc.getSpawn().is_customBossInstance())
|
||||
{
|
||||
startQuestTimer("baium_despawn", 60000, npc, null, true);
|
||||
}
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
player.reduceCurrentHp(99999999, player);
|
||||
}
|
||||
|
||||
npc.setRunning();
|
||||
|
||||
startQuestTimer("skill_range", 500, npc, null, true);
|
||||
final NpcInstance baium = npc;
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
try
|
||||
{
|
||||
baium.setIsInvul(false);
|
||||
// baium.setIsImobilised(false);
|
||||
// for (NpcInstance minion : _Minions)
|
||||
// minion.setShowSummonAnimation(false);
|
||||
baium.getAttackByList().addAll(_zone.getCharactersInside().values());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning(e.getMessage());
|
||||
}
|
||||
}, 11100L);
|
||||
// TODO: the person who woke baium up should be knocked across the room, onto a wall, and
|
||||
// lose massive amounts of HP.
|
||||
for (int[] element : ANGEL_LOCATION)
|
||||
{
|
||||
final MonsterInstance angel = (MonsterInstance) addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
|
||||
angel.setIsInvul(true);
|
||||
_minions.add(angel);
|
||||
angel.getAttackByList().addAll(_zone.getCharactersInside().values());
|
||||
angel.isAggressive();
|
||||
}
|
||||
}
|
||||
// despawn the live baium after 30 minutes of inactivity
|
||||
// also check if the players are cheating, having pulled Baium outside his zone...
|
||||
}
|
||||
else if (event.equals("baium_despawn") && (npc != null))
|
||||
{
|
||||
if (npc.getNpcId() == LIVE_BAIUM)
|
||||
{
|
||||
// just in case the zone reference has been lost (somehow...), restore the reference
|
||||
if (_zone == null)
|
||||
{
|
||||
_zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
|
||||
}
|
||||
if ((_lastAttackVsBaiumTime + (Config.BAIUM_SLEEP * 1000)) < System.currentTimeMillis())
|
||||
{
|
||||
npc.deleteMe(); // despawn the live-baium
|
||||
for (NpcInstance minion : _minions)
|
||||
{
|
||||
if (minion != null)
|
||||
{
|
||||
minion.getSpawn().stopRespawn();
|
||||
minion.deleteMe();
|
||||
}
|
||||
}
|
||||
_minions.clear();
|
||||
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more
|
||||
_zone.oustAllPlayers();
|
||||
cancelQuestTimer("baium_despawn", npc, null);
|
||||
}
|
||||
else if (((_lastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)))
|
||||
{
|
||||
// npc.setIsCastingNow(false); //just in case
|
||||
npc.setTarget(npc);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4135, 1));
|
||||
// npc.setIsCastingNow(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
String htmltext = "";
|
||||
if (_zone == null)
|
||||
{
|
||||
_zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
|
||||
}
|
||||
if (_zone == null)
|
||||
{
|
||||
return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>";
|
||||
}
|
||||
|
||||
final Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
|
||||
|
||||
if ((npcId == STONE_BAIUM) && (status == ASLEEP))
|
||||
{
|
||||
if (Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM || _zone.isPlayerAllowed(player))
|
||||
{
|
||||
// once Baium is awaken, no more people may enter until he dies, the server reboots, or
|
||||
// 30 minutes pass with no attacks made against Baium.
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, AWAKE);
|
||||
npc.deleteMe();
|
||||
final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, npc);
|
||||
GrandBossManager.getInstance().addBoss(baium);
|
||||
final NpcInstance _baium = baium;
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
try
|
||||
{
|
||||
_baium.setIsInvul(true);
|
||||
_baium.setRunning();
|
||||
_baium.broadcastPacket(new SocialAction(_baium.getObjectId(), 2));
|
||||
startQuestTimer("baium_wakeup", 15000, _baium, player);
|
||||
// _baium.setShowSummonAnimation(false);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
LOGGER.warning(e.getMessage());
|
||||
}
|
||||
}, 100L);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "Conditions are not right to wake up Baium";
|
||||
}
|
||||
}
|
||||
else if (npcId == ANGELIC_VORTEX)
|
||||
{
|
||||
if (player.isFlying())
|
||||
{
|
||||
// print "Player "+player.getName()+" attempted to enter Baium's lair while flying!";
|
||||
return "<html><body>Angelic Vortex:<br>You may not enter while flying a wyvern</body></html>";
|
||||
}
|
||||
|
||||
if ((status == ASLEEP) && (player.getQuestState("baium").getQuestItemsCount(4295) > 0)) // bloody fabric
|
||||
{
|
||||
player.getQuestState("baium").takeItems(4295, 1);
|
||||
// allow entry for the player for the next 30 secs (more than enough time for the TP to happen)
|
||||
// Note: this just means 30secs to get in, no limits on how long it takes before we get out.
|
||||
_zone.allowPlayerEntry(player, 30);
|
||||
player.teleToLocation(113100, 14500, 10077);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.showChatWindow(player, 1);
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(NpcInstance npc, PlayerInstance player, Skill skill)
|
||||
{
|
||||
if (npc.isInvul())
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
return null;
|
||||
}
|
||||
else if ((npc.getNpcId() == LIVE_BAIUM) && !npc.isInvul())
|
||||
{
|
||||
callSkillAI(npc);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (!_zone.isInsideZone(attacker))
|
||||
{
|
||||
attacker.reduceCurrentHp(attacker.getCurrentHp(), attacker, false);
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
if (npc.isInvul())
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
else if ((npc.getNpcId() == LIVE_BAIUM) && !npc.isInvul())
|
||||
{
|
||||
if (attacker.getMountType() == 1)
|
||||
{
|
||||
int sk_4258 = 0;
|
||||
final Effect[] effects = attacker.getAllEffects();
|
||||
if ((effects != null) && (effects.length != 0))
|
||||
{
|
||||
for (Effect e : effects)
|
||||
{
|
||||
if (e.getSkill().getId() == 4258)
|
||||
{
|
||||
sk_4258 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sk_4258 == 0)
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4258, 1));
|
||||
}
|
||||
}
|
||||
// update a variable with the last action against baium
|
||||
_lastAttackVsBaiumTime = System.currentTimeMillis();
|
||||
callSkillAI(npc);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
|
||||
if (!npc.getSpawn().is_customBossInstance())
|
||||
{
|
||||
cancelQuestTimer("baium_despawn", npc, null);
|
||||
// spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair)
|
||||
addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // //should we teleport everyone out if the cubic despawns??
|
||||
// "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs]
|
||||
final long respawnTime = (Config.BAIUM_RESP_FIRST + Rnd.get(Config.BAIUM_RESP_SECOND)) * 3600000;
|
||||
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, DEAD);
|
||||
startQuestTimer("baium_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM, info);
|
||||
}
|
||||
|
||||
for (NpcInstance minion : _minions)
|
||||
{
|
||||
if (minion != null)
|
||||
{
|
||||
minion.getSpawn().stopRespawn();
|
||||
minion.deleteMe();
|
||||
}
|
||||
}
|
||||
_minions.clear();
|
||||
|
||||
if (getQuestTimer("skill_range", npc, null) != null)
|
||||
{
|
||||
getQuestTimer("skill_range", npc, null).cancel();
|
||||
}
|
||||
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public Creature getRandomTarget(NpcInstance npc)
|
||||
{
|
||||
final List<Creature> result = new ArrayList<>();
|
||||
final Collection<WorldObject> objs = npc.getKnownList().getKnownObjects().values();
|
||||
{
|
||||
for (WorldObject obj : objs)
|
||||
{
|
||||
if (obj instanceof Creature)
|
||||
{
|
||||
if (((((Creature) obj).getZ() < (npc.getZ() - 100)) && (((Creature) obj).getZ() > (npc.getZ() + 100))) || !GeoEngine.getInstance().canSeeTarget(obj, npc))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (obj instanceof PlayerInstance)
|
||||
{
|
||||
if (Util.checkIfInRange(9000, npc, obj, true) && !((Creature) obj).isDead())
|
||||
{
|
||||
result.add((PlayerInstance) obj);
|
||||
}
|
||||
}
|
||||
if (obj instanceof Summon)
|
||||
{
|
||||
if (Util.checkIfInRange(9000, npc, obj, true) && !((Creature) obj).isDead())
|
||||
{
|
||||
result.add((Summon) obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result.isEmpty())
|
||||
{
|
||||
for (NpcInstance minion : _minions)
|
||||
{
|
||||
if (minion != null)
|
||||
{
|
||||
result.add(minion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final Object[] characters = result.toArray();
|
||||
final QuestTimer timer = getQuestTimer("clean_player", npc, null);
|
||||
if (timer != null)
|
||||
{
|
||||
timer.cancel();
|
||||
}
|
||||
startQuestTimer("clean_player", 20000, npc, null);
|
||||
final Creature target = (Creature) characters[Rnd.get(characters.length)];
|
||||
return target;
|
||||
}
|
||||
|
||||
public synchronized void callSkillAI(NpcInstance npc)
|
||||
{
|
||||
if (npc.isInvul() || npc.isCastingNow())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_target == null) || _target.isDead() || !(_zone.isInsideZone(_target)))
|
||||
{
|
||||
_target = getRandomTarget(npc);
|
||||
if (_target != null)
|
||||
{
|
||||
_skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1);
|
||||
}
|
||||
}
|
||||
|
||||
final Creature target = _target;
|
||||
Skill skill = _skill;
|
||||
if (skill == null)
|
||||
{
|
||||
skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1);
|
||||
}
|
||||
if ((target == null) || target.isDead() || !(_zone.isInsideZone(target)))
|
||||
{
|
||||
// npc.setIsCastingNow(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Util.checkIfInRange(skill.getCastRange(), npc, target, true))
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
npc.setTarget(target);
|
||||
// npc.setIsCastingNow(true);
|
||||
if (getDist(skill.getCastRange()) > 0)
|
||||
{
|
||||
npc.broadcastPacket(new MoveToPawn(npc, target, getDist(skill.getCastRange())));
|
||||
}
|
||||
try
|
||||
{
|
||||
wait(1000);
|
||||
npc.stopMove(null);
|
||||
npc.doCast(skill);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_FOLLOW, target, null);
|
||||
// npc.setIsCastingNow(false);
|
||||
}
|
||||
}
|
||||
|
||||
public int getRandomSkill(NpcInstance npc)
|
||||
{
|
||||
int skill;
|
||||
if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0))
|
||||
{
|
||||
if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4128;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4129;
|
||||
}
|
||||
else
|
||||
{
|
||||
skill = 4127;
|
||||
}
|
||||
}
|
||||
else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0))
|
||||
{
|
||||
if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4131;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4128;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4129;
|
||||
}
|
||||
else
|
||||
{
|
||||
skill = 4127;
|
||||
}
|
||||
}
|
||||
else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4.0))
|
||||
{
|
||||
if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4130;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4131;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4128;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4129;
|
||||
}
|
||||
else
|
||||
{
|
||||
skill = 4127;
|
||||
}
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4130;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4131;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4128;
|
||||
}
|
||||
else if (Rnd.get(100) < 10)
|
||||
{
|
||||
skill = 4129;
|
||||
}
|
||||
else
|
||||
{
|
||||
skill = 4127;
|
||||
}
|
||||
return skill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillUse(NpcInstance npc, PlayerInstance caster, Skill skill)
|
||||
{
|
||||
if (npc.isInvul())
|
||||
{
|
||||
npc.getAI().setIntention(AI_INTENTION_IDLE);
|
||||
return null;
|
||||
}
|
||||
npc.setTarget(caster);
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
public int getDist(int range)
|
||||
{
|
||||
int dist = 0;
|
||||
switch (range)
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
dist = 85;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
dist = range - 85;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Baium(-1, "baium", "ai");
|
||||
}
|
||||
}
|
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Barakiel.java
vendored
Normal file
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Barakiel.java
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/*
|
||||
* @author m095 (L2EmuRT)
|
||||
*/
|
||||
public class Barakiel extends Quest
|
||||
{
|
||||
// Barakiel NpcID
|
||||
private static final int BARAKIEL = 25325;
|
||||
|
||||
public Barakiel(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
addEventId(BARAKIEL, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
// FIXME: Mobius - AI does nothing?
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Barakiel(-1, "Barakiel", "ai");
|
||||
}
|
||||
}
|
345
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Benom.java
vendored
Normal file
345
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Benom.java
vendored
Normal file
@@ -0,0 +1,345 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.csv.DoorTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Benom extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int BENOM = 29054;
|
||||
private static final int BENOM_TELEPORT = 13101;
|
||||
// Locations
|
||||
private final static Location[] WALK_ROUTES =
|
||||
{
|
||||
new Location(12565, -49739, -547),
|
||||
new Location(11242, -49689, -33),
|
||||
new Location(10751, -49702, 83),
|
||||
new Location(10824, -50808, 316),
|
||||
new Location(9084, -50786, 972),
|
||||
new Location(9095, -49787, 1252),
|
||||
new Location(8371, -49711, 1252),
|
||||
new Location(8423, -48545, 1252),
|
||||
new Location(9105, -48474, 1252),
|
||||
new Location(9085, -47488, 972),
|
||||
new Location(10858, -47527, 316),
|
||||
new Location(10842, -48626, 75),
|
||||
new Location(12171, -48464, -547),
|
||||
new Location(13565, -49145, -535),
|
||||
new Location(15653, -49159, -1059),
|
||||
new Location(15423, -48402, -839),
|
||||
new Location(15066, -47438, -419),
|
||||
new Location(13990, -46843, -292),
|
||||
new Location(13685, -47371, -163),
|
||||
new Location(13384, -47470, -163),
|
||||
new Location(14609, -48608, 346),
|
||||
new Location(13878, -47449, 747),
|
||||
new Location(12894, -49109, 980),
|
||||
new Location(10135, -49150, 996),
|
||||
new Location(12894, -49109, 980),
|
||||
new Location(13738, -50894, 747),
|
||||
new Location(14579, -49698, 347),
|
||||
new Location(12896, -51135, -166),
|
||||
new Location(12971, -52046, -292),
|
||||
new Location(15140, -50781, -442),
|
||||
new Location(15328, -50406, -603),
|
||||
new Location(15594, -49192, -1059),
|
||||
new Location(13175, -49153, -537)
|
||||
};
|
||||
// Misc
|
||||
private final static int[] WALK_TIMES =
|
||||
{
|
||||
18000,
|
||||
17000,
|
||||
4500,
|
||||
16000,
|
||||
22000,
|
||||
14000,
|
||||
10500,
|
||||
14000,
|
||||
9500,
|
||||
12500,
|
||||
20500,
|
||||
14500,
|
||||
17000,
|
||||
20000,
|
||||
22000,
|
||||
11000,
|
||||
11000,
|
||||
20000,
|
||||
8000,
|
||||
5500,
|
||||
20000,
|
||||
18000,
|
||||
25000,
|
||||
28000,
|
||||
25000,
|
||||
25000,
|
||||
25000,
|
||||
25000,
|
||||
10000,
|
||||
24000,
|
||||
7000,
|
||||
12000,
|
||||
20000
|
||||
};
|
||||
private final static String[] TALK =
|
||||
{
|
||||
"You should have finished me when you had the chance!!!",
|
||||
"I will crush all of you!!!",
|
||||
"I am not finished here, come face me!!!",
|
||||
"You cowards!!! I will torture each and everyone of you!!!"
|
||||
};
|
||||
private final static int ALIVE = 0;
|
||||
private final static int DEAD = 1;
|
||||
private static int _benomWalkRouteStep = 0;
|
||||
private static int _benomIsSpawned = 0;
|
||||
private static NpcInstance _benomInstance;
|
||||
private static NpcInstance _teleportInstance;
|
||||
|
||||
public Benom()
|
||||
{
|
||||
super(-1, "Benom", "ai/bosses");
|
||||
|
||||
addStartNpc(BENOM_TELEPORT);
|
||||
addTalkId(BENOM_TELEPORT);
|
||||
addFirstTalkId(BENOM_TELEPORT);
|
||||
addAttackId(BENOM);
|
||||
addKillId(BENOM);
|
||||
|
||||
final int castleOwner = CastleManager.getInstance().getCastleById(8).getOwnerId();
|
||||
final long siegeDate = CastleManager.getInstance().getCastleById(8).getSiegeDate().getTimeInMillis();
|
||||
long benomTeleporterSpawn = (siegeDate - System.currentTimeMillis()) - 86400000;
|
||||
final long benomRaidRoomSpawn = (siegeDate - System.currentTimeMillis()) - 86400000;
|
||||
long benomRaidSiegeSpawn = (siegeDate - System.currentTimeMillis());
|
||||
if (benomTeleporterSpawn < 0)
|
||||
{
|
||||
benomTeleporterSpawn = 1;
|
||||
}
|
||||
if (benomRaidSiegeSpawn < 0)
|
||||
{
|
||||
benomRaidSiegeSpawn = 1;
|
||||
}
|
||||
if (castleOwner > 0)
|
||||
{
|
||||
if (benomTeleporterSpawn >= 1)
|
||||
{
|
||||
startQuestTimer("BenomTeleSpawn", benomTeleporterSpawn, null, null);
|
||||
}
|
||||
if ((siegeDate - System.currentTimeMillis()) > 0)
|
||||
{
|
||||
startQuestTimer("BenomRaidRoomSpawn", benomRaidRoomSpawn, null, null);
|
||||
}
|
||||
startQuestTimer("BenomRaidSiegeSpawn", benomRaidSiegeSpawn, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "BenomTeleSpawn":
|
||||
{
|
||||
_teleportInstance = addSpawn(BENOM_TELEPORT, 11013, -49629, -547, 13400, false, 0);
|
||||
break;
|
||||
}
|
||||
case "BenomRaidRoomSpawn":
|
||||
{
|
||||
if ((_benomIsSpawned == 0) && (GrandBossManager.getInstance().getBossStatus(BENOM) == 0))
|
||||
{
|
||||
_benomInstance = addSpawn(BENOM, 12047, -49211, -3009, 0, false, 0);
|
||||
_benomIsSpawned = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomRaidSiegeSpawn":
|
||||
{
|
||||
if (GrandBossManager.getInstance().getBossStatus(BENOM) == 0)
|
||||
{
|
||||
if (_benomIsSpawned == 0)
|
||||
{
|
||||
_benomInstance = addSpawn(BENOM, 11025, -49152, -537, 0, false, 0);
|
||||
_benomIsSpawned = 1;
|
||||
}
|
||||
else if (_benomIsSpawned == 1)
|
||||
{
|
||||
_benomInstance.teleToLocation(11025, -49152, -537);
|
||||
}
|
||||
startQuestTimer("BenomSpawnEffect", 100, null, null);
|
||||
startQuestTimer("BenomBossDespawn", 5400000, null, null);
|
||||
_teleportInstance.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomSpawnEffect":
|
||||
{
|
||||
_benomInstance.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
_benomInstance.broadcastPacket(new SpecialCamera(_benomInstance.getObjectId(), 200, 0, 150, 0, 5000));
|
||||
_benomInstance.broadcastPacket(new SocialAction(_benomInstance.getObjectId(), 3));
|
||||
startQuestTimer("BenomWalk", 5000, _benomInstance, null);
|
||||
_benomWalkRouteStep = 0;
|
||||
break;
|
||||
}
|
||||
case "Attacking":
|
||||
{
|
||||
final Collection<PlayerInstance> knownPlayers = npc.getKnownList().getKnownPlayers().values();
|
||||
if (knownPlayers.size() > 0)
|
||||
{
|
||||
final PlayerInstance target = knownPlayers.stream().findAny().get();
|
||||
((MonsterInstance) npc).addDamageHate(target, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
startQuestTimer("Attacking", 2000, npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("BenomWalkFinish", 2000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomWalkFinish":
|
||||
{
|
||||
if (npc.getCastle().getSiege().getIsInProgress())
|
||||
{
|
||||
cancelQuestTimer("Attacking", npc, player);
|
||||
npc.teleToLocation(WALK_ROUTES[_benomWalkRouteStep], false);
|
||||
npc.setWalking();
|
||||
_benomWalkRouteStep = 0;
|
||||
startQuestTimer("BenomWalk", 2200, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomWalk":
|
||||
{
|
||||
if (_benomWalkRouteStep == 33)
|
||||
{
|
||||
_benomWalkRouteStep = 0;
|
||||
startQuestTimer("BenomWalk", 100, npc, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("Talk", 100, npc, null);
|
||||
if (_benomWalkRouteStep == 14)
|
||||
{
|
||||
startQuestTimer("DoorOpen", 15000, null, null);
|
||||
startQuestTimer("DoorClose", 23000, null, null);
|
||||
}
|
||||
if (_benomWalkRouteStep == 32)
|
||||
{
|
||||
startQuestTimer("DoorOpen", 500, null, null);
|
||||
startQuestTimer("DoorClose", 4000, null, null);
|
||||
}
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, WALK_ROUTES[_benomWalkRouteStep]);
|
||||
startQuestTimer("BenomWalk", WALK_TIMES[_benomWalkRouteStep], npc, null);
|
||||
System.out.println(WALK_TIMES[_benomWalkRouteStep]);
|
||||
_benomWalkRouteStep = _benomWalkRouteStep + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "DoorOpen":
|
||||
{
|
||||
DoorTable.getInstance().getDoor(20160005).openMe();
|
||||
break;
|
||||
}
|
||||
case "DoorClose":
|
||||
{
|
||||
DoorTable.getInstance().getDoor(20160005).closeMe();
|
||||
break;
|
||||
}
|
||||
case "Talk":
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, "Benom", TALK[Rnd.get(4)]));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "BenomBossDespawn":
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(BENOM, ALIVE);
|
||||
_benomIsSpawned = 0;
|
||||
_benomInstance.deleteMe();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final int castleOwner = CastleManager.getInstance().getCastleById(8).getOwnerId();
|
||||
final int clanId = player.getClanId();
|
||||
if ((castleOwner > 0) && (clanId > 0))
|
||||
{
|
||||
if (castleOwner == clanId)
|
||||
{
|
||||
final int x = 12558 + (Rnd.get(200) - 100);
|
||||
final int y = -49279 + (Rnd.get(200) - 100);
|
||||
player.teleToLocation(x, y, -3007);
|
||||
return null;
|
||||
}
|
||||
return "<html><body>Benom's Avatar:<br>Your clan does not own this castle. Only members of this Castle's owning clan can challenge Benom.</body></html>";
|
||||
}
|
||||
return "<html><body>Benom's Avatar:<br>Your clan does not own this castle. Only members of this Castle's owning clan can challenge Benom.</body></html>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
cancelQuestTimer("BenomWalk", npc, null);
|
||||
cancelQuestTimer("BenomWalkFinish", npc, null);
|
||||
startQuestTimer("Attacking", 100, npc, attacker);
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(BENOM, DEAD);
|
||||
cancelQuestTimer("BenomWalk", npc, null);
|
||||
cancelQuestTimer("BenomWalkFinish", npc, null);
|
||||
cancelQuestTimer("BenomBossDespawn", npc, null);
|
||||
cancelQuestTimer("Talk", npc, null);
|
||||
cancelQuestTimer("Attacking", npc, null);
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Benom();
|
||||
}
|
||||
}
|
262
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java
vendored
Normal file
262
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java
vendored
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.entity.Announcements;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.templates.StatsSet;
|
||||
|
||||
/**
|
||||
* Core AI
|
||||
* @author qwerty, Mobius
|
||||
*/
|
||||
public class Core extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int CORE = 29006;
|
||||
private static final int DEATH_KNIGHT = 29007;
|
||||
private static final int DOOM_WRAITH = 29008;
|
||||
private static final int SUSCEPTOR = 29011;
|
||||
// Spawns
|
||||
private static final Map<Integer, Location> MINNION_SPAWNS = new HashMap<>();
|
||||
static
|
||||
{
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17191, 109298, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17564, 109548, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17855, 109552, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18280, 109202, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18784, 109253, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18059, 108314, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17300, 108444, -6488));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17148, 110071, -6648));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18318, 110077, -6648));
|
||||
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17726, 110391, -6648));
|
||||
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17113, 110970, -6648));
|
||||
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17496, 110880, -6648));
|
||||
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(18061, 110990, -6648));
|
||||
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(18384, 110698, -6648));
|
||||
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17993, 111458, -6584));
|
||||
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17297, 111470, -6584));
|
||||
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17893, 110198, -6648));
|
||||
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17706, 109423, -6488));
|
||||
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17849, 109388, -6480));
|
||||
}
|
||||
// Misc
|
||||
private static final byte ALIVE = 0;
|
||||
private static final byte DEAD = 1;
|
||||
|
||||
private static boolean _firstAttacked;
|
||||
|
||||
private static final List<Attackable> _minions = new CopyOnWriteArrayList<>();
|
||||
|
||||
public Core(int id, String name, String descr)
|
||||
{
|
||||
super(id, name, descr);
|
||||
|
||||
final int[] mobs =
|
||||
{
|
||||
CORE,
|
||||
DEATH_KNIGHT,
|
||||
DOOM_WRAITH,
|
||||
SUSCEPTOR
|
||||
};
|
||||
|
||||
for (int mob : mobs)
|
||||
{
|
||||
addEventId(mob, Quest.QuestEventType.ON_KILL);
|
||||
addEventId(mob, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
_firstAttacked = false;
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
||||
{
|
||||
// Load the unlock date and time for Core from DB.
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("core_unlock", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The time has already expired while the server was offline. Immediately spawn Core.
|
||||
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final String test = loadGlobalQuestVar("Core_Attacked");
|
||||
if (test.equalsIgnoreCase("true"))
|
||||
{
|
||||
_firstAttacked = true;
|
||||
}
|
||||
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
|
||||
}
|
||||
spawnBoss(core);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveGlobalData()
|
||||
{
|
||||
final String val = "" + _firstAttacked;
|
||||
saveGlobalQuestVar("Core_Attacked", val);
|
||||
}
|
||||
|
||||
public void spawnBoss(GrandBossInstance npc)
|
||||
{
|
||||
GrandBossManager.getInstance().addBoss(npc);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
// Spawn minions
|
||||
Attackable mob;
|
||||
Location spawnLocation;
|
||||
for (Entry<Integer, Location> spawn : MINNION_SPAWNS.entrySet())
|
||||
{
|
||||
spawnLocation = spawn.getValue();
|
||||
mob = (Attackable) addSpawn(spawn.getKey(), spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ(), Rnd.get(61794), false, 0);
|
||||
_minions.add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final Integer status = GrandBossManager.getInstance().getBossStatus(CORE);
|
||||
if (event.equals("core_unlock"))
|
||||
{
|
||||
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||
spawnBoss(core);
|
||||
}
|
||||
else if (status == null)
|
||||
{
|
||||
LOGGER.warning("GrandBoss with Id " + CORE + " has not valid status into GrandBossManager.");
|
||||
}
|
||||
else if (event.equals("spawn_minion") && (status == ALIVE))
|
||||
{
|
||||
_minions.add((Attackable) addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0));
|
||||
}
|
||||
else if (event.equals("despawn_minions"))
|
||||
{
|
||||
for (int i = 0; i < _minions.size(); i++)
|
||||
{
|
||||
final Attackable mob = _minions.get(i);
|
||||
if (mob != null)
|
||||
{
|
||||
mob.decayMe();
|
||||
}
|
||||
}
|
||||
_minions.clear();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == CORE)
|
||||
{
|
||||
if (_firstAttacked)
|
||||
{
|
||||
if (Rnd.get(100) == 0)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Removing intruders."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_firstAttacked = true;
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "A non-permitted target has been discovered."));
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Starting intruder removal system."));
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
final String name = npc.getName();
|
||||
if (npcId == CORE)
|
||||
{
|
||||
final int objId = npc.getObjectId();
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
||||
npc.broadcastPacket(new CreatureSay(objId, 0, name, "A fatal error has occurred."));
|
||||
npc.broadcastPacket(new CreatureSay(objId, 0, name, "System is being shut down..."));
|
||||
npc.broadcastPacket(new CreatureSay(objId, 0, name, "......"));
|
||||
_firstAttacked = false;
|
||||
|
||||
if (!npc.getSpawn().is_customBossInstance())
|
||||
{
|
||||
addSpawn(31842, 16502, 110165, -6394, 0, false, 900000);
|
||||
addSpawn(31842, 18948, 110166, -6397, 0, false, 900000);
|
||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||
// Calculate Min and Max respawn times randomly.
|
||||
final long respawnTime = (Config.CORE_RESP_FIRST + Rnd.get(Config.CORE_RESP_SECOND)) * 3600000;
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// Also save the respawn time so that the info is maintained past reboots.
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||
startQuestTimer("despawn_minions", 20000, null, null);
|
||||
cancelQuestTimers("spawn_minion");
|
||||
}
|
||||
}
|
||||
else if ((GrandBossManager.getInstance().getBossStatus(CORE) == ALIVE) && _minions.contains(npc))
|
||||
{
|
||||
_minions.remove(npc);
|
||||
startQuestTimer("spawn_minion", Config.CORE_RESP_MINION * 1000, npc, null);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Core(-1, "core", "ai");
|
||||
}
|
||||
}
|
145
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/DrChaos.java
vendored
Normal file
145
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/DrChaos.java
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class DrChaos extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int STRANGE_MACHINE = 32032;
|
||||
private static final int DR_CHAOS = 32033;
|
||||
private static final int CHAOS_GOLEM = 25512;
|
||||
// Misc
|
||||
private static int _golemSpawned = 0;
|
||||
private static int _chaosSpawned = 1;
|
||||
|
||||
private DrChaos()
|
||||
{
|
||||
super(-1, "DrChaos", "ai/bosses");
|
||||
|
||||
addFirstTalkId(DR_CHAOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "1":
|
||||
{
|
||||
final NpcInstance strangeMachine = findTemplate(STRANGE_MACHINE);
|
||||
if (strangeMachine != null)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, strangeMachine);
|
||||
strangeMachine.broadcastPacket(new SpecialCamera(strangeMachine.getObjectId(), 1, -200, 15, 10000, 20000));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning("Dr Chaos AI: problem finding Strange Machine (npcid = " + STRANGE_MACHINE + "). Error: not spawned!");
|
||||
}
|
||||
startQuestTimer("2", 2000, npc, player);
|
||||
startQuestTimer("3", 10000, npc, player);
|
||||
if (_chaosSpawned == 0)
|
||||
{
|
||||
addSpawn(DR_CHAOS, 96471, -111425, -3334, 0, false, 0);
|
||||
_chaosSpawned = 1;
|
||||
}
|
||||
startQuestTimer("2", 2000, npc, player);
|
||||
startQuestTimer("3", 10000, npc, player);
|
||||
break;
|
||||
}
|
||||
case "2":
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
|
||||
break;
|
||||
}
|
||||
case "3":
|
||||
{
|
||||
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1, -150, 10, 3000, 20000));
|
||||
startQuestTimer("4", 2500, npc, player);
|
||||
break;
|
||||
}
|
||||
case "4":
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96055, -110759, -3312));
|
||||
startQuestTimer("5", 2000, npc, player);
|
||||
break;
|
||||
}
|
||||
case "5":
|
||||
{
|
||||
player.teleToLocation(94832, -112624, -3304);
|
||||
npc.teleToLocation(-113091, -243942, -15536);
|
||||
if (_golemSpawned == 0)
|
||||
{
|
||||
final NpcInstance golem = addSpawn(CHAOS_GOLEM, 94640, -112496, -3336, 0, false, 0);
|
||||
_golemSpawned = 1;
|
||||
startQuestTimer("6", 1000, golem, player);
|
||||
player.sendPacket(new PlaySound(1, "Rm03_A", 0, 0, 0, 0, 0));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "6":
|
||||
{
|
||||
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 30, -200, 20, 6000, 8000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
player.setTarget(null);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96323, -110914, -3328));
|
||||
startQuestTimer("1", 3000, npc, player);
|
||||
return null;
|
||||
}
|
||||
|
||||
private NpcInstance findTemplate(int npcId)
|
||||
{
|
||||
NpcInstance npcInstance = null;
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawnTable().values())
|
||||
{
|
||||
if ((spawn != null) && (spawn.getNpcId() == npcId))
|
||||
{
|
||||
npcInstance = spawn.getLastSpawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return npcInstance;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DrChaos();
|
||||
}
|
||||
}
|
1884
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java
vendored
Normal file
1884
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Golkonda.java
vendored
Normal file
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Golkonda.java
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/*
|
||||
* @author m095 (L2EmuRT)
|
||||
*/
|
||||
public class Golkonda extends Quest
|
||||
{
|
||||
// Golkonda NpcID
|
||||
private static final int GOLKONDA = 25126;
|
||||
|
||||
public Golkonda(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
addEventId(GOLKONDA, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
// FIXME: Mobius - AI does nothing?
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Golkonda(-1, "Golkonda", "ai");
|
||||
}
|
||||
}
|
297
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gordon.java
vendored
Normal file
297
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gordon.java
vendored
Normal file
@@ -0,0 +1,297 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
||||
|
||||
/**
|
||||
* Gordon AI
|
||||
* @author TOFIZ
|
||||
* @version $Revision: 1.1 $ $Date: 2008/08/21 $
|
||||
*/
|
||||
public class Gordon extends Quest
|
||||
{
|
||||
private static final int GORDON = 29095;
|
||||
private static int _npcMoveX = 0;
|
||||
private static int _npcMoveY = 0;
|
||||
private static int _isWalkTo = 0;
|
||||
private static int _npcBlock = 0;
|
||||
private static int X = 0;
|
||||
private static int Y = 0;
|
||||
private static int Z = 0;
|
||||
|
||||
// @formatter:off
|
||||
private static final int[][] WALKS =
|
||||
{
|
||||
{141569, -45908, -2387},
|
||||
{142494, -45456, -2397},
|
||||
{142922, -44561, -2395},
|
||||
{143672, -44130, -2398},
|
||||
{144557, -43378, -2325},
|
||||
{145839, -43267, -2301},
|
||||
{147044, -43601, -2307},
|
||||
{148140, -43206, -2303},
|
||||
{148815, -43434, -2328},
|
||||
{149862, -44151, -2558},
|
||||
{151037, -44197, -2708},
|
||||
{152555, -42756, -2836},
|
||||
{154808, -39546, -3236},
|
||||
{155333, -39962, -3272},
|
||||
{156531, -41240, -3470},
|
||||
{156863, -43232, -3707},
|
||||
{156783, -44198, -3764},
|
||||
{158169, -45163, -3541},
|
||||
{158952, -45479, -3473},
|
||||
{160039, -46514, -3634},
|
||||
{160244, -47429, -3656},
|
||||
{159155, -48109, -3665},
|
||||
{159558, -51027, -3523},
|
||||
{159396, -53362, -3244},
|
||||
{160872, -56556, -2789},
|
||||
{160857, -59072, -2613},
|
||||
{160410, -59888, -2647},
|
||||
{158770, -60173, -2673},
|
||||
{156368, -59557, -2638},
|
||||
{155188, -59868, -2642},
|
||||
{154118, -60591, -2731},
|
||||
{153571, -61567, -2821},
|
||||
{153457, -62819, -2886},
|
||||
{152939, -63778, -3003},
|
||||
{151816, -64209, -3120},
|
||||
{147655, -64826, -3433},
|
||||
{145422, -64576, -3369},
|
||||
{144097, -64320, -3404},
|
||||
{140780, -61618, -3096},
|
||||
{139688, -61450, -3062},
|
||||
{138267, -61743, -3056},
|
||||
{138613, -58491, -3465},
|
||||
{138139, -57252, -3517},
|
||||
{139555, -56044, -3310},
|
||||
{139107, -54537, -3240},
|
||||
{139279, -53781, -3091},
|
||||
{139810, -52687, -2866},
|
||||
{139657, -52041, -2793},
|
||||
{139215, -51355, -2698},
|
||||
{139334, -50514, -2594},
|
||||
{139817, -49715, -2449},
|
||||
{139824, -48976, -2263},
|
||||
{140130, -47578, -2213},
|
||||
{140483, -46339, -2382},
|
||||
{141569, -45908, -2387}
|
||||
};
|
||||
// @formatter:on
|
||||
|
||||
private static boolean _isAttacked = false;
|
||||
private static boolean _isSpawned = false;
|
||||
|
||||
public Gordon(int id, String name, String descr)
|
||||
{
|
||||
super(id, name, descr);
|
||||
|
||||
addEventId(GORDON, Quest.QuestEventType.ON_KILL);
|
||||
addEventId(GORDON, Quest.QuestEventType.ON_ATTACK);
|
||||
addEventId(GORDON, Quest.QuestEventType.ON_SPAWN);
|
||||
|
||||
// wait 2 minutes after Start AI
|
||||
startQuestTimer("check_ai", 120000, null, null, true);
|
||||
|
||||
_isSpawned = false;
|
||||
_isAttacked = false;
|
||||
_isWalkTo = 1;
|
||||
_npcMoveX = 0;
|
||||
_npcMoveY = 0;
|
||||
_npcBlock = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
X = WALKS[_isWalkTo - 1][0];
|
||||
Y = WALKS[_isWalkTo - 1][1];
|
||||
Z = WALKS[_isWalkTo - 1][2];
|
||||
if (event.equals("time_isAttacked"))
|
||||
{
|
||||
_isAttacked = false;
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
npc.setWalking();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(X, Y, Z, 0));
|
||||
}
|
||||
}
|
||||
else if (event.equals("check_ai"))
|
||||
{
|
||||
cancelQuestTimer("check_ai", null, null);
|
||||
if (!_isSpawned)
|
||||
{
|
||||
final NpcInstance gordon_ai = findTemplate(GORDON);
|
||||
if (gordon_ai != null)
|
||||
{
|
||||
_isSpawned = true;
|
||||
startQuestTimer("Start", 1000, gordon_ai, null, true);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.equals("Start"))
|
||||
{
|
||||
// startQuestTimer("Start", 1000, npc, null);
|
||||
if ((npc != null) && _isSpawned)
|
||||
{
|
||||
// check if player have Cursed Weapon and in radius
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
final Collection<PlayerInstance> chars = npc.getKnownList().getKnownPlayers().values();
|
||||
if ((chars != null) && (chars.size() > 0))
|
||||
{
|
||||
for (PlayerInstance pc : chars)
|
||||
{
|
||||
if (pc.isCursedWeaponEquipped() && pc.isInsideRadius(npc, 5000, false, false))
|
||||
{
|
||||
npc.setRunning();
|
||||
((Attackable) npc).addDamageHate(pc, 0, 9999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, pc);
|
||||
_isAttacked = true;
|
||||
cancelQuestTimer("time_isAttacked", null, null);
|
||||
startQuestTimer("time_isAttacked", 180000, npc, null);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// end check
|
||||
if (_isAttacked)
|
||||
{
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
if ((npc.getNpcId() == GORDON) && ((npc.getX() - 50) <= X) && ((npc.getX() + 50) >= X) && ((npc.getY() - 50) <= Y) && ((npc.getY() + 50) >= Y))
|
||||
{
|
||||
_isWalkTo++;
|
||||
if (_isWalkTo > 55)
|
||||
{
|
||||
_isWalkTo = 1;
|
||||
}
|
||||
X = WALKS[_isWalkTo - 1][0];
|
||||
Y = WALKS[_isWalkTo - 1][1];
|
||||
Z = WALKS[_isWalkTo - 1][2];
|
||||
npc.setWalking();
|
||||
// TODO: find better way to prevent teleporting to the home location
|
||||
npc.getSpawn().setX(X);
|
||||
npc.getSpawn().setY(Y);
|
||||
npc.getSpawn().setZ(Z);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(X, Y, Z, 0));
|
||||
}
|
||||
// Test for unblock Npc
|
||||
if ((npc.getX() != _npcMoveX) && (npc.getY() != _npcMoveY))
|
||||
{
|
||||
_npcMoveX = npc.getX();
|
||||
_npcMoveY = npc.getY();
|
||||
_npcBlock = 0;
|
||||
}
|
||||
else if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
_npcBlock++;
|
||||
if (_npcBlock > 2)
|
||||
{
|
||||
npc.teleToLocation(X, Y, Z);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
if (_npcBlock > 0)
|
||||
{
|
||||
// TODO: find better way to prevent teleporting to the home location
|
||||
npc.getSpawn().setX(X);
|
||||
npc.getSpawn().setY(Y);
|
||||
npc.getSpawn().setZ(Z);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(X, Y, Z, 0));
|
||||
}
|
||||
}
|
||||
// End Test unblock Npc
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(NpcInstance npc)
|
||||
{
|
||||
if ((npc.getNpcId() == GORDON) && (_npcBlock == 0))
|
||||
{
|
||||
_isSpawned = true;
|
||||
_isWalkTo = 1;
|
||||
startQuestTimer("Start", 1000, npc, null);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance player, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
_isAttacked = true;
|
||||
cancelQuestTimer("time_isAttacked", null, null);
|
||||
startQuestTimer("time_isAttacked", 180000, npc, null);
|
||||
if (player != null)
|
||||
{
|
||||
npc.setRunning();
|
||||
((Attackable) npc).addDamageHate(player, 0, 100);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, player, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
cancelQuestTimer("Start", null, null);
|
||||
cancelQuestTimer("time_isAttacked", null, null);
|
||||
_isSpawned = false;
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public NpcInstance findTemplate(int npcId)
|
||||
{
|
||||
NpcInstance npc = null;
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawnTable().values())
|
||||
{
|
||||
if ((spawn != null) && (spawn.getNpcId() == npcId))
|
||||
{
|
||||
npc = spawn.getLastSpawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return npc;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Gordon(-1, "Gordon", "ai");
|
||||
}
|
||||
}
|
103
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gustav.java
vendored
Normal file
103
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Gustav.java
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.clanhalls.DevastatedCastle;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Gustav extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int GUSTAV = 35410;
|
||||
private static final int MESSENGER = 35420;
|
||||
// Misc
|
||||
private static final List<Clan> _clans = new CopyOnWriteArrayList<>();
|
||||
|
||||
private Gustav()
|
||||
{
|
||||
super(-1, "Gustav", "ai/bosses");
|
||||
|
||||
addTalkId(MESSENGER);
|
||||
addStartNpc(MESSENGER);
|
||||
addAttackId(GUSTAV);
|
||||
addKillId(GUSTAV);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final Clan playerClan = player.getClan();
|
||||
for (Clan clan : _clans)
|
||||
{
|
||||
if (clan == playerClan)
|
||||
{
|
||||
return "<html><body>You already registered!</body></html>";
|
||||
}
|
||||
}
|
||||
|
||||
if (DevastatedCastle.getInstance().Conditions(player))
|
||||
{
|
||||
if (!_clans.contains(playerClan))
|
||||
{
|
||||
_clans.add(playerClan);
|
||||
}
|
||||
return "<html><body>You have successful registered on a siege.</body></html>";
|
||||
}
|
||||
|
||||
return "<html><body>You are not allowed to do that!</body></html>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final Clan playerClan = attacker.getClan();
|
||||
if (playerClan != null)
|
||||
{
|
||||
for (Clan clan : _clans)
|
||||
{
|
||||
if (clan == playerClan)
|
||||
{
|
||||
DevastatedCastle.getInstance().addSiegeDamage(clan, damage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
DevastatedCastle.getInstance().SiegeFinish();
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Gustav();
|
||||
}
|
||||
}
|
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Hallate.java
vendored
Normal file
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Hallate.java
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/*
|
||||
* @author m095 (L2EmuRT)
|
||||
*/
|
||||
public class Hallate extends Quest
|
||||
{
|
||||
// Hallate NpcID
|
||||
private static final int HALLATE = 25220;
|
||||
|
||||
public Hallate(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
addEventId(HALLATE, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
// FIXME: Mobius - AI does nothing?
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Hallate(-1, "Hallate", "ai");
|
||||
}
|
||||
}
|
454
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java
vendored
Normal file
454
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java
vendored
Normal file
@@ -0,0 +1,454 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.datatables.csv.DoorTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.DoorInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.ItemInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
||||
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import org.l2jmobius.gameserver.templates.creatures.NpcTemplate;
|
||||
|
||||
/**
|
||||
* Ice Fairy Sirra AI
|
||||
* @author Kerberos
|
||||
*/
|
||||
public class IceFairySirra extends Quest
|
||||
{
|
||||
private static final int STEWARD = 32029;
|
||||
private static final int SILVER_HEMOCYTE = 8057;
|
||||
private static BossZone _freyasZone;
|
||||
private static PlayerInstance _player = null;
|
||||
protected List<NpcInstance> _allMobs = new CopyOnWriteArrayList<>();
|
||||
protected Future<?> _onDeadEventTask = null;
|
||||
|
||||
public IceFairySirra(int id, String name, String descr)
|
||||
{
|
||||
super(id, name, descr);
|
||||
final int[] mobs =
|
||||
{
|
||||
STEWARD,
|
||||
22100,
|
||||
22102,
|
||||
22104
|
||||
};
|
||||
|
||||
for (int mob : mobs)
|
||||
{
|
||||
// TODO:
|
||||
addEventId(mob, Quest.QuestEventType.QUEST_START);
|
||||
addEventId(mob, Quest.QuestEventType.QUEST_TALK);
|
||||
addEventId(mob, Quest.QuestEventType.NPC_FIRST_TALK);
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (player.getQuestState("IceFairySirra") == null)
|
||||
{
|
||||
newQuestState(player);
|
||||
}
|
||||
player.setLastQuestNpcObject(npc.getObjectId());
|
||||
String filename = "";
|
||||
if (npc.isBusy())
|
||||
{
|
||||
filename = getHtmlPath(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = getHtmlPath(0);
|
||||
}
|
||||
sendHtml(npc, player, filename);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equals("check_condition"))
|
||||
{
|
||||
if (npc.isBusy())
|
||||
{
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
String filename = "";
|
||||
if (player.isInParty() && (player.getParty().getPartyLeaderOID() == player.getObjectId()))
|
||||
{
|
||||
if (checkItems(player))
|
||||
{
|
||||
startQuestTimer("start", 100000, null, player);
|
||||
_player = player;
|
||||
destroyItems(player);
|
||||
player.getInventory().addItem("Scroll", 8379, 3, player, null);
|
||||
npc.setBusy(true);
|
||||
screenMessage(player, "Steward: Please wait a moment.", 100000);
|
||||
filename = getHtmlPath(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = getHtmlPath(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = getHtmlPath(1);
|
||||
}
|
||||
sendHtml(npc, player, filename);
|
||||
}
|
||||
else if (event.equals("start"))
|
||||
{
|
||||
if (_freyasZone == null)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Failed to load zone");
|
||||
cleanUp();
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
_freyasZone.setZoneEnabled(true);
|
||||
closeGates();
|
||||
doSpawns();
|
||||
startQuestTimer("Party_Port", 2000, null, player);
|
||||
startQuestTimer("End", 1802000, null, player);
|
||||
}
|
||||
else if (event.equals("Party_Port"))
|
||||
{
|
||||
teleportInside(player);
|
||||
screenMessage(player, "Steward: Please restore the Queen's appearance!", 10000);
|
||||
startQuestTimer("30MinutesRemaining", 300000, null, player);
|
||||
}
|
||||
else if (event.equals("30MinutesRemaining"))
|
||||
{
|
||||
screenMessage(player, "30 minute(s) are remaining.", 10000);
|
||||
startQuestTimer("20minutesremaining", 600000, null, player);
|
||||
}
|
||||
else if (event.equals("20MinutesRemaining"))
|
||||
{
|
||||
screenMessage(player, "20 minute(s) are remaining.", 10000);
|
||||
startQuestTimer("10minutesremaining", 600000, null, player);
|
||||
}
|
||||
else if (event.equals("10MinutesRemaining"))
|
||||
{
|
||||
screenMessage(player, "Steward: Waste no time! Please hurry!", 10000);
|
||||
}
|
||||
else if (event.equals("End"))
|
||||
{
|
||||
screenMessage(player, "Steward: Was it indeed too much to ask.", 10000);
|
||||
cleanUp();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
_freyasZone = GrandBossManager.getInstance().getZone(105546, -127892, -2768);
|
||||
if (_freyasZone == null)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Failed to load zone");
|
||||
return;
|
||||
}
|
||||
_freyasZone.setZoneEnabled(false);
|
||||
final NpcInstance steward = findTemplate(STEWARD);
|
||||
if (steward != null)
|
||||
{
|
||||
steward.setBusy(false);
|
||||
}
|
||||
openGates();
|
||||
}
|
||||
|
||||
public void cleanUp()
|
||||
{
|
||||
init();
|
||||
cancelQuestTimer("30MinutesRemaining", null, _player);
|
||||
cancelQuestTimer("20MinutesRemaining", null, _player);
|
||||
cancelQuestTimer("10MinutesRemaining", null, _player);
|
||||
cancelQuestTimer("End", null, _player);
|
||||
for (NpcInstance mob : _allMobs)
|
||||
{
|
||||
try
|
||||
{
|
||||
mob.getSpawn().stopRespawn();
|
||||
mob.deleteMe();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Failed deleting mob. " + e);
|
||||
}
|
||||
}
|
||||
_allMobs.clear();
|
||||
}
|
||||
|
||||
public NpcInstance findTemplate(int npcId)
|
||||
{
|
||||
NpcInstance npc = null;
|
||||
for (Spawn spawn : SpawnTable.getInstance().getSpawnTable().values())
|
||||
{
|
||||
if ((spawn != null) && (spawn.getNpcId() == npcId))
|
||||
{
|
||||
npc = spawn.getLastSpawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return npc;
|
||||
}
|
||||
|
||||
protected void openGates()
|
||||
{
|
||||
for (int i = 23140001; i < 23140003; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
final DoorInstance door = DoorTable.getInstance().getDoor(i);
|
||||
if (door != null)
|
||||
{
|
||||
door.openMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Attempted to open undefined door. doorId: " + i);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Failed closing door " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeGates()
|
||||
{
|
||||
for (int i = 23140001; i < 23140003; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
final DoorInstance door = DoorTable.getInstance().getDoor(i);
|
||||
if (door != null)
|
||||
{
|
||||
door.closeMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Attempted to close undefined door. doorId: " + i);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Failed closing door " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkItems(PlayerInstance player)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (PlayerInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
final ItemInstance i = pc.getInventory().getItemByItemId(SILVER_HEMOCYTE);
|
||||
if ((i == null) || (i.getCount() < 10))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void destroyItems(PlayerInstance player)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (PlayerInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
final ItemInstance i = pc.getInventory().getItemByItemId(SILVER_HEMOCYTE);
|
||||
pc.destroyItem("Hemocytes", i.getObjectId(), 10, null, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
public void teleportInside(PlayerInstance player)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (PlayerInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
pc.teleToLocation(113533, -126159, -3488, false);
|
||||
if (_freyasZone == null)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Failed to load zone");
|
||||
cleanUp();
|
||||
return;
|
||||
}
|
||||
_freyasZone.allowPlayerEntry(pc, 2103);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
public void screenMessage(PlayerInstance player, String text, int time)
|
||||
{
|
||||
if (player.getParty() != null)
|
||||
{
|
||||
for (PlayerInstance pc : player.getParty().getPartyMembers())
|
||||
{
|
||||
pc.sendPacket(new ExShowScreenMessage(text, time));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
public void doSpawns()
|
||||
{
|
||||
final int[][] mobs =
|
||||
{
|
||||
{
|
||||
29060,
|
||||
105546,
|
||||
-127892,
|
||||
-2768
|
||||
},
|
||||
{
|
||||
29056,
|
||||
102779,
|
||||
-125920,
|
||||
-2840
|
||||
},
|
||||
{
|
||||
22100,
|
||||
111719,
|
||||
-126646,
|
||||
-2992
|
||||
},
|
||||
{
|
||||
22102,
|
||||
109509,
|
||||
-128946,
|
||||
-3216
|
||||
},
|
||||
{
|
||||
22104,
|
||||
109680,
|
||||
-125756,
|
||||
-3136
|
||||
}
|
||||
};
|
||||
Spawn spawnDat;
|
||||
NpcTemplate template;
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
template = NpcTable.getInstance().getTemplate(mobs[i][0]);
|
||||
if (template != null)
|
||||
{
|
||||
spawnDat = new Spawn(template);
|
||||
spawnDat.setAmount(1);
|
||||
spawnDat.setX(mobs[i][1]);
|
||||
spawnDat.setY(mobs[i][2]);
|
||||
spawnDat.setZ(mobs[i][3]);
|
||||
spawnDat.setHeading(0);
|
||||
spawnDat.setRespawnDelay(60);
|
||||
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
||||
_allMobs.add(spawnDat.doSpawn());
|
||||
spawnDat.stopRespawn();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Data missing in NPC table for ID: " + mobs[i][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("IceFairySirraManager: Spawns could not be initialized: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getHtmlPath(int val)
|
||||
{
|
||||
String pom = "";
|
||||
|
||||
pom = "32029-" + val;
|
||||
if (val == 0)
|
||||
{
|
||||
pom = "32029";
|
||||
}
|
||||
|
||||
final String temp = "data/html/default/" + pom + ".htm";
|
||||
|
||||
if (!Config.LAZY_CACHE)
|
||||
{
|
||||
// If not running lazy cache the file must be in the cache or it doesnt exist
|
||||
if (HtmCache.getInstance().contains(temp))
|
||||
{
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
else if (HtmCache.getInstance().isLoadable(temp))
|
||||
{
|
||||
return temp;
|
||||
}
|
||||
|
||||
// If the file is not found, the standard message "I have nothing to say to you" is returned
|
||||
return "data/html/npcdefault.htm";
|
||||
}
|
||||
|
||||
public void sendHtml(NpcInstance npc, PlayerInstance player, String filename)
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setFile(filename);
|
||||
html.replace("%objectId%", String.valueOf(npc.getObjectId()));
|
||||
player.sendPacket(html);
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new IceFairySirra(-1, "IceFairySirra", "ai");
|
||||
}
|
||||
}
|
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Kernon.java
vendored
Normal file
42
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Kernon.java
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/*
|
||||
* @author m095 (L2EmuRT)
|
||||
*/
|
||||
public class Kernon extends Quest
|
||||
{
|
||||
// Kernon NpcID
|
||||
private static final int KERNON = 25054;
|
||||
|
||||
public Kernon(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
addEventId(KERNON, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
// FIXME: Mobius - AI does nothing?
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Kernon(-1, "Kernon", "ai");
|
||||
}
|
||||
}
|
103
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Nurka.java
vendored
Normal file
103
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Nurka.java
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.clan.Clan;
|
||||
import org.l2jmobius.gameserver.model.entity.siege.clanhalls.FortressOfResistance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Nurka extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int NURKA = 35368;
|
||||
private static final int MESSENGER = 35382;
|
||||
// Misc
|
||||
private static final List<Clan> _clans = new CopyOnWriteArrayList<>();
|
||||
|
||||
private Nurka()
|
||||
{
|
||||
super(-1, "Nurka", "ai/bosses");
|
||||
|
||||
addTalkId(MESSENGER);
|
||||
addStartNpc(MESSENGER);
|
||||
addAttackId(NURKA);
|
||||
addKillId(NURKA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final Clan playerClan = player.getClan();
|
||||
for (Clan clan : _clans)
|
||||
{
|
||||
if (clan == playerClan)
|
||||
{
|
||||
return "<html><body>You already registered!</body></html>";
|
||||
}
|
||||
}
|
||||
|
||||
if (FortressOfResistance.getInstance().Conditions(player))
|
||||
{
|
||||
if (!_clans.contains(playerClan))
|
||||
{
|
||||
_clans.add(playerClan);
|
||||
}
|
||||
return "<html><body>You have successful registered on a siege.</body></html>";
|
||||
}
|
||||
|
||||
return "<html><body>You are not allowed to do that!</body></html>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final Clan playerClan = attacker.getClan();
|
||||
if (playerClan != null)
|
||||
{
|
||||
for (Clan clan : _clans)
|
||||
{
|
||||
if (clan == playerClan)
|
||||
{
|
||||
FortressOfResistance.getInstance().addSiegeDamage(clan, damage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
FortressOfResistance.getInstance().CaptureFinish();
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Nurka();
|
||||
}
|
||||
}
|
269
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java
vendored
Normal file
269
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.Announcements;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.templates.StatsSet;
|
||||
|
||||
/**
|
||||
* @author Shyla
|
||||
*/
|
||||
public class Orfen extends Quest
|
||||
{
|
||||
private static final int ORFEN = 29014;
|
||||
private static final int LIVE = 0;
|
||||
private static final int DEAD = 1;
|
||||
|
||||
private boolean _firstAttacked = false;
|
||||
private boolean _teleported = false;
|
||||
|
||||
GrandBossInstance _orfen = null;
|
||||
|
||||
enum Event
|
||||
{
|
||||
ORFEN_SPAWN,
|
||||
ORFEN_REFRESH,
|
||||
ORFEN_RETURN
|
||||
}
|
||||
|
||||
/**
|
||||
* @param questId
|
||||
* @param name
|
||||
* @param descr
|
||||
*/
|
||||
public Orfen(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
final Integer status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||
|
||||
addEventId(ORFEN, Quest.QuestEventType.ON_KILL);
|
||||
addEventId(ORFEN, Quest.QuestEventType.ON_ATTACK);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case DEAD:
|
||||
{
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("ORFEN_SPAWN", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
final int loc_x = 55024;
|
||||
final int loc_y = 17368;
|
||||
final int loc_z = -5412;
|
||||
final int heading = 0;
|
||||
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
|
||||
GrandBossManager.getInstance().addBoss(_orfen);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LIVE:
|
||||
{
|
||||
/*
|
||||
* int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading");
|
||||
*/
|
||||
final int loc_x = 55024;
|
||||
final int loc_y = 17368;
|
||||
final int loc_z = -5412;
|
||||
final int heading = 0;
|
||||
final int hp = info.getInteger("currentHP");
|
||||
final int mp = info.getInteger("currentMP");
|
||||
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().addBoss(_orfen);
|
||||
_orfen.setCurrentHpMp(hp, mp);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
final int loc_x = 55024;
|
||||
final int loc_y = 17368;
|
||||
final int loc_z = -5412;
|
||||
final int heading = 0;
|
||||
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
|
||||
GrandBossManager.getInstance().addBoss(_orfen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final Event event_enum = Event.valueOf(event.toUpperCase());
|
||||
|
||||
switch (event_enum)
|
||||
{
|
||||
case ORFEN_SPAWN:
|
||||
{
|
||||
final int loc_x = 55024;
|
||||
final int loc_y = 17368;
|
||||
final int loc_z = -5412;
|
||||
final int heading = 0;
|
||||
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
|
||||
GrandBossManager.getInstance().addBoss(_orfen);
|
||||
break;
|
||||
}
|
||||
case ORFEN_REFRESH:
|
||||
{
|
||||
if ((npc == null) || (npc.getSpawn() == null))
|
||||
{
|
||||
cancelQuestTimer("ORFEN_REFRESH", npc, null);
|
||||
break;
|
||||
}
|
||||
double saved_hp = -1;
|
||||
if ((npc.getNpcId() == ORFEN) && !npc.getSpawn().is_customBossInstance())
|
||||
{
|
||||
saved_hp = GrandBossManager.getInstance().getStatsSet(ORFEN).getDouble("currentHP");
|
||||
if (saved_hp < npc.getCurrentHp())
|
||||
{
|
||||
npc.setCurrentHp(saved_hp);
|
||||
GrandBossManager.getInstance().getStatsSet(ORFEN).set("currentHP", npc.getMaxHp());
|
||||
}
|
||||
}
|
||||
if ((_teleported && (npc.getCurrentHp() > (npc.getMaxHp() * 0.95))))
|
||||
{
|
||||
cancelQuestTimer("ORFEN_REFRESH", npc, null);
|
||||
startQuestTimer("ORFEN_RETURN", 10000, npc, null);
|
||||
}
|
||||
else
|
||||
{ // restart the refresh scheduling
|
||||
startQuestTimer("ORFEN_REFRESH", 10000, npc, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ORFEN_RETURN:
|
||||
{
|
||||
if ((npc == null) || (npc.getSpawn() == null))
|
||||
{
|
||||
break;
|
||||
}
|
||||
_teleported = false;
|
||||
_firstAttacked = false;
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
npc.getSpawn().setX(55024);
|
||||
npc.getSpawn().setY(17368);
|
||||
npc.getSpawn().setZ(-5412);
|
||||
npc.teleToLocation(55024, 17368, -5412, false);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOGGER.info("ORFEN: Not defined event: " + event + "!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
if (npcId == ORFEN)
|
||||
{
|
||||
if (_firstAttacked)
|
||||
{
|
||||
if (((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)) && !_teleported)
|
||||
{
|
||||
GrandBossManager.getInstance().getStatsSet(ORFEN).set("currentHP", npc.getCurrentHp());
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||
_teleported = true;
|
||||
npc.getSpawn().setX(43577);
|
||||
npc.getSpawn().setY(15985);
|
||||
npc.getSpawn().setZ(-4396);
|
||||
npc.teleToLocation(43577, 15985, -4396, false);
|
||||
startQuestTimer("ORFEN_REFRESH", 10000, npc, null);
|
||||
}
|
||||
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && (Rnd.get(10) == 0))
|
||||
{
|
||||
attacker.teleToLocation(npc.getX(), npc.getY(), npc.getZ());
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SkillTable.getInstance().getInfo(4064, 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_firstAttacked = true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc.getNpcId() == ORFEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
|
||||
if (!npc.getSpawn().is_customBossInstance())
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(ORFEN, DEAD);
|
||||
// time is 48hour +/- 20hour
|
||||
final long respawnTime = (Config.ORFEN_RESP_FIRST + Rnd.get(Config.ORFEN_RESP_SECOND)) * 3600000;
|
||||
cancelQuestTimer("ORFEN_REFRESH", npc, null);
|
||||
startQuestTimer("ORFEN_SPAWN", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(ORFEN, info);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Orfen(-1, "Orfen", "ai");
|
||||
}
|
||||
}
|
439
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/QueenAnt.java
vendored
Normal file
439
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/QueenAnt.java
vendored
Normal file
@@ -0,0 +1,439 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.Announcements;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.templates.StatsSet;
|
||||
|
||||
public class QueenAnt extends Quest
|
||||
{
|
||||
private static final int QUEEN = 29001;
|
||||
private static final int LARVA = 29002;
|
||||
private static final int NURSE = 29003;
|
||||
private static final int GUARD = 29004;
|
||||
private static final int ROYAL = 29005;
|
||||
|
||||
// QUEEN Status Tracking :
|
||||
private static final int LIVE = 0; // Queen Ant is spawned.
|
||||
private static final int DEAD = 1; // Queen Ant has been killed.
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static BossZone _zone;
|
||||
private MonsterInstance _larva = null;
|
||||
private MonsterInstance _queen = null;
|
||||
private final List<MonsterInstance> _minions = new CopyOnWriteArrayList<>();
|
||||
private final List<MonsterInstance> _nurses = new CopyOnWriteArrayList<>();
|
||||
|
||||
enum Event
|
||||
{
|
||||
QUEEN_SPAWN, /* CHECK_QA_ZONE, */
|
||||
CHECK_MINIONS_ZONE,
|
||||
CHECK_NURSE_ALIVE,
|
||||
ACTION,
|
||||
DESPAWN_MINIONS,
|
||||
SPAWN_ROYAL,
|
||||
NURSES_SPAWN,
|
||||
RESPAWN_ROYAL,
|
||||
RESPAWN_NURSE,
|
||||
LARVA_DESPAWN,
|
||||
HEAL
|
||||
}
|
||||
|
||||
public QueenAnt(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
final int[] mobs =
|
||||
{
|
||||
QUEEN,
|
||||
LARVA,
|
||||
NURSE,
|
||||
GUARD,
|
||||
ROYAL
|
||||
};
|
||||
for (int mob : mobs)
|
||||
{
|
||||
addEventId(mob, Quest.QuestEventType.ON_KILL);
|
||||
addEventId(mob, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
|
||||
_zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734);
|
||||
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
|
||||
final Integer status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case DEAD:
|
||||
{
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("QUEEN_SPAWN", temp, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
|
||||
GrandBossManager.getInstance().addBoss(queen);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LIVE:
|
||||
{
|
||||
/*
|
||||
* int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading");
|
||||
*/
|
||||
final int hp = info.getInteger("currentHP");
|
||||
final int mp = info.getInteger("currentMP");
|
||||
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().addBoss(queen);
|
||||
queen.setCurrentHpMp(hp, mp);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
|
||||
GrandBossManager.getInstance().addBoss(queen);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnBoss(GrandBossInstance npc)
|
||||
{
|
||||
startQuestTimer("ACTION", 10000, npc, null, true);
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
startQuestTimer("SPAWN_ROYAL", 1000, npc, null);
|
||||
startQuestTimer("NURSES_SPAWN", 1000, npc, null);
|
||||
startQuestTimer("CHECK_MINIONS_ZONE", 30000, npc, null, true);
|
||||
startQuestTimer("HEAL", 1000, null, null, true);
|
||||
_queen = npc;
|
||||
_larva = (MonsterInstance) addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0);
|
||||
_larva.setIsUnkillable(true);
|
||||
_larva.setIsImobilised(true);
|
||||
_larva.setIsAttackDisabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final Event event_enum = Event.valueOf(event);
|
||||
|
||||
switch (event_enum)
|
||||
{
|
||||
case QUEEN_SPAWN:
|
||||
{
|
||||
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
|
||||
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
|
||||
{
|
||||
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
|
||||
}
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
|
||||
GrandBossManager.getInstance().addBoss(queen);
|
||||
spawnBoss(queen);
|
||||
}
|
||||
break;
|
||||
case LARVA_DESPAWN:
|
||||
{
|
||||
_larva.decayMe();
|
||||
}
|
||||
break;
|
||||
case NURSES_SPAWN:
|
||||
{
|
||||
final int radius = 400;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
final int x = (int) (radius * Math.cos(i * 1.407)); // 1.407~2pi/6
|
||||
final int y = (int) (radius * Math.sin(i * 1.407));
|
||||
_nurses.add((MonsterInstance) addSpawn(NURSE, npc.getX() + x, npc.getY() + y, npc.getZ(), 0, false, 0));
|
||||
_nurses.get(i).setIsAttackDisabled(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SPAWN_ROYAL:
|
||||
{
|
||||
final int radius = 400;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
final int x = (int) (radius * Math.cos(i * .7854)); // .7854~2pi/8
|
||||
final int y = (int) (radius * Math.sin(i * .7854));
|
||||
_minions.add((MonsterInstance) addSpawn(ROYAL, npc.getX() + x, npc.getY() + y, npc.getZ(), 0, false, 0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RESPAWN_ROYAL:
|
||||
{
|
||||
_minions.add((MonsterInstance) addSpawn(ROYAL, npc.getX(), npc.getY(), npc.getZ(), 0, true, 0));
|
||||
}
|
||||
case RESPAWN_NURSE:
|
||||
{
|
||||
_nurses.add((MonsterInstance) addSpawn(NURSE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 0));
|
||||
}
|
||||
break;
|
||||
case DESPAWN_MINIONS:
|
||||
{
|
||||
for (int i = 0; i < _minions.size(); i++)
|
||||
{
|
||||
final Attackable mob = _minions.get(i);
|
||||
if (mob != null)
|
||||
{
|
||||
mob.decayMe();
|
||||
}
|
||||
}
|
||||
for (int k = 0; k < _nurses.size(); k++)
|
||||
{
|
||||
final MonsterInstance _nurse = _nurses.get(k);
|
||||
if (_nurse != null)
|
||||
{
|
||||
_nurse.decayMe();
|
||||
}
|
||||
}
|
||||
_nurses.clear();
|
||||
_minions.clear();
|
||||
}
|
||||
break;
|
||||
case CHECK_MINIONS_ZONE:
|
||||
{
|
||||
for (int i = 0; i < _minions.size(); i++)
|
||||
{
|
||||
final Attackable mob = _minions.get(i);
|
||||
if ((mob != null) && !mob.isInsideRadius(npc.getX(), npc.getY(), 700, false))/* !_Zone.isInsideZone(mob)) */
|
||||
{
|
||||
mob.teleToLocation(npc.getX(), npc.getY(), npc.getZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CHECK_NURSE_ALIVE:
|
||||
{
|
||||
int deadNurses = 0;
|
||||
for (MonsterInstance nurse : _nurses)
|
||||
{
|
||||
if (nurse.isDead())
|
||||
{
|
||||
deadNurses++;
|
||||
}
|
||||
}
|
||||
if (deadNurses == _nurses.size())
|
||||
{
|
||||
startQuestTimer("RESPAWN_NURSE", Config.QA_RESP_NURSE * 1000, npc, null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* case CHECK_QA_ZONE:{ int loc_x = -21610; int loc_y = 181594; int loc_z = -5734; if(!npc.isInsideRadius(loc_x,loc_y,3000,false)){ npc.teleToLocation(loc_x, loc_y, loc_z); } startQuestTimer("CHECK_MINIONS_ZONE", 1000, npc, null); } break;
|
||||
*/
|
||||
case ACTION:
|
||||
{
|
||||
if (Rnd.get(3) == 0)
|
||||
{
|
||||
if (Rnd.nextBoolean())
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 4));
|
||||
}
|
||||
}
|
||||
/*
|
||||
* if(Math.abs(npc.getX() + 21610) > 1000 || Math.abs(npc.getY() - 181594) > 2500) { ((Attackable) npc).clearAggroList(); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); npc.teleToLocation(-21610, 181594, -5740); }
|
||||
*/
|
||||
// startQuestTimer("ACTION", 10000, npc, null);
|
||||
}
|
||||
break;
|
||||
case HEAL:
|
||||
{
|
||||
boolean notCasting;
|
||||
final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp());
|
||||
final boolean queenNeedHeal = (_queen != null) && (_queen.getCurrentHp() < _queen.getMaxHp());
|
||||
boolean nurseNeedHeal = false;
|
||||
for (MonsterInstance nurse : _nurses)
|
||||
{
|
||||
nurseNeedHeal = (nurse != null) && (nurse.getCurrentHp() < nurse.getMaxHp());
|
||||
if ((nurse == null) || nurse.isDead() || nurse.isCastingNow())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
notCasting = nurse.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST;
|
||||
if (larvaNeedHeal)
|
||||
{
|
||||
if ((nurse.getTarget() != _larva) || notCasting)
|
||||
{
|
||||
getIntoPosition(nurse, _larva);
|
||||
nurse.setTarget(_larva);
|
||||
nurse.doCast(SkillTable.getInstance().getInfo(4020, 1));
|
||||
nurse.doCast(SkillTable.getInstance().getInfo(4024, 1));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (queenNeedHeal)
|
||||
{
|
||||
if ((nurse.getTarget() != _queen) || notCasting)
|
||||
{
|
||||
getIntoPosition(nurse, _queen);
|
||||
nurse.setTarget(_queen);
|
||||
nurse.doCast(SkillTable.getInstance().getInfo(4020, 1));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (nurseNeedHeal)
|
||||
{
|
||||
if ((nurse.getTarget() != nurse) || notCasting)
|
||||
{
|
||||
for (int k = 0; k < _nurses.size(); k++)
|
||||
{
|
||||
getIntoPosition(_nurses.get(k), nurse);
|
||||
_nurses.get(k).setTarget(nurse);
|
||||
_nurses.get(k).doCast(SkillTable.getInstance().getInfo(4020, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notCasting && (nurse.getTarget() != null))
|
||||
{
|
||||
nurse.setTarget(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
LOGGER.info("QUEEN: Not defined event: " + event + "!");
|
||||
}
|
||||
}
|
||||
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
if (npcId == NURSE)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||
return null;
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
|
||||
final Integer status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||
|
||||
if (npcId == QUEEN)
|
||||
{
|
||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||
|
||||
if (!npc.getSpawn().is_customBossInstance())
|
||||
{
|
||||
GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);
|
||||
// time is 36hour +/- 17hour
|
||||
final long respawnTime = (Config.QA_RESP_FIRST + Rnd.get(Config.QA_RESP_SECOND)) * 3600000;
|
||||
startQuestTimer("QUEEN_SPAWN", respawnTime, null, null);
|
||||
startQuestTimer("LARVA_DESPAWN", 4 * 60 * 60 * 1000, null, null);
|
||||
cancelQuestTimer("ACTION", npc, null);
|
||||
cancelQuestTimer("SPAWN_ROYAL", npc, null);
|
||||
cancelQuestTimer("CHECK_MINIONS_ZONE", npc, null);
|
||||
cancelQuestTimer("CHECK_NURSE_ALIVE", npc, null);
|
||||
cancelQuestTimer("HEAL", null, null);
|
||||
// cancelQuestTimer("CHECK_QA_ZONE", npc, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(QUEEN, info);
|
||||
}
|
||||
|
||||
startQuestTimer("DESPAWN_MINIONS", 10000, null, null);
|
||||
}
|
||||
else if (status == LIVE)
|
||||
{
|
||||
if ((npcId == ROYAL) || (npcId == NURSE))
|
||||
{
|
||||
npc.decayMe();
|
||||
if (_minions.contains(npc))
|
||||
{
|
||||
_minions.remove(npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
_nurses.remove(npc);
|
||||
}
|
||||
|
||||
if (npcId == ROYAL)
|
||||
{
|
||||
startQuestTimer("RESPAWN_ROYAL", (Config.QA_RESP_ROYAL + Rnd.get(40)) * 1000, npc, null);
|
||||
}
|
||||
else if (npcId == NURSE)
|
||||
{
|
||||
startQuestTimer("CHECK_NURSE_ALIVE", 1000, npc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public void getIntoPosition(MonsterInstance nurse, MonsterInstance caller)
|
||||
{
|
||||
if (!nurse.isInsideRadius(caller, 300, false, false))
|
||||
{
|
||||
nurse.getAI().moveToPawn(caller, 300);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new QueenAnt(-1, "queen_ant", "ai");
|
||||
}
|
||||
}
|
183
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Sailren.java
vendored
Normal file
183
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Sailren.java
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.Party;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.zone.type.BossZone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SpecialCamera;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Sailren extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int STATUE = 32109;
|
||||
private static final int SAILREN = 29065;
|
||||
private static final int VELO = 22196;
|
||||
private static final int PTERO = 22199;
|
||||
private static final int TREX = 22215;
|
||||
private static final int STONE = 8784;
|
||||
// Misc
|
||||
private static NpcInstance _vlcInstance;
|
||||
private static NpcInstance _ptrInstance;
|
||||
private static NpcInstance _trxInstance;
|
||||
private static NpcInstance _slrnInstance;
|
||||
|
||||
private Sailren()
|
||||
{
|
||||
super(-1, "Sailren", "ai/bosses");
|
||||
|
||||
addStartNpc(STATUE);
|
||||
addTalkId(STATUE);
|
||||
addKillId(VELO, PTERO, TREX, SAILREN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "start":
|
||||
{
|
||||
_vlcInstance = addSpawn(VELO, 27845, -5567, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _vlcInstance, player);
|
||||
cancelQuestTimer("start", npc, null);
|
||||
break;
|
||||
}
|
||||
case "round2":
|
||||
{
|
||||
_ptrInstance = addSpawn(PTERO, 27838, -5578, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _ptrInstance, player);
|
||||
cancelQuestTimer("round2", npc, null);
|
||||
break;
|
||||
}
|
||||
case "round3":
|
||||
{
|
||||
_trxInstance = addSpawn(TREX, 27838, -5578, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _trxInstance, player);
|
||||
cancelQuestTimer("round3", npc, null);
|
||||
break;
|
||||
}
|
||||
case "sailren":
|
||||
{
|
||||
_slrnInstance = addSpawn(SAILREN, 27489, -6223, -1982, 45000, false, 0);
|
||||
startQuestTimer("camera", 2000, _slrnInstance, player);
|
||||
startQuestTimer("vkrovatku", 1200000, _slrnInstance, null);
|
||||
cancelQuestTimer("round4", npc, null);
|
||||
break;
|
||||
}
|
||||
case "camera":
|
||||
{
|
||||
player.broadcastPacket(new SpecialCamera(npc.getObjectId(), 400, -75, 3, -150, 5000));
|
||||
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
|
||||
break;
|
||||
}
|
||||
case "open":
|
||||
{
|
||||
deleteGlobalQuestVar("close");
|
||||
cancelQuestTimer("open", npc, null);
|
||||
break;
|
||||
}
|
||||
case "vkrovatku":
|
||||
{
|
||||
npc.deleteMe();
|
||||
deleteGlobalQuestVar("close");
|
||||
cancelQuestTimer("open", npc, null);
|
||||
cancelQuestTimer("vkrovatku", npc, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (player.getInventory().getItemByItemId(STONE) != null)
|
||||
{
|
||||
final String close = loadGlobalQuestVar("close");
|
||||
if (close.equals(""))
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
player.destroyItemByItemId("Sailren", STONE, 1, player, true);
|
||||
saveGlobalQuestVar("close", "1");
|
||||
final BossZone zone = GrandBossManager.getInstance().getZone(27244, -7026, -1974);
|
||||
for (PlayerInstance member : party.getPartyMembers())
|
||||
{
|
||||
if (zone != null)
|
||||
{
|
||||
zone.allowPlayerEntry(member, 3600);
|
||||
}
|
||||
member.teleToLocation(27244, -7026, -1974);
|
||||
}
|
||||
startQuestTimer("start", 30000, npc, player);
|
||||
startQuestTimer("open", 1800000, npc, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<html><body><font color=LEVEL>Only with party...</font></body></html>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<html><body><font color=LEVEL>Some one else is inside...</font></body></html>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<html><body>You need quest item: <font color=LEVEL>Gazkh...</font></body></html>";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
if (npc == _vlcInstance)
|
||||
{
|
||||
startQuestTimer("round2", 30000, npc, killer);
|
||||
}
|
||||
else if (npc == _ptrInstance)
|
||||
{
|
||||
startQuestTimer("round3", 60000, npc, killer);
|
||||
}
|
||||
else if (npc == _trxInstance)
|
||||
{
|
||||
startQuestTimer("sailren", 180000, npc, killer);
|
||||
}
|
||||
else if (npc == _slrnInstance)
|
||||
{
|
||||
deleteGlobalQuestVar("close");
|
||||
cancelQuestTimer("open", npc, null);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Sailren();
|
||||
}
|
||||
}
|
75
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Tyrannosaurus.java
vendored
Normal file
75
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Tyrannosaurus.java
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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.bosses;
|
||||
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class Tyrannosaurus extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] TREX =
|
||||
{
|
||||
22215, // Tyrannosaurus
|
||||
22216, // Tyrannosaurus
|
||||
22217, // Tyrannosaurus
|
||||
};
|
||||
// Locations
|
||||
private final static Location[] SPAWNS =
|
||||
{
|
||||
new Location(19506, -15772, -3080, 49220),
|
||||
new Location(22253, -17062, -2976, 47449),
|
||||
new Location(23348, -20888, -2672, 0),
|
||||
new Location(25047, -18477, -2712, 0),
|
||||
new Location(27331, -16669, -2664, 21125),
|
||||
new Location(27714, -14692, -2552, 0),
|
||||
new Location(26555, -11574, -2464, 28153),
|
||||
new Location(21295, -11123, -2784, 41953),
|
||||
new Location(19605, -11234, -2816, 57601),
|
||||
new Location(19220, -11806, -2776, 0),
|
||||
new Location(26740, -16596, -2688, 13790)
|
||||
};
|
||||
|
||||
public Tyrannosaurus()
|
||||
{
|
||||
super(-1, "Tyrannosaurus", "ai/bosses");
|
||||
addKillId(TREX);
|
||||
addSpawn(TREX[Rnd.get(TREX.length)], SPAWNS[Rnd.get(SPAWNS.length)], false, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
addSpawn(TREX[Rnd.get(TREX.length)], SPAWNS[Rnd.get(SPAWNS.length)], false, 0);
|
||||
}, 1800000);
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Tyrannosaurus();
|
||||
}
|
||||
}
|
1572
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java
vendored
Normal file
1572
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Valakas.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1764
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java
vendored
Normal file
1764
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/VanHalter.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1002
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java
vendored
Normal file
1002
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Zaken.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
53
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/AncientEgg.java
vendored
Normal file
53
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/AncientEgg.java
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class AncientEgg extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int EGG = 18344; // Ancient Egg
|
||||
// Skill
|
||||
private static final int SIGNAL = 5088; // Signal
|
||||
|
||||
private AncientEgg(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
addAttackId(EGG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
attacker.setTarget(attacker);
|
||||
attacker.doCast(SkillTable.getInstance().getInfo(SIGNAL, 1));
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new AncientEgg(-1, "AncientEgg", "ai");
|
||||
}
|
||||
}
|
74
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/CatsEyeBandit.java
vendored
Normal file
74
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/CatsEyeBandit.java
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class CatsEyeBandit extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int CATS_EYE_BANDIT = 27038;
|
||||
|
||||
private CatsEyeBandit()
|
||||
{
|
||||
super(-1, "CatsEyeBandit", "ai/others");
|
||||
|
||||
addKillId(CATS_EYE_BANDIT);
|
||||
addAttackId(CATS_EYE_BANDIT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You childish fool, do you think you can catch me?"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
if (Rnd.get(100) < 80)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "I must do something about this shameful incident..."));
|
||||
}
|
||||
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new CatsEyeBandit();
|
||||
}
|
||||
}
|
135
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Chests.java
vendored
Normal file
135
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Chests.java
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.ChestInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Chests extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] CHESTS =
|
||||
{// @formatter:off
|
||||
18265,18266,18267,18268,18269,18270,18271,18272,18273,18274,18275,
|
||||
18276,18277,18278,18279,18280,18281,18282,18283,18284,18285,18286,
|
||||
18287,18288,18289,18290,18291,18292,18293,18294,18295,18296,18297,
|
||||
18298,21671,21694,21717,21740,21763,21786,21801,21802,21803,21804,
|
||||
21805,21806,21807,21808,21809,21810,21811,21812,21813,21814,21815,
|
||||
21816,21817,21818,21819,21820,21821,21822
|
||||
};// @formatter:on
|
||||
// Skill
|
||||
private static final int SKILL_DELUXE_KEY = 2229;
|
||||
// Misc
|
||||
private static final int BASE_CHANCE = 100;
|
||||
// Percent to decrease base chance when grade of DELUXE key not match.
|
||||
private static final int LEVEL_DECREASE = 40;
|
||||
// Chance for a chest to actually be a BOX (as opposed to being a mimic).
|
||||
private static final int IS_BOX = 40;
|
||||
|
||||
private Chests()
|
||||
{
|
||||
super(-1, "Chests", "ai/others");
|
||||
|
||||
addSkillUseId(CHESTS);
|
||||
addAttackId(CHESTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillUse(NpcInstance npc, PlayerInstance caster, Skill skill)
|
||||
{
|
||||
// if this has already been interacted, no further ai decisions are needed
|
||||
// if it's the first interaction, check if this is a box or mimic
|
||||
final ChestInstance chest = (ChestInstance) npc;
|
||||
if (chest.isInteracted())
|
||||
{
|
||||
chest.setInteracted();
|
||||
if (Rnd.get(100) < IS_BOX)
|
||||
{
|
||||
// if it's a box, either it will be successfully openned by a proper key, or instantly disappear
|
||||
if (skill.getId() == SKILL_DELUXE_KEY)
|
||||
{
|
||||
// check the chance to open the box
|
||||
final int keyLevelNeeded = chest.getLevel() / 10;
|
||||
int levelDiff = keyLevelNeeded - skill.getLevel();
|
||||
if (levelDiff < 0)
|
||||
{
|
||||
levelDiff = levelDiff * (-1);
|
||||
}
|
||||
final int chance = BASE_CHANCE - (levelDiff * LEVEL_DECREASE);
|
||||
|
||||
// success, pretend-death with rewards: npc.reduceCurrentHp(99999999, player)
|
||||
if (Rnd.get(100) < chance)
|
||||
{
|
||||
chest.setMustRewardExpSp(false);
|
||||
chest.setSpecialDrop();
|
||||
chest.reduceCurrentHp(99999999, caster);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// used a skill other than chest-key, or used a chest-key but failed to open: disappear with no rewards
|
||||
chest.onDecay();
|
||||
}
|
||||
else
|
||||
{
|
||||
final Creature target = chest.getAttackByList().contains(caster.getPet()) ? caster.getPet() : caster;
|
||||
chest.setRunning();
|
||||
chest.addDamageHate(target, 0, 999);
|
||||
chest.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
}
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final ChestInstance chest = (ChestInstance) npc;
|
||||
if (!chest.isInteracted())
|
||||
{
|
||||
chest.setInteracted();
|
||||
if (Rnd.get(100) < IS_BOX)
|
||||
{
|
||||
chest.onDecay();
|
||||
}
|
||||
else
|
||||
{
|
||||
// if this weren't a box, upon interaction start the mimic behaviors...
|
||||
// TODO: perhaps a self-buff (skill id 4245) with random chance goes here?
|
||||
final Creature target = isPet ? attacker.getPet() : attacker;
|
||||
chest.setRunning();
|
||||
chest.addDamageHate(target, 0, (damage * 100) / (chest.getLevel() + 7));
|
||||
chest.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Chests();
|
||||
}
|
||||
}
|
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialAgent.java
vendored
Normal file
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialAgent.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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class DeluLizardmanSpecialAgent extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int DELU_LIZARDMAN_SPECIAL_AGENT = 21105;
|
||||
|
||||
private DeluLizardmanSpecialAgent()
|
||||
{
|
||||
super(-1, "DeluLizardmanSpecialAgent", "ai/others");
|
||||
|
||||
addAttackId(DELU_LIZARDMAN_SPECIAL_AGENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Hey! We're having a duel here!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "How dare you interrupt our fight! Hey guys, help!"));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DeluLizardmanSpecialAgent();
|
||||
}
|
||||
}
|
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialCommander.java
vendored
Normal file
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialCommander.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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class DeluLizardmanSpecialCommander extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int DELU_LIZARDMAN_SPECIAL_COMMANDER = 21107;
|
||||
|
||||
private DeluLizardmanSpecialCommander()
|
||||
{
|
||||
super(-1, "DeluLizardmanSpecialCommander", "ai/others");
|
||||
|
||||
addAttackId(DELU_LIZARDMAN_SPECIAL_COMMANDER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Come on, Ill take you on!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "How dare you interrupt a sacred duel! You must be taught a lesson!"));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new DeluLizardmanSpecialCommander();
|
||||
}
|
||||
}
|
79
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/EvaBox.java
vendored
Normal file
79
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/EvaBox.java
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.datatables.xml.ItemTable;
|
||||
import org.l2jmobius.gameserver.model.Effect;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.ItemInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class EvaBox extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int BOX = 32342;
|
||||
// Skills
|
||||
private static final List<Integer> KISS_OF_EVA = new ArrayList<>();
|
||||
static
|
||||
{
|
||||
KISS_OF_EVA.add(1073);
|
||||
KISS_OF_EVA.add(3141);
|
||||
KISS_OF_EVA.add(3252);
|
||||
}
|
||||
// Items
|
||||
private static final int[] REWARDS =
|
||||
{
|
||||
9692,
|
||||
9693
|
||||
};
|
||||
|
||||
private EvaBox()
|
||||
{
|
||||
super(-1, "EvaBox", "ai/others");
|
||||
|
||||
addKillId(BOX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
for (Effect effect : killer.getAllEffects())
|
||||
{
|
||||
if (KISS_OF_EVA.contains(effect.getSkill().getId()))
|
||||
{
|
||||
final ItemInstance reward = ItemTable.getInstance().createItem("EvaBox", Rnd.get(REWARDS.length), 1, killer);
|
||||
reward.dropMe(npc, npc.getX(), npc.getY(), npc.getZ());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new EvaBox();
|
||||
}
|
||||
}
|
560
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java
vendored
Normal file
560
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java
vendored
Normal file
@@ -0,0 +1,560 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.idfactory.IdFactory;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.TamedBeastInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||
import org.l2jmobius.gameserver.templates.creatures.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
import quests.Q020_BringUpWithLove.Q020_BringUpWithLove;
|
||||
|
||||
/**
|
||||
* Growth-capable mobs: Polymorphing upon successful feeding.
|
||||
* @author Fulminus, Mobius
|
||||
*/
|
||||
public class FeedableBeasts extends Quest
|
||||
{
|
||||
private static final int GOLDEN_SPICE = 6643;
|
||||
private static final int CRYSTAL_SPICE = 6644;
|
||||
private static final int SKILL_GOLDEN_SPICE = 2188;
|
||||
private static final int SKILL_CRYSTAL_SPICE = 2189;
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] TAMED_BEASTS =
|
||||
{
|
||||
16013, 16014, 16015, 16016, 16017, 16018
|
||||
};
|
||||
|
||||
private static final int[] FEEDABLE_BEASTS =
|
||||
{
|
||||
21451, 21452, 21453, 21454, 21455, 21456, 21457, 21458, 21459, 21460, 21461, 21462, 21463, 21464, 21465, 21466, 21467, 21468, 21469, // Alpen Kookaburra
|
||||
21470, 21471, 21472, 21473, 21474, 21475, 21476, 21477, 21478, 21479, 21480, 21481, 21482, 21483, 21484, 21485, 21486, 21487, 21488, // Alpen Buffalo
|
||||
21489, 21490, 21491, 21492, 21493, 21494, 21495, 21496, 21497, 21498, 21499, 21500, 21501, 21502, 21503, 21504, 21505, 21506, 21507, // Alpen Cougar
|
||||
21824, 21825, 21826, 21827, 21828, 21829 // Alpen Kookaburra, Buffalo, Cougar
|
||||
};
|
||||
// @formatter:on
|
||||
|
||||
private static final Map<Integer, Integer> MAD_COW_POLYMORPH = new HashMap<>();
|
||||
{
|
||||
MAD_COW_POLYMORPH.put(21824, 21468);
|
||||
MAD_COW_POLYMORPH.put(21825, 21469);
|
||||
MAD_COW_POLYMORPH.put(21826, 21487);
|
||||
MAD_COW_POLYMORPH.put(21827, 21488);
|
||||
MAD_COW_POLYMORPH.put(21828, 21506);
|
||||
MAD_COW_POLYMORPH.put(21829, 21507);
|
||||
}
|
||||
|
||||
private static final String[][] TEXT =
|
||||
{
|
||||
{
|
||||
"What did you just do to me?",
|
||||
"You want to tame me, huh?",
|
||||
"Do not give me this. Perhaps you will be in danger.",
|
||||
"Bah bah. What is this unpalatable thing?",
|
||||
"My belly has been complaining. This hit the spot.",
|
||||
"What is this? Can I eat it?",
|
||||
"You don't need to worry about me.",
|
||||
"Delicious food, thanks.",
|
||||
"I am starting to like you!",
|
||||
"Gulp!"
|
||||
},
|
||||
{
|
||||
"I do not think you have given up on the idea of taming me.",
|
||||
"That is just food to me. Perhaps I can eat your hand too.",
|
||||
"Will eating this make me fat? Ha ha.",
|
||||
"Why do you always feed me?",
|
||||
"Do not trust me. I may betray you."
|
||||
},
|
||||
{
|
||||
"Destroy!",
|
||||
"Look what you have done!",
|
||||
"Strange feeling...! Evil intentions grow in my heart...!",
|
||||
"It is happening!",
|
||||
"This is sad...Good is sad...!"
|
||||
}
|
||||
};
|
||||
|
||||
private static final String[] SPAWN_CHATS =
|
||||
{
|
||||
"$s1, will you show me your hideaway?",
|
||||
"$s1, whenever I look at spice, I think about you.",
|
||||
"$s1, you do not need to return to the village. I will give you strength.",
|
||||
"Thanks, $s1. I hope I can help you.",
|
||||
"$s1, what can I do to help you?",
|
||||
};
|
||||
|
||||
private static final Map<Integer, Integer> FEED_INFO = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, GrowthCapableMob> GROWTH_CAPABLE_MONSTERS = new HashMap<>();
|
||||
|
||||
private static class GrowthCapableMob
|
||||
{
|
||||
private final int _growthLevel;
|
||||
private final int _chance;
|
||||
|
||||
private final Map<Integer, int[][]> _spiceToMob = new HashMap<>();
|
||||
|
||||
public GrowthCapableMob(int growthLevel, int chance)
|
||||
{
|
||||
_growthLevel = growthLevel;
|
||||
_chance = chance;
|
||||
}
|
||||
|
||||
public void addMobs(int spice, int[][] Mobs)
|
||||
{
|
||||
_spiceToMob.put(spice, Mobs);
|
||||
}
|
||||
|
||||
public Integer getMob(int spice, int mobType, int classType)
|
||||
{
|
||||
if (_spiceToMob.containsKey(spice))
|
||||
{
|
||||
return _spiceToMob.get(spice)[mobType][classType];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getRandomMob(int spice)
|
||||
{
|
||||
int[][] temp;
|
||||
temp = _spiceToMob.get(spice);
|
||||
return temp[0][Rnd.get(temp[0].length)];
|
||||
}
|
||||
|
||||
public Integer getChance()
|
||||
{
|
||||
return _chance;
|
||||
}
|
||||
|
||||
public Integer getGrowthLevel()
|
||||
{
|
||||
return _growthLevel;
|
||||
}
|
||||
}
|
||||
|
||||
private FeedableBeasts()
|
||||
{
|
||||
super(-1, "FeedableBeasts", "ai/others");
|
||||
|
||||
addKillId(FEEDABLE_BEASTS);
|
||||
addSkillUseId(FEEDABLE_BEASTS);
|
||||
|
||||
// TODO: no grendels?
|
||||
GrowthCapableMob temp;
|
||||
|
||||
//@formatter:off
|
||||
final int[][] Kookabura_0_Gold = {{ 21452, 21453, 21454, 21455 }};
|
||||
final int[][] Kookabura_0_Crystal = {{ 21456, 21457, 21458, 21459 }};
|
||||
final int[][] Kookabura_1_Gold_1= {{ 21460, 21462 }};
|
||||
final int[][] Kookabura_1_Gold_2 = {{ 21461, 21463 }};
|
||||
final int[][] Kookabura_1_Crystal_1 = {{ 21464, 21466 }};
|
||||
final int[][] Kookabura_1_Crystal_2 = {{ 21465, 21467 }};
|
||||
final int[][] Kookabura_2_1 = {{ 21468, 21824}, { 16017, 16018 }};
|
||||
final int[][] Kookabura_2_2 = {{ 21469, 21825}, { 16017, 16018 }};
|
||||
|
||||
final int[][] Buffalo_0_Gold = {{ 21471, 21472, 21473, 21474 }};
|
||||
final int[][] Buffalo_0_Crystal = {{ 21475, 21476, 21477, 21478 }};
|
||||
final int[][] Buffalo_1_Gold_1 = {{ 21479, 21481 }};
|
||||
final int[][] Buffalo_1_Gold_2 = {{ 21481, 21482 }};
|
||||
final int[][] Buffalo_1_Crystal_1 = {{ 21483, 21485 }};
|
||||
final int[][] Buffalo_1_Crystal_2 = {{ 21484, 21486 }};
|
||||
final int[][] Buffalo_2_1 = {{ 21487,21826}, {16013, 16014 }};
|
||||
final int[][] Buffalo_2_2 = {{ 21488,21827}, {16013, 16014 }};
|
||||
|
||||
final int[][] Cougar_0_Gold = {{ 21490, 21491, 21492, 21493 }};
|
||||
final int[][] Cougar_0_Crystal = {{ 21494,21495, 21496, 21497 }};
|
||||
final int[][] Cougar_1_Gold_1 = {{ 21498, 21500 }};
|
||||
final int[][] Cougar_1_Gold_2 = {{ 21499, 21501 }};
|
||||
final int[][] Cougar_1_Crystal_1 = {{ 21502,21504 }};
|
||||
final int[][] Cougar_1_Crystal_2 = {{ 21503,21505 }};
|
||||
final int[][] Cougar_2_1 = {{ 21506, 21828 }, { 16015,16016 }};
|
||||
final int[][] Cougar_2_2 = {{ 21507, 21829 }, { 16015,16016 }};
|
||||
//@formatter:on
|
||||
|
||||
// Alpen Kookabura
|
||||
temp = new GrowthCapableMob(0, 100);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_0_Crystal);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21451, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21452, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21454, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_1_Gold_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21453, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21455, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21456, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21458, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_1_Crystal_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21457, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21459, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_2_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21460, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21462, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Kookabura_2_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21461, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21463, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_2_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21464, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21466, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Kookabura_2_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21465, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21467, temp);
|
||||
|
||||
// Alpen Buffalo
|
||||
temp = new GrowthCapableMob(0, 100);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_0_Crystal);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21470, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21471, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21473, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_1_Gold_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21472, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21474, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21475, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21477, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_1_Crystal_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21476, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21478, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_2_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21479, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21481, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Buffalo_2_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21480, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21482, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_2_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21483, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21485, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Buffalo_2_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21484, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21486, temp);
|
||||
|
||||
// Alpen Cougar
|
||||
temp = new GrowthCapableMob(0, 100);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_0_Gold);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_0_Crystal);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21489, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21490, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21492, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_1_Gold_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21491, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21493, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21494, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21496, temp);
|
||||
|
||||
temp = new GrowthCapableMob(1, 40);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_1_Crystal_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21495, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21497, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_2_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21498, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21500, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(GOLDEN_SPICE, Cougar_2_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21499, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21501, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_2_1);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21502, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21504, temp);
|
||||
|
||||
temp = new GrowthCapableMob(2, 25);
|
||||
temp.addMobs(CRYSTAL_SPICE, Cougar_2_2);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21503, temp);
|
||||
GROWTH_CAPABLE_MONSTERS.put(21505, temp);
|
||||
}
|
||||
|
||||
private void spawnNext(NpcInstance npc, int growthLevel, PlayerInstance player, int food)
|
||||
{
|
||||
int npcId = npc.getNpcId();
|
||||
int nextNpcId = 0;
|
||||
|
||||
// Find the next mob to spawn, based on the current npcId, growthlevel, and food.
|
||||
if (growthLevel == 2)
|
||||
{
|
||||
// If tamed, the mob that will spawn depends on the class type (fighter/mage) of the player!
|
||||
if (Rnd.get(2) == 0)
|
||||
{
|
||||
if (player.isMageClass())
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 1, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* If not tamed, there is a small chance that have "mad cow" disease. that is a stronger-than-normal animal that attacks its feeder
|
||||
*/
|
||||
if (Rnd.get(5) == 0)
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
// All other levels of growth are straight-forward
|
||||
else
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getRandomMob(food);
|
||||
}
|
||||
|
||||
// Remove the feedinfo of the mob that got despawned, if any
|
||||
if (FEED_INFO.getOrDefault(npc.getObjectId(), 0) == player.getObjectId())
|
||||
{
|
||||
FEED_INFO.remove(npc.getObjectId());
|
||||
}
|
||||
|
||||
// Despawn the old mob
|
||||
npc.deleteMe();
|
||||
|
||||
// if this is finally a trained mob, then despawn any other trained mobs that the player might have and initialize the Tamed Beast.
|
||||
if (Util.contains(TAMED_BEASTS, nextNpcId))
|
||||
{
|
||||
if (player.getTrainedBeast() != null)
|
||||
{
|
||||
player.getTrainedBeast().deleteMe();
|
||||
}
|
||||
|
||||
final NpcTemplate template = NpcTable.getInstance().getTemplate(nextNpcId);
|
||||
final TamedBeastInstance nextNpc = new TamedBeastInstance(IdFactory.getInstance().getNextId(), template, player, food, npc.getX(), npc.getY(), npc.getZ());
|
||||
|
||||
nextNpc.setRunning();
|
||||
|
||||
// If player has Q020 going, give quest item
|
||||
QuestState st = player.getQuestState(Q020_BringUpWithLove.qn);
|
||||
if ((st != null) && (Rnd.get(100) < 5) && !st.hasQuestItems(7185))
|
||||
{
|
||||
st.giveItems(7185, 1);
|
||||
st.set("cond", "2");
|
||||
}
|
||||
|
||||
// Also, perform a rare random chat
|
||||
int rand = Rnd.get(20);
|
||||
if (rand < 5)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(nextNpc.getObjectId(), 0, nextNpc.getName(), SPAWN_CHATS[rand].replace("$s1", player.getName())));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If not trained, the newly spawned mob will automatically be aggro against its feeder
|
||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||
Attackable nextNpc = (Attackable) addSpawn(nextNpcId, npc);
|
||||
|
||||
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
||||
{
|
||||
startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player, false);
|
||||
}
|
||||
|
||||
// Register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equalsIgnoreCase("polymorph Mad Cow") && (npc != null) && (player != null))
|
||||
{
|
||||
if (MAD_COW_POLYMORPH.containsKey(npc.getNpcId()))
|
||||
{
|
||||
// remove the feed info from the previous mob
|
||||
if (FEED_INFO.getOrDefault(npc.getObjectId(), 0) == player.getObjectId())
|
||||
{
|
||||
FEED_INFO.remove(npc.getObjectId());
|
||||
}
|
||||
|
||||
// despawn the mad cow
|
||||
npc.deleteMe();
|
||||
|
||||
// spawn the new mob
|
||||
Attackable nextNpc = (Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getNpcId()), npc);
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSkillUse(NpcInstance npc, PlayerInstance caster, Skill skill)
|
||||
{
|
||||
// Gather some values on local variables
|
||||
int npcId = npc.getNpcId();
|
||||
int skillId = skill.getId();
|
||||
|
||||
// Check if the npc and skills used are valid for this script. Exit if invalid.
|
||||
if (!Util.contains(FEEDABLE_BEASTS, npcId) || ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE)))
|
||||
{
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
// First gather some values on local variables
|
||||
int objectId = npc.getObjectId();
|
||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in GROWTH_CAPABLE_MOBS, then it's at max growth (3)
|
||||
|
||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||
{
|
||||
growthLevel = GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel();
|
||||
}
|
||||
|
||||
// Prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||
if ((growthLevel == 0) && FEED_INFO.containsKey(objectId))
|
||||
{
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
FEED_INFO.put(objectId, caster.getObjectId());
|
||||
|
||||
int food = 0;
|
||||
if (skillId == SKILL_GOLDEN_SPICE)
|
||||
{
|
||||
food = GOLDEN_SPICE;
|
||||
}
|
||||
else if (skillId == SKILL_CRYSTAL_SPICE)
|
||||
{
|
||||
food = CRYSTAL_SPICE;
|
||||
}
|
||||
|
||||
// Display the social action of the beast eating the food.
|
||||
npc.broadcastPacket(new SocialAction(objectId, 2));
|
||||
|
||||
// If the pet can grow
|
||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||
{
|
||||
// Do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||
if (GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 0) == null)
|
||||
{
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
// Rare random talk...
|
||||
if (Rnd.get(20) == 0)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(objectId, 0, npc.getName(), TEXT[growthLevel][Rnd.get(TEXT[growthLevel].length)]));
|
||||
}
|
||||
|
||||
if ((growthLevel > 0) && (FEED_INFO.getOrDefault(objectId, 0) != caster.getObjectId()))
|
||||
{
|
||||
// check if this is the same player as the one who raised it from growth 0.
|
||||
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
// Polymorph the mob, with a certain chance, given its current growth level
|
||||
if (Rnd.get(100) < GROWTH_CAPABLE_MONSTERS.get(npcId).getChance())
|
||||
{
|
||||
spawnNext(npc, growthLevel, caster, food);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onSkillUse(npc, caster, skill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isSummon)
|
||||
{
|
||||
// Remove the feedinfo of the mob that got killed, if any
|
||||
FEED_INFO.remove(npc.getObjectId());
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FeedableBeasts();
|
||||
}
|
||||
}
|
66
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/KarulBugbear.java
vendored
Normal file
66
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/KarulBugbear.java
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class KarulBugbear extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int KARUL_BUGBEAR = 20600;
|
||||
|
||||
private KarulBugbear()
|
||||
{
|
||||
super(-1, "KarulBugbear", "ai/others");
|
||||
|
||||
addAttackId(KARUL_BUGBEAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 4)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Your rear is practically unguarded!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
if (Rnd.get(100) < 4)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Watch your back!"));
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new KarulBugbear();
|
||||
}
|
||||
}
|
192
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Monastery.java
vendored
Normal file
192
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Monastery.java
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.Skill.SkillType;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class Monastery extends Quest
|
||||
{
|
||||
static final int[] mobs1 =
|
||||
{
|
||||
22124,
|
||||
22125,
|
||||
22126,
|
||||
22127,
|
||||
22129
|
||||
};
|
||||
static final int[] mobs2 =
|
||||
{
|
||||
22134,
|
||||
22135
|
||||
};
|
||||
// TODO: npcstring
|
||||
static final String[] text =
|
||||
{
|
||||
"You cannot carry a weapon without authorization!",
|
||||
"name, why would you choose the path of darkness?!",
|
||||
"name! How dare you defy the will of Einhasad!"
|
||||
};
|
||||
|
||||
public Monastery(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
registerMobs(mobs1, QuestEventType.ON_AGGRO_RANGE_ENTER, QuestEventType.ON_SPAWN, QuestEventType.ON_SPELL_FINISHED);
|
||||
registerMobs(mobs2, QuestEventType.ON_SPELL_FINISHED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAggroRangeEnter(NpcInstance npc, PlayerInstance player, boolean isPet)
|
||||
{
|
||||
if (Util.contains(mobs1, npc.getNpcId()) && !npc.isInCombat() && (npc.getTarget() == null))
|
||||
{
|
||||
if ((player.getActiveWeaponInstance() != null) && !player.isSilentMoving())
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), text[0]));
|
||||
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 22124:
|
||||
case 22126:
|
||||
{
|
||||
final Skill skill = SkillTable.getInstance().getInfo(4589, 8);
|
||||
npc.doCast(skill);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
((Attackable) npc).addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (((Attackable) npc).getMostHated() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(NpcInstance npc)
|
||||
{
|
||||
if (Util.contains(mobs1, npc.getNpcId()))
|
||||
{
|
||||
final List<Playable> result = new ArrayList<>();
|
||||
final Collection<WorldObject> objs = npc.getKnownList().getKnownObjects().values();
|
||||
for (WorldObject obj : objs)
|
||||
{
|
||||
if ((obj instanceof PlayerInstance) || (obj instanceof PetInstance))
|
||||
{
|
||||
if (Util.checkIfInRange(npc.getAggroRange(), npc, obj, true) && !((Creature) obj).isDead())
|
||||
{
|
||||
result.add((Playable) obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!result.isEmpty() && (result.size() != 0))
|
||||
{
|
||||
final Object[] characters = result.toArray();
|
||||
for (Object obj : characters)
|
||||
{
|
||||
final Playable target = (Playable) (obj instanceof PlayerInstance ? obj : ((Summon) obj).getOwner());
|
||||
|
||||
if ((target.getActiveWeaponInstance() == null) || ((target instanceof PlayerInstance) && ((PlayerInstance) target).isSilentMoving()) || ((target instanceof Summon) && ((Summon) target).getOwner().isSilentMoving()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((target.getActiveWeaponInstance() != null) && !npc.isInCombat() && (npc.getTarget() == null))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), text[0]));
|
||||
switch (npc.getNpcId())
|
||||
{
|
||||
case 22124:
|
||||
case 22126:
|
||||
case 22127:
|
||||
{
|
||||
final Skill skill = SkillTable.getInstance().getInfo(4589, 8);
|
||||
npc.doCast(skill);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
((Attackable) npc).addDamageHate(target, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(NpcInstance npc, PlayerInstance player, Skill skill)
|
||||
{
|
||||
if (Util.contains(mobs1, npc.getNpcId()) && (skill.getId() == 4589))
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
((Attackable) npc).addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
|
||||
if (Util.contains(mobs2, npc.getNpcId()))
|
||||
{
|
||||
if (skill.getSkillType() == SkillType.AGGDAMAGE)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), text[Rnd.get(2) + 1].replace("name", player.getName())));
|
||||
((Attackable) npc).addDamageHate(player, 0, 999);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Monastery(-1, "monastery", "ai");
|
||||
}
|
||||
}
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-01.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Grand Master Roien:<br>
|
||||
First, you must learn the basic methods of control in the game. You should meet the<font color="LEVEL"> Newbie Helper</font> over there.<br>
|
||||
Listen carefully to what he tells you, you will find it very useful later in the game.<br>
|
||||
</body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-02.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-02.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Grand Master Roien:<br>
|
||||
Welcome. I am Grand Master Roien, of Cedric's Training Hall. This school was established by the renowned Paladin Sir Cedric, famous for producing many competent Fighters..<br>
|
||||
Did you get the recommendation from the Newbie helper?<br>
|
||||
<a action="bypass -h Quest NewbieHelper 30008_02">"I brought the recommendation."</a><br>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Grand Master Roien:<br>
|
||||
You've learned the basic methods of control in the game. Now your adventures may begin!<br>
|
||||
Please accept this gift. I'm sure you know how to use it, right?<br>
|
||||
Go to<font color="LEVEL"> Talking Island Village</font> and meet the<font color="LEVEL"> Newbie Helper</font> there. He will give you much useful advice. He also has a gift for you.<br>
|
||||
Follow the arrow above your head to find him. Off you go! Good luck!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30008-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Grand Master Roien:<br>
|
||||
Go to <font color="LEVEL">Talking Island Village</font> and meet the <font color="LEVEL">Newbie Helper.</font> He will give you much important advice. He also has a gift for you.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30009-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30009-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good!<br>
|
||||
As I promised, I'll give you a gift. This is called a soulshot. Soulshots make it possible for you to launch much stronger attacks. However, it only works once, so use it carefully.<br>
|
||||
<img src="L2UI_CH3.tutorial_img18" width=64 height=64><br>
|
||||
Take this letter of recommendation to<font color="LEVEL"> Grand Master Roien</font> over there. He's been eager to meet you. He has a gift for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30009-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30009-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Speak with<font color="LEVEL"> Grand Master Roien</font> over there. He's eager to meet you. He has a gift for you.<br>
|
||||
May the goddess of luck be with you!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-01.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Grand Master Gallin:<br>
|
||||
First, you must learn the basic methods of control in the game. Let me introduce my little friend, the<font color="LEVEL"> newbie helper</font>.<br>
|
||||
The newbie helper will teach you many things you will find useful in the game.<br>
|
||||
</body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-02.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-02.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Grand Magister Gallint:<br>
|
||||
Welcome to my school of wizardry. It was founded by the famed alchemist Einhovant, and many excellent Wizards have been trained here.<br>
|
||||
Have you brought a letter of recommendation from the Newbie Helper?<br>
|
||||
<a action="bypass -h Quest NewbieHelper 30017_02">I've brought the letter of recommendation."</a><br>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Grand Master Gallin:<br>
|
||||
You've learned the basic control methods in the game. Now your adventures can begin!<br>
|
||||
Please accept this gift. You know how to use it, right?<br>
|
||||
Go to<font color="LEVEL"> Talking Island Village</font> and meet the<font color="LEVEL"> newbie helper</font> there. The newbie helper will teach you many things you need to know about the game. He has gifts for you, too!<br>
|
||||
Follow the arrow above your head to find the newbie helper. Get going! Good luck!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30017-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Grand Magister Gallint:<br>
|
||||
Go to <font color="LEVEL">Talking Island Village</font> and meet the <font color="LEVEL">newbie helper.</font> The newbie helper will teach you many things you need to know about the game. He also has a gift for you!<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30019-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30019-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good!<br>
|
||||
As I promised, I'll give you a gift. This is called a spiritshot. Spiritshots make your magical attacks much stronger. However, it only works once, so you should save it for the right moment.<br>
|
||||
<img src="L2UI_CH3.tutorial_img19" width=64 height=64><br>
|
||||
Take this letter of recommendation to<font color="LEVEL"> Grand Master Gallint</font> over there. He's been looking forward to meeting you. He has something for you.
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30019-03a.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30019-03a.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good!<br>
|
||||
As I promised, I'll give you a gift. This is called a spiritshot. Spiritshots make your magical attacks much stronger. However, it only works once, so you should save it for the right moment.<br>
|
||||
<img src="L2UI_CH3.tutorial_img19" width=64 height=64><br>
|
||||
Take this letter of recommendation to<font color="LEVEL"> Grand Master Gallint</font> over there. He's been looking forward to meeting you. He has something for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30019-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30019-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Speak with<font color="LEVEL"> Grand Master Gallint</font> over there. He's been waiting for you. He has a gift for you.<br>
|
||||
May the goddess of luck be with you!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-01.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Hierarch Mitraell:<br>
|
||||
First, you must learn the basic methods of control in the game. Let me introduce my little friend, the<font color="LEVEL"> newbie helper</font>.<br>
|
||||
Follow his instructions, you'll quickly learn things that you'll need in the game.<br>
|
||||
</body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-02.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-02.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Hierarch Mitraell:<br>
|
||||
I, the Hierarch of all Dark Elves offer you the blessings of the abyss. I am the prisoner of a magic seal, barely able to function, but I still manage to teach my students.<br>
|
||||
Have you brought the blood of Mitraell from the Newbie Helper?<br>
|
||||
<a action="bypass -h Quest NewbieHelper 30129_02">"I brought the blood of Mitraell."</a><br>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Hierarch Mitraell:<br>
|
||||
You've learned the basic methods of control in the game. Now your adventures can begin.<br>
|
||||
Please accept this gift. You know how to use it, right?<br>
|
||||
Go to the<font color="LEVEL"> Dark Elven Village</font> and meet the<font color="LEVEL"> newbie helper</font> there. The newbie helper will teach you many things that will help you in the game. You'll also get a gift!<br>
|
||||
Follow the arrow above your head to find the newbie helper. Get going! Good luck!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30129-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Hierarch Mitraell:<br>
|
||||
Go to the<font color="LEVEL"> Dark Elven Village</font> and meet the<font color="LEVEL"> newbie helper.</font> The newbie helper will teach you many things.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
8
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-01.htm
vendored
Normal file
8
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-01.htm
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Welcome! Are you ready for a mission?<br>
|
||||
Have you seen the gremlins around here? They've stolen the precious blue gemstone!<br>
|
||||
<font color="LEVEL">You must recover it from them! </font><br>
|
||||
I'll tell you again how to kill the gremlins. Place your cursor over a gremlin and click the <font color="FF0000">left button</font>. The cursor will change to a sword. Click the <font color="FF0000">F2 key</font> to attack with<font color="LEVEL"> Wind Strike</font> magic.<br>
|
||||
<img src="L2UI_CH3.tutorial_img12" width=64 height=64><table border=0><tr><td><img src="L2UI_CH3.tutorial_img133" width=64 height=64></td><td><img src="L2UI_CH3.tutorial_img16" width=64 height=64></td></tr></table><br>
|
||||
Complete this mission and I'll reward you with useful items. Good luck!
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good!<br>
|
||||
As I promised, I'll give you a gift. This is called a soulshot. Soulshots make it possible for you to launch much stronger attacks. However, it only works once, so use it carefully.<br>
|
||||
<img src="L2UI_CH3.tutorial_img18" width=64 height=64><br>
|
||||
Take this blood to<font color="LEVEL"> Mitraell</font> over there. He has a gift for you.
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-03a.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-03a.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good!<br>
|
||||
As I promised, I'll give you a gift. This is called a spiritshot. Spiritshots make your magical attacks much stronger. However, it only works once, so you should save it for the right moment.<br>
|
||||
<img src="L2UI_CH3.tutorial_img19" width=64 height=64><br>
|
||||
Take this blood to<font color="LEVEL"> Mitraell</font> over there. He has a gift for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30131-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Speak with<font color="LEVEL"> Hierarch Mitraell</font> over there. He has a gift for you.<br>
|
||||
May the goddess of luck be with you!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-01.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Nerupa:<br>
|
||||
First, you must learn the basic methods of control in the game. Let me introduce the<font color="LEVEL"> newbie helper</font>.<br>
|
||||
Follow his instructions and you'll quickly learn things that you need to know.<br>
|
||||
</body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-02.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-02.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Nerupa:<br>
|
||||
I am a proud warrior of the Arachne tribe. Long ago, I made a pact with the Mother Tree, and have protected this forest and young Elves for centuries.<br>
|
||||
Have you brought a leaf of the Mother Tree from the Newbie Guide?<br>
|
||||
<a action="bypass -h Quest NewbieHelper 30370_02">"I brought a leaf of the Mother Tree."</a><br>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Nerupa:<br>
|
||||
You have learned the basic methods of control in the game. Now your adventure may begin.<br>
|
||||
Here is a gift. You know how to use it, right?<br>
|
||||
Go to the<font color="LEVEL"> Elven Village</font> and meet the<font color="LEVEL"> newbie helper</font> there. He will give you much important advice. Not to mention a few gifts!<br>
|
||||
Follow the arrow above your head to find the newbie helper. Get going! Good luck!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30370-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Nerupa:<br>
|
||||
Go to the<font color="LEVEL"> Elven Village</font> and meet the<font color="LEVEL"> newbie helper.</font> He will give you a lot of important advice. Not to mention a few gifts!<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30400-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30400-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good work.<br>
|
||||
As promised, I'll give you a gift. This is a soulshot. It will greatly strengthen your magic. Take heed, it only works once, so use it wisely.<br>
|
||||
<img src="L2UI_CH3.tutorial_img18" width=64 height=64><br>
|
||||
Take this leaf of the mother tree to<font color="LEVEL"> Nerupa</font> over there. She has a gift for you.
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30400-03a.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30400-03a.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good work.<br>
|
||||
As promised, I'll give you a gift. This is a soulshot. It will greatly enhance your magic. Take heed, it only works once, so use it wisely...<br>
|
||||
<img src="L2UI_CH3.tutorial_img19" width=64 height=64><br>
|
||||
Take this leaf of the mother tree to<font color="LEVEL"> Nerupa</font> over there. She has a gift for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30400-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30400-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Speak with<font color="LEVEL"> Nerupa</font> over there. She has a gift for you.<br>
|
||||
May the goddess of luck be with you!
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30430-03a.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30430-03a.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good work.<br>
|
||||
As promised, I'll give you a gift. This is a soulshot. It will greatly enhance your magic. Take heed, it only works once, so use it wisely...<br>
|
||||
<img src="L2UI_CH3.tutorial_img18" width=64 height=64><br>
|
||||
Take this leaf of the mother tree to<font color="LEVEL"> Nerupa</font> over there. She has a gift for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-01.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Foreman Laferon:<br>
|
||||
First, you must learn the basic methods of control in the game. Let me introduce my little friend, the<font color="LEVEL"> newbie helper</font>.<br>
|
||||
He will teach you many things you need to know about the game.<br>
|
||||
</body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-02.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-02.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Foreman Laferon:<br>
|
||||
Pleased to meet you, my young friend! I'm foreman of this strip mine, and have trained many fine young Dwarves here.<br>
|
||||
Have you gotten a mining license from the Newbie Helper?<br>
|
||||
<a action="bypass -h Quest NewbieHelper 30528_02">"I have a mining license."</a><br>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Foreman Laferon:<br>
|
||||
You've learned the basic methods of control in the game. Now your adventures can begin.<br>
|
||||
First, please accept this gift. You know how to use it, right?<br>
|
||||
Go to the<font color="LEVEL"> Dwarven Village</font> and meet the<font color="LEVEL"> newbie helper</font> there. The newbie helper will give you some very important advice. He has gifts for you, too!<br>
|
||||
Follow the arrow above your head and you'll find the newbie helper. Get going! Good luck!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30528-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Foreman Laferon:<br>
|
||||
Go to the<font color="LEVEL"> Dwarven Village</font> and meet the<font color="LEVEL"> newbie helper</font>. The newbie helper will teach you many things you need to know about the game.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30530-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30530-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good work.<br>
|
||||
As promised, I'll give you a gift. This is a soulshot. It will make your attacks much stronger. Take heed, it only works once, so use it wisely.<br>
|
||||
<img src="L2UI_CH3.tutorial_img18" width=64 height=64><br>
|
||||
Take this mining license to<font color="LEVEL"> Foreman Laferon</font> over there. He has a gift for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30530-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30530-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Speak with<font color="LEVEL"> Foreman Laferon</font> over there. He has a gift for you.<br>
|
||||
May the goddess of luck be with you!
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-01.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Flame Guardian Vulkus:<br>
|
||||
First, you must learn the basic methods of control in the game. Let me introduce my little friend, the<font color="LEVEL"> newbie helper</font>.<br>
|
||||
Follow his instructions, you'll quickly learn things that you'll need in the game.<br>
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-02.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-02.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Flame Guardian Vulkus:<br>
|
||||
Tejakar Oroka! I am Flame Guardian Vulkus! My role is to teach the fighting spirit of Paagrio to young orcs!<br>
|
||||
Did you get the Voucher of Flame from the Newbie Helper?<br>
|
||||
<a action="bypass -h Quest NewbieHelper 30573_02">"I brought the Voucher of Flame."</a></body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-03.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-03.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Flame Guardian Vulkus:<br>
|
||||
You've learned the basic methods of control in the game. Now your adventures can begin.<br>
|
||||
Please accept this gift. You know how to use it, right?<br>
|
||||
Go to the<font color="LEVEL"> Orc Village</font> and meet the<font color="LEVEL"> newbie helper</font> there. The newbie helper will teach you many things that will help you in the game. You'll also get a gift!<br>
|
||||
Follow the arrow above your head to find the newbie helper. Get going! Good luck!</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30573-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Flame Guardian Vulkus:<br>
|
||||
Go to the<font color="LEVEL"> Orc Village</font> and meet the<font color="LEVEL"> newbie helper.</font> The newbie helper will teach you many things.<br>
|
||||
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good work.<br>
|
||||
As promised, I'll give you a gift. This is a soulshot. It will make your attacks much stronger. Take heed, it only works once, so use it wisely.<br>
|
||||
<img src="L2UI_CH3.tutorial_img18" width=64 height=64><br>
|
||||
Take this voucher of flame to<font color="LEVEL"> Flame Guardian Vulkus</font> over there. He has a gift for you.
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-03a.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-03a.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
You got a blue gem! Good!<br>
|
||||
As I promised, I'll give you a gift. This is called a spiritshot. Spiritshots make your magical attacks much stronger. However, it only works once, so you should save it for the right moment.<br>
|
||||
<img src="L2UI_CH3.tutorial_img19" width=64 height=64><br>
|
||||
Take this voucher of flame to<font color="LEVEL"> Flame Guardian Vulkus</font> over there. He has a gift for you.
|
||||
</body></html>
|
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-04.htm
vendored
Normal file
4
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-04.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Speak with<font color="LEVEL"> Flame Guardian Vulkus</font> over there. He has a gift for you.<br>
|
||||
May the goddess of luck be with you!
|
||||
</body></html>
|
3
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-05.htm
vendored
Normal file
3
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/30575-05.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
I've taught you all I can, my child. Go now, out into the world! Live every day like it was your last! It very well might be!
|
||||
</body></html>
|
429
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
vendored
Normal file
429
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/NewbieHelper.java
vendored
Normal file
@@ -0,0 +1,429 @@
|
||||
/*
|
||||
* 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.others.NewbieHelper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
import org.l2jmobius.gameserver.model.quest.State;
|
||||
|
||||
public class NewbieHelper extends Quest
|
||||
{
|
||||
private final static String qn = "NewbieHelper";
|
||||
private final static String qnTutorial = "Tutorial";
|
||||
|
||||
// Quest Items
|
||||
// Human
|
||||
private final static int RECOMMENDATION_01 = 1067;
|
||||
private final static int RECOMMENDATION_02 = 1068;
|
||||
// Elf
|
||||
private final static int LEAF_OF_MOTHERTREE = 1069;
|
||||
// Dark Elf
|
||||
private final static int BLOOD_OF_JUNDIN = 1070;
|
||||
// Dwarf
|
||||
private final static int LICENSE_OF_MINER = 1498;
|
||||
// Orc
|
||||
private final static int VOUCHER_OF_FLAME = 1496;
|
||||
|
||||
// Items Reward
|
||||
private final static int SOULSHOT_NOVICE = 5789;
|
||||
private final static int SPIRITSHOT_NOVICE = 5790;
|
||||
private final static int BLUE_GEM = 6353;
|
||||
private final static int TOKEN = 8542;
|
||||
private final static int SCROLL = 8594;
|
||||
|
||||
private final static Map<String, Event> _events = new HashMap<>();
|
||||
static
|
||||
{
|
||||
_events.put("30008_02", new Event("30008-03.htm", -84058, 243239, -3730, RECOMMENDATION_01, 0x00, SOULSHOT_NOVICE, 200, 0x00, 0, 0));
|
||||
_events.put("30017_02", new Event("30017-03.htm", -84058, 243239, -3730, RECOMMENDATION_02, 0x0a, SPIRITSHOT_NOVICE, 100, 0x00, 0, 0));
|
||||
_events.put("30129_02", new Event("30129-03.htm", 12116, 16666, -4610, BLOOD_OF_JUNDIN, 0x26, SPIRITSHOT_NOVICE, 100, 0x1f, SOULSHOT_NOVICE, 200));
|
||||
_events.put("30370_02", new Event("30370-03.htm", 45491, 48359, -3086, LEAF_OF_MOTHERTREE, 0x19, SPIRITSHOT_NOVICE, 100, 0x12, SOULSHOT_NOVICE, 200));
|
||||
_events.put("30528_02", new Event("30528-03.htm", 115642, -178046, -941, LICENSE_OF_MINER, 0x35, SOULSHOT_NOVICE, 200, 0x00, 0, 0));
|
||||
_events.put("30573_02", new Event("30573-03.htm", -45067, -113549, -235, VOUCHER_OF_FLAME, 0x31, SOULSHOT_NOVICE, 200, 0x2c, SOULSHOT_NOVICE, 200));
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
private final static Map<Integer, Talk> _talks = new HashMap<>();
|
||||
static
|
||||
{
|
||||
// Grand Master - Roien - Human
|
||||
_talks.put(30008, new Talk(0, new String[]{"30008-01.htm", "30008-02.htm", "30008-04.htm"}, 0, 0));
|
||||
_talks.put(30009, new Talk(0, new String[]{"newbiehelper_fig_01.htm", "30009-03.htm", "", "30009-04.htm"}, 1, RECOMMENDATION_01));
|
||||
// Grand Master - Gallint - Human
|
||||
_talks.put(30017, new Talk(0, new String[]{"30017-01.htm", "30017-02.htm", "30017-04.htm"}, 0, 0));
|
||||
_talks.put(30019, new Talk(0, new String[]{"newbiehelper_fig_01.htm", "", "30019-03a.htm", "30019-04.htm"}, 1, RECOMMENDATION_02));
|
||||
// Hierarch - Dark Elf
|
||||
_talks.put(30129, new Talk(2, new String[]{"30129-01.htm", "30129-02.htm", "30129-04.htm"}, 0, 0));
|
||||
_talks.put(30131, new Talk(2, new String[]{"newbiehelper_fig_01.htm", "30131-03.htm", "30131-03a.htm", "30131-04.htm"}, 1, BLOOD_OF_JUNDIN));
|
||||
// Nerupa - Elf
|
||||
_talks.put(30370, new Talk(1, new String[]{"30370-01.htm", "30370-02.htm", "30370-04.htm"}, 0, 0));
|
||||
_talks.put(30400, new Talk(1, new String[]{"newbiehelper_fig_01.htm", "30400-03.htm", "30400-03a.htm", "30400-04.htm"}, 1, LEAF_OF_MOTHERTREE));
|
||||
// Foreman - Dwarf
|
||||
_talks.put(30528, new Talk(4, new String[]{"30528-01.htm", "30528-02.htm", "30528-04.htm"}, 0, 0));
|
||||
_talks.put(30530, new Talk(4, new String[]{"newbiehelper_fig_01.htm", "30530-03.htm", "", "30530-04.htm"}, 1, LICENSE_OF_MINER));
|
||||
// Flame Guardian - Orc
|
||||
_talks.put(30573, new Talk(3, new String[]{"30573-01.htm", "30573-02.htm", "30573-04.htm"}, 0, 0));
|
||||
_talks.put(30575, new Talk(3, new String[]{"newbiehelper_fig_01.htm", "30575-03.htm", "30575-03a.htm", "30575-04.htm"}, 1, VOUCHER_OF_FLAME));
|
||||
}
|
||||
// @formatter:on
|
||||
|
||||
public NewbieHelper()
|
||||
{
|
||||
super(-1, qn, "ai/others");
|
||||
|
||||
addStartNpc(30009, 30019, 30131, 30400, 30530, 30575);
|
||||
|
||||
addTalkId(30009, 30019, 30131, 30400, 30530, 30575, 30008, 30017, 30129, 30370, 30528, 30573);
|
||||
|
||||
addFirstTalkId(new int[]
|
||||
{
|
||||
30009, // Newbie Helper - Human
|
||||
30019, // Newbie Helper - Human
|
||||
30131, // Newbie Helper - Dark Elf
|
||||
30400, // Newbie Helper - Elf
|
||||
30530, // Newbie Helper - Dwarf
|
||||
30575, // Newbie Helper - Orc
|
||||
|
||||
30598, // Newbie Guide
|
||||
30599, // Newbie Guide
|
||||
30600, // Newbie Guide
|
||||
30601, // Newbie Guide
|
||||
30602, // Newbie Guide
|
||||
|
||||
30008, // Grand Master - Roien - Human
|
||||
30017, // Grand Master - Gallint - Human
|
||||
30129, // Hierarch - Dark Elf
|
||||
30370, // Nerupa - Elf
|
||||
30528, // Foreman - Dwarf
|
||||
30573 // Flame Guardian - Orc
|
||||
});
|
||||
|
||||
addKillId(18342);
|
||||
}
|
||||
|
||||
private static class Talk
|
||||
{
|
||||
int _raceId;
|
||||
String[] _htmlfiles;
|
||||
int _npcTyp;
|
||||
int _item;
|
||||
|
||||
public Talk(int raceId, String[] htmlfiles, int npcTyp, int item)
|
||||
{
|
||||
_raceId = raceId;
|
||||
_htmlfiles = htmlfiles;
|
||||
_npcTyp = npcTyp;
|
||||
_item = item;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Event
|
||||
{
|
||||
String _htmlfile;
|
||||
int _radarX;
|
||||
int _radarY;
|
||||
int _radarZ;
|
||||
int _item;
|
||||
int _classId1;
|
||||
int _gift1;
|
||||
int _count1;
|
||||
int _classId2;
|
||||
int _gift2;
|
||||
int _count2;
|
||||
|
||||
public Event(String htmlfile, int x, int y, int z, int item, int classId1, int gift1, int count1, int classId2, int gift2, int count2)
|
||||
{
|
||||
_htmlfile = htmlfile;
|
||||
_radarX = x;
|
||||
_radarY = y;
|
||||
_radarZ = z;
|
||||
_item = item;
|
||||
_classId1 = classId1;
|
||||
_gift1 = gift1;
|
||||
_count1 = count1;
|
||||
_classId2 = classId2;
|
||||
_gift2 = gift2;
|
||||
_count2 = count2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final QuestState qs1 = player.getQuestState(qn);
|
||||
final QuestState qs2 = player.getQuestState(qnTutorial);
|
||||
if ((qs1 == null) || (qs2 == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String htmltext = event;
|
||||
player = qs1.getPlayer();
|
||||
|
||||
int ex = qs2.getInt("Ex");
|
||||
int classId = qs1.getPlayer().getClassId().getId();
|
||||
|
||||
if (event.equalsIgnoreCase("TimerEx_NewbieHelper"))
|
||||
{
|
||||
if (ex == 0)
|
||||
{
|
||||
qs1.playTutorialVoice(player.isMageClass() ? "tutorial_voice_009b" : "tutorial_voice_009a");
|
||||
qs2.set("Ex", "1");
|
||||
}
|
||||
else if (ex == 3)
|
||||
{
|
||||
qs1.playTutorialVoice("tutorial_voice_010a");
|
||||
qs2.set("Ex", "4");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else if (event.equalsIgnoreCase("TimerEx_GrandMaster"))
|
||||
{
|
||||
if (ex >= 4)
|
||||
{
|
||||
qs1.showQuestionMark(7);
|
||||
qs1.playSound("ItemSound.quest_tutorial");
|
||||
qs1.playTutorialVoice("tutorial_voice_025");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Event ev = _events.get(event);
|
||||
if (ev != null)
|
||||
{
|
||||
if (ev._radarX != 0)
|
||||
{
|
||||
qs1.addRadar(ev._radarX, ev._radarY, ev._radarZ);
|
||||
}
|
||||
htmltext = ev._htmlfile;
|
||||
if ((qs1.getQuestItemsCount(ev._item) == 1) && (qs1.getInt("onlyone") == 0))
|
||||
{
|
||||
qs1.rewardExpAndSp(0, 50);
|
||||
startQuestTimer("TimerEx_GrandMaster", 60000, null, player, false);
|
||||
qs1.takeItems(ev._item, 1);
|
||||
if (ex <= 3)
|
||||
{
|
||||
qs2.set("Ex", "4");
|
||||
}
|
||||
if (classId == ev._classId1)
|
||||
{
|
||||
qs1.giveItems(ev._gift1, ev._count1);
|
||||
qs1.playTutorialVoice(ev._gift1 == SPIRITSHOT_NOVICE ? "tutorial_voice_027" : "tutorial_voice_026");
|
||||
}
|
||||
else if (classId == ev._classId2)
|
||||
{
|
||||
if (ev._gift2 != 0)
|
||||
{
|
||||
qs1.giveItems(ev._gift2, ev._count2);
|
||||
qs1.playTutorialVoice("tutorial_voice_026");
|
||||
}
|
||||
}
|
||||
qs1.unset("step");
|
||||
qs1.set("onlyone", "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState qs1 = player.getQuestState(qn);
|
||||
QuestState qs2 = player.getQuestState(qnTutorial);
|
||||
if (qs1 == null)
|
||||
{
|
||||
qs1 = newQuestState(player);
|
||||
}
|
||||
|
||||
if ((qs2 == null) || Config.DISABLE_TUTORIAL)
|
||||
{
|
||||
npc.showChatWindow(player);
|
||||
return null;
|
||||
}
|
||||
|
||||
int npcId = npc.getNpcId();
|
||||
int level = player.getLevel();
|
||||
boolean isMage = player.isMageClass();
|
||||
boolean isOrcMage = player.getClassId().getId() == 49;
|
||||
|
||||
int npcTyp = 0, raceId = 0, item = 0;
|
||||
String[] htmlfiles = {};
|
||||
Talk talk = _talks.get(npcId);
|
||||
try
|
||||
{
|
||||
if (talk != null)
|
||||
{
|
||||
raceId = talk._raceId;
|
||||
htmlfiles = talk._htmlfiles;
|
||||
npcTyp = talk._npcTyp;
|
||||
item = talk._item;
|
||||
}
|
||||
if (((level >= 10) || (qs1.getInt("onlyone") == 1)) && (npcTyp == 1))
|
||||
{
|
||||
htmltext = "newbiehelper_03.htm";
|
||||
}
|
||||
else if ((qs1.getInt("onlyone") == 0) && (level < 10))
|
||||
{
|
||||
if (player.getRace().ordinal() == raceId)
|
||||
{
|
||||
htmltext = htmlfiles[0];
|
||||
if (npcTyp == 1)
|
||||
{
|
||||
if ((qs1.getInt("step") == 0) && (qs2.get("Ex") == null))
|
||||
{
|
||||
qs2.set("Ex", "0");
|
||||
qs1.set("step", "1");
|
||||
startQuestTimer("TimerEx_NewbieHelper", 30000, null, player, false);
|
||||
htmltext = !isMage ? "newbiehelper_fig_01.htm" : isOrcMage ? "newbiehelper_mage_01a.htm" : "newbiehelper_mage_01.htm";
|
||||
qs1.setState(State.STARTED);
|
||||
}
|
||||
else if ((qs1.getInt("step") == 1) && (qs2.getInt("Ex") <= 2) && (qs1.getQuestItemsCount(item) == 0))
|
||||
{
|
||||
if (qs1.hasAtLeastOneQuestItem(BLUE_GEM))
|
||||
{
|
||||
qs1.takeItems(BLUE_GEM, -1);
|
||||
qs1.giveItems(item, 1);
|
||||
qs1.set("step", "2");
|
||||
qs2.set("ucMemo", "3");
|
||||
qs2.set("Ex", "3");
|
||||
startQuestTimer("TimerEx_NewbieHelper", 30000, null, player, false);
|
||||
if (isMage && !isOrcMage)
|
||||
{
|
||||
qs1.playTutorialVoice("tutorial_voice_027");
|
||||
qs1.giveItems(SPIRITSHOT_NOVICE, 100);
|
||||
htmltext = htmlfiles[2];
|
||||
if (htmltext.equalsIgnoreCase(""))
|
||||
{
|
||||
htmltext = "<html><body>I am sorry. I only help warriors. Please go to another Newbie Helper who may assist you.</body></html>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qs1.playTutorialVoice("tutorial_voice_026");
|
||||
qs1.giveItems(SOULSHOT_NOVICE, 200);
|
||||
htmltext = htmlfiles[1];
|
||||
if (htmltext.equalsIgnoreCase(""))
|
||||
{
|
||||
htmltext = "<html><body>I am sorry. I only help mystics. Please go to another Newbie Helper who may assist you.</body></html>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = !isMage ? "newbiehelper_fig_02.htm" : isOrcMage ? "newbiehelper_mage_02a.htm" : "newbiehelper_mage_02.htm";
|
||||
}
|
||||
}
|
||||
else if (qs1.getInt("step") == 2)
|
||||
{
|
||||
htmltext = htmlfiles[3];
|
||||
}
|
||||
}
|
||||
else if (npcTyp == 0)
|
||||
{
|
||||
int step = qs1.getInt("step");
|
||||
if (step == 1)
|
||||
{
|
||||
htmltext = htmlfiles[0];
|
||||
}
|
||||
else if (step == 2)
|
||||
{
|
||||
htmltext = htmlfiles[1];
|
||||
}
|
||||
else if (step == 3)
|
||||
{
|
||||
htmltext = htmlfiles[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npcId >= 30598) && (npcId <= 30602))
|
||||
{
|
||||
if ((qs2.getInt("reward") == 0) && (qs1.getInt("onlyone") == 1))
|
||||
{
|
||||
qs1.playTutorialVoice(isMage && !isOrcMage ? "tutorial_voice_027" : "tutorial_voice_026");
|
||||
qs1.giveItems(isMage && !isOrcMage ? SPIRITSHOT_NOVICE : SOULSHOT_NOVICE, isMage && !isOrcMage ? 100 : 200);
|
||||
qs1.giveItems(TOKEN, 12);
|
||||
if (Rnd.get(100) < 50)
|
||||
{
|
||||
qs1.giveItems(SCROLL, 2);
|
||||
}
|
||||
qs2.set("reward", "1");
|
||||
qs1.setState(State.COMPLETED);
|
||||
}
|
||||
npc.showChatWindow(player);
|
||||
return null;
|
||||
}
|
||||
else if ((npcTyp == 0) && (qs1.getState() == State.COMPLETED))
|
||||
{
|
||||
htmltext = "" + npcId + "-04.htm";
|
||||
}
|
||||
if ((htmltext == null) || htmltext.equalsIgnoreCase(""))
|
||||
{
|
||||
npc.showChatWindow(player);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// TODO: do nothing
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet)
|
||||
{
|
||||
final QuestState qs1 = player.getQuestState(qn);
|
||||
final QuestState qs2 = player.getQuestState(qnTutorial);
|
||||
if ((qs1 == null) || (qs2 == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final int ex = qs2.getInt("Ex");
|
||||
if (ex <= 1)
|
||||
{
|
||||
qs1.setState(State.STARTED);
|
||||
qs2.playTutorialVoice("tutorial_voice_011");
|
||||
qs2.showQuestionMark(3);
|
||||
qs2.set("Ex", "2");
|
||||
}
|
||||
else if ((ex <= 2) && (qs1.getState() == State.STARTED) && (qs2.getInt("Gemstone") == 0) && (Rnd.get(100) < 50))
|
||||
{
|
||||
((MonsterInstance) npc).DropItem(player, BLUE_GEM, 1);
|
||||
qs1.playSound("ItemSound.quest_tutorial");
|
||||
qs1.set("step", "1");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new NewbieHelper();
|
||||
}
|
||||
}
|
3
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/newbiehelper_03.htm
vendored
Normal file
3
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/NewbieHelper/newbiehelper_03.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
I've taught you all I can, my child. Go now, out into the world! Live every day like it was your last! It very well might be!
|
||||
</body></html>
|
@@ -0,0 +1,7 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Welcome! Are you ready for a mission?<br>
|
||||
Have you seen the Gremlins around here? They've stolen the precious Blue Gemstone!<br>
|
||||
<font color="LEVEL">You must recover it from them! </font><br>
|
||||
Place your cursor over a Gremlin and click the <font color="FF0000">left button</font>. The cursor will change to a sword. Click again to attack.<img src="L2UI_CH3.tutorial_img12" width=64 height=64><br>
|
||||
Complete this mission and I'll reward you with useful items. Good luck!
|
||||
</body></html>
|
@@ -0,0 +1,5 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Did you forget what to do? Get a blue gem! <font color="LEVEL">You must kill Gremlins to get a blue gem.</font> <br>
|
||||
Kill, kill, kill the Gremlins! Put your cursor over a Gremlin and click the <font color="FF0000">left mouse button</font>. It turns into a knife. Left-click again to slice up the Gremlin!<img src="L2UI_CH3.tutorial_img12" width=64 height=64><br>
|
||||
Do it quick and I'll give you something cool.
|
||||
</body></html>
|
@@ -0,0 +1,8 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Welcome! Are you ready for a mission?<br>
|
||||
Have you seen the gremlins around here? They've stolen the precious blue gemstone!<br>
|
||||
<font color="LEVEL">You must recover it from them! </font><br>
|
||||
I'll tell you again how to kill the gremlins. Place your cursor over a gremlin and click the <font color="FF0000">left button</font>. The cursor will change to a sword. Click the <font color="FF0000">F2 key</font> to attack with<font color="LEVEL"> Wind Strike</font> magic.<br>
|
||||
<img src="L2UI_CH3.tutorial_img12" width=64 height=64><table border=0><tr><td><img src="L2UI_CH3.tutorial_img133" width=64 height=64></td><td><img src="L2UI_CH3.tutorial_img16" width=64 height=64></td></tr></table><br>
|
||||
Complete this mission and I'll reward you with useful items. Good luck!
|
||||
</body></html>
|
@@ -0,0 +1,8 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Welcome! Are you ready for a mission? <br>
|
||||
Have you seen the Gremlins around here? They've stolen the precious Blue Gemstone!<br>
|
||||
<font color="LEVEL">You must recover it from them! </font><br>
|
||||
Place your cursor over a Gremlin and click the <font color="FF0000">left button</font>. The cursor will change to a sword. Click the left button again to attack.<img src="L2UI_CH3.tutorial_img12" width=64 height=64><br>
|
||||
Before striking, to enhance the strength of your attack, use <font color="LEVEL">Soul Cry</font> magic by clicking the <font color="FF0000">F2 key</font>. Click it again to turn off the magic.<table border=0><tr><td><img src="L2UI_CH3.tutorial_img133" width=64 height=64></td><td><img src="L2UI_CH3.tutorial_img17" width=64 height=64></td></tr></table><br>
|
||||
You shall be well-rewarded for your efforts. Good luck.
|
||||
</body></html>
|
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Did you forget what to do? Get a blue gem! <font color="LEVEL">You must kill Gremlins to get a blue gem.</font> <br>
|
||||
Kill, kill, kill the Gremlins! Put your cursor over a Gremlin and click the <font color="FF0000">left mouse button</font>. It turns into a knife. Press the <font color="FF0000">F2 key</font> to attack using <font color="LEVEL">wind strike</font> magic.<br>
|
||||
<img src="L2UI_CH3.tutorial_img12" width=64 height=64><table border=0><tr><td><img src="L2UI_CH3.tutorial_img133" width=64 height=64></td><td><img src="L2UI_CH3.tutorial_img16" width=64 height=64></td></tr></table><br>
|
||||
Do it quick and I'll give you something you'll need later.
|
||||
</body></html>
|
@@ -0,0 +1,6 @@
|
||||
<html><body>Newbie Helper:<br>
|
||||
Go and get a blue gem! <font color="LEVEL">Don't you remember? You've got to kill Gremlins!</font> <br>
|
||||
As I said, move your cursor over a Gremlin and click the <font color="FF0000">left mouse button</font>. This will transform the cursor into the shape of a knife. Click the left mouse button again to attack. <img src="L2UI_CH3.tutorial_img12" width=64 height=64><br>
|
||||
Use <font color="LEVEL">Soul Cry</font> magic before attacking. This will improve your chances greatly. To activate Soul Cry magic, press <font color="FF0000">F2 key</font>, and again to de-activate it.<table border=0><tr><td><img src="L2UI_CH3.tutorial_img133" width=64 height=64></td><td><img src="L2UI_CH3.tutorial_img17" width=64 height=64></td></tr></table><br>
|
||||
Do this and you shall be well-rewarded. Good luck!
|
||||
</body></html>
|
@@ -0,0 +1 @@
|
||||
<html><head><body>
|
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/OlMahumGeneral.java
vendored
Normal file
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/OlMahumGeneral.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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class OlMahumGeneral extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int OL_MAHUM_GENERAL = 20438;
|
||||
|
||||
private OlMahumGeneral()
|
||||
{
|
||||
super(-1, "OlMahumGeneral", "ai/others");
|
||||
|
||||
addAttackId(OL_MAHUM_GENERAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 10)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "We shall see about that!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "I will definitely repay this humiliation!"));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new OlMahumGeneral();
|
||||
}
|
||||
}
|
100
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/RetreatOnAttack.java
vendored
Normal file
100
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/RetreatOnAttack.java
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.position.Location;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class RetreatOnAttack extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int EPLY = 20432;
|
||||
private static final int OL_MAHUM_GUARD = 20058;
|
||||
// Misc
|
||||
private static final String[] OL_MAHUM_GUARD_TEXT =
|
||||
{
|
||||
"I'll be back!",
|
||||
"You are stronger than expected..."
|
||||
};
|
||||
|
||||
private RetreatOnAttack()
|
||||
{
|
||||
super(-1, "RetreatOnAttack", "ai/others");
|
||||
|
||||
addAttackId(EPLY, OL_MAHUM_GUARD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (event.equals("Retreat") && (npc != null) && (player != null))
|
||||
{
|
||||
npc.setIsAfraid(false);
|
||||
((Attackable) npc).addDamageHate(player, 0, 100);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
if ((npcId == EPLY) || ((npc.getStatus().getCurrentHp() <= ((npc.getMaxHp() * 50) / 100)) && (Rnd.get(100) < 10)))
|
||||
{
|
||||
if (npcId == OL_MAHUM_GUARD)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), OL_MAHUM_GUARD_TEXT[Rnd.get(OL_MAHUM_GUARD_TEXT.length)]));
|
||||
}
|
||||
int posX = npc.getX();
|
||||
int posY = npc.getY();
|
||||
int posZ = npc.getZ();
|
||||
int signX = -500;
|
||||
int signY = -500;
|
||||
if (npc.getX() > attacker.getX())
|
||||
{
|
||||
signX = 500;
|
||||
}
|
||||
if (npc.getY() > attacker.getY())
|
||||
{
|
||||
signY = 500;
|
||||
}
|
||||
posX = posX + signX;
|
||||
posY = posY + signY;
|
||||
npc.setIsAfraid(true);
|
||||
npc.setRunning();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, posZ));
|
||||
startQuestTimer("Retreat", 10000, npc, attacker);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new RetreatOnAttack();
|
||||
}
|
||||
}
|
59
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/ScarletStakatoNoble.java
vendored
Normal file
59
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/ScarletStakatoNoble.java
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class ScarletStakatoNoble extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final int SCARLET_STAKATO_NOBLE = 21378;
|
||||
private static final int SCARLET_STAKATO_NOBLE_B = 21652;
|
||||
|
||||
private ScarletStakatoNoble()
|
||||
{
|
||||
super(-1, "ScarletStakatoNoble", "ai/others");
|
||||
|
||||
addKillId(SCARLET_STAKATO_NOBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
if (Rnd.get(100) < 20)
|
||||
{
|
||||
addSpawn(SCARLET_STAKATO_NOBLE_B, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
|
||||
addSpawn(SCARLET_STAKATO_NOBLE_B, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
|
||||
addSpawn(SCARLET_STAKATO_NOBLE_B, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
|
||||
addSpawn(SCARLET_STAKATO_NOBLE_B, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
|
||||
addSpawn(SCARLET_STAKATO_NOBLE_B, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 0);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ScarletStakatoNoble();
|
||||
}
|
||||
}
|
95
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Splendor.java
vendored
Normal file
95
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Splendor.java
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class Splendor extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private static final Map<Integer, List<Integer>> NPCS = new HashMap<>();
|
||||
static
|
||||
{
|
||||
// Npc, [NewNpc,% for chance by shot,ModeSpawn]
|
||||
// Modespawn 1=> delete and spawn the new npc
|
||||
// Modespawn 2=> just add 1 spawn
|
||||
// if Quest_Drop = 5 => 25% by shot to change mob
|
||||
NPCS.put(21521, Arrays.asList(21522, 5, 1)); // Claw of Splendor
|
||||
NPCS.put(21524, Arrays.asList(21525, 5, 1)); // Blade of Splendor
|
||||
NPCS.put(21527, Arrays.asList(21528, 5, 1)); // Anger of Splendor
|
||||
NPCS.put(21537, Arrays.asList(21538, 5, 1)); // Fang of Splendor
|
||||
NPCS.put(21539, Arrays.asList(21540, 100, 2)); // Wailing of Splendor
|
||||
}
|
||||
|
||||
private Splendor()
|
||||
{
|
||||
super(-1, "Splendor", "ai/others");
|
||||
|
||||
for (int npcId : NPCS.keySet())
|
||||
{
|
||||
addAttackId(npcId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final List<Integer> npcData = NPCS.get(npc.getNpcId());
|
||||
if (Rnd.get(100) < (npcData.get(1) * Config.RATE_DROP_QUEST))
|
||||
{
|
||||
if (npcData.get(2) == 1)
|
||||
{
|
||||
npc.deleteMe();
|
||||
final MonsterInstance newNpc = (MonsterInstance) addSpawn(npcData.get(0), npc);
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
else if (npc.isScriptValue(1))
|
||||
{
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
else if (npcData.get(2) == 2)
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
final MonsterInstance newNpc = (MonsterInstance) addSpawn(npcData.get(0), npc);
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Splendor();
|
||||
}
|
||||
}
|
274
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/SummonMinions.java
vendored
Normal file
274
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/SummonMinions.java
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
public class SummonMinions extends Quest
|
||||
{
|
||||
private static int HasSpawned;
|
||||
private static Set<Integer> myTrackingSet = new CopyOnWriteArraySet<>(); // Used to track instances of npcs
|
||||
private final Map<Integer, List<PlayerInstance>> _attackersList = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, Integer[]> MINIONS = new HashMap<>();
|
||||
static
|
||||
{
|
||||
MINIONS.put(20767, new Integer[]
|
||||
{
|
||||
20768,
|
||||
20769,
|
||||
20770
|
||||
}); // Timak Orc Troop
|
||||
// MINIONS.put(22030, new Integer[]{22045, 22047, 22048}); //Ragna Orc Shaman
|
||||
// MINIONS.put(22032, new Integer[]{22036}); //Ragna Orc Warrior - summons shaman but not 22030 ><
|
||||
// MINIONS.put(22038, new Integer[]{22037}); //Ragna Orc Hero
|
||||
MINIONS.put(21524, new Integer[]
|
||||
{
|
||||
21525
|
||||
}); // Blade of Splendor
|
||||
MINIONS.put(21531, new Integer[]
|
||||
{
|
||||
21658
|
||||
}); // Punishment of Splendor
|
||||
MINIONS.put(21539, new Integer[]
|
||||
{
|
||||
21540
|
||||
}); // Wailing of Splendor
|
||||
MINIONS.put(22257, new Integer[]
|
||||
{
|
||||
18364,
|
||||
18364
|
||||
}); // Island Guardian
|
||||
MINIONS.put(22258, new Integer[]
|
||||
{
|
||||
18364,
|
||||
18364
|
||||
}); // White Sand Mirage
|
||||
MINIONS.put(22259, new Integer[]
|
||||
{
|
||||
18364,
|
||||
18364
|
||||
}); // Muddy Coral
|
||||
MINIONS.put(22260, new Integer[]
|
||||
{
|
||||
18364,
|
||||
18364
|
||||
}); // Kleopora
|
||||
MINIONS.put(22261, new Integer[]
|
||||
{
|
||||
18365,
|
||||
18365
|
||||
}); // Seychelles
|
||||
MINIONS.put(22262, new Integer[]
|
||||
{
|
||||
18365,
|
||||
18365
|
||||
}); // Naiad
|
||||
MINIONS.put(22263, new Integer[]
|
||||
{
|
||||
18365,
|
||||
18365
|
||||
}); // Sonneratia
|
||||
MINIONS.put(22264, new Integer[]
|
||||
{
|
||||
18366,
|
||||
18366
|
||||
}); // Castalia
|
||||
MINIONS.put(22265, new Integer[]
|
||||
{
|
||||
18366,
|
||||
18366
|
||||
}); // Chrysocolla
|
||||
MINIONS.put(22266, new Integer[]
|
||||
{
|
||||
18366,
|
||||
18366
|
||||
}); // Pythia
|
||||
}
|
||||
|
||||
public SummonMinions(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
final int[] mobs =
|
||||
{
|
||||
20767,
|
||||
21524,
|
||||
21531,
|
||||
21539,
|
||||
22257,
|
||||
22258,
|
||||
22259,
|
||||
22260,
|
||||
22261,
|
||||
22262,
|
||||
22263,
|
||||
22264,
|
||||
22265,
|
||||
22266
|
||||
};
|
||||
|
||||
for (int mob : mobs)
|
||||
{
|
||||
addEventId(mob, Quest.QuestEventType.ON_KILL);
|
||||
addEventId(mob, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (MINIONS.containsKey(npcId))
|
||||
{
|
||||
if (!myTrackingSet.contains(npcObjId)) // this allows to handle multiple instances of npc
|
||||
{
|
||||
myTrackingSet.add(npcObjId);
|
||||
HasSpawned = npcObjId;
|
||||
}
|
||||
if (HasSpawned == npcObjId)
|
||||
{
|
||||
if ((npcId == 22030) || (npcId == 22032) || (npcId == 22038)) // mobs that summon minions only on certain hp
|
||||
{
|
||||
if (npc.getStatus().getCurrentHp() < (npc.getMaxHp() / 2))
|
||||
{
|
||||
HasSpawned = 0;
|
||||
if (Rnd.get(100) < 33) // mobs that summon minions only on certain chance
|
||||
{
|
||||
Integer[] minions = MINIONS.get(npcId);
|
||||
for (Integer minion : minions)
|
||||
{
|
||||
final Attackable newNpc = (Attackable) addSpawn(minion, (npc.getX() + Rnd.get(-150, 150)), (npc.getY() + Rnd.get(-150, 150)), npc.getZ(), 0, false, 0);
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npcId == 22257) || (npcId == 22258) || (npcId == 22259) || (npcId == 22260) || (npcId == 22261) || (npcId == 22262) || (npcId == 22263) || (npcId == 22264) || (npcId == 22265) || (npcId == 22266))
|
||||
{
|
||||
if (isPet)
|
||||
{
|
||||
attacker = attacker.getPet().getOwner();
|
||||
}
|
||||
if (attacker.getParty() != null)
|
||||
{
|
||||
for (PlayerInstance member : attacker.getParty().getPartyMembers())
|
||||
{
|
||||
if (_attackersList.get(npcObjId) == null)
|
||||
{
|
||||
final List<PlayerInstance> player = new ArrayList<>();
|
||||
player.add(member);
|
||||
_attackersList.put(npcObjId, player);
|
||||
}
|
||||
else if (!_attackersList.get(npcObjId).contains(member))
|
||||
{
|
||||
_attackersList.get(npcObjId).add(member);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_attackersList.get(npcObjId) == null)
|
||||
{
|
||||
final List<PlayerInstance> player = new ArrayList<>();
|
||||
player.add(attacker);
|
||||
_attackersList.put(npcObjId, player);
|
||||
}
|
||||
else if (!_attackersList.get(npcObjId).contains(attacker))
|
||||
{
|
||||
_attackersList.get(npcObjId).add(attacker);
|
||||
}
|
||||
if (((attacker.getParty() != null) && (attacker.getParty().getMemberCount() > 2)) || (_attackersList.get(npcObjId).size() > 2)) // Just to make sure..
|
||||
{
|
||||
HasSpawned = 0;
|
||||
Integer[] minions = MINIONS.get(npcId);
|
||||
for (Integer minion : minions)
|
||||
{
|
||||
final Attackable newNpc = (Attackable) addSpawn(minion, npc.getX() + Rnd.get(-150, 150), npc.getY() + Rnd.get(-150, 150), npc.getZ(), 0, false, 0);
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
// mobs without special conditions
|
||||
{
|
||||
HasSpawned = 0;
|
||||
Integer[] minions = MINIONS.get(npcId);
|
||||
if (npcId != 20767)
|
||||
{
|
||||
for (Integer minion : minions)
|
||||
{
|
||||
final Attackable newNpc = (Attackable) addSpawn(minion, npc.getX() + Rnd.get(-150, 150), npc.getY() + Rnd.get(-150, 150), npc.getZ(), 0, false, 0);
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(attacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Integer minion : minions)
|
||||
{
|
||||
addSpawn(minion, (npc.getX() + Rnd.get(-100, 100)), (npc.getY() + Rnd.get(-100, 100)), npc.getZ(), 0, false, 0);
|
||||
}
|
||||
}
|
||||
if (npcId == 20767)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npcObjId, 0, npc.getName(), "Come out, you children of darkness!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_attackersList.get(npcObjId) != null)
|
||||
{
|
||||
_attackersList.get(npcObjId).clear();
|
||||
}
|
||||
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
final int npcId = npc.getNpcId();
|
||||
final int npcObjId = npc.getObjectId();
|
||||
if (MINIONS.containsKey(npcId))
|
||||
{
|
||||
myTrackingSet.remove(npcObjId);
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonMinions(-1, "SummonMinions", "ai");
|
||||
}
|
||||
}
|
62
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcOverlord.java
vendored
Normal file
62
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcOverlord.java
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class TimakOrcOverlord extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int TIMAK_ORC_OVERLORD = 20588;
|
||||
|
||||
private TimakOrcOverlord()
|
||||
{
|
||||
super(-1, "TimakOrcOverlord", "ai/others");
|
||||
|
||||
addAttackId(TIMAK_ORC_OVERLORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 50)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Dear ultimate power!!!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TimakOrcOverlord();
|
||||
}
|
||||
}
|
62
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcTroopLeader.java
vendored
Normal file
62
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcTroopLeader.java
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class TimakOrcTroopLeader extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int TIMAK_ORC_TROOP_LEADER = 20767;
|
||||
|
||||
private TimakOrcTroopLeader()
|
||||
{
|
||||
super(-1, "TimakOrcTroopLeader", "ai/others");
|
||||
|
||||
addAttackId(TIMAK_ORC_TROOP_LEADER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 50)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Destroy the enemy, my brothers!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TimakOrcTroopLeader();
|
||||
}
|
||||
}
|
233
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Transform.java
vendored
Normal file
233
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Transform.java
vendored
Normal file
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* 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.others;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
public class Transform extends Quest
|
||||
{
|
||||
private final ArrayList<Transformer> _mobs = new ArrayList<>();
|
||||
|
||||
private static class Transformer
|
||||
{
|
||||
private final int _id;
|
||||
private final int _idPoly;
|
||||
private final int _chance;
|
||||
private final int _message;
|
||||
|
||||
protected Transformer(int id, int idPoly, int chance, int message)
|
||||
{
|
||||
_id = id;
|
||||
_idPoly = idPoly;
|
||||
_chance = chance;
|
||||
_message = message;
|
||||
}
|
||||
|
||||
protected int getId()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
protected int getIdPoly()
|
||||
{
|
||||
return _idPoly;
|
||||
}
|
||||
|
||||
protected int getChance()
|
||||
{
|
||||
return _chance;
|
||||
}
|
||||
|
||||
protected int getMessage()
|
||||
{
|
||||
return _message;
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] Message =
|
||||
{
|
||||
"I cannot despise the fellow! I see his sincerity in the duel.",
|
||||
"Nows we truly begin!",
|
||||
"Fool! Right now is only practice!",
|
||||
"Have a look at my true strength.",
|
||||
"This time at the last! The end!"
|
||||
};
|
||||
|
||||
public Transform(int questId, String name, String descr)
|
||||
{
|
||||
super(questId, name, descr);
|
||||
|
||||
_mobs.add(new Transformer(21261, 21262, 1, 5)); // 1st mutation Ol Mahum Transcender
|
||||
_mobs.add(new Transformer(21262, 21263, 1, 5)); // 2st mutation Ol Mahum Transcender
|
||||
_mobs.add(new Transformer(21263, 21264, 1, 5)); // 3rd mutation Ol Mahum Transcender
|
||||
_mobs.add(new Transformer(21258, 21259, 100, 5)); // always mutation on atk Fallen Orc Shaman
|
||||
_mobs.add(new Transformer(20835, 21608, 1, 5)); // zaken's seer to zaken's watchman
|
||||
_mobs.add(new Transformer(21608, 21609, 1, 5)); // zaken's watchman
|
||||
_mobs.add(new Transformer(20832, 21602, 1, 5)); // Zaken's pikeman
|
||||
_mobs.add(new Transformer(21602, 21603, 1, 5)); // Zaken's pikeman
|
||||
_mobs.add(new Transformer(20833, 21605, 1, 5)); // Zaken's archet
|
||||
_mobs.add(new Transformer(21605, 21606, 1, 5)); // Zaken's archet
|
||||
_mobs.add(new Transformer(21625, 21623, 1, 5)); // zaken's Elite Guard to zaken's Guard
|
||||
_mobs.add(new Transformer(21623, 21624, 1, 5)); // zaken's Guard
|
||||
_mobs.add(new Transformer(20842, 21620, 1, 5)); // Musveren
|
||||
_mobs.add(new Transformer(21620, 21621, 1, 5)); // Musveren
|
||||
_mobs.add(new Transformer(20830, 20859, 100, 0)); //
|
||||
_mobs.add(new Transformer(21067, 21068, 100, 0)); //
|
||||
_mobs.add(new Transformer(21062, 21063, 100, 0)); // Angels
|
||||
_mobs.add(new Transformer(20831, 20860, 100, 0)); //
|
||||
_mobs.add(new Transformer(21070, 21071, 100, 0)); //
|
||||
|
||||
final int[] mobsKill =
|
||||
{
|
||||
20830,
|
||||
21067,
|
||||
21062,
|
||||
20831,
|
||||
21070
|
||||
};
|
||||
|
||||
for (int mob : mobsKill)
|
||||
{
|
||||
addEventId(mob, Quest.QuestEventType.ON_KILL);
|
||||
}
|
||||
|
||||
final int[] mobsAttack =
|
||||
{
|
||||
21620,
|
||||
20842,
|
||||
21623,
|
||||
21625,
|
||||
21605,
|
||||
20833,
|
||||
21602,
|
||||
20832,
|
||||
21608,
|
||||
20835,
|
||||
21258
|
||||
};
|
||||
|
||||
for (int mob : mobsAttack)
|
||||
{
|
||||
addEventId(mob, Quest.QuestEventType.ON_ATTACK);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
for (Transformer monster : _mobs)
|
||||
{
|
||||
if (npc.getNpcId() == monster.getId())
|
||||
{
|
||||
if (Rnd.get(100) <= (monster.getChance() * Config.RATE_DROP_QUEST))
|
||||
{
|
||||
if (monster.getMessage() != 0)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), Message[Rnd.get(monster.getMessage())]));
|
||||
}
|
||||
npc.onDecay();
|
||||
final Attackable newNpc = (Attackable) addSpawn(monster.getIdPoly(), npc);
|
||||
final Creature originalAttacker = isPet ? attacker.getPet() : attacker;
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(originalAttacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalAttacker);
|
||||
|
||||
// NPC Spawn Effect L2OFF
|
||||
final NPCSpawnTask spawnEffectTask = new NPCSpawnTask(newNpc, 4000, 800000);
|
||||
final Thread effectThread = new Thread(spawnEffectTask);
|
||||
effectThread.start();
|
||||
|
||||
// Like L2OFF auto target new mob (like an aggression)
|
||||
originalAttacker.setTargetTrasformedNpc(newNpc);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
|
||||
{
|
||||
for (Transformer monster : _mobs)
|
||||
{
|
||||
if (npc.getNpcId() == monster.getId())
|
||||
{
|
||||
if (monster.getMessage() != 0)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), Message[Rnd.get(monster.getMessage())]));
|
||||
}
|
||||
final Attackable newNpc = (Attackable) addSpawn(monster.getIdPoly(), npc);
|
||||
final Creature originalAttacker = isPet ? killer.getPet() : killer;
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(originalAttacker, 0, 999);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalAttacker);
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, killer, isPet);
|
||||
}
|
||||
|
||||
private class NPCSpawnTask implements Runnable
|
||||
{
|
||||
private final NpcInstance spawn;
|
||||
private final long spawnEffectTime;
|
||||
private final int spawnAbnormalEffect;
|
||||
|
||||
/**
|
||||
* @param spawn
|
||||
* @param spawnEffectTime
|
||||
* @param spawnAbnormalEffect
|
||||
*/
|
||||
public NPCSpawnTask(NpcInstance spawn, long spawnEffectTime, int spawnAbnormalEffect)
|
||||
{
|
||||
super();
|
||||
this.spawn = spawn;
|
||||
this.spawnEffectTime = spawnEffectTime;
|
||||
this.spawnAbnormalEffect = Integer.decode("0x" + spawnAbnormalEffect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
spawn.startAbnormalEffect(spawnAbnormalEffect);
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(spawnEffectTime);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
}
|
||||
|
||||
spawn.stopAbnormalEffect(spawnAbnormalEffect);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Transform(-1, "transform", "ai");
|
||||
}
|
||||
}
|
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcFootman.java
vendored
Normal file
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcFootman.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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class TurekOrcFootman extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int TUREK_ORC_FOOTMAN = 20499;
|
||||
|
||||
private TurekOrcFootman()
|
||||
{
|
||||
super(-1, "TurekOrcFootman", "ai/others");
|
||||
|
||||
addAttackId(TUREK_ORC_FOOTMAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "There is no reason for you to kill me! I have nothing you need!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "We shall see about that!"));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TurekOrcFootman();
|
||||
}
|
||||
}
|
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcSupplier.java
vendored
Normal file
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcSupplier.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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class TurekOrcSupplier extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int TUREK_ORC_SUPPLIER = 20498;
|
||||
|
||||
private TurekOrcSupplier()
|
||||
{
|
||||
super(-1, "TurekOrcFootman", "ai/others");
|
||||
|
||||
addAttackId(TUREK_ORC_SUPPLIER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You wont take me down easily."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "We shall see about that!"));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TurekOrcSupplier();
|
||||
}
|
||||
}
|
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcWarlord.java
vendored
Normal file
63
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcWarlord.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.others;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
* @note Based on python script
|
||||
*/
|
||||
public class TurekOrcWarlord extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int TUREK_ORC_WARLORD = 20495;
|
||||
|
||||
private TurekOrcWarlord()
|
||||
{
|
||||
super(-1, "TurekOrcWarlord", "ai/others");
|
||||
|
||||
addAttackId(TUREK_ORC_WARLORD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
|
||||
{
|
||||
if (npc.isScriptValue(1))
|
||||
{
|
||||
if (Rnd.get(100) < 40)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You wont take me down easily."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "The battle has just begun!"));
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isPet);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TurekOrcWarlord();
|
||||
}
|
||||
}
|
712
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/Tutorial.java
vendored
Normal file
712
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/Tutorial.java
vendored
Normal file
@@ -0,0 +1,712 @@
|
||||
/*
|
||||
* 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.others.Tutorial;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.Quest;
|
||||
import org.l2jmobius.gameserver.model.quest.QuestState;
|
||||
|
||||
public class Tutorial extends Quest
|
||||
{
|
||||
// @formatter:off
|
||||
// table for Quest Timer ( Ex == -2 ) [raceId, voice, html]
|
||||
private static final String[][] QTEXMTWO =
|
||||
{
|
||||
{"0", "tutorial_voice_001a", "tutorial_human_fighter001.htm"},
|
||||
{"10", "tutorial_voice_001b", "tutorial_human_mage001.htm"},
|
||||
{"18", "tutorial_voice_001c", "tutorial_elven_fighter001.htm"},
|
||||
{"25", "tutorial_voice_001d", "tutorial_elven_mage001.htm"},
|
||||
{"31", "tutorial_voice_001e", "tutorial_delf_fighter001.htm"},
|
||||
{"38", "tutorial_voice_001f", "tutorial_delf_mage001.htm"},
|
||||
{"44", "tutorial_voice_001g", "tutorial_orc_fighter001.htm"},
|
||||
{"49", "tutorial_voice_001h", "tutorial_orc_mage001.htm"},
|
||||
{"53", "tutorial_voice_001i", "tutorial_dwarven_fighter001.htm"}
|
||||
};
|
||||
// table for Client Event Enable (8) [raceId, html, x, y, z]
|
||||
private static final String[][] CEEa =
|
||||
{
|
||||
{"0", "tutorial_human_fighter007.htm", "-71424", "258336", "-3109"},
|
||||
{"10", "tutorial_human_mage007.htm", "-91036", "248044", "-3568"},
|
||||
{"18", "tutorial_elf007.htm", "46112", "41200", "-3504"},
|
||||
{"25", "tutorial_elf007.htm", "46112", "41200", "-3504"},
|
||||
{"31", "tutorial_delf007.htm", "28384", "11056", "-4233"},
|
||||
{"38", "tutorial_delf007.htm", "28384", "11056", "-4233"},
|
||||
{"44", "tutorial_orc007.htm", "-56736", "-113680", "-672"},
|
||||
{"49", "tutorial_orc007.htm", "-56736", "-113680", "-672"},
|
||||
{"53", "tutorial_dwarven_fighter007.htm", "108567", "-173994", "-406"}
|
||||
};
|
||||
// table for Question Mark Clicked (9 & 11) learning skills [raceId, html, x, y, z]
|
||||
private static final String[][] QMCa =
|
||||
{
|
||||
{"0", "tutorial_fighter017.htm", "-83165", "242711", "-3720"},
|
||||
{"10", "tutorial_mage017.htm", "-85247", "244718", "-3720"},
|
||||
{"18", "tutorial_fighter017.htm", "45610", "52206", "-2792"},
|
||||
{"25", "tutorial_mage017.htm", "45610", "52206", "-2792"},
|
||||
{"31", "tutorial_fighter017.htm", "10344", "14445", "-4242"},
|
||||
{"38", "tutorial_mage017.htm", "10344", "14445", "-4242"},
|
||||
{"44", "tutorial_fighter017.htm", "-46324", "-114384", "-200"},
|
||||
{"49", "tutorial_fighter017.htm", "-46305", "-112763", "-200"},
|
||||
{"53", "tutorial_fighter017.htm", "115447", "-182672", "-1440"}
|
||||
};
|
||||
// @formatter:on
|
||||
// table for Question Mark Clicked (24) newbie lvl [raceId, html]
|
||||
private static final Map<Integer, String> QMCb = new HashMap<>();
|
||||
static
|
||||
{
|
||||
QMCb.put(0, "tutorial_human009.htm");
|
||||
QMCb.put(10, "tutorial_human009.htm");
|
||||
QMCb.put(18, "tutorial_elf009.htm");
|
||||
QMCb.put(25, "tutorial_elf009.htm");
|
||||
QMCb.put(31, "tutorial_delf009.htm");
|
||||
QMCb.put(38, "tutorial_delf009.htm");
|
||||
QMCb.put(44, "tutorial_orc009.htm");
|
||||
QMCb.put(49, "tutorial_orc009.htm");
|
||||
QMCb.put(53, "tutorial_dwarven009.htm");
|
||||
}
|
||||
// table for Question Mark Clicked (35) 1st class transfer [raceId, html]
|
||||
private static final Map<Integer, String> QMCc = new HashMap<>();
|
||||
static
|
||||
{
|
||||
QMCc.put(0, "tutorial_21.htm");
|
||||
QMCc.put(10, "tutorial_21a.htm");
|
||||
QMCc.put(18, "tutorial_21b.htm");
|
||||
QMCc.put(25, "tutorial_21c.htm");
|
||||
QMCc.put(31, "tutorial_21g.htm");
|
||||
QMCc.put(38, "tutorial_21h.htm");
|
||||
QMCc.put(44, "tutorial_21d.htm");
|
||||
QMCc.put(49, "tutorial_21e.htm");
|
||||
QMCc.put(53, "tutorial_21f.htm");
|
||||
}
|
||||
// table for Tutorial Close Link (26) 2nd class transfer [raceId, html]
|
||||
private static final Map<Integer, String> TCLa = new HashMap<>();
|
||||
static
|
||||
{
|
||||
TCLa.put(1, "tutorial_22w.htm");
|
||||
TCLa.put(4, "tutorial_22.htm");
|
||||
TCLa.put(7, "tutorial_22b.htm");
|
||||
TCLa.put(11, "tutorial_22c.htm");
|
||||
TCLa.put(15, "tutorial_22d.htm");
|
||||
TCLa.put(19, "tutorial_22e.htm");
|
||||
TCLa.put(22, "tutorial_22f.htm");
|
||||
TCLa.put(26, "tutorial_22g.htm");
|
||||
TCLa.put(29, "tutorial_22h.htm");
|
||||
TCLa.put(32, "tutorial_22n.htm");
|
||||
TCLa.put(35, "tutorial_22o.htm");
|
||||
TCLa.put(39, "tutorial_22p.htm");
|
||||
TCLa.put(42, "tutorial_22q.htm");
|
||||
TCLa.put(45, "tutorial_22i.htm");
|
||||
TCLa.put(47, "tutorial_22j.htm");
|
||||
TCLa.put(50, "tutorial_22k.htm");
|
||||
TCLa.put(54, "tutorial_22l.htm");
|
||||
TCLa.put(56, "tutorial_22m.htm");
|
||||
}
|
||||
// table for Tutorial Close Link (23) 2nd class transfer [raceId, html]
|
||||
private static final Map<Integer, String> TCLb = new HashMap<>();
|
||||
static
|
||||
{
|
||||
TCLb.put(4, "tutorial_22aa.htm");
|
||||
TCLb.put(7, "tutorial_22ba.htm");
|
||||
TCLb.put(11, "tutorial_22ca.htm");
|
||||
TCLb.put(15, "tutorial_22da.htm");
|
||||
TCLb.put(19, "tutorial_22ea.htm");
|
||||
TCLb.put(22, "tutorial_22fa.htm");
|
||||
TCLb.put(26, "tutorial_22ga.htm");
|
||||
TCLb.put(32, "tutorial_22na.htm");
|
||||
TCLb.put(35, "tutorial_22oa.htm");
|
||||
TCLb.put(39, "tutorial_22pa.htm");
|
||||
TCLb.put(50, "tutorial_22ka.htm");
|
||||
}
|
||||
// table for Tutorial Close Link (24) 2nd class transfer [raceId, html]
|
||||
private static final Map<Integer, String> TCLc = new HashMap<>();
|
||||
static
|
||||
{
|
||||
TCLc.put(4, "tutorial_22ab.htm");
|
||||
TCLc.put(7, "tutorial_22bb.htm");
|
||||
TCLc.put(11, "tutorial_22cb.htm");
|
||||
TCLc.put(15, "tutorial_22db.htm");
|
||||
TCLc.put(19, "tutorial_22eb.htm");
|
||||
TCLc.put(22, "tutorial_22fb.htm");
|
||||
TCLc.put(26, "tutorial_22gb.htm");
|
||||
TCLc.put(32, "tutorial_22nb.htm");
|
||||
TCLc.put(35, "tutorial_22ob.htm");
|
||||
TCLc.put(39, "tutorial_22pb.htm");
|
||||
TCLc.put(50, "tutorial_22kb.htm");
|
||||
}
|
||||
|
||||
private static final String qn = "Tutorial";
|
||||
|
||||
public Tutorial()
|
||||
{
|
||||
super(-1, qn, "ai/others");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
final QuestState qs = player.getQuestState(qn);
|
||||
if ((qs == null) || Config.DISABLE_TUTORIAL)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String html = "";
|
||||
|
||||
int classId = player.getClassId().getId();
|
||||
int Ex = qs.getInt("Ex");
|
||||
|
||||
if (event.startsWith("UC"))
|
||||
{
|
||||
if ((player.getLevel() < 6) && (qs.getInt("onlyone") == 0))
|
||||
{
|
||||
switch (qs.getInt("ucMemo"))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
qs.set("ucMemo", "0");
|
||||
startQuestTimer("QT", 10000, null, player, false);
|
||||
qs.set("Ex", "-2");
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
qs.showQuestionMark(1);
|
||||
qs.playTutorialVoice("tutorial_voice_006");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (Ex == 2)
|
||||
{
|
||||
qs.showQuestionMark(3);
|
||||
}
|
||||
else if (qs.getQuestItemsCount(6353) > 0)
|
||||
{
|
||||
qs.showQuestionMark(5);
|
||||
}
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
qs.showQuestionMark(12);
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.onTutorialClientEvent(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event.startsWith("QT"))
|
||||
{
|
||||
if (Ex == -2)
|
||||
{
|
||||
String voice = "";
|
||||
for (String[] element : QTEXMTWO)
|
||||
{
|
||||
if (classId == Integer.valueOf(element[0]))
|
||||
{
|
||||
voice = element[1];
|
||||
html = element[2];
|
||||
}
|
||||
}
|
||||
qs.playTutorialVoice(voice);
|
||||
qs.set("Ex", "-3");
|
||||
cancelQuestTimers("QT");
|
||||
startQuestTimer("QT", 30000, null, player, false);
|
||||
}
|
||||
else if (Ex == -3)
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_002");
|
||||
qs.set("Ex", "0");
|
||||
}
|
||||
else if (Ex == -4)
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_008");
|
||||
qs.set("Ex", "-5");
|
||||
}
|
||||
}
|
||||
// Tutorial close
|
||||
else if (event.startsWith("TE"))
|
||||
{
|
||||
cancelQuestTimers("TE");
|
||||
if (!event.equalsIgnoreCase("TE"))
|
||||
{
|
||||
switch (Integer.valueOf(event.substring(2)))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
qs.closeTutorialHtml();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
qs.closeTutorialHtml();
|
||||
qs.playTutorialVoice("tutorial_voice_006");
|
||||
qs.showQuestionMark(1);
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
startQuestTimer("QT", 30000, null, player, false);
|
||||
qs.set("Ex", "-4");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_003");
|
||||
html = "tutorial_02.htm";
|
||||
qs.onTutorialClientEvent(1);
|
||||
qs.set("Ex", "-5");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
html = "tutorial_03.htm";
|
||||
qs.onTutorialClientEvent(2);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
html = "tutorial_05.htm";
|
||||
qs.onTutorialClientEvent(8);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
html = "tutorial_100.htm";
|
||||
qs.onTutorialClientEvent(0);
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
html = "tutorial_101.htm";
|
||||
qs.onTutorialClientEvent(0);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
html = "tutorial_103.htm";
|
||||
qs.onTutorialClientEvent(0);
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
qs.closeTutorialHtml();
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
if (TCLb.containsKey(classId))
|
||||
{
|
||||
html = TCLb.get(classId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 24:
|
||||
{
|
||||
if (TCLc.containsKey(classId))
|
||||
{
|
||||
html = TCLc.get(classId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
html = "tutorial_22cc.htm";
|
||||
break;
|
||||
}
|
||||
case 26:
|
||||
{
|
||||
if (TCLa.containsKey(classId))
|
||||
{
|
||||
html = TCLa.get(classId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 27:
|
||||
{
|
||||
html = "tutorial_29.htm";
|
||||
break;
|
||||
}
|
||||
case 28:
|
||||
{
|
||||
html = "tutorial_28.htm";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Client Event
|
||||
else if (event.startsWith("CE"))
|
||||
{
|
||||
int event_id = Integer.valueOf(event.substring(2));
|
||||
if ((event_id == 1) && (player.getLevel() < 6))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_004");
|
||||
html = "tutorial_03.htm";
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.onTutorialClientEvent(2);
|
||||
}
|
||||
else if ((event_id == 2) && (player.getLevel() < 6))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_005");
|
||||
html = "tutorial_05.htm";
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.onTutorialClientEvent(8);
|
||||
}
|
||||
else if ((event_id == 8) && (player.getLevel() < 6))
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
for (String[] element : CEEa)
|
||||
{
|
||||
if (classId == Integer.valueOf(element[0]))
|
||||
{
|
||||
html = element[1];
|
||||
x = Integer.valueOf(element[2]);
|
||||
y = Integer.valueOf(element[3]);
|
||||
z = Integer.valueOf(element[4]);
|
||||
}
|
||||
}
|
||||
if (x != 0)
|
||||
{
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.addRadar(x, y, z);
|
||||
qs.playTutorialVoice("tutorial_voice_007");
|
||||
qs.set("ucMemo", "1");
|
||||
qs.set("Ex", "-5");
|
||||
}
|
||||
}
|
||||
else if ((event_id == 30) && (player.getLevel() < 10) && (qs.getInt("Die") == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_016");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("Die", "1");
|
||||
qs.showQuestionMark(8);
|
||||
qs.onTutorialClientEvent(0);
|
||||
}
|
||||
else if ((event_id == 800000) && (player.getLevel() < 6) && (qs.getInt("sit") == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_018");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("sit", "1");
|
||||
qs.onTutorialClientEvent(0);
|
||||
html = "tutorial_21z.htm";
|
||||
}
|
||||
else if (event_id == 40)
|
||||
{
|
||||
switch (player.getLevel())
|
||||
{
|
||||
case 5:
|
||||
{
|
||||
if (((qs.getInt("lvl") < 5) && !player.isMageClass()) || (classId == 49))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_014");
|
||||
qs.showQuestionMark(9);
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("lvl", "5");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
if ((qs.getInt("lvl") < 6) && (player.getClassId().level() == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_020");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.showQuestionMark(24);
|
||||
qs.set("lvl", "6");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
if ((qs.getInt("lvl") < 7) && player.isMageClass() && (classId != 49) && (player.getClassId().level() == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_019");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("lvl", "7");
|
||||
qs.showQuestionMark(11);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
if (qs.getInt("lvl") < 15)
|
||||
{
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("lvl", "15");
|
||||
qs.showQuestionMark(33);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 19:
|
||||
{
|
||||
if ((qs.getInt("lvl") < 19) && (player.getClassId().level() == 0))
|
||||
{
|
||||
switch (classId)
|
||||
{
|
||||
case 0:
|
||||
case 10:
|
||||
case 18:
|
||||
case 25:
|
||||
case 31:
|
||||
case 38:
|
||||
case 44:
|
||||
case 49:
|
||||
case 52:
|
||||
{
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("lvl", "19");
|
||||
qs.showQuestionMark(35);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 35:
|
||||
{
|
||||
if ((qs.getInt("lvl") < 35) && (player.getClassId().level() == 1))
|
||||
{
|
||||
switch (classId)
|
||||
{
|
||||
case 1:
|
||||
case 4:
|
||||
case 7:
|
||||
case 11:
|
||||
case 15:
|
||||
case 19:
|
||||
case 22:
|
||||
case 26:
|
||||
case 29:
|
||||
case 32:
|
||||
case 35:
|
||||
case 39:
|
||||
case 42:
|
||||
case 45:
|
||||
case 47:
|
||||
case 50:
|
||||
case 54:
|
||||
case 56:
|
||||
{
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("lvl", "35");
|
||||
qs.showQuestionMark(34);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((event_id == 45) && (player.getLevel() < 10) && (qs.getInt("HP") == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_017");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("HP", "1");
|
||||
qs.showQuestionMark(10);
|
||||
qs.onTutorialClientEvent(800000);
|
||||
}
|
||||
else if ((event_id == 57) && (player.getLevel() < 6) && (qs.getInt("Adena") == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_012");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("Adena", "1");
|
||||
qs.showQuestionMark(23);
|
||||
}
|
||||
else if ((event_id == 6353) && (player.getLevel() < 6) && (qs.getInt("Gemstone") == 0))
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_013");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
qs.set("Gemstone", "1");
|
||||
qs.showQuestionMark(5);
|
||||
}
|
||||
else if ((event_id == 1048576) && (player.getLevel() < 6))
|
||||
{
|
||||
qs.showQuestionMark(5);
|
||||
qs.playTutorialVoice("tutorial_voice_013");
|
||||
qs.playSound("ItemSound.quest_tutorial");
|
||||
}
|
||||
}
|
||||
// Question mark clicked
|
||||
else if (event.startsWith("QM"))
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
switch (Integer.valueOf(event.substring(2)))
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
qs.playTutorialVoice("tutorial_voice_007");
|
||||
qs.set("Ex", "-5");
|
||||
for (String[] element : CEEa)
|
||||
{
|
||||
if (classId == Integer.valueOf(element[0]))
|
||||
{
|
||||
html = element[1];
|
||||
x = Integer.valueOf(element[2]);
|
||||
y = Integer.valueOf(element[3]);
|
||||
z = Integer.valueOf(element[4]);
|
||||
}
|
||||
}
|
||||
qs.addRadar(x, y, z);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
html = "tutorial_09.htm";
|
||||
qs.onTutorialClientEvent(1048576);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
for (String[] element : CEEa)
|
||||
{
|
||||
if (classId == Integer.valueOf(element[0]))
|
||||
{
|
||||
html = element[1];
|
||||
x = Integer.valueOf(element[2]);
|
||||
y = Integer.valueOf(element[3]);
|
||||
z = Integer.valueOf(element[4]);
|
||||
}
|
||||
}
|
||||
qs.addRadar(x, y, z);
|
||||
html = "tutorial_11.htm";
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
html = "tutorial_15.htm";
|
||||
qs.set("ucMemo", "3");
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
html = "tutorial_18.htm";
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
for (String[] element : QMCa)
|
||||
{
|
||||
if (classId == Integer.valueOf(element[0]))
|
||||
{
|
||||
html = element[1];
|
||||
x = Integer.valueOf(element[2]);
|
||||
y = Integer.valueOf(element[3]);
|
||||
z = Integer.valueOf(element[4]);
|
||||
}
|
||||
}
|
||||
if (x != 0)
|
||||
{
|
||||
qs.addRadar(x, y, z);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
html = "tutorial_19.htm";
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
for (String[] element : QMCa)
|
||||
{
|
||||
if (classId == Integer.valueOf(element[0]))
|
||||
{
|
||||
html = element[1];
|
||||
x = Integer.valueOf(element[2]);
|
||||
y = Integer.valueOf(element[3]);
|
||||
z = Integer.valueOf(element[4]);
|
||||
}
|
||||
}
|
||||
if (x != 0)
|
||||
{
|
||||
qs.addRadar(x, y, z);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
html = "tutorial_15.htm";
|
||||
qs.set("ucMemo", "4");
|
||||
break;
|
||||
}
|
||||
case 17:
|
||||
{
|
||||
html = "tutorial_30.htm";
|
||||
break;
|
||||
}
|
||||
case 23:
|
||||
{
|
||||
html = "tutorial_24.htm";
|
||||
break;
|
||||
}
|
||||
case 24:
|
||||
{
|
||||
if (QMCb.containsKey(classId))
|
||||
{
|
||||
html = QMCb.get(classId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 26:
|
||||
{
|
||||
html = player.isMageClass() && (classId != 49) ? "tutorial_newbie004b.htm" : "tutorial_newbie004a.htm";
|
||||
break;
|
||||
}
|
||||
case 33:
|
||||
{
|
||||
html = "tutorial_27.htm";
|
||||
break;
|
||||
}
|
||||
case 34:
|
||||
{
|
||||
html = "tutorial_28.htm";
|
||||
break;
|
||||
}
|
||||
case 35:
|
||||
{
|
||||
if (QMCc.containsKey(classId))
|
||||
{
|
||||
html = QMCc.get(classId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (html.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
qs.showTutorialHTML(html);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Tutorial();
|
||||
}
|
||||
}
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_02.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_02.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>
|
||||
<center><font color="LEVEL">[Movement ]</font></center><br>
|
||||
Move your mouse cursor to the spot to which you want to move and <font color="FF0000">left-click</font>. Then, you will be moved to that location.<img src="L2UI_CH3.tutorial_img01" width=64 height=64><img src="L2UI_CH3.tutorial_img021" width=64 height=64><br>
|
||||
<a action="link TE07">Exit the Tutorial</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_03.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_03.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>
|
||||
<center><font color="LEVEL">[Changing Point-Of-View]</font></center><br>
|
||||
Good work! Now, I will explain to you how you can change your point-of-view.<br>
|
||||
<font color="FF0000">Try moving your mouse while pressing down the right button. </font> You can set your viewpoint in any direction.<img src="L2UI_CH3.tutorial_img04" width=128 height=64><br>When you need to examine the area around your character, you can use this feature to change your viewpoint as needed.<br>
|
||||
<a action="link TE08">Exit the Tutorial</a>
|
||||
</body></html>
|
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_04.htm
vendored
Normal file
6
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_04.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body><center><font color="LEVEL">Using the Mouse Wheel</font></center><br>
|
||||
Good work. Now you will learn about enlarging and shrinking the screen using the mouse wheel.<br>
|
||||
If you rotate the <font color="LEVEL">mouse wheel</font> down, you enlarge the game screen. Rotate the wheel up to reduce the screen.<br>
|
||||
The more you turn the wheel, the larger or smaller the screen becomes, but notice that there is a limit to how far you can go in either direction.<br>
|
||||
<a action="link TE09">Close Window</a>
|
||||
</body></html>
|
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_05.htm
vendored
Normal file
5
L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Tutorial/tutorial_05.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>
|
||||
<center><font color="LEVEL">[Initializing Point-Of-View]</font></center><br>
|
||||
Good job! Now, I will explain how you can return to the default point-of-view (POV).<br>Initializing POV means that you will change your POV to the same direction as the direction your character is facing. <font color="LEVEL">Right-clicking your mouse </font> will initialize your POV.<img src="L2UI_CH3.tutorial_img051" width=64 height=64><br>After looking around, if you would like to look straight ahead again, you can use this feature.<br>
|
||||
<a action="link TE010">Exit the Tutorial</a>
|
||||
</body></html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user