Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P Dream
- Index: Dream_GameServer/dist/config/main/player.properties
- ===================================================================
- --- Dream_GameServer/dist/config/main/player.properties (revision 83)
- +++ Dream_GameServer/dist/config/main/player.properties (working copy)
- @@ -240,6 +240,10 @@
- AutoLootHerbs = False
- AutoLootAdena = False
- +# Items ID Cannot Auto Picked
- +# example : 1,2,3,4,5
- +NoAutoLootList = 0
- +
- #=======================================#
- # Addition to characters
- #=======================================#
- Index: Dream_GameServer/src/com/dream/game/manager/SaoManager.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/manager/SaoManager.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/manager/SaoManager.java (working copy)
- @@ -0,0 +1,177 @@
- +/*
- + * 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 com.dream.game.manager;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.Map;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.concurrent.ScheduledFuture;
- +
- +import org.apache.log4j.Logger;
- +
- +import com.dream.Config;
- +import com.dream.L2DatabaseFactory;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.model.world.L2World;
- +import com.dream.game.network.ThreadPoolManager;
- +import com.dream.game.network.serverpackets.Die;
- +import com.dream.game.network.serverpackets.ExShowScreenMessage;
- +
- +public class SaoManager
- +{
- + private static final Logger _log = Logger.getLogger(SaoManager.class.getName());
- +
- + private final Map<Integer, Long> _saos;
- + protected final Map<Integer, Long> _saosTask;
- + private ScheduledFuture<?> _scheduler;
- +
- + public static SaoManager getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + protected SaoManager()
- + {
- + _saos = new ConcurrentHashMap<>();
- + _saosTask = new ConcurrentHashMap<>();
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new SaoTask(), 1000, 1000);
- + load();
- + }
- +
- + public void reload()
- + {
- + _saos.clear();
- + _saosTask.clear();
- + if (_scheduler != null)
- + _scheduler.cancel(true);
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new SaoTask(), 1000, 1000);
- + load();
- + }
- +
- + public void load()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("SELECT charId, duration FROM character_sao ORDER BY charId");
- + ResultSet rs = statement.executeQuery();
- + while (rs.next())
- + _saos.put(rs.getInt("charId"), rs.getLong("duration"));
- + rs.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Exception: SaoManager load: " + e.getMessage());
- + }
- +
- + _log.info("SaoManager: Loaded " + _saos.size() + " characters with Sao mod actived.");
- + }
- +
- + public void addSao(int charId, long duration)
- + {
- + _saos.put(charId, duration);
- + _saosTask.put(charId, duration);
- + manageSaoPrivileges(charId);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("INSERT INTO character_sao (charId, duration) VALUES (?, ?)");
- + statement.setInt(1, charId);
- + statement.setLong(2, duration);
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Exception: SaoManager addSao: " + e.getMessage());
- + }
- + }
- +
- + public void removeSao(int charId)
- + {
- + _saos.remove(charId);
- + _saosTask.remove(charId);
- + manageSaoPrivileges(charId);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("DELETE FROM character_sao WHERE charId = ?");
- + statement.setInt(1, charId);
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warn("Exception: SaoManager removeSao: " + e.getMessage());
- + }
- + }
- +
- + public boolean hasSaoPrivileges(int charId)
- + {
- + return _saos.containsKey(charId);
- + }
- +
- + public long getSaoDuration(int charId)
- + {
- + return _saos.get(charId);
- + }
- +
- + public void addSaoTask(int charId, long duration)
- + {
- + _saosTask.put(charId, duration);
- + }
- +
- + public void removeSaoTask(int charId)
- + {
- + _saosTask.remove(charId);
- + }
- +
- + public void manageSaoPrivileges(int charId)
- + {
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.broadcastUserInfo();
- + }
- +
- + public class SaoTask implements Runnable
- + {
- + @Override
- + public final void run()
- + {
- + if (_saosTask.isEmpty())
- + return;
- +
- + for (Map.Entry<Integer, Long> entry : _saosTask.entrySet())
- + {
- + final long duration = entry.getValue();
- + if (System.currentTimeMillis() > duration)
- + {
- + final int charId = entry.getKey();
- + removeSao(charId);
- +
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.sendPacket(new ExShowScreenMessage(Config.SAO_END_MSG, 10000));
- + player.sendPacket(new Die(player));
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final SaoManager _instance = new SaoManager();
- + }
- +}
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/manager/VipManagerOne.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/manager/VipManagerOne.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/manager/VipManagerOne.java (working copy)
- @@ -0,0 +1,179 @@
- +package com.dream.game.manager;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.Map;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.concurrent.ScheduledFuture;
- +import java.util.logging.Logger;
- +
- +import com.dream.L2DatabaseFactory;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.model.world.L2World;
- +import com.dream.game.network.ThreadPoolManager;
- +import com.dream.game.network.serverpackets.ExShowScreenMessage;
- +import com.dream.util.CloseUtil;
- +
- +/**
- + * @author rapfersan92
- + */
- +public class VipManagerOne
- +{
- + private static final Logger _log = Logger.getLogger(VipManager.class.getName());
- +
- + private final Map<Integer, Long> _vips;
- + protected final Map<Integer, Long> _vipsTask;
- + private ScheduledFuture<?> _scheduler;
- +
- + public static VipManager getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + protected VipManagerOne()
- + {
- + _vips = new ConcurrentHashMap<>();
- + _vipsTask = new ConcurrentHashMap<>();
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VipTask(), 1000, 1000);
- + load();
- + }
- +
- + public void reload()
- + {
- + _vips.clear();
- + _vipsTask.clear();
- + if (_scheduler != null)
- + _scheduler.cancel(true);
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VipTask(), 1000, 1000);
- + load();
- + }
- +
- + public void load()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("SELECT charId, duration FROM character_vip_one ORDER BY charId");
- + ResultSet rs = statement.executeQuery();
- + while (rs.next())
- + _vips.put(rs.getInt("charId"), rs.getLong("duration"));
- + rs.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Exception: VipManager load: " + e.getMessage());
- + }
- +
- + _log.info("VipManager: Loaded " + _vips.size() + " characters with vip privileges.");
- + }
- +
- + public void addVip(int charId, long duration)
- + {
- + _vips.put(charId, duration);
- + _vipsTask.put(charId, duration);
- + manageVipPrivileges(charId);
- + }
- +
- + public static void doVip(L2PcInstance player, int days)
- + {
- + if (player == null)
- + return;
- +
- + player.setEndTime("vip", days);
- +
- + Connection connection = null;
- + try
- + {
- + connection = L2DatabaseFactory.getInstance().getConnection();
- +
- + PreparedStatement statement = connection.prepareStatement("INSERT INTO character_vip_one (charId, duration) VALUES (?, ?)");
- + statement.setInt(1, player.getObjectId());
- + statement.setLong(2, player.getVipEndTime());
- + statement.execute();
- + statement.close();
- + connection.close();
- + }
- + catch (Exception e)
- + {
- +
- + }
- + finally
- + {
- + CloseUtil.close(connection);
- + }
- + }
- +
- + public void removeVip(int charId)
- + {
- + _vips.remove(charId);
- + _vipsTask.remove(charId);
- + manageVipPrivileges(charId);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("DELETE FROM character_vip_one WHERE charId = ?");
- + statement.setInt(1, charId);
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Exception: VipManager removeVip: " + e.getMessage());
- + }
- + }
- +
- + public boolean hasVipPrivileges(int charId)
- + {
- + return _vips.containsKey(charId);
- + }
- +
- + public long getVipDuration(int charId)
- + {
- + return _vips.get(charId);
- + }
- +
- + public void addVipTask(int charId, long duration)
- + {
- + _vipsTask.put(charId, duration);
- + }
- +
- + public void removeVipTask(int charId)
- + {
- + _vipsTask.remove(charId);
- + }
- +
- + public void manageVipPrivileges(int charId)
- + {
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.broadcastUserInfo();
- + }
- +
- + public class VipTask implements Runnable
- + {
- + @Override
- + public final void run()
- + {
- + if (_vipsTask.isEmpty())
- + return;
- +
- + for (Map.Entry<Integer, Long> entry : _vipsTask.entrySet())
- + {
- + final long duration = entry.getValue();
- + if (System.currentTimeMillis() > duration)
- + {
- + final int charId = entry.getKey();
- + removeVip(charId);
- +
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.sendPacket(new ExShowScreenMessage("Your vip privileges were removed.", 10000));
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final VipManager _instance = new VipManager();
- + }
- +}
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/Config.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/Config.java (revision 83)
- +++ Dream_GameServer/src/com/dream/Config.java (working copy)
- @@ -16,6 +16,7 @@
- import java.util.Map;
- import java.util.Properties;
- import java.util.StringTokenizer;
- +import java.util.concurrent.TimeUnit;
- import java.util.regex.Pattern;
- import org.apache.log4j.Logger;
- @@ -27,6 +28,7 @@
- import com.dream.game.model.actor.instance.L2PcInstance;
- import com.dream.game.util.ClassMasterSettings;
- +import javolution.text.TextBuilder;
- import javolution.text.TypeFormat;
- public class Config extends L2Config
- @@ -68,6 +70,67 @@
- WorldObjectSet
- }
- + public static String PHANTOM_PLAYERS_AKK;
- + public static boolean ALLOW_PHANTOM_PLAYERS = false;
- + public static int PHANTOM_PLAYERS_COUNT_FIRST;
- + public static boolean PHANTOM_PLAYERS_SOULSHOT_ANIM;
- + public static long PHANTOM_PLAYERS_DELAY_FIRST;
- + public static long PHANTOM_PLAYERS_DESPAWN_FIRST;
- + public static int PHANTOM_PLAYERS_DELAY_SPAWN_FIRST;
- + public static int PHANTOM_PLAYERS_DELAY_DESPAWN_FIRST;
- + public static int PHANTOM_PLAYERS_COUNT_NEXT;
- + public static long PHANTOM_PLAYERS_DELAY_NEXT;
- + public static long PHANTOM_PLAYERS_DESPAWN_NEXT;
- + public static int PHANTOM_PLAYERS_DELAY_SPAWN_NEXT;
- + public static int PHANTOM_PLAYERS_DELAY_DESPAWN_NEXT;
- + public static int PHANTOM_PLAYERS_ENCHANT_MIN;
- + public static int PHANTOM_PLAYERS_ENCHANT_MAX;
- + public static final ArrayList<Integer> PHANTOM_PLAYERS_NAME_CLOLORS = new ArrayList<>();
- + public static final ArrayList<Integer> PHANTOM_PLAYERS_TITLE_CLOLORS = new ArrayList<>();
- +
- + public static void loadPhantomConfig()
- + {
- + System.out.println("Loading: ./config/phantom/PhantomPlayers.properties.");
- + try
- + {
- + L2Properties localL2Properties = new L2Properties("./config/phantom/PhantomPlayers.properties");
- + PHANTOM_PLAYERS_AKK = localL2Properties.getProperty("PhantomPlayerAccounts", "l2jlovely.net");
- + PHANTOM_PLAYERS_SOULSHOT_ANIM = Boolean.parseBoolean(localL2Properties.getProperty("PhantomSoulshotAnimation", "True"));
- + PHANTOM_PLAYERS_COUNT_FIRST = Integer.parseInt(localL2Properties.getProperty("FirstCount", "50"));
- + PHANTOM_PLAYERS_DELAY_FIRST = TimeUnit.MINUTES.toMillis(Integer.parseInt(localL2Properties.getProperty("FirstDelay", "5")));
- + PHANTOM_PLAYERS_DESPAWN_FIRST = TimeUnit.MINUTES.toMillis(Integer.parseInt(localL2Properties.getProperty("FirstDespawn", "60")));
- + PHANTOM_PLAYERS_DELAY_SPAWN_FIRST = (int) TimeUnit.SECONDS.toMillis(Integer.parseInt(localL2Properties.getProperty("FirstDelaySpawn", "1")));
- + PHANTOM_PLAYERS_DELAY_DESPAWN_FIRST = (int) TimeUnit.SECONDS.toMillis(Integer.parseInt(localL2Properties.getProperty("FirstDelayDespawn", "20")));
- + PHANTOM_PLAYERS_COUNT_NEXT = Integer.parseInt(localL2Properties.getProperty("NextCount", "50"));
- + PHANTOM_PLAYERS_DELAY_NEXT = TimeUnit.MINUTES.toMillis(Integer.parseInt(localL2Properties.getProperty("NextDelay", "15")));
- + PHANTOM_PLAYERS_DESPAWN_NEXT = TimeUnit.MINUTES.toMillis(Integer.parseInt(localL2Properties.getProperty("NextDespawn", "90")));
- + PHANTOM_PLAYERS_DELAY_SPAWN_NEXT = (int) TimeUnit.SECONDS.toMillis(Integer.parseInt(localL2Properties.getProperty("NextDelaySpawn", "20")));
- + PHANTOM_PLAYERS_DELAY_DESPAWN_NEXT = (int) TimeUnit.SECONDS.toMillis(Integer.parseInt(localL2Properties.getProperty("NextDelayDespawn", "30")));
- + String[] arrayOfString12 = localL2Properties.getProperty("FakeEnchant", "0,14").split(",");
- + PHANTOM_PLAYERS_ENCHANT_MIN = Integer.parseInt(arrayOfString12[0]);
- + PHANTOM_PLAYERS_ENCHANT_MAX = Integer.parseInt(arrayOfString12[1]);
- + arrayOfString12 = localL2Properties.getProperty("FakeNameColors", "FFFFFF,FFFFFF").split(",");
- +
- + String mode1;
- + for (String mode : arrayOfString12)
- + {
- + mode1 = new TextBuilder(mode).reverse().toString();
- + PHANTOM_PLAYERS_NAME_CLOLORS.add(Integer.decode("0x" + mode1));
- + }
- + arrayOfString12 = localL2Properties.getProperty("FakeTitleColors", "FFFF77,FFFF77").split(",");
- + for (String mode : arrayOfString12)
- + {
- + mode1 = new TextBuilder(mode).reverse().toString();
- + PHANTOM_PLAYERS_TITLE_CLOLORS.add(Integer.decode("0x" + mode1));
- + }
- + }
- + catch (Exception localException)
- + {
- + _log.error(localException.getMessage(), localException);
- + throw new Error("Failed to Load ./config/phantom/PhantomPlayers.properties File.");
- + }
- + }
- +
- public static boolean ENABLE_EVENT_MANAGER;
- public static int EVENT_MANAGER_ID;
- @@ -159,6 +222,7 @@
- public static boolean SHOW_DEBUFF_ONLY;
- public static boolean ALLOW_AUTO_LOOT;
- public static boolean AUTO_LOOT;
- + public static ArrayList<Integer> NO_AUTO_LOOT_LIST = new ArrayList<>();
- public static boolean AUTO_LOOT_RAID;
- public static boolean AUTO_LOOT_HERBS;
- public static boolean AUTO_LOOT_ADENA;
- @@ -1718,6 +1782,52 @@
- }
- }
- + public static boolean ALLOW_SAO_MOD;
- + public static int SAO_TIME_CONFIG;
- + public static int SAO_TIME_CONFIG_MULTIPLIER;
- + public static String SAO_END_MSG;
- + public static String SAO_START_MSG;
- + public static String SAO_TIME_INFO;
- +
- + public static boolean ALLOW_VIP_CHARACTERS;
- + public static int VIP_TITLE_COLOR;
- + public static int VIP_TITLE_COLOR_ONE;
- + public static int VIP_TITLE_COLOR_TWO;
- + public static int VIP_RATE_DROP_ADENA;
- + public static int VIP_RATE_DROP_ADENA_ONE;
- + public static int VIP_RATE_DROP_ADENA_TWO;
- + public static int VIP_RATE_DROP_SPOIL;
- + public static int VIP_RATE_DROP_SPOIL_ONE;
- + public static int VIP_RATE_DROP_SPOIL_TWO;
- + public static int VIP_RATE_DROP;
- + public static int VIP_RATE_DROP_ONE;
- + public static int VIP_RATE_DROP_TWO;
- + public static int VIP_RATE_DROP_BLUESEAL;
- + public static int VIP_RATE_DROP_BLUESEAL_ONE;
- + public static int VIP_RATE_DROP_BLUESEAL_TWO;
- + public static int VIP_RATE_DROP_GREENSEAL;
- + public static int VIP_RATE_DROP_GREENSEAL_ONE;
- + public static int VIP_RATE_DROP_GREENSEAL_TWO;
- + public static int VIP_RATE_DROP_REDSEAL;
- + public static int VIP_RATE_DROP_REDSEAL_ONE;
- + public static int VIP_RATE_DROP_REDSEAL_TWO;
- + public static int RATE_DROP_BLUESEAL;
- + public static int RATE_DROP_GREENSEAL;
- + public static int RATE_DROP_REDSEAL;
- + public static int VIP_RATE_XP;
- + public static int VIP_RATE_XP_ONE;
- + public static int VIP_RATE_XP_TWO;
- + public static int VIP_RATE_SP;
- + public static int VIP_RATE_SP_ONE;
- + public static int VIP_RATE_SP_TWO;
- + public static int VIP_ITEM_ID;
- + public static int VIP_ITEM_ID_ONE;
- + public static int VIP_ITEM_ID_TWO;
- + public static int VIP_ITEM_DAYS;
- + public static int VIP_ITEM_DAYS_ONE;
- + public static int VIP_ITEM_DAYS_TWO;
- + public static int VIP_ITEM_MULTIPLIER;
- +
- public static void loadMods()
- {
- try
- @@ -1798,6 +1908,53 @@
- SPAWN_EVENT_MANAGER = Boolean.parseBoolean(p.getProperty("EnableAutoSpawn", "false"));
- ACTIVATED_SYSTEM = Boolean.parseBoolean(p.getProperty("ActivateSystem", "false"));
- +
- + ALLOW_SAO_MOD = Boolean.parseBoolean(p.getProperty("AllowSaoMod", "false"));
- + SAO_TIME_CONFIG = Integer.parseInt(p.getProperty("SaoTimeConfig", "1"));
- + SAO_TIME_CONFIG_MULTIPLIER = Integer.parseInt(p.getProperty("SaoTimeMultiplier", "3600000"));
- + SAO_START_MSG = p.getProperty("SaoStartMsg", "Your Sao restrictions were added.");
- + SAO_END_MSG = p.getProperty("SaoEndMsg", "Your Sao restrictions were removed.");
- + SAO_TIME_INFO = p.getProperty("SaoInfoMsg", "Your Sao restrictions end at");
- +
- + ALLOW_VIP_CHARACTERS = Boolean.parseBoolean(p.getProperty("AllowVipCharacters", "False"));
- + VIP_TITLE_COLOR = Integer.decode("0x" + p.getProperty("VipTitleColor", "00FF00"));
- + VIP_TITLE_COLOR_ONE = Integer.decode("0x" + p.getProperty("VipTitleColorOne", "00FF00"));
- + VIP_TITLE_COLOR_TWO = Integer.decode("0x" + p.getProperty("VipTitleColorTwo", "00FF00"));
- + VIP_RATE_DROP_ADENA = Integer.parseInt(p.getProperty("VipDropAdena", "1"));
- + VIP_RATE_DROP_ADENA_ONE = Integer.parseInt(p.getProperty("VipDropAdenaOne", "1"));
- + VIP_RATE_DROP_ADENA_TWO = Integer.parseInt(p.getProperty("VipDropAdenaTwo", "1"));
- + VIP_RATE_DROP_SPOIL = Integer.parseInt(p.getProperty("VipDropSpoil", "1"));
- + VIP_RATE_DROP_SPOIL_ONE = Integer.parseInt(p.getProperty("VipDropSpoilOne", "1"));
- + VIP_RATE_DROP_SPOIL_TWO = Integer.parseInt(p.getProperty("VipDropSpoilTwo", "1"));
- + VIP_RATE_DROP = Integer.parseInt(p.getProperty("VipDrop", "1"));
- + VIP_RATE_DROP_ONE = Integer.parseInt(p.getProperty("VipDropOne", "1"));
- + VIP_RATE_DROP_TWO = Integer.parseInt(p.getProperty("VipDropTwo", "1"));
- +
- + VIP_RATE_DROP_BLUESEAL = Integer.parseInt(p.getProperty("VipDropBlueSeal", "1"));
- + VIP_RATE_DROP_BLUESEAL_ONE = Integer.parseInt(p.getProperty("VipDropBlueSealOne", "1"));
- + VIP_RATE_DROP_BLUESEAL_TWO = Integer.parseInt(p.getProperty("VipDropBlueSealTwo", "1"));
- + VIP_RATE_DROP_GREENSEAL = Integer.parseInt(p.getProperty("VipDropGreenSeal", "1"));
- + VIP_RATE_DROP_GREENSEAL_ONE = Integer.parseInt(p.getProperty("VipDropGreenSealOne", "1"));
- + VIP_RATE_DROP_GREENSEAL_TWO = Integer.parseInt(p.getProperty("VipDropGreenSealTwo", "1"));
- + VIP_RATE_DROP_REDSEAL = Integer.parseInt(p.getProperty("VipDropRedSeal", "1"));
- + VIP_RATE_DROP_REDSEAL_ONE = Integer.parseInt(p.getProperty("VipDropRedSealOne", "1"));
- + VIP_RATE_DROP_REDSEAL_TWO = Integer.parseInt(p.getProperty("VipDropRedSealTwo", "1"));
- + RATE_DROP_BLUESEAL = Integer.parseInt(p.getProperty("DropBlueSeal", "1"));
- + RATE_DROP_GREENSEAL = Integer.parseInt(p.getProperty("DropGreenSeal", "1"));
- + RATE_DROP_REDSEAL = Integer.parseInt(p.getProperty("DropRedSeal", "1"));
- +
- + VIP_RATE_XP = Integer.parseInt(p.getProperty("VipExpRate", "1"));
- + VIP_RATE_XP_ONE = Integer.parseInt(p.getProperty("VipExpRateOne", "1"));
- + VIP_RATE_XP_TWO = Integer.parseInt(p.getProperty("VipExpRateTwo", "1"));
- + VIP_RATE_SP = Integer.parseInt(p.getProperty("VipSpRate", "1"));
- + VIP_RATE_SP_ONE = Integer.parseInt(p.getProperty("VipSpRateOne", "1"));
- + VIP_RATE_SP_TWO = Integer.parseInt(p.getProperty("VipSpRateTwo", "1"));
- + VIP_ITEM_ID = Integer.parseInt(p.getProperty("VipItemId", "9955"));
- + VIP_ITEM_ID_ONE = Integer.parseInt(p.getProperty("VipItemIdOne", "9955"));
- + VIP_ITEM_ID_TWO = Integer.parseInt(p.getProperty("VipItemIdTwo", "9955"));
- + VIP_ITEM_DAYS = Integer.parseInt(p.getProperty("VipItemDays", "30"));
- + VIP_ITEM_DAYS_ONE = Integer.parseInt(p.getProperty("VipItemDaysOne", "30"));
- + VIP_ITEM_DAYS_TWO = Integer.parseInt(p.getProperty("VipItemDaysTwo", "30"));
- }
- catch (Exception e)
- {
- @@ -1961,6 +2118,9 @@
- }
- }
- + public static boolean OFF_TELEPORTER_ENABLE;
- + public static List<Integer> OFF_ACCEPTED_TELEPORTERS = new ArrayList<>();
- +
- public static void loadOptionsConfig()
- {
- try
- @@ -2102,6 +2262,16 @@
- }
- SHOUT_CHAT_LEVEL = Integer.parseInt(p.getProperty("ShoutChatLevel", "1"));
- TRADE_CHAT_LEVEL = Integer.parseInt(p.getProperty("TradeChatLevel", "1"));
- +
- + OFF_TELEPORTER_ENABLE = Boolean.valueOf(p.getProperty("EnableOFFTeleporter", "false"));
- + if (OFF_TELEPORTER_ENABLE)
- + {
- + OFF_ACCEPTED_TELEPORTERS = new ArrayList<>();
- + for (String type : p.getProperty("OFFAcceptedTeleportersId", "30080").split(","))
- + {
- + OFF_ACCEPTED_TELEPORTERS.add(Integer.valueOf(type));
- + }
- + }
- }
- catch (Exception e)
- {
- @@ -2190,6 +2360,22 @@
- AUTO_LOOT_HERBS = p.getProperty("AutoLootHerbs").trim().equalsIgnoreCase("true");
- AUTO_LOOT_ADENA = p.getProperty("AutoLootAdena").trim().equalsIgnoreCase("true");
- + String[] noAutoLoot = p.getProperty("NoAutoLootList", "0").split(",");
- + if (noAutoLoot.length > 0)
- + {
- + for (String id : noAutoLoot)
- + {
- + try
- + {
- + int npcId = Integer.valueOf(id);
- + if (npcId != 0)
- + NO_AUTO_LOOT_LIST.add(npcId);
- + }
- + catch (NumberFormatException nfe)
- + {
- + }
- + }
- + }
- PLAYER_SPAWN_PROTECTION = Integer.parseInt(p.getProperty("PlayerSpawnProtection", "5"));
- PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(p.getProperty("PlayerFakeDeathUpProtection", "0"));
- DEATH_PENALTY_CHANCE = Integer.parseInt(p.getProperty("DeathPenaltyChance", "20"));
- Index: Dream_GameServer/src/com/dream/game/network/SystemMessageId.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/network/SystemMessageId.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/network/SystemMessageId.java (working copy)
- @@ -12237,8 +12237,14 @@
- * ID: 680<br>
- * Message: You cannot participate in an auction.
- */
- - CANNOT_PARTICIPATE_IN_AN_AUCTION(680);
- + CANNOT_PARTICIPATE_IN_AN_AUCTION(680),
- + /**
- + * ID: 2155<br>
- + * Message: You will be moved to (). Do you wish to continue?
- + */
- + OFF_REQUEST_TELEPORTER(2155);
- +
- public static final SystemMessageId getSystemMessageId(int id)
- {
- return getSystemMessageId(id, true);
- Index: Dream_GameServer/src/com/dream/game/manager/VipManagerTwo.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/manager/VipManagerTwo.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/manager/VipManagerTwo.java (working copy)
- @@ -0,0 +1,179 @@
- +package com.dream.game.manager;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.Map;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.concurrent.ScheduledFuture;
- +import java.util.logging.Logger;
- +
- +import com.dream.L2DatabaseFactory;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.model.world.L2World;
- +import com.dream.game.network.ThreadPoolManager;
- +import com.dream.game.network.serverpackets.ExShowScreenMessage;
- +import com.dream.util.CloseUtil;
- +
- +/**
- + * @author rapfersan92
- + */
- +public class VipManagerTwo
- +{
- + private static final Logger _log = Logger.getLogger(VipManager.class.getName());
- +
- + private final Map<Integer, Long> _vips;
- + protected final Map<Integer, Long> _vipsTask;
- + private ScheduledFuture<?> _scheduler;
- +
- + public static VipManager getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + protected VipManagerTwo()
- + {
- + _vips = new ConcurrentHashMap<>();
- + _vipsTask = new ConcurrentHashMap<>();
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VipTask(), 1000, 1000);
- + load();
- + }
- +
- + public void reload()
- + {
- + _vips.clear();
- + _vipsTask.clear();
- + if (_scheduler != null)
- + _scheduler.cancel(true);
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VipTask(), 1000, 1000);
- + load();
- + }
- +
- + public void load()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("SELECT charId, duration FROM character_vip_two ORDER BY charId");
- + ResultSet rs = statement.executeQuery();
- + while (rs.next())
- + _vips.put(rs.getInt("charId"), rs.getLong("duration"));
- + rs.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Exception: VipManager load: " + e.getMessage());
- + }
- +
- + _log.info("VipManager: Loaded " + _vips.size() + " characters with vip privileges.");
- + }
- +
- + public void addVip(int charId, long duration)
- + {
- + _vips.put(charId, duration);
- + _vipsTask.put(charId, duration);
- + manageVipPrivileges(charId);
- + }
- +
- + public static void doVip(L2PcInstance player, int days)
- + {
- + if (player == null)
- + return;
- +
- + player.setEndTime("vip", days);
- +
- + Connection connection = null;
- + try
- + {
- + connection = L2DatabaseFactory.getInstance().getConnection();
- +
- + PreparedStatement statement = connection.prepareStatement("INSERT INTO character_vip_two (charId, duration) VALUES (?, ?)");
- + statement.setInt(1, player.getObjectId());
- + statement.setLong(2, player.getVipEndTime());
- + statement.execute();
- + statement.close();
- + connection.close();
- + }
- + catch (Exception e)
- + {
- +
- + }
- + finally
- + {
- + CloseUtil.close(connection);
- + }
- + }
- +
- + public void removeVip(int charId)
- + {
- + _vips.remove(charId);
- + _vipsTask.remove(charId);
- + manageVipPrivileges(charId);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("DELETE FROM character_vip_two WHERE charId = ?");
- + statement.setInt(1, charId);
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Exception: VipManager removeVip: " + e.getMessage());
- + }
- + }
- +
- + public boolean hasVipPrivileges(int charId)
- + {
- + return _vips.containsKey(charId);
- + }
- +
- + public long getVipDuration(int charId)
- + {
- + return _vips.get(charId);
- + }
- +
- + public void addVipTask(int charId, long duration)
- + {
- + _vipsTask.put(charId, duration);
- + }
- +
- + public void removeVipTask(int charId)
- + {
- + _vipsTask.remove(charId);
- + }
- +
- + public void manageVipPrivileges(int charId)
- + {
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.broadcastUserInfo();
- + }
- +
- + public class VipTask implements Runnable
- + {
- + @Override
- + public final void run()
- + {
- + if (_vipsTask.isEmpty())
- + return;
- +
- + for (Map.Entry<Integer, Long> entry : _vipsTask.entrySet())
- + {
- + final long duration = entry.getValue();
- + if (System.currentTimeMillis() > duration)
- + {
- + final int charId = entry.getKey();
- + removeVip(charId);
- +
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.sendPacket(new ExShowScreenMessage("Your vip privileges were removed.", 10000));
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final VipManager _instance = new VipManager();
- + }
- +}
- \ No newline at end of file
- Index: Dream_DataPack/sql/server/character_sao.sql
- ===================================================================
- --- Dream_DataPack/sql/server/character_sao.sql (revision 0)
- +++ Dream_DataPack/sql/server/character_sao.sql (working copy)
- @@ -0,0 +1,5 @@
- +CREATE TABLE IF NOT EXISTS `character_sao` (
- + `objectId` INT NOT NULL DEFAULT 0,
- + `duration` BIGINT NOT NULL DEFAULT 0,
- + PRIMARY KEY (`objectId`)
- +);
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/L2GameServer.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/L2GameServer.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/L2GameServer.java (working copy)
- @@ -87,10 +87,12 @@
- import com.dream.game.manager.QuestManager;
- import com.dream.game.manager.RaidBossSpawnManager;
- import com.dream.game.manager.RaidPointsManager;
- +import com.dream.game.manager.SaoManager;
- import com.dream.game.manager.SiegeManager;
- import com.dream.game.manager.SiegeRewardManager;
- import com.dream.game.manager.TaskManager;
- import com.dream.game.manager.TownManager;
- +import com.dream.game.manager.VipManager;
- import com.dream.game.manager.clanhallsiege.BanditStrongholdSiege;
- import com.dream.game.manager.clanhallsiege.DevastatedCastleSiege;
- import com.dream.game.manager.clanhallsiege.FortResistSiegeManager;
- @@ -463,6 +465,8 @@
- TaskManager.getInstance();
- GmListTable.getInstance();
- PetitionManager.getInstance();
- + SaoManager.getInstance();
- + VipManager.getInstance();
- if (Config.COMMUNITY_TYPE.equals("full"))
- {
- Index: Dream_GameServer/src/com/dream/game/manager/BossSpawnManager.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/manager/BossSpawnManager.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/manager/BossSpawnManager.java (working copy)
- @@ -27,6 +27,7 @@
- import com.dream.game.model.L2Spawn;
- import com.dream.game.network.ThreadPoolManager;
- import com.dream.game.templates.chars.L2NpcTemplate;
- +import com.dream.game.util.Broadcast;
- import com.dream.tools.random.Rnd;
- import com.dream.util.StatsSet;
- @@ -68,7 +69,7 @@
- _storedInfo.put(bossId, info);
- - GmListTable.broadcastMessageToGMs("Spawning Raid Boss " + raidboss.getName());
- + Broadcast.announceToOnlinePlayers("Spawning Raid Boss " + raidboss.getName());
- _bosses.put(bossId, raidboss);
- }
- Index: Dream_GameServer/src/com/dream/game/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/actor/instance/L2PcInstance.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/model/actor/instance/L2PcInstance.java (working copy)
- @@ -4,11 +4,14 @@
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- +import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Calendar;
- import java.util.Collection;
- +import java.util.Date;
- import java.util.HashMap;
- import java.util.HashSet;
- +import java.util.Iterator;
- import java.util.LinkedHashMap;
- import java.util.List;
- import java.util.Map;
- @@ -64,6 +67,7 @@
- import com.dream.game.manager.PartyRoomManager;
- import com.dream.game.manager.QuestManager;
- import com.dream.game.manager.RecipeController;
- +import com.dream.game.manager.SaoManager;
- import com.dream.game.manager.SiegeManager;
- import com.dream.game.model.BlockList;
- import com.dream.game.model.CursedWeapon;
- @@ -98,6 +102,7 @@
- import com.dream.game.model.actor.L2Summon;
- import com.dream.game.model.actor.appearance.PcAppearance;
- import com.dream.game.model.actor.knownlist.PcKnownList;
- +import com.dream.game.model.actor.position.L2CharPosition;
- import com.dream.game.model.actor.reference.ClearableReference;
- import com.dream.game.model.actor.reference.ImmutableReference;
- import com.dream.game.model.actor.stat.PcStat;
- @@ -130,6 +135,7 @@
- import com.dream.game.model.restriction.ObjectRestrictions;
- import com.dream.game.model.world.L2World;
- import com.dream.game.model.world.L2WorldRegion;
- +import com.dream.game.model.world.Location;
- import com.dream.game.model.zone.L2TradeZone;
- import com.dream.game.model.zone.L2Zone;
- import com.dream.game.network.AuthServerThread;
- @@ -157,6 +163,7 @@
- import com.dream.game.network.serverpackets.ExOlympiadUserInfo;
- import com.dream.game.network.serverpackets.ExPutEnchantTargetItemResult;
- import com.dream.game.network.serverpackets.ExSetCompassZoneCode;
- +import com.dream.game.network.serverpackets.ExShowScreenMessage;
- import com.dream.game.network.serverpackets.ExStorageMaxCount;
- import com.dream.game.network.serverpackets.FriendList;
- import com.dream.game.network.serverpackets.HennaInfo;
- @@ -4199,6 +4206,18 @@
- stopRentPet();
- stopWaterTask();
- sendPacket(new EtcStatusUpdate(this));
- +
- + if (Config.ALLOW_SAO_MOD && !isGM())
- + {
- + SaoManager.getInstance().addSao(getObjectId(), System.currentTimeMillis() + Config.SAO_TIME_CONFIG * Config.SAO_TIME_CONFIG_MULTIPLIER);
- + sendChatMessage(0, SystemChatChannelId.Chat_None, "SAO", Config.SAO_TIME_INFO + new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(System.currentTimeMillis() + Config.SAO_TIME_CONFIG * Config.SAO_TIME_CONFIG_MULTIPLIER)) + ".");
- + sendPacket(new ExShowScreenMessage(Config.SAO_START_MSG, 10000));
- + SaoManager.getInstance().addSaoTask(getObjectId(), (System.currentTimeMillis() + Config.SAO_TIME_CONFIG * Config.SAO_TIME_CONFIG_MULTIPLIER));
- + NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile("data/html/mods/SAOHtml.htm");
- + sendPacket(html);
- + }
- +
- return true;
- }
- @@ -4413,6 +4432,13 @@
- _reviveRequested = false;
- _revivePower = 0;
- + if (Config.ALLOW_SAO_MOD && SaoManager.getInstance().hasSaoPrivileges(getObjectId()) && !isGM())
- + {
- + SaoManager.getInstance().removeSao(getObjectId());
- + sendPacket(new ExShowScreenMessage(Config.SAO_END_MSG, 10000));
- + SaoManager.getInstance().removeSaoTask(getObjectId());
- + }
- +
- if (isMounted())
- {
- startFeed(_mountNpcId);
- @@ -12601,4 +12627,298 @@
- return _wantsPeace;
- }
- + private int[] KAY_TELEPORTER_COORDS;
- +
- + public void addKayTeleporterCoords(int[] cords)
- + {
- + this.KAY_TELEPORTER_COORDS = cords;
- + }
- +
- + public int[] getTeleporterKayCoords()
- + {
- + return this.KAY_TELEPORTER_COORDS;
- + }
- +
- + private long _vip_endTime = 0;
- +
- + public void setVipEndTime(long val)
- + {
- + _vip_endTime = val;
- + }
- +
- + public long getVipEndTime()
- + {
- + return _vip_endTime;
- + }
- +
- + public void setEndTime(String process, int val)
- + {
- + if (val > 0)
- + {
- + long end_day;
- + Calendar calendar = Calendar.getInstance();
- + if (val >= 30)
- + {
- + while (val >= 30)
- + {
- + if (calendar.get(Calendar.MONTH) == 11)
- + {
- + calendar.roll(Calendar.YEAR, true);
- + }
- + calendar.roll(Calendar.MONTH, true);
- + val -= 30;
- + }
- + }
- + if ((val < 30) && (val > 0))
- + {
- + while (val > 0)
- + {
- + if ((calendar.get(Calendar.DATE) == 28) && (calendar.get(Calendar.MONTH) == 1))
- + {
- + calendar.roll(Calendar.MONTH, true);
- + }
- + if (calendar.get(Calendar.DATE) == 30)
- + {
- + if (calendar.get(Calendar.MONTH) == 11)
- + {
- + calendar.roll(Calendar.YEAR, true);
- + }
- + calendar.roll(Calendar.MONTH, true);
- +
- + }
- + calendar.roll(Calendar.DATE, true);
- + val--;
- + }
- + }
- +
- + end_day = calendar.getTimeInMillis();
- + if (process.equals("vip"))
- + {
- + _vip_endTime = end_day;
- + }
- + else
- + {
- + _log.warn("process " + process + "no Known while try set end date");
- + return;
- + }
- + Date dt = new Date(end_day);
- + _log.info("" + process + " End time for player " + getName() + " is " + dt);
- + }
- + else
- + {
- + if (process.equals("aio"))
- + {
- + _vip_endTime = 0;
- + }
- + else
- + {
- + _log.info("process " + process + "no Known while try set end date");
- + return;
- + }
- + }
- + }
- +
- + @SuppressWarnings("unused")
- + private boolean _IsPhantom = false;
- + private int _fakeProtect = 0;
- + public Location _phantomLoc = null;
- +
- + public Location getPhantomLoc()
- + {
- + return this._phantomLoc;
- + }
- +
- + public boolean rndWalk(L2Character paramL2Character, boolean paramBoolean)
- + {
- + rndWalk();
- + if (this._fakeProtect > 2)
- + {
- + return false;
- + }
- + this._fakeProtect += 1;
- + return true;
- + }
- +
- + public void rndWalk()
- + {
- + int i = getX();
- + int j = getY();
- + int k = getZ();
- + switch (Rnd.get(1, 6))
- + {
- + case 1:
- + i += 40;
- + j += 180;
- + break;
- + case 2:
- + i += 150;
- + j += 50;
- + break;
- + case 3:
- + i += 69;
- + j -= 100;
- + break;
- + case 4:
- + i += 10;
- + j -= 100;
- + break;
- + case 5:
- + i -= 150;
- + j -= 20;
- + break;
- + case 6:
- + i -= 100;
- + j += 60;
- + }
- + setRunning();
- + getAI().setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(i, j, k, calcHeading(i, j)));
- + }
- +
- + public void clearRndWalk()
- + {
- + }
- +
- + public void setOnlineStatusPhantom(boolean paramBoolean)
- + {
- + Connection localConnection = null;
- + try
- + {
- + localConnection = L2DatabaseFactory.getInstance().getConnection(localConnection);
- + PreparedStatement localPreparedStatement = localConnection.prepareStatement("UPDATE characters SET online=?, lastAccess=? WHERE charId=?");
- + if (paramBoolean)
- + {
- + localPreparedStatement.setInt(1, 1);
- + }
- + else
- + {
- + localPreparedStatement.setInt(1, 0);
- + }
- + localPreparedStatement.setLong(2, System.currentTimeMillis());
- + localPreparedStatement.setInt(3, getObjectId());
- + localPreparedStatement.execute();
- + localPreparedStatement.close();
- +
- + return;
- + }
- + catch (Exception localException)
- + {
- + _log.error("Failed updating character online status.", localException);
- + }
- + finally
- + {
- + try
- + {
- + if (localConnection != null)
- + {
- + localConnection.close();
- + }
- + }
- + catch (SQLException localSQLException3)
- + {
- + localSQLException3.printStackTrace();
- + }
- + }
- + }
- +
- + public void setPhantomLoc(int paramInt1, int paramInt2, int paramInt3)
- + {
- + this._phantomLoc = new Location(paramInt1, paramInt2, paramInt3);
- + }
- +
- + public static L2PcInstance loadPhantom(int paramInt1, int paramInt2, int paramInt3, boolean paramBoolean)
- + {
- + L2PcInstance localL2PcInstance = null;
- + int i = Rnd.get(89, 112);
- + if (paramInt3 > 0)
- + {
- + i = paramInt3;
- + }
- + boolean bool1 = Rnd.get(0, 1) != 0;
- + L2PcTemplate localL2PcTemplate = CharTemplateTable.getInstance().getTemplate(i);
- + byte b = (byte) Rnd.get(3);
- + PcAppearance localPcAppearance = new PcAppearance(b, b, b, bool1);
- + if (paramBoolean)
- + {
- + localL2PcInstance = new L2PcInstance(paramInt1, localL2PcTemplate, "fake_qwerty", localPcAppearance);
- + }
- + else
- + {
- + localL2PcInstance = new L2PcInstance(paramInt1, localL2PcTemplate, "fake_qwerty", localPcAppearance);
- + }
- + localL2PcInstance.setIsPhantom(true);
- + localL2PcInstance._lastAccess = 0L;
- + localL2PcInstance.getStat().setSp(Integer.MAX_VALUE);
- + long l1 = localL2PcInstance.getExp();
- + long l2 = Experience.LEVEL[paramInt2];
- + localL2PcInstance.addExpAndSp(l2 - l1, 0);
- + localL2PcInstance.setHeading(Rnd.get(1, 65535));
- + localL2PcInstance.setKarma(0);
- + localL2PcInstance.setPvpKills(0);
- + localL2PcInstance.setPkKills(0);
- + localL2PcInstance.setOnlineTime(0L);
- + localL2PcInstance.setNewbie(0);
- + boolean bool2 = Rnd.get(0, 1) != 0;
- + localL2PcInstance.setNoble(bool2);
- + localL2PcInstance.setHero(false);
- + localL2PcInstance.setClanJoinExpiryTime(0L);
- + localL2PcInstance.setClanJoinExpiryTime(0L);
- + localL2PcInstance.setClanCreateExpiryTime(0L);
- + localL2PcInstance.setClanCreateExpiryTime(0L);
- + localL2PcInstance.setPledgeType(0);
- + localL2PcInstance.setPledgeRank(0);
- + localL2PcInstance.setApprentice(0);
- + localL2PcInstance.setLastRecomUpdate(0L);
- + localL2PcInstance.setDeleteTimer(0L);
- + localL2PcInstance.setFistsWeaponItem(localL2PcInstance.findFistsWeaponItem(i));
- + localL2PcInstance.setUptime(System.currentTimeMillis());
- + localL2PcInstance.getStatus().setCurrentHp(localL2PcInstance.getMaxHp());
- + localL2PcInstance.getStatus().setCurrentCp(localL2PcInstance.getMaxCp());
- + localL2PcInstance.getStatus().setCurrentMp(localL2PcInstance.getMaxMp());
- + localL2PcInstance.checkRecom(5, 1);
- + localL2PcInstance._classIndex = 0;
- + try
- + {
- + localL2PcInstance.setBaseClass(2);
- + }
- + catch (Exception localException)
- + {
- + localL2PcInstance.setBaseClass(i);
- + }
- + if ((restoreSubClassData(localL2PcInstance)) && (i != localL2PcInstance.getBaseClass()))
- + {
- + Iterator<SubClass> localIterator = localL2PcInstance.getSubClasses().values().iterator();
- + while (localIterator.hasNext())
- + {
- + SubClass localSubClass = localIterator.next();
- + if (localSubClass.getClassId() == i)
- + {
- + localL2PcInstance._classIndex = localSubClass.getClassIndex();
- + }
- + }
- + }
- + localL2PcInstance._activeClass = i;
- + localL2PcInstance.setApprentice(0);
- + localL2PcInstance.setSponsor(0);
- + localL2PcInstance.setLvlJoinedAcademy(0);
- + localL2PcInstance.setIsIn7sDungeon(false);
- + localL2PcInstance.setInJail(false);
- + localL2PcInstance.setJailTimer(0L);
- + localL2PcInstance.setAllianceWithVarkaKetra(0);
- + localL2PcInstance.setDeathPenaltyBuffLevel(0);
- + localL2PcInstance.setPcCaffePoints(0);
- + try
- + {
- + localL2PcInstance.stopAllTimers();
- + }
- + catch (Throwable localThrowable)
- + {
- + _log.warn("deleteMe()", localThrowable);
- + }
- + return localL2PcInstance;
- + }
- +
- + public void setIsPhantom(boolean paramBoolean)
- + {
- + _IsPhantom = paramBoolean;
- + }
- }
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/model/actor/L2Attackable.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/actor/L2Attackable.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/model/actor/L2Attackable.java (working copy)
- @@ -32,6 +32,9 @@
- import com.dream.game.manager.CursedWeaponsManager;
- import com.dream.game.manager.EventsDropManager;
- import com.dream.game.manager.ItemsAutoDestroy;
- +import com.dream.game.manager.VipManager;
- +import com.dream.game.manager.VipManagerOne;
- +import com.dream.game.manager.VipManagerTwo;
- import com.dream.game.manager.clanhallsiege.FortResistSiegeManager;
- import com.dream.game.model.L2Boss;
- import com.dream.game.model.L2CommandChannel;
- @@ -743,17 +746,123 @@
- champRate = 1;
- }
- - if (drop.getItemId() == 57)
- + if (drop.getItemId() == 6360)
- {
- - dropChance *= Config.RATE_DROP_ADENA;
- + if (VipManager.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_BLUESEAL;
- + }
- + else if (VipManagerOne.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_BLUESEAL_ONE;
- + }
- + else if (VipManagerTwo.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_BLUESEAL_TWO;
- + }
- + else
- + {
- + dropChance *= Config.RATE_DROP_BLUESEAL;
- + }
- +
- }
- + else if (drop.getItemId() == 6361)
- + {
- + if (VipManager.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_GREENSEAL;
- + }
- + else if (VipManagerOne.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_GREENSEAL_ONE;
- + }
- + else if (VipManagerTwo.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_GREENSEAL_TWO;
- + }
- + else
- + {
- + dropChance *= Config.RATE_DROP_GREENSEAL;
- + }
- +
- + }
- + else if (drop.getItemId() == 6362)
- + {
- + if (VipManager.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_REDSEAL;
- + }
- + else if (VipManagerOne.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_REDSEAL_ONE;
- + }
- + else if (VipManagerTwo.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_REDSEAL_TWO;
- + }
- + else
- + {
- + dropChance *= Config.RATE_DROP_REDSEAL;
- + }
- +
- + }
- + else if (drop.getItemId() == 57)
- + {
- + if (VipManager.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_ADENA;
- + }
- + else if (VipManagerOne.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_ADENA_ONE;
- + }
- + else if (VipManagerTwo.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_ADENA_TWO;
- + }
- + else
- + {
- + dropChance *= Config.RATE_DROP_ADENA;
- + }
- +
- + }
- else if (isSweep)
- {
- - dropChance *= Config.RATE_DROP_SPOIL;
- + if (VipManager.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_SPOIL;
- + }
- + else if (VipManagerOne.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_SPOIL_ONE;
- + }
- + else if (VipManagerTwo.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_SPOIL_TWO;
- + }
- + else
- + {
- + dropChance *= Config.RATE_DROP_SPOIL;
- + }
- }
- else
- {
- - dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
- + if (VipManager.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP;
- + }
- + else if (VipManagerOne.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_ONE;
- + }
- + else if (VipManagerTwo.getInstance().hasVipPrivileges(lastAttacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + dropChance *= Config.VIP_RATE_DROP_TWO;
- + }
- + else
- + {
- + dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
- + }
- }
- dropChance = Math.round(dropChance) * champRate;
- @@ -1003,6 +1112,22 @@
- player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ACQUIRED_S1_BONUS_EXPERIENCE_THROUGH_OVER_HIT).addNumber(overHitExp));
- exp += overHitExp;
- }
- +
- + if (VipManager.getInstance().hasVipPrivileges(attacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + exp *= Config.VIP_RATE_XP;
- + sp *= Config.VIP_RATE_SP;
- + }
- + if (VipManagerOne.getInstance().hasVipPrivileges(attacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + exp *= Config.VIP_RATE_XP_ONE;
- + sp *= Config.VIP_RATE_SP_ONE;
- + }
- + if (VipManagerTwo.getInstance().hasVipPrivileges(attacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + exp *= Config.VIP_RATE_XP_TWO;
- + sp *= Config.VIP_RATE_SP_TWO;
- + }
- }
- // Distribute the Exp and SP between the
- @@ -1166,6 +1291,24 @@
- player.sendPacket(SystemMessageId.OVER_HIT);
- exp += calculateOverhitExp(exp);
- }
- +
- + if (VipManager.getInstance().hasVipPrivileges(attacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + exp *= Config.VIP_RATE_XP;
- + sp *= Config.VIP_RATE_SP;
- + }
- +
- + if (VipManagerOne.getInstance().hasVipPrivileges(attacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + exp *= Config.VIP_RATE_XP_ONE;
- + sp *= Config.VIP_RATE_SP_ONE;
- + }
- +
- + if (VipManagerTwo.getInstance().hasVipPrivileges(attacker.getObjectId()) && Config.ALLOW_VIP_CHARACTERS)
- + {
- + exp *= Config.VIP_RATE_XP_TWO;
- + sp *= Config.VIP_RATE_SP_TWO;
- + }
- }
- // champion xp/sp :)
- @@ -1339,8 +1482,12 @@
- if (Rnd.get(L2DropData.MAX_CHANCE) < drop.chance)
- {
- RewardItem item = new RewardItem(drop.items[Rnd.get(drop.items.length)], Rnd.get(drop.min, drop.max));
- - if (Config.AUTO_LOOT_RAID && isRaid() && player.isAutoLootEnabled())
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (Config.AUTO_LOOT_RAID && isRaid() && player.isAutoLootEnabled())
- + {
- player.doAutoLoot(this, item);
- }
- else if (player.isAutoLootEnabled() && !isRaid())
- @@ -1434,8 +1581,12 @@
- _log.warn("Item id to drop: " + item.getItemId() + " amount: " + item.getCount());
- }
- - if (player.isAutoLootEnabled() && !isRaid())
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && !isRaid())
- + {
- player.doAutoLoot(this, item);
- }
- else
- @@ -1472,8 +1623,12 @@
- if (rewardItem[0] > 0 && rewardItem[1] > 0)
- {
- RewardItem item = new RewardItem(rewardItem[0], rewardItem[1]);
- - if (player.isAutoLootEnabled())
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled())
- + {
- player.doAutoLoot(this, item);
- }
- else
- @@ -1493,8 +1648,12 @@
- if (random < Config.RATE_DROP_SPECIAL_HERBS && !_spec)
- {
- RewardItem item = new RewardItem(8612, 1);
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1524,8 +1683,12 @@
- // Attack - Rate
- break;
- }
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1541,8 +1704,12 @@
- if (random < Config.RATE_DROP_SPECIAL_HERBS && !_spec)
- {
- RewardItem item = new RewardItem(8613, 1); // Herb of Mystic
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1570,8 +1737,12 @@
- // Speed
- }
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1587,8 +1758,12 @@
- if (random < Config.RATE_DROP_SPECIAL_HERBS && !_spec)
- {
- RewardItem item = new RewardItem(8614, 1); // Herb of Recovery
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1606,8 +1781,12 @@
- if (random < Config.RATE_DROP_MP_HP_HERBS)
- {
- RewardItem item = new RewardItem(8600, 1); // Herb of Life
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1624,8 +1803,12 @@
- {
- RewardItem item = new RewardItem(8601, 1); // Greater Herb
- // of Life
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1641,8 +1824,12 @@
- if (random < Config.RATE_DROP_SUPERIOR_HERBS)
- {
- RewardItem item = new RewardItem(8602, 1);
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1657,8 +1844,12 @@
- if (random < Config.RATE_DROP_MP_HP_HERBS)
- {
- RewardItem item = new RewardItem(8603, 1);
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1674,8 +1865,12 @@
- if (random < Config.RATE_DROP_GREATER_HERBS)
- {
- RewardItem item = new RewardItem(8604, 1);
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1691,8 +1886,12 @@
- if (random < Config.RATE_DROP_SUPERIOR_HERBS)
- {
- RewardItem item = new RewardItem(8605, 1);
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- @@ -1706,8 +1905,12 @@
- if (random < Config.RATE_DROP_COMMON_HERBS)
- {
- RewardItem item = new RewardItem(8611, 1);
- - if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + if (Config.NO_AUTO_LOOT_LIST.contains(this.getNpcId()))
- {
- + dropItem(player, item);
- + }
- + else if (player.isAutoLootEnabled() && Config.AUTO_LOOT_HERBS)
- + {
- player.addItem("Loot", item.getItemId(), item.getCount(), this, true);
- }
- else
- Index: Dream_GameServer/src/com/dream/game/network/clientpackets/EnterWorld.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/network/clientpackets/EnterWorld.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/network/clientpackets/EnterWorld.java (working copy)
- @@ -1,5 +1,8 @@
- package com.dream.game.network.clientpackets;
- +import java.text.SimpleDateFormat;
- +import java.util.Date;
- +
- import org.apache.log4j.Logger;
- import com.dream.Config;
- @@ -20,8 +23,12 @@
- import com.dream.game.manager.FortManager;
- import com.dream.game.manager.FortSiegeManager;
- import com.dream.game.manager.PetitionManager;
- +import com.dream.game.manager.SaoManager;
- import com.dream.game.manager.SiegeManager;
- import com.dream.game.manager.SiegeRewardManager;
- +import com.dream.game.manager.VipManager;
- +import com.dream.game.manager.VipManagerOne;
- +import com.dream.game.manager.VipManagerTwo;
- import com.dream.game.manager.clanhallsiege.DevastatedCastleSiege;
- import com.dream.game.manager.clanhallsiege.FortressOfDeadSiege;
- import com.dream.game.model.L2Clan;
- @@ -53,6 +60,7 @@
- import com.dream.game.network.serverpackets.Die;
- import com.dream.game.network.serverpackets.EtcStatusUpdate;
- import com.dream.game.network.serverpackets.ExBasicActionList;
- +import com.dream.game.network.serverpackets.ExShowScreenMessage;
- import com.dream.game.network.serverpackets.ExStorageMaxCount;
- import com.dream.game.network.serverpackets.FriendList;
- import com.dream.game.network.serverpackets.HennaInfo;
- @@ -439,7 +447,6 @@
- activeChar.sendPacket(SystemMessageId.WELCOME_TO_LINEAGE);
- SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
- Announcements.getInstance().showAnnouncements(activeChar);
- - activeChar.sendChatMessage(0, SystemChatChannelId.Chat_None, Config.SERVER_NAME, "Thank you for using Dream Project..");
- ObjectRestrictions.getInstance().resumeTasks(activeChar.getObjectId());
- @@ -557,6 +564,26 @@
- sendPacket(html);
- }
- + if (SaoManager.getInstance().hasSaoPrivileges(activeChar.getObjectId()))
- + {
- + final L2PcInstance player = L2World.getInstance().getPlayer(activeChar.getObjectId());
- +
- + long duration = SaoManager.getInstance().getSaoDuration(activeChar.getObjectId());
- + player.sendPacket(new ExShowScreenMessage(Config.SAO_TIME_INFO + new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(duration)) + ".", 10000));
- + player.sendChatMessage(0, SystemChatChannelId.Chat_None, "SAO", Config.SAO_TIME_INFO + new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(duration)) + ".");
- + SaoManager.getInstance().addSaoTask(activeChar.getObjectId(), duration);
- + }
- +
- + if (VipManager.getInstance().hasVipPrivileges(activeChar.getObjectId()) || VipManagerOne.getInstance().hasVipPrivileges(activeChar.getObjectId()) || VipManagerTwo.getInstance().hasVipPrivileges(activeChar.getObjectId()))
- + {
- + final L2PcInstance player = L2World.getInstance().getPlayer(activeChar.getObjectId());
- +
- + long duration = VipManager.getInstance().getVipDuration(activeChar.getObjectId());
- + player.sendPacket(new ExShowScreenMessage("Your VIP end at " + new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(duration)) + ".", 10000));
- + player.sendChatMessage(0, SystemChatChannelId.Chat_None, "VIP", "Dear " + player.getName() + " now you have VIP Status " + " you have acess granted in VIPs NPC's," + " remember your VIP end at " + new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(duration)) + ".");
- + VipManager.getInstance().addVipTask(activeChar.getObjectId(), duration);
- + }
- +
- if ((activeChar._event != null) && (activeChar._event.getState() == GameEvent.STATE_ACTIVE))
- {
- activeChar.addMessage("<html><body><br>Don't forget, you party the remaining <font color=\"LEVEL\">" + activeChar._event.getName() + "</font>!</body></html>");
- Index: Dream_GameServer/dist/config/main/npc.properties
- ===================================================================
- --- Dream_GameServer/dist/config/main/npc.properties (revision 83)
- +++ Dream_GameServer/dist/config/main/npc.properties (working copy)
- @@ -98,10 +98,18 @@
- # Instantly update a database of information on the status of the boss after his assassination
- # Use this option with caution.
- ForceUpdateRaidBossOnDB = False
- +<<<<<<< .mine
- # If True, Lethal Protected Mobs (in LethalProtectedMobs property) cannot receive Lethal shot
- AllowLethalProtectionMobs = False
- +# es. : LethalProtectedMobs = 35062,21436
- +# 35062 = CTFFlag
- +LethalProtectedMobs = 35062
- +=======
- +# If True, Lethal Protected Mobs (in LethalProtectedMobs property) cannot receive Lethal shot
- +AllowLethalProtectionMobs = False
- +
- # es. : LethalProtectedMobs = 35062,21436
- # 35062 = CTFFlag
- -LethalProtectedMobs = 35062
- \ No newline at end of file
- +LethalProtectedMobs = 35062>>>>>>> .r81
- Index: Dream_GameServer/src/com/dream/game/network/clientpackets/DlgAnswer.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/network/clientpackets/DlgAnswer.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/network/clientpackets/DlgAnswer.java (working copy)
- @@ -32,8 +32,16 @@
- }
- getClient().getActiveChar().removeConfirmDlgRequestTime(_requesterId);
- - if (_messageId == SystemMessageId.S1_MAKING_RESSURECTION_REQUEST.getId())
- + if (_messageId == SystemMessageId.OFF_REQUEST_TELEPORTER.getId())
- {
- + if (cha.getTeleporterKayCoords() != null && _answer != 0)
- + {
- + cha.teleToLocation(cha.getTeleporterKayCoords()[0], cha.getTeleporterKayCoords()[1], cha.getTeleporterKayCoords()[2]);
- + cha.addKayTeleporterCoords(null);
- + }
- + }
- + else if (_messageId == SystemMessageId.S1_MAKING_RESSURECTION_REQUEST.getId())
- + {
- cha.reviveAnswer(_answer);
- }
- else if (_messageId == SystemMessageId.S1_WISHES_TO_SUMMON_YOU_FROM_S2_DO_YOU_ACCEPT.getId())
- Index: Dream_GameServer/src/com/dream/game/network/serverpackets/Die.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/network/serverpackets/Die.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/network/serverpackets/Die.java (working copy)
- @@ -1,6 +1,8 @@
- package com.dream.game.network.serverpackets;
- +import com.dream.Config;
- import com.dream.game.manager.FortSiegeManager;
- +import com.dream.game.manager.SaoManager;
- import com.dream.game.manager.SiegeManager;
- import com.dream.game.manager.clanhallsiege.BanditStrongholdSiege;
- import com.dream.game.manager.clanhallsiege.WildBeastFarmSiege;
- @@ -11,6 +13,7 @@
- import com.dream.game.model.actor.instance.L2PcInstance;
- import com.dream.game.model.entity.siege.FortSiege;
- import com.dream.game.model.entity.siege.Siege;
- +import com.dream.game.model.world.L2World;
- public class Die extends L2GameServerPacket
- {
- @@ -17,7 +20,7 @@
- private final int _charObjId;
- private final boolean _fallDown;
- private boolean _sweepable;
- - private boolean _inFunEvent = false;
- + private boolean _inFunEvent;
- private final L2Character _activeChar;
- private final int _showVillage;
- private int _showClanhall;
- @@ -95,17 +98,29 @@
- @Override
- protected final void writeImpl()
- {
- + final L2PcInstance player = L2World.getInstance().getPlayer(_activeChar.getObjectId());
- +
- if (!_fallDown)
- return;
- - writeC(0x6);
- - writeD(_charObjId);
- - writeD(_inFunEvent ? 0x00 : _showVillage);
- - writeD(_inFunEvent ? 0x00 : _showClanhall);
- - writeD(_inFunEvent ? 0x00 : _showCastle);
- - writeD(_showFlag);
- - writeD(_sweepable ? 0x01 : 0x00);
- - writeD(_inFunEvent ? 0x00 : _fixedres);
- + writeC(0x6);
- + writeD(_charObjId);
- +
- + if (Config.ALLOW_SAO_MOD && player != null && _activeChar instanceof L2PcInstance)
- + {
- + writeD(SaoManager.getInstance().hasSaoPrivileges(player.getObjectId()) ? 0x00 : _showVillage);
- + writeD(SaoManager.getInstance().hasSaoPrivileges(player.getObjectId()) ? 0x00 : _showClanhall);
- + writeD(SaoManager.getInstance().hasSaoPrivileges(player.getObjectId()) ? 0x00 : _showCastle);
- + }
- + else
- + {
- + writeD(_inFunEvent ? 0x00 : _showVillage);
- + writeD(_inFunEvent ? 0x00 : _showClanhall);
- + writeD(_inFunEvent ? 0x00 : _showCastle);
- + }
- + writeD(_showFlag);
- + writeD(_sweepable ? 0x01 : 0x00);
- + writeD(_inFunEvent ? 0x00 : _fixedres);
- }
- }
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/model/actor/instance/L2TeleporterInstance.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/actor/instance/L2TeleporterInstance.java (revision 83)
- +++ Dream_GameServer/src/com/dream/game/model/actor/instance/L2TeleporterInstance.java (working copy)
- @@ -18,6 +18,7 @@
- import com.dream.game.model.restriction.ObjectRestrictions;
- import com.dream.game.network.SystemMessageId;
- import com.dream.game.network.serverpackets.ActionFailed;
- +import com.dream.game.network.serverpackets.ConfirmDlg;
- import com.dream.game.network.serverpackets.NpcHtmlMessage;
- import com.dream.game.templates.chars.L2NpcTemplate;
- @@ -80,7 +81,26 @@
- if (!list.isForNoble() && player.reduceAdena("Teleport", price, this, true))
- {
- - player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), true);
- + if (Config.OFF_TELEPORTER_ENABLE && Config.OFF_ACCEPTED_TELEPORTERS.contains(this.getTemplate().getNpcId()))
- + {
- + ConfirmDlg confirm = new ConfirmDlg(SystemMessageId.OFF_REQUEST_TELEPORTER.getId());
- + confirm.addString(this.getTemplate().getName());
- + confirm.addZoneName(list.getLocX(), list.getLocY(), list.getLocZ());
- + confirm.addTime(15000);
- + confirm.addRequesterId(player.getObjectId());
- + int[] cords =
- + {
- + list.getLocX(),
- + list.getLocY(),
- + list.getLocZ()
- + };
- + player.addKayTeleporterCoords(cords);
- + player.sendPacket(confirm);
- + }
- + else
- + {
- + player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), true);
- + }
- if (Config.PLAYER_SPAWN_PROTECTION > 0 && !isInsidePeaceZone(player))
- {
- player.sendMessage(String.format(Message.getMessage(player, Message.MessageId.MSG_SPAWN_PROTECTION), Config.PLAYER_SPAWN_PROTECTION));
- Index: Dream_GameServer/dist/config/custom/mods.properties
- ===================================================================
- --- Dream_GameServer/dist/config/custom/mods.properties (revision 83)
- +++ Dream_GameServer/dist/config/custom/mods.properties (working copy)
- @@ -165,4 +165,71 @@
- # The item info list for Clan Leader (You must fill both list to CL get reward).
- # CL must be online during siege ofc - so we dont care to reward him offline.
- # To add a item with count just add " , " to split the item and count and " ; " to close the statement
- -RewardClInfo = 57,2000;5575,200000
- \ No newline at end of file
- +RewardClInfo = 57,2000;5575,200000
- +
- +#=======================================#
- +# Sword Arts Online System
- +#=======================================#
- +# Enable Disable Sao Mod
- +# Default = False
- +AllowSaoMod = False
- +
- +# Time you want to aplly Sao Mod
- +# Can be multipler in config above
- +SaoTimeConfig = 1
- +
- +# Time for Multiplier.
- +# 1 - Minutes = 60000
- +# 2 - Hours = 3600000
- +# 3 - Days = 86400000
- +SaoTimeMultiplier = 3600000
- +
- +# Sao Start Message
- +SaoStartMsg = Your Sao restrictions were added.
- +
- +# Sao End Message
- +SaoEndMsg = Your Sao restrictions were removed.
- +
- +# Sao Time Info
- +SaoInfoMsg = Your Sao restrictions end at
- +
- +#=======================================#
- +# Vip Characters System
- +#=======================================#
- +AllowVipCharacters = False
- +VipTitleColor = 00FF00
- +VipTitleColorOne = 00FF00
- +VipTitleColorTwo = 00FF00
- +VipDropAdena = 1
- +VipDropAdenaOne = 1
- +VipDropAdenaTwo = 1
- +VipDropSpoil = 1
- +VipDropSpoilOne = 1
- +VipDropSpoilTwo = 1
- +VipDrop = 1
- +VipDropOne = 1
- +VipDropTwo = 1
- +VipDropBlueSeal = 1
- +VipDropBlueSealOne = 1
- +VipDropBlueSealTwo = 1
- +VipDropGreenSeal = 1
- +VipDropGreenSealOne = 1
- +VipDropGreenSealTwo = 1
- +VipDropRedSeal = 1
- +VipDropRedSealOne = 1
- +VipDropRedSealTwo = 1
- +DropBlueSeal = 1
- +DropGreenSeal = 1
- +DropRedSeal = 1
- +VipExpRate = 1
- +VipExpRateOne = 1
- +VipExpRateTwo = 1
- +VipSpRate = 1
- +VipSpRateOne = 1
- +VipSpRateTwo = 1
- +VipItemId = 9955
- +VipItemIdOne = 9955
- +VipItemIdTwo = 9955
- +VipItemDays = 30
- +VipItemDaysOne = 30
- +VipItemDaysTwo = 30
- \ No newline at end of file
- Index: Dream_GameServer/src/com/dream/game/model/PhantomPlayers.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/model/PhantomPlayers.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/model/PhantomPlayers.java (working copy)
- @@ -0,0 +1,1159 @@
- +package com.dream.game.model;
- +
- +import java.io.BufferedReader;
- +import java.io.File;
- +import java.io.FileReader;
- +import java.io.LineNumberReader;
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.ArrayList;
- +import java.util.Collection;
- +import java.util.Iterator;
- +import java.util.Map;
- +import java.util.Map.Entry;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.concurrent.ConcurrentLinkedQueue;
- +
- +import org.apache.log4j.Logger;
- +
- +import com.dream.Config;
- +import com.dream.L2DatabaseFactory;
- +import com.dream.game.ai.CtrlIntention;
- +import com.dream.game.datatables.sql.ClanTable;
- +import com.dream.game.datatables.sql.ItemTable;
- +import com.dream.game.model.actor.instance.L2ItemInstance;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.model.actor.position.L2CharPosition;
- +import com.dream.game.model.world.L2World;
- +import com.dream.game.model.world.Location;
- +import com.dream.game.network.Disconnection;
- +import com.dream.game.network.ThreadPoolManager;
- +import com.dream.game.network.serverpackets.MagicSkillUse;
- +import com.dream.game.templates.item.L2Weapon;
- +import com.dream.game.templates.item.L2WeaponType;
- +import com.dream.tools.random.Rnd;
- +
- +import javolution.text.TextBuilder;
- +import javolution.util.FastMap;
- +
- +public class PhantomPlayers
- +{
- + public static final Logger _log = Logger.getLogger(PhantomPlayers.class.getName());
- + public static String _phantomAcc = Config.PHANTOM_PLAYERS_AKK;
- + @SuppressWarnings("unused")
- + private static int _PhantomsCount = 0;
- + public static int _PhantomsLimit = 0;
- + private static int _setsCount = 0;
- + private static int _setsCountClan = 0;
- + public volatile int _PhantomsTownTotal = 0;
- + private static int _nameColCount = 0;
- + private static int _titleColCount = 0;
- + private static ArrayList<Integer> _nameColors = new ArrayList<>();
- + private static ArrayList<Integer> _titleColors = new ArrayList<>();
- + private static ArrayList<L2Set> _sets = new ArrayList<>();
- + private static int _setsArcherCount = 0;
- + private static ArrayList<L2Set> _setsArcher = new ArrayList<>();
- + private static PhantomPlayers _instance;
- + private static int _setsOlyCount = 0;
- + private static ArrayList<L2Set> _setsOly = new ArrayList<>();
- + private static int _locsCount = 0;
- + private static ArrayList<Location> _PhantomsTownLoc = new ArrayList<>();
- + public static FastMap<Integer, L2Fantome> _phantoms = new FastMap<>();
- + private static int _PhantomsEnchPhsCount = 0;
- + private static ArrayList<String> _PhantomsEnchPhrases = new ArrayList<>();
- + private static int _PhantomsLastPhsCount = 0;
- + private static ArrayList<String> _PhantomsLastPhrases = new ArrayList<>();
- + public static Map<Integer, ConcurrentLinkedQueue<L2PcInstance>> _PhantomsTown = new ConcurrentHashMap<>();
- + @SuppressWarnings("unused")
- + private static Map<Integer, ConcurrentLinkedQueue<L2PcInstance>> _PhantomsTownClan = new ConcurrentHashMap<>();
- + private static Map<Integer, ConcurrentLinkedQueue<Integer>> _PhantomsTownClanList = new ConcurrentHashMap<>();
- + private Location localLocation;
- +
- + public static PhantomPlayers getInstance()
- + {
- + return _instance;
- + }
- +
- + private void load()
- + {
- + parceArmors();
- + parceArcherArmors();
- + parceOlyArmors();
- + parceColors();
- + cacheLastPhrases();
- + if (Config.ALLOW_PHANTOM_PLAYERS)
- + {
- + parceTownLocs();
- + parceTownClans();
- + cacheFantoms();
- + cacheEnchantPhrases();
- + _PhantomsLimit = Config.PHANTOM_PLAYERS_COUNT_FIRST + Config.PHANTOM_PLAYERS_COUNT_NEXT + 10;
- + _PhantomsTown.put(Integer.valueOf(1), new ConcurrentLinkedQueue<L2PcInstance>());
- + _PhantomsTown.put(Integer.valueOf(2), new ConcurrentLinkedQueue<L2PcInstance>());
- + }
- + }
- +
- + public static void init()
- + {
- + _instance = new PhantomPlayers();
- + _instance.load();
- + }
- +
- + private int getTitleColor()
- + {
- + return _titleColors.get(Rnd.get(_titleColCount)).intValue();
- + }
- +
- + private int getNameColor()
- + {
- + return _nameColors.get(Rnd.get(_nameColCount)).intValue();
- + }
- +
- + public L2PcInstance loadPhantom(int paramInt)
- + {
- + int i = L2World.getInstance().getAllPlayersCount();
- + if (i < Config.MAXIMUM_ONLINE_USERS)
- + {
- + L2Fantome localL2Fantome = _phantoms.get(Integer.valueOf(paramInt));
- + if (localL2Fantome == null)
- + {
- + return null;
- + }
- + Collection<?> localCollection = L2World.getInstance().getAllPlayers();
- + L2PcInstance[] arrayOfL2PcInstance = localCollection.toArray(new L2PcInstance[localCollection.size()]);
- + for (int j = 0; j < arrayOfL2PcInstance.length; j++)
- + {
- + if (paramInt == arrayOfL2PcInstance[j].getObjectId())
- + {
- + return null;
- + }
- + }
- + L2Set localL2Set = getRandomSet();
- + L2ItemInstance localL2ItemInstance1 = ItemTable.getInstance().createDummyItem(localL2Set._body);
- + L2ItemInstance localL2ItemInstance2 = ItemTable.getInstance().createDummyItem(localL2Set._gaiters);
- + L2ItemInstance localL2ItemInstance3 = ItemTable.getInstance().createDummyItem(localL2Set._gloves);
- + L2ItemInstance localL2ItemInstance4 = ItemTable.getInstance().createDummyItem(localL2Set._boots);
- + L2ItemInstance localL2ItemInstance5 = ItemTable.getInstance().createDummyItem(localL2Set._weapon);
- + L2ItemInstance localL2ItemInstance6 = null;
- + int k = localL2Set._grade;
- + int m = 1;
- + int n = 0;
- + if (k == 0)
- + {
- + m = Rnd.get(1, 19);
- + }
- + if (k == 1)
- + {
- + m = Rnd.get(20, 39);
- + }
- + if (k == 2)
- + {
- + m = Rnd.get(40, 51);
- + }
- + if (k == 3)
- + {
- + m = Rnd.get(52, 60);
- + }
- + if (k == 4)
- + {
- + m = Rnd.get(61, 75);
- + }
- + if (k == 5)
- + {
- + m = Rnd.get(76, 80);
- + }
- + L2PcInstance localL2PcInstance = L2PcInstance.loadPhantom(paramInt, m, n, false);
- + localL2PcInstance.setName(localL2Fantome.name);
- + localL2PcInstance.setTitle(localL2Fantome.title);
- + localL2PcInstance.getAppearance().setNameColor(getNameColor());
- + localL2PcInstance.getAppearance().setTitleColor(getTitleColor());
- + if (Rnd.get(100) < 40)
- + {
- + localL2PcInstance.setClan(ClanTable.getInstance().getClan(getRandomClan()));
- + }
- + localL2PcInstance.getInventory().equipItemAndRecord(localL2ItemInstance1);
- + localL2PcInstance.getInventory().equipItemAndRecord(localL2ItemInstance2);
- + localL2PcInstance.getInventory().equipItemAndRecord(localL2ItemInstance3);
- + localL2PcInstance.getInventory().equipItemAndRecord(localL2ItemInstance4);
- + int[] arrayOfInt =
- + {
- + 92,
- + 102,
- + 109
- + };
- + if (localL2Set._custom > 0)
- + {
- + localL2ItemInstance6 = ItemTable.getInstance().createDummyItem(localL2Set._custom);
- + localL2PcInstance.getInventory().equipItemAndRecord(localL2ItemInstance6);
- + }
- + localL2ItemInstance5.setEnchantLevel(Rnd.get(Config.PHANTOM_PLAYERS_ENCHANT_MIN, Config.PHANTOM_PLAYERS_ENCHANT_MAX));
- + if (Rnd.get(100) < 30)
- + {
- + localL2ItemInstance5.setAugmentation(new L2Augmentation(1067847165, 3250, 1));
- + }
- + L2Weapon localL2Weapon = localL2ItemInstance5.getWeaponItem();
- + if ((localL2Weapon.getItemType() == L2WeaponType.BOW) && ((localL2PcInstance.getClassId().getId() != 92) || (localL2PcInstance.getClassId().getId() != 102) || (localL2PcInstance.getClassId().getId() != 109)))
- + {
- + localL2PcInstance.setClassId(arrayOfInt[Rnd.get(arrayOfInt.length)]);
- + }
- + localL2PcInstance.getInventory().equipItemAndRecord(localL2ItemInstance5);
- + Location localLocation = getRandomLoc();
- + localL2PcInstance.setPhantomLoc(localLocation.getX(), localLocation.getY(), localLocation.getZ());
- + localL2PcInstance.getPosition().setXYZInvisible(localLocation.getX() + Rnd.get(60), localLocation.getY() + Rnd.get(60), localLocation.getZ());
- + localL2PcInstance.spawnMe(localLocation.getX() + Rnd.get(1, 250), localLocation.getY() + Rnd.get(1, 250), localLocation.getZ());
- + localL2PcInstance.broadcastUserInfo();
- + localL2PcInstance.setOnlineStatusPhantom(true);
- + startWalk(localL2PcInstance);
- + return localL2PcInstance;
- + }
- + return null;
- + }
- +
- + private Location getRandomLoc()
- + {
- + localLocation = null;
- + if (localLocation == null)
- + {
- + localLocation = _PhantomsTownLoc.get(Rnd.get(0, _locsCount));
- + }
- + return localLocation;
- + }
- +
- + private void parceColors()
- + {
- + _nameColors = Config.PHANTOM_PLAYERS_NAME_CLOLORS;
- + _titleColors = Config.PHANTOM_PLAYERS_TITLE_CLOLORS;
- + _nameColCount = _nameColors.size() - 1;
- + _titleColCount = _titleColors.size() - 1;
- + }
- +
- + public void startWalk(L2PcInstance paramL2PcInstance)
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new PhantomWalk(paramL2PcInstance), 15000L);
- + }
- +
- + private void parceArmors()
- + {
- + if (!_sets.isEmpty())
- + {
- + _sets.clear();
- + }
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/town_sets.ini");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + String str;
- + while ((str = localLineNumberReader.readLine()) != null)
- + {
- + if ((str.trim().length() != 0) && (!str.startsWith("#")))
- + {
- + String[] arrayOfString = str.split(",");
- + int i = 0;
- + try
- + {
- + i = Integer.parseInt(arrayOfString[5]);
- + }
- + catch (Exception localException5)
- + {
- + i = 0;
- + }
- + _sets.add(new L2Set(Integer.parseInt(arrayOfString[0]), Integer.parseInt(arrayOfString[1]), Integer.parseInt(arrayOfString[2]), Integer.parseInt(arrayOfString[3]), Integer.parseInt(arrayOfString[4]), Integer.parseInt(arrayOfString[5]), i));
- + }
- + }
- + _setsCount = _sets.size() - 1;
- + _log.info("Load " + _setsCount + " phantom armor sets");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException6)
- + {
- + }
- + }
- + }
- +
- + private void cacheFantoms()
- + {
- + new Thread(new Runnable()
- + {
- + @SuppressWarnings("unused")
- + private String str2;
- + @SuppressWarnings("unused")
- + private Object localObject1;
- +
- + @Override
- + public void run()
- + {
- + String str1 = "";
- + str2 = "";
- + Connection localConnection = null;
- + localObject1 = null;
- + try
- + {
- + localConnection = L2DatabaseFactory.getInstance().getConnection();
- + localConnection.setTransactionIsolation(1);
- + PreparedStatement localPreparedStatement = localConnection.prepareStatement("SELECT charId,char_name,title,x,y,z,clanid FROM characters WHERE account_name = ?");
- + localPreparedStatement.setString(1, PhantomPlayers._phantomAcc);
- + ResultSet localResultSet = localPreparedStatement.executeQuery();
- + localResultSet.setFetchSize(250);
- + while (localResultSet.next())
- + {
- + str1 = localResultSet.getString("char_name");
- + PhantomPlayers._phantoms.put(Integer.valueOf(localResultSet.getInt("charId")), new PhantomPlayers.L2Fantome(str1, localResultSet.getString("title"), localResultSet.getInt("x"), localResultSet.getInt("y"), localResultSet.getInt("z"), localResultSet.getInt("clanid")));
- + }
- + localPreparedStatement.close();
- + localResultSet.close();
- + localConnection.close();
- + PhantomPlayers._log.info("PhantomPlayers: Cached " + PhantomPlayers._phantoms.size() + " players.");
- + }
- + catch (Exception localException)
- + {
- + PhantomPlayers._log.warn("PhantomPlayers: could not load chars from DB: " + localException);
- + }
- + finally
- + {
- + if (localConnection != null)
- + {
- + localConnection = null;
- + }
- + }
- + if (!PhantomPlayers._phantoms.isEmpty())
- + {
- + ThreadPoolManager.getInstance().scheduleGeneral(new FantomTask(1), Config.PHANTOM_PLAYERS_DELAY_FIRST);
- + }
- + }
- + }).start();
- + }
- +
- + private L2Set getRandomSet()
- + {
- + return _sets.get(Rnd.get(_setsCount));
- + }
- +
- + private void parceArcherArmors()
- + {
- + if (!_setsArcher.isEmpty())
- + {
- + _setsArcher.clear();
- + }
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/archer_sets.ini");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + String str;
- + while ((str = localLineNumberReader.readLine()) != null)
- + {
- + if ((str.trim().length() != 0) && (!str.startsWith("#")))
- + {
- + String[] arrayOfString = str.split(",");
- + int i = 0;
- + try
- + {
- + i = Integer.parseInt(arrayOfString[5]);
- + }
- + catch (Exception localException5)
- + {
- + i = 0;
- + }
- + _setsArcher.add(new L2Set(Integer.parseInt(arrayOfString[0]), Integer.parseInt(arrayOfString[1]), Integer.parseInt(arrayOfString[2]), Integer.parseInt(arrayOfString[3]), Integer.parseInt(arrayOfString[4]), Integer.parseInt(arrayOfString[5]), i));
- + }
- + }
- + _setsArcherCount = _setsArcher.size() - 1;
- + _log.info("Load " + _setsArcherCount + " Aecher phantom armor sets");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException6)
- + {
- + }
- + }
- + }
- +
- + private void parceOlyArmors()
- + {
- + if (!_setsOly.isEmpty())
- + {
- + _setsOly.clear();
- + }
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/oly_sets.ini");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + String str;
- + while ((str = localLineNumberReader.readLine()) != null)
- + {
- + if ((str.trim().length() != 0) && (!str.startsWith("#")))
- + {
- + String[] arrayOfString = str.split(",");
- + int i = 0;
- + try
- + {
- + i = Integer.parseInt(arrayOfString[6]);
- + }
- + catch (Exception localException5)
- + {
- + i = 0;
- + }
- + _setsOly.add(new L2Set(Integer.parseInt(arrayOfString[0]), Integer.parseInt(arrayOfString[1]), Integer.parseInt(arrayOfString[2]), Integer.parseInt(arrayOfString[3]), Integer.parseInt(arrayOfString[4]), Integer.parseInt(arrayOfString[5]), i));
- + }
- + }
- + _setsOlyCount = _setsOly.size() - 1;
- + _log.info("Load " + _setsOlyCount + " phantom Only armor sets");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException6)
- + {
- + }
- + }
- + }
- +
- + private void parceTownClans()
- + {
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/town_clans.ini");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + int i = 0;
- + String str1;
- + while ((str1 = localLineNumberReader.readLine()) != null)
- + {
- + if ((str1.trim().length() != 0) && (!str1.startsWith("#")))
- + {
- + String[] arrayOfString1 = str1.split(":");
- + i = Integer.parseInt(arrayOfString1[0]);
- + String[] arrayOfString2 = arrayOfString1[1].split(",");
- + ConcurrentLinkedQueue<Integer> localConcurrentLinkedQueue = new ConcurrentLinkedQueue<>();
- + for (String str2 : arrayOfString2)
- + {
- + localConcurrentLinkedQueue.add(Integer.valueOf(Integer.parseInt(str2)));
- + }
- + _PhantomsTownClanList.put(Integer.valueOf(i), localConcurrentLinkedQueue);
- + }
- + }
- + _setsCountClan = _PhantomsTownClanList.size() - 1;
- + _log.info("Load " + _setsCountClan + " phantom Clans");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException5)
- + {
- + }
- + }
- + }
- +
- + private void parceTownLocs()
- + {
- + _PhantomsTownLoc.clear();
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/town_locs.ini");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + String str;
- + while ((str = localLineNumberReader.readLine()) != null)
- + {
- + if ((str.trim().length() != 0) && (!str.startsWith("#")))
- + {
- + String[] arrayOfString = str.split(",");
- + _PhantomsTownLoc.add(new Location(Integer.parseInt(arrayOfString[0]), Integer.parseInt(arrayOfString[1]), Integer.parseInt(arrayOfString[2])));
- + }
- + }
- + _locsCount = _PhantomsTownLoc.size() - 1;
- + _log.info("Load " + _locsCount + " phantom Town Locations");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException5)
- + {
- + }
- + }
- + }
- +
- + private void cacheEnchantPhrases()
- + {
- + _PhantomsEnchPhrases.clear();
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/phrases_enchant.txt");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + String str;
- + while ((str = localLineNumberReader.readLine()) != null)
- + {
- + if ((str.trim().length() != 0) && (!str.startsWith("#")))
- + {
- + _PhantomsEnchPhrases.add(str);
- + }
- + }
- + _PhantomsEnchPhsCount = _PhantomsEnchPhrases.size() - 1;
- + _log.info("Load " + _PhantomsEnchPhsCount + " phantom Ench");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException5)
- + {
- + }
- + }
- + }
- +
- + private void cacheLastPhrases()
- + {
- + _PhantomsLastPhrases.clear();
- + LineNumberReader localLineNumberReader = null;
- + BufferedReader localBufferedReader = null;
- + FileReader localFileReader = null;
- + try
- + {
- + File localFile = new File("./config/phantom/phrases_last.ini");
- + if (!localFile.exists())
- + {
- + return;
- + }
- + localFileReader = new FileReader(localFile);
- + localBufferedReader = new BufferedReader(localFileReader);
- + localLineNumberReader = new LineNumberReader(localBufferedReader);
- + String str;
- + while ((str = localLineNumberReader.readLine()) != null)
- + {
- + if ((str.trim().length() != 0) && (!str.startsWith("#")))
- + {
- + _PhantomsLastPhrases.add(str);
- + }
- + }
- + _PhantomsLastPhsCount = _PhantomsLastPhrases.size() - 1;
- + _log.info("Load " + _PhantomsLastPhsCount + " phantom Last");
- + return;
- + }
- + catch (Exception localException2)
- + {
- + localException2.printStackTrace();
- + }
- + finally
- + {
- + try
- + {
- + if (localFileReader != null)
- + {
- + localFileReader.close();
- + }
- + if (localBufferedReader != null)
- + {
- + localBufferedReader.close();
- + }
- + if (localLineNumberReader != null)
- + {
- + localLineNumberReader.close();
- + }
- + }
- + catch (Exception localException5)
- + {
- + }
- + }
- + }
- +
- + @SuppressWarnings("unused")
- + private L2Set getRandomArcherSet()
- + {
- + return _setsArcher.get(Rnd.get(_setsArcherCount));
- + }
- +
- + @SuppressWarnings("unused")
- + private int getRandomPhantom()
- + {
- + return Rnd.get(511151115, 511157100);
- + }
- +
- + public int getRandomPhantomNext()
- + {
- + int i = 0;
- + for (int j = 6; j > 0; j--)
- + {
- + i = Rnd.get(511151115, 511157100);
- + if ((!_PhantomsTown.get(Integer.valueOf(1)).contains(Integer.valueOf(i))) && (!_PhantomsTown.get(Integer.valueOf(2)).contains(Integer.valueOf(i))))
- + {
- + return i;
- + }
- + }
- + return getRandomPhantomNext();
- + }
- +
- + private int getRandomClan()
- + {
- + return Rnd.get(511158000, 511158008);
- + }
- +
- + @SuppressWarnings("unused")
- + private String getRandomEnchantPhrase()
- + {
- + return _PhantomsEnchPhrases.get(Rnd.get(_PhantomsEnchPhsCount));
- + }
- +
- + public String getRandomLastPhrase()
- + {
- + return _PhantomsLastPhrases.get(Rnd.get(_PhantomsLastPhsCount));
- + }
- +
- + private class PhantomWalk implements Runnable
- + {
- + L2PcInstance _phantom;
- +
- + public PhantomWalk(L2PcInstance paramL2PcInstance)
- + {
- + this._phantom = paramL2PcInstance;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (this._phantom.getAI().getIntention() != CtrlIntention.ATTACK)
- + {
- + this._phantom.rndWalk();
- + }
- + PhantomPlayers.this.startWalk(this._phantom);
- + }
- + }
- +
- + static class L2Set
- + {
- + public int _body;
- + public int _gaiters;
- + public int _gloves;
- + public int _boots;
- + public int _weapon;
- + public int _custom;
- + public int _grade;
- +
- + L2Set(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7)
- + {
- + this._body = paramInt1;
- + this._gaiters = paramInt2;
- + this._gloves = paramInt3;
- + this._boots = paramInt4;
- + this._weapon = paramInt5;
- + this._grade = paramInt6;
- + this._custom = paramInt7;
- + }
- + }
- +
- + static class L2Fantome
- + {
- + public String name;
- + public String title;
- + public int x;
- + public int y;
- + public int z;
- + public int clanId;
- +
- + L2Fantome(String paramString1, String paramString2, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
- + {
- + this.name = paramString1;
- + this.title = paramString2;
- + this.x = paramInt1;
- + this.y = paramInt2;
- + this.z = paramInt3;
- + this.clanId = paramInt4;
- + }
- + }
- +
- + public class FantomTask implements Runnable
- + {
- + public int _task;
- +
- + public FantomTask(int paramInt)
- + {
- + this._task = paramInt;
- + }
- +
- + @Override
- + public void run()
- + {
- + int i = 0;
- + int j = 0;
- + int k = 0;
- + int m = 0;
- + L2PcInstance localL2PcInstance;
- + switch (this._task)
- + {
- + case 1:
- + PhantomPlayers._log.info("PhantomPlayers: 1st wave, spawn started.");
- + while (i < Config.PHANTOM_PLAYERS_COUNT_FIRST)
- + {
- + localL2PcInstance = null;
- + k = getRandomPhantomNext();
- + if (!_PhantomsTown.get(Integer.valueOf(1)).contains(Integer.valueOf(k)))
- + {
- + localL2PcInstance = loadPhantom(k);
- + if (localL2PcInstance != null)
- + {
- + _PhantomsTown.get(Integer.valueOf(1)).add(localL2PcInstance);
- + if ((Config.PHANTOM_PLAYERS_SOULSHOT_ANIM) && (Rnd.get(100) < 45))
- + {
- + try
- + {
- + Thread.sleep(900L);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- + if (Rnd.get(100) < 3)
- + {
- + localL2PcInstance.sitDown();
- + }
- + localL2PcInstance.broadcastPacket(new MagicSkillUse(localL2PcInstance, localL2PcInstance, 2154, 1, 0, 0, false));
- + try
- + {
- + Thread.sleep(300L);
- + }
- + catch (InterruptedException localInterruptedException2)
- + {
- + }
- + localL2PcInstance.broadcastPacket(new MagicSkillUse(localL2PcInstance, localL2PcInstance, 2164, 1, 0, 0, false));
- + }
- + try
- + {
- + Thread.sleep(Config.PHANTOM_PLAYERS_DELAY_SPAWN_FIRST);
- + }
- + catch (InterruptedException localInterruptedException3)
- + {
- + }
- + i++;
- + }
- + }
- + }
- + PhantomPlayers._log.info("FPhantomPlayers: 1st wave, spawned " + i + " players.");
- + System.out.println("4");
- + ThreadPoolManager.getInstance().scheduleGeneral(new FantomTaskDespawn(1), Config.PHANTOM_PLAYERS_DESPAWN_FIRST);
- + ThreadPoolManager.getInstance().scheduleGeneral(new FantomTask(2), Config.PHANTOM_PLAYERS_DELAY_NEXT);
- + ThreadPoolManager.getInstance().scheduleGeneral(new Social(), 12000L);
- + ThreadPoolManager.getInstance().scheduleGeneral(new CheckCount(), 300000L);
- + break;
- + case 2:
- + PhantomPlayers._log.info("PhantomPlayers: 2nd wave, spawn started.");
- + while (j < Config.PHANTOM_PLAYERS_COUNT_NEXT)
- + {
- + localL2PcInstance = null;
- + m = PhantomPlayers.this.getRandomPhantomNext();
- + if ((!_PhantomsTown.get(Integer.valueOf(1)).contains(Integer.valueOf(m))) || (!_PhantomsTown.get(Integer.valueOf(2)).contains(Integer.valueOf(m))))
- + {
- + localL2PcInstance = PhantomPlayers.this.loadPhantom(m);
- + if (localL2PcInstance != null)
- + {
- + _PhantomsTown.get(Integer.valueOf(2)).add(localL2PcInstance);
- + if ((Config.PHANTOM_PLAYERS_SOULSHOT_ANIM) && (Rnd.get(100) < 45))
- + {
- + try
- + {
- + Thread.sleep(900L);
- + }
- + catch (InterruptedException localInterruptedException4)
- + {
- + }
- + if (Rnd.get(100) < 3)
- + {
- + localL2PcInstance.sitDown();
- + }
- + localL2PcInstance.broadcastPacket(new MagicSkillUse(localL2PcInstance, localL2PcInstance, 2154, 1, 0, 0, false));
- + try
- + {
- + Thread.sleep(300L);
- + }
- + catch (InterruptedException localInterruptedException5)
- + {
- + }
- + localL2PcInstance.broadcastPacket(new MagicSkillUse(localL2PcInstance, localL2PcInstance, 2164, 1, 0, 0, false));
- + }
- + try
- + {
- + Thread.sleep(Config.PHANTOM_PLAYERS_DELAY_SPAWN_NEXT);
- + }
- + catch (InterruptedException localInterruptedException6)
- + {
- + }
- + j++;
- + }
- + }
- + }
- + PhantomPlayers._log.info("PhantomPlayers: 2nd wave, spawned " + j + " players.");
- + ThreadPoolManager.getInstance().scheduleGeneral(new PhantomPlayers.FantomTaskDespawn(2), Config.PHANTOM_PLAYERS_DESPAWN_NEXT);
- + }
- + }
- + }
- +
- + public class FantomTaskDespawn implements Runnable
- + {
- + public int _task;
- + @SuppressWarnings("unused")
- + private Location localLocation;
- +
- + public FantomTaskDespawn(int paramInt)
- + {
- + this._task = paramInt;
- + }
- +
- + @Override
- + public void run()
- + {
- + localLocation = null;
- + L2PcInstance localL2PcInstance1 = null;
- + ConcurrentLinkedQueue<?> localConcurrentLinkedQueue = _PhantomsTown.get(Integer.valueOf(this._task));
- + Iterator<?> localIterator = localConcurrentLinkedQueue.iterator();
- + while (localIterator.hasNext())
- + {
- + Object localObject = localIterator.next();
- + L2PcInstance localL2PcInstance2 = (L2PcInstance) localObject;
- + if (localObject != null)
- + {
- + localLocation = localL2PcInstance2.getPhantomLoc();
- + new Disconnection(localL2PcInstance2).defaultSequence(false);
- + localL2PcInstance2.setOnlineStatus(false);
- + _PhantomsTown.get(Integer.valueOf(this._task)).remove(localObject);
- + try
- + {
- + Thread.sleep(this._task == 1 ? Config.PHANTOM_PLAYERS_DELAY_DESPAWN_FIRST : Config.PHANTOM_PLAYERS_DELAY_DESPAWN_NEXT);
- + }
- + catch (InterruptedException localInterruptedException1)
- + {
- + }
- + if (_PhantomsTownTotal <= _PhantomsLimit)
- + {
- + int i = PhantomPlayers.this.getRandomPhantomNext();
- + if (!_PhantomsTown.get(Integer.valueOf(this._task)).contains(Integer.valueOf(i)))
- + {
- + localL2PcInstance1 = PhantomPlayers.this.loadPhantom(i);
- + if (localL2PcInstance1 != null)
- + {
- + _PhantomsTown.get(Integer.valueOf(this._task)).add(localL2PcInstance1);
- + if ((Config.PHANTOM_PLAYERS_SOULSHOT_ANIM) && (Rnd.get(100) < 45))
- + {
- + try
- + {
- + Thread.sleep(900L);
- + }
- + catch (InterruptedException localInterruptedException2)
- + {
- + }
- + if (Rnd.get(100) < 3)
- + {
- + localL2PcInstance1.sitDown();
- + }
- + localL2PcInstance1.broadcastPacket(new MagicSkillUse(localL2PcInstance1, localL2PcInstance1, 2154, 1, 0, 0, false));
- + try
- + {
- + Thread.sleep(300L);
- + }
- + catch (InterruptedException localInterruptedException3)
- + {
- + }
- + localL2PcInstance1.broadcastPacket(new MagicSkillUse(localL2PcInstance1, localL2PcInstance1, 2164, 1, 0, 0, false));
- + }
- + try
- + {
- + Thread.sleep(100L);
- + }
- + catch (InterruptedException localInterruptedException4)
- + {
- + }
- + }
- + }
- + }
- + }
- + }
- + ThreadPoolManager.getInstance().scheduleGeneral(new FantomTaskDespawn(1), this._task == 1 ? Config.PHANTOM_PLAYERS_DESPAWN_FIRST : Config.PHANTOM_PLAYERS_DESPAWN_NEXT);
- + }
- + }
- +
- + public class CheckCount implements Runnable
- + {
- + public CheckCount()
- + {
- + }
- +
- + @Override
- + public void run()
- + {
- + Iterator<?> localIterator1 = _PhantomsTown.entrySet().iterator();
- + while (localIterator1.hasNext())
- + {
- + Entry<?, ?> localEntry = (Entry<?, ?>) localIterator1.next();
- + Integer localInteger = (Integer) localEntry.getKey();
- + ConcurrentLinkedQueue<?> localConcurrentLinkedQueue = (ConcurrentLinkedQueue<?>) localEntry.getValue();
- + if ((localInteger != null) && (localConcurrentLinkedQueue != null) && (!localConcurrentLinkedQueue.isEmpty()))
- + {
- + int i = localInteger.intValue() == 1 ? Config.PHANTOM_PLAYERS_COUNT_FIRST : Config.PHANTOM_PLAYERS_COUNT_NEXT;
- + int j = localConcurrentLinkedQueue.size() - i;
- + if (j >= 1)
- + {
- + Iterator<?> localIterator2 = localConcurrentLinkedQueue.iterator();
- + while (localIterator2.hasNext())
- + {
- + Object localObject = localIterator2.next();
- + L2PcInstance localL2PcInstance = (L2PcInstance) localObject;
- + new Disconnection(localL2PcInstance).defaultSequence(false);
- + localL2PcInstance.setOnlineStatus(false);
- + PhantomPlayers._PhantomsTown.get(localInteger).remove(localObject);
- + j--;
- + if (j == 0)
- + {
- + break;
- + }
- + }
- + }
- + }
- + }
- + ThreadPoolManager.getInstance().scheduleGeneral(new CheckCount(), 300000L);
- + }
- + }
- +
- + public class Social implements Runnable
- + {
- + public Social()
- + {
- + }
- +
- + @Override
- + public void run()
- + {
- + TextBuilder localTextBuilder = new TextBuilder();
- + Iterator<?> localIterator1 = PhantomPlayers._PhantomsTown.entrySet().iterator();
- + while (localIterator1.hasNext())
- + {
- + Entry<?, ?> localEntry = (Entry<?, ?>) localIterator1.next();
- + Integer localInteger = (Integer) localEntry.getKey();
- + ConcurrentLinkedQueue<?> localConcurrentLinkedQueue = (ConcurrentLinkedQueue<?>) localEntry.getValue();
- + if ((localInteger != null) && (localConcurrentLinkedQueue != null) && (!localConcurrentLinkedQueue.isEmpty()))
- + {
- + int i = 0;
- + Iterator<?> localIterator2 = localConcurrentLinkedQueue.iterator();
- + while (localIterator2.hasNext())
- + {
- + Object localObject = localIterator2.next();
- + L2PcInstance localL2PcInstance = (L2PcInstance) localObject;
- + if (Rnd.get(100) < 65)
- + {
- + switch (Rnd.get(2))
- + {
- + case 0:
- + case 1:
- + L2ItemInstance localL2ItemInstance = localL2PcInstance.getActiveWeaponInstance();
- + int j = localL2ItemInstance.getEnchantLevel();
- + int k = j + 1;
- + if ((Rnd.get(100) < 45) && (j <= Config.ENCHANT_MAX_WEAPON_NORMAL))
- + {
- + localL2ItemInstance.setEnchantLevel(k);
- + }
- + else if (Rnd.get(100) < 70)
- + {
- + localL2ItemInstance.setEnchantLevel(3);
- + if ((k > 13) && (Rnd.get(100) < 2))
- + {
- + localTextBuilder.append("!");
- + for (int m = Rnd.get(2, 13); m > 0; m--)
- + {
- + localTextBuilder.append("!");
- + }
- + localTextBuilder.clear();
- + }
- + }
- + localL2PcInstance.broadcastUserInfo();
- + break;
- + case 2:
- + if (Rnd.get(100) < 5)
- + {
- + localL2PcInstance.getAI().setIntention(CtrlIntention.MOVE_TO, new L2CharPosition(localL2PcInstance.getX() + Rnd.get(30), localL2PcInstance.getY() + Rnd.get(30), localL2PcInstance.getZ(), 0));
- + }
- + break;
- + }
- + try
- + {
- + Thread.sleep(Rnd.get(500, 1500));
- + }
- + catch (InterruptedException localInterruptedException)
- + {
- + }
- + i++;
- + }
- + if (i > 55)
- + {
- + break;
- + }
- + }
- + }
- + }
- + localTextBuilder.clear();
- + ThreadPoolManager.getInstance().scheduleGeneral(new Social(), 12000L);
- + }
- + }
- +}
- \ No newline at end of file
- Index: Dream_GameServer/dist/config/main/options.properties
- ===================================================================
- --- Dream_GameServer/dist/config/main/options.properties (revision 83)
- +++ Dream_GameServer/dist/config/main/options.properties (working copy)
- @@ -375,4 +375,7 @@
- # Levels, with which you can communicate and trade auto chat rooms
- ShoutChatLevel = 1
- -TradeChatLevel = 1
- \ No newline at end of file
- +TradeChatLevel = 1
- +
- +EnableOFFTeleporter = True
- +OFFAcceptedTeleportersId = 30080
- \ No newline at end of file
- Index: Dream_GameServer/dist/config/custom/custom.properties
- ===================================================================
- --- Dream_GameServer/dist/config/custom/custom.properties (revision 83)
- +++ Dream_GameServer/dist/config/custom/custom.properties (working copy)
- @@ -88,7 +88,7 @@
- # Load Custom Droplist's Table
- LoadCustomDroplistTable = False
- -# Load Custom Teleport's Table
- +# Load Custom ArmorSet's Table
- LoadCustomArmorSetTable = False
- # Load Custom Spawnlist's Table
- Index: Dream_GameServer/src/com/dream/game/manager/VipManager.java
- ===================================================================
- --- Dream_GameServer/src/com/dream/game/manager/VipManager.java (revision 0)
- +++ Dream_GameServer/src/com/dream/game/manager/VipManager.java (working copy)
- @@ -0,0 +1,179 @@
- +package com.dream.game.manager;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.Map;
- +import java.util.concurrent.ConcurrentHashMap;
- +import java.util.concurrent.ScheduledFuture;
- +import java.util.logging.Logger;
- +
- +import com.dream.L2DatabaseFactory;
- +import com.dream.game.model.actor.instance.L2PcInstance;
- +import com.dream.game.model.world.L2World;
- +import com.dream.game.network.ThreadPoolManager;
- +import com.dream.game.network.serverpackets.ExShowScreenMessage;
- +import com.dream.util.CloseUtil;
- +
- +/**
- + * @author rapfersan92
- + */
- +public class VipManager
- +{
- + private static final Logger _log = Logger.getLogger(VipManager.class.getName());
- +
- + private final Map<Integer, Long> _vips;
- + protected final Map<Integer, Long> _vipsTask;
- + private ScheduledFuture<?> _scheduler;
- +
- + public static VipManager getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + protected VipManager()
- + {
- + _vips = new ConcurrentHashMap<>();
- + _vipsTask = new ConcurrentHashMap<>();
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VipTask(), 1000, 1000);
- + load();
- + }
- +
- + public void reload()
- + {
- + _vips.clear();
- + _vipsTask.clear();
- + if (_scheduler != null)
- + _scheduler.cancel(true);
- + _scheduler = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new VipTask(), 1000, 1000);
- + load();
- + }
- +
- + public void load()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("SELECT charId, duration FROM character_vip ORDER BY charId");
- + ResultSet rs = statement.executeQuery();
- + while (rs.next())
- + _vips.put(rs.getInt("charId"), rs.getLong("duration"));
- + rs.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Exception: VipManager load: " + e.getMessage());
- + }
- +
- + _log.info("VipManager: Loaded " + _vips.size() + " characters with vip privileges.");
- + }
- +
- + public void addVip(int charId, long duration)
- + {
- + _vips.put(charId, duration);
- + _vipsTask.put(charId, duration);
- + manageVipPrivileges(charId);
- + }
- +
- + public static void doVip(L2PcInstance player, int days)
- + {
- + if (player == null)
- + return;
- +
- + player.setEndTime("vip", days);
- +
- + Connection connection = null;
- + try
- + {
- + connection = L2DatabaseFactory.getInstance().getConnection();
- +
- + PreparedStatement statement = connection.prepareStatement("INSERT INTO character_vip (charId, duration) VALUES (?, ?)");
- + statement.setInt(1, player.getObjectId());
- + statement.setLong(2, player.getVipEndTime());
- + statement.execute();
- + statement.close();
- + connection.close();
- + }
- + catch (Exception e)
- + {
- +
- + }
- + finally
- + {
- + CloseUtil.close(connection);
- + }
- + }
- +
- + public void removeVip(int charId)
- + {
- + _vips.remove(charId);
- + _vipsTask.remove(charId);
- + manageVipPrivileges(charId);
- +
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("DELETE FROM character_vip WHERE charId = ?");
- + statement.setInt(1, charId);
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.warning("Exception: VipManager removeVip: " + e.getMessage());
- + }
- + }
- +
- + public boolean hasVipPrivileges(int charId)
- + {
- + return _vips.containsKey(charId);
- + }
- +
- + public long getVipDuration(int charId)
- + {
- + return _vips.get(charId);
- + }
- +
- + public void addVipTask(int charId, long duration)
- + {
- + _vipsTask.put(charId, duration);
- + }
- +
- + public void removeVipTask(int charId)
- + {
- + _vipsTask.remove(charId);
- + }
- +
- + public void manageVipPrivileges(int charId)
- + {
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.broadcastUserInfo();
- + }
- +
- + public class VipTask implements Runnable
- + {
- + @Override
- + public final void run()
- + {
- + if (_vipsTask.isEmpty())
- + return;
- +
- + for (Map.Entry<Integer, Long> entry : _vipsTask.entrySet())
- + {
- + final long duration = entry.getValue();
- + if (System.currentTimeMillis() > duration)
- + {
- + final int charId = entry.getKey();
- + removeVip(charId);
- +
- + final L2PcInstance player = L2World.getInstance().getPlayer(charId);
- + player.sendPacket(new ExShowScreenMessage("Your vip privileges were removed.", 10000));
- + }
- + }
- + }
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final VipManager _instance = new VipManager();
- + }
- +}
- \ No newline at end of file
- Index: Dream_DataPack/data/html/mods/SAOHtml.htm
- ===================================================================
- --- Dream_DataPack/data/html/mods/SAOHtml.htm (revision 0)
- +++ Dream_DataPack/data/html/mods/SAOHtml.htm (working copy)
- @@ -0,0 +1,8 @@
- +<html>
- +<title></title>
- +<body>
- +<br>
- +<br>
- +<center>
- +Luan bixona.
- +</body></html>
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement