Removed nonexistent boss scripts.
This commit is contained in:
parent
f9c2923f03
commit
438bbb88b7
@ -1,145 +0,0 @@
|
||||
/*
|
||||
* 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.Location;
|
||||
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.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, "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"));
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
@ -1,278 +0,0 @@
|
||||
/*
|
||||
* 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.Location;
|
||||
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.EventType;
|
||||
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;
|
||||
|
||||
// @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()
|
||||
{
|
||||
super(-1, "ai/bosses");
|
||||
|
||||
addEventId(GORDON, EventType.ON_KILL);
|
||||
addEventId(GORDON, EventType.ON_ATTACK);
|
||||
addEventId(GORDON, EventType.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)
|
||||
{
|
||||
int x = WALKS[_isWalkTo - 1][0];
|
||||
int y = WALKS[_isWalkTo - 1][1];
|
||||
int z = WALKS[_isWalkTo - 1][2];
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case "time_isAttacked":
|
||||
{
|
||||
_isAttacked = false;
|
||||
if (npc.getNpcId() == GORDON)
|
||||
{
|
||||
npc.setWalking();
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(x, y, z, 0));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "check_ai":
|
||||
{
|
||||
cancelQuestTimer("check_ai", null, null);
|
||||
if (!_isSpawned)
|
||||
{
|
||||
final NpcInstance gordon = findTemplate(GORDON);
|
||||
if (gordon != null)
|
||||
{
|
||||
_isSpawned = true;
|
||||
startQuestTimer("Start", 1000, gordon, null, true);
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "Start":
|
||||
{
|
||||
// startQuestTimer("Start", 1000, npc, null);
|
||||
if ((npc != null) && _isSpawned)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
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,453 +0,0 @@
|
||||
/*
|
||||
* 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 java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.DoorData;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.DoorInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
import org.l2jmobius.gameserver.model.quest.EventType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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 Collection<NpcInstance> _allMobs = ConcurrentHashMap.newKeySet();
|
||||
protected Future<?> _onDeadEventTask = null;
|
||||
|
||||
public IceFairySirra()
|
||||
{
|
||||
super(-1, "ai/bosses");
|
||||
final int[] mobs =
|
||||
{
|
||||
STEWARD,
|
||||
22100,
|
||||
22102,
|
||||
22104
|
||||
};
|
||||
|
||||
for (int mob : mobs)
|
||||
{
|
||||
// TODO:
|
||||
addEventId(mob, EventType.QUEST_START);
|
||||
addEventId(mob, EventType.QUEST_TALK);
|
||||
addEventId(mob, EventType.NPC_FIRST_TALK);
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(NpcInstance npc, PlayerInstance player)
|
||||
{
|
||||
if (player.getQuestState(getName()) == 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 = DoorData.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 = DoorData.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 value)
|
||||
{
|
||||
String pom = "";
|
||||
pom = "32029-" + value;
|
||||
if (value == 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();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user