Cleanup for bosses ai scripts.

This commit is contained in:
MobiusDevelopment
2019-07-17 11:40:35 +00:00
parent efa24bed93
commit 3e3132d196
9 changed files with 745 additions and 1846 deletions

View File

@@ -59,7 +59,7 @@ public class Antharas extends Quest
{ {
protected static final Logger LOGGER = Logger.getLogger(Antharas.class.getName()); protected static final Logger LOGGER = Logger.getLogger(Antharas.class.getName());
// config // Config
private static final int FWA_ACTIVITYTIMEOFANTHARAS = 120; private static final int FWA_ACTIVITYTIMEOFANTHARAS = 120;
// private static final int FWA_APPTIMEOFANTHARAS = 1800000; // private static final int FWA_APPTIMEOFANTHARAS = 1800000;
// private static final int FWA_INACTIVITYTIME = 900000; // private static final int FWA_INACTIVITYTIME = 900000;

View File

@@ -72,49 +72,26 @@ public class Baium extends Quest
private static final int LIVE_BAIUM = 29020; private static final int LIVE_BAIUM = 29020;
private static final int ARCHANGEL = 29021; private static final int ARCHANGEL = 29021;
// Baium status tracking // 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 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 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 private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked,
// fixed archangel spawnloc // Archangel locations.
// @formatter:off
private static final int ANGEL_LOCATION[][] = private static final int ANGEL_LOCATION[][] =
{ {
{ {114239, 17168, 10080, 63544},
114239, {115780, 15564, 10080, 13620},
17168, {114880, 16236, 10080, 5400},
10080, {115168, 17200, 10080, 0},
63544 {115792, 16608, 10080, 0},
},
{
115780,
15564,
10080,
13620
},
{
114880,
16236,
10080,
5400
},
{
115168,
17200,
10080,
0
},
{
115792,
16608,
10080,
0
},
}; };
// @formatter:on
private long _LastAttackVsBaiumTime = 0; private long _lastAttackVsBaiumTime = 0;
private final List<NpcInstance> _Minions = new CopyOnWriteArrayList<>(); private final List<NpcInstance> _minions = new CopyOnWriteArrayList<>();
protected BossZone _Zone; protected BossZone _zone;
public Baium(int questId, String name, String descr) public Baium(int questId, String name, String descr)
{ {
@@ -131,7 +108,7 @@ public class Baium extends Quest
addStartNpc(ANGELIC_VORTEX); addStartNpc(ANGELIC_VORTEX);
addTalkId(STONE_BAIUM); addTalkId(STONE_BAIUM);
addTalkId(ANGELIC_VORTEX); addTalkId(ANGELIC_VORTEX);
_Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
final StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM); final StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
final Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM); final Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
@@ -228,7 +205,7 @@ public class Baium extends Quest
npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1)); npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 5)); npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 5));
// start monitoring baium's inactivity // start monitoring baium's inactivity
_LastAttackVsBaiumTime = System.currentTimeMillis(); _lastAttackVsBaiumTime = System.currentTimeMillis();
if (!npc.getSpawn().is_customBossInstance()) if (!npc.getSpawn().is_customBossInstance())
{ {
@@ -252,7 +229,7 @@ public class Baium extends Quest
// baium.setIsImobilised(false); // baium.setIsImobilised(false);
// for (NpcInstance minion : _Minions) // for (NpcInstance minion : _Minions)
// minion.setShowSummonAnimation(false); // minion.setShowSummonAnimation(false);
baium.getAttackByList().addAll(_Zone.getCharactersInside().values()); baium.getAttackByList().addAll(_zone.getCharactersInside().values());
} }
catch (Exception e) catch (Exception e)
{ {
@@ -265,8 +242,8 @@ public class Baium extends Quest
{ {
final MonsterInstance angel = (MonsterInstance) addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0); final MonsterInstance angel = (MonsterInstance) addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
angel.setIsInvul(true); angel.setIsInvul(true);
_Minions.add(angel); _minions.add(angel);
angel.getAttackByList().addAll(_Zone.getCharactersInside().values()); angel.getAttackByList().addAll(_zone.getCharactersInside().values());
angel.isAggressive(); angel.isAggressive();
} }
} }
@@ -278,14 +255,14 @@ public class Baium extends Quest
if (npc.getNpcId() == LIVE_BAIUM) if (npc.getNpcId() == LIVE_BAIUM)
{ {
// just in case the zone reference has been lost (somehow...), restore the reference // just in case the zone reference has been lost (somehow...), restore the reference
if (_Zone == null) if (_zone == null)
{ {
_Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
} }
if ((_LastAttackVsBaiumTime + (Config.BAIUM_SLEEP * 1000)) < System.currentTimeMillis()) if ((_lastAttackVsBaiumTime + (Config.BAIUM_SLEEP * 1000)) < System.currentTimeMillis())
{ {
npc.deleteMe(); // despawn the live-baium npc.deleteMe(); // despawn the live-baium
for (NpcInstance minion : _Minions) for (NpcInstance minion : _minions)
{ {
if (minion != null) if (minion != null)
{ {
@@ -293,13 +270,13 @@ public class Baium extends Quest
minion.deleteMe(); minion.deleteMe();
} }
} }
_Minions.clear(); _minions.clear();
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium 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 GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more
_Zone.oustAllPlayers(); _zone.oustAllPlayers();
cancelQuestTimer("baium_despawn", npc, null); cancelQuestTimer("baium_despawn", npc, null);
} }
else if (((_LastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0))) else if (((_lastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)))
{ {
// npc.setIsCastingNow(false); //just in case // npc.setIsCastingNow(false); //just in case
npc.setTarget(npc); npc.setTarget(npc);
@@ -316,11 +293,11 @@ public class Baium extends Quest
{ {
final int npcId = npc.getNpcId(); final int npcId = npc.getNpcId();
String htmltext = ""; String htmltext = "";
if (_Zone == null) if (_zone == null)
{ {
_Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
} }
if (_Zone == null) if (_zone == null)
{ {
return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>"; return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>";
} }
@@ -329,7 +306,7 @@ public class Baium extends Quest
if ((npcId == STONE_BAIUM) && (status == ASLEEP)) if ((npcId == STONE_BAIUM) && (status == ASLEEP))
{ {
if (Config.ALLOW_DIRECT_TP_TO_BOSS_ROOM || _Zone.isPlayerAllowed(player)) 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 // 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. // 30 minutes pass with no attacks made against Baium.
@@ -372,7 +349,7 @@ public class Baium extends Quest
player.getQuestState("baium").takeItems(4295, 1); 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) // 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. // Note: this just means 30secs to get in, no limits on how long it takes before we get out.
_Zone.allowPlayerEntry(player, 30); _zone.allowPlayerEntry(player, 30);
player.teleToLocation(113100, 14500, 10077); player.teleToLocation(113100, 14500, 10077);
} }
else else
@@ -401,7 +378,7 @@ public class Baium extends Quest
@Override @Override
public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet) public String onAttack(NpcInstance npc, PlayerInstance attacker, int damage, boolean isPet)
{ {
if (!_Zone.isInsideZone(attacker)) if (!_zone.isInsideZone(attacker))
{ {
attacker.reduceCurrentHp(attacker.getCurrentHp(), attacker, false); attacker.reduceCurrentHp(attacker.getCurrentHp(), attacker, false);
return super.onAttack(npc, attacker, damage, isPet); return super.onAttack(npc, attacker, damage, isPet);
@@ -434,7 +411,7 @@ public class Baium extends Quest
} }
} }
// update a variable with the last action against baium // update a variable with the last action against baium
_LastAttackVsBaiumTime = System.currentTimeMillis(); _lastAttackVsBaiumTime = System.currentTimeMillis();
callSkillAI(npc); callSkillAI(npc);
} }
return super.onAttack(npc, attacker, damage, isPet); return super.onAttack(npc, attacker, damage, isPet);
@@ -460,7 +437,7 @@ public class Baium extends Quest
GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM, info); GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM, info);
} }
for (NpcInstance minion : _Minions) for (NpcInstance minion : _minions)
{ {
if (minion != null) if (minion != null)
{ {
@@ -468,7 +445,7 @@ public class Baium extends Quest
minion.deleteMe(); minion.deleteMe();
} }
} }
_Minions.clear(); _minions.clear();
if (getQuestTimer("skill_range", npc, null) != null) if (getQuestTimer("skill_range", npc, null) != null)
{ {
@@ -510,7 +487,7 @@ public class Baium extends Quest
} }
if (result.isEmpty()) if (result.isEmpty())
{ {
for (NpcInstance minion : _Minions) for (NpcInstance minion : _minions)
{ {
if (minion != null) if (minion != null)
{ {
@@ -542,7 +519,7 @@ public class Baium extends Quest
return; return;
} }
if ((_target == null) || _target.isDead() || !(_Zone.isInsideZone(_target))) if ((_target == null) || _target.isDead() || !(_zone.isInsideZone(_target)))
{ {
_target = getRandomTarget(npc); _target = getRandomTarget(npc);
if (_target != null) if (_target != null)
@@ -557,7 +534,7 @@ public class Baium extends Quest
{ {
skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1); skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1);
} }
if ((target == null) || target.isDead() || !(_Zone.isInsideZone(target))) if ((target == null) || target.isDead() || !(_zone.isInsideZone(target)))
{ {
// npc.setIsCastingNow(false); // npc.setIsCastingNow(false);
return; return;

View File

@@ -48,7 +48,7 @@ public class Core extends Quest
private static final int DOOM_WRAITH = 29008; private static final int DOOM_WRAITH = 29008;
private static final int SUSCEPTOR = 29011; private static final int SUSCEPTOR = 29011;
// Spawns // Spawns
private static final Map<Integer, Location> MINNION_SPAWNS = new HashMap<>(); private static final Map<Integer, Location> MINNION_SPAWNS = new HashMap<>();
static static
{ {
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17191, 109298, -6488)); MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17191, 109298, -6488));
@@ -162,7 +162,6 @@ public class Core extends Quest
public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player) public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player)
{ {
final Integer status = GrandBossManager.getInstance().getBossStatus(CORE); final Integer status = GrandBossManager.getInstance().getBossStatus(CORE);
if (event.equals("core_unlock")) if (event.equals("core_unlock"))
{ {
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0); final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);

File diff suppressed because it is too large Load Diff

View File

@@ -42,284 +42,67 @@ public class Gordon extends Quest
private static int X = 0; private static int X = 0;
private static int Y = 0; private static int Y = 0;
private static int Z = 0; private static int Z = 0;
// @formatter:off
private static final int[][] WALKS = private static final int[][] WALKS =
{ {
{ {141569, -45908, -2387},
141569, {142494, -45456, -2397},
-45908, {142922, -44561, -2395},
-2387 {143672, -44130, -2398},
}, {144557, -43378, -2325},
{ {145839, -43267, -2301},
142494, {147044, -43601, -2307},
-45456, {148140, -43206, -2303},
-2397 {148815, -43434, -2328},
}, {149862, -44151, -2558},
{ {151037, -44197, -2708},
142922, {152555, -42756, -2836},
-44561, {154808, -39546, -3236},
-2395 {155333, -39962, -3272},
}, {156531, -41240, -3470},
{ {156863, -43232, -3707},
143672, {156783, -44198, -3764},
-44130, {158169, -45163, -3541},
-2398 {158952, -45479, -3473},
}, {160039, -46514, -3634},
{ {160244, -47429, -3656},
144557, {159155, -48109, -3665},
-43378, {159558, -51027, -3523},
-2325 {159396, -53362, -3244},
}, {160872, -56556, -2789},
{ {160857, -59072, -2613},
145839, {160410, -59888, -2647},
-43267, {158770, -60173, -2673},
-2301 {156368, -59557, -2638},
}, {155188, -59868, -2642},
{ {154118, -60591, -2731},
147044, {153571, -61567, -2821},
-43601, {153457, -62819, -2886},
-2307 {152939, -63778, -3003},
}, {151816, -64209, -3120},
{ {147655, -64826, -3433},
148140, {145422, -64576, -3369},
-43206, {144097, -64320, -3404},
-2303 {140780, -61618, -3096},
}, {139688, -61450, -3062},
{ {138267, -61743, -3056},
148815, {138613, -58491, -3465},
-43434, {138139, -57252, -3517},
-2328 {139555, -56044, -3310},
}, {139107, -54537, -3240},
{ {139279, -53781, -3091},
149862, {139810, -52687, -2866},
-44151, {139657, -52041, -2793},
-2558 {139215, -51355, -2698},
}, {139334, -50514, -2594},
{ {139817, -49715, -2449},
151037, {139824, -48976, -2263},
-44197, {140130, -47578, -2213},
-2708 {140483, -46339, -2382},
}, {141569, -45908, -2387}
{
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 _isAttacked = false;
private static boolean _isSpawned = false; private static boolean _isSpawned = false;

View File

@@ -38,10 +38,10 @@ public class Orfen extends Quest
private static final int LIVE = 0; private static final int LIVE = 0;
private static final int DEAD = 1; private static final int DEAD = 1;
private boolean FirstAttacked = false; private boolean _firstAttacked = false;
private boolean Teleported = false; private boolean _teleported = false;
GrandBossInstance orfen = null; GrandBossInstance _orfen = null;
enum Event enum Event
{ {
@@ -80,16 +80,16 @@ public class Orfen extends Quest
final int loc_y = 17368; final int loc_y = 17368;
final int loc_z = -5412; final int loc_z = -5412;
final int heading = 0; final int heading = 0;
orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0); _orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{ {
Announcements.getInstance().announceToAll("Raid boss " + orfen.getName() + " spawned in world."); Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
} }
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE); GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
GrandBossManager.getInstance().addBoss(orfen); GrandBossManager.getInstance().addBoss(_orfen);
} }
}
break; break;
}
case LIVE: case LIVE:
{ {
/* /*
@@ -101,28 +101,29 @@ public class Orfen extends Quest
final int heading = 0; final int heading = 0;
final int hp = info.getInteger("currentHP"); final int hp = info.getInteger("currentHP");
final int mp = info.getInteger("currentMP"); final int mp = info.getInteger("currentMP");
orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0); _orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{ {
Announcements.getInstance().announceToAll("Raid boss " + orfen.getName() + " spawned in world."); Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
} }
GrandBossManager.getInstance().addBoss(orfen); GrandBossManager.getInstance().addBoss(_orfen);
orfen.setCurrentHpMp(hp, mp); _orfen.setCurrentHpMp(hp, mp);
}
break; break;
}
default: default:
{ {
final int loc_x = 55024; final int loc_x = 55024;
final int loc_y = 17368; final int loc_y = 17368;
final int loc_z = -5412; final int loc_z = -5412;
final int heading = 0; final int heading = 0;
orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0); _orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{ {
Announcements.getInstance().announceToAll("Raid boss " + orfen.getName() + " spawned in world."); Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
} }
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE); GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
GrandBossManager.getInstance().addBoss(orfen); GrandBossManager.getInstance().addBoss(_orfen);
break;
} }
} }
} }
@@ -140,15 +141,15 @@ public class Orfen extends Quest
final int loc_y = 17368; final int loc_y = 17368;
final int loc_z = -5412; final int loc_z = -5412;
final int heading = 0; final int heading = 0;
orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0); _orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{ {
Announcements.getInstance().announceToAll("Raid boss " + orfen.getName() + " spawned in world."); Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
} }
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE); GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
GrandBossManager.getInstance().addBoss(orfen); GrandBossManager.getInstance().addBoss(_orfen);
}
break; break;
}
case ORFEN_REFRESH: case ORFEN_REFRESH:
{ {
if ((npc == null) || (npc.getSpawn() == null)) if ((npc == null) || (npc.getSpawn() == null))
@@ -166,7 +167,7 @@ public class Orfen extends Quest
GrandBossManager.getInstance().getStatsSet(ORFEN).set("currentHP", npc.getMaxHp()); GrandBossManager.getInstance().getStatsSet(ORFEN).set("currentHP", npc.getMaxHp());
} }
} }
if ((Teleported && (npc.getCurrentHp() > (npc.getMaxHp() * 0.95)))) if ((_teleported && (npc.getCurrentHp() > (npc.getMaxHp() * 0.95))))
{ {
cancelQuestTimer("ORFEN_REFRESH", npc, null); cancelQuestTimer("ORFEN_REFRESH", npc, null);
startQuestTimer("ORFEN_RETURN", 10000, npc, null); startQuestTimer("ORFEN_RETURN", 10000, npc, null);
@@ -175,26 +176,27 @@ public class Orfen extends Quest
{ // restart the refresh scheduling { // restart the refresh scheduling
startQuestTimer("ORFEN_REFRESH", 10000, npc, null); startQuestTimer("ORFEN_REFRESH", 10000, npc, null);
} }
}
break; break;
}
case ORFEN_RETURN: case ORFEN_RETURN:
{ {
if ((npc == null) || (npc.getSpawn() == null)) if ((npc == null) || (npc.getSpawn() == null))
{ {
break; break;
} }
Teleported = false; _teleported = false;
FirstAttacked = false; _firstAttacked = false;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
npc.getSpawn().setX(55024); npc.getSpawn().setX(55024);
npc.getSpawn().setY(17368); npc.getSpawn().setY(17368);
npc.getSpawn().setZ(-5412); npc.getSpawn().setZ(-5412);
npc.teleToLocation(55024, 17368, -5412, false); npc.teleToLocation(55024, 17368, -5412, false);
}
break; break;
}
default: default:
{ {
LOGGER.info("ORFEN: Not defined event: " + event + "!"); LOGGER.info("ORFEN: Not defined event: " + event + "!");
break;
} }
} }
@@ -207,13 +209,13 @@ public class Orfen extends Quest
final int npcId = npc.getNpcId(); final int npcId = npc.getNpcId();
if (npcId == ORFEN) if (npcId == ORFEN)
{ {
if (FirstAttacked) if (_firstAttacked)
{ {
if (((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)) && !Teleported) if (((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)) && !_teleported)
{ {
GrandBossManager.getInstance().getStatsSet(ORFEN).set("currentHP", npc.getCurrentHp()); GrandBossManager.getInstance().getStatsSet(ORFEN).set("currentHP", npc.getCurrentHp());
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
Teleported = true; _teleported = true;
npc.getSpawn().setX(43577); npc.getSpawn().setX(43577);
npc.getSpawn().setY(15985); npc.getSpawn().setY(15985);
npc.getSpawn().setZ(-4396); npc.getSpawn().setZ(-4396);
@@ -229,7 +231,7 @@ public class Orfen extends Quest
} }
else else
{ {
FirstAttacked = true; _firstAttacked = true;
} }
} }

View File

@@ -49,11 +49,11 @@ public class QueenAnt extends Quest
private static final int DEAD = 1; // Queen Ant has been killed. private static final int DEAD = 1; // Queen Ant has been killed.
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static BossZone _Zone; private static BossZone _zone;
private MonsterInstance _larva = null; private MonsterInstance _larva = null;
private MonsterInstance _queen = null; private MonsterInstance _queen = null;
private final List<MonsterInstance> _Minions = new CopyOnWriteArrayList<>(); private final List<MonsterInstance> _minions = new CopyOnWriteArrayList<>();
private final List<MonsterInstance> _Nurses = new CopyOnWriteArrayList<>(); private final List<MonsterInstance> _nurses = new CopyOnWriteArrayList<>();
enum Event enum Event
{ {
@@ -88,7 +88,7 @@ public class QueenAnt extends Quest
addEventId(mob, Quest.QuestEventType.ON_ATTACK); addEventId(mob, Quest.QuestEventType.ON_ATTACK);
} }
_Zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734); _zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734);
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN); final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
@@ -193,8 +193,8 @@ public class QueenAnt extends Quest
{ {
final int x = (int) (radius * Math.cos(i * 1.407)); // 1.407~2pi/6 final int x = (int) (radius * Math.cos(i * 1.407)); // 1.407~2pi/6
final int y = (int) (radius * Math.sin(i * 1.407)); 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.add((MonsterInstance) addSpawn(NURSE, npc.getX() + x, npc.getY() + y, npc.getZ(), 0, false, 0));
_Nurses.get(i).setIsAttackDisabled(true); _nurses.get(i).setIsAttackDisabled(true);
} }
} }
break; break;
@@ -205,46 +205,46 @@ public class QueenAnt extends Quest
{ {
final int x = (int) (radius * Math.cos(i * .7854)); // .7854~2pi/8 final int x = (int) (radius * Math.cos(i * .7854)); // .7854~2pi/8
final int y = (int) (radius * Math.sin(i * .7854)); 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)); _minions.add((MonsterInstance) addSpawn(ROYAL, npc.getX() + x, npc.getY() + y, npc.getZ(), 0, false, 0));
} }
} }
break; break;
case RESPAWN_ROYAL: case RESPAWN_ROYAL:
{ {
_Minions.add((MonsterInstance) addSpawn(ROYAL, npc.getX(), npc.getY(), npc.getZ(), 0, true, 0)); _minions.add((MonsterInstance) addSpawn(ROYAL, npc.getX(), npc.getY(), npc.getZ(), 0, true, 0));
} }
case RESPAWN_NURSE: case RESPAWN_NURSE:
{ {
_Nurses.add((MonsterInstance) addSpawn(NURSE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 0)); _nurses.add((MonsterInstance) addSpawn(NURSE, npc.getX(), npc.getY(), npc.getZ(), 0, true, 0));
} }
break; break;
case DESPAWN_MINIONS: case DESPAWN_MINIONS:
{ {
for (int i = 0; i < _Minions.size(); i++) for (int i = 0; i < _minions.size(); i++)
{ {
final Attackable mob = _Minions.get(i); final Attackable mob = _minions.get(i);
if (mob != null) if (mob != null)
{ {
mob.decayMe(); mob.decayMe();
} }
} }
for (int k = 0; k < _Nurses.size(); k++) for (int k = 0; k < _nurses.size(); k++)
{ {
final MonsterInstance _nurse = _Nurses.get(k); final MonsterInstance _nurse = _nurses.get(k);
if (_nurse != null) if (_nurse != null)
{ {
_nurse.decayMe(); _nurse.decayMe();
} }
} }
_Nurses.clear(); _nurses.clear();
_Minions.clear(); _minions.clear();
} }
break; break;
case CHECK_MINIONS_ZONE: case CHECK_MINIONS_ZONE:
{ {
for (int i = 0; i < _Minions.size(); i++) for (int i = 0; i < _minions.size(); i++)
{ {
final Attackable mob = _Minions.get(i); final Attackable mob = _minions.get(i);
if ((mob != null) && !mob.isInsideRadius(npc.getX(), npc.getY(), 700, false))/* !_Zone.isInsideZone(mob)) */ if ((mob != null) && !mob.isInsideRadius(npc.getX(), npc.getY(), 700, false))/* !_Zone.isInsideZone(mob)) */
{ {
mob.teleToLocation(npc.getX(), npc.getY(), npc.getZ()); mob.teleToLocation(npc.getX(), npc.getY(), npc.getZ());
@@ -255,14 +255,14 @@ public class QueenAnt extends Quest
case CHECK_NURSE_ALIVE: case CHECK_NURSE_ALIVE:
{ {
int deadNurses = 0; int deadNurses = 0;
for (MonsterInstance nurse : _Nurses) for (MonsterInstance nurse : _nurses)
{ {
if (nurse.isDead()) if (nurse.isDead())
{ {
deadNurses++; deadNurses++;
} }
} }
if (deadNurses == _Nurses.size()) if (deadNurses == _nurses.size())
{ {
startQuestTimer("RESPAWN_NURSE", Config.QA_RESP_NURSE * 1000, npc, null); startQuestTimer("RESPAWN_NURSE", Config.QA_RESP_NURSE * 1000, npc, null);
} }
@@ -296,7 +296,7 @@ public class QueenAnt extends Quest
final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp()); final boolean larvaNeedHeal = (_larva != null) && (_larva.getCurrentHp() < _larva.getMaxHp());
final boolean queenNeedHeal = (_queen != null) && (_queen.getCurrentHp() < _queen.getMaxHp()); final boolean queenNeedHeal = (_queen != null) && (_queen.getCurrentHp() < _queen.getMaxHp());
boolean nurseNeedHeal = false; boolean nurseNeedHeal = false;
for (MonsterInstance nurse : _Nurses) for (MonsterInstance nurse : _nurses)
{ {
nurseNeedHeal = (nurse != null) && (nurse.getCurrentHp() < nurse.getMaxHp()); nurseNeedHeal = (nurse != null) && (nurse.getCurrentHp() < nurse.getMaxHp());
if ((nurse == null) || nurse.isDead() || nurse.isCastingNow()) if ((nurse == null) || nurse.isDead() || nurse.isCastingNow())
@@ -329,11 +329,11 @@ public class QueenAnt extends Quest
{ {
if ((nurse.getTarget() != nurse) || notCasting) if ((nurse.getTarget() != nurse) || notCasting)
{ {
for (int k = 0; k < _Nurses.size(); k++) for (int k = 0; k < _nurses.size(); k++)
{ {
getIntoPosition(_Nurses.get(k), nurse); getIntoPosition(_nurses.get(k), nurse);
_Nurses.get(k).setTarget(nurse); _nurses.get(k).setTarget(nurse);
_Nurses.get(k).doCast(SkillTable.getInstance().getInfo(4020, 1)); _nurses.get(k).doCast(SkillTable.getInstance().getInfo(4020, 1));
} }
} }
} }
@@ -402,13 +402,13 @@ public class QueenAnt extends Quest
if ((npcId == ROYAL) || (npcId == NURSE)) if ((npcId == ROYAL) || (npcId == NURSE))
{ {
npc.decayMe(); npc.decayMe();
if (_Minions.contains(npc)) if (_minions.contains(npc))
{ {
_Minions.remove(npc); _minions.remove(npc);
} }
else else
{ {
_Nurses.remove(npc); _nurses.remove(npc);
} }
if (npcId == ROYAL) if (npcId == ROYAL)

View File

@@ -53,7 +53,6 @@ import org.l2jmobius.gameserver.templates.StatsSet;
import org.l2jmobius.gameserver.templates.creatures.NpcTemplate; import org.l2jmobius.gameserver.templates.creatures.NpcTemplate;
/** /**
* @version $Revision: $ $Date: $
* @author L2J_JP SANDMAN * @author L2J_JP SANDMAN
**/ **/
public class VanHalter extends Quest public class VanHalter extends Quest
@@ -504,7 +503,6 @@ public class VanHalter extends Quest
tr.getSpawn().stopRespawn(); tr.getSpawn().stopRespawn();
tr.deleteMe(); tr.deleteMe();
} }
_royalGuardCaptain.clear(); _royalGuardCaptain.clear();
} }

View File

@@ -603,7 +603,6 @@ public class Zaken extends Quest
cancelQuestTimer("1003", null, null); cancelQuestTimer("1003", null, null);
} }
} }
else if (event.equals("zaken_unlock")) else if (event.equals("zaken_unlock"))
{ {
final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0); final GrandBossInstance zaken = (GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);
@@ -624,9 +623,9 @@ public class Zaken extends Quest
{ {
return super.onFactionCall(npc, caller, attacker, isPet); return super.onFactionCall(npc, caller, attacker, isPet);
} }
final int npcId = npc.getNpcId(); final int npcId = npc.getNpcId();
final int callerId = caller.getNpcId(); final int callerId = caller.getNpcId();
if ((getTimeHour() < 5) && (callerId != ZAKEN) && (npcId == ZAKEN)) if ((getTimeHour() < 5) && (callerId != ZAKEN) && (npcId == ZAKEN))
{ {
final int damage = 0; // well damage required :x final int damage = 0; // well damage required :x