Ir para conteúdo
  • Cadastre-se
  • 0

Problemas Com Zaken


SCRASH0

Pergunta

Estou com um Bug Chato Na Frozen.
Quando Cria o server, Vai no zaken. pela primeira vez ele ta lá da //recall_npc. e puxa ele. ele Vem normal.

depois que mata ele,pela primeira vez. quando da spawn, ele não aparece mas só diz q ta Vivo. mas da /target nele aparece o nome dele mas ele não aparece, nem da pra puxa ele, da Alvo invalido.

esse error fecho meu server uma vez na rev 1118.

Auguem pode me ajuda?.


NINGUEM PODE AJUDAR?

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

5 respostass a esta questão

Posts recomendados


  • 0

por favor me informe o time que você olha ele no server? bom se for de dia ele não aparece somente a noite OBS bom Ok.

 

OBS mesmo com o ADM não consegui visualizar ele á nao ser que você crie outro Zaken e edite ele para que nao tenha essa skill igual ao do original por ele tem ela de sumir.

Editado por DanielSantos

Obrigado vira em Breve


azc67n.png


Clique em Curti para Motivar Muitos outros a tbm Fazer o Mesmo pois assim Motiva a Responder :onda:

Link para o comentário
Compartilhar em outros sites

  • 0

Testado e aprovado uso ele na minha acis !! mude os imports porque foi do projeto de marcos ai já ta pra frozen

 

 

/*
* L2jProject x - www.l2jprojectx.com
*
* 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 net.l2jpx.gameserver.ai.special;

import org.apache.log4j.Logger;

import net.l2jpx.Config;
import net.l2jpx.gameserver.ai.CtrlIntention;
import net.l2jpx.gameserver.controllers.GameTimeController;
import net.l2jpx.gameserver.datatables.SkillTable;
import net.l2jpx.gameserver.datatables.xml.DoorData;
import net.l2jpx.gameserver.managers.GrandBossManager;
import net.l2jpx.gameserver.model.L2Attackable;
import net.l2jpx.gameserver.model.L2Character;
import net.l2jpx.gameserver.model.L2Effect;
import net.l2jpx.gameserver.model.L2Skill;
import net.l2jpx.gameserver.model.actor.instance.L2GrandBossInstance;
import net.l2jpx.gameserver.model.actor.instance.L2NpcInstance;
import net.l2jpx.gameserver.model.actor.instance.L2PcInstance;
import net.l2jpx.gameserver.model.quest.Quest;
import net.l2jpx.gameserver.model.zone.type.L2BossZone;
import net.l2jpx.gameserver.network.serverpackets.PlaySound;
import net.l2jpx.gameserver.templates.StatsSet;
import net.l2jpx.gameserver.thread.ThreadPoolManager;
import net.l2jpx.util.random.Rnd;

/**
* Zaken AI
*/
public class Zaken extends Quest implements Runnable
{
protected static final Logger LOGGER = Logger.getLogger(Zaken.class);

private int _1001 = 0; // used for first cancel of QuestTimer "1001"
private int _ai0 = 0; // used for zaken coords updater
private int _ai1 = 0; // used for X coord tracking for non-random teleporting in zaken's self teleport skill
private int _ai2 = 0; // used for Y coord tracking for non-random teleporting in zaken's self teleport skill
private int _ai3 = 0; // used for Z coord tracking for non-random teleporting in zaken's self teleport skill
private int _ai4 = 0; // used for spawning minions cycles
private int _quest0 = 0; // used for teleporting progress
private int _quest1 = 0; // used for most hated players progress
private int _quest2 = 0; // used for zaken HP check for teleport
private L2PcInstance c_quest0 = null; // 1st player used for area teleport
private L2PcInstance c_quest1 = null; // 2nd player used for area teleport
private L2PcInstance c_quest2 = null; // 3rd player used for area teleport
private L2PcInstance c_quest3 = null; // 4th player used for area teleport
private L2PcInstance c_quest4 = null; // 5th player used for area teleport
private static final int ZAKEN = 29022;
private static final int doll_blader_b = 29023;
private static final int vale_master_b = 29024;
private static final int pirates_zombie_captain_b = 29026;
private static final int pirates_zombie_b = 29027;
private static final int[] Xcoords =
{
53950,
55980,
54950,
55970,
53930,
55970,
55980,
54960,
53950,
53930,
55970,
55980,
54960,
53950,
53930
};
private static final int[] Ycoords =
{
219860,
219820,
218790,
217770,
217760,
217770,
219920,
218790,
219860,
217760,
217770,
219920,
218790,
219860,
217760
};
private static final int[] Zcoords =
{
-3488,
-3488,
-3488,
-3488,
-3488,
-3216,
-3216,
-3216,
-3216,
-3216,
-2944,
-2944,
-2944,
-2944,
-2944
};

// ZAKEN Status Tracking :
private static final byte ALIVE = 0; // Zaken is spawned.
private static final byte DEAD = 1; // Zaken has been killed.

private static L2BossZone _Zone;

public Zaken(final int questId, final String name, final String descr)
{
super(questId, name, descr);

// Zaken doors handling
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
{
@Override
public void run()
{
try
{
if (getTimeHour() == 0)
{
LOGGER.info("Zaken door id 21240006 opened, game time 00.00.");
DoorData.getInstance().getDoor(21240006).openMe();
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
@Override
public void run()
{
try
{
LOGGER.info("Zaken door id 21240006 closed.");
DoorData.getInstance().getDoor(21240006).closeMe();
}
catch (final Throwable e)
{
if (Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();

LOGGER.warn("Cannot close door ID: 21240006 " + e);
}
}
}, 300000L);
}
}
catch (final Throwable e)
{
if (Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();

LOGGER.warn("Cannot open door ID: 21240006 " + e);
}
}
}, 2000L, 600000L);

addEventId(ZAKEN, Quest.QuestEventType.ON_KILL);
addEventId(ZAKEN, Quest.QuestEventType.ON_ATTACK);

_Zone = GrandBossManager.getInstance().getZone(55312, 219168, -3223);

final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN);
if (status == DEAD)
{
// load the unlock date and time for zaken from DB
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
// if zaken is locked until a certain time, mark it so and start the unlock timer
// the unlock time has not yet expired.
if (temp > 0)
startQuestTimer("zaken_unlock", temp, null, null);
else
{
// the time has already expired while the server was offline. Immediately spawn zaken.
final L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
spawnBoss(zaken);
}
}
else
{
final int loc_x = info.getInteger("loc_x");
final int loc_y = info.getInteger("loc_y");
final int loc_z = info.getInteger("loc_z");
final int heading = info.getInteger("heading");
final int hp = info.getInteger("currentHP");
final int mp = info.getInteger("currentMP");
final L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, loc_x, loc_y, loc_z, heading, false, 0);
zaken.setCurrentHpMp(hp, mp);
spawnBoss(zaken);
}
}

public void spawnBoss(final L2GrandBossInstance npc)
{
if (npc == null)
{
LOGGER.warn("Zaken AI failed to load, missing Zaken in grandboss_data.sql");
return;
}
GrandBossManager.getInstance().addBoss(npc);

npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
_ai0 = 0;
_ai1 = npc.getX();
_ai2 = npc.getY();
_ai3 = npc.getZ();
_quest0 = 0;
_quest1 = 0;
_quest2 = 3;
if (_Zone == null)
{
LOGGER.warn("Zaken AI failed to load, missing zone for Zaken");
return;
}
if (_Zone.isInsideZone(npc))
{
_ai4 = 1;
startQuestTimer("1003", 1700, null, null);
}
_1001 = 1;
startQuestTimer("1001", 1000, npc, null); // buffs,random teleports
}

@Override
public String onAdvEvent(final String event, final L2NpcInstance npc, final L2PcInstance player)
{
final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN);

if (status == DEAD && event == null || !event.equalsIgnoreCase("zaken_unlock"))
return super.onAdvEvent(event, npc, player);

if (event.equalsIgnoreCase("1001"))
{
if (_1001 == 1)
{
_1001 = 0;
cancelQuestTimer("1001", npc, null);
}
int sk_4223 = 0;
int sk_4227 = 0;
final L2Effect[] effects = npc.getAllEffects();
if (effects != null && effects.length != 0)
{
for (final L2Effect e : effects)
{
if (e.getSkill().getId() == 4227)
{
sk_4227 = 1;
}
if (e.getSkill().getId() == 4223)
{
sk_4223 = 1;
}
}
}
if (getTimeHour() < 5)
{
if (sk_4223 == 1) // use night face if zaken have day face
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4224, 1));
_ai1 = npc.getX();
_ai2 = npc.getY();
_ai3 = npc.getZ();
}
if (sk_4227 == 0) // use zaken regeneration
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4227, 1));
}
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _ai0 == 0)
{
int i0 = 0;
int i1 = 1;
if (((L2Attackable) npc).getMostHated() != null)
{
if ((((((L2Attackable) npc).getMostHated().getX() - _ai1) * (((L2Attackable) npc).getMostHated().getX() - _ai1)) + ((((L2Attackable) npc).getMostHated().getY() - _ai2) * (((L2Attackable) npc).getMostHated().getY() - _ai2))) > (1500 * 1500))
i0 = 1;
else
i0 = 0;
if (i0 == 0)
i1 = 0;
if (_quest0 > 0)
{
if (c_quest0 == null)
i0 = 0;
else if ((((c_quest0.getX() - _ai1) * (c_quest0.getX() - _ai1)) + ((c_quest0.getY() - _ai2) * (c_quest0.getY() - _ai2))) > (1500 * 1500))
i0 = 1;
else
i0 = 0;
if (i0 == 0)
i1 = 0;
}
if (_quest0 > 1)
{
if (c_quest1 == null)
i0 = 0;
else if ((((c_quest1.getX() - _ai1) * (c_quest1.getX() - _ai1)) + ((c_quest1.getY() - _ai2) * (c_quest1.getY() - _ai2))) > (1500 * 1500))
i0 = 1;
else
i0 = 0;
if (i0 == 0)
i1 = 0;
}
if (_quest0 > 2)
{
if (c_quest2 == null)
i0 = 0;
else if ((((c_quest2.getX() - _ai1) * (c_quest2.getX() - _ai1)) + ((c_quest2.getY() - _ai2) * (c_quest2.getY() - _ai2))) > (1500 * 1500))
i0 = 1;
else
i0 = 0;
if (i0 == 0)
i1 = 0;
}
if (_quest0 > 3)
{
if (c_quest3 == null)
i0 = 0;
else if ((((c_quest3.getX() - _ai1) * (c_quest3.getX() - _ai1)) + ((c_quest3.getY() - _ai2) * (c_quest3.getY() - _ai2))) > (1500 * 1500))
i0 = 1;
else
i0 = 0;
if (i0 == 0)
i1 = 0;
}
if (_quest0 > 4)
{
if (c_quest4 == null)
i0 = 0;
else if ((((c_quest4.getX() - _ai1) * (c_quest4.getX() - _ai1)) + ((c_quest4.getY() - _ai2) * (c_quest4.getY() - _ai2))) > (1500 * 1500))
i0 = 1;
else
i0 = 0;
if (i0 == 0)
i1 = 0;
}
if (i1 == 1)
{
_quest0 = 0;
final int i2 = Rnd.get(15);
_ai1 = Xcoords[i2] + Rnd.get(650);
_ai2 = Ycoords[i2] + Rnd.get(650);
_ai3 = Zcoords[i2];
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
}
}
}
if (Rnd.get(20) < 1 && _ai0 == 0)
{
_ai1 = npc.getX();
_ai2 = npc.getY();
_ai3 = npc.getZ();
}
L2Character c_ai0 = null;
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 == 0)
{
if (((L2Attackable) npc).getMostHated() != null)
{
c_ai0 = ((L2Attackable) npc).getMostHated();
_quest1 = 1;
}
}
else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 != 0)
{
if (((L2Attackable) npc).getMostHated() != null)
{
if (c_ai0 == ((L2Attackable) npc).getMostHated())
{
_quest1 = (_quest1 + 1);
}
else
{
_quest1 = 1;
c_ai0 = ((L2Attackable) npc).getMostHated();
}
}
}
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
{
_quest1 = 0;
}
if (_quest1 > 5)
{
((L2Attackable) npc).stopHating(c_ai0);
final L2Character nextTarget = ((L2Attackable) npc).getMostHated();
if (nextTarget != null)
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
_quest1 = 0;
}
}
else if (sk_4223 == 0) // use day face if not night time
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4223, 1));
_quest2 = 3;
}
if (sk_4227 == 1) // when switching to day time, cancel zaken night regen
{
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4242, 1));
}
if (Rnd.get(40) < 1)
{
final int i2 = Rnd.get(15);
_ai1 = Xcoords[i2] + Rnd.get(650);
_ai2 = Ycoords[i2] + Rnd.get(650);
_ai3 = Zcoords[i2];
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
}
startQuestTimer("1001", 30000, npc, null);
}
if (event.equalsIgnoreCase("1002"))
{
_quest0 = 0;
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
_ai0 = 0;
}
if (event.equalsIgnoreCase("1003"))
{
if (_ai4 == 1)
{
final int rr = Rnd.get(15);
addSpawn(pirates_zombie_captain_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 2;
}
else if (_ai4 == 2)
{
final int rr = Rnd.get(15);
addSpawn(doll_blader_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 3;
}
else if (_ai4 == 3)
{
addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 4;
}
else if (_ai4 == 4)
{
addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 5;
}
else if (_ai4 == 5)
{
addSpawn(doll_blader_b, 52675, 219371, -3290, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 52687, 219596, -3368, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 52672, 219740, -3418, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 52857, 219992, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 52959, 219997, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 53381, 220151, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 54236, 220948, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54885, 220144, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55264, 219860, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 55399, 220263, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55679, 220129, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 56276, 220783, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 57173, 220234, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 56267, 218826, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56294, 219482, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 56094, 219113, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56364, 218967, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 57113, 218079, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56186, 217153, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55440, 218081, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 55202, 217940, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55225, 218236, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54973, 218075, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54226, 218797, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54394, 219067, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54139, 219253, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 54262, 219480, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 6;
}
else if (_ai4 == 6)
{
addSpawn(pirates_zombie_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54413, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 54841, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 55372, 217128, -3343, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 55893, 217122, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 56282, 217237, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 56963, 218080, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 56267, 218826, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56294, 219482, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 56094, 219113, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56364, 218967, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 56276, 220783, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 57173, 220234, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54885, 220144, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55264, 219860, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 55399, 220263, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55679, 220129, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 54236, 220948, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 54464, 219095, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54226, 218797, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54394, 219067, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54139, 219253, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 54262, 219480, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 53412, 218077, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55440, 218081, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 55202, 217940, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55225, 218236, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54973, 218075, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 7;
}
else if (_ai4 == 7)
{
addSpawn(pirates_zombie_b, 54228, 217504, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54181, 217168, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 54714, 217123, -3168, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 55298, 217127, -3073, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 55787, 217130, -2993, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 56284, 217216, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 56963, 218080, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 56267, 218826, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56294, 219482, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 56094, 219113, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 56364, 218967, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 56276, 220783, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 57173, 220234, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54885, 220144, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55264, 219860, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 55399, 220263, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55679, 220129, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 54236, 220948, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 54464, 219095, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54226, 218797, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(vale_master_b, 54394, 219067, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54139, 219253, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(doll_blader_b, 54262, 219480, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 53412, 218077, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 54280, 217200, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55440, 218081, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_captain_b, 55202, 217940, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 55225, 218236, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
addSpawn(pirates_zombie_b, 54973, 218075, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;
_ai4 = 8;
cancelQuestTimer("1003", null, null);
}
}

else if (event.equalsIgnoreCase("zaken_unlock"))
{
final L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
spawnBoss(zaken);
}
else if (event.equalsIgnoreCase("CreateOnePrivateEx"))
{
addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0)/* .setIsRaidMinion(true) */;
}
return super.onAdvEvent(event, npc, player);
}

@Override
public String onFactionCall(final L2NpcInstance npc, final L2NpcInstance caller, final L2PcInstance attacker, final boolean isPet)
{
if (caller == null || npc == null)
return super.onFactionCall(npc, caller, attacker, isPet);
final int npcId = npc.getNpcId();
final int callerId = caller.getNpcId();

if (getTimeHour() < 5 && callerId != ZAKEN && npcId == ZAKEN)
{
final int damage = 0; // well damage required :x
if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE && _ai0 == 0 && damage < 10 && Rnd.get((30 * 15)) < 1)// todo - damage missing
{
_ai0 = 1;
_ai1 = caller.getX();
_ai2 = caller.getY();
_ai3 = caller.getZ();
startQuestTimer("1002", 300, caller, null);
}
}
return super.onFactionCall(npc, caller, attacker, isPet);
}

@Override
public String onSpellFinished(final L2NpcInstance npc, final L2PcInstance player, final L2Skill skill)
{
if (npc.getNpcId() == ZAKEN)
{
final int skillId = skill.getId();
if (skillId == 4222)
{
npc.teleToLocation(_ai1, _ai2, _ai3);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
}
else if (skillId == 4216)
{
final int i1 = Rnd.get(15);
player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(player);
final L2Character nextTarget = ((L2Attackable) npc).getMostHated();
if (nextTarget != null)
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);

}
else if (skillId == 4217)
{
int i0 = 0;
int i1 = Rnd.get(15);
player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(player);

if (c_quest0 != null && _quest0 > 0 && c_quest0 != player && c_quest0.getZ() > (player.getZ() - 100) && c_quest0.getZ() < (player.getZ() + 100))
{
if ((((c_quest0.getX() - player.getX()) * (c_quest0.getX() - player.getX())) + ((c_quest0.getY() - player.getY()) * (c_quest0.getY() - player.getY()))) > (250 * 250))
{
i0 = 1;
}
else
{
i0 = 0;
}
if (i0 == 0)
{
i1 = Rnd.get(15);
c_quest0.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(c_quest0);
}
}
if (c_quest1 != null && _quest0 > 1 && c_quest1 != player && c_quest1.getZ() > (player.getZ() - 100) && c_quest1.getZ() < (player.getZ() + 100))
{
if ((((c_quest1.getX() - player.getX()) * (c_quest1.getX() - player.getX())) + ((c_quest1.getY() - player.getY()) * (c_quest1.getY() - player.getY()))) > (250 * 250))
{
i0 = 1;
}
else
{
i0 = 0;
}
if (i0 == 0)
{
i1 = Rnd.get(15);
c_quest1.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(c_quest1);
}
}
if (c_quest2 != null && _quest0 > 2 && c_quest2 != player && c_quest2.getZ() > (player.getZ() - 100) && c_quest2.getZ() < (player.getZ() + 100))
{
if ((((c_quest2.getX() - player.getX()) * (c_quest2.getX() - player.getX())) + ((c_quest2.getY() - player.getY()) * (c_quest2.getY() - player.getY()))) > (250 * 250))
{
i0 = 1;
}
else
{
i0 = 0;
}
if (i0 == 0)
{
i1 = Rnd.get(15);
c_quest2.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(c_quest2);
}
}
if (c_quest3 != null && _quest0 > 3 && c_quest3 != player && c_quest3.getZ() > (player.getZ() - 100) && c_quest3.getZ() < (player.getZ() + 100))
{
if ((((c_quest3.getX() - player.getX()) * (c_quest3.getX() - player.getX())) + ((c_quest3.getY() - player.getY()) * (c_quest3.getY() - player.getY()))) > (250 * 250))
{
i0 = 1;
}
else
{
i0 = 0;
}
if (i0 == 0)
{
i1 = Rnd.get(15);
c_quest3.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(c_quest3);
}
}
if (c_quest4 != null && _quest0 > 4 && c_quest4 != player && c_quest4.getZ() > (player.getZ() - 100) && c_quest4.getZ() < (player.getZ() + 100))
{
if ((((c_quest4.getX() - player.getX()) * (c_quest4.getX() - player.getX())) + ((c_quest4.getY() - player.getY()) * (c_quest4.getY() - player.getY()))) > (250 * 250))
{
i0 = 1;
}
else
{
i0 = 0;
}
if (i0 == 0)
{
i1 = Rnd.get(15);
c_quest4.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);
((L2Attackable) npc).stopHating(c_quest4);
}
}
final L2Character nextTarget = ((L2Attackable) npc).getMostHated();
if (nextTarget != null)
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);
}
}
return super.onSpellFinished(npc, player, skill);
}

@Override
public String onAttack(final L2NpcInstance npc, final L2PcInstance attacker, final int damage, final boolean isPet)
{
final int npcId = npc.getNpcId();
if (npcId == ZAKEN)
{
if (attacker.getMountType() == 1)
{
int sk_4258 = 0;
final L2Effect[] effects = attacker.getAllEffects();
if (effects != null && effects.length != 0)
{
for (final L2Effect e : effects)
{
if (e.getSkill().getId() == 4258)
{
sk_4258 = 1;
}
}
}
if (sk_4258 == 0)
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4258, 1));
}
}
final L2Character originalAttacker = isPet ? attacker.getPet() : attacker;
final int hate = (int) (((damage / npc.getMaxHp()) / 0.05) * 20000);
((L2Attackable) npc).addDamageHate(originalAttacker, 0, hate);
if (Rnd.get(10) < 1)
{
final int i0 = Rnd.get((15 * 15));
if (i0 < 1)
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4216, 1));
}
else if (i0 < 2)
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4217, 1));
}
else if (i0 < 4)
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4219, 1));
}
else if (i0 < 8)
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4218, 1));
}
else if (i0 < 15)
{
for (final L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
{
if (character != attacker)
continue;
if (attacker != ((L2Attackable) npc).getMostHated())
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
}
}
}
if (Rnd.get(2) < 1)
{
if (attacker == ((L2Attackable) npc).getMostHated())
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4220, 1));
}
}
}
if (getTimeHour() < 5)
{
}
else if (npc.getCurrentHp() < ((npc.getMaxHp() * _quest2) / 4.0))
{
_quest2 = (_quest2 - 1);
final int i2 = Rnd.get(15);
_ai1 = Xcoords[i2] + Rnd.get(650);
_ai2 = Ycoords[i2] + Rnd.get(650);
_ai3 = Zcoords[i2];
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
}
}
return super.onAttack(npc, attacker, damage, isPet);
}

@Override
public String onKill(final L2NpcInstance npc, final L2PcInstance killer, final boolean isPet)
{
final int npcId = npc.getNpcId();

final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN);

if (npcId == ZAKEN)
{
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));

if (!npc.getSpawn().is_customBossInstance())
{
GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD);
// time is 36hour +/- 17hour
final long respawnTime = (long) (Config.ZAKEN_RESP_FIRST + Rnd.get(Config.ZAKEN_RESP_SECOND)) * 3600000;
startQuestTimer("zaken_unlock", respawnTime, null, null);
cancelQuestTimer("1001", npc, null);
cancelQuestTimer("1003", npc, null);
// also save the respawn time so that the info is maintained past reboots
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatsSet(ZAKEN, info);
}
}
else if (status == ALIVE)
{
if (npcId != ZAKEN)
{
startQuestTimer("CreateOnePrivateEx", ((30 + Rnd.get(60)) * 1000), npc, null);
}
}
return super.onKill(npc, killer, isPet);
}

/*
* public String onSkillSee(L2NpcInstance npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) { int npcId = npc.getNpcId(); if (npcId == ZAKEN) { if (skill.getAggroPoints() > 0) { ((L2Attackable) npc).addDamageHate(caster, 0, (((skill.getAggroPoints() / npc.getMaxHp()) *
* 10) * 150)); } if (Rnd.get(12) < 1) { int i0 = Rnd.get((15 * 15)); if (i0 < 1) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4216, 1)); } else if (i0 < 2) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4217, 1)); } else if (i0 < 4) {
* npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4219, 1)); } else if (i0 < 8) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4218, 1)); } else if (i0 < 15) { for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100)) { if
* (character != caster) continue; if (caster != ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4221, 1)); } } } if (Rnd.get(2) < 1) { if (caster == ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster);
* npc.doCast(SkillTable.getInstance().getInfo(4220, 1)); } } } } return super.onSkillSee(npc, caster, skill, targets, isPet); }
*/

@Override
public String onAggroRangeEnter(final L2NpcInstance npc, final L2PcInstance player, final boolean isPet)
{
final int npcId = npc.getNpcId();
if (npcId == ZAKEN)
{
if (_Zone.isInsideZone(npc))
{
final L2Character target = isPet ? player.getPet() : player;
((L2Attackable) npc).addDamageHate(target, 1, 200);
}
if (player.getZ() > (npc.getZ() - 100) && player.getZ() < (npc.getZ() + 100))
{
if (_quest0 < 5 && Rnd.get(3) < 1)
{
if (_quest0 == 0)
{
c_quest0 = player;
}
else if (_quest0 == 1)
{
c_quest1 = player;
}
else if (_quest0 == 2)
{
c_quest2 = player;
}
else if (_quest0 == 3)
{
c_quest3 = player;
}
else if (_quest0 == 4)
{
c_quest4 = player;
}
_quest0++;
}
if (Rnd.get(15) < 1)
{
final int i0 = Rnd.get((15 * 15));
if (i0 < 1)
{
npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(4216, 1));
}
else if (i0 < 2)
{
npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(4217, 1));
}
else if (i0 < 4)
{
npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(4219, 1));
}
else if (i0 < 8)
{
npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(4218, 1));
}
else if (i0 < 15)
{
for (final L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))
{
if (character != player)
continue;
if (player != ((L2Attackable) npc).getMostHated())
{
npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
}
}
}
if (Rnd.get(2) < 1)
{
if (player == ((L2Attackable) npc).getMostHated())
{
npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(4220, 1));
}
}
}
}
}
return super.onAggroRangeEnter(npc, player, isPet);
}

public int getTimeHour()
{
return (GameTimeController.getInstance().getGameTime() / 60) % 24;
}

@Override
public void run()
{
}
}

 

Link para o comentário
Compartilhar em outros sites

  • 0

Testado e aprovado uso ele na minha acis !! mude os imports porque foi do projeto de marcos ai já ta pra frozen

 

 

/*

* L2jProject x - www.l2jprojectx.com

*

* 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 net.l2jpx.gameserver.ai.special;

 

import org.apache.log4j.Logger;

 

import net.l2jpx.Config;

import net.l2jpx.gameserver.ai.CtrlIntention;

import net.l2jpx.gameserver.controllers.GameTimeController;

import net.l2jpx.gameserver.datatables.SkillTable;

import net.l2jpx.gameserver.datatables.xml.DoorData;

import net.l2jpx.gameserver.managers.GrandBossManager;

import net.l2jpx.gameserver.model.L2Attackable;

import net.l2jpx.gameserver.model.L2Character;

import net.l2jpx.gameserver.model.L2Effect;

import net.l2jpx.gameserver.model.L2Skill;

import net.l2jpx.gameserver.model.actor.instance.L2GrandBossInstance;

import net.l2jpx.gameserver.model.actor.instance.L2NpcInstance;

import net.l2jpx.gameserver.model.actor.instance.L2PcInstance;

import net.l2jpx.gameserver.model.quest.Quest;

import net.l2jpx.gameserver.model.zone.type.L2BossZone;

import net.l2jpx.gameserver.network.serverpackets.PlaySound;

import net.l2jpx.gameserver.templates.StatsSet;

import net.l2jpx.gameserver.thread.ThreadPoolManager;

import net.l2jpx.util.random.Rnd;

 

/**

* Zaken AI

*/

public class Zaken extends Quest implements Runnable

{

protected static final Logger LOGGER = Logger.getLogger(Zaken.class);

 

private int _1001 = 0; // used for first cancel of QuestTimer "1001"

private int _ai0 = 0; // used for zaken coords updater

private int _ai1 = 0; // used for X coord tracking for non-random teleporting in zaken's self teleport skill

private int _ai2 = 0; // used for Y coord tracking for non-random teleporting in zaken's self teleport skill

private int _ai3 = 0; // used for Z coord tracking for non-random teleporting in zaken's self teleport skill

private int _ai4 = 0; // used for spawning minions cycles

private int _quest0 = 0; // used for teleporting progress

private int _quest1 = 0; // used for most hated players progress

private int _quest2 = 0; // used for zaken HP check for teleport

private L2PcInstance c_quest0 = null; // 1st player used for area teleport

private L2PcInstance c_quest1 = null; // 2nd player used for area teleport

private L2PcInstance c_quest2 = null; // 3rd player used for area teleport

private L2PcInstance c_quest3 = null; // 4th player used for area teleport

private L2PcInstance c_quest4 = null; // 5th player used for area teleport

private static final int ZAKEN = 29022;

private static final int doll_blader_b = 29023;

private static final int vale_master_b = 29024;

private static final int pirates_zombie_captain_b = 29026;

private static final int pirates_zombie_b = 29027;

private static final int[] Xcoords =

{

53950,

55980,

54950,

55970,

53930,

55970,

55980,

54960,

53950,

53930,

55970,

55980,

54960,

53950,

53930

};

private static final int[] Ycoords =

{

219860,

219820,

218790,

217770,

217760,

217770,

219920,

218790,

219860,

217760,

217770,

219920,

218790,

219860,

217760

};

private static final int[] Zcoords =

{

-3488,

-3488,

-3488,

-3488,

-3488,

-3216,

-3216,

-3216,

-3216,

-3216,

-2944,

-2944,

-2944,

-2944,

-2944

};

 

// ZAKEN Status Tracking :

private static final byte ALIVE = 0; // Zaken is spawned.

private static final byte DEAD = 1; // Zaken has been killed.

 

private static L2BossZone _Zone;

 

public Zaken(final int questId, final String name, final String descr)

{

super(questId, name, descr);

 

// Zaken doors handling

ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()

{

@Override

public void run()

{

try

{

if (getTimeHour() == 0)

{

LOGGER.info("Zaken door id 21240006 opened, game time 00.00.");

DoorData.getInstance().getDoor(21240006).openMe();

ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()

{

@Override

public void run()

{

try

{

LOGGER.info("Zaken door id 21240006 closed.");

DoorData.getInstance().getDoor(21240006).closeMe();

}

catch (final Throwable e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("Cannot close door ID: 21240006 " + e);

}

}

}, 300000L);

}

}

catch (final Throwable e)

{

if (Config.ENABLE_ALL_EXCEPTIONS)

e.printStackTrace();

 

LOGGER.warn("Cannot open door ID: 21240006 " + e);

}

}

}, 2000L, 600000L);

 

addEventId(ZAKEN, Quest.QuestEventType.ON_KILL);

addEventId(ZAKEN, Quest.QuestEventType.ON_ATTACK);

 

_Zone = GrandBossManager.getInstance().getZone(55312, 219168, -3223);

 

final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);

final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN);

if (status == DEAD)

{

// load the unlock date and time for zaken from DB

final long temp = info.getLong("respawn_time") - System.currentTimeMillis();

// if zaken is locked until a certain time, mark it so and start the unlock timer

// the unlock time has not yet expired.

if (temp > 0)

startQuestTimer("zaken_unlock", temp, null, null);

else

{

// the time has already expired while the server was offline. Immediately spawn zaken.

final L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);

GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);

spawnBoss(zaken);

}

}

else

{

final int loc_x = info.getInteger("loc_x");

final int loc_y = info.getInteger("loc_y");

final int loc_z = info.getInteger("loc_z");

final int heading = info.getInteger("heading");

final int hp = info.getInteger("currentHP");

final int mp = info.getInteger("currentMP");

final L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, loc_x, loc_y, loc_z, heading, false, 0);

zaken.setCurrentHpMp(hp, mp);

spawnBoss(zaken);

}

}

 

public void spawnBoss(final L2GrandBossInstance npc)

{

if (npc == null)

{

LOGGER.warn("Zaken AI failed to load, missing Zaken in grandboss_data.sql");

return;

}

GrandBossManager.getInstance().addBoss(npc);

 

npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));

_ai0 = 0;

_ai1 = npc.getX();

_ai2 = npc.getY();

_ai3 = npc.getZ();

_quest0 = 0;

_quest1 = 0;

_quest2 = 3;

if (_Zone == null)

{

LOGGER.warn("Zaken AI failed to load, missing zone for Zaken");

return;

}

if (_Zone.isInsideZone(npc))

{

_ai4 = 1;

startQuestTimer("1003", 1700, null, null);

}

_1001 = 1;

startQuestTimer("1001", 1000, npc, null); // buffs,random teleports

}

 

@Override

public String onAdvEvent(final String event, final L2NpcInstance npc, final L2PcInstance player)

{

final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN);

 

if (status == DEAD && event == null || !event.equalsIgnoreCase("zaken_unlock"))

return super.onAdvEvent(event, npc, player);

 

if (event.equalsIgnoreCase("1001"))

{

if (_1001 == 1)

{

_1001 = 0;

cancelQuestTimer("1001", npc, null);

}

int sk_4223 = 0;

int sk_4227 = 0;

final L2Effect[] effects = npc.getAllEffects();

if (effects != null && effects.length != 0)

{

for (final L2Effect e : effects)

{

if (e.getSkill().getId() == 4227)

{

sk_4227 = 1;

}

if (e.getSkill().getId() == 4223)

{

sk_4223 = 1;

}

}

}

if (getTimeHour() < 5)

{

if (sk_4223 == 1) // use night face if zaken have day face

{

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4224, 1));

_ai1 = npc.getX();

_ai2 = npc.getY();

_ai3 = npc.getZ();

}

if (sk_4227 == 0) // use zaken regeneration

{

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4227, 1));

}

if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _ai0 == 0)

{

int i0 = 0;

int i1 = 1;

if (((L2Attackable) npc).getMostHated() != null)

{

if ((((((L2Attackable) npc).getMostHated().getX() - _ai1) * (((L2Attackable) npc).getMostHated().getX() - _ai1)) + ((((L2Attackable) npc).getMostHated().getY() - _ai2) * (((L2Attackable) npc).getMostHated().getY() - _ai2))) > (1500 * 1500))

i0 = 1;

else

i0 = 0;

if (i0 == 0)

i1 = 0;

if (_quest0 > 0)

{

if (c_quest0 == null)

i0 = 0;

else if ((((c_quest0.getX() - _ai1) * (c_quest0.getX() - _ai1)) + ((c_quest0.getY() - _ai2) * (c_quest0.getY() - _ai2))) > (1500 * 1500))

i0 = 1;

else

i0 = 0;

if (i0 == 0)

i1 = 0;

}

if (_quest0 > 1)

{

if (c_quest1 == null)

i0 = 0;

else if ((((c_quest1.getX() - _ai1) * (c_quest1.getX() - _ai1)) + ((c_quest1.getY() - _ai2) * (c_quest1.getY() - _ai2))) > (1500 * 1500))

i0 = 1;

else

i0 = 0;

if (i0 == 0)

i1 = 0;

}

if (_quest0 > 2)

{

if (c_quest2 == null)

i0 = 0;

else if ((((c_quest2.getX() - _ai1) * (c_quest2.getX() - _ai1)) + ((c_quest2.getY() - _ai2) * (c_quest2.getY() - _ai2))) > (1500 * 1500))

i0 = 1;

else

i0 = 0;

if (i0 == 0)

i1 = 0;

}

if (_quest0 > 3)

{

if (c_quest3 == null)

i0 = 0;

else if ((((c_quest3.getX() - _ai1) * (c_quest3.getX() - _ai1)) + ((c_quest3.getY() - _ai2) * (c_quest3.getY() - _ai2))) > (1500 * 1500))

i0 = 1;

else

i0 = 0;

if (i0 == 0)

i1 = 0;

}

if (_quest0 > 4)

{

if (c_quest4 == null)

i0 = 0;

else if ((((c_quest4.getX() - _ai1) * (c_quest4.getX() - _ai1)) + ((c_quest4.getY() - _ai2) * (c_quest4.getY() - _ai2))) > (1500 * 1500))

i0 = 1;

else

i0 = 0;

if (i0 == 0)

i1 = 0;

}

if (i1 == 1)

{

_quest0 = 0;

final int i2 = Rnd.get(15);

_ai1 = Xcoords[i2] + Rnd.get(650);

_ai2 = Ycoords[i2] + Rnd.get(650);

_ai3 = Zcoords[i2];

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4222, 1));

}

}

}

if (Rnd.get(20) < 1 && _ai0 == 0)

{

_ai1 = npc.getX();

_ai2 = npc.getY();

_ai3 = npc.getZ();

}

L2Character c_ai0 = null;

if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 == 0)

{

if (((L2Attackable) npc).getMostHated() != null)

{

c_ai0 = ((L2Attackable) npc).getMostHated();

_quest1 = 1;

}

}

else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK && _quest1 != 0)

{

if (((L2Attackable) npc).getMostHated() != null)

{

if (c_ai0 == ((L2Attackable) npc).getMostHated())

{

_quest1 = (_quest1 + 1);

}

else

{

_quest1 = 1;

c_ai0 = ((L2Attackable) npc).getMostHated();

}

}

}

if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)

{

_quest1 = 0;

}

if (_quest1 > 5)

{

((L2Attackable) npc).stopHating(c_ai0);

final L2Character nextTarget = ((L2Attackable) npc).getMostHated();

if (nextTarget != null)

npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);

_quest1 = 0;

}

}

else if (sk_4223 == 0) // use day face if not night time

{

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4223, 1));

_quest2 = 3;

}

if (sk_4227 == 1) // when switching to day time, cancel zaken night regen

{

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4242, 1));

}

if (Rnd.get(40) < 1)

{

final int i2 = Rnd.get(15);

_ai1 = Xcoords[i2] + Rnd.get(650);

_ai2 = Ycoords[i2] + Rnd.get(650);

_ai3 = Zcoords[i2];

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4222, 1));

}

startQuestTimer("1001", 30000, npc, null);

}

if (event.equalsIgnoreCase("1002"))

{

_quest0 = 0;

npc.doCast(SkillTable.getInstance().getInfo(4222, 1));

_ai0 = 0;

}

if (event.equalsIgnoreCase("1003"))

{

if (_ai4 == 1)

{

final int rr = Rnd.get(15);

addSpawn(pirates_zombie_captain_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 2;

}

else if (_ai4 == 2)

{

final int rr = Rnd.get(15);

addSpawn(doll_blader_b, Xcoords[rr] + Rnd.get(650), Ycoords[rr] + Rnd.get(650), Zcoords[rr], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 3;

}

else if (_ai4 == 3)

{

addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 4;

}

else if (_ai4 == 4)

{

addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, Xcoords[Rnd.get(15)] + Rnd.get(650), Ycoords[Rnd.get(15)] + Rnd.get(650), Zcoords[Rnd.get(15)], Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 5;

}

else if (_ai4 == 5)

{

addSpawn(doll_blader_b, 52675, 219371, -3290, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 52687, 219596, -3368, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 52672, 219740, -3418, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 52857, 219992, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 52959, 219997, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 53381, 220151, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 54236, 220948, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54885, 220144, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55264, 219860, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 55399, 220263, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55679, 220129, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 56276, 220783, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 57173, 220234, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 56267, 218826, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56294, 219482, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 56094, 219113, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56364, 218967, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 57113, 218079, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56186, 217153, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55440, 218081, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 55202, 217940, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55225, 218236, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54973, 218075, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54226, 218797, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54394, 219067, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54139, 219253, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 54262, 219480, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 6;

}

else if (_ai4 == 6)

{

addSpawn(pirates_zombie_b, 53412, 218077, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54413, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 54841, 217132, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 55372, 217128, -3343, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 55893, 217122, -3488, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 56282, 217237, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 56963, 218080, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 56267, 218826, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56294, 219482, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 56094, 219113, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56364, 218967, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 56276, 220783, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 57173, 220234, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54885, 220144, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55264, 219860, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 55399, 220263, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55679, 220129, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 54236, 220948, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 54464, 219095, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54226, 218797, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54394, 219067, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54139, 219253, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 54262, 219480, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 53412, 218077, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55440, 218081, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 55202, 217940, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55225, 218236, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54973, 218075, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 7;

}

else if (_ai4 == 7)

{

addSpawn(pirates_zombie_b, 54228, 217504, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54181, 217168, -3216, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 54714, 217123, -3168, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 55298, 217127, -3073, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 55787, 217130, -2993, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 56284, 217216, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 56963, 218080, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 56267, 218826, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56294, 219482, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 56094, 219113, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 56364, 218967, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 56276, 220783, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 57173, 220234, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54885, 220144, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55264, 219860, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 55399, 220263, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55679, 220129, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 54236, 220948, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 54464, 219095, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54226, 218797, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(vale_master_b, 54394, 219067, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54139, 219253, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(doll_blader_b, 54262, 219480, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 53412, 218077, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 54280, 217200, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55440, 218081, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_captain_b, 55202, 217940, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 55225, 218236, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

addSpawn(pirates_zombie_b, 54973, 218075, -2944, Rnd.get(65536), false, 0)/* .setIsRaidMinion(true) */;

_ai4 = 8;

cancelQuestTimer("1003", null, null);

}

}

 

else if (event.equalsIgnoreCase("zaken_unlock"))

{

final L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0);

GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);

spawnBoss(zaken);

}

else if (event.equalsIgnoreCase("CreateOnePrivateEx"))

{

addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0)/* .setIsRaidMinion(true) */;

}

return super.onAdvEvent(event, npc, player);

}

 

@Override

public String onFactionCall(final L2NpcInstance npc, final L2NpcInstance caller, final L2PcInstance attacker, final boolean isPet)

{

if (caller == null || npc == null)

return super.onFactionCall(npc, caller, attacker, isPet);

final int npcId = npc.getNpcId();

final int callerId = caller.getNpcId();

 

if (getTimeHour() < 5 && callerId != ZAKEN && npcId == ZAKEN)

{

final int damage = 0; // well damage required :x

if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE && _ai0 == 0 && damage < 10 && Rnd.get((30 * 15)) < 1)// todo - damage missing

{

_ai0 = 1;

_ai1 = caller.getX();

_ai2 = caller.getY();

_ai3 = caller.getZ();

startQuestTimer("1002", 300, caller, null);

}

}

return super.onFactionCall(npc, caller, attacker, isPet);

}

 

@Override

public String onSpellFinished(final L2NpcInstance npc, final L2PcInstance player, final L2Skill skill)

{

if (npc.getNpcId() == ZAKEN)

{

final int skillId = skill.getId();

if (skillId == 4222)

{

npc.teleToLocation(_ai1, _ai2, _ai3);

npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);

}

else if (skillId == 4216)

{

final int i1 = Rnd.get(15);

player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(player);

final L2Character nextTarget = ((L2Attackable) npc).getMostHated();

if (nextTarget != null)

npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);

 

}

else if (skillId == 4217)

{

int i0 = 0;

int i1 = Rnd.get(15);

player.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(player);

 

if (c_quest0 != null && _quest0 > 0 && c_quest0 != player && c_quest0.getZ() > (player.getZ() - 100) && c_quest0.getZ() < (player.getZ() + 100))

{

if ((((c_quest0.getX() - player.getX()) * (c_quest0.getX() - player.getX())) + ((c_quest0.getY() - player.getY()) * (c_quest0.getY() - player.getY()))) > (250 * 250))

{

i0 = 1;

}

else

{

i0 = 0;

}

if (i0 == 0)

{

i1 = Rnd.get(15);

c_quest0.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(c_quest0);

}

}

if (c_quest1 != null && _quest0 > 1 && c_quest1 != player && c_quest1.getZ() > (player.getZ() - 100) && c_quest1.getZ() < (player.getZ() + 100))

{

if ((((c_quest1.getX() - player.getX()) * (c_quest1.getX() - player.getX())) + ((c_quest1.getY() - player.getY()) * (c_quest1.getY() - player.getY()))) > (250 * 250))

{

i0 = 1;

}

else

{

i0 = 0;

}

if (i0 == 0)

{

i1 = Rnd.get(15);

c_quest1.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(c_quest1);

}

}

if (c_quest2 != null && _quest0 > 2 && c_quest2 != player && c_quest2.getZ() > (player.getZ() - 100) && c_quest2.getZ() < (player.getZ() + 100))

{

if ((((c_quest2.getX() - player.getX()) * (c_quest2.getX() - player.getX())) + ((c_quest2.getY() - player.getY()) * (c_quest2.getY() - player.getY()))) > (250 * 250))

{

i0 = 1;

}

else

{

i0 = 0;

}

if (i0 == 0)

{

i1 = Rnd.get(15);

c_quest2.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(c_quest2);

}

}

if (c_quest3 != null && _quest0 > 3 && c_quest3 != player && c_quest3.getZ() > (player.getZ() - 100) && c_quest3.getZ() < (player.getZ() + 100))

{

if ((((c_quest3.getX() - player.getX()) * (c_quest3.getX() - player.getX())) + ((c_quest3.getY() - player.getY()) * (c_quest3.getY() - player.getY()))) > (250 * 250))

{

i0 = 1;

}

else

{

i0 = 0;

}

if (i0 == 0)

{

i1 = Rnd.get(15);

c_quest3.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(c_quest3);

}

}

if (c_quest4 != null && _quest0 > 4 && c_quest4 != player && c_quest4.getZ() > (player.getZ() - 100) && c_quest4.getZ() < (player.getZ() + 100))

{

if ((((c_quest4.getX() - player.getX()) * (c_quest4.getX() - player.getX())) + ((c_quest4.getY() - player.getY()) * (c_quest4.getY() - player.getY()))) > (250 * 250))

{

i0 = 1;

}

else

{

i0 = 0;

}

if (i0 == 0)

{

i1 = Rnd.get(15);

c_quest4.teleToLocation(Xcoords[i1] + Rnd.get(650), Ycoords[i1] + Rnd.get(650), Zcoords[i1]);

((L2Attackable) npc).stopHating(c_quest4);

}

}

final L2Character nextTarget = ((L2Attackable) npc).getMostHated();

if (nextTarget != null)

npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, nextTarget);

}

}

return super.onSpellFinished(npc, player, skill);

}

 

@Override

public String onAttack(final L2NpcInstance npc, final L2PcInstance attacker, final int damage, final boolean isPet)

{

final int npcId = npc.getNpcId();

if (npcId == ZAKEN)

{

if (attacker.getMountType() == 1)

{

int sk_4258 = 0;

final L2Effect[] effects = attacker.getAllEffects();

if (effects != null && effects.length != 0)

{

for (final L2Effect e : effects)

{

if (e.getSkill().getId() == 4258)

{

sk_4258 = 1;

}

}

}

if (sk_4258 == 0)

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4258, 1));

}

}

final L2Character originalAttacker = isPet ? attacker.getPet() : attacker;

final int hate = (int) (((damage / npc.getMaxHp()) / 0.05) * 20000);

((L2Attackable) npc).addDamageHate(originalAttacker, 0, hate);

if (Rnd.get(10) < 1)

{

final int i0 = Rnd.get((15 * 15));

if (i0 < 1)

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4216, 1));

}

else if (i0 < 2)

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4217, 1));

}

else if (i0 < 4)

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4219, 1));

}

else if (i0 < 8)

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4218, 1));

}

else if (i0 < 15)

{

for (final L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))

{

if (character != attacker)

continue;

if (attacker != ((L2Attackable) npc).getMostHated())

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4221, 1));

}

}

}

if (Rnd.get(2) < 1)

{

if (attacker == ((L2Attackable) npc).getMostHated())

{

npc.setTarget(attacker);

npc.doCast(SkillTable.getInstance().getInfo(4220, 1));

}

}

}

if (getTimeHour() < 5)

{

}

else if (npc.getCurrentHp() < ((npc.getMaxHp() * _quest2) / 4.0))

{

_quest2 = (_quest2 - 1);

final int i2 = Rnd.get(15);

_ai1 = Xcoords[i2] + Rnd.get(650);

_ai2 = Ycoords[i2] + Rnd.get(650);

_ai3 = Zcoords[i2];

npc.setTarget(npc);

npc.doCast(SkillTable.getInstance().getInfo(4222, 1));

}

}

return super.onAttack(npc, attacker, damage, isPet);

}

 

@Override

public String onKill(final L2NpcInstance npc, final L2PcInstance killer, final boolean isPet)

{

final int npcId = npc.getNpcId();

 

final Integer status = GrandBossManager.getInstance().getBossStatus(ZAKEN);

 

if (npcId == ZAKEN)

{

npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));

 

if (!npc.getSpawn().is_customBossInstance())

{

GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD);

// time is 36hour +/- 17hour

final long respawnTime = (long) (Config.ZAKEN_RESP_FIRST + Rnd.get(Config.ZAKEN_RESP_SECOND)) * 3600000;

startQuestTimer("zaken_unlock", respawnTime, null, null);

cancelQuestTimer("1001", npc, null);

cancelQuestTimer("1003", npc, null);

// also save the respawn time so that the info is maintained past reboots

final StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);

info.set("respawn_time", System.currentTimeMillis() + respawnTime);

GrandBossManager.getInstance().setStatsSet(ZAKEN, info);

}

}

else if (status == ALIVE)

{

if (npcId != ZAKEN)

{

startQuestTimer("CreateOnePrivateEx", ((30 + Rnd.get(60)) * 1000), npc, null);

}

}

return super.onKill(npc, killer, isPet);

}

 

/*

* public String onSkillSee(L2NpcInstance npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) { int npcId = npc.getNpcId(); if (npcId == ZAKEN) { if (skill.getAggroPoints() > 0) { ((L2Attackable) npc).addDamageHate(caster, 0, (((skill.getAggroPoints() / npc.getMaxHp()) *

* 10) * 150)); } if (Rnd.get(12) < 1) { int i0 = Rnd.get((15 * 15)); if (i0 < 1) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4216, 1)); } else if (i0 < 2) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4217, 1)); } else if (i0 < 4) {

* npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4219, 1)); } else if (i0 < 8) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4218, 1)); } else if (i0 < 15) { for (L2Character character : npc.getKnownList().getKnownCharactersInRadius(100)) { if

* (character != caster) continue; if (caster != ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster); npc.doCast(SkillTable.getInstance().getInfo(4221, 1)); } } } if (Rnd.get(2) < 1) { if (caster == ((L2Attackable) npc).getMostHated()) { npc.setTarget(caster);

* npc.doCast(SkillTable.getInstance().getInfo(4220, 1)); } } } } return super.onSkillSee(npc, caster, skill, targets, isPet); }

*/

 

@Override

public String onAggroRangeEnter(final L2NpcInstance npc, final L2PcInstance player, final boolean isPet)

{

final int npcId = npc.getNpcId();

if (npcId == ZAKEN)

{

if (_Zone.isInsideZone(npc))

{

final L2Character target = isPet ? player.getPet() : player;

((L2Attackable) npc).addDamageHate(target, 1, 200);

}

if (player.getZ() > (npc.getZ() - 100) && player.getZ() < (npc.getZ() + 100))

{

if (_quest0 < 5 && Rnd.get(3) < 1)

{

if (_quest0 == 0)

{

c_quest0 = player;

}

else if (_quest0 == 1)

{

c_quest1 = player;

}

else if (_quest0 == 2)

{

c_quest2 = player;

}

else if (_quest0 == 3)

{

c_quest3 = player;

}

else if (_quest0 == 4)

{

c_quest4 = player;

}

_quest0++;

}

if (Rnd.get(15) < 1)

{

final int i0 = Rnd.get((15 * 15));

if (i0 < 1)

{

npc.setTarget(player);

npc.doCast(SkillTable.getInstance().getInfo(4216, 1));

}

else if (i0 < 2)

{

npc.setTarget(player);

npc.doCast(SkillTable.getInstance().getInfo(4217, 1));

}

else if (i0 < 4)

{

npc.setTarget(player);

npc.doCast(SkillTable.getInstance().getInfo(4219, 1));

}

else if (i0 < 8)

{

npc.setTarget(player);

npc.doCast(SkillTable.getInstance().getInfo(4218, 1));

}

else if (i0 < 15)

{

for (final L2Character character : npc.getKnownList().getKnownCharactersInRadius(100))

{

if (character != player)

continue;

if (player != ((L2Attackable) npc).getMostHated())

{

npc.setTarget(player);

npc.doCast(SkillTable.getInstance().getInfo(4221, 1));

}

}

}

if (Rnd.get(2) < 1)

{

if (player == ((L2Attackable) npc).getMostHated())

{

npc.setTarget(player);

npc.doCast(SkillTable.getInstance().getInfo(4220, 1));

}

}

}

}

}

return super.onAggroRangeEnter(npc, player, isPet);

}

 

public int getTimeHour()

{

return (GameTimeController.getInstance().getGameTime() / 60) % 24;

}

 

@Override

public void run()

{

}

}

 

Aonde coloco isso ? Plz

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 esta pergunta...

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