return null;
}
else if(event.equalsIgnoreCase("start_stage_1"))
{
Player p = st.getPlayer();
Reflection reflect = p.getReflection();
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
st.set("stage", 1);
reflect.openDoor(16240002);
officer.setRunning();
officer.setFollowTarget(st.getPlayer());
officer.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, st.getPlayer(), 150);
}
return null;
}
else if(event.equalsIgnoreCase("start_stage_3"))
{
Player p = st.getPlayer();
Reflection reflect = p.getReflection();
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
st.set("stage", 3);
reflect.openDoor(16240004);
officer.setRunning();
officer.setFollowTarget(st.getPlayer());
officer.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, st.getPlayer(), 150);
st.getPlayer().sendPacket(new ExShowScreenMessage(NpcString.MARK_OF_BELIS_CAN_BE_ACQUIRED_FROM_ENEMIES, 7000, ScreenMessageAlign.TOP_CENTER));
st.startQuestTimer("belise_mark_msg_timer", 10000);
}
return null;
}
else if(event.equalsIgnoreCase("drop_belise_mark"))
{
npc.dropItem(st.getPlayer(), BELIS_MARK, 1);
return null;
}
else if(event.equalsIgnoreCase("belise_mark_msg_timer"))
{
Player player = st.getPlayer();
Reflection reflection = player.getActiveReflection();
if(reflection!= null && reflection.getInstancedZoneId() == INSTANCED_ZONE_ID && st.getInt("stage") == 3)
{
player.sendPacket(new ExShowScreenMessage(NpcString.MARK_OF_BELIS_CAN_BE_ACQUIRED_FROM_ENEMIES, 7000, ScreenMessageAlign.TOP_CENTER));
st.startQuestTimer("belise_mark_msg_timer", 10000);
}
return null;
}
else if(event.equalsIgnoreCase("use_belise_mark"))
{
if(st.getInt("stage") == 3)
{
if(st.takeItems(BELIS_MARK, 1) == 1)
{
int marksLeft = NEED_BELIS_MARKS_COUNT - st.getInt("belise_marks_left") - 1;
if(marksLeft > 0)
{
htmltext = HtmCache.getInstance().getNotNull("quests/_10331_StartOfFate/belis_verification_system_q10331_2.htm", st.getPlayer());
htmltext = htmltext.replace("<?BELISE_MARKS_LEFT?>", String.valueOf(marksLeft));
}
else
{
Player player = st.getPlayer();
Reflection reflect = player.getActiveReflection();
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
st.set("stage", 4);
reflect.openDoor(16240005);
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
if(officer != null)
officerMoveToLocation(officer, new Location(-117896, 214248, -8617, 49151));
}
htmltext = "belis_verification_system_q10331_3.htm";
}
st.set("belise_marks_left", NEED_BELIS_MARKS_COUNT - marksLeft);
}
else
htmltext = "belis_verification_system_q10331_no.htm";
}
else
htmltext = "belis_verification_system_q10331_4.htm";
}
else if(event.equalsIgnoreCase("start_stage_5"))
{
Player p = st.getPlayer();
Reflection reflect = p.getReflection();
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
st.set("stage", 5);
reflect.openDoor(16240006);
officer.setRunning();
NpcInstance generator = getNpcFromReflection(ELECTRICITY_GENERATOR, reflect);
if(generator != null)
{
generator.setNpcState(1);
officer.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, generator, 1000);
Functions.npcSay(officer, NpcString.DONT_COME_BACK_HERE);
st.startQuestTimer("stage_5_phrases_timer", 5000, officer);
st.startQuestTimer("stage_5_spawn_timer", 5000, officer);
}
}
return null;
}
else if(event.equalsIgnoreCase("stage_5_phrases_timer"))
{
if(st.getInt("stage") == 5)
{
Functions.npcSay(npc, NpcString.DONT_COME_BACK_HERE);
Player player = st.getPlayer();
Reflection reflection = player.getActiveReflection();
if(reflection!= null && reflection.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
NpcString screenMsg = NpcString.BEHIND_YOU_THE_ENEMY_IS_AMBUSING_YOU;
if(Rnd.chance(50))
screenMsg = NpcString.IF_TERAIN_DIES_MISSION_WILL_FAIL;
player.sendPacket(new ExShowScreenMessage(screenMsg, 7000, ScreenMessageAlign.TOP_CENTER, true, true));
}
st.startQuestTimer("stage_5_phrases_timer", 10000, npc);
}
return null;
}
else if(event.equalsIgnoreCase("stage_5_spawn_timer"))
{
if(st.getInt("stage") == 5)
{
int defendersCount = st.getInt("spawned_defenders");
if(defendersCount < NEED_DEFENDERS_KILLS_COUNT)
{
int defenderNpcId = (defendersCount == 0 || defendersCount % 2 == 0) ? HANDYMAN : OPERATIVE;
Reflection reflect = npc.getReflection();
NpcInstance defender = addSpawnToInstance(defenderNpcId, new Location(-116600, 213080, -8615, 21220), 0, reflect.getId());
/*
NpcString defenderPhrase = NpcString.FOCUS_ON_ATTACKING_THE_GUY_IN_THE_ROOM;
if(Rnd.chance(50))
defenderPhrase = NpcString.KILL_THE_GUY_MESSING_WITH_THE_ELECTRIC_DEVICE;
Functions.npcSay(defender, defenderPhrase);
*/
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
if(officer != null)
{
defender.setSpawnedLoc(officer.getLoc());
defender.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, officer, 10);
}
st.set("spawned_defenders", defendersCount + 1);
String defendersIds = st.get("defenders_ids");
if(defendersIds == null)
defendersIds = "";
st.set("defenders_ids", st.get("defenders_ids") + "-" + defender.getObjectId() + "-");
}
st.startQuestTimer("stage_5_spawn_timer", 20000, npc);
}
return null;
}
else if(event.equalsIgnoreCase("process_stage_5"))
{
Player player = st.getPlayer();
Reflection reflect = player.getActiveReflection();
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
int defenderKills = st.getInt("defender_kills");
if(defenderKills >= NEED_DEFENDERS_KILLS_COUNT)
{
st.set("stage", 6);
st.getPlayer().sendPacket(new ExShowScreenMessage(NpcString.ELECTRONIC_DEVICE_HAS_BEEN_DESTROYED, 5000, ScreenMessageAlign.TOP_CENTER));
reflect.openDoor(16240007);
reflect.getZone("[belise_labyrinth_03_1]").setActive(true);
reflect.getZone("[belise_labyrinth_03_2]").setActive(false);
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
if(officer != null)
officerMoveToLocation(officer, new Location(-119112, 213672, -8617, 8191));
NpcInstance generator = getNpcFromReflection(ELECTRICITY_GENERATOR, reflect);
if(generator != null)
generator.deleteMe();
}
}
return null;
}
else if(event.equalsIgnoreCase("start_stage_7"))
{
Player player = st.getPlayer();
Reflection reflect = player.getActiveReflection();
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
st.set("stage", 7);
reflect.openDoor(16240008);
SceneMovie scene = SceneMovie.sc_talking_island_boss_opening;
st.getPlayer().showQuestMovie(scene);
st.startQuestTimer("spawn_nemertess", scene.getDuration(), npc);
}
return null;
}
else if(event.equalsIgnoreCase("spawn_nemertess"))
{
if(st.getInt("stage") == 7)
{
Player player = st.getPlayer();
Reflection reflect = player.getActiveReflection();
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
addSpawnToInstance(NEMERTESS, new Location(-118328, 212968, -8705, 24575), 0, reflect.getId());
}
}
return null;
}
else if(event.equalsIgnoreCase("kill_nemertess"))
{
if(st.getInt("stage") == 7)
{
Player player = st.getPlayer();
Reflection reflect = player.getActiveReflection();
if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
{
clearInstanceVariables(st);
st.setCond(4);
st.giveItems(SARILS_NECKLACE, 1);
NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);