Page 1 of 1

Reboss Event

Posted: Sat Sep 13, 2014 2:53 pm
by Attila
L2J Revision Number:5625
L2JDP Revision Number:10426

Can some won help me i got this error at game server controle

1. WARNING in \events\RaidBossesEvent\RaidBossesEvent.java (at line 132)
RbSpawn = this.addSpawn(RaidBossId.get(rbId), BossCoordX.get(rbLoc), Bos
sCoordY.get(rbLoc), BossCoordZ.get(rbLoc), 0, false, 0);

whit this reboss event script:

Code: Select all

    /*     * 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 <http://www.gnu.org/licenses/>.     */    package events.RaidBossesEvent;         import java.util.List;    import java.util.Map;         import javolution.util.FastList;    import javolution.util.FastMap;         import com.l2jserver.gameserver.Announcements;    import com.l2jserver.gameserver.model.actor.L2Npc;    import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;    import com.l2jserver.gameserver.model.quest.Quest;    import com.l2jserver.util.Rnd;         /**     * @author TheOne     * @version denser     */         public class RaidBossesEvent extends Quest    {        private static final String qn = "RaidBossesEvent";        private static final int _eventInterval = 4 * 60 * 60 * 1000; //# 4 hours after the first event there is the second one and the others after are 4 hours too, change according to your needs        private static final int _firstStart = 15 * 60 * 1000; //#15 minutes after each restart there is the first event 2700000 - 900000        private static final int _raidInterval = 1 * 60 * 60 * 1000;//1 hour to spawn raid before kill        private static L2Npc RbSpawn = null;        private static final String[][] Bosses = {            { "???????? ???? (80)", "25514" },            { "????? (80)", "25283" },            { "?????? (80)", "25286" },            { "????? (85)", "29175" },            { "?????? (85)", "29150" },            { "????? (87)", "29118" },            { "?????? (83)", "29099" },            { "????? (75)", "29054" },        };        private static final String[][] RbCoords = {            { "??????????? ????????", "10468,-24569,-3650" },            { "?????? ????? ??????", "58787,-83598,-2664" },            { "??????? ??????", "47114,187152,-3485" },            { "??????? ???????", "-89418,150682,-3586" },        };        private static final int MOUNT = 5;        private static final int[][] REWARD = {//id,amount,chance        { 9546, Rnd.get(1, MOUNT), 90 },//Fire Stone        { 9552, Rnd.get(1, MOUNT), 7 },//Fire crystal        { 9558, Rnd.get(1, MOUNT), 1 },//Fire jewel               { 9547, Rnd.get(1, MOUNT), 90 },//Water Stone        { 9553, Rnd.get(1, MOUNT), 7 },//Water crystal        { 9559, Rnd.get(1, MOUNT), 1 },//Water jewel               { 9548, Rnd.get(1, MOUNT), 90 },//Earth Stone        { 9554, Rnd.get(1, MOUNT), 7 },//Earth crystal        { 9560, Rnd.get(1, MOUNT), 1 },//Earth jewel               { 9549, Rnd.get(1, MOUNT), 90 },//Wind Stone        { 9555, Rnd.get(1, MOUNT), 7 },//Wind crystal        { 9561, Rnd.get(1, MOUNT), 1 },//Wind jewel               { 9550, Rnd.get(1, MOUNT), 90 },//Dark Stone        { 9556, Rnd.get(1, MOUNT), 7 },//Dark crystal        { 9562, Rnd.get(1, MOUNT), 1 },//Wind jewel               { 9551, Rnd.get(1, MOUNT), 90 },//Divine Stone        { 9557, Rnd.get(1, MOUNT), 7 },//Divine crystal        { 9563, Rnd.get(1, MOUNT), 1 },//Divine jewel               { 6673, Rnd.get(500, 1000), 90 },//Festival Adena        { 14169, 1, 33 },//Top-Grade Life Stone - level 84        };        private static Map<Integer, String> RaidBosses = new FastMap<Integer, String>();        private static List<Integer> RaidBossId = new FastList<Integer>();        private static List<String> BossLocName = new FastList<String>();        private static List<Integer> BossCoordX = new FastList<Integer>();        private static List<Integer> BossCoordY = new FastList<Integer>();        private static List<Integer> BossCoordZ = new FastList<Integer>();        static        {            for (String[] boss : Bosses)            {                RaidBosses.put(Integer.valueOf(boss[1]), boss[0]);                RaidBossId.add(Integer.valueOf(boss[1]));            }                       for (String[] bossCoords : RbCoords)            {                String[] coords = bossCoords[1].split(",");                BossLocName.add(bossCoords[0]);                BossCoordX.add(Integer.valueOf(coords[0]));                BossCoordY.add(Integer.valueOf(coords[1]));                BossCoordZ.add(Integer.valueOf(coords[2]));            }        }               public RaidBossesEvent(int questId, String name, String descr)        {            super(questId, name, descr);            for (int bossid : RaidBossId)            {                addKillId(bossid);            }                       this.startQuestTimer("raidSpawn", _firstStart, null, null);        }               @Override        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)        {            if (event.equalsIgnoreCase("raidSpawn"))            {                int rbId = Rnd.get(RaidBossId.size());//id                int rbLoc = Rnd.get(RbCoords.length);//loc                String raidboss = RaidBosses.get(RaidBossId.get(rbId));                String location = BossLocName.get(rbLoc);                Announcements.getInstance().announceToAll("?????! ???? ????: " + raidboss + " ?????? ??? ???????? ????? ? " + location + ", ?? ???????? ????? 1 ???! ????????????!");                System.out.println("# Raidboss event initiated (" + raidboss + ")!");                RbSpawn = this.addSpawn(RaidBossId.get(rbId), BossCoordX.get(rbLoc), BossCoordY.get(rbLoc), BossCoordZ.get(rbLoc), 0, false, 0);                this.startQuestTimer("RbDespawn", _raidInterval, null, null);            }                       if (event.equalsIgnoreCase("RbDespawn"))            {                this.startQuestTimer("raidSpawn", _eventInterval, null, null);                RbSpawn.deleteMe();                Announcements.getInstance().announceToAll("?????! ???????? ?? ??? ????...?? ?????????? ?? ??????????!");                System.out.println("# Raidboss did not die yet and will disappear now!");            }            return null;        }               @Override        public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)        {            if (npc == RbSpawn)            {                if (npc.getObjectId() == RbSpawn.getObjectId())                {                    for (L2PcInstance p : npc.getKnownList().getKnownPlayersInRadius(1300))                    {                        if (!p.isDead())                        {                            p.sendMessage("?????! ???????? ???? ???????!");                            for (int[] item : REWARD)                            {                                switch (item[0])                                {                                                                  default:                                    {                                        if (Rnd.get(100) <= item[2])                                            p.addItem(qn, item[0], item[1], player, true);                                    }                                        break;                                }                            }                        }                    }                }            }            this.startQuestTimer("raidSpawn", _eventInterval, null, null);            this.cancelQuestTimer("RbDespawn", null, null);            Announcements.getInstance().announceToAll("?????! ???????? ??? ????!!! ????? ???????!");            System.out.println("# Raidboss has been killed, Event is over!");            return null;        }               public static void main(String[] args)        {            new RaidBossesEvent(-1, qn, "events");            System.out.println(qn + " - ON");        }    }
what is rong whit this
thanks

Re: Reboss Event

Posted: Wed Sep 17, 2014 12:16 am
by MiguelS
I think this is took from another source code (like russ)

Re: Reboss Event

Posted: Thu Sep 18, 2014 2:08 pm
by wajahat30
Can some won help me i got this error at game server controle :lol:

Re: Reboss Event

Posted: Thu Apr 09, 2015 5:30 pm
by Attila
I am getting this message
Image

with this code i use
what's wrong with what do i need to change.
somewone can tell me please

Code: Select all

    /*
     * 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 <http://www.gnu.org/licenses/>.
     */
    package events.RaidBossesEvent;
     
    import java.util.List;
    import java.util.Map;
     
    import javolution.util.FastList;
    import javolution.util.FastMap;
     
    import com.l2jserver.gameserver.Announcements;
    import com.l2jserver.gameserver.model.actor.L2Npc;
    import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
    import com.l2jserver.gameserver.model.quest.Quest;
    import com.l2jserver.util.Rnd;
     
    /**
     * @author TheOne, denser
     */
    public class RaidBossesEvent extends Quest
    {
        private static final String qn = "RaidBossesEvent";
        private static final int _eventInterval = 4 * 60 * 60 * 1000; //# 4 hours after the first event there is the second one and the others after are 4 hours too, change according to your needs
        private static final int _firstStart = 15 * 60 * 1000; //#15 minutes after each restart there is the first event 2700000 - 900000
        private static final int _raidInterval = 1 * 60 * 60 * 1000;//1 hour to spawn raid before kill
        private static L2Npc RbSpawn = null;
        private static final String[][] Bosses = {
            { "Queen Shyeed (80)", "25514" },
            { "Lilith (80)", "25283" },
            { "Anakim (80)", "25286" },
            { "Tiat (85)", "29175" },
            { "Ekimus (85)", "29150" },
            { "Beleth (87)", "29118" },
            { "Baylor (83)", "29099" },
            { "Benom (75)", "29054" },
        };
        private static final String[][] RbCoords = {
            { "Primeval Isle", "10468,-24569,-3650" },
            { "Beast Farm", "58787,-83598,-2664" },
            { "Giran Harbor", "47114,187152,-3485" },
            { "Gludin Harbor", "-89418,150682,-3586" },
        };
        private static final int MOUNT = 5;
        private static final int[][] REWARD = {//id,amount,chance
        { 9546, Rnd.get(1, MOUNT), 90 },//Fire Stone
        { 9552, Rnd.get(1, MOUNT), 7 },//Fire crystal
        { 9558, Rnd.get(1, MOUNT), 1 },//Fire jewel
       
        { 9547, Rnd.get(1, MOUNT), 90 },//Water Stone
        { 9553, Rnd.get(1, MOUNT), 7 },//Water crystal
        { 9559, Rnd.get(1, MOUNT), 1 },//Water jewel
       
        { 9548, Rnd.get(1, MOUNT), 90 },//Earth Stone
        { 9554, Rnd.get(1, MOUNT), 7 },//Earth crystal
        { 9560, Rnd.get(1, MOUNT), 1 },//Earth jewel
       
        { 9549, Rnd.get(1, MOUNT), 90 },//Wind Stone
        { 9555, Rnd.get(1, MOUNT), 7 },//Wind crystal
        { 9561, Rnd.get(1, MOUNT), 1 },//Wind jewel
       
        { 9550, Rnd.get(1, MOUNT), 90 },//Dark Stone
        { 9556, Rnd.get(1, MOUNT), 7 },//Dark crystal
        { 9562, Rnd.get(1, MOUNT), 1 },//Wind jewel
       
        { 9551, Rnd.get(1, MOUNT), 90 },//Divine Stone
        { 9557, Rnd.get(1, MOUNT), 7 },//Divine crystal
        { 9563, Rnd.get(1, MOUNT), 1 },//Divine jewel
       
        { 6673, Rnd.get(500, 1000), 90 },//Festival Adena
        { 14169, 1, 33 },//Top-Grade Life Stone - level 84
        };
        private static Map<Integer, String> RaidBosses = new FastMap<Integer, String>();
        private static List<Integer> RaidBossId = new FastList<Integer>();
        private static List<String> BossLocName = new FastList<String>();
        private static List<Integer> BossCoordX = new FastList<Integer>();
        private static List<Integer> BossCoordY = new FastList<Integer>();
        private static List<Integer> BossCoordZ = new FastList<Integer>();
        static
        {
            for (String[] boss : Bosses)
            {
                RaidBosses.put(Integer.valueOf(boss[1]), boss[0]);
                RaidBossId.add(Integer.valueOf(boss[1]));
            }
           
            for (String[] bossCoords : RbCoords)
            {
                String[] coords = bossCoords[1].split(",");
                BossLocName.add(bossCoords[0]);
                BossCoordX.add(Integer.valueOf(coords[0]));
                BossCoordY.add(Integer.valueOf(coords[1]));
                BossCoordZ.add(Integer.valueOf(coords[2]));
            }
        }
       
        public RaidBossesEvent(int questId, String name, String descr)
        {
            super(questId, name, descr);
            for (int bossid : RaidBossId)
            {
                addKillId(bossid);
            }
           
            this.startQuestTimer("raidSpawn", _firstStart, null, null);
        }
       
        @Override
        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
        {
            if (event.equalsIgnoreCase("raidSpawn"))
            {
                int rbId = Rnd.get(RaidBossId.size());//id
                int rbLoc = Rnd.get(RbCoords.length);//loc
                String raidboss = RaidBosses.get(RaidBossId.get(rbId));
                String location = BossLocName.get(rbLoc);
                Announcements.getInstance().announceToAll("Hunting time, your target: " + raidboss + " just appeared in " + location + ", you only have 1 hour, Hurry up!");
                System.out.println("# Raidboss event initiated (" + raidboss + ")!");
                RbSpawn = this.addSpawn(RaidBossId.get(rbId), BossCoordX.get(rbLoc), BossCoordY.get(rbLoc), BossCoordZ.get(rbLoc), 0, false, 0);
                this.startQuestTimer("RbDespawn", _raidInterval, null, null);
            }
           
            if (event.equalsIgnoreCase("RbDespawn"))
            {
                this.startQuestTimer("raidSpawn", _eventInterval, null, null);
                RbSpawn.deleteMe();
                Announcements.getInstance().announceToAll("The Raid Boss didn't die and it'll disappear now!");
                System.out.println("# Raidboss did not die yet and will disappear now!");
            }
            return null;
        }
       
        @Override
        public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
        {
            if (npc == RbSpawn)
            {
                if (npc.getObjectId() == RbSpawn.getObjectId())
                {
                    for (L2PcInstance p : npc.getKnownList().getKnownPlayersInRadius(1300))
                    {
                        if (!p.isDead())
                        {
                            p.sendMessage("Here is your reward!");
                            for (int[] item : REWARD)
                            {
                                if (Rnd.get(100) <= item[2])
                                    p.addItem(qn, item[0], item[1], player, true);
                            }
                        }
                    }
                }
            }
            this.startQuestTimer("raidSpawn", _eventInterval, null, null);
            this.cancelQuestTimer("RbDespawn", null, null);
            Announcements.getInstance().announceToAll("The Raid Boss was killed! The event is now over.");
            System.out.println("# Raidboss has been killed, Event is over!");
            return null;
        }
       
        public static void main(String[] args)
        {
            new RaidBossesEvent(-1, qn, "events");
            System.out.println(qn + " - ON");
        }
    }