Ir para conteúdo
  • Cadastre-se
  • 0
ICON

Player é teleportado ao entra na zona do zaken

Pergunta

Projeto acis.

ola, estou add um zaken em meu projeto e esta 98% ainda falta arruma as skill teleporte dele.

ai lembrei que na acis tinha isso de teleportar o player ao entra na zona dele. fui testa e estou com esse problema.

ja fiz umas duas pesquisas aqui no forum e achei poucas coisas sobre esse assunto, ou foi redirecinado para outro AI zaken ou nao respondido.

se alguem puder tirar essa duvida de onde arruma essa parada eu agradeço.

teste com level baixo e level auto tudo é teleportado para giran, somente char admin consegui entra na zona.

script que estou usando mas crio que nao seja o problema. 

 

/*
 * Copyright (C) 2004-2013 L2J DataPack
 *
 * This file is part of L2J DataPack.
 *
 * L2J DataPack 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.
 *
 * L2J DataPack is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package ai.individual;
 
import ai.AbstractNpcAI;
 
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.datatables.DoorTable;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.templates.StatsSet;
import net.sf.l2j.gameserver.model.actor.L2Attackable;
import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
import net.sf.l2j.util.Rnd;
 
/**
 * Zaken AI
 */
public class Zaken extends AbstractNpcAI
{
        private int _1001 = 0; // used for first cancel of QuestTimer "1001"
        private int _ai0 = 0; // used for zaken cord updater
        private int _ai1 = 0; // used for X cord tracking for non-random teleporting in zaken's self teleport skill
        private int _ai2 = 0; // used for Y cord 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;
       
        private Zaken(String name, String descr)
        {
                super(name, descr);
               
                // Zaken doors handling
                ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
                {
                        @Override
                        public void run()
                        {
                                try
                                {
                                        if (getTimeHour() == 0)
                                        {
                                                DoorTable.getInstance().getDoor(21240006).openMe();
                                                ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
                                                {
                                                        @Override
                                                        public void run()
                                                        {
                                                                try
                                                                {
                                                                        DoorTable.getInstance().getDoor(21240006).closeMe();
                                                                }
                                                                catch (Throwable e)
                                                                {
                                                                        _log.warning("Cannot close door ID: 21240006 " + e);
                                                                }
                                                        }
                                                }, 300000L);
                                        }
                                }
                                catch (Throwable e)
                                {
                                        _log.warning("Cannot open door ID: 21240006 " + e);
                                }
                        }
                }, 2000L, 600000L);
               
                int[] mobs =
                {
                        ZAKEN,
                        doll_blader_b,
                        vale_master_b,
                        pirates_zombie_captain_b,
                        pirates_zombie_b
                };
               
                registerMobs(mobs);
                _Zone = GrandBossManager.getInstance().getZoneByXYZ(55312, 219168, -3223);
               
                StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
                int status = GrandBossManager.getInstance().getBossStatus(ZAKEN);
                if (status == DEAD)
                {
                        // load the unlock date and time for zaken from DB
                        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, false);
                        }
                        else
                        {
                                // the time has already expired while the server was offline. Immediately spawn zaken.
                                L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0, false);
                                GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
                                spawnBoss(zaken);
                        }
                }
                else
                {
                        int loc_x = info.getInteger("loc_x");
                        int loc_y = info.getInteger("loc_y");
                        int loc_z = info.getInteger("loc_z");
                        int heading = info.getInteger("heading");
                        int hp = info.getInteger("currentHP");
                        int mp = info.getInteger("currentMP");
                        L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, loc_x, loc_y, loc_z, heading, false, 0, false);
                        zaken.setCurrentHpMp(hp, mp);
                        zaken.setCurrentHp(zaken.getMaxHp());
                        zaken.setCurrentMp(zaken.getMaxMp());
                        spawnBoss(zaken);
                }
        }
       
        public void spawnBoss(L2GrandBossInstance npc)
        {
                if (npc == null)
                {
                        _log.warning("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)
                {
                        _log.warning("Zaken AI failed to load, missing zone for Zaken");
                        return;
                }
                if (_Zone.isInsideZone(npc))
                {
                        _ai4 = 1;
                        startQuestTimer("1003", 1700, null, null, true);
                }
                _1001 = 1;
                startQuestTimer("1001", 1000, npc, null, true); // buffs,random teleports
        }
       
        @Override
        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
        {
                int status = GrandBossManager.getInstance().getBossStatus(ZAKEN);
                if ((status == DEAD) && !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;
                        L2Effect[] effects = npc.getAllEffects();
                        if ((effects != null) && (effects.length != 0))
                        {
                                for (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.IDLE) && (_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;
                                                        int i2 = getRandom(15);
                                                        _ai1 = Xcoords[i2] + getRandom(650);
                                                        _ai2 = Ycoords[i2] + getRandom(650);
                                                        _ai3 = Zcoords[i2];
                                                        npc.setTarget(npc);
                                                        npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
                                                }
                                        }
                                }
                                if ((getRandom(20) < 1) && (_ai0 == 0))
                                {
                                        _ai1 = npc.getX();
                                        _ai2 = npc.getY();
                                        _ai3 = npc.getZ();
                                }
                                L2Character c_ai0 = null;
                                if ((npc.getAI().getIntention() == CtrlIntention.ATTACK) && (_quest1 == 0))
                                {
                                        if (((L2Attackable) npc).getMostHated() != null)
                                        {
                                                c_ai0 = ((L2Attackable) npc).getMostHated();
                                                _quest1 = 1;
                                        }
                                }
                                else if ((npc.getAI().getIntention() == CtrlIntention.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.IDLE)
                                {
                                        _quest1 = 0;
                                }
                                if (_quest1 > 5)
                                {
                                        ((L2Attackable) npc).stopHating(c_ai0);
                                        L2Character nextTarget = ((L2Attackable) npc).getMostHated();
                                        if (nextTarget != null)
                                        {
                                                npc.getAI().setIntention(CtrlIntention.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 (getRandom(40) < 1)
                        {
                                int i2 = getRandom(15);
                                _ai1 = Xcoords[i2] + getRandom(650);
                                _ai2 = Ycoords[i2] + getRandom(650);
                                _ai3 = Zcoords[i2];
                                npc.setTarget(npc);
                                npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
                        }
                        startQuestTimer("1001", 30000, npc, null, true);
                }
                if (event.equalsIgnoreCase("1002"))
                {
                        _quest0 = 0;
                        npc.doCast(SkillTable.getInstance().getInfo(4222, 1));
                        _ai0 = 0;
                }
                if (event.equalsIgnoreCase("1003"))
                {
                        if (_ai4 == 1)
                        {
                                int rr = getRandom(15);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, Xcoords[rr] + getRandom(650), Ycoords[rr] + getRandom(650), Zcoords[rr], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 2;
                        }
                        else if (_ai4 == 2)
                        {
                                int rr = getRandom(15);
                                ((L2Attackable) addSpawn(doll_blader_b, Xcoords[rr] + getRandom(650), Ycoords[rr] + getRandom(650), Zcoords[rr], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 3;
                        }
                        else if (_ai4 == 3)
                        {
                                ((L2Attackable) addSpawn(vale_master_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 4;
                        }
                        else if (_ai4 == 4)
                        {
                                ((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, Xcoords[getRandom(15)] + getRandom(650), Ycoords[getRandom(15)] + getRandom(650), Zcoords[getRandom(15)], getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 5;
                        }
                        else if (_ai4 == 5)
                        {
                                ((L2Attackable) addSpawn(doll_blader_b, 52675, 219371, -3290, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 52687, 219596, -3368, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 52672, 219740, -3418, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 52857, 219992, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 52959, 219997, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 53381, 220151, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 57113, 218079, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56186, 217153, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 6;
                        }
                        else if (_ai4 == 6)
                        {
                                ((L2Attackable) addSpawn(pirates_zombie_b, 53412, 218077, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54413, 217132, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 54841, 217132, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 55372, 217128, -3343, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 55893, 217122, -3488, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 56282, 217237, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 56963, 218080, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 54464, 219095, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 7;
                        }
                        else if (_ai4 == 7)
                        {
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54228, 217504, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54181, 217168, -3216, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 54714, 217123, -3168, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 55298, 217127, -3073, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 55787, 217130, -2993, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 56284, 217216, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 56963, 218080, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 56267, 218826, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56294, 219482, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 56094, 219113, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 56364, 218967, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 56276, 220783, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 57173, 220234, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54885, 220144, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55264, 219860, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 55399, 220263, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55679, 220129, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 54236, 220948, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 54464, 219095, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54226, 218797, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(vale_master_b, 54394, 219067, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54139, 219253, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(doll_blader_b, 54262, 219480, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 53412, 218077, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 54280, 217200, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55440, 218081, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_captain_b, 55202, 217940, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 55225, 218236, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                ((L2Attackable) addSpawn(pirates_zombie_b, 54973, 218075, -2944, getRandom(65536), false, 0, false)).setIsRaidMinion(true);
                                _ai4 = 8;
                                cancelQuestTimer("1003", null, null);
                        }
                }
               
                else if (event.equalsIgnoreCase("zaken_unlock"))
                {
                        L2GrandBossInstance zaken = (L2GrandBossInstance) addSpawn(ZAKEN, 55312, 219168, -3223, 0, false, 0, false);
                        GrandBossManager.getInstance().setBossStatus(ZAKEN, ALIVE);
                        spawnBoss(zaken);
                }
                else if (event.equalsIgnoreCase("CreateOnePrivateEx"))
                {
                        ((L2Attackable) addSpawn(npc.getNpcId(), npc.getX(), npc.getY(), npc.getZ(), 0, false, 0, false)).setIsRaidMinion(true);
                }
                return super.onAdvEvent(event, npc, player);
        }
       
        public int getRandom(int i)
		{
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
        public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isSummon)
        {
                if ((caller == null) || (npc == null))
                {
                        return super.onFactionCall(npc, caller, attacker, isSummon);
                }
                int npcId = npc.getNpcId();
                int callerId = caller.getNpcId();
               
                if ((getTimeHour() < 5) && (callerId != ZAKEN) && (npcId == ZAKEN))
                {
                        int damage = 0; // well damage required :x
                        if ((npc.getAI().getIntention() == CtrlIntention.IDLE) && (_ai0 == 0) && (damage < 10) && (getRandom((30 * 15)) < 1))// todo - damage missing
                        {
                                _ai0 = 1;
                                _ai1 = caller.getX();
                                _ai2 = caller.getY();
                                _ai3 = caller.getZ();
                                startQuestTimer("1002", 300, caller, null, false);
                        }
                }
                return super.onFactionCall(npc, caller, attacker, isSummon);
        }
       
        @Override
        public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
        {
                if (npc.getNpcId() == ZAKEN)
                {
                        int skillId = skill.getId();
                        if (skillId == 4222)
                        {
                                npc.teleToLocation(_ai1, _ai2, _ai3, 0);
                                npc.getAI().setIntention(CtrlIntention.IDLE);
                        }
                        else if (skillId == 4216)
                        {
                                int i1 = getRandom(15);
                                player.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                ((L2Attackable) npc).stopHating(player);
                                L2Character nextTarget = ((L2Attackable) npc).getMostHated();
                                if (nextTarget != null)
                                {
                                        npc.getAI().setIntention(CtrlIntention.ATTACK, nextTarget);
                                }
                               
                        }
                        else if (skillId == 4217)
                        {
                                int i0 = 0;
                                int i1 = getRandom(15);
                                player.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                ((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 = getRandom(15);
                                                c_quest0.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                                ((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 = getRandom(15);
                                                c_quest1.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                                ((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 = getRandom(15);
                                                c_quest2.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                                ((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 = getRandom(15);
                                                c_quest3.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                                ((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 = getRandom(15);
                                                c_quest4.teleToLocation(Xcoords[i1] + getRandom(650), Ycoords[i1] + getRandom(650), Zcoords[i1], 0);
                                                ((L2Attackable) npc).stopHating(c_quest4);
                                        }
                                }
                                L2Character nextTarget = ((L2Attackable) npc).getMostHated();
                                if (nextTarget != null)
                                {
                                        npc.getAI().setIntention(CtrlIntention.ATTACK, nextTarget);
                                }
                        }
                }
                return super.onSpellFinished(npc, player, skill);
        }
       
        @Override
        public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
        {
                int npcId = npc.getNpcId();
                if (npcId == ZAKEN)
                {
                        if (attacker.getMountType() == 1)
                        {
                                int sk_4258 = 0;
                                L2Effect[] effects = attacker.getAllEffects();
                                if ((effects != null) && (effects.length != 0))
                                {
                                        for (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));
                                }
                        }
                        L2Character originalAttacker = isPet ? attacker.getPet() : attacker;
                        int hate = (int) (((damage / npc.getMaxHp()) / 0.05) * 20000);
                        ((L2Attackable) npc).addDamageHate(originalAttacker, 0, hate);
                        if (getRandom(10) < 1)
                        {
                                int i0 = getRandom((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 (L2Character character : npc.getKnownList().getKnownTypeInRadius(L2Character.class, (100)))
                                        {
                                                if (character != attacker)
                                                {
                                                        continue;
                                                }
                                                if (attacker != ((L2Attackable) npc).getMostHated())
                                                {
                                                        npc.setTarget(attacker);
                                                        npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
                                                }
                                        }
                                }
                                if (getRandom(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);
                                int i2 = getRandom(15);
                                _ai1 = Xcoords[i2] + getRandom(650);
                                _ai2 = Ycoords[i2] + getRandom(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(L2Npc npc, L2PcInstance killer, boolean isSummon)
        {
                int npcId = npc.getNpcId();
                if (npcId == ZAKEN)
                {
                        npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
                        GrandBossManager.getInstance().setBossStatus(ZAKEN, DEAD);
                        // Calculate Min and Max respawn times randomly.
                       
                        long respawnTime = (long) Config.SPAWN_INTERVAL_ZAKEN + Rnd.get(-Config.RANDOM_SPAWN_TIME_ZAKEN, Config.RANDOM_SPAWN_TIME_ZAKEN);
                        respawnTime *= 3600000;
                        startQuestTimer("zaken_unlock", respawnTime, null, null, false);
                       
                        // also save the respawn time so that the info is maintained past reboots
                        StatsSet info = GrandBossManager.getInstance().getStatsSet(ZAKEN);
                        info.set("respawn_time", System.currentTimeMillis() + respawnTime);
                        GrandBossManager.getInstance().setStatsSet(ZAKEN, info);
                }
                else if (GrandBossManager.getInstance().getBossStatus(ZAKEN) == ALIVE)
                {
                        if (npcId != ZAKEN)
                        {
                                startQuestTimer("CreateOnePrivateEx", ((30 + getRandom(60)) * 1000), npc, null, false);
                        }
                }
                return super.onKill(npc, killer, isSummon);
        }
       
        @Override
        public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isSummon)
        {
                int npcId = npc.getNpcId();
                if (npcId == ZAKEN)
                {
                        if (skill.getAggroPoints() > 0)
                        {
                                ((L2Attackable) npc).addDamageHate(caster, 0, (((skill.getAggroPoints() / npc.getMaxHp()) * 10) * 150));
                        }
                        if (getRandom(12) < 1)
                        {
                                int i0 = getRandom((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().getKnownTypeInRadius(L2Character.class, (100)))
                                        {
                                                if (character != caster)
                                                {
                                                        continue;
                                                }
                                                if (caster != ((L2Attackable) npc).getMostHated())
                                                {
                                                        npc.setTarget(caster);
                                                        npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
                                                }
                                        }
                                }
                                if (getRandom(2) < 1)
                                {
                                        if (caster == ((L2Attackable) npc).getMostHated())
                                        {
                                                npc.setTarget(caster);
                                                npc.doCast(SkillTable.getInstance().getInfo(4220, 1));
                                        }
                                }
                        }
                }
                return super.onSkillSee(npc, caster, skill, targets, isSummon);
        }
       
        @Override
        public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet)
        {
                int npcId = npc.getNpcId();
                if (npcId == ZAKEN)
                {
                        if (_Zone.isInsideZone(npc))
                        {
                                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) && (getRandom(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 (getRandom(15) < 1)
                                {
                                        int i0 = getRandom((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 (L2Character character : npc.getKnownList().getKnownTypeInRadius(L2Character.class, (100)))
                                                {
                                                        if (character != player)
                                                        {
                                                                continue;
                                                        }
                                                        if (player != ((L2Attackable) npc).getMostHated())
                                                        {
                                                                npc.setTarget(player);
                                                                npc.doCast(SkillTable.getInstance().getInfo(4221, 1));
                                                        }
                                                }
                                        }
                                        if (getRandom(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 (GameTimeTaskManager.getInstance().getGameTime() / 60) % 24;
        }
       
        public static void main(String[] args)
        {
                new Zaken(Zaken.class.getSimpleName(), "ai");
        }
}

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

2 respostass a esta questão

Posts recomendados

  • 0

faz o seguinte quando o char volta pra giran tu nao mexe nele e da o seguinte comando /loc vai gera um localizçao de teleport

ai voce vai pega essa localizacao e vai funça os teleport e as ai do zaken ..

pq nao tou mas mexendo com l2j se não ajudava mas .

Compartilhar este post


Link para o post
Compartilhar em outros sites

Precisando de Dedicado ou VPS?

Conheça a L2JCenter
  • 0

terminou meu expediente de l2 por hoje, mas amanha vou tenta como vc falou caso consiga eu posto aqui.

obg.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar Agora

  • Mudanças no Login

    Preste atenção às mudanças no método de login.

    Com a migração para nomes de usuário IPB4 não existe mais.

    Você deve usar seu nome de exibição ou email em vez de nome de usuário.




     



  • Quem Está Navegando

    Nenhum usuário registrado visualizando esta página.

  • Posts

    • Movido para conteudo Offline, se alguém ou o autor tiver o Link ou o conteúdo do mesmo em algum mirror atualizaremos o post!
    • Movido para conteudo Offline, se alguém ou o autor tiver o Link ou o conteúdo do mesmo em algum mirror atualizaremos o post!
    • Server officially started on 31/05/2018, which is already half a year ago, despite the low online we keep our word and the server is still Online. Players who stayed on it are mostly casual players, we were asked by them to try to revive the server, so be it! There have been many changes on the server since the start, many bugs have been fixed, and we have improved its stability.
      We're still working on improving the files, so we're trying to fix all reported bugs quickly.
      If you play casually, you are looking for a server that has an active administration and will live long without wipe, then you should check it out! 🙂

      Here is the list of changes we have made as part of Server Resurrection project:
      -Free Tickets for Weapon / Armor / Jewelry TOP D Grade
      -Buff Potions with Buffs for 20min, Mage 10xs Fighter 10x
      -Premium Account Coin (1 Day) 7x, everyone decides when he uses his Coins.
      -Free First and Second Class, class change available at the Cat (Class Manager) or in the pop-up window after reaching 20 and 40 lvl, after each class change player gets 5 Potions with Buffs and after the second class player gets additional Shadow C Weapon Coupons (3rd Class works as standard - Quest)
      -Maximum number of online accounts has been increased to 1 + 4. -Party EXP/SP x2

      Changes regarding NPC Buffer (Newbie Buffer):
      From1 lvl to 40 lvl players will receive Master's Blessing Buffs for 2h.
      Fighter: Wind Walk, Berserker Spirit, Might, Shield, Haste, Blessed Body, Vampiric Rage, Magic Barrier, Guidance, Focus, Death Whisper, Greater Might, Chant of Victory.
      Mage: Wind Walk, Berserker Spirit, Empower, Shield, Acumen, Blessed Body, Blessed Soul, Magic Barrier, Greater Shield, Wild Magic, Clarity, Prophecy of Water.

      Here, it remains unchanged:
      From 40 lvl to 61 lvl players will receive Newbie Buffs for 2 hours (Only their time has changed)
      Fighter: Might, Shield, Haste, Blessed Body, Blessed Soul, Vampiric Rage, Magic Barrier, Guidance, Regeneration.
      Mage: Empower, Shield, Acumen, Blessed Body, Blessed Soul, Magic Barrier, Concentration, Regeneration.

      I think that this should make reaching the 40 level more enjoyable, I believe most of you will agree with me that 1-40 is a very boring period.

      Additionally, every weekend we are going to launch:
      -Double EXP / SP rate
      -Double Adena rate
      -Double Drop / Spoil rate
      (of course not all at one time)
      In addition, GM's often give away buffs to players that will make game fun and quicker. (they are doing it now)

      The above changes are already introduced on the server, but additionally the plan is to introduce:
      - Skill Learn w/o SpellBooks until 75lvl, to learn skills from 3rd Class, SpellBook will be required
      - We will probably add auto Learn Skills until 40lvl

      All these changes are designed to help new players to some extent catch up with the current players. Server reactivation is mainly directed to casual players who do not like to change servers often, to players who want to be sure that server will be standing for a long time without "Wipe" and allow them to play without loss.

      Officially changes will come into life on 21/12/2018 at around 8 PM CET, immediately after Maintenance.
      On the same day at 8 PM first Event is going to be launched: Double EXP / SP and Adena!
      It's going to last until Sunday, December 23, 2012, at 23:59   Currently, server Features:   Website: http://l2emi.eu/
      Forum [EN]: http://l2emi.eu/Forum/
      Forum [PL]: https://forum.lineage2.com.pl/index.php?board=431.0
      Account Panel: http://www.base.l2emi.eu/account/
      Drop Calc: http://www.base.l2emi.eu/drop/   Rate:
      Exp - x7
      SP - x7
      Party Exp - x2
      Adena - x5
      Drop - x4
      Spoil - x4
      Drop Seal Stones - x4
      Quest Reward - x1
      Quest Item Drop - x2
      Raid Boss Drop - x1
      Raid Boss Drop Chance - x3
      Epic Boss Drop - x1   New Players:
      -Free teleports until 40lvl'a
      -Free Tickets for Weapon / Armor / Jewelry TOP D Grade
      -Buff Potions with Buffs for 20min, Mage 10xs Fighter 10x
      -Free First and Second Class, class change available at the Cat (Class Manager) or in the pop-up window after reaching 20 and 40 lvl, after each class change player gets 5 Potions with Buffs and after the second class player gets additional Shadow C Weapon Coupons.
      -Newbie Buffer from 1lvl to 61 lvl.
          From 1 lvl to 40 lvl players will receive Master's Blessing Buffs for 2h.
          Fighter: Wind Walk, Berserker Spirit, Might, Shield, Haste, Blessed Body, Vampiric Rage, Magic Barrier, Guidance, Focus, Death Whisper, Greater Might, Chant of Victory.
          Mage: Wind Walk, Berserker Spirit, Empower, Shield, Acumen, Blessed Body, Blessed Soul, Magic Barrier, Greater Shield, Wild Magic, Clarity, Prophecy of Water.
          From 40 lvl to 61 lvl players will receive Newbie Buffs for 2 hours (Only their time has changed)
          Fighter: Might, Shield, Haste, Blessed Body, Blessed Soul, Vampiric Rage, Magic Barrier, Guidance, Regeneration, Focus.
          Mage: Empower, Shield, Acumen, Blessed Body, Blessed Soul, Magic Barrier, Concentration, Regeneration, Clarity.   General Features:
      - Low B Grade Weapon, Armor, Jewelry w Luxury
      - Buff time: WC / EE / SE / OL / PP - 20 min (Retail), Dance / Songs / Summon buffs 4min (That is x2)
      - 20 buffs slots +4 Divine Inspiration
      - Free First and Second Class. 3rd Class Quest to be done normaly (Quest)
      - .Menu - Repair, Password change, PM on / off, Trade on / off, Bind IP, Auto HP / CP.
      - Light boost for Core Ring and Orfen Earing. - Weight Limit x3
      - The quest for the subclass will be slightly modified, it will be possible to kill baium or get 30 fabricks . - All Epic Bosses will have fixed respawn time + random time. (eg Baium every 4 Days always at 18 +/- 1h) [The date of the next respawn will be displayed on the page without exact hour] - IP lock on the Olympiad, 1 IP = 1 Character.
      - Unlimited Offlineshop.
      - Number of active accounts per HWID 1 + 4
      - LS, GC, Enchants stackable
      - Anty-Bot, Anti-Cheat - L2s-Guard Protection
      - Additional Bot Report on the site, GMs will receive notifications about your report in game
      - Web Statistics: Top 50 PvP, Top 50 PK, Castle Owners.
      - Own Drop Calculator on the site, will be based on our Drop / Spoil Database.
      - Server location: France, Strasbourg.   Boss Respawn:
      -All Raid Bosses 24h +12h Random
      -Subclass Raid Bosses 12h +6h Random
      -Queen Ant 2 days -> 18:00 +2h random
      -Core 2  days  -> 17:00 +2h random 
      -Orfen  2 days  -> 21:00 +2h random
      -Frintezza 2 days  -> 22:00 +2h random
      -Zaken 3 days  -> 19:00 +2h random
      -Baium 5 days -> 18:00 +2h random
      -Antharas 8 days  ->  18:00 +2h random
      -Valakas 11 days  -> 19:00 +2h random   Low B-Grade changes:   Core and Orfen boost:  
    • Ih ala te conheco de algum lugar rico
    • Mas como faz pra adicionar o botão To Giran quando o char morre?
      pq só aparece To Village

      queria deixar as duas opções.
      To village pra voltar direto pra mesma area,
      e To Giran pra caso o player queira voltar pra giran, como faz?
×