Sync with L2jServer HighFive Aug 21st 2015.
This commit is contained in:
@ -156,39 +156,23 @@ public final class GameServer
|
||||
{
|
||||
private static final Logger _log = Logger.getLogger(GameServer.class.getName());
|
||||
|
||||
// Local Constants
|
||||
private static final String LOG_FOLDER = "log"; // Name of folder for log file
|
||||
private static final String LOG_NAME = "./log.cfg"; // Name of log file
|
||||
|
||||
private final SelectorThread<L2GameClient> _selectorThread;
|
||||
private final L2GamePacketHandler _gamePacketHandler;
|
||||
private final DeadLockDetector _deadDetectThread;
|
||||
public static GameServer gameServer;
|
||||
public static final Calendar dateTimeServerStarted = Calendar.getInstance();
|
||||
|
||||
public long getUsedMemoryMB()
|
||||
{
|
||||
return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576;
|
||||
}
|
||||
|
||||
public SelectorThread<L2GameClient> getSelectorThread()
|
||||
{
|
||||
return _selectorThread;
|
||||
}
|
||||
|
||||
public L2GamePacketHandler getL2GamePacketHandler()
|
||||
{
|
||||
return _gamePacketHandler;
|
||||
}
|
||||
|
||||
public DeadLockDetector getDeadLockDetectorThread()
|
||||
{
|
||||
return _deadDetectThread;
|
||||
}
|
||||
|
||||
public GameServer() throws Exception
|
||||
{
|
||||
long serverLoadStart = System.currentTimeMillis();
|
||||
|
||||
if (!IdFactory.getInstance().isInitialized())
|
||||
{
|
||||
_log.severe(getClass().getSimpleName() + ": Could not read object IDs from DB. Please check your data.");
|
||||
_log.severe(getClass().getSimpleName() + ": Could not read object IDs from database. Please check your configuration.");
|
||||
throw new Exception("Could not initialize the ID factory!");
|
||||
}
|
||||
|
||||
@ -497,9 +481,6 @@ public final class GameServer
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Server.serverMode = Server.MODE_GAMESERVER;
|
||||
// Local Constants
|
||||
final String LOG_FOLDER = "log"; // Name of folder for log file
|
||||
final String LOG_NAME = "./log.cfg"; // Name of log file
|
||||
|
||||
/*** Main ***/
|
||||
// Create log folder
|
||||
@ -524,6 +505,26 @@ public final class GameServer
|
||||
}
|
||||
}
|
||||
|
||||
public long getUsedMemoryMB()
|
||||
{
|
||||
return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576;
|
||||
}
|
||||
|
||||
public SelectorThread<L2GameClient> getSelectorThread()
|
||||
{
|
||||
return _selectorThread;
|
||||
}
|
||||
|
||||
public L2GamePacketHandler getL2GamePacketHandler()
|
||||
{
|
||||
return _gamePacketHandler;
|
||||
}
|
||||
|
||||
public DeadLockDetector getDeadLockDetectorThread()
|
||||
{
|
||||
return _deadDetectThread;
|
||||
}
|
||||
|
||||
public static void printSection(String s)
|
||||
{
|
||||
s = "=[ " + s + " ]";
|
||||
|
@ -504,8 +504,8 @@ public class L2Attackable extends L2Npc
|
||||
|
||||
if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
|
||||
{
|
||||
exp *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
sp *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
exp *= Config.L2JMOD_CHAMPION_REWARDS_EXP_SP;
|
||||
sp *= Config.L2JMOD_CHAMPION_REWARDS_EXP_SP;
|
||||
}
|
||||
|
||||
exp *= penalty;
|
||||
@ -614,8 +614,8 @@ public class L2Attackable extends L2Npc
|
||||
|
||||
if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
|
||||
{
|
||||
exp *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
sp *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
exp *= Config.L2JMOD_CHAMPION_REWARDS_EXP_SP;
|
||||
sp *= Config.L2JMOD_CHAMPION_REWARDS_EXP_SP;
|
||||
}
|
||||
|
||||
exp *= partyMul;
|
||||
|
@ -22,6 +22,7 @@ import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.drops.GeneralDropItem;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
|
||||
/**
|
||||
* @author Battlecruiser
|
||||
@ -37,7 +38,10 @@ public interface IAmountMultiplierStrategy
|
||||
return (item, victim) ->
|
||||
{
|
||||
double multiplier = 1;
|
||||
|
||||
if (victim.isChampion())
|
||||
{
|
||||
multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS_AMOUNT : Config.L2JMOD_CHAMPION_ADENAS_REWARDS_AMOUNT;
|
||||
}
|
||||
Float dropAmountMultiplier = Config.RATE_DROP_AMOUNT_MULTIPLIER.get(item.getItemId());
|
||||
if (dropAmountMultiplier != null)
|
||||
{
|
||||
|
@ -38,11 +38,11 @@ public interface IChanceMultiplierStrategy
|
||||
double championmult;
|
||||
if ((item.getItemId() == Inventory.ADENA_ID) || (item.getItemId() == Inventory.ANCIENT_ADENA_ID))
|
||||
{
|
||||
championmult = Config.L2JMOD_CHAMPION_ADENAS_REWARDS;
|
||||
championmult = Config.L2JMOD_CHAMPION_ADENAS_REWARDS_CHANCE;
|
||||
}
|
||||
else
|
||||
{
|
||||
championmult = Config.L2JMOD_CHAMPION_REWARDS;
|
||||
championmult = Config.L2JMOD_CHAMPION_REWARDS_CHANCE;
|
||||
}
|
||||
|
||||
return (Config.L2JMOD_CHAMPION_ENABLE && (victim != null) && victim.isChampion()) ? (Config.RATE_QUEST_DROP * championmult) : Config.RATE_QUEST_DROP;
|
||||
@ -55,7 +55,7 @@ public interface IChanceMultiplierStrategy
|
||||
float multiplier = 1;
|
||||
if (victim.isChampion())
|
||||
{
|
||||
multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS : Config.L2JMOD_CHAMPION_ADENAS_REWARDS;
|
||||
multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS_CHANCE : Config.L2JMOD_CHAMPION_ADENAS_REWARDS_CHANCE;
|
||||
}
|
||||
Float dropChanceMultiplier = Config.RATE_DROP_CHANCE_MULTIPLIER.get(item.getItemId());
|
||||
if (dropChanceMultiplier != null)
|
||||
|
@ -87,7 +87,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
_hall.setSiege(this);
|
||||
|
||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
|
||||
_log.config(_hall.getName() + " siege scheduled for: " + getSiegeDate().getTime());
|
||||
_log.config(_hall.getName() + " siege scheduled for " + getSiegeDate().getTime() + ".");
|
||||
loadAttackers();
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning(getName() + ": Could not load siege attackers!:");
|
||||
_log.warning(getName() + ": Could not load siege attackers!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,11 +134,11 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
}
|
||||
}
|
||||
}
|
||||
_log.config(getName() + ": Sucessfully saved attackers down to database!");
|
||||
_log.config(getName() + ": Successfully saved attackers to database.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning(getName() + ": Couldnt save attacker list!");
|
||||
_log.warning(getName() + ": Couldn't save attacker list!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.warning(getName() + ": Couldnt load siege guards!:");
|
||||
_log.warning(getName() + ": Couldnt load siege guards!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -404,7 +404,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
onSiegeEnds();
|
||||
|
||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
|
||||
_log.config("Siege of " + _hall.getName() + " scheduled for: " + _hall.getSiegeDate().getTime());
|
||||
_log.config("Siege of " + _hall.getName() + " scheduled for " + _hall.getSiegeDate().getTime() + ".");
|
||||
|
||||
_hall.updateSiegeStatus(SiegeStatus.REGISTERING);
|
||||
unSpawnSiegeGuards();
|
||||
@ -415,7 +415,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
{
|
||||
cancelSiegeTask();
|
||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new PrepareOwner(), _hall.getNextSiegeTime() - 3600000);
|
||||
_log.config(_hall.getName() + " siege scheduled for: " + _hall.getSiegeDate().getTime().toString());
|
||||
_log.config(_hall.getName() + " siege scheduled for " + _hall.getSiegeDate().getTime().toString() + ".");
|
||||
}
|
||||
|
||||
public void cancelSiegeTask()
|
||||
|
@ -2301,16 +2301,17 @@ public abstract class AbstractScript implements INamable
|
||||
dropChance *= Config.RATE_QUEST_DROP; // TODO separate configs for rate and amount
|
||||
if ((npc != null) && Config.L2JMOD_CHAMPION_ENABLE && npc.isChampion())
|
||||
{
|
||||
dropChance *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
if ((itemId == Inventory.ADENA_ID) || (itemId == Inventory.ANCIENT_ADENA_ID))
|
||||
{
|
||||
minAmount *= Config.L2JMOD_CHAMPION_ADENAS_REWARDS;
|
||||
maxAmount *= Config.L2JMOD_CHAMPION_ADENAS_REWARDS;
|
||||
dropChance *= Config.L2JMOD_CHAMPION_ADENAS_REWARDS_CHANCE;
|
||||
minAmount *= Config.L2JMOD_CHAMPION_ADENAS_REWARDS_AMOUNT;
|
||||
maxAmount *= Config.L2JMOD_CHAMPION_ADENAS_REWARDS_AMOUNT;
|
||||
}
|
||||
else
|
||||
{
|
||||
minAmount *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
maxAmount *= Config.L2JMOD_CHAMPION_REWARDS;
|
||||
dropChance *= Config.L2JMOD_CHAMPION_REWARDS_CHANCE;
|
||||
minAmount *= Config.L2JMOD_CHAMPION_REWARDS_AMOUNT;
|
||||
maxAmount *= Config.L2JMOD_CHAMPION_REWARDS_AMOUNT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,11 +361,15 @@ public abstract class AbstractOlympiadGame
|
||||
player.untransform();
|
||||
}
|
||||
|
||||
if (player.isInOlympiadMode())
|
||||
{
|
||||
player.sendPacket(new ExOlympiadMode(0));
|
||||
}
|
||||
|
||||
player.setIsInOlympiadMode(false);
|
||||
player.setIsOlympiadStart(false);
|
||||
player.setOlympiadSide(-1);
|
||||
player.setOlympiadGameId(-1);
|
||||
player.sendPacket(new ExOlympiadMode(0));
|
||||
|
||||
// Add Clan Skills
|
||||
if (player.getClan() != null)
|
||||
|
Reference in New Issue
Block a user