Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/aCis_gameserver/config/events.properties b/aCis_gameserver/config/events.properties
- index d0e7892..120a73a 100644
- --- a/aCis_gameserver/config/events.properties
- +++ b/aCis_gameserver/config/events.properties
- @@ -241,4 +241,24 @@ AltFishChampionshipReward1 = 800000
- AltFishChampionshipReward2 = 500000
- AltFishChampionshipReward3 = 300000
- AltFishChampionshipReward4 = 200000
- -AltFishChampionshipReward5 = 100000
- \ No newline at end of file
- +AltFishChampionshipReward5 = 100000
- +
- +#=============================================================
- +# Kill Boss Event
- +#=============================================================
- +# Enable event?
- +KBEEnable = True
- +# Event Interval in minutes
- +KBEInterval = 2
- +# Event Duration in minutes
- +KBEDuration = 1
- +# Boss ID - Separated by ( , ) - Random Selected
- +KBEListBossID = 25126,25450
- +# Boss Title
- +KBETitle = [Event - Boss]
- +# Define Spawn X,Y,Z - Separated by ( ; ) - Random Selected
- +KBEListSpawn = -16376,-53944,-10448
- +#Announcement Start Event (Separated by ; )
- +KBEStartAnnounce = [Kill The Boss (ON)]: Kill the boss of the event and get special items;[Kill The Boss (ON)] You have 15 minutes to kill the boss.
- +#Announcement End Event (Separated by ; )
- +KBEEndAnnounce = [Kill The Boss (OFF)]: The event is over, stay tuned for the next event;[Kill The Boss (OFF)] Thank you Guys!
- \ No newline at end of file
- diff --git a/aCis_gameserver/java/net/sf/l2j/Config.java b/aCis_gameserver/java/net/sf/l2j/Config.java
- index a8e02f8..e3c7184 100644
- --- a/aCis_gameserver/java/net/sf/l2j/Config.java
- +++ b/aCis_gameserver/java/net/sf/l2j/Config.java
- @@ -222,6 +222,16 @@ public final class Config
- public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
- public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;
- + /** Kill Boss Event */
- + public static boolean KBE_ENABLE;
- + public static int KBE_INTERVAL;
- + public static int KBE_DURATION;
- + public static int[] KBE_LIST_BOSS_ID;
- + public static String KBE_TITLE;
- + public static int[][] KBE_SPAWN;
- + public static String[] KBE_ANNOUNCE_START;
- + public static String[] KBE_ANNOUNCE_END;
- +
- // --------------------------------------------------
- // GeoEngine
- // --------------------------------------------------
- @@ -903,6 +913,48 @@ public final class Config
- ALT_FISH_CHAMPIONSHIP_REWARD_3 = events.getProperty("AltFishChampionshipReward3", 300000);
- ALT_FISH_CHAMPIONSHIP_REWARD_4 = events.getProperty("AltFishChampionshipReward4", 200000);
- ALT_FISH_CHAMPIONSHIP_REWARD_5 = events.getProperty("AltFishChampionshipReward5", 100000);
- +
- + //----------------------------------------------
- + // KILL BOSS EVENT
- + // @author: TpgX
- + //----------------------------------------------
- + String tmpList;
- + String[] _tmpList;
- +
- + KBE_ENABLE = events.getProperty("KBEEnable", false);
- + KBE_INTERVAL = events.getProperty("KBEInterval", 720);
- + KBE_DURATION = events.getProperty("KBEDuration", 15);
- + tmpList = events.getProperty("KBEStartAnnounce", "[Kill Boss]: Start Event!");
- + _tmpList = tmpList.split(";");
- + KBE_ANNOUNCE_START = new String[_tmpList.length];
- +
- + for(int i = 0 ; i < _tmpList.length ; i++){
- + KBE_ANNOUNCE_START[i] = _tmpList[i];
- + }
- + tmpList = events.getProperty("KBEEndAnnounce", "[Kill Boss]: Over Event!");
- + _tmpList = tmpList.split(";");
- + KBE_ANNOUNCE_END = new String[_tmpList.length];
- +
- + for(int i = 0 ; i < _tmpList.length ; i++){
- + KBE_ANNOUNCE_END[i] = _tmpList[i];
- + }
- +
- + tmpList = events.getProperty("KBEListBossID","20938");
- + String[] bossList = tmpList.split(",");
- + KBE_LIST_BOSS_ID = new int[bossList.length];
- +
- + for (int i = 0 ; i < bossList.length ; i++)
- + KBE_LIST_BOSS_ID[i] = Integer.parseInt(bossList[i]);
- +
- + KBE_TITLE = events.getProperty("KBETitle","[Event - Boss]");
- + tmpList = events.getProperty("KBEListSpawn","150086, 46733,-3412");
- + _tmpList = tmpList.split(";");
- + KBE_SPAWN = new int[_tmpList.length][];
- +
- + for(int i = 0 ; i < _tmpList.length ; i++){
- + String[] spawnList = _tmpList[i].split(",");
- + KBE_SPAWN[i] = new int[]{Integer.parseInt(spawnList[0]),Integer.parseInt(spawnList[1]),Integer.parseInt(spawnList[2])};
- + }
- }
- /**
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java b/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
- index 6df234c..9835315 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
- @@ -96,6 +96,7 @@ import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
- import net.sf.l2j.gameserver.instancemanager.SiegeManager;
- import net.sf.l2j.gameserver.instancemanager.ZoneManager;
- import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
- +import net.sf.l2j.gameserver.model.KillBossEvent;
- import net.sf.l2j.gameserver.model.L2Manor;
- import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.entity.Hero;
- @@ -284,6 +285,8 @@ public class GameServer
- if (Config.ALT_FISH_CHAMPIONSHIP_ENABLED)
- FishingChampionshipManager.getInstance();
- + if(Config.KBE_ENABLE)
- + KillBossEvent.init();
- StringUtil.printSection("Handlers");
- _log.config("AutoSpawnHandler: Loaded " + AutoSpawnManager.getInstance().size() + " handlers.");
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/KillBossEvent.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/KillBossEvent.java
- new file mode 100644
- index 0000000..a2596f8
- --- /dev/null
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/KillBossEvent.java
- @@ -0,0 +1,127 @@
- +/*
- + * 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 net.sf.l2j.gameserver.model;
- +
- +import java.util.logging.Logger;
- +import net.sf.l2j.commons.concurrent.ThreadPool;
- +import net.sf.l2j.commons.random.Rnd;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.datatables.NpcTable;
- +import net.sf.l2j.gameserver.datatables.SpawnTable;
- +import net.sf.l2j.gameserver.model.actor.L2Npc;
- +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
- +import net.sf.l2j.gameserver.util.Broadcast;
- +
- +/**
- + * @author Tiago
- + *
- + */
- +public class KillBossEvent
- +{
- + protected static final Logger _log = Logger.getLogger(KillBossEvent.class.getName());
- + private static int bossId;
- + private static L2Npc _witchInst;
- + private static int[] localization;
- + private static boolean statusEvent = false;
- +
- + protected static void start(){
- +
- + try{
- +
- + System.out.println("Quantidade de Boss no Evento" + Config.KBE_LIST_BOSS_ID.length);
- + bossId = Config.KBE_LIST_BOSS_ID[Rnd.get(Config.KBE_LIST_BOSS_ID.length)];
- + localization = Config.KBE_SPAWN[Rnd.get(Config.KBE_SPAWN.length)];
- +
- + NpcTemplate _bossNpc = NpcTable.getInstance().getTemplate(bossId);
- + L2Spawn bossSpawn = new L2Spawn(_bossNpc);
- +
- + bossSpawn.setLoc(localization[0], localization[1],localization[2],0);
- + bossSpawn.setRespawnState(false);
- + SpawnTable.getInstance().addNewSpawn(bossSpawn, false);
- + _witchInst = bossSpawn.doSpawn(false);
- +
- + for(int i = 0 ; i < Config.KBE_ANNOUNCE_START.length ; i++){
- + Broadcast.announceToOnlinePlayers(Config.KBE_ANNOUNCE_START[i], true);
- + }
- +
- +
- + statusEvent = true;
- +
- + sleep(Config.KBE_DURATION);
- +
- +
- + SpawnTable.getInstance().deleteSpawn(bossSpawn, false);
- + _witchInst.getSpawn().setRespawnState(false);
- + _witchInst.deleteMe();
- + SpawnTable.getInstance().deleteSpawn(_witchInst.getSpawn(), false);
- +
- + for(int i = 0 ; i < Config.KBE_ANNOUNCE_END.length ; i++){
- + Broadcast.announceToOnlinePlayers(Config.KBE_ANNOUNCE_END[i], true);
- + }
- +
- + statusEvent = false;
- +
- + }catch(Exception e){
- + _log.warning("[ERRO]: "+e.toString());
- + }
- + }
- +
- + public static int getBossSelected()
- + {
- + return bossId;
- + }
- +
- + /**
- + * {@literal Init Thread}
- + * @author Tiago
- + */
- + public static void init()
- + {
- + ThreadPool.scheduleAtFixedRate(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + start();
- + }
- + }, Config.KBE_INTERVAL*1000*60, Config.KBE_INTERVAL*1000*60);
- + }
- +
- + /**
- + * {@literal Check status from Event}
- + * @author Tiago
- + * @return Boolean
- + */
- + public static Boolean statusKillTheBossEvent(){
- + return KillBossEvent.statusEvent;
- + }
- +
- + /**
- + * @author Tiago
- + * @param minutes Integer minutes
- + */
- + private static void sleep(int minutes){
- + try
- + {
- + Thread.sleep(minutes * 1000 * 60);
- + }
- + catch (InterruptedException e)
- + {
- + e.printStackTrace();
- + }
- + }
- +
- +}
- \ No newline at end of file
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
- index 27ae67c..c3bbe05 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
- @@ -17,6 +17,7 @@ package net.sf.l2j.gameserver.network.serverpackets;
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.datatables.ClanTable;
- import net.sf.l2j.gameserver.model.L2Clan;
- +import net.sf.l2j.gameserver.model.KillBossEvent;
- import net.sf.l2j.gameserver.model.L2Object.PolyType;
- import net.sf.l2j.gameserver.model.actor.L2Character;
- import net.sf.l2j.gameserver.model.actor.L2Npc;
- @@ -92,6 +93,8 @@ public abstract class AbstractNpcInfo extends L2GameServerPacket
- if (_npc.isChampion())
- _title = ("Champion");
- + else if (KillBossEvent.statusKillTheBossEvent() && _npc.getNpcId() == KillBossEvent.getBossSelected())
- + _title = (Config.KBE_TITLE);
- else if (_npc.getTemplate().isCustomNpc())
- _title = _npc.getTemplate().getTitle();
- else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement