Ir para conteúdo
  • Cadastre-se

Event Dungeon


caique156

Posts recomendados

Minha ideia e fazer um Evento dungeon quando os players de uma pt terminar de matar os determinados monstros spawnados apareça um bau de tesouro para pegar a recomeça isso durante 25 min... varias dungeon media de 10 salas para 10 pt

Quem quiser participar manda um salve ;)

 

 

player se registra no npc com uma pt de 4 pessoas -->

Aguarda o tempo ---->


é puxado para a sala ---->


na sala ele tera 5 min de espera para se organizar ----->


apos esse tempo aparece uma mensagem na tela em contagem regressiva--->



no termino da contagem e spwanado os mob em sala --->


objetivo matar todos os mobs da sala por 25 min --->


para cada vez q a sala é limpa é gerado uma caixa de teseouro no meio com tempo de 1 min na qual vem item random---->

a caixa some e os mobs voltam a spawna ---->


Quando atingir o tempo de 25 min a pt e teleportada para a cidade ---->

 

 

Link para o comentário
Compartilhar em outros sites


Apesar de ter poucos post tenho capacidade para fazer, porem como irei compartilhar no l2jbrasil qualquer ajuda e bem vinda.... o principio e o mesmo do tvt e a parte dos mobs e o mesmo da Quest Four Sepulcher

 

flw vlw


A todos que gostarem da ideia peço que valorizem a ideia e nao julguem a quantidade de post apesar dessa conta ser antiga eu perdi um que era mais antiga ainda com maior quantidade de post's, tambem nunca liguei.. apesar tambem de ser iniciante em l2j tenho uma base de java e programação e programação em qualquer lugar a logica é a mesma. :anjo:

Editado por caique156
Link para o comentário
Compartilhar em outros sites

Ele citou a ideia dele, talvez alguém que manja pode pegar a ideia do mesmo e fazer o script e postar totalmente de graça aqui pra todos

Pra que essa ignorância?

Não foi ignorancia, estou apenas perguntando se ele ja fez algo. E se não vai fazer como alguns aqui no fórum..

Minha meta é ser ...

( )Zaw9wHq.png

"Ficar louco de vez em quando é necessidade básica para permanecer são."

Osho

Link para o comentário
Compartilhar em outros sites

Não foi ignorancia, estou apenas perguntando se ele ja fez algo. E se não vai fazer como alguns aqui no fórum..

Estou vendo a logica do tvt junto com algumas quests tenho uma ideia mais ou menos como deve ser a sql e o java

Link para o comentário
Compartilhar em outros sites

Para qual crônica isso? desde a L2JServer Freya já tem este evento...

Caso tenha alguma sugestão para aplicativos, por favor envie por MP.

 WhatsApp: 22 98156-2591 

L2JDREAM PROJECT

Link para o comentário
Compartilhar em outros sites

Interlude

Interlude não tem suporte a instâncias, não é possível fazer o evento para partys distintas...

Primeiro é necessário criar o suporte a instâncias, e tentar fazer funcionar igual ao Gracia ++ tem nas áreas hellbound...

Caso tenha alguma sugestão para aplicativos, por favor envie por MP.

 WhatsApp: 22 98156-2591 

L2JDREAM PROJECT

Link para o comentário
Compartilhar em outros sites

Interlude não tem suporte a instâncias, não é possível fazer o evento para partys distintas...

Primeiro é necessário criar o suporte a instâncias, e tentar fazer funcionar igual ao Gracia ++ tem nas áreas hellbound...

Acredito que tenha suporte pois tem umas dungueon dentro do l2, quanto a varias party se registrando ai ja nao sei bem como é, poderia definir um limite de grupos a entrar e para cada grupo um local distinto.. ou entao um mesmo local em uma fila para entrar

Link para o comentário
Compartilhar em outros sites

Cara, achei massa sua ideia sou iniciante na area de l2j se nao ajudava mas precisando de algo estamos ai :)

Aqui, no entanto, nós não olhamos para trás por muito tempo. Nós continuamos seguindo em frente, abrindo novas portas e fazendo coisas novas. E sabe por quê? Porque somos curiosos… e a curiosidade continua nos conduzindo por novos caminhos. Siga em frente…

Walt Disney

Link para o comentário
Compartilhar em outros sites

Bom eu colocaria para ser 1 PT por vez em modo Random.

a ultima pt q se registrar vai demorar umas 3 horas ++

esse é o único problema.

se dividir em 4 locais seria possível ?

Cara, achei massa sua ideia sou iniciante na area de l2j se nao ajudava mas precisando de algo estamos ai :)

Tamo junto.. tambem sou novo

Link para o comentário
Compartilhar em outros sites

Acredito que tenha suporte pois tem umas dungueon dentro do l2, quanto a varias party se registrando ai ja nao sei bem como é, poderia definir um limite de grupos a entrar e para cada grupo um local distinto.. ou entao um mesmo local em uma fila para entrar

não tem suporte a dungeons, essa instance foi implementada no Gracia nas áreas de Hellbound, no interlude se mandar as partys para um lugar específico as partys vão se encontrar, não emula uma dungeon por instance por party. teria que retirar esse funcionamento do Gracia e implementar no interlude antes de criar o evento da sua idéia..

 

No freya L2JServer, onde tem o suporte para dungeon por instance tem este evento, ele utiliza uma área de hellbound, a party é spawnada, tem que matar os mobs, daí abre uma porta pra outra sala onde aparece outros mobs, assim até chegar ao ultimo mob na última sala que spawna o boss, que após morrer spawna um baú onde o lider da party clica e o prêmio é inserido no inventário..

Caso tenha alguma sugestão para aplicativos, por favor envie por MP.

 WhatsApp: 22 98156-2591 

L2JDREAM PROJECT

Link para o comentário
Compartilhar em outros sites

Bem parecido com o Tera só muda a parte do baú. :)

No L2J é:

Special Instance Event:

Gracia Epilogue ++

Quest name: BloodEmpire

 

tem até um pré-config FREYA aqui no fórum que tem este evento

SIq2d9E.jpg

Editado por Wallace Carvalho

Caso tenha alguma sugestão para aplicativos, por favor envie por MP.

 WhatsApp: 22 98156-2591 

L2JDREAM PROJECT

Link para o comentário
Compartilhar em outros sites

Com todo respeito, eu tenho esse evento. Você pode configurar quantas PT's entram ao mesmo tempo, Se caso estiverem em Conexão de PT, as 2 entram juntas. Um amg meu que fez >.> so que pra freya

Um mundo de diversão no Lineage 2

https://www.primeworld.com.br

Discord: Em breve

Comunidade brasileira de Lineage. Interlude Remastered / High Five / Essence 

Classes remasterizadas, sistemas únicos, diversão garantida.

Link para o comentário
Compartilhar em outros sites

é o que o Wallace está falando , para freya e gracia epilogue é de boa , agora para interlude vai ter que criar o código para as Instâncias.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

é o que o Wallace está falando , para freya e gracia epilogue é de boa , agora para interlude vai ter que criar o código para as Instâncias.

 

 

Com todo respeito, eu tenho esse evento. Você pode configurar quantas PT's entram ao mesmo tempo, Se caso estiverem em Conexão de PT, as 2 entram juntas. Um amg meu que fez >.> so que pra freya

 

Vamos mudar oq tiver que ser mudado gostaria muito de aprender tb como converter alguns arquivos sql em XML tipo acis no projeto frozen

Link para o comentário
Compartilhar em outros sites

Não manjo muito de java, mas sim o interlude tem como criar dungeons mesmo não tendo a mesma. Por exemplo o Boss Frintezza funciona praticamente com este sistema de Party, a revisão que eu so tem um mob dungeon onde a pt é teleportado para um certo local onde voce digite as coordenadas, porem não é exatamente como sua ideia de tempo limite e spawn de mobs. mais a mesma pode ser feita com assim. Infelizmente não tenho acesso ao Core, se não eu compartilharia aqui. Mais sim é possível fazer para interlude uma dungeon mesmo não tendo a mesma. A logica não é tão dificil e unir o tvt + o sistema de entrace party do frintezza pode ser que consiga algo similar ao que voce pensou.

R2d3uef.png

Link para o comentário
Compartilhar em outros sites

Não manjo muito de java, mas sim o interlude tem como criar dungeons mesmo não tendo a mesma. Por exemplo o Boss Frintezza funciona praticamente com este sistema de Party, a revisão que eu so tem um mob dungeon onde a pt é teleportado para um certo local onde voce digite as coordenadas, porem não é exatamente como sua ideia de tempo limite e spawn de mobs. mais a mesma pode ser feita com assim. Infelizmente não tenho acesso ao Core, se não eu compartilharia aqui. Mais sim é possível fazer para interlude uma dungeon mesmo não tendo a mesma. A logica não é tão dificil e unir o tvt + o sistema de entrace party do frintezza pode ser que consiga algo similar ao que voce pensou.

Entao a quest dos goblets e mais ou menos isso pt + tempo limite

Quest referida

 

 

 

* 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 .

*/

package com.l2jfrozen.gameserver.managers;

 

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import java.util.Calendar;

import java.util.List;

import java.util.Map;

import java.util.Set;

import java.util.concurrent.ScheduledFuture;

 

import javolution.util.FastList;

import javolution.util.FastMap;

 

import com.l2jfrozen.Config;

import com.l2jfrozen.gameserver.datatables.csv.DoorTable;

import com.l2jfrozen.gameserver.datatables.sql.NpcTable;

import com.l2jfrozen.gameserver.datatables.sql.SpawnTable;

import com.l2jfrozen.gameserver.model.actor.instance.L2DoorInstance;

import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;

import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;

import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;

import com.l2jfrozen.gameserver.model.actor.instance.L2SepulcherMonsterInstance;

import com.l2jfrozen.gameserver.model.actor.instance.L2SepulcherNpcInstance;

import com.l2jfrozen.gameserver.model.quest.QuestState;

import com.l2jfrozen.gameserver.model.spawn.L2Spawn;

import com.l2jfrozen.gameserver.model.zone.type.L2BossZone;

import com.l2jfrozen.gameserver.network.SystemMessageId;

import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;

import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;

import com.l2jfrozen.gameserver.templates.L2NpcTemplate;

import com.l2jfrozen.gameserver.thread.ThreadPoolManager;

import com.l2jfrozen.gameserver.util.Util;

import com.l2jfrozen.util.CloseUtil;

import com.l2jfrozen.util.database.DatabaseUtils;

import com.l2jfrozen.util.database.L2DatabaseFactory;

import com.l2jfrozen.util.random.Rnd;

 

/**

* This class ...

* @version $Revision: $ $Date: $

* @author sandman TODO: Gatekeepers shouting some text when doors get opened..so far unknown in leaked C4 is this text: 1000502 [brushes hinders competitor's monster.] which is really ugly translation TODO: Victim should attack one npc, when u save this NPC debuff zones will not be activated and

* NPC will polymorph into some kind of Tammed Beast xD and shout: 1000503 [many thanks rescue.] which is again really ugly translation. When Victim kill this NPC, debuff zones will get activated with current core its impossible to make attack npc * npc i will try to search where is this

* prevented but still is unknown which npc u need to save to survive in next room without debuffs

*/

public class FourSepulchersManager extends GrandBossManager

{

private static final String QUEST_ID = "620_FourGoblets";

 

private static final int ENTRANCE_PASS = 7075;

private static final int USED_PASS = 7261;

private static final int CHAPEL_KEY = 7260;

private static final int ANTIQUE_BROOCH = 7262;

 

protected boolean _firstTimeRun;

protected boolean _inEntryTime = false;

protected boolean _inWarmUpTime = false;

protected boolean _inAttackTime = false;

protected boolean _inCoolDownTime = false;

 

protected ScheduledFuture_changeCoolDownTimeTask = null;

protected ScheduledFuture_changeEntryTimeTask = null;

protected ScheduledFuture_changeWarmUpTimeTask = null;

protected ScheduledFuture_changeAttackTimeTask = null;

protected ScheduledFuture_onPartyAnnihilatedTask = null;

 

private final int[][] _startHallSpawn =

{

{

181632,

-85587,

-7218

},

{

179963,

-88978,

-7218

},

{

173217,

-86132,

-7218

},

{

175608,

-82296,

-7218

}

};

 

private final int[][][] _shadowSpawnLoc =

{

{

{

25339,

191231,

-85574,

-7216,

33380

},

{

25349,

189534,

-88969,

-7216,

32768

},

{

25346,

173195,

-76560,

-7215,

49277

},

{

25342,

175591,

-72744,

-7215,

49317

}

},

{

{

25342,

191231,

-85574,

-7216,

33380

},

{

25339,

189534,

-88969,

-7216,

32768

},

{

25349,

173195,

-76560,

-7215,

49277

},

{

25346,

175591,

-72744,

-7215,

49317

}

},

{

{

25346,

191231,

-85574,

-7216,

33380

},

{

25342,

189534,

-88969,

-7216,

32768

},

{

25339,

173195,

-76560,

-7215,

49277

},

{

25349,

175591,

-72744,

-7215,

49317

}

},

{

{

25349,

191231,

-85574,

-7216,

33380

},

{

25346,

189534,

-88969,

-7216,

32768

},

{

25342,

173195,

-76560,

-7215,

49277

},

{

25339,

175591,

-72744,

-7215,

49317

}

},

};

 

protected FastMap _archonSpawned = new FastMap<>();

protected FastMap _hallInUse = new FastMap<>();

protected FastMap _startHallSpawns = new FastMap<>();

protected FastMap _hallGateKeepers = new FastMap<>();

protected FastMap _keyBoxNpc = new FastMap<>();

protected FastMap _victim = new FastMap<>();

protected FastMap _challengers = new FastMap<>();

protected FastMap _executionerSpawns = new FastMap<>();

protected FastMap _keyBoxSpawns = new FastMap<>();

protected FastMap _mysteriousBoxSpawns = new FastMap<>();

protected FastMap _shadowSpawns = new FastMap<>();

protected FastMap> _dukeFinalMobs = new FastMap<>();

protected FastMap> _dukeMobs = new FastMap<>();

protected FastMap> _emperorsGraveNpcs = new FastMap<>();

protected FastMap> _magicalMonsters = new FastMap<>();

protected FastMap> _physicalMonsters = new FastMap<>();

protected FastMap> _viscountMobs = new FastMap<>();

 

protected FastList _physicalSpawns;

protected FastList _magicalSpawns;

protected FastList _managers;

protected FastList _dukeFinalSpawns;

protected FastList _emperorsGraveSpawns;

protected FastList _allMobs = new FastList<>();

 

protected long _attackTimeEnd = 0;

protected long _coolDownTimeEnd = 0;

protected long _entryTimeEnd = 0;

protected long _warmUpTimeEnd = 0;

 

protected byte _newCycleMin = 55;

 

public static final FourSepulchersManager getInstance()

{

return SingletonHolder._instance;

}

 

public FourSepulchersManager()

{

init();

}

 

private void init()

{

if (_changeCoolDownTimeTask != null)

{

_changeCoolDownTimeTask.cancel(true);

}

if (_changeEntryTimeTask != null)

{

_changeEntryTimeTask.cancel(true);

}

if (_changeWarmUpTimeTask != null)

{

_changeWarmUpTimeTask.cancel(true);

}

if (_changeAttackTimeTask != null)

{

_changeAttackTimeTask.cancel(true);

}

 

_changeCoolDownTimeTask = null;

_changeEntryTimeTask = null;

_changeWarmUpTimeTask = null;

_changeAttackTimeTask = null;

 

_inEntryTime = false;

_inWarmUpTime = false;

_inAttackTime = false;

_inCoolDownTime = false;

 

_firstTimeRun = true;

initFixedInfo();

loadMysteriousBox();

initKeyBoxSpawns();

loadPhysicalMonsters();

loadMagicalMonsters();

initLocationShadowSpawns();

initExecutionerSpawns();

loadDukeMonsters();

loadEmperorsGraveMonsters();

spawnManagers();

timeSelector();

}

 

// phase select on server launch

protected void timeSelector()

{

timeCalculator();

final long currentTime = Calendar.getInstance().getTimeInMillis();

// if current time >= time of entry beginning and if current time < time

// of entry beginning + time of entry end

if (currentTime >= _coolDownTimeEnd && currentTime < _entryTimeEnd) // entry

// time

// check

{

clean();

_changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeEntryTime(), 0);

LOGGER.info("FourSepulchersManager: Beginning in Entry time");

}

else if (currentTime >= _entryTimeEnd && currentTime < _warmUpTimeEnd) // warmup

// time

// check

{

clean();

_changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeWarmUpTime(), 0);

LOGGER.info("FourSepulchersManager: Beginning in WarmUp time");

}

else if (currentTime >= _warmUpTimeEnd && currentTime < _attackTimeEnd) // attack

// time

// check

{

clean();

_changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeAttackTime(), 0);

LOGGER.info("FourSepulchersManager: Beginning in Attack time");

}

else

// else cooldown time and without cleanup because it's already

// implemented

{

_changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeCoolDownTime(), 0);

LOGGER.info("FourSepulchersManager: Beginning in Cooldown time");

}

}

 

// phase end times calculator

protected void timeCalculator()

{

Calendar tmp = Calendar.getInstance();

if (tmp.get(Calendar.MINUTE) < _newCycleMin)

{

tmp.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) - 1);

}

tmp.set(Calendar.MINUTE, _newCycleMin);

_coolDownTimeEnd = tmp.getTimeInMillis();

_entryTimeEnd = _coolDownTimeEnd + Config.FS_TIME_ENTRY * 60000;

_warmUpTimeEnd = _entryTimeEnd + Config.FS_TIME_WARMUP * 60000;

_attackTimeEnd = _warmUpTimeEnd + Config.FS_TIME_ATTACK * 60000;

tmp = null;

}

 

public void clean()

{

for (int i = 31921; i < 31925; i++)

{

final int[] Location = _startHallSpawns.get(i);

if (Location != null && Location.length == 3)

{

final L2BossZone zone = GrandBossManager.getInstance().getZone(Location[0], Location[1], Location[2]);

if (zone != null)

zone.oustAllPlayers();

}

 

}

 

deleteAllMobs();

closeAllDoors();

 

_hallInUse.clear();

_hallInUse.put(31921, false);

_hallInUse.put(31922, false);

_hallInUse.put(31923, false);

_hallInUse.put(31924, false);

 

if (_archonSpawned.size() != 0)

{

Set npcIdSet = _archonSpawned.keySet();

for (final int npcId : npcIdSet)

{

_archonSpawned.put(npcId, false);

}

npcIdSet = null;

}

}

 

protected void spawnManagers()

{

_managers = new FastList<>();

// L2Spawn spawnDat;

 

int i = 31921;

for (L2Spawn spawnDat; i <= 31924; i++)

{

if (i < 31921 || i > 31924)

{

continue;

}

final L2NpcTemplate template1 = NpcTable.getInstance().getTemplate(i);

if (template1 == null)

{

continue;

}

try

{

spawnDat = new L2Spawn(template1);

 

spawnDat.setAmount(1);

spawnDat.setRespawnDelay(60);

switch (i)

{

case 31921: // conquerors

spawnDat.setLocx(181061);

spawnDat.setLocy(-85595);

spawnDat.setLocz(-7200);

spawnDat.setHeading(-32584);

break;

case 31922: // emperors

spawnDat.setLocx(179292);

spawnDat.setLocy(-88981);

spawnDat.setLocz(-7200);

spawnDat.setHeading(-33272);

break;

case 31923: // sages

spawnDat.setLocx(173202);

spawnDat.setLocy(-87004);

spawnDat.setLocz(-7200);

spawnDat.setHeading(-16248);

break;

case 31924: // judges

spawnDat.setLocx(175606);

spawnDat.setLocy(-82853);

spawnDat.setLocz(-7200);

spawnDat.setHeading(-16248);

break;

}

_managers.add(spawnDat);

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

spawnDat.doSpawn();

spawnDat.startRespawn();

if (Config.DEBUG)

{

LOGGER.info("FourSepulchersManager: spawned " + spawnDat.getTemplate().getName());

}

}

catch (final SecurityException e)

{

e.printStackTrace();

}

catch (final ClassNotFoundException e)

{

e.printStackTrace();

}

catch (final NoSuchMethodException e)

{

e.printStackTrace();

}

}

}

 

protected void initFixedInfo()

{

_startHallSpawns.put(31921, _startHallSpawn[0]);

_startHallSpawns.put(31922, _startHallSpawn[1]);

_startHallSpawns.put(31923, _startHallSpawn[2]);

_startHallSpawns.put(31924, _startHallSpawn[3]);

 

_hallInUse.put(31921, false);

_hallInUse.put(31922, false);

_hallInUse.put(31923, false);

_hallInUse.put(31924, false);

 

_hallGateKeepers.put(31925, 25150012);

_hallGateKeepers.put(31926, 25150013);

_hallGateKeepers.put(31927, 25150014);

_hallGateKeepers.put(31928, 25150015);

_hallGateKeepers.put(31929, 25150016);

_hallGateKeepers.put(31930, 25150002);

_hallGateKeepers.put(31931, 25150003);

_hallGateKeepers.put(31932, 25150004);

_hallGateKeepers.put(31933, 25150005);

_hallGateKeepers.put(31934, 25150006);

_hallGateKeepers.put(31935, 25150032);

_hallGateKeepers.put(31936, 25150033);

_hallGateKeepers.put(31937, 25150034);

_hallGateKeepers.put(31938, 25150035);

_hallGateKeepers.put(31939, 25150036);

_hallGateKeepers.put(31940, 25150022);

_hallGateKeepers.put(31941, 25150023);

_hallGateKeepers.put(31942, 25150024);

_hallGateKeepers.put(31943, 25150025);

_hallGateKeepers.put(31944, 25150026);

 

_keyBoxNpc.put(18120, 31455);

_keyBoxNpc.put(18121, 31455);

_keyBoxNpc.put(18122, 31455);

_keyBoxNpc.put(18123, 31455);

_keyBoxNpc.put(18124, 31456);

_keyBoxNpc.put(18125, 31456);

_keyBoxNpc.put(18126, 31456);

_keyBoxNpc.put(18127, 31456);

_keyBoxNpc.put(18128, 31457);

_keyBoxNpc.put(18129, 31457);

_keyBoxNpc.put(18130, 31457);

_keyBoxNpc.put(18131, 31457);

_keyBoxNpc.put(18149, 31458);

_keyBoxNpc.put(18150, 31459);

_keyBoxNpc.put(18151, 31459);

_keyBoxNpc.put(18152, 31459);

_keyBoxNpc.put(18153, 31459);

_keyBoxNpc.put(18154, 31460);

_keyBoxNpc.put(18155, 31460);

_keyBoxNpc.put(18156, 31460);

_keyBoxNpc.put(18157, 31460);

_keyBoxNpc.put(18158, 31461);

_keyBoxNpc.put(18159, 31461);

_keyBoxNpc.put(18160, 31461);

_keyBoxNpc.put(18161, 31461);

_keyBoxNpc.put(18162, 31462);

_keyBoxNpc.put(18163, 31462);

_keyBoxNpc.put(18164, 31462);

_keyBoxNpc.put(18165, 31462);

_keyBoxNpc.put(18183, 31463);

_keyBoxNpc.put(18184, 31464);

_keyBoxNpc.put(18212, 31465);

_keyBoxNpc.put(18213, 31465);

_keyBoxNpc.put(18214, 31465);

_keyBoxNpc.put(18215, 31465);

_keyBoxNpc.put(18216, 31466);

_keyBoxNpc.put(18217, 31466);

_keyBoxNpc.put(18218, 31466);

_keyBoxNpc.put(18219, 31466);

 

_victim.put(18150, 18158);

_victim.put(18151, 18159);

_victim.put(18152, 18160);

_victim.put(18153, 18161);

_victim.put(18154, 18162);

_victim.put(18155, 18163);

_victim.put(18156, 18164);

_victim.put(18157, 18165);

}

 

private void loadMysteriousBox()

{

Connection con = null;

 

_mysteriousBoxSpawns.clear();

 

try

{

con = L2DatabaseFactory.getInstance().getConnection(false);

PreparedStatement statement = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist Where spawntype = ? ORDER BY id");

statement.setInt(1, 0);

ResultSet rset = statement.executeQuery();

 

L2Spawn spawnDat;

L2NpcTemplate template1;

 

while (rset.next())

{

template1 = NpcTable.getInstance().getTemplate(rset.getInt("npc_templateid"));

if (template1 != null)

{

spawnDat = new L2Spawn(template1);

spawnDat.setAmount(rset.getInt("count"));

spawnDat.setLocx(rset.getInt("locx"));

spawnDat.setLocy(rset.getInt("locy"));

spawnDat.setLocz(rset.getInt("locz"));

spawnDat.setHeading(rset.getInt("heading"));

spawnDat.setRespawnDelay(rset.getInt("respawn_delay"));

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

final int keyNpcId = rset.getInt("key_npc_id");

_mysteriousBoxSpawns.put(keyNpcId, spawnDat);

}

else

{

LOGGER.warn("FourSepulchersManager.LoadMysteriousBox: Data missing in NPC table for ID: " + rset.getInt("npc_templateid") + ".");

}

}

 

spawnDat = null;

template1 = null;

 

DatabaseUtils.close(rset);

DatabaseUtils.close(statement);

rset = null;

statement = null;

if (Config.DEBUG)

{

LOGGER.info("FourSepulchersManager: loaded " + _mysteriousBoxSpawns.size() + " Mysterious-Box spawns.");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

// problem with initializing spawn, go to next one

LOGGER.warn("FourSepulchersManager.LoadMysteriousBox: Spawn could not be initialized: " + e);

}

finally

{

CloseUtil.close(con);

con = null;

}

}

 

private void initKeyBoxSpawns()

{

L2Spawn spawnDat;

L2NpcTemplate template;

 

for (final int keyNpcId : _keyBoxNpc.keySet())

{

try

{

template = NpcTable.getInstance().getTemplate(_keyBoxNpc.get(keyNpcId));

if (template != null)

{

spawnDat = new L2Spawn(template);

spawnDat.setAmount(1);

spawnDat.setLocx(0);

spawnDat.setLocy(0);

spawnDat.setLocz(0);

spawnDat.setHeading(0);

spawnDat.setRespawnDelay(3600);

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

_keyBoxSpawns.put(keyNpcId, spawnDat);

}

else

{

LOGGER.warn("FourSepulchersManager.InitKeyBoxSpawns: Data missing in NPC table for ID: " + _keyBoxNpc.get(keyNpcId) + ".");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("FourSepulchersManager.InitKeyBoxSpawns: Spawn could not be initialized: " + e);

}

}

spawnDat = null;

template = null;

}

 

private void loadPhysicalMonsters()

{

_physicalMonsters.clear();

 

int loaded = 0;

Connection con = null;

 

try

{

con = L2DatabaseFactory.getInstance().getConnection(false);

 

PreparedStatement statement1 = con.prepareStatement("SELECT Distinct key_npc_id FROM four_sepulchers_spawnlist Where spawntype = ? ORDER BY key_npc_id");

statement1.setInt(1, 1);

ResultSet rset1 = statement1.executeQuery();

while (rset1.next())

{

final int keyNpcId = rset1.getInt("key_npc_id");

 

PreparedStatement statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist Where key_npc_id = ? and spawntype = ? ORDER BY id");

statement2.setInt(1, keyNpcId);

statement2.setInt(2, 1);

ResultSet rset2 = statement2.executeQuery();

 

L2Spawn spawnDat;

L2NpcTemplate template1;

 

_physicalSpawns = new FastList<>();

 

while (rset2.next())

{

template1 = NpcTable.getInstance().getTemplate(rset2.getInt("npc_templateid"));

if (template1 != null)

{

spawnDat = new L2Spawn(template1);

spawnDat.setAmount(rset2.getInt("count"));

spawnDat.setLocx(rset2.getInt("locx"));

spawnDat.setLocy(rset2.getInt("locy"));

spawnDat.setLocz(rset2.getInt("locz"));

spawnDat.setHeading(rset2.getInt("heading"));

spawnDat.setRespawnDelay(rset2.getInt("respawn_delay"));

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

_physicalSpawns.add(spawnDat);

loaded++;

}

else

{

LOGGER.warn("FourSepulchersManager.LoadPhysicalMonsters: Data missing in NPC table for ID: " + rset2.getInt("npc_templateid") + ".");

}

}

 

rset2.close();

statement2.close();

rset2 = null;

statement2 = null;

_physicalMonsters.put(keyNpcId, _physicalSpawns);

}

 

rset1.close();

statement1.close();

rset1 = null;

statement1 = null;

if (Config.DEBUG)

{

LOGGER.info("FourSepulchersManager: loaded " + loaded + " Physical type monsters spawns.");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

// problem with initializing spawn, go to next one

LOGGER.warn("FourSepulchersManager.LoadPhysicalMonsters: Spawn could not be initialized: " + e);

}

finally

{

CloseUtil.close(con);

con = null;

}

}

 

private void loadMagicalMonsters()

{

_magicalMonsters.clear();

 

int loaded = 0;

Connection con = null;

 

try

{

con = L2DatabaseFactory.getInstance().getConnection(false);

 

PreparedStatement statement1 = con.prepareStatement("SELECT Distinct key_npc_id FROM four_sepulchers_spawnlist Where spawntype = ? ORDER BY key_npc_id");

statement1.setInt(1, 2);

ResultSet rset1 = statement1.executeQuery();

while (rset1.next())

{

final int keyNpcId = rset1.getInt("key_npc_id");

 

PreparedStatement statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist Where key_npc_id = ? and spawntype = ? ORDER BY id");

statement2.setInt(1, keyNpcId);

statement2.setInt(2, 2);

ResultSet rset2 = statement2.executeQuery();

 

L2Spawn spawnDat;

L2NpcTemplate template1;

 

_magicalSpawns = new FastList<>();

 

while (rset2.next())

{

template1 = NpcTable.getInstance().getTemplate(rset2.getInt("npc_templateid"));

if (template1 != null)

{

spawnDat = new L2Spawn(template1);

spawnDat.setAmount(rset2.getInt("count"));

spawnDat.setLocx(rset2.getInt("locx"));

spawnDat.setLocy(rset2.getInt("locy"));

spawnDat.setLocz(rset2.getInt("locz"));

spawnDat.setHeading(rset2.getInt("heading"));

spawnDat.setRespawnDelay(rset2.getInt("respawn_delay"));

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

_magicalSpawns.add(spawnDat);

loaded++;

}

else

{

LOGGER.warn("FourSepulchersManager.LoadMagicalMonsters: Data missing in NPC table for ID: " + rset2.getInt("npc_templateid") + ".");

}

}

 

rset2.close();

statement2.close();

rset2 = null;

statement2 = null;

_magicalMonsters.put(keyNpcId, _magicalSpawns);

}

 

rset1.close();

statement1.close();

rset1 = null;

statement1 = null;

if (Config.DEBUG)

{

LOGGER.info("FourSepulchersManager: loaded " + loaded + " Magical type monsters spawns.");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

// problem with initializing spawn, go to next one

LOGGER.warn("FourSepulchersManager.LoadMagicalMonsters: Spawn could not be initialized: " + e);

}

finally

{

CloseUtil.close(con);

con = null;

}

}

 

private void loadDukeMonsters()

{

_dukeFinalMobs.clear();

_archonSpawned.clear();

 

int loaded = 0;

Connection con = null;

 

try

{

con = L2DatabaseFactory.getInstance().getConnection(false);

 

PreparedStatement statement1 = con.prepareStatement("SELECT Distinct key_npc_id FROM four_sepulchers_spawnlist Where spawntype = ? ORDER BY key_npc_id");

statement1.setInt(1, 5);

ResultSet rset1 = statement1.executeQuery();

while (rset1.next())

{

final int keyNpcId = rset1.getInt("key_npc_id");

 

PreparedStatement statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist Where key_npc_id = ? and spawntype = ? ORDER BY id");

statement2.setInt(1, keyNpcId);

statement2.setInt(2, 5);

ResultSet rset2 = statement2.executeQuery();

 

L2Spawn spawnDat;

L2NpcTemplate template1;

 

_dukeFinalSpawns = new FastList<>();

 

while (rset2.next())

{

template1 = NpcTable.getInstance().getTemplate(rset2.getInt("npc_templateid"));

if (template1 != null)

{

spawnDat = new L2Spawn(template1);

spawnDat.setAmount(rset2.getInt("count"));

spawnDat.setLocx(rset2.getInt("locx"));

spawnDat.setLocy(rset2.getInt("locy"));

spawnDat.setLocz(rset2.getInt("locz"));

spawnDat.setHeading(rset2.getInt("heading"));

spawnDat.setRespawnDelay(rset2.getInt("respawn_delay"));

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

_dukeFinalSpawns.add(spawnDat);

loaded++;

}

else

{

LOGGER.warn("FourSepulchersManager.LoadDukeMonsters: Data missing in NPC table for ID: " + rset2.getInt("npc_templateid") + ".");

}

}

 

rset2.close();

statement2.close();

rset2 = null;

statement2 = null;

_dukeFinalMobs.put(keyNpcId, _dukeFinalSpawns);

_archonSpawned.put(keyNpcId, false);

}

 

rset1.close();

statement1.close();

rset1 = null;

statement1 = null;

if (Config.DEBUG)

{

LOGGER.info("FourSepulchersManager: loaded " + loaded + " Church of duke monsters spawns.");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

// problem with initializing spawn, go to next one

LOGGER.warn("FourSepulchersManager.LoadDukeMonsters: Spawn could not be initialized: " + e);

}

finally

{

CloseUtil.close(con);

con = null;

}

}

 

private void loadEmperorsGraveMonsters()

{

_emperorsGraveNpcs.clear();

 

int loaded = 0;

Connection con = null;

 

try

{

con = L2DatabaseFactory.getInstance().getConnection(false);

 

PreparedStatement statement1 = con.prepareStatement("SELECT Distinct key_npc_id FROM four_sepulchers_spawnlist Where spawntype = ? ORDER BY key_npc_id");

statement1.setInt(1, 6);

ResultSet rset1 = statement1.executeQuery();

while (rset1.next())

{

final int keyNpcId = rset1.getInt("key_npc_id");

 

PreparedStatement statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist Where key_npc_id = ? and spawntype = ? ORDER BY id");

statement2.setInt(1, keyNpcId);

statement2.setInt(2, 6);

ResultSet rset2 = statement2.executeQuery();

 

L2Spawn spawnDat;

L2NpcTemplate template1;

 

_emperorsGraveSpawns = new FastList<>();

 

while (rset2.next())

{

template1 = NpcTable.getInstance().getTemplate(rset2.getInt("npc_templateid"));

if (template1 != null)

{

spawnDat = new L2Spawn(template1);

spawnDat.setAmount(rset2.getInt("count"));

spawnDat.setLocx(rset2.getInt("locx"));

spawnDat.setLocy(rset2.getInt("locy"));

spawnDat.setLocz(rset2.getInt("locz"));

spawnDat.setHeading(rset2.getInt("heading"));

spawnDat.setRespawnDelay(rset2.getInt("respawn_delay"));

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

_emperorsGraveSpawns.add(spawnDat);

loaded++;

}

else

{

LOGGER.warn("FourSepulchersManager.LoadEmperorsGraveMonsters: Data missing in NPC table for ID: " + rset2.getInt("npc_templateid") + ".");

}

}

 

rset2.close();

statement2.close();

rset2 = null;

statement2 = null;

_emperorsGraveNpcs.put(keyNpcId, _emperorsGraveSpawns);

}

 

rset1.close();

statement1.close();

rset1 = null;

statement1 = null;

if (Config.DEBUG)

{

LOGGER.info("FourSepulchersManager: loaded " + loaded + " Emperor's grave NPC spawns.");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

// problem with initializing spawn, go to next one

LOGGER.warn("FourSepulchersManager.LoadEmperorsGraveMonsters: Spawn could not be initialized: " + e);

}

finally

{

CloseUtil.close(con);

con = null;

}

}

 

protected void initLocationShadowSpawns()

{

final int locNo = Rnd.get(4);

final int[] gateKeeper =

{

31929,

31934,

31939,

31944

};

 

L2Spawn spawnDat;

L2NpcTemplate template;

 

_shadowSpawns.clear();

 

for (int i = 0; i <= 3; i++)

{

template = NpcTable.getInstance().getTemplate(_shadowSpawnLoc[locNo][0]);

if (template != null)

{

try

{

spawnDat = new L2Spawn(template);

spawnDat.setAmount(1);

spawnDat.setLocx(_shadowSpawnLoc[locNo][1]);

spawnDat.setLocy(_shadowSpawnLoc[locNo][2]);

spawnDat.setLocz(_shadowSpawnLoc[locNo][3]);

spawnDat.setHeading(_shadowSpawnLoc[locNo][4]);

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

final int keyNpcId = gateKeeper;

_shadowSpawns.put(keyNpcId, spawnDat);

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("initLocationShadowSpawns:" + e.getMessage());

}

}

else

{

LOGGER.warn("FourSepulchersManager.InitLocationShadowSpawns: Data missing in NPC table for ID: " + _shadowSpawnLoc[locNo][0] + ".");

}

}

}

 

protected void initExecutionerSpawns()

{

L2Spawn spawnDat;

L2NpcTemplate template;

 

for (final int keyNpcId : _victim.keySet())

{

try

{

template = NpcTable.getInstance().getTemplate(_victim.get(keyNpcId));

if (template != null)

{

spawnDat = new L2Spawn(template);

spawnDat.setAmount(1);

spawnDat.setLocx(0);

spawnDat.setLocy(0);

spawnDat.setLocz(0);

spawnDat.setHeading(0);

spawnDat.setRespawnDelay(3600);

SpawnTable.getInstance().addNewSpawn(spawnDat, false);

_executionerSpawns.put(keyNpcId, spawnDat);

}

else

{

LOGGER.warn("FourSepulchersManager.InitExecutionerSpawns: Data missing in NPC table for ID: " + _victim.get(keyNpcId) + ".");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("FourSepulchersManager.InitExecutionerSpawns: Spawn could not be initialized: " + e);

}

}

}

 

public boolean isEntryTime()

{

return _inEntryTime;

}

 

public boolean isAttackTime()

{

return _inAttackTime;

}

 

public synchronized void tryEntry(final L2NpcInstance npc, final L2PcInstance player)

{

final int npcId = npc.getNpcId();

switch (npcId)

{

// ID ok

case 31921:

case 31922:

case 31923:

case 31924:

break;

// ID not ok

default:

if (!player.isGM())

{

LOGGER.warn("Player " + player.getName() + "(" + player.getObjectId() + ") tried to cheat in four sepulchers.");

Util.handleIllegalPlayerAction(player, "Warning!! Character " + player.getName() + " tried to enter four sepulchers with invalid npc id.", Config.DEFAULT_PUNISH);

}

return;

}

 

if (_hallInUse.get(npcId).booleanValue())

{

showHtmlFile(player, npcId + "-FULL.htm", npc, null);

return;

}

 

if (Config.FS_PARTY_MEMBER_COUNT > 1)

{

if (!player.isInParty() || player.getParty().getMemberCount() < Config.FS_PARTY_MEMBER_COUNT)

{

showHtmlFile(player, npcId + "-SP.htm", npc, null);

return;

}

 

if (!player.getParty().isLeader(player))

{

showHtmlFile(player, npcId + "-NL.htm", npc, null);

return;

}

 

for (final L2PcInstance mem : player.getParty().getPartyMembers())

{

final QuestState qs = mem.getQuestState(QUEST_ID);

if (qs == null || !qs.isStarted() && !qs.isCompleted())

{

showHtmlFile(player, npcId + "-NS.htm", npc, mem);

return;

}

 

if (mem.getInventory().getItemByItemId(ENTRANCE_PASS) == null)

{

showHtmlFile(player, npcId + "-SE.htm", npc, mem);

return;

}

 

if (mem.getWeightPenalty() >= 3)

{

mem.sendPacket(new SystemMessage(SystemMessageId.INVENTORY_LESS_THAN_80_PERCENT));

return;

}

}

}

else if (Config.FS_PARTY_MEMBER_COUNT <= 1 && player.isInParty())

{

if (!player.getParty().isLeader(player))

{

showHtmlFile(player, npcId + "-NL.htm", npc, null);

return;

}

for (final L2PcInstance mem : player.getParty().getPartyMembers())

{

final QuestState qs = mem.getQuestState(QUEST_ID);

if (qs == null || !qs.isStarted() && !qs.isCompleted())

{

showHtmlFile(player, npcId + "-NS.htm", npc, mem);

return;

}

 

if (mem.getInventory().getItemByItemId(ENTRANCE_PASS) == null)

{

showHtmlFile(player, npcId + "-SE.htm", npc, mem);

return;

}

 

if (mem.getWeightPenalty() >= 3)

{

mem.sendPacket(new SystemMessage(SystemMessageId.INVENTORY_LESS_THAN_80_PERCENT));

return;

}

}

}

else

{

final QuestState qs = player.getQuestState(QUEST_ID);

if (qs == null || !qs.isStarted() && !qs.isCompleted())

{

showHtmlFile(player, npcId + "-NS.htm", npc, player);

return;

}

 

if (player.getInventory().getItemByItemId(ENTRANCE_PASS) == null)

{

showHtmlFile(player, npcId + "-SE.htm", npc, player);

return;

}

 

if (player.getWeightPenalty() >= 3)

{

player.sendPacket(new SystemMessage(SystemMessageId.INVENTORY_LESS_THAN_80_PERCENT));

return;

}

}

 

if (!isEntryTime())

{

showHtmlFile(player, npcId + "-NE.htm", npc, null);

return;

}

 

showHtmlFile(player, npcId + "-OK.htm", npc, null);

 

entry(npcId, player);

}

 

private void entry(final int npcId, final L2PcInstance player)

{

final int[] Location = _startHallSpawns.get(npcId);

int driftx;

int drifty;

 

if (Config.FS_PARTY_MEMBER_COUNT > 1)

{

List members = new FastList<>();

for (final L2PcInstance mem : player.getParty().getPartyMembers())

{

if (!mem.isDead() && Util.checkIfInRange(700, player, mem, true))

{

members.add(mem);

}

}

 

for (final L2PcInstance mem : members)

{

GrandBossManager.getInstance().getZone(Location[0], Location[1], Location[2]).allowPlayerEntry(mem, 30);

driftx = Rnd.get(-80, 80);

drifty = Rnd.get(-80, 80);

mem.teleToLocation(Location[0] + driftx, Location[1] + drifty, Location[2]);

mem.destroyItemByItemId("Quest", ENTRANCE_PASS, 1, mem, true);

if (mem.getInventory().getItemByItemId(ANTIQUE_BROOCH) == null)

{

mem.addItem("Quest", USED_PASS, 1, mem, true);

}

 

final L2ItemInstance hallsKey = mem.getInventory().getItemByItemId(CHAPEL_KEY);

if (hallsKey != null)

{

mem.destroyItemByItemId("Quest", CHAPEL_KEY, hallsKey.getCount(), mem, true);

}

}

 

members = null;

 

_challengers.remove(npcId);

_challengers.put(npcId, player);

 

_hallInUse.remove(npcId);

_hallInUse.put(npcId, true);

}

else if (Config.FS_PARTY_MEMBER_COUNT <= 1 && player.isInParty())

{

List members = new FastList<>();

for (final L2PcInstance mem : player.getParty().getPartyMembers())

{

if (!mem.isDead() && Util.checkIfInRange(700, player, mem, true))

{

members.add(mem);

}

}

 

for (final L2PcInstance mem : members)

{

GrandBossManager.getInstance().getZone(Location[0], Location[1], Location[2]).allowPlayerEntry(mem, 30);

driftx = Rnd.get(-80, 80);

drifty = Rnd.get(-80, 80);

mem.teleToLocation(Location[0] + driftx, Location[1] + drifty, Location[2]);

mem.destroyItemByItemId("Quest", ENTRANCE_PASS, 1, mem, true);

if (mem.getInventory().getItemByItemId(ANTIQUE_BROOCH) == null)

{

mem.addItem("Quest", USED_PASS, 1, mem, true);

}

 

final L2ItemInstance hallsKey = mem.getInventory().getItemByItemId(CHAPEL_KEY);

if (hallsKey != null)

{

mem.destroyItemByItemId("Quest", CHAPEL_KEY, hallsKey.getCount(), mem, true);

}

}

 

members = null;

 

_challengers.remove(npcId);

_challengers.put(npcId, player);

 

_hallInUse.remove(npcId);

_hallInUse.put(npcId, true);

}

else

{

GrandBossManager.getInstance().getZone(Location[0], Location[1], Location[2]).allowPlayerEntry(player, 30);

driftx = Rnd.get(-80, 80);

drifty = Rnd.get(-80, 80);

player.teleToLocation(Location[0] + driftx, Location[1] + drifty, Location[2]);

player.destroyItemByItemId("Quest", ENTRANCE_PASS, 1, player, true);

if (player.getInventory().getItemByItemId(ANTIQUE_BROOCH) == null)

{

player.addItem("Quest", USED_PASS, 1, player, true);

}

 

L2ItemInstance hallsKey = player.getInventory().getItemByItemId(CHAPEL_KEY);

if (hallsKey != null)

{

player.destroyItemByItemId("Quest", CHAPEL_KEY, hallsKey.getCount(), player, true);

}

 

hallsKey = null;

 

_challengers.remove(npcId);

_challengers.put(npcId, player);

 

_hallInUse.remove(npcId);

_hallInUse.put(npcId, true);

}

}

 

public void spawnMysteriousBox(final int npcId)

{

if (!isAttackTime())

return;

 

L2Spawn spawnDat = _mysteriousBoxSpawns.get(npcId);

if (spawnDat != null)

{

_allMobs.add(spawnDat.doSpawn());

spawnDat.stopRespawn();

}

spawnDat = null;

}

 

public void spawnMonster(final int npcId)

{

if (!isAttackTime())

return;

 

FastList monsterList;

FastList mobs = new FastList<>();

L2Spawn keyBoxMobSpawn;

 

if (Rnd.get(2) == 0)

{

monsterList = _physicalMonsters.get(npcId);

}

else

{

monsterList = _magicalMonsters.get(npcId);

}

 

if (monsterList != null)

{

boolean spawnKeyBoxMob = false;

boolean spawnedKeyBoxMob = false;

 

for (final L2Spawn spawnDat : monsterList)

{

if (spawnedKeyBoxMob)

{

spawnKeyBoxMob = false;

}

else

{

switch (npcId)

{

case 31469:

case 31474:

case 31479:

case 31484:

if (Rnd.get(48) == 0)

{

spawnKeyBoxMob = true;

// LOGGER.info("FourSepulchersManager.SpawnMonster:

// Set to spawn Church of Viscount Key Mob.");

}

break;

default:

spawnKeyBoxMob = false;

}

}

 

L2SepulcherMonsterInstance mob = null;

 

if (spawnKeyBoxMob)

{

try

{

final L2NpcTemplate template = NpcTable.getInstance().getTemplate(18149);

if (template != null)

{

keyBoxMobSpawn = new L2Spawn(template);

keyBoxMobSpawn.setAmount(1);

keyBoxMobSpawn.setLocx(spawnDat.getLocx());

keyBoxMobSpawn.setLocy(spawnDat.getLocy());

keyBoxMobSpawn.setLocz(spawnDat.getLocz());

keyBoxMobSpawn.setHeading(spawnDat.getHeading());

keyBoxMobSpawn.setRespawnDelay(3600);

SpawnTable.getInstance().addNewSpawn(keyBoxMobSpawn, false);

mob = (L2SepulcherMonsterInstance) keyBoxMobSpawn.doSpawn();

keyBoxMobSpawn.stopRespawn();

}

else

{

LOGGER.warn("FourSepulchersManager.SpawnMonster: Data missing in NPC table for ID: 18149");

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("FourSepulchersManager.SpawnMonster: Spawn could not be initialized: " + e);

}

 

spawnedKeyBoxMob = true;

}

else

{

mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();

spawnDat.stopRespawn();

}

 

if (mob != null)

{

mob.mysteriousBoxId = npcId;

switch (npcId)

{

case 31469:

case 31474:

case 31479:

case 31484:

case 31472:

case 31477:

case 31482:

case 31487:

mobs.add(mob);

}

_allMobs.add(mob);

}

}

 

switch (npcId)

{

case 31469:

case 31474:

case 31479:

case 31484:

_viscountMobs.put(npcId, mobs);

break;

 

case 31472:

case 31477:

case 31482:

case 31487:

_dukeMobs.put(npcId, mobs);

break;

}

}

monsterList = null;

mobs = null;

keyBoxMobSpawn = null;

}

 

public synchronized boolean isViscountMobsAnnihilated(final int npcId)

{

FastList mobs = _viscountMobs.get(npcId);

 

if (mobs == null)

return true;

 

for (final L2SepulcherMonsterInstance mob : mobs)

{

if (!mob.isDead())

return false;

}

mobs = null;

 

return true;

}

 

public synchronized boolean isDukeMobsAnnihilated(final int npcId)

{

FastList mobs = _dukeMobs.get(npcId);

 

if (mobs == null)

return true;

 

for (final L2SepulcherMonsterInstance mob : mobs)

{

if (!mob.isDead())

return false;

}

mobs = null;

 

return true;

}

 

public void spawnKeyBox(final L2NpcInstance activeChar)

{

if (!isAttackTime())

return;

 

L2Spawn spawnDat = _keyBoxSpawns.get(activeChar.getNpcId());

 

if (spawnDat != null)

{

spawnDat.setAmount(1);

spawnDat.setLocx(activeChar.getX());

spawnDat.setLocy(activeChar.getY());

spawnDat.setLocz(activeChar.getZ());

spawnDat.setHeading(activeChar.getHeading());

spawnDat.setRespawnDelay(3600);

_allMobs.add(spawnDat.doSpawn());

spawnDat.stopRespawn();

 

spawnDat = null;

}

}

 

public void spawnExecutionerOfHalisha(final L2NpcInstance activeChar)

{

if (!isAttackTime())

return;

 

L2Spawn spawnDat = _executionerSpawns.get(activeChar.getNpcId());

 

if (spawnDat != null)

{

spawnDat.setAmount(1);

spawnDat.setLocx(activeChar.getX());

spawnDat.setLocy(activeChar.getY());

spawnDat.setLocz(activeChar.getZ());

spawnDat.setHeading(activeChar.getHeading());

spawnDat.setRespawnDelay(3600);

_allMobs.add(spawnDat.doSpawn());

spawnDat.stopRespawn();

 

spawnDat = null;

}

}

 

public void spawnArchonOfHalisha(final int npcId)

{

if (!isAttackTime())

return;

 

if (_archonSpawned.get(npcId))

return;

 

FastList monsterList = _dukeFinalMobs.get(npcId);

 

if (monsterList != null)

{

for (final L2Spawn spawnDat : monsterList)

{

final L2SepulcherMonsterInstance mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();

spawnDat.stopRespawn();

 

if (mob != null)

{

mob.mysteriousBoxId = npcId;

_allMobs.add(mob);

}

}

_archonSpawned.put(npcId, true);

monsterList = null;

}

}

 

public void spawnEmperorsGraveNpc(final int npcId)

{

if (!isAttackTime())

return;

 

FastList monsterList = _emperorsGraveNpcs.get(npcId);

 

if (monsterList != null)

{

for (final L2Spawn spawnDat : monsterList)

{

_allMobs.add(spawnDat.doSpawn());

spawnDat.stopRespawn();

}

monsterList = null;

}

}

 

protected void locationShadowSpawns()

{

final int locNo = Rnd.get(4);

// LOGGER.info("FourSepulchersManager.LocationShadowSpawns: Location index

// is " + locNo + ".");

final int[] gateKeeper =

{

31929,

31934,

31939,

31944

};

 

L2Spawn spawnDat;

 

for (int i = 0; i <= 3; i++)

{

final int keyNpcId = gateKeeper;

spawnDat = _shadowSpawns.get(keyNpcId);

spawnDat.setLocx(_shadowSpawnLoc[locNo][1]);

spawnDat.setLocy(_shadowSpawnLoc[locNo][2]);

spawnDat.setLocz(_shadowSpawnLoc[locNo][3]);

spawnDat.setHeading(_shadowSpawnLoc[locNo][4]);

_shadowSpawns.put(keyNpcId, spawnDat);

}

spawnDat = null;

}

 

public void spawnShadow(final int npcId)

{

if (!isAttackTime())

return;

 

L2Spawn spawnDat = _shadowSpawns.get(npcId);

if (spawnDat != null)

{

final L2SepulcherMonsterInstance mob = (L2SepulcherMonsterInstance) spawnDat.doSpawn();

spawnDat.stopRespawn();

 

if (mob != null)

{

mob.mysteriousBoxId = npcId;

_allMobs.add(mob);

}

spawnDat = null;

}

}

 

public void deleteAllMobs()

{

for (final L2NpcInstance mob : _allMobs)

{

try

{

mob.getSpawn().stopRespawn();

mob.deleteMe();

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("deleteAllMobs: " + e.getMessage());

}

}

_allMobs.clear();

}

 

protected void closeAllDoors()

{

for (final int doorId : _hallGateKeepers.values())

{

final L2DoorInstance door = DoorTable.getInstance().getDoor(doorId);

try

{

if (door != null)

{

door.closeMe();

}

else

{

LOGGER.warn("Ahenbek ashelbek! Shaitanama!! " + doorId);

}

}

catch (final Exception e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("Failed closing door " + doorId + " - " + e.getMessage());

}

}

}

 

protected byte minuteSelect(byte min)

{

if ((double) min % 5 != 0)// if doesn't divides on 5 fully

{

// mad table for selecting proper minutes...

// may be there is a better way to do this

switch (min)

{

case 6:

case 7:

min = 5;

break;

case 8:

case 9:

case 11:

case 12:

min = 10;

break;

case 13:

case 14:

case 16:

case 17:

min = 15;

break;

case 18:

case 19:

case 21:

case 22:

min = 20;

break;

case 23:

case 24:

case 26:

case 27:

min = 25;

break;

case 28:

case 29:

case 31:

case 32:

min = 30;

break;

case 33:

case 34:

case 36:

case 37:

min = 35;

break;

case 38:

case 39:

case 41:

case 42:

min = 40;

break;

case 43:

case 44:

case 46:

case 47:

min = 45;

break;

case 48:

case 49:

case 51:

case 52:

min = 50;

break;

case 53:

case 54:

case 56:

case 57:

min = 55;

break;

}

}

return min;

}

 

public void managerSay(byte min)

{

// for attack phase, sending message every 5 minutes

if (_inAttackTime)

{

if (min < 5)

return; // do not shout when < 5 minutes

 

min = minuteSelect(min);

String msg = min + " minute(s) have passed."; // now this is a proper message^^

if (min == 90)

{

msg = "Game over. The teleport will appear momentarily";

}

 

for (final L2Spawn temp : _managers)

{

if (temp == null)

{

LOGGER.warn("FourSepulchersManager: managerSay(): manager is null");

continue;

}

if (!(temp.getLastSpawn() instanceof L2SepulcherNpcInstance))

{

LOGGER.warn("FourSepulchersManager: managerSay(): manager is not Sepulcher instance");

continue;

}

// hall not used right now, so its manager will not tell you

// anything :)

// if you don't need this - delete next two lines.

if (!_hallInUse.get(temp.getNpcid()).booleanValue())

{

continue;

}

 

((L2SepulcherNpcInstance) temp.getLastSpawn()).sayInShout(msg);

}

}

 

else if (_inEntryTime)

{

final String msg1 = "You may now enter the Sepulcher";

final String msg2 = "If you place your hand on the stone statue in front of each sepulcher," + " you will be able to enter";

 

for (final L2Spawn temp : _managers)

{

if (temp == null)

{

LOGGER.warn("FourSepulchersManager: Something goes wrong in managerSay()...");

continue;

}

if (!(temp.getLastSpawn() instanceof L2SepulcherNpcInstance))

{

LOGGER.warn("FourSepulchersManager: Something goes wrong in managerSay()...");

continue;

}

((L2SepulcherNpcInstance) temp.getLastSpawn()).sayInShout(msg1);

((L2SepulcherNpcInstance) temp.getLastSpawn()).sayInShout(msg2);

}

}

}

 

protected class ManagerSay implements Runnable

{

@Override

public void run()

{

if (_inAttackTime)

{

Calendar tmp = Calendar.getInstance();

tmp.setTimeInMillis(Calendar.getInstance().getTimeInMillis() - _warmUpTimeEnd);

if (tmp.get(Calendar.MINUTE) + 5 < Config.FS_TIME_ATTACK)

{

managerSay((byte) tmp.get(Calendar.MINUTE)); // byte

// because

// minute

// cannot be

// more than

// 59

ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 5 * 60000);

}

// attack time ending chat

else if (tmp.get(Calendar.MINUTE) + 5 >= Config.FS_TIME_ATTACK)

{

managerSay((byte) 90); // sending a unique id :D

}

tmp = null;

}

else if (_inEntryTime)

{

managerSay((byte) 0);

}

}

}

 

protected class ChangeEntryTime implements Runnable

{

@Override

public void run()

{

// LOGGER.info("FourSepulchersManager:In Entry Time");

_inEntryTime = true;

_inWarmUpTime = false;

_inAttackTime = false;

_inCoolDownTime = false;

 

long interval = 0;

// if this is first launch - search time when entry time will be

// ended:

// counting difference between time when entry time ends and current

// time

// and then launching change time task

if (_firstTimeRun)

{

interval = _entryTimeEnd - Calendar.getInstance().getTimeInMillis();

}

else

{

interval = Config.FS_TIME_ENTRY * 60000; // else use stupid

// method

}

 

// launching saying process...

ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 0);

_changeWarmUpTimeTask = ThreadPoolManager.getInstance().scheduleEffect(new ChangeWarmUpTime(), interval);

if (_changeEntryTimeTask != null)

{

_changeEntryTimeTask.cancel(true);

_changeEntryTimeTask = null;

}

 

}

}

 

protected class ChangeWarmUpTime implements Runnable

{

@Override

public void run()

{

// LOGGER.info("FourSepulchersManager:In Warm-Up Time");

_inEntryTime = true;

_inWarmUpTime = false;

_inAttackTime = false;

_inCoolDownTime = false;

 

long interval = 0;

// searching time when warmup time will be ended:

// counting difference between time when warmup time ends and

// current time

// and then launching change time task

if (_firstTimeRun)

{

interval = _warmUpTimeEnd - Calendar.getInstance().getTimeInMillis();

}

else

{

interval = Config.FS_TIME_WARMUP * 60000;

}

_changeAttackTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeAttackTime(), interval);

 

if (_changeWarmUpTimeTask != null)

{

_changeWarmUpTimeTask.cancel(true);

_changeWarmUpTimeTask = null;

}

}

}

 

protected class ChangeAttackTime implements Runnable

{

@Override

public void run()

{

// LOGGER.info("FourSepulchersManager:In Attack Time");

_inEntryTime = false;

_inWarmUpTime = false;

_inAttackTime = true;

_inCoolDownTime = false;

 

locationShadowSpawns();

 

spawnMysteriousBox(31921);

spawnMysteriousBox(31922);

spawnMysteriousBox(31923);

spawnMysteriousBox(31924);

 

if (!_firstTimeRun)

{

_warmUpTimeEnd = Calendar.getInstance().getTimeInMillis();

}

 

long interval = 0;

// say task

if (_firstTimeRun)

{

for (double min = Calendar.getInstance().get(Calendar.MINUTE); min < _newCycleMin; min++)

{

// looking for next shout time....

if (min % 5 == 0)// check if min can be divided by 5

{

// LOGGER.info(Calendar.getInstance().getTime()

// + " Atk announce scheduled to " + min

// + " minute of this hour.");

final Calendar inter = Calendar.getInstance();

inter.set(Calendar.MINUTE, (int) min);

ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());

break;

}

}

}

else

{

ThreadPoolManager.getInstance().scheduleGeneral(new ManagerSay(), 5 * 60400);

}

// searching time when attack time will be ended:

// counting difference between time when attack time ends and

// current time

// and then launching change time task

if (_firstTimeRun)

{

interval = _attackTimeEnd - Calendar.getInstance().getTimeInMillis();

}

else

{

interval = Config.FS_TIME_ATTACK * 60000;

}

_changeCoolDownTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeCoolDownTime(), interval);

 

if (_changeAttackTimeTask != null)

{

_changeAttackTimeTask.cancel(true);

_changeAttackTimeTask = null;

}

}

}

 

protected class ChangeCoolDownTime implements Runnable

{

@Override

public void run()

{

// LOGGER.info("FourSepulchersManager:In Cool-Down Time");

_inEntryTime = false;

_inWarmUpTime = false;

_inAttackTime = false;

_inCoolDownTime = true;

 

clean();

 

Calendar time = Calendar.getInstance();

// one hour = 55th min to 55 min of next hour, so we check for this,

// also check for first launch

if (Calendar.getInstance().get(Calendar.MINUTE) > _newCycleMin && !_firstTimeRun)

{

time.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) + 1);

}

time.set(Calendar.MINUTE, _newCycleMin);

// LOGGER.info("FourSepulchersManager: Entry time: " + time.getTime());

if (_firstTimeRun)

{

_firstTimeRun = false; // cooldown phase ends event hour, so it

// will be not first run

}

 

final long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();

_changeEntryTimeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeEntryTime(), interval);

 

if (_changeCoolDownTimeTask != null)

{

_changeCoolDownTimeTask.cancel(true);

_changeCoolDownTimeTask = null;

}

time = null;

}

}

 

public Map getHallGateKeepers()

{

return _hallGateKeepers;

}

 

public void showHtmlFile(final L2PcInstance player, final String file, final L2NpcInstance npc, final L2PcInstance member)

{

NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());

html.setFile("data/html/SepulcherNpc/" + file);

if (member != null)

{

html.replace("%member%", member.getName());

}

player.sendPacket(html);

html = null;

}

 

private static class SingletonHolder

{

protected static final FourSepulchersManager _instance = new FourSepulchersManager();

}

}

 

,>,>,>,>,>,>,>,>,>,>,>,>,>,>,>,>,>,>

Editado por caique156
Link para o comentário
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.






  • Patrocinadores

  • Quem Está Navegando

    • Nenhum usuário registrado visualizando esta página.
  • Posts

    • Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?    
    • muchas gracias muy lindos NPC 🙂
    • relaxa jovem gafanhoto, testa as quests. e posTa os erros indesejaveis.  
    • Se alguém pudesse me ensinar como codificar as missões, eu ficaria feliz em fazer isso sozinho ou pelo menos ajudar. Eu realmente quero jogar em um servidor onde todas as quests funcionem bem e melhor ainda se você puder fazer quests customizadas!
    • mas no interlude, nem todas as quests de class,  vai mostrar onde tem que ir, ate o reborn nao mostrava quando era interlude, só mostrou depois que eles colocaram client classic pra rodar, e ficou melhor ainda quando virou hellbound em diante, mas ha sim alguma chance de modificar isso direto no script para fazer igualmente, só basta te um pouco de paciencia e persistencia exato
    • 408_PathToElvenwizard dá Orion eu tive que mexer tbm, até modifiquei e consegui deixar ela igual do Classic, com a seta e a marcação no mapa. (não retail IL) Dá pra importar py de várias revs, o foda é que não da regular as quest py através do debug em tempo real, pelo menos eu não consegui rsrs
    • Hasta el momento todas las QUESTS son completables si te guias con un tutorial de youtube. El problema es que tienen bugs de locacion y de subquests que no avanzan o no te marcan correctamente a donde ir en el mapa, cosa que en Retail si se ve como corresponde.
    • estranho, mas pelo menos a galera nunca reclamo das quests quando tinha aberto 5x, geral fez class primeira e segunda job, poucos que compraram a class
    • en RUSaCis-3.5 data pack, las Quests estan en formato .java y son diferentes a como estan redactadas en jOrion y jFrozen 1.5 (ProyectX) package net.sf.l2j.gameserver.scripting.quest; import net.sf.l2j.commons.random.Rnd; import net.sf.l2j.gameserver.enums.Paperdoll; import net.sf.l2j.gameserver.enums.QuestStatus; import net.sf.l2j.gameserver.enums.actors.ClassId; import net.sf.l2j.gameserver.model.actor.Creature; import net.sf.l2j.gameserver.model.actor.Npc; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.network.serverpackets.SocialAction; import net.sf.l2j.gameserver.scripting.QuestState; public class Q224_TestOfSagittarius extends SecondClassQuest { private static final String QUEST_NAME = "Q224_TestOfSagittarius"; // Items private static final int BERNARD_INTRODUCTION = 3294; private static final int HAMIL_LETTER_1 = 3295; private static final int HAMIL_LETTER_2 = 3296; private static final int HAMIL_LETTER_3 = 3297; private static final int HUNTER_RUNE_1 = 3298; private static final int HUNTER_RUNE_2 = 3299; private static final int TALISMAN_OF_KADESH = 3300; private static final int TALISMAN_OF_SNAKE = 3301; private static final int MITHRIL_CLIP = 3302; private static final int STAKATO_CHITIN = 3303; private static final int REINFORCED_BOWSTRING = 3304; private static final int MANASHEN_HORN = 3305; private static final int BLOOD_OF_LIZARDMAN = 3306; private static final int CRESCENT_MOON_BOW = 3028; private static final int WOODEN_ARROW = 17; // Rewards private static final int MARK_OF_SAGITTARIUS = 3293; // NPCs private static final int BERNARD = 30702; private static final int HAMIL = 30626; private static final int SIR_ARON_TANFORD = 30653; private static final int VOKIAN = 30514; private static final int GAUEN = 30717; // Monsters private static final int ANT = 20079; private static final int ANT_CAPTAIN = 20080; private static final int ANT_OVERSEER = 20081; private static final int ANT_RECRUIT = 20082; private static final int ANT_PATROL = 20084; private static final int ANT_GUARD = 20086; private static final int NOBLE_ANT = 20089; private static final int NOBLE_ANT_LEADER = 20090; private static final int BREKA_ORC_SHAMAN = 20269; private static final int BREKA_ORC_OVERLORD = 20270; private static final int MARSH_STAKATO_WORKER = 20230; private static final int MARSH_STAKATO_SOLDIER = 20232; private static final int MARSH_STAKATO_DRONE = 20234; private static final int MARSH_SPIDER = 20233; private static final int ROAD_SCAVENGER = 20551; private static final int MANASHEN_GARGOYLE = 20563; private static final int LETO_LIZARDMAN = 20577; private static final int LETO_LIZARDMAN_ARCHER = 20578; private static final int LETO_LIZARDMAN_SOLDIER = 20579; private static final int LETO_LIZARDMAN_WARRIOR = 20580; private static final int LETO_LIZARDMAN_SHAMAN = 20581; private static final int LETO_LIZARDMAN_OVERLORD = 20582; private static final int SERPENT_DEMON_KADESH = 27090; public Q224_TestOfSagittarius() { super(224, "Test Of Sagittarius"); setItemsIds(BERNARD_INTRODUCTION, HAMIL_LETTER_1, HAMIL_LETTER_2, HAMIL_LETTER_3, HUNTER_RUNE_1, HUNTER_RUNE_2, TALISMAN_OF_KADESH, TALISMAN_OF_SNAKE, MITHRIL_CLIP, STAKATO_CHITIN, REINFORCED_BOWSTRING, MANASHEN_HORN, BLOOD_OF_LIZARDMAN, CRESCENT_MOON_BOW); addQuestStart(BERNARD); addTalkId(BERNARD, HAMIL, SIR_ARON_TANFORD, VOKIAN, GAUEN); addMyDying(ANT, ANT_CAPTAIN, ANT_OVERSEER, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, NOBLE_ANT, NOBLE_ANT_LEADER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, MARSH_SPIDER, ROAD_SCAVENGER, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SERPENT_DEMON_KADESH); } @Override public String onAdvEvent(String event, Npc npc, Player player) { String htmltext = event; QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; // BERNARD if (event.equalsIgnoreCase("30702-04.htm")) { st.setState(QuestStatus.STARTED); st.setCond(1); playSound(player, SOUND_ACCEPT); giveItems(player, BERNARD_INTRODUCTION, 1); if (giveDimensionalDiamonds39(player)) htmltext = "30702-04a.htm"; } // HAMIL else if (event.equalsIgnoreCase("30626-03.htm")) { st.setCond(2); playSound(player, SOUND_MIDDLE); takeItems(player, BERNARD_INTRODUCTION, 1); giveItems(player, HAMIL_LETTER_1, 1); } else if (event.equalsIgnoreCase("30626-07.htm")) { st.setCond(5); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_1, 10); giveItems(player, HAMIL_LETTER_2, 1); } // SIR_ARON_TANFORD else if (event.equalsIgnoreCase("30653-02.htm")) { st.setCond(3); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_1, 1); } // VOKIAN else if (event.equalsIgnoreCase("30514-02.htm")) { st.setCond(6); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_2, 1); } return htmltext; } @Override public String onTalk(Npc npc, Player player) { String htmltext = getNoQuestMsg(); QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; switch (st.getState()) { case CREATED: if (player.getClassId() != ClassId.ROGUE && player.getClassId() != ClassId.ELVEN_SCOUT && player.getClassId() != ClassId.ASSASSIN) htmltext = "30702-02.htm"; else if (player.getStatus().getLevel() < 39) htmltext = "30702-01.htm"; else htmltext = "30702-03.htm"; break; case STARTED: int cond = st.getCond(); switch (npc.getNpcId()) { case BERNARD: htmltext = "30702-05.htm"; break; case HAMIL: if (cond == 1) htmltext = "30626-01.htm"; else if (cond == 2 || cond == 3) htmltext = "30626-04.htm"; else if (cond == 4) htmltext = "30626-05.htm"; else if (cond > 4 && cond < 8) htmltext = "30626-08.htm"; else if (cond == 8) { htmltext = "30626-09.htm"; st.setCond(9); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_2, 10); giveItems(player, HAMIL_LETTER_3, 1); } else if (cond > 8 && cond < 12) htmltext = "30626-10.htm"; else if (cond == 12) { htmltext = "30626-11.htm"; st.setCond(13); playSound(player, SOUND_MIDDLE); } else if (cond == 13) htmltext = "30626-12.htm"; else if (cond == 14) { htmltext = "30626-13.htm"; takeItems(player, BLOOD_OF_LIZARDMAN, -1); takeItems(player, CRESCENT_MOON_BOW, 1); takeItems(player, TALISMAN_OF_KADESH, 1); giveItems(player, MARK_OF_SAGITTARIUS, 1); rewardExpAndSp(player, 54726, 20250); player.broadcastPacket(new SocialAction(player, 3)); playSound(player, SOUND_FINISH); st.exitQuest(false); } break; case SIR_ARON_TANFORD: if (cond == 2) htmltext = "30653-01.htm"; else if (cond > 2) htmltext = "30653-03.htm"; break; case VOKIAN: if (cond == 5) htmltext = "30514-01.htm"; else if (cond == 6) htmltext = "30514-03.htm"; else if (cond == 7) { htmltext = "30514-04.htm"; st.setCond(8); playSound(player, SOUND_MIDDLE); takeItems(player, TALISMAN_OF_SNAKE, 1); } else if (cond > 7) htmltext = "30514-05.htm"; break; case GAUEN: if (cond == 9) { htmltext = "30717-01.htm"; st.setCond(10); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_3, 1); } else if (cond == 10) htmltext = "30717-03.htm"; else if (cond == 11) { htmltext = "30717-02.htm"; st.setCond(12); playSound(player, SOUND_MIDDLE); takeItems(player, MANASHEN_HORN, 1); takeItems(player, MITHRIL_CLIP, 1); takeItems(player, REINFORCED_BOWSTRING, 1); takeItems(player, STAKATO_CHITIN, 1); giveItems(player, CRESCENT_MOON_BOW, 1); giveItems(player, WOODEN_ARROW, 10); } else if (cond > 11) htmltext = "30717-04.htm"; break; } break; case COMPLETED: htmltext = getAlreadyCompletedMsg(); break; } return htmltext; } @Override public void onMyDying(Npc npc, Creature killer) { final Player player = killer.getActingPlayer(); final QuestState st = checkPlayerState(player, npc, QuestStatus.STARTED); if (st == null) return; switch (npc.getNpcId()) { case ANT: case ANT_CAPTAIN: case ANT_OVERSEER: case ANT_RECRUIT: case ANT_PATROL: case ANT_GUARD: case NOBLE_ANT: case NOBLE_ANT_LEADER: if (st.getCond() == 3 && dropItems(player, HUNTER_RUNE_1, 1, 10, 500000)) st.setCond(4); break; case BREKA_ORC_SHAMAN: case BREKA_ORC_OVERLORD: if (st.getCond() == 6 && dropItems(player, HUNTER_RUNE_2, 1, 10, 500000)) { st.setCond(7); giveItems(player, TALISMAN_OF_SNAKE, 1); } break; case MARSH_STAKATO_WORKER: case MARSH_STAKATO_SOLDIER: case MARSH_STAKATO_DRONE: if (st.getCond() == 10 && dropItems(player, STAKATO_CHITIN, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING)) st.setCond(11); break; case MARSH_SPIDER: if (st.getCond() == 10 && dropItems(player, REINFORCED_BOWSTRING, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case ROAD_SCAVENGER: if (st.getCond() == 10 && dropItems(player, MITHRIL_CLIP, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN)) st.setCond(11); break; case MANASHEN_GARGOYLE: if (st.getCond() == 10 && dropItems(player, MANASHEN_HORN, 1, 1, 100000) && player.getInventory().hasItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case LETO_LIZARDMAN: case LETO_LIZARDMAN_ARCHER: case LETO_LIZARDMAN_SOLDIER: case LETO_LIZARDMAN_WARRIOR: case LETO_LIZARDMAN_SHAMAN: case LETO_LIZARDMAN_OVERLORD: if (st.getCond() == 13) { if (((player.getInventory().getItemCount(BLOOD_OF_LIZARDMAN) - 120) * 5) > Rnd.get(100)) { playSound(player, SOUND_BEFORE_BATTLE); takeItems(player, BLOOD_OF_LIZARDMAN, -1); addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } else dropItemsAlways(player, BLOOD_OF_LIZARDMAN, 1, 0); } break; case SERPENT_DEMON_KADESH: if (st.getCond() == 13) { if (player.getInventory().getItemIdFrom(Paperdoll.RHAND) == CRESCENT_MOON_BOW) { st.setCond(14); playSound(player, SOUND_MIDDLE); giveItems(player, TALISMAN_OF_KADESH, 1); } else addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } break; } } }  
×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.