L2NpcInstance Mob_2 = FindMySpawn(player, NPC[4]);
if(Mob_2 != null)
{
AutoChat(Mob_2, Text[13].replace("PLAYERNAME", player.getName()));
DeleteMySpawn(player, NPC[4]);
QuestTimer qt = st.getQuestTimer("Mob_2 has despawned");
if(qt != null)
{
qt.cancel();
}
qt = st.getQuestTimer("NPC_4 Timer");
if(qt != null)
{
qt.cancel();
}
}
return null;
}
else if(event.equalsIgnoreCase("5-1"))
{
st.set("cond", "6");
st.takeItems(Items[4], 1);
Cast(st.findTemplate(NPC[5]), player, 4546, 1);
st.playSound(SOUND_MIDDLE);
htmltext = "5-02.htm";
}
else if(event.equalsIgnoreCase("6-1"))
{
st.set("cond", "8");
st.takeItems(Items[5], 1);
Cast(st.findTemplate(NPC[6]), player, 4546, 1);
st.playSound(SOUND_MIDDLE);
htmltext = "6-03.htm";
}
else if(event.equalsIgnoreCase("7-1"))
{
if(FindMySpawn(player, Mob[0]) == null)
{
L2NpcInstance Mob_1 = spawn(Mob[0], new Location(X[0], Y[0], Z[0]));
AddSpawn(player, Mob_1, 180000);
startQuestTimer("Mob_0 Timer", 500L, Mob_1, player);
startQuestTimer("Mob_1 has despawned", 120000L, Mob_1, player);
htmltext = "7-02.htm";
}
else
{
htmltext = "7-03.htm";
}
}
else if(event.equalsIgnoreCase("7-2"))
{
st.set("cond", "10");
st.takeItems(Items[6], 1);
Cast(st.findTemplate(NPC[7]), player, 4546, 1);
st.playSound(SOUND_MIDDLE);
htmltext = "7-06.htm";
}
else if(event.equalsIgnoreCase("8-1"))
{
st.set("cond", "14");
st.takeItems(Items[7], 1);
Cast(st.findTemplate(NPC[8]), player, 4546, 1);
st.playSound(SOUND_MIDDLE);
htmltext = "8-02.htm";
}
else if(event.equalsIgnoreCase("9-1"))
{
st.set("cond", "17");
st.takeItems(Items[8], 1);
Cast(st.findTemplate(NPC[9]), player, 4546, 1);
st.playSound(SOUND_MIDDLE);
htmltext = "9-03.htm";
}
else if(event.equalsIgnoreCase("10-1"))
{
if(st.getInt("Quest0") == 0 || FindMySpawn(player, NPC[4]) == null)
{
DeleteMySpawn(player, NPC[4]);
DeleteMySpawn(player, Mob[2]);
st.set("Quest0", "1");
st.set("Quest1", "45");
L2NpcInstance NPC_4 = spawn(NPC[4], new Location(X[2], Y[2], Z[2]));
L2NpcInstance Mob_2 = spawn(Mob[2], new Location(X[1], Y[1], Z[1]));
AddSpawn(player, Mob_2, 300000);
AddSpawn(player, NPC_4, 300000);
startQuestTimer("Mob_2 Timer", 1000, Mob_2, player);
startQuestTimer("Mob_2 despawn", 59000, Mob_2, player);
startQuestTimer("NPC_4 Timer", 500, NPC_4, player);
startQuestTimer("NPC_4 despawn", 60000, NPC_4, player);
htmltext = "10-02.htm";
}
else if(st.getInt("Quest1") == 45)
{
htmltext = "10-03.htm";
}
else if(st.getInt("Tab") == 1)
{
L2NpcInstance Mob_2 = FindMySpawn(player, NPC[4]);
if(Mob_2 == null || !st.getPlayer().knowsObject(Mob_2))
{
DeleteMySpawn(player, NPC[4]);
Mob_2 = spawn(NPC[4], new Location(X[2], Y[2], Z[2]));
AddSpawn(player, Mob_2, 300000);
st.set("Quest0", "1");
st.set("Quest1", "0"); // На всякий случай
QuestTimer qt = st.getQuestTimer("NPC_4 despawn");
if(qt != null)
{
qt.cancel();
}
startQuestTimer("NPC_4 despawn", 180000, Mob_2, player);
}
htmltext = "10-04.htm";
}