Removal of assorted empty lines.
This commit is contained in:
@@ -1358,27 +1358,21 @@ public class Config
|
||||
FLOOD_PROTECTOR_ITEM_AUCTION = new FloodProtectorConfig("ItemAuctionFloodProtector");
|
||||
|
||||
final PropertiesParser serverSettings = new PropertiesParser(SERVER_CONFIG_FILE);
|
||||
|
||||
GAMESERVER_HOSTNAME = serverSettings.getString("GameserverHostname", "0.0.0.0");
|
||||
PORT_GAME = serverSettings.getInt("GameserverPort", 7777);
|
||||
|
||||
GAME_SERVER_LOGIN_PORT = serverSettings.getInt("LoginPort", 9014);
|
||||
GAME_SERVER_LOGIN_HOST = serverSettings.getString("LoginHost", "127.0.0.1");
|
||||
|
||||
REQUEST_ID = serverSettings.getInt("RequestServerID", 0);
|
||||
ACCEPT_ALTERNATE_ID = serverSettings.getBoolean("AcceptAlternateID", true);
|
||||
|
||||
DATABASE_DRIVER = serverSettings.getString("Driver", "org.mariadb.jdbc.Driver");
|
||||
DATABASE_URL = serverSettings.getString("URL", "jdbc:mariadb://localhost/l2jgs");
|
||||
DATABASE_LOGIN = serverSettings.getString("Login", "root");
|
||||
DATABASE_PASSWORD = serverSettings.getString("Password", "");
|
||||
DATABASE_MAX_CONNECTIONS = serverSettings.getInt("MaximumDbConnections", 10);
|
||||
|
||||
BACKUP_DATABASE = serverSettings.getBoolean("BackupDatabase", false);
|
||||
MYSQL_BIN_PATH = serverSettings.getString("MySqlBinLocation", "C:/xampp/mysql/bin/");
|
||||
BACKUP_PATH = serverSettings.getString("BackupPath", "../backup/");
|
||||
BACKUP_DAYS = serverSettings.getInt("BackupDays", 30);
|
||||
|
||||
try
|
||||
{
|
||||
DATAPACK_ROOT = new File(serverSettings.getString("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
|
||||
@@ -1388,7 +1382,6 @@ public class Config
|
||||
LOGGER.log(Level.WARNING, "Error setting datapack root!", e);
|
||||
DATAPACK_ROOT = new File(".");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
SCRIPT_ROOT = new File(serverSettings.getString("ScriptRoot", "./data/scripts").replaceAll("\\\\", "/")).getCanonicalFile();
|
||||
@@ -1398,9 +1391,7 @@ public class Config
|
||||
LOGGER.log(Level.WARNING, "Error setting script root!", e);
|
||||
SCRIPT_ROOT = new File(".");
|
||||
}
|
||||
|
||||
Pattern charNamePattern;
|
||||
|
||||
try
|
||||
{
|
||||
charNamePattern = Pattern.compile(serverSettings.getString("CnameTemplate", ".*"));
|
||||
@@ -1410,18 +1401,13 @@ public class Config
|
||||
LOGGER.log(Level.WARNING, "Character name pattern is invalid!", e);
|
||||
charNamePattern = Pattern.compile(".*");
|
||||
}
|
||||
|
||||
CHARNAME_TEMPLATE_PATTERN = charNamePattern;
|
||||
|
||||
PET_NAME_TEMPLATE = serverSettings.getString("PetNameTemplate", ".*");
|
||||
CLAN_NAME_TEMPLATE = serverSettings.getString("ClanNameTemplate", ".*");
|
||||
|
||||
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7);
|
||||
MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100);
|
||||
|
||||
HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false);
|
||||
MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0);
|
||||
|
||||
final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";");
|
||||
PROTOCOL_LIST = new ArrayList<>(protocols.length);
|
||||
for (String protocol : protocols)
|
||||
@@ -1438,16 +1424,13 @@ public class Config
|
||||
SERVER_LIST_TYPE = getServerTypeId(serverSettings.getString("ServerListType", "Free").split(","));
|
||||
SERVER_LIST_AGE = serverSettings.getInt("ServerListAge", 0);
|
||||
SERVER_LIST_BRACKET = serverSettings.getBoolean("ServerListBrackets", false);
|
||||
|
||||
SCHEDULED_THREAD_POOL_COUNT = serverSettings.getInt("ScheduledThreadPoolCount", 40);
|
||||
INSTANT_THREAD_POOL_COUNT = serverSettings.getInt("InstantThreadPoolCount", 20);
|
||||
IO_PACKET_THREAD_CORE_SIZE = serverSettings.getInt("UrgentPacketThreadCoreSize", 20);
|
||||
THREADS_FOR_LOADING = serverSettings.getBoolean("ThreadsForLoading", false);
|
||||
|
||||
DEADLOCK_DETECTOR = serverSettings.getBoolean("DeadLockDetector", true);
|
||||
DEADLOCK_CHECK_INTERVAL = serverSettings.getInt("DeadLockCheckInterval", 20);
|
||||
RESTART_ON_DEADLOCK = serverSettings.getBoolean("RestartOnDeadlock", false);
|
||||
|
||||
SERVER_RESTART_SCHEDULE_ENABLED = serverSettings.getBoolean("ServerRestartScheduleEnabled", false);
|
||||
SERVER_RESTART_SCHEDULE_MESSAGE = serverSettings.getBoolean("ServerRestartScheduleMessage", false);
|
||||
SERVER_RESTART_SCHEDULE_COUNTDOWN = serverSettings.getInt("ServerRestartScheduleCountdown", 600);
|
||||
@@ -1482,7 +1465,6 @@ public class Config
|
||||
CASTLE_SELL_TAX_NEUTRAL = Feature.getInt("SellTaxForNeutralSide", 0);
|
||||
CASTLE_SELL_TAX_LIGHT = Feature.getInt("SellTaxForLightSide", 0);
|
||||
CASTLE_SELL_TAX_DARK = Feature.getInt("SellTaxForDarkSide", 20);
|
||||
|
||||
CS_TELE_FEE_RATIO = Feature.getLong("CastleTeleportFunctionFeeRatio", 604800000);
|
||||
CS_TELE1_FEE = Feature.getInt("CastleTeleportFunctionFeeLvl1", 1000);
|
||||
CS_TELE2_FEE = Feature.getInt("CastleTeleportFunctionFeeLvl2", 10000);
|
||||
@@ -1498,7 +1480,6 @@ public class Config
|
||||
CS_EXPREG_FEE_RATIO = Feature.getLong("CastleExpRegenerationFunctionFeeRatio", 604800000);
|
||||
CS_EXPREG1_FEE = Feature.getInt("CastleExpRegenerationFeeLvl1", 63000);
|
||||
CS_EXPREG2_FEE = Feature.getInt("CastleExpRegenerationFeeLvl2", 70000);
|
||||
|
||||
OUTER_DOOR_UPGRADE_PRICE2 = Feature.getInt("OuterDoorUpgradePriceLvl2", 3000000);
|
||||
OUTER_DOOR_UPGRADE_PRICE3 = Feature.getInt("OuterDoorUpgradePriceLvl3", 4000000);
|
||||
OUTER_DOOR_UPGRADE_PRICE5 = Feature.getInt("OuterDoorUpgradePriceLvl5", 5000000);
|
||||
@@ -1512,7 +1493,6 @@ public class Config
|
||||
TRAP_UPGRADE_PRICE2 = Feature.getInt("TrapUpgradePriceLvl2", 4000000);
|
||||
TRAP_UPGRADE_PRICE3 = Feature.getInt("TrapUpgradePriceLvl3", 5000000);
|
||||
TRAP_UPGRADE_PRICE4 = Feature.getInt("TrapUpgradePriceLvl4", 6000000);
|
||||
|
||||
FS_TELE_FEE_RATIO = Feature.getLong("FortressTeleportFunctionFeeRatio", 604800000);
|
||||
FS_TELE1_FEE = Feature.getInt("FortressTeleportFunctionFeeLvl1", 1000);
|
||||
FS_TELE2_FEE = Feature.getInt("FortressTeleportFunctionFeeLvl2", 10000);
|
||||
@@ -1533,7 +1513,6 @@ public class Config
|
||||
FS_MAX_SUPPLY_LEVEL = Feature.getInt("FortressMaxSupplyLevel", 6);
|
||||
FS_FEE_FOR_CASTLE = Feature.getInt("FortressFeeForCastle", 25000);
|
||||
FS_MAX_OWN_TIME = Feature.getInt("FortressMaximumOwnTime", 168);
|
||||
|
||||
TAKE_FORT_POINTS = Feature.getInt("TakeFortPoints", 200);
|
||||
LOOSE_FORT_POINTS = Feature.getInt("LooseFortPoints", 0);
|
||||
TAKE_CASTLE_POINTS = Feature.getInt("TakeCastlePoints", 1500);
|
||||
@@ -1557,7 +1536,6 @@ public class Config
|
||||
|
||||
// Load Attendance config file (if exists)
|
||||
final PropertiesParser Attandance = new PropertiesParser(ATTENDANCE_CONFIG_FILE);
|
||||
|
||||
ENABLE_ATTENDANCE_REWARDS = Attandance.getBoolean("EnableAttendanceRewards", false);
|
||||
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
|
||||
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
|
||||
@@ -1566,7 +1544,6 @@ public class Config
|
||||
|
||||
// Load AttributeSystem config file (if exists)
|
||||
final PropertiesParser AttributeSystem = new PropertiesParser(ATTRIBUTE_SYSTEM_FILE);
|
||||
|
||||
S_WEAPON_STONE = AttributeSystem.getInt("SWeaponStone", 50);
|
||||
S80_WEAPON_STONE = AttributeSystem.getInt("S80WeaponStone", 50);
|
||||
S84_WEAPON_STONE = AttributeSystem.getInt("S84WeaponStone", 50);
|
||||
@@ -1574,7 +1551,6 @@ public class Config
|
||||
R95_WEAPON_STONE = AttributeSystem.getInt("R95WeaponStone", 50);
|
||||
R99_WEAPON_STONE = AttributeSystem.getInt("R99WeaponStone", 50);
|
||||
R110_WEAPON_STONE = AttributeSystem.getInt("R110WeaponStone", 50);
|
||||
|
||||
S_ARMOR_STONE = AttributeSystem.getInt("SArmorStone", 60);
|
||||
S80_ARMOR_STONE = AttributeSystem.getInt("S80ArmorStone", 80);
|
||||
S84_ARMOR_STONE = AttributeSystem.getInt("S84ArmorStone", 80);
|
||||
@@ -1582,7 +1558,6 @@ public class Config
|
||||
R95_ARMOR_STONE = AttributeSystem.getInt("R95ArmorStone", 100);
|
||||
R99_ARMOR_STONE = AttributeSystem.getInt("R99ArmorStone", 100);
|
||||
R110_ARMOR_STONE = AttributeSystem.getInt("R110ArmorStone", 100);
|
||||
|
||||
S_WEAPON_CRYSTAL = AttributeSystem.getInt("SWeaponCrystal", 30);
|
||||
S80_WEAPON_CRYSTAL = AttributeSystem.getInt("S80WeaponCrystal", 40);
|
||||
S84_WEAPON_CRYSTAL = AttributeSystem.getInt("S84WeaponCrystal", 50);
|
||||
@@ -1590,7 +1565,6 @@ public class Config
|
||||
R95_WEAPON_CRYSTAL = AttributeSystem.getInt("R95WeaponCrystal", 60);
|
||||
R99_WEAPON_CRYSTAL = AttributeSystem.getInt("R99WeaponCrystal", 60);
|
||||
R110_WEAPON_CRYSTAL = AttributeSystem.getInt("R110WeaponCrystal", 60);
|
||||
|
||||
S_ARMOR_CRYSTAL = AttributeSystem.getInt("SArmorCrystal", 50);
|
||||
S80_ARMOR_CRYSTAL = AttributeSystem.getInt("S80ArmorCrystal", 70);
|
||||
S84_ARMOR_CRYSTAL = AttributeSystem.getInt("S84ArmorCrystal", 80);
|
||||
@@ -1598,7 +1572,6 @@ public class Config
|
||||
R95_ARMOR_CRYSTAL = AttributeSystem.getInt("R95ArmorCrystal", 100);
|
||||
R99_ARMOR_CRYSTAL = AttributeSystem.getInt("R99ArmorCrystal", 100);
|
||||
R110_ARMOR_CRYSTAL = AttributeSystem.getInt("R110ArmorCrystal", 100);
|
||||
|
||||
S_WEAPON_STONE_SUPER = AttributeSystem.getInt("SWeaponStoneSuper", 100);
|
||||
S80_WEAPON_STONE_SUPER = AttributeSystem.getInt("S80WeaponStoneSuper", 100);
|
||||
S84_WEAPON_STONE_SUPER = AttributeSystem.getInt("S84WeaponStoneSuper", 100);
|
||||
@@ -1606,7 +1579,6 @@ public class Config
|
||||
R95_WEAPON_STONE_SUPER = AttributeSystem.getInt("R95WeaponStoneSuper", 100);
|
||||
R99_WEAPON_STONE_SUPER = AttributeSystem.getInt("R99WeaponStoneSuper", 100);
|
||||
R110_WEAPON_STONE_SUPER = AttributeSystem.getInt("R110WeaponStoneSuper", 100);
|
||||
|
||||
S_ARMOR_STONE_SUPER = AttributeSystem.getInt("SArmorStoneSuper", 100);
|
||||
S80_ARMOR_STONE_SUPER = AttributeSystem.getInt("S80ArmorStoneSuper", 100);
|
||||
S84_ARMOR_STONE_SUPER = AttributeSystem.getInt("S84ArmorStoneSuper", 100);
|
||||
@@ -1614,7 +1586,6 @@ public class Config
|
||||
R95_ARMOR_STONE_SUPER = AttributeSystem.getInt("R95ArmorStoneSuper", 100);
|
||||
R99_ARMOR_STONE_SUPER = AttributeSystem.getInt("R99ArmorStoneSuper", 100);
|
||||
R110_ARMOR_STONE_SUPER = AttributeSystem.getInt("R110ArmorStoneSuper", 100);
|
||||
|
||||
S_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("SWeaponCrystalSuper", 80);
|
||||
S80_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("S80WeaponCrystalSuper", 90);
|
||||
S84_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("S84WeaponCrystalSuper", 100);
|
||||
@@ -1622,7 +1593,6 @@ public class Config
|
||||
R95_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("R95WeaponCrystalSuper", 100);
|
||||
R99_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("R99WeaponCrystalSuper", 100);
|
||||
R110_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("R110WeaponCrystalSuper", 100);
|
||||
|
||||
S_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("SArmorCrystalSuper", 100);
|
||||
S80_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("S80ArmorCrystalSuper", 100);
|
||||
S84_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("S84ArmorCrystalSuper", 100);
|
||||
@@ -1630,7 +1600,6 @@ public class Config
|
||||
R95_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("R95ArmorCrystalSuper", 100);
|
||||
R99_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("R99ArmorCrystalSuper", 100);
|
||||
R110_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("R110ArmorCrystalSuper", 100);
|
||||
|
||||
S_WEAPON_JEWEL = AttributeSystem.getInt("SWeaponJewel", 100);
|
||||
S80_WEAPON_JEWEL = AttributeSystem.getInt("S80WeaponJewel", 100);
|
||||
S84_WEAPON_JEWEL = AttributeSystem.getInt("S84WeaponJewel", 100);
|
||||
@@ -1639,7 +1608,6 @@ public class Config
|
||||
R99_WEAPON_JEWEL = AttributeSystem.getInt("R99WeaponJewel", 100);
|
||||
// Only R110 is used
|
||||
R110_WEAPON_JEWEL = AttributeSystem.getInt("R110WeaponJewel", 100);
|
||||
|
||||
S_ARMOR_JEWEL = AttributeSystem.getInt("SArmorJewel", 100);
|
||||
S80_ARMOR_JEWEL = AttributeSystem.getInt("S80ArmorJewel", 100);
|
||||
S84_ARMOR_JEWEL = AttributeSystem.getInt("S84ArmorJewel", 100);
|
||||
@@ -1651,7 +1619,6 @@ public class Config
|
||||
|
||||
// Load BalthusKnights config file (if exists)
|
||||
final PropertiesParser BalthusKnights = new PropertiesParser(BALTHUS_KNIGHTS_CONFIG_FILE);
|
||||
|
||||
BALTHUS_KNIGHTS_ENABLED = BalthusKnights.getBoolean("BalthusKnightsEnabled", true);
|
||||
BALTHUS_KNIGHTS_LEVEL = BalthusKnights.getInt("BalthusKnightsLevel", 85);
|
||||
BALTHUS_KNIGHTS_PREMIUM = BalthusKnights.getBoolean("BalthusKnightsPremium", true);
|
||||
@@ -1670,7 +1637,6 @@ public class Config
|
||||
|
||||
// Load Character config file (if exists)
|
||||
final PropertiesParser Character = new PropertiesParser(CHARACTER_CONFIG_FILE);
|
||||
|
||||
PLAYER_DELEVEL = Character.getBoolean("Delevel", true);
|
||||
DELEVEL_MINIMUM = Character.getInt("DelevelMinimum", 85);
|
||||
DECREASE_SKILL_LEVEL = Character.getBoolean("DecreaseSkillOnDelevel", true);
|
||||
@@ -1684,8 +1650,6 @@ public class Config
|
||||
MP_REGEN_MULTIPLIER = Character.getDouble("MpRegenMultiplier", 100) / 100;
|
||||
CP_REGEN_MULTIPLIER = Character.getDouble("CpRegenMultiplier", 100) / 100;
|
||||
ENABLE_MODIFY_SKILL_DURATION = Character.getBoolean("EnableModifySkillDuration", false);
|
||||
|
||||
// Create Map only if enabled
|
||||
if (ENABLE_MODIFY_SKILL_DURATION)
|
||||
{
|
||||
final String[] propertySplit = Character.getString("SkillDurationList", "").split(";");
|
||||
@@ -1714,7 +1678,6 @@ public class Config
|
||||
}
|
||||
}
|
||||
ENABLE_MODIFY_SKILL_REUSE = Character.getBoolean("EnableModifySkillReuse", false);
|
||||
// Create Map only if enabled
|
||||
if (ENABLE_MODIFY_SKILL_REUSE)
|
||||
{
|
||||
final String[] propertySplit = Character.getString("SkillReuseList", "").split(";");
|
||||
@@ -1742,7 +1705,6 @@ public class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AUTO_LEARN_SKILLS = Character.getBoolean("AutoLearnSkills", false);
|
||||
AUTO_LEARN_FS_SKILLS = Character.getBoolean("AutoLearnForgottenScrollSkills", false);
|
||||
AUTO_LEARN_FP_SKILLS = Character.getBoolean("AutoLearnForgottenPowerSkills", false);
|
||||
@@ -1797,7 +1759,6 @@ public class Config
|
||||
HARDIN_REMOVED_SKILLS.get(classId).add(Integer.parseInt(classInfo[i]));
|
||||
}
|
||||
}
|
||||
|
||||
ENABLE_VITALITY = Character.getBoolean("EnableVitality", true);
|
||||
STARTING_VITALITY_POINTS = Character.getInt("StartingVitalityPoints", 140000);
|
||||
RAIDBOSS_USE_VITALITY = Character.getBoolean("RaidbossUseVitality", true);
|
||||
@@ -1848,7 +1809,6 @@ public class Config
|
||||
MIN_WEAPON_ENCHANT_ANNOUNCE = Character.getInt("MinimumWeaponEnchantAnnounce", 7);
|
||||
MAX_ARMOR_ENCHANT_ANNOUNCE = Character.getInt("MaximumArmorEnchantAnnounce", 30);
|
||||
MAX_WEAPON_ENCHANT_ANNOUNCE = Character.getInt("MaximumWeaponEnchantAnnounce", 30);
|
||||
|
||||
final String[] array = Character.getString("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314,13740,13741,13742,13743,13744,13745,13746,13747,13748,14592,14593,14594,14595,14596,14597,14598,14599,14600,14664,14665,14666,14667,14668,14669,14670,14671,14672,14801,14802,14803,14804,14805,14806,14807,14808,14809,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,16025,16026,21712,22173,22174,22175").split(",");
|
||||
AUGMENTATION_BLACKLIST = new int[array.length];
|
||||
for (int i = 0; i < array.length; i++)
|
||||
@@ -1967,7 +1927,6 @@ public class Config
|
||||
|
||||
// Load Telnet config file (if exists)
|
||||
final PropertiesParser telnetSettings = new PropertiesParser(TELNET_CONFIG_FILE);
|
||||
|
||||
TELNET_ENABLED = telnetSettings.getBoolean("EnableTelnet", false);
|
||||
TELNET_PORT = telnetSettings.getInt("Port", 12345);
|
||||
TELNET_HOSTNAME = telnetSettings.getString("BindAddress", "127.0.0.1");
|
||||
@@ -1976,7 +1935,6 @@ public class Config
|
||||
|
||||
// Load Training Camp config file (if exists)
|
||||
final PropertiesParser trainingCampSettings = new PropertiesParser(TRAINING_CAMP_CONFIG_FILE);
|
||||
|
||||
TRAINING_CAMP_ENABLE = trainingCampSettings.getBoolean("TrainingCampEnable", false);
|
||||
TRAINING_CAMP_PREMIUM_ONLY = trainingCampSettings.getBoolean("TrainingCampPremiumOnly", false);
|
||||
TRAINING_CAMP_MAX_DURATION = trainingCampSettings.getInt("TrainingCampDuration", 18000);
|
||||
@@ -2138,7 +2096,6 @@ public class Config
|
||||
MIN_BLOCK_CHECKER_TEAM_MEMBERS = 6;
|
||||
}
|
||||
HBCE_FAIR_PLAY = General.getBoolean("HBCEFairPlay", false);
|
||||
|
||||
BOTREPORT_ENABLE = General.getBoolean("EnableBotReportButton", false);
|
||||
BOTREPORT_RESETPOINT_HOUR = General.getString("BotReportPointsResetHour", "00:00").split(":");
|
||||
BOTREPORT_REPORT_DELAY = General.getInt("BotReportDelay", 30) * 60000;
|
||||
@@ -2147,12 +2104,10 @@ public class Config
|
||||
|
||||
// Load FloodProtector config file
|
||||
final PropertiesParser FloodProtectors = new PropertiesParser(FLOOD_PROTECTOR_CONFIG_FILE);
|
||||
|
||||
loadFloodProtectorConfigs(FloodProtectors);
|
||||
|
||||
// Load NPC config file (if exists)
|
||||
final PropertiesParser NPC = new PropertiesParser(NPC_CONFIG_FILE);
|
||||
|
||||
ANNOUNCE_MAMMON_SPAWN = NPC.getBoolean("AnnounceMammonSpawn", false);
|
||||
ALT_MOB_AGRO_IN_PEACEZONE = NPC.getBoolean("AltMobAgroInPeaceZone", true);
|
||||
ALT_ATTACKABLE_NPCS = NPC.getBoolean("AltAttackableNpcs", true);
|
||||
@@ -2195,7 +2150,6 @@ public class Config
|
||||
{
|
||||
LOGGER.warning(StringUtil.concat("[CustomMinionsRespawnTime]: invalid config property -> CustomMinionsRespawnTime \"", prop, "\""));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
MINIONS_RESPAWN_TIME.put(Integer.parseInt(propSplit[0]), Integer.parseInt(propSplit[1]));
|
||||
@@ -2209,7 +2163,6 @@ public class Config
|
||||
}
|
||||
}
|
||||
FORCE_DELETE_MINIONS = NPC.getBoolean("ForceDeleteMinions", false);
|
||||
|
||||
RAID_DISABLE_CURSE = NPC.getBoolean("DisableRaidCurse", false);
|
||||
RAID_CHAOS_TIME = NPC.getInt("RaidChaosTime", 10);
|
||||
GRAND_CHAOS_TIME = NPC.getInt("GrandChaosTime", 10);
|
||||
@@ -2217,18 +2170,15 @@ public class Config
|
||||
INVENTORY_MAXIMUM_PET = NPC.getInt("MaximumSlotsForPet", 12);
|
||||
PET_HP_REGEN_MULTIPLIER = NPC.getDouble("PetHpRegenMultiplier", 100) / 100;
|
||||
PET_MP_REGEN_MULTIPLIER = NPC.getDouble("PetMpRegenMultiplier", 100) / 100;
|
||||
|
||||
VITALITY_CONSUME_BY_MOB = NPC.getInt("VitalityConsumeByMob", 2250);
|
||||
VITALITY_CONSUME_BY_BOSS = NPC.getInt("VitalityConsumeByBoss", 1125);
|
||||
|
||||
// Load Rates config file (if exists)
|
||||
final PropertiesParser RatesSettings = new PropertiesParser(RATES_CONFIG_FILE);
|
||||
|
||||
RATE_XP = RatesSettings.getFloat("RateXp", 1);
|
||||
RATE_SP = RatesSettings.getFloat("RateSp", 1);
|
||||
RATE_PARTY_XP = RatesSettings.getFloat("RatePartyXp", 1);
|
||||
RATE_PARTY_SP = RatesSettings.getFloat("RatePartySp", 1);
|
||||
|
||||
RATE_INSTANCE_XP = RatesSettings.getFloat("RateInstanceXp", -1);
|
||||
if (RATE_INSTANCE_XP < 0)
|
||||
{
|
||||
@@ -2249,7 +2199,6 @@ public class Config
|
||||
{
|
||||
RATE_INSTANCE_PARTY_SP = RATE_PARTY_SP;
|
||||
}
|
||||
|
||||
RATE_EXTRACTABLE = RatesSettings.getFloat("RateExtractable", 1);
|
||||
RATE_DROP_MANOR = RatesSettings.getInt("RateDropManor", 1);
|
||||
RATE_QUEST_DROP = RatesSettings.getFloat("RateQuestDrop", 1);
|
||||
@@ -2264,7 +2213,6 @@ public class Config
|
||||
RATE_QUEST_REWARD_RECIPE = RatesSettings.getFloat("RateQuestRewardRecipe", 1);
|
||||
RATE_QUEST_REWARD_MATERIAL = RatesSettings.getFloat("RateQuestRewardMaterial", 1);
|
||||
RATE_RAIDBOSS_POINTS = RatesSettings.getFloat("RateRaidbossPointsReward", 1);
|
||||
|
||||
RATE_VITALITY_EXP_MULTIPLIER = RatesSettings.getFloat("RateVitalityExpMultiplier", 2);
|
||||
VITALITY_MAX_ITEMS_ALLOWED = RatesSettings.getInt("VitalityMaxItemsAllowed", 999);
|
||||
RATE_VITALITY_LOST = RatesSettings.getFloat("RateVitalityLost", 1);
|
||||
@@ -2290,7 +2238,6 @@ public class Config
|
||||
KARMA_RATE_DROP_ITEM = RatesSettings.getInt("KarmaRateDropItem", 50);
|
||||
KARMA_RATE_DROP_EQUIP = RatesSettings.getInt("KarmaRateDropEquip", 40);
|
||||
KARMA_RATE_DROP_EQUIP_WEAPON = RatesSettings.getInt("KarmaRateDropEquipWeapon", 10);
|
||||
|
||||
RATE_DEATH_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("DeathDropAmountMultiplier", 1);
|
||||
RATE_SPOIL_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("SpoilDropAmountMultiplier", 1);
|
||||
RATE_HERB_DROP_AMOUNT_MULTIPLIER = RatesSettings.getFloat("HerbDropAmountMultiplier", 1);
|
||||
@@ -2299,7 +2246,6 @@ public class Config
|
||||
RATE_SPOIL_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("SpoilDropChanceMultiplier", 1);
|
||||
RATE_HERB_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("HerbDropChanceMultiplier", 1);
|
||||
RATE_RAID_DROP_CHANCE_MULTIPLIER = RatesSettings.getFloat("RaidDropChanceMultiplier", 1);
|
||||
|
||||
final String[] dropAmountMultiplier = RatesSettings.getString("DropAmountMultiplierByItemId", "").split(";");
|
||||
RATE_DROP_AMOUNT_BY_ID = new HashMap<>(dropAmountMultiplier.length);
|
||||
if (!dropAmountMultiplier[0].isEmpty())
|
||||
@@ -2327,7 +2273,6 @@ public class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final String[] dropChanceMultiplier = RatesSettings.getString("DropChanceMultiplierByItemId", "").split(";");
|
||||
RATE_DROP_CHANCE_BY_ID = new HashMap<>(dropChanceMultiplier.length);
|
||||
if (!dropChanceMultiplier[0].isEmpty())
|
||||
@@ -2355,10 +2300,8 @@ public class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DROP_MAX_OCCURRENCES_NORMAL = RatesSettings.getInt("DropMaxOccurrencesNormal", 2);
|
||||
DROP_MAX_OCCURRENCES_RAIDBOSS = RatesSettings.getInt("DropMaxOccurrencesRaidboss", 7);
|
||||
|
||||
DROP_ADENA_MIN_LEVEL_DIFFERENCE = RatesSettings.getInt("DropAdenaMinLevelDifference", 8);
|
||||
DROP_ADENA_MAX_LEVEL_DIFFERENCE = RatesSettings.getInt("DropAdenaMaxLevelDifference", 15);
|
||||
DROP_ADENA_MIN_LEVEL_GAP_CHANCE = RatesSettings.getDouble("DropAdenaMinLevelGapChance", 10);
|
||||
@@ -2368,40 +2311,30 @@ public class Config
|
||||
|
||||
// Load PvP config file (if exists)
|
||||
final PropertiesParser PVPSettings = new PropertiesParser(PVP_CONFIG_FILE);
|
||||
|
||||
KARMA_DROP_GM = PVPSettings.getBoolean("CanGMDropEquipment", false);
|
||||
KARMA_PK_LIMIT = PVPSettings.getInt("MinimumPKRequiredToDrop", 5);
|
||||
KARMA_NONDROPPABLE_PET_ITEMS = PVPSettings.getString("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
|
||||
KARMA_NONDROPPABLE_ITEMS = PVPSettings.getString("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390");
|
||||
|
||||
String[] karma = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
|
||||
KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[karma.length];
|
||||
|
||||
for (int i = 0; i < karma.length; i++)
|
||||
{
|
||||
KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(karma[i]);
|
||||
}
|
||||
|
||||
Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
|
||||
karma = KARMA_NONDROPPABLE_ITEMS.split(",");
|
||||
KARMA_LIST_NONDROPPABLE_ITEMS = new int[karma.length];
|
||||
|
||||
for (int i = 0; i < karma.length; i++)
|
||||
{
|
||||
KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(karma[i]);
|
||||
}
|
||||
|
||||
Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
|
||||
ANTIFEED_ENABLE = PVPSettings.getBoolean("AntiFeedEnable", false);
|
||||
ANTIFEED_DUALBOX = PVPSettings.getBoolean("AntiFeedDualbox", true);
|
||||
ANTIFEED_DISCONNECTED_AS_DUALBOX = PVPSettings.getBoolean("AntiFeedDisconnectedAsDualbox", true);
|
||||
ANTIFEED_INTERVAL = PVPSettings.getInt("AntiFeedInterval", 120) * 1000;
|
||||
|
||||
VAMPIRIC_ATTACK_AFFECTS_PVP = PVPSettings.getBoolean("VampiricAttackAffectsPvP", false);
|
||||
MP_VAMPIRIC_ATTACK_AFFECTS_PVP = PVPSettings.getBoolean("MpVampiricAttackAffectsPvP", false);
|
||||
|
||||
// sorting so binarySearch can be used later
|
||||
Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
|
||||
Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
|
||||
|
||||
PVP_NORMAL_TIME = PVPSettings.getInt("PvPVsNormalTime", 120000);
|
||||
PVP_PVP_TIME = PVPSettings.getInt("PvPVsPvPTime", 60000);
|
||||
MAX_REPUTATION = PVPSettings.getInt("MaxReputation", 500);
|
||||
@@ -2410,7 +2343,6 @@ public class Config
|
||||
|
||||
// Load Olympiad config file (if exists)
|
||||
final PropertiesParser Olympiad = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
|
||||
|
||||
ALT_OLY_START_TIME = Olympiad.getInt("AltOlyStartTime", 20);
|
||||
ALT_OLY_MIN = Olympiad.getInt("AltOlyMin", 0);
|
||||
ALT_OLY_CPERIOD = Olympiad.getLong("AltOlyCPeriod", 14400000);
|
||||
@@ -2467,7 +2399,6 @@ public class Config
|
||||
if (hexIdFile.exists())
|
||||
{
|
||||
final PropertiesParser hexId = new PropertiesParser(hexIdFile);
|
||||
|
||||
if (hexId.containskey("ServerID") && hexId.containskey("HexID"))
|
||||
{
|
||||
SERVER_ID = hexId.getInt("ServerID", 1);
|
||||
@@ -2481,7 +2412,6 @@ public class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (HEX_ID == null)
|
||||
{
|
||||
LOGGER.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
|
||||
@@ -2489,69 +2419,54 @@ public class Config
|
||||
|
||||
// Grand bosses
|
||||
final PropertiesParser GrandBossSettings = new PropertiesParser(GRANDBOSS_CONFIG_FILE);
|
||||
|
||||
ANTHARAS_WAIT_TIME = GrandBossSettings.getInt("AntharasWaitTime", 30);
|
||||
ANTHARAS_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfAntharasSpawn", 264);
|
||||
ANTHARAS_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfAntharasSpawn", 72);
|
||||
|
||||
VALAKAS_WAIT_TIME = GrandBossSettings.getInt("ValakasWaitTime", 30);
|
||||
VALAKAS_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfValakasSpawn", 264);
|
||||
VALAKAS_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfValakasSpawn", 72);
|
||||
|
||||
BAIUM_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfBaiumSpawn", 168);
|
||||
BAIUM_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfBaiumSpawn", 48);
|
||||
|
||||
CORE_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfCoreSpawn", 60);
|
||||
CORE_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfCoreSpawn", 24);
|
||||
|
||||
ORFEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfOrfenSpawn", 48);
|
||||
ORFEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfOrfenSpawn", 20);
|
||||
|
||||
QUEEN_ANT_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfQueenAntSpawn", 36);
|
||||
QUEEN_ANT_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfQueenAntSpawn", 17);
|
||||
|
||||
BELETH_WAIT_TIME = GrandBossSettings.getInt("BelethWaitTime", 5);
|
||||
BELETH_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfBelethSpawn", 192);
|
||||
BELETH_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfBelethSpawn", 148);
|
||||
BELETH_MIN_PLAYERS = GrandBossSettings.getInt("BelethMinPlayers", 49);
|
||||
BELETH_MAX_PLAYERS = GrandBossSettings.getInt("BelethMaxPlayers", 350);
|
||||
|
||||
KELBIM_WAIT_TIME = GrandBossSettings.getInt("KelbimWaitTime", 5);
|
||||
KELBIM_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfKelbimSpawn", 192);
|
||||
KELBIM_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfKelbimSpawn", 148);
|
||||
KELBIM_MIN_PLAYERS = GrandBossSettings.getInt("KelbimMinPlayers", 49);
|
||||
KELBIM_MAX_PLAYERS = GrandBossSettings.getInt("KelbimMaxPlayers", 350);
|
||||
|
||||
ANAKIM_MIN_PLAYERS = GrandBossSettings.getInt("AnakimMinPlayers", 98);
|
||||
ANAKIM_MAX_PLAYERS = GrandBossSettings.getInt("AnakimMaxPlayers", 120);
|
||||
ANAKIM_MIN_PLAYER_LVL = GrandBossSettings.getInt("AnakimMinPlayerLvl", 105);
|
||||
|
||||
LILITH_MIN_PLAYERS = GrandBossSettings.getInt("LilithMinPlayers", 98);
|
||||
LILITH_MAX_PLAYERS = GrandBossSettings.getInt("LilithMaxPlayers", 120);
|
||||
LILITH_MIN_PLAYER_LVL = GrandBossSettings.getInt("LilithMinPlayerLvl", 105);
|
||||
|
||||
TRASKEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfTraskenSpawn", 264);
|
||||
TRASKEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfTraskenSpawn", 72);
|
||||
TRASKEN_MIN_PLAYERS = GrandBossSettings.getInt("TraskenMinPlayers", 49);
|
||||
TRASKEN_MAX_PLAYERS = GrandBossSettings.getInt("TraskenMaxPlayers", 112);
|
||||
TRASKEN_MIN_PLAYER_LVL = GrandBossSettings.getInt("TraskenMinPlayerLvl", 85);
|
||||
|
||||
LINDVIOR_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfLindviorSpawn", 264);
|
||||
LINDVIOR_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLindviorSpawn", 72);
|
||||
LINDVIOR_MIN_PLAYERS = GrandBossSettings.getInt("LindviorMinPlayers", 49);
|
||||
LINDVIOR_MAX_PLAYERS = GrandBossSettings.getInt("LindviorMaxPlayers", 112);
|
||||
LINDVIOR_MIN_PLAYER_LVL = GrandBossSettings.getInt("LindviorMinPlayerLvl", 99);
|
||||
|
||||
HELIOS_WAIT_TIME = GrandBossSettings.getInt("HeliosWaitTime", 10);
|
||||
HELIOS_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfHeliosSpawn", 264);
|
||||
HELIOS_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfHeliosSpawn", 72);
|
||||
HELIOS_MIN_PLAYER = GrandBossSettings.getInt("HeliosMinPlayers", 70);
|
||||
HELIOS_MIN_PLAYER_LVL = GrandBossSettings.getInt("HeliosMinPlayerLvl", 102);
|
||||
|
||||
RAMONA_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfRamonaSpawn", 72);
|
||||
RAMONA_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfRamonaSpawn", 48);
|
||||
RAMONA_MIN_PLAYER = GrandBossSettings.getInt("RamonaMinPlayers", 7);
|
||||
|
||||
FAFURION_WAIT_TIME = GrandBossSettings.getInt("FafurionWaitTime", 10);
|
||||
FAFURION_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfFafurionSpawn", 264);
|
||||
FAFURION_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfFafurionSpawn", 72);
|
||||
@@ -2561,11 +2476,8 @@ public class Config
|
||||
|
||||
// Gracia Seeds
|
||||
final PropertiesParser GraciaSeedsSettings = new PropertiesParser(GRACIASEEDS_CONFIG_FILE);
|
||||
|
||||
// Seed of Destruction
|
||||
SOD_TIAT_KILL_COUNT = GraciaSeedsSettings.getInt("TiatKillCountForNextState", 10);
|
||||
SOD_STAGE_2_LENGTH = GraciaSeedsSettings.getLong("Stage2Length", 720) * 60000;
|
||||
|
||||
try
|
||||
{
|
||||
//@formatter:off
|
||||
@@ -2581,25 +2493,22 @@ public class Config
|
||||
LOGGER.log(Level.WARNING, "Error while loading chat filter words!", e);
|
||||
}
|
||||
|
||||
final PropertiesParser geoData = new PropertiesParser(GEOENGINE_CONFIG_FILE);
|
||||
|
||||
GEODATA_PATH = geoData.getString("GeoDataPath", "./data/geodata/");
|
||||
COORD_SYNCHRONIZE = geoData.getInt("CoordSynchronize", -1);
|
||||
|
||||
PART_OF_CHARACTER_HEIGHT = geoData.getInt("PartOfCharacterHeight", 75);
|
||||
MAX_OBSTACLE_HEIGHT = geoData.getInt("MaxObstacleHeight", 32);
|
||||
|
||||
PATHFINDING = geoData.getBoolean("PathFinding", true);
|
||||
PATHFIND_BUFFERS = geoData.getString("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
|
||||
BASE_WEIGHT = geoData.getInt("BaseWeight", 10);
|
||||
DIAGONAL_WEIGHT = geoData.getInt("DiagonalWeight", 14);
|
||||
OBSTACLE_MULTIPLIER = geoData.getInt("ObstacleMultiplier", 10);
|
||||
HEURISTIC_WEIGHT = geoData.getInt("HeuristicWeight", 20);
|
||||
MAX_ITERATIONS = geoData.getInt("MaxIterations", 3500);
|
||||
// Load GeoEngine config file (if exists)
|
||||
final PropertiesParser GeoEngine = new PropertiesParser(GEOENGINE_CONFIG_FILE);
|
||||
GEODATA_PATH = GeoEngine.getString("GeoDataPath", "./data/geodata/");
|
||||
COORD_SYNCHRONIZE = GeoEngine.getInt("CoordSynchronize", -1);
|
||||
PART_OF_CHARACTER_HEIGHT = GeoEngine.getInt("PartOfCharacterHeight", 75);
|
||||
MAX_OBSTACLE_HEIGHT = GeoEngine.getInt("MaxObstacleHeight", 32);
|
||||
PATHFINDING = GeoEngine.getBoolean("PathFinding", true);
|
||||
PATHFIND_BUFFERS = GeoEngine.getString("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
|
||||
BASE_WEIGHT = GeoEngine.getInt("BaseWeight", 10);
|
||||
DIAGONAL_WEIGHT = GeoEngine.getInt("DiagonalWeight", 14);
|
||||
OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10);
|
||||
HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20);
|
||||
MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500);
|
||||
|
||||
// Load AllowedPlayerRaces config file (if exists)
|
||||
final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE);
|
||||
|
||||
ALLOW_HUMAN = AllowedPlayerRaces.getBoolean("AllowHuman", true);
|
||||
ALLOW_ELF = AllowedPlayerRaces.getBoolean("AllowElf", true);
|
||||
ALLOW_DARKELF = AllowedPlayerRaces.getBoolean("AllowDarkElf", true);
|
||||
@@ -2610,7 +2519,6 @@ public class Config
|
||||
|
||||
// Load AutoPotions config file (if exists)
|
||||
final PropertiesParser AutoPotions = new PropertiesParser(CUSTOM_AUTO_POTIONS_CONFIG_FILE);
|
||||
|
||||
AUTO_POTIONS_ENABLED = AutoPotions.getBoolean("AutoPotionsEnabled", false);
|
||||
AUTO_POTIONS_IN_OLYMPIAD = AutoPotions.getBoolean("AutoPotionsInOlympiad", false);
|
||||
AUTO_POTION_MIN_LVL = AutoPotions.getInt("AutoPotionMinimumLevel", 1);
|
||||
@@ -2638,14 +2546,12 @@ public class Config
|
||||
|
||||
// Load Banking config file (if exists)
|
||||
final PropertiesParser Banking = new PropertiesParser(CUSTOM_BANKING_CONFIG_FILE);
|
||||
|
||||
BANKING_SYSTEM_ENABLED = Banking.getBoolean("BankingEnabled", false);
|
||||
BANKING_SYSTEM_GOLDBARS = Banking.getInt("BankingGoldbarCount", 1);
|
||||
BANKING_SYSTEM_ADENA = Banking.getInt("BankingAdenaCount", 500000000);
|
||||
|
||||
// Load BoostNpcStats config file (if exists)
|
||||
final PropertiesParser BoostNpcStats = new PropertiesParser(CUSTOM_NPC_STAT_MULTIPLIERS_CONFIG_FILE);
|
||||
|
||||
ENABLE_NPC_STAT_MULTIPLIERS = BoostNpcStats.getBoolean("EnableNpcStatMultipliers", false);
|
||||
MONSTER_HP_MULTIPLIER = BoostNpcStats.getDouble("MonsterHP", 1.0);
|
||||
MONSTER_MP_MULTIPLIER = BoostNpcStats.getDouble("MonsterMP", 1.0);
|
||||
@@ -2682,7 +2588,6 @@ public class Config
|
||||
|
||||
// Load ChampionMonster config file (if exists)
|
||||
final PropertiesParser ChampionMonster = new PropertiesParser(CUSTOM_CHAMPION_MONSTERS_CONFIG_FILE);
|
||||
|
||||
CHAMPION_ENABLE = ChampionMonster.getBoolean("ChampionEnable", false);
|
||||
CHAMPION_PASSIVE = ChampionMonster.getBoolean("ChampionPassive", false);
|
||||
CHAMPION_FREQUENCY = ChampionMonster.getInt("ChampionFrequency", 0);
|
||||
@@ -2708,12 +2613,10 @@ public class Config
|
||||
|
||||
// Load ChatModeration config file (if exists)
|
||||
final PropertiesParser ChatModeration = new PropertiesParser(CUSTOM_CHAT_MODERATION_CONFIG_FILE);
|
||||
|
||||
CHAT_ADMIN = ChatModeration.getBoolean("ChatAdmin", true);
|
||||
|
||||
// Load ClassBalance config file (if exists)
|
||||
final PropertiesParser ClassBalance = new PropertiesParser(CUSTOM_CLASS_BALANCE_CONFIG_FILE);
|
||||
|
||||
final String[] pveMagicalSkillDamageMultipliers = ClassBalance.getString("PveMagicalSkillDamageMultipliers", "").trim().split(";");
|
||||
PVE_MAGICAL_SKILL_DAMAGE_MULTIPLIERS.clear();
|
||||
if (pveMagicalSkillDamageMultipliers.length > 0)
|
||||
@@ -3165,7 +3068,6 @@ public class Config
|
||||
|
||||
// Load CommunityBoard config file (if exists)
|
||||
final PropertiesParser CommunityBoard = new PropertiesParser(CUSTOM_COMMUNITY_BOARD_CONFIG_FILE);
|
||||
|
||||
CUSTOM_CB_ENABLED = CommunityBoard.getBoolean("CustomCommunityBoard", false);
|
||||
COMMUNITYBOARD_CURRENCY = CommunityBoard.getInt("CommunityCurrencyId", 57);
|
||||
COMMUNITYBOARD_ENABLE_MULTISELLS = CommunityBoard.getBoolean("CommunityEnableMultisells", true);
|
||||
@@ -3199,19 +3101,16 @@ public class Config
|
||||
|
||||
// Load CustomDepositableItems config file (if exists)
|
||||
final PropertiesParser CustomDepositableItems = new PropertiesParser(CUSTOM_CUSTOM_DEPOSITABLE_ITEMS_CONFIG_FILE);
|
||||
|
||||
CUSTOM_DEPOSITABLE_ENABLED = CustomDepositableItems.getBoolean("CustomDepositableEnabled", false);
|
||||
CUSTOM_DEPOSITABLE_QUEST_ITEMS = CustomDepositableItems.getBoolean("DepositableQuestItems", false);
|
||||
|
||||
// Load CustomMailManager config file (if exists)
|
||||
final PropertiesParser CustomMailManager = new PropertiesParser(CUSTOM_CUSTOM_MAIL_MANAGER_CONFIG_FILE);
|
||||
|
||||
CUSTOM_MAIL_MANAGER_ENABLED = CustomMailManager.getBoolean("CustomMailManagerEnabled", false);
|
||||
CUSTOM_MAIL_MANAGER_DELAY = CustomMailManager.getInt("DatabaseQueryDelay", 30) * 1000;
|
||||
|
||||
// Load DelevelManager config file (if exists)
|
||||
final PropertiesParser DelevelManager = new PropertiesParser(CUSTOM_DELEVEL_MANAGER_CONFIG_FILE);
|
||||
|
||||
DELEVEL_MANAGER_ENABLED = DelevelManager.getBoolean("Enabled", false);
|
||||
DELEVEL_MANAGER_NPCID = DelevelManager.getInt("NpcId", 1002000);
|
||||
DELEVEL_MANAGER_ITEMID = DelevelManager.getInt("RequiredItemId", 4356);
|
||||
@@ -3220,7 +3119,6 @@ public class Config
|
||||
|
||||
// Load DualboxCheck config file (if exists)
|
||||
final PropertiesParser DualboxCheck = new PropertiesParser(CUSTOM_DUALBOX_CHECK_CONFIG_FILE);
|
||||
|
||||
DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0);
|
||||
@@ -3255,7 +3153,6 @@ public class Config
|
||||
|
||||
// Load FactionSystem config file (if exists)
|
||||
final PropertiesParser FactionSystem = new PropertiesParser(CUSTOM_FACTION_SYSTEM_CONFIG_FILE);
|
||||
|
||||
String[] tempString;
|
||||
FACTION_SYSTEM_ENABLED = FactionSystem.getBoolean("EnableFactionSystem", false);
|
||||
tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(",");
|
||||
@@ -3300,7 +3197,6 @@ public class Config
|
||||
|
||||
// Load MultilingualSupport config file (if exists)
|
||||
final PropertiesParser MultilingualSupport = new PropertiesParser(CUSTOM_MULTILANGUAL_SUPPORT_CONFIG_FILE);
|
||||
|
||||
MULTILANG_DEFAULT = MultilingualSupport.getString("MultiLangDefault", "en").toLowerCase();
|
||||
MULTILANG_ENABLE = MultilingualSupport.getBoolean("MultiLangEnable", false);
|
||||
if (MULTILANG_ENABLE)
|
||||
@@ -3321,7 +3217,6 @@ public class Config
|
||||
|
||||
// Load NoblessMaster config file (if exists)
|
||||
final PropertiesParser NoblessMaster = new PropertiesParser(CUSTOM_NOBLESS_MASTER_CONFIG_FILE);
|
||||
|
||||
NOBLESS_MASTER_ENABLED = NoblessMaster.getBoolean("Enabled", false);
|
||||
NOBLESS_MASTER_NPCID = NoblessMaster.getInt("NpcId", 1003000);
|
||||
NOBLESS_MASTER_LEVEL_REQUIREMENT = NoblessMaster.getInt("LevelRequirement", 80);
|
||||
@@ -3330,7 +3225,6 @@ public class Config
|
||||
|
||||
// Load OfflineTrade config file (if exists)
|
||||
final PropertiesParser OfflineTrade = new PropertiesParser(CUSTOM_OFFLINE_TRADE_CONFIG_FILE);
|
||||
|
||||
OFFLINE_TRADE_ENABLE = OfflineTrade.getBoolean("OfflineTradeEnable", false);
|
||||
OFFLINE_CRAFT_ENABLE = OfflineTrade.getBoolean("OfflineCraftEnable", false);
|
||||
OFFLINE_MODE_IN_PEACE_ZONE = OfflineTrade.getBoolean("OfflineModeInPeaceZone", false);
|
||||
@@ -3345,12 +3239,10 @@ public class Config
|
||||
|
||||
// Load PasswordChange config file (if exists)
|
||||
final PropertiesParser PasswordChange = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
|
||||
|
||||
ALLOW_CHANGE_PASSWORD = PasswordChange.getBoolean("AllowChangePassword", false);
|
||||
|
||||
// Load PcCafe config file (if exists)
|
||||
final PropertiesParser PcCafe = new PropertiesParser(CUSTOM_PC_CAFE_CONFIG_FILE);
|
||||
|
||||
PC_CAFE_ENABLED = PcCafe.getBoolean("PcCafeEnabled", false);
|
||||
PC_CAFE_ONLY_PREMIUM = PcCafe.getBoolean("PcCafeOnlyPremium", false);
|
||||
PC_CAFE_MAX_POINTS = PcCafe.getInt("MaxPcCafePoints", 200000);
|
||||
@@ -3383,7 +3275,6 @@ public class Config
|
||||
|
||||
// Load PremiumSystem config file (if exists)
|
||||
final PropertiesParser PremiumSystem = new PropertiesParser(CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE);
|
||||
|
||||
PREMIUM_SYSTEM_ENABLED = PremiumSystem.getBoolean("EnablePremiumSystem", false);
|
||||
PREMIUM_RATE_XP = PremiumSystem.getFloat("PremiumRateXp", 2);
|
||||
PREMIUM_RATE_SP = PremiumSystem.getFloat("PremiumRateSp", 2);
|
||||
@@ -3452,13 +3343,11 @@ public class Config
|
||||
|
||||
// Load PrivateStoreRange config file (if exists)
|
||||
final PropertiesParser PrivateStoreRange = new PropertiesParser(CUSTOM_PRIVATE_STORE_RANGE_CONFIG_FILE);
|
||||
|
||||
SHOP_MIN_RANGE_FROM_PLAYER = PrivateStoreRange.getInt("ShopMinRangeFromPlayer", 50);
|
||||
SHOP_MIN_RANGE_FROM_NPC = PrivateStoreRange.getInt("ShopMinRangeFromNpc", 100);
|
||||
|
||||
// Load PvpAnnounce config file (if exists)
|
||||
final PropertiesParser PvpAnnounce = new PropertiesParser(CUSTOM_PVP_ANNOUNCE_CONFIG_FILE);
|
||||
|
||||
ANNOUNCE_PK_PVP = PvpAnnounce.getBoolean("AnnouncePkPvP", false);
|
||||
ANNOUNCE_PK_PVP_NORMAL_MESSAGE = PvpAnnounce.getBoolean("AnnouncePkPvPNormalMessage", true);
|
||||
ANNOUNCE_PK_MSG = PvpAnnounce.getString("AnnouncePkMsg", "$killer has slaughtered $target");
|
||||
@@ -3466,7 +3355,6 @@ public class Config
|
||||
|
||||
// Load PvpRewardItem config file (if exists)
|
||||
final PropertiesParser PvpRewardItem = new PropertiesParser(CUSTOM_PVP_REWARD_ITEM_CONFIG_FILE);
|
||||
|
||||
REWARD_PVP_ITEM = PvpRewardItem.getBoolean("RewardPvpItem", false);
|
||||
REWARD_PVP_ITEM_ID = PvpRewardItem.getInt("RewardPvpItemId", 57);
|
||||
REWARD_PVP_ITEM_AMOUNT = PvpRewardItem.getInt("RewardPvpItemAmount", 1000);
|
||||
@@ -3480,7 +3368,6 @@ public class Config
|
||||
|
||||
// Load PvpRewardItem config file (if exists)
|
||||
final PropertiesParser PvpTitleColor = new PropertiesParser(CUSTOM_PVP_TITLE_CONFIG_FILE);
|
||||
|
||||
PVP_COLOR_SYSTEM_ENABLED = PvpTitleColor.getBoolean("EnablePvPColorSystem", false);
|
||||
PVP_AMOUNT1 = PvpTitleColor.getInt("PvpAmount1", 500);
|
||||
PVP_AMOUNT2 = PvpTitleColor.getInt("PvpAmount2", 1000);
|
||||
@@ -3500,7 +3387,6 @@ public class Config
|
||||
|
||||
// Load RandomSpawns config file (if exists)
|
||||
final PropertiesParser RandomSpawns = new PropertiesParser(CUSTOM_RANDOM_SPAWNS_CONFIG_FILE);
|
||||
|
||||
ENABLE_RANDOM_MONSTER_SPAWNS = RandomSpawns.getBoolean("EnableRandomMonsterSpawns", false);
|
||||
MOB_MAX_SPAWN_RANGE = RandomSpawns.getInt("MaxSpawnMobRange", 150);
|
||||
MOB_MIN_SPAWN_RANGE = MOB_MAX_SPAWN_RANGE * -1;
|
||||
@@ -3516,19 +3402,16 @@ public class Config
|
||||
|
||||
// Load SayuneForAll config file (if exists)
|
||||
final PropertiesParser SayuneForAll = new PropertiesParser(CUSTOM_SAYUNE_FOR_ALL_CONFIG_FILE);
|
||||
|
||||
FREE_JUMPS_FOR_ALL = SayuneForAll.getBoolean("FreeJumpsForAll", false);
|
||||
|
||||
// Load ScreenWelcomeMessage config file (if exists)
|
||||
final PropertiesParser ScreenWelcomeMessage = new PropertiesParser(CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE);
|
||||
|
||||
WELCOME_MESSAGE_ENABLED = ScreenWelcomeMessage.getBoolean("ScreenWelcomeMessageEnable", false);
|
||||
WELCOME_MESSAGE_TEXT = ScreenWelcomeMessage.getString("ScreenWelcomeMessageText", "Welcome to our server!");
|
||||
WELCOME_MESSAGE_TIME = ScreenWelcomeMessage.getInt("ScreenWelcomeMessageTime", 10) * 1000;
|
||||
|
||||
// Load SellBuffs config file (if exists)
|
||||
final PropertiesParser SellBuffs = new PropertiesParser(CUSTOM_SELL_BUFFS_CONFIG_FILE);
|
||||
|
||||
SELLBUFF_ENABLED = SellBuffs.getBoolean("SellBuffEnable", false);
|
||||
SELLBUFF_MP_MULTIPLER = SellBuffs.getInt("MpCostMultipler", 1);
|
||||
SELLBUFF_PAYMENT_ID = SellBuffs.getInt("PaymentID", 57);
|
||||
@@ -3538,12 +3421,10 @@ public class Config
|
||||
|
||||
// Load ServerTime config file (if exists)
|
||||
final PropertiesParser ServerTime = new PropertiesParser(CUSTOM_SERVER_TIME_CONFIG_FILE);
|
||||
|
||||
DISPLAY_SERVER_TIME = ServerTime.getBoolean("DisplayServerTime", false);
|
||||
|
||||
// Load StartingLocation config file (if exists)
|
||||
final PropertiesParser StartingLocation = new PropertiesParser(CUSTOM_STARTING_LOCATION_CONFIG_FILE);
|
||||
|
||||
CUSTOM_STARTING_LOC = StartingLocation.getBoolean("CustomStartingLocation", false);
|
||||
CUSTOM_STARTING_LOC_X = StartingLocation.getInt("CustomStartingLocX", 50821);
|
||||
CUSTOM_STARTING_LOC_Y = StartingLocation.getInt("CustomStartingLocY", 186527);
|
||||
@@ -3551,7 +3432,6 @@ public class Config
|
||||
|
||||
// Load VoteReward config file (if exists)
|
||||
final PropertiesParser VoteReward = new PropertiesParser(CUSTOM_VOTE_REWARD_CONFIG_FILE);
|
||||
|
||||
// L2network.eu
|
||||
ALLOW_NETWORK_VOTE_REWARD = VoteReward.getBoolean("AllowNetworkVoteReward", false);
|
||||
NETWORK_SERVER_LINK = VoteReward.getString("NetworkServerLink", "");
|
||||
@@ -3611,19 +3491,15 @@ public class Config
|
||||
|
||||
// Load WalkerBotProtection config file (if exists)
|
||||
final PropertiesParser WalkerBotProtection = new PropertiesParser(CUSTOM_WALKER_BOT_PROTECTION_CONFIG_FILE);
|
||||
|
||||
L2WALKER_PROTECTION = WalkerBotProtection.getBoolean("L2WalkerProtection", false);
|
||||
}
|
||||
else if (SERVER_MODE == ServerMode.LOGIN)
|
||||
{
|
||||
final PropertiesParser ServerSettings = new PropertiesParser(LOGIN_CONFIG_FILE);
|
||||
|
||||
GAME_SERVER_LOGIN_HOST = ServerSettings.getString("LoginHostname", "127.0.0.1");
|
||||
GAME_SERVER_LOGIN_PORT = ServerSettings.getInt("LoginPort", 9013);
|
||||
|
||||
LOGIN_BIND_ADDRESS = ServerSettings.getString("LoginserverHostname", "0.0.0.0");
|
||||
PORT_LOGIN = ServerSettings.getInt("LoginserverPort", 2106);
|
||||
|
||||
try
|
||||
{
|
||||
DATAPACK_ROOT = new File(ServerSettings.getString("DatapackRoot", ".").replaceAll("\\\\", "/")).getCanonicalFile();
|
||||
@@ -3633,37 +3509,28 @@ public class Config
|
||||
LOGGER.log(Level.WARNING, "Error setting datapack root!", e);
|
||||
DATAPACK_ROOT = new File(".");
|
||||
}
|
||||
|
||||
ACCEPT_NEW_GAMESERVER = ServerSettings.getBoolean("AcceptNewGameServer", true);
|
||||
|
||||
LOGIN_TRY_BEFORE_BAN = ServerSettings.getInt("LoginTryBeforeBan", 5);
|
||||
LOGIN_BLOCK_AFTER_BAN = ServerSettings.getInt("LoginBlockAfterBan", 900);
|
||||
|
||||
LOGIN_SERVER_SCHEDULE_RESTART = ServerSettings.getBoolean("LoginRestartSchedule", false);
|
||||
LOGIN_SERVER_SCHEDULE_RESTART_TIME = ServerSettings.getLong("LoginRestartTime", 24);
|
||||
|
||||
DATABASE_DRIVER = ServerSettings.getString("Driver", "org.mariadb.jdbc.Driver");
|
||||
DATABASE_URL = ServerSettings.getString("URL", "jdbc:mariadb://localhost/l2jls");
|
||||
DATABASE_LOGIN = ServerSettings.getString("Login", "root");
|
||||
DATABASE_PASSWORD = ServerSettings.getString("Password", "");
|
||||
DATABASE_MAX_CONNECTIONS = ServerSettings.getInt("MaximumDbConnections", 10);
|
||||
|
||||
BACKUP_DATABASE = ServerSettings.getBoolean("BackupDatabase", false);
|
||||
MYSQL_BIN_PATH = ServerSettings.getString("MySqlBinLocation", "C:/xampp/mysql/bin/");
|
||||
BACKUP_PATH = ServerSettings.getString("BackupPath", "../backup/");
|
||||
BACKUP_DAYS = ServerSettings.getInt("BackupDays", 30);
|
||||
|
||||
SHOW_LICENCE = ServerSettings.getBoolean("ShowLicence", true);
|
||||
SHOW_PI_AGREEMENT = ServerSettings.getBoolean("ShowPIAgreement", false);
|
||||
|
||||
AUTO_CREATE_ACCOUNTS = ServerSettings.getBoolean("AutoCreateAccounts", true);
|
||||
|
||||
FLOOD_PROTECTION = ServerSettings.getBoolean("EnableFloodProtection", true);
|
||||
FAST_CONNECTION_LIMIT = ServerSettings.getInt("FastConnectionLimit", 15);
|
||||
NORMAL_CONNECTION_TIME = ServerSettings.getInt("NormalConnectionTime", 700);
|
||||
FAST_CONNECTION_TIME = ServerSettings.getInt("FastConnectionTime", 350);
|
||||
MAX_CONNECTION_PER_IP = ServerSettings.getInt("MaxConnectionPerIP", 50);
|
||||
|
||||
ENABLE_CMD_LINE_LOGIN = ServerSettings.getBoolean("EnableCmdLineLogin", false);
|
||||
ONLY_CMD_LINE_LOGIN = ServerSettings.getBoolean("OnlyCmdLineLogin", false);
|
||||
}
|
||||
@@ -3905,8 +3772,7 @@ public class Config
|
||||
LOGGER.info("Network Config: ipconfig.xml exists using manual configuration...");
|
||||
parseFile(new File(IPCONFIG_FILE));
|
||||
}
|
||||
else
|
||||
// Auto configuration...
|
||||
else // Auto configuration...
|
||||
{
|
||||
LOGGER.info("Network Config: ipconfig.xml doesn't exists using automatic configuration...");
|
||||
autoIpConfig();
|
||||
@@ -3971,11 +3837,9 @@ public class Config
|
||||
try
|
||||
{
|
||||
final Enumeration<NetworkInterface> niList = NetworkInterface.getNetworkInterfaces();
|
||||
|
||||
while (niList.hasMoreElements())
|
||||
{
|
||||
final NetworkInterface ni = niList.nextElement();
|
||||
|
||||
if (!ni.isUp() || ni.isVirtual())
|
||||
{
|
||||
continue;
|
||||
|
@@ -80,7 +80,6 @@ public abstract class BaseRecievePacket
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": " + e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -536,7 +536,6 @@ public class CommonUtil
|
||||
}
|
||||
final char[] arr = str.toCharArray();
|
||||
final char c = arr[0];
|
||||
|
||||
if (Character.isLetter(c))
|
||||
{
|
||||
arr[0] = Character.toUpperCase(c);
|
||||
|
@@ -56,7 +56,6 @@ public class DeadLockDetector extends Thread
|
||||
try
|
||||
{
|
||||
final long[] ids = tmx.findDeadlockedThreads();
|
||||
|
||||
if (ids != null)
|
||||
{
|
||||
deadlock = true;
|
||||
|
@@ -33,7 +33,6 @@ public class IPSubnet
|
||||
_addr = InetAddress.getByName(input.substring(0, idx)).getAddress();
|
||||
_mask = getMask(Integer.parseInt(input.substring(idx + 1)), _addr.length);
|
||||
_isIPv4 = _addr.length == 4;
|
||||
|
||||
if (!applyMask(_addr))
|
||||
{
|
||||
throw new UnknownHostException(input);
|
||||
@@ -91,7 +90,6 @@ public class IPSubnet
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -129,7 +127,6 @@ public class IPSubnet
|
||||
{
|
||||
return applyMask(((InetAddress) o).getAddress());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -232,7 +232,6 @@ public class StringUtil
|
||||
public static void append(StringBuilder sbString, String... strings)
|
||||
{
|
||||
sbString.ensureCapacity(sbString.length() + getLength(strings));
|
||||
|
||||
for (String string : strings)
|
||||
{
|
||||
sbString.append(string);
|
||||
|
@@ -1153,7 +1153,6 @@ public class BlowfishEngine
|
||||
xr ^= func(xl) ^ P[15];
|
||||
xl ^= func(xr) ^ P[16];
|
||||
xr ^= P[17];
|
||||
|
||||
table[s] = xr;
|
||||
table[s + 1] = xl;
|
||||
xr = xl; // end of cycle swap
|
||||
@@ -1295,7 +1294,6 @@ public class BlowfishEngine
|
||||
{
|
||||
int xl = bytesTo32bits(src, srcIndex);
|
||||
int xr = bytesTo32bits(src, srcIndex + 4);
|
||||
|
||||
xl ^= P[0];
|
||||
xr ^= func(xl) ^ P[1];
|
||||
xl ^= func(xr) ^ P[2];
|
||||
@@ -1314,7 +1312,6 @@ public class BlowfishEngine
|
||||
xr ^= func(xl) ^ P[15];
|
||||
xl ^= func(xr) ^ P[16];
|
||||
xr ^= P[17];
|
||||
|
||||
bits32ToBytes(xr, dst, dstIndex);
|
||||
bits32ToBytes(xl, dst, dstIndex + 4);
|
||||
}
|
||||
@@ -1405,7 +1402,6 @@ public class BlowfishEngine
|
||||
{
|
||||
int xl = bytesTo32bits(src, srcIndex);
|
||||
int xr = bytesTo32bits(src, srcIndex + 4);
|
||||
|
||||
xl ^= P[17];
|
||||
xr ^= func(xl) ^ P[16];
|
||||
xl ^= func(xr) ^ P[15];
|
||||
@@ -1424,7 +1420,6 @@ public class BlowfishEngine
|
||||
xr ^= func(xl) ^ P[2];
|
||||
xl ^= func(xr) ^ P[1];
|
||||
xr ^= P[0];
|
||||
|
||||
bits32ToBytes(xr, dst, dstIndex);
|
||||
bits32ToBytes(xl, dst, dstIndex + 4);
|
||||
}
|
||||
|
@@ -173,7 +173,6 @@ public class LoginServerThread extends Thread
|
||||
lengthLo = in.read();
|
||||
lengthHi = in.read();
|
||||
length = (lengthHi * 256) + lengthLo;
|
||||
|
||||
if (lengthHi < 0)
|
||||
{
|
||||
LOGGER.finer(getClass().getSimpleName() + ": Login terminated the connection.");
|
||||
@@ -181,7 +180,6 @@ public class LoginServerThread extends Thread
|
||||
}
|
||||
|
||||
final byte[] incoming = new byte[length - 2];
|
||||
|
||||
int receivedBytes = 0;
|
||||
int newBytes = 0;
|
||||
int left = length - 2;
|
||||
@@ -201,7 +199,6 @@ public class LoginServerThread extends Thread
|
||||
// decrypt if we have a key
|
||||
_blowfish.decrypt(incoming, 0, incoming.length);
|
||||
checksumOk = NewCrypt.verifyChecksum(incoming);
|
||||
|
||||
if (!checksumOk)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": Incorrect packet checksum, ignoring packet (LS)");
|
||||
|
@@ -234,7 +234,6 @@ public class AttackableAI extends CreatureAI
|
||||
{
|
||||
final Location loc = npc.getSpawn();
|
||||
final int range = Config.MAX_DRIFT_RANGE;
|
||||
|
||||
if (!npc.isInsideRadius3D(loc, range + range))
|
||||
{
|
||||
intention = AI_INTENTION_ACTIVE;
|
||||
@@ -473,7 +472,6 @@ public class AttackableAI extends CreatureAI
|
||||
{
|
||||
// Get the hate level of the Attackable against this Creature target contained in _aggroList
|
||||
final int aggro = npc.getHating(hated);
|
||||
|
||||
if ((aggro + _globalAggro) > 0)
|
||||
{
|
||||
// Set the Creature movement type to run and send Server->Client packet ChangeMoveType to all others PlayerInstance
|
||||
@@ -516,7 +514,6 @@ public class AttackableAI extends CreatureAI
|
||||
{
|
||||
final int offset;
|
||||
final int minRadius = 30;
|
||||
|
||||
if (npc.isRaidMinion())
|
||||
{
|
||||
offset = 500; // for Raids - need correction
|
||||
@@ -580,7 +577,6 @@ public class AttackableAI extends CreatureAI
|
||||
int y1 = 0;
|
||||
int z1 = 0;
|
||||
final int range = Config.MAX_DRIFT_RANGE;
|
||||
|
||||
for (Skill sk : npc.getTemplate().getAISkills(AISkillScope.BUFF))
|
||||
{
|
||||
target = skillTargetReconsider(sk, true);
|
||||
@@ -595,7 +591,6 @@ public class AttackableAI extends CreatureAI
|
||||
x1 = npc.getSpawn().getX();
|
||||
y1 = npc.getSpawn().getY();
|
||||
z1 = npc.getSpawn().getZ();
|
||||
|
||||
if (!npc.isInsideRadius2D(x1, y1, 0, range))
|
||||
{
|
||||
npc.setReturningToSpawnPoint(true);
|
||||
@@ -612,7 +607,6 @@ public class AttackableAI extends CreatureAI
|
||||
|
||||
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
|
||||
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld());
|
||||
|
||||
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
|
||||
}
|
||||
}
|
||||
@@ -768,7 +762,6 @@ public class AttackableAI extends CreatureAI
|
||||
}
|
||||
|
||||
final int combinedCollision = collision + target.getTemplate().getCollisionRadius();
|
||||
|
||||
final List<Skill> aiSuicideSkills = npc.getTemplate().getAISkills(AISkillScope.SUICIDE);
|
||||
if (!aiSuicideSkills.isEmpty() && ((int) ((npc.getCurrentHp() / npc.getMaxHp()) * 100) < 30) && npc.hasSkillChance())
|
||||
{
|
||||
@@ -831,7 +824,6 @@ public class AttackableAI extends CreatureAI
|
||||
int posX = npc.getX();
|
||||
int posY = npc.getY();
|
||||
final int posZ = npc.getZ() + 30;
|
||||
|
||||
if (target.getX() < posX)
|
||||
{
|
||||
posX += 300;
|
||||
@@ -1139,7 +1131,6 @@ public class AttackableAI extends CreatureAI
|
||||
|
||||
// Check current target first.
|
||||
final int range = insideCastRange ? skill.getCastRange() + getActiveChar().getTemplate().getCollisionRadius() : 2000; // TODO need some forget range
|
||||
|
||||
Stream<Creature> stream;
|
||||
if (isBad)
|
||||
{
|
||||
@@ -1169,13 +1160,11 @@ public class AttackableAI extends CreatureAI
|
||||
|
||||
// Return any target.
|
||||
return stream.findFirst().orElse(null);
|
||||
|
||||
}
|
||||
|
||||
private Creature targetReconsider(boolean randomTarget)
|
||||
{
|
||||
final Attackable npc = getActiveChar();
|
||||
|
||||
if (randomTarget)
|
||||
{
|
||||
Stream<Creature> stream = npc.getAggroList().values().stream().map(AggroInfo::getAttacker).filter(this::checkTarget);
|
||||
@@ -1185,7 +1174,6 @@ public class AttackableAI extends CreatureAI
|
||||
{
|
||||
stream = Stream.concat(stream, World.getInstance().getVisibleObjectsInRange(npc, Creature.class, npc.getAggroRange(), this::checkTarget).stream());
|
||||
}
|
||||
|
||||
return stream.findAny().orElse(null);
|
||||
}
|
||||
|
||||
@@ -1296,7 +1284,6 @@ public class AttackableAI extends CreatureAI
|
||||
if (me.isMonster())
|
||||
{
|
||||
MonsterInstance master = (MonsterInstance) me;
|
||||
|
||||
if (master.hasMinions())
|
||||
{
|
||||
master.getMinionList().onAssist(me, attacker);
|
||||
@@ -1350,7 +1337,6 @@ public class AttackableAI extends CreatureAI
|
||||
if (me.isMonster())
|
||||
{
|
||||
MonsterInstance master = (MonsterInstance) me;
|
||||
|
||||
if (master.hasMinions())
|
||||
{
|
||||
master.getMinionList().onAssist(me, target);
|
||||
|
@@ -60,14 +60,12 @@ public class ControllableMobAI extends AttackableAI
|
||||
protected void thinkFollow()
|
||||
{
|
||||
final Attackable me = (Attackable) _actor;
|
||||
|
||||
if (!Util.checkIfInRange(MobGroupTable.FOLLOW_RANGE, me, getForcedTarget(), true))
|
||||
{
|
||||
final int signX = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int signY = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int randX = Rnd.get(MobGroupTable.FOLLOW_RANGE);
|
||||
final int randY = Rnd.get(MobGroupTable.FOLLOW_RANGE);
|
||||
|
||||
moveTo(getForcedTarget().getX() + (signX * randX), getForcedTarget().getY() + (signY * randY), getForcedTarget().getZ());
|
||||
}
|
||||
}
|
||||
@@ -154,7 +152,6 @@ public class ControllableMobAI extends AttackableAI
|
||||
{
|
||||
int maxRange = 0;
|
||||
// check distant skills
|
||||
|
||||
for (Skill sk : _actor.getAllSkills())
|
||||
{
|
||||
if (Util.checkIfInRange(sk.getCastRange(), _actor, target, true) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() > _actor.getStat().getMpConsume(sk)))
|
||||
@@ -196,14 +193,12 @@ public class ControllableMobAI extends AttackableAI
|
||||
final double dist2 = _actor.calculateDistanceSq2D(target);
|
||||
final int range = _actor.getPhysicalAttackRange() + _actor.getTemplate().getCollisionRadius() + target.getTemplate().getCollisionRadius();
|
||||
int maxRange = range;
|
||||
|
||||
if (!_actor.isMuted() && (dist2 > ((range + 20) * (range + 20))))
|
||||
{
|
||||
// check distant skills
|
||||
for (Skill sk : _actor.getAllSkills())
|
||||
{
|
||||
final int castRange = sk.getCastRange();
|
||||
|
||||
if (((castRange * castRange) >= dist2) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() > _actor.getStat().getMpConsume(sk)))
|
||||
{
|
||||
_actor.doCast(sk);
|
||||
@@ -236,14 +231,12 @@ public class ControllableMobAI extends AttackableAI
|
||||
final double dist2 = _actor.calculateDistanceSq2D(getForcedTarget());
|
||||
final int range = _actor.getPhysicalAttackRange() + _actor.getTemplate().getCollisionRadius() + getForcedTarget().getTemplate().getCollisionRadius();
|
||||
int maxRange = range;
|
||||
|
||||
if (!_actor.isMuted() && (dist2 > ((range + 20) * (range + 20))))
|
||||
{
|
||||
// check distant skills
|
||||
for (Skill sk : _actor.getAllSkills())
|
||||
{
|
||||
final int castRange = sk.getCastRange();
|
||||
|
||||
if (((castRange * castRange) >= dist2) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() > _actor.getStat().getMpConsume(sk)))
|
||||
{
|
||||
_actor.doCast(sk);
|
||||
@@ -303,14 +296,12 @@ public class ControllableMobAI extends AttackableAI
|
||||
final double dist2 = _actor.calculateDistanceSq2D(target);
|
||||
final int range = _actor.getPhysicalAttackRange() + _actor.getTemplate().getCollisionRadius() + target.getTemplate().getCollisionRadius();
|
||||
int maxRange = range;
|
||||
|
||||
if (!_actor.isMuted() && (dist2 > ((range + 20) * (range + 20))))
|
||||
{
|
||||
// check distant skills
|
||||
for (Skill sk : _actor.getAllSkills())
|
||||
{
|
||||
final int castRange = sk.getCastRange();
|
||||
|
||||
if (((castRange * castRange) >= dist2) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() > _actor.getStat().getMpConsume(sk)))
|
||||
{
|
||||
_actor.doCast(sk);
|
||||
@@ -326,7 +317,6 @@ public class ControllableMobAI extends AttackableAI
|
||||
|
||||
// Force mobs to attack anybody if confused.
|
||||
Creature hated;
|
||||
|
||||
if (_actor.isConfused())
|
||||
{
|
||||
hated = findNextRndTarget();
|
||||
@@ -352,7 +342,6 @@ public class ControllableMobAI extends AttackableAI
|
||||
for (Skill sk : _actor.getAllSkills())
|
||||
{
|
||||
final int castRange = sk.getCastRange();
|
||||
|
||||
if (((castRange * castRange) >= dist2) && !_actor.isSkillDisabled(sk) && (_actor.getCurrentMp() < _actor.getStat().getMpConsume(sk)))
|
||||
{
|
||||
_actor.doCast(sk);
|
||||
@@ -369,7 +358,6 @@ public class ControllableMobAI extends AttackableAI
|
||||
protected void thinkActive()
|
||||
{
|
||||
Creature hated;
|
||||
|
||||
if (_actor.isConfused())
|
||||
{
|
||||
hated = findNextRndTarget();
|
||||
@@ -394,7 +382,6 @@ public class ControllableMobAI extends AttackableAI
|
||||
return false;
|
||||
}
|
||||
final Attackable me = (Attackable) _actor;
|
||||
|
||||
if (target.isNpc() || target.isDoor())
|
||||
{
|
||||
return false;
|
||||
|
@@ -258,7 +258,6 @@ public class CreatureAI extends AbstractAI
|
||||
|
||||
// Launch the Think Event
|
||||
notifyEvent(CtrlEvent.EVT_THINK, null);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -890,17 +889,13 @@ public class CreatureAI extends AbstractAI
|
||||
|
||||
final double dx = worldPosition.getX() - x;
|
||||
final double dy = worldPosition.getY() - y;
|
||||
|
||||
double dist = Math.hypot(dx, dy);
|
||||
|
||||
final double sin = dy / dist;
|
||||
final double cos = dx / dist;
|
||||
|
||||
dist -= offset - 5;
|
||||
|
||||
x += (int) (dist * cos);
|
||||
y += (int) (dist * sin);
|
||||
|
||||
moveTo(x, y, worldPosition.getZ());
|
||||
return true;
|
||||
}
|
||||
@@ -1186,7 +1181,6 @@ public class CreatureAI extends AbstractAI
|
||||
}
|
||||
final int castRange = sk.getCastRange();
|
||||
boolean hasLongRangeDamageSkill = false;
|
||||
|
||||
if (sk.isContinuous())
|
||||
{
|
||||
if (!sk.isDebuff())
|
||||
|
@@ -67,7 +67,6 @@ public class DoppelgangerAI extends CreatureAI
|
||||
{
|
||||
final WorldObject target = getTarget();
|
||||
final Creature attackTarget = (target != null) && target.isCreature() ? (Creature) target : null;
|
||||
|
||||
if (checkTargetLostOrDead(attackTarget))
|
||||
{
|
||||
setTarget(null);
|
||||
@@ -89,7 +88,6 @@ public class DoppelgangerAI extends CreatureAI
|
||||
}
|
||||
|
||||
final WorldObject target = _skill.getTarget(_actor, _forceUse, _dontMove, false);
|
||||
|
||||
if (checkTargetLost(target))
|
||||
{
|
||||
setTarget(null);
|
||||
@@ -244,7 +242,6 @@ public class DoppelgangerAI extends CreatureAI
|
||||
setTarget(pawn);
|
||||
_moveToPawnTimeout = GameTimeController.getInstance().getGameTicks();
|
||||
_moveToPawnTimeout += 1000 / GameTimeController.MILLIS_IN_TICK;
|
||||
|
||||
if (pawn == null)
|
||||
{
|
||||
return;
|
||||
@@ -254,7 +251,6 @@ public class DoppelgangerAI extends CreatureAI
|
||||
// _actor.moveToLocation(pawn.getX(), pawn.getY(), pawn.getZ(), offset);
|
||||
final Location loc = new Location(pawn.getX() + Rnd.get(-offset, offset), pawn.getY() + Rnd.get(-offset, offset), pawn.getZ());
|
||||
_actor.moveToLocation(loc.getX(), loc.getY(), loc.getZ(), 0);
|
||||
|
||||
if (!_actor.isMoving())
|
||||
{
|
||||
clientActionFailed();
|
||||
|
@@ -109,11 +109,9 @@ public class FriendlyNpcAI extends AttackableAI
|
||||
}
|
||||
|
||||
final int collision = npc.getTemplate().getCollisionRadius();
|
||||
|
||||
setTarget(originalAttackTarget);
|
||||
|
||||
final int combinedCollision = collision + originalAttackTarget.getTemplate().getCollisionRadius();
|
||||
|
||||
if (!npc.isMovementDisabled() && (Rnd.get(100) <= 3))
|
||||
{
|
||||
for (Attackable nearby : World.getInstance().getVisibleObjects(npc, Attackable.class))
|
||||
@@ -160,7 +158,6 @@ public class FriendlyNpcAI extends AttackableAI
|
||||
int posX = npc.getX();
|
||||
int posY = npc.getY();
|
||||
final int posZ = npc.getZ() + 30;
|
||||
|
||||
if (originalAttackTarget.getX() < posX)
|
||||
{
|
||||
posX += 300;
|
||||
|
@@ -64,7 +64,6 @@ public class PlayerAI extends PlayableAI
|
||||
{
|
||||
final Object localArg0 = args.length > 0 ? args[0] : null;
|
||||
final Object localArg1 = args.length > 1 ? args[1] : null;
|
||||
|
||||
final Object globalArg0 = (_intentionArgs != null) && (_intentionArgs.length > 0) ? _intentionArgs[0] : null;
|
||||
final Object globalArg1 = (_intentionArgs != null) && (_intentionArgs.length > 1) ? _intentionArgs[1] : null;
|
||||
|
||||
@@ -240,7 +239,6 @@ public class PlayerAI extends PlayableAI
|
||||
{
|
||||
_clientMovingToPawnOffset = 0;
|
||||
_clientMoving = false;
|
||||
|
||||
super.clientNotifyDead();
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,6 @@ public class SummonAI extends PlayableAI implements Runnable
|
||||
{
|
||||
final WorldObject target = getTarget();
|
||||
final Creature attackTarget = (target != null) && target.isCreature() ? (Creature) target : null;
|
||||
|
||||
if (checkTargetLostOrDead(attackTarget))
|
||||
{
|
||||
setTarget(null);
|
||||
@@ -286,13 +285,11 @@ public class SummonAI extends PlayableAI implements Runnable
|
||||
if (_startAvoid)
|
||||
{
|
||||
_startAvoid = false;
|
||||
|
||||
if (!_clientMoving && !_actor.isDead() && !_actor.isMovementDisabled() && (_actor.getMoveSpeed() > 0))
|
||||
{
|
||||
final int ownerX = ((Summon) _actor).getOwner().getX();
|
||||
final int ownerY = ((Summon) _actor).getOwner().getY();
|
||||
final double angle = Math.toRadians(Rnd.get(-90, 90)) + Math.atan2(ownerY - _actor.getY(), ownerX - _actor.getX());
|
||||
|
||||
final int targetX = ownerX + (int) (AVOID_RADIUS * Math.cos(angle));
|
||||
final int targetY = ownerY + (int) (AVOID_RADIUS * Math.sin(angle));
|
||||
if (GeoEngine.getInstance().canMoveToTarget(_actor.getX(), _actor.getY(), _actor.getZ(), targetX, targetY, _actor.getZ(), _actor.getInstanceWorld()))
|
||||
|
@@ -128,7 +128,6 @@ public class PostBBSManager extends BaseBBSManager
|
||||
final Post p = getGPosttByTopic(topic);
|
||||
final Locale locale = Locale.getDefault();
|
||||
final DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, locale);
|
||||
|
||||
String mes = p.getCPost(0).postTxt.replace(">", ">");
|
||||
mes = mes.replace("<", "<");
|
||||
|
||||
@@ -143,7 +142,6 @@ public class PostBBSManager extends BaseBBSManager
|
||||
final int idf = Integer.parseInt(st.nextToken());
|
||||
final int idt = Integer.parseInt(st.nextToken());
|
||||
final int idp = Integer.parseInt(st.nextToken());
|
||||
|
||||
final Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
|
||||
if (f == null)
|
||||
{
|
||||
|
@@ -236,7 +236,6 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
final StringBuilder html = new StringBuilder(2000);
|
||||
html.append("<html><body><br><br><table border=0 width=610><tr><td width=10></td><td width=600 align=left><a action=\"bypass _bbshome\">HOME</a> > <a action=\"bypass _bbsmemo\">Memo Form</a></td></tr></table><img src=\"L2UI.squareblank\" width=\"1\" height=\"10\"><center><table border=0 cellspacing=0 cellpadding=2 bgcolor=888888 width=610><tr><td FIXWIDTH=5></td><td FIXWIDTH=415 align=center>&$413;</td><td FIXWIDTH=120 align=center></td><td FIXWIDTH=70 align=center>&$418;</td></tr></table>");
|
||||
final DateFormat dateFormat = DateFormat.getInstance();
|
||||
|
||||
for (int i = 0, j = getMaxID(forum) + 1; i < (12 * index); j--)
|
||||
{
|
||||
if (j < 0)
|
||||
@@ -251,7 +250,6 @@ public class TopicBBSManager extends BaseBBSManager
|
||||
}
|
||||
|
||||
html.append("<br><table width=610 cellspace=0 cellpadding=0><tr><td width=50><button value=\"&$422;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"></td><td width=510 align=center><table border=0><tr>");
|
||||
|
||||
if (index == 1)
|
||||
{
|
||||
html.append("<td><button action=\"\" back=\"l2ui_ch3.prev1_down\" fore=\"l2ui_ch3.prev1\" width=16 height=16 ></td>");
|
||||
|
@@ -67,7 +67,6 @@ public class OfflineTraderTable
|
||||
stm1.execute();
|
||||
stm2.execute();
|
||||
con.setAutoCommit(false); // avoid halfway done
|
||||
|
||||
for (PlayerInstance pc : World.getInstance().getPlayers())
|
||||
{
|
||||
try
|
||||
@@ -195,14 +194,12 @@ public class OfflineTraderTable
|
||||
|
||||
final int typeId = rs.getInt("type");
|
||||
boolean isSellBuff = false;
|
||||
|
||||
if (typeId == PrivateStoreType.SELL_BUFFS.getId())
|
||||
{
|
||||
isSellBuff = true;
|
||||
}
|
||||
|
||||
final PrivateStoreType type = isSellBuff ? PrivateStoreType.PACKAGE_SELL : PrivateStoreType.findById(typeId);
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": PrivateStoreType with id " + rs.getInt("type") + " could not be found.");
|
||||
@@ -315,7 +312,6 @@ public class OfflineTraderTable
|
||||
}
|
||||
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + nTraders + " offline traders.");
|
||||
|
||||
if (!Config.STORE_OFFLINE_TRADE_IN_REALTIME)
|
||||
{
|
||||
try (Statement stm1 = con.createStatement())
|
||||
@@ -340,7 +336,6 @@ public class OfflineTraderTable
|
||||
PreparedStatement stm4 = con.prepareStatement(SAVE_OFFLINE_STATUS))
|
||||
{
|
||||
String title = null;
|
||||
|
||||
stm1.setInt(1, trader.getObjectId()); // Char Id
|
||||
stm1.execute();
|
||||
stm1.close();
|
||||
|
@@ -69,7 +69,6 @@ public class PetNameTable
|
||||
public boolean isValidPetName(String name)
|
||||
{
|
||||
boolean result = true;
|
||||
|
||||
if (!isAlphaNumeric(name))
|
||||
{
|
||||
return result;
|
||||
|
@@ -75,7 +75,6 @@ public class AlchemyData implements IXmlReader
|
||||
}
|
||||
|
||||
final AlchemyCraftData alchemyCraft = new AlchemyCraftData(set);
|
||||
|
||||
for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
|
||||
{
|
||||
if ("ingredients".equalsIgnoreCase(c.getNodeName()))
|
||||
@@ -99,7 +98,6 @@ public class AlchemyData implements IXmlReader
|
||||
final String type = b.getAttributes().getNamedItem("type").getNodeValue();
|
||||
final int prodId = Integer.parseInt(b.getAttributes().getNamedItem("id").getNodeValue());
|
||||
final int prodCount = Integer.parseInt(b.getAttributes().getNamedItem("count").getNodeValue());
|
||||
|
||||
if (type.equalsIgnoreCase("ON_SUCCESS"))
|
||||
{
|
||||
alchemyCraft.setProductionSuccess(new ItemHolder(prodId, prodCount));
|
||||
|
@@ -60,7 +60,6 @@ public class BeautyShopData implements IXmlReader
|
||||
Node att;
|
||||
Race race = null;
|
||||
Sex sex = null;
|
||||
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
@@ -86,7 +85,6 @@ public class BeautyShopData implements IXmlReader
|
||||
}
|
||||
|
||||
final BeautyData beautyData = new BeautyData();
|
||||
|
||||
for (Node a = b.getFirstChild(); a != null; a = a.getNextSibling())
|
||||
{
|
||||
if ("hair".equalsIgnoreCase(a.getNodeName()))
|
||||
@@ -99,7 +97,6 @@ public class BeautyShopData implements IXmlReader
|
||||
set.set(att.getNodeName(), att.getNodeValue());
|
||||
}
|
||||
final BeautyItem hair = new BeautyItem(set);
|
||||
|
||||
for (Node g = a.getFirstChild(); g != null; g = g.getNextSibling())
|
||||
{
|
||||
if ("color".equalsIgnoreCase(g.getNodeName()))
|
||||
|
@@ -118,7 +118,6 @@ public class BuyListData implements IXmlReader
|
||||
case "item":
|
||||
{
|
||||
final NamedNodeMap attrs = node.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final Item item = ItemTable.getInstance().getTemplate(itemId);
|
||||
if (item != null)
|
||||
@@ -127,7 +126,6 @@ public class BuyListData implements IXmlReader
|
||||
final long restockDelay = parseLong(attrs, "restock_delay", -1L);
|
||||
final long count = parseLong(attrs, "count", -1L);
|
||||
final int baseTax = parseInteger(attrs, "baseTax", defaultBaseTax);
|
||||
|
||||
buyList.addProduct(new Product(buyListId, item, price, restockDelay, count, baseTax));
|
||||
}
|
||||
else
|
||||
|
@@ -70,7 +70,6 @@ public class CastleData implements IXmlReader
|
||||
for (Node tpNode = castleNode.getFirstChild(); tpNode != null; tpNode = tpNode.getNextSibling())
|
||||
{
|
||||
final List<CastleSpawnHolder> spawns = new ArrayList<>();
|
||||
|
||||
if ("spawns".equals(tpNode.getNodeName()))
|
||||
{
|
||||
for (Node npcNode = tpNode.getFirstChild(); npcNode != null; npcNode = npcNode.getNextSibling())
|
||||
@@ -84,7 +83,6 @@ public class CastleData implements IXmlReader
|
||||
final int y = parseInteger(np, "y");
|
||||
final int z = parseInteger(np, "z");
|
||||
final int heading = parseInteger(np, "heading");
|
||||
|
||||
spawns.add(new CastleSpawnHolder(npcId, side, x, y, z, heading));
|
||||
}
|
||||
}
|
||||
@@ -93,7 +91,6 @@ public class CastleData implements IXmlReader
|
||||
else if ("siegeGuards".equals(tpNode.getNodeName()))
|
||||
{
|
||||
final List<SiegeGuardHolder> guards = new ArrayList<>();
|
||||
|
||||
for (Node npcNode = tpNode.getFirstChild(); npcNode != null; npcNode = npcNode.getNextSibling())
|
||||
{
|
||||
if ("guard".equals(npcNode.getNodeName()))
|
||||
@@ -104,7 +101,6 @@ public class CastleData implements IXmlReader
|
||||
final boolean stationary = parseBoolean(np, "stationary", false);
|
||||
final int npcId = parseInteger(np, "npcId");
|
||||
final int npcMaxAmount = parseInteger(np, "npcMaxAmount");
|
||||
|
||||
guards.add(new SiegeGuardHolder(castleId, itemId, type, stationary, npcId, npcMaxAmount));
|
||||
}
|
||||
}
|
||||
|
@@ -67,7 +67,6 @@ public class ClanHallData implements IXmlReader
|
||||
final List<Integer> npcs = new ArrayList<>();
|
||||
final List<ClanHallTeleportHolder> teleports = new ArrayList<>();
|
||||
final StatSet params = new StatSet();
|
||||
|
||||
for (Node listNode = doc.getFirstChild(); listNode != null; listNode = listNode.getNextSibling())
|
||||
{
|
||||
if ("list".equals(listNode.getNodeName()))
|
||||
@@ -80,7 +79,6 @@ public class ClanHallData implements IXmlReader
|
||||
params.set("name", parseString(clanHallNode.getAttributes(), "name", "None"));
|
||||
params.set("grade", parseEnum(clanHallNode.getAttributes(), ClanHallGrade.class, "grade", ClanHallGrade.GRADE_NONE));
|
||||
params.set("type", parseEnum(clanHallNode.getAttributes(), ClanHallType.class, "type", ClanHallType.OTHER));
|
||||
|
||||
for (Node tpNode = clanHallNode.getFirstChild(); tpNode != null; tpNode = tpNode.getNextSibling())
|
||||
{
|
||||
switch (tpNode.getNodeName())
|
||||
|
@@ -107,7 +107,6 @@ public class ClanMasteryData implements IXmlReader
|
||||
final int clanReputation = set.getInt("clanReputation");
|
||||
final int previousMastery = set.getInt("previousMastery", 0);
|
||||
final int previousMasteryAlt = set.getInt("previousMasteryAlt", 0);
|
||||
|
||||
_clanMasteryData.put(id, new ClanMasteryHolder(id, skill1, skill2, skill3, skill4, clanLevel, clanReputation, previousMastery, previousMasteryAlt));
|
||||
}));
|
||||
}
|
||||
|
@@ -63,7 +63,6 @@ public class ClanShopData implements IXmlReader
|
||||
final int count = set.getInt("count");
|
||||
final long adena = set.getLong("adena");
|
||||
final int fame = set.getInt("fame");
|
||||
|
||||
final Item item = ItemTable.getInstance().getTemplate(itemId);
|
||||
if (item == null)
|
||||
{
|
||||
|
@@ -63,7 +63,6 @@ public class DailyMissionData implements IXmlReader
|
||||
forEach(doc, "list", listNode -> forEach(listNode, "reward", rewardNode ->
|
||||
{
|
||||
final StatSet set = new StatSet(parseAttributes(rewardNode));
|
||||
|
||||
final List<ItemHolder> items = new ArrayList<>(1);
|
||||
forEach(rewardNode, "items", itemsNode -> forEach(itemsNode, "item", itemNode ->
|
||||
{
|
||||
|
@@ -66,10 +66,8 @@ public class ExperienceData implements IXmlReader
|
||||
{
|
||||
final Node table = doc.getFirstChild();
|
||||
final NamedNodeMap tableAttr = table.getAttributes();
|
||||
|
||||
MAX_LEVEL = (byte) (Byte.parseByte(tableAttr.getNamedItem("maxLevel").getNodeValue()) + 1);
|
||||
MAX_PET_LEVEL = (byte) (Byte.parseByte(tableAttr.getNamedItem("maxPetLevel").getNodeValue()) + 1);
|
||||
|
||||
if (MAX_LEVEL > Config.PLAYER_MAXIMUM_LEVEL)
|
||||
{
|
||||
MAX_LEVEL = Config.PLAYER_MAXIMUM_LEVEL;
|
||||
|
@@ -63,7 +63,6 @@ public class ExtendDropData implements IXmlReader
|
||||
forEach(doc, "list", listNode -> forEach(listNode, "drop", dropNode ->
|
||||
{
|
||||
final StatSet set = new StatSet(parseAttributes(dropNode));
|
||||
|
||||
final List<ExtendDropItemHolder> items = new ArrayList<>(1);
|
||||
forEach(dropNode, "items", itemsNode -> forEach(itemsNode, "item", itemNode ->
|
||||
{
|
||||
@@ -101,7 +100,6 @@ public class ExtendDropData implements IXmlReader
|
||||
systemMessages.put(amount, systemMessageId);
|
||||
}));
|
||||
set.set("systemMessages", systemMessages);
|
||||
|
||||
_extendDrop.put(set.getInt("id"), new ExtendDropDataHolder(set));
|
||||
}));
|
||||
}
|
||||
|
@@ -213,7 +213,6 @@ public class FenceData implements IXmlReader
|
||||
|
||||
final double xi = (((x3 - x4) * ((x1 * y2) - (y1 * x2))) - ((x1 - x2) * ((x3 * y4) - (y3 * x4)))) / d;
|
||||
final double yi = (((y3 - y4) * ((x1 * y2) - (y1 * x2))) - ((y1 - y2) * ((x3 * y4) - (y3 * x4)))) / d;
|
||||
|
||||
return new double[]
|
||||
{
|
||||
xi,
|
||||
|
@@ -110,7 +110,6 @@ public class FishingData implements IXmlReader
|
||||
final int waitMin = parseInteger(attrs, "waitMin");
|
||||
final int waitMax = parseInteger(attrs, "waitMax", waitMin);
|
||||
final boolean isPremiumOnly = parseBoolean(attrs, "isPremiumOnly", false);
|
||||
|
||||
if (ItemTable.getInstance().getTemplate(itemId) == null)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + itemId);
|
||||
@@ -126,7 +125,6 @@ public class FishingData implements IXmlReader
|
||||
final int cId = parseInteger(cAttrs, "itemId");
|
||||
final float cChance = parseFloat(cAttrs, "chance");
|
||||
final float cMultiplier = parseFloat(cAttrs, "multiplier", 1f);
|
||||
|
||||
if (ItemTable.getInstance().getTemplate(cId) == null)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + itemId);
|
||||
@@ -152,7 +150,6 @@ public class FishingData implements IXmlReader
|
||||
final int reduceFishingTime = parseInteger(attrs, "reduceFishingTime", 0);
|
||||
final float xpMultiplier = parseFloat(attrs, "xpMultiplier", 1f);
|
||||
final float spMultiplier = parseFloat(attrs, "spMultiplier", 1f);
|
||||
|
||||
if (ItemTable.getInstance().getTemplate(itemId) == null)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + itemId);
|
||||
|
@@ -146,12 +146,10 @@ public class ItemCrystallizationData implements IXmlReader
|
||||
}
|
||||
|
||||
final List<ItemChanceHolder> rewards = new ArrayList<>();
|
||||
|
||||
for (ItemChanceHolder reward : crystallizeRewards)
|
||||
{
|
||||
double chance = reward.getChance() * item.getCrystalCount();
|
||||
long count = reward.getCount();
|
||||
|
||||
if (chance > 100.)
|
||||
{
|
||||
final double countMul = Math.ceil(chance / 100.);
|
||||
@@ -168,7 +166,6 @@ public class ItemCrystallizationData implements IXmlReader
|
||||
private void generateCrystallizationData()
|
||||
{
|
||||
final int previousCount = _items.size();
|
||||
|
||||
for (Item item : ItemTable.getInstance().getAllItems())
|
||||
{
|
||||
// Check if the data has not been generated.
|
||||
|
@@ -63,13 +63,10 @@ public class MonsterBookData implements IXmlReader
|
||||
if ("card".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
|
||||
final int itemId = parseInteger(attrs, "id");
|
||||
final int monster = parseInteger(attrs, "monster");
|
||||
final String faction = parseString(attrs, "faction");
|
||||
|
||||
final MonsterBookCardHolder card = new MonsterBookCardHolder(itemId, monster, Faction.valueOf(faction));
|
||||
|
||||
if (NpcData.getInstance().getTemplate(monster) == null)
|
||||
{
|
||||
LOGGER.severe(getClass().getSimpleName() + ": Could not find NPC template with id " + monster + ".");
|
||||
@@ -80,12 +77,10 @@ public class MonsterBookData implements IXmlReader
|
||||
if ("rewards".equalsIgnoreCase(b.getNodeName()))
|
||||
{
|
||||
final NamedNodeMap rewardAttrs = b.getAttributes();
|
||||
|
||||
final int kills = parseInteger(rewardAttrs, "kills");
|
||||
final Long exp = parseLong(rewardAttrs, "exp");
|
||||
final int sp = parseInteger(rewardAttrs, "sp");
|
||||
final int points = parseInteger(rewardAttrs, "points");
|
||||
|
||||
card.addReward(new MonsterBookRewardHolder(kills, exp, sp, points));
|
||||
}
|
||||
}
|
||||
|
@@ -101,7 +101,6 @@ public class MultisellData implements IXmlReader
|
||||
final List<ItemChanceHolder> ingredients = new ArrayList<>(1);
|
||||
final List<ItemChanceHolder> products = new ArrayList<>(1);
|
||||
final MultisellEntryHolder entry = new MultisellEntryHolder(ingredients, products);
|
||||
|
||||
for (Node d = itemNode.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
if ("ingredient".equalsIgnoreCase(d.getNodeName()))
|
||||
@@ -111,7 +110,6 @@ public class MultisellData implements IXmlReader
|
||||
final byte enchantmentLevel = parseByte(d.getAttributes(), "enchantmentLevel", (byte) 0);
|
||||
final Boolean maintainIngredient = parseBoolean(d.getAttributes(), "maintainIngredient", false);
|
||||
final ItemChanceHolder ingredient = new ItemChanceHolder(id, 0, count, enchantmentLevel, maintainIngredient);
|
||||
|
||||
if (itemExists(ingredient))
|
||||
{
|
||||
ingredients.add(ingredient);
|
||||
@@ -185,7 +183,6 @@ public class MultisellData implements IXmlReader
|
||||
|
||||
set.set("listId", listId);
|
||||
set.set("entries", entries);
|
||||
|
||||
_multisells.put(listId, new MultisellListHolder(set));
|
||||
});
|
||||
}
|
||||
@@ -265,7 +262,6 @@ public class MultisellData implements IXmlReader
|
||||
index += PAGE_SIZE;
|
||||
}
|
||||
while (index < list.getEntries().size());
|
||||
|
||||
player.setMultiSell(list);
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,6 @@ public class NpcData implements IXmlReader
|
||||
|
||||
parseDatapackDirectory("data/stats/npcs", false);
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _npcs.size() + " NPCs.");
|
||||
|
||||
if (Config.CUSTOM_NPC_DATA)
|
||||
{
|
||||
final int npcCount = _npcs.size();
|
||||
|
@@ -64,11 +64,9 @@ public class PetSkillData implements IXmlReader
|
||||
if ("skill".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
final NamedNodeMap attrs = d.getAttributes();
|
||||
|
||||
final int npcId = parseInteger(attrs, "npcId");
|
||||
final int skillId = parseInteger(attrs, "skillId");
|
||||
final int skillLvl = parseInteger(attrs, "skillLvl");
|
||||
|
||||
Map<Long, SkillHolder> skillTree = _skillTrees.get(npcId);
|
||||
if (skillTree == null)
|
||||
{
|
||||
|
@@ -70,7 +70,6 @@ public class PlayerTemplateData implements IXmlReader
|
||||
{
|
||||
NamedNodeMap attrs;
|
||||
int classId = 0;
|
||||
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
@@ -86,7 +85,6 @@ public class PlayerTemplateData implements IXmlReader
|
||||
final StatSet set = new StatSet();
|
||||
set.set("classId", classId);
|
||||
final List<Location> creationPoints = new ArrayList<>();
|
||||
|
||||
for (Node nd = d.getFirstChild(); nd != null; nd = nd.getNextSibling())
|
||||
{
|
||||
// Skip odd nodes
|
||||
@@ -146,7 +144,6 @@ public class PlayerTemplateData implements IXmlReader
|
||||
// calculate total pdef and mdef from parts
|
||||
set.set("basePDef", (set.getInt("basePDefchest", 0) + set.getInt("basePDeflegs", 0) + set.getInt("basePDefhead", 0) + set.getInt("basePDeffeet", 0) + set.getInt("basePDefgloves", 0) + set.getInt("basePDefunderwear", 0) + set.getInt("basePDefcloak", 0) + set.getInt("basePDefhair", 0)));
|
||||
set.set("baseMDef", (set.getInt("baseMDefrear", 0) + set.getInt("baseMDeflear", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefneck", 0)));
|
||||
|
||||
_playerTemplates.put(ClassId.getClassId(classId), new PlayerTemplate(set, creationPoints));
|
||||
}
|
||||
else if ("lvlUpgainData".equalsIgnoreCase(d.getNodeName()))
|
||||
|
@@ -99,7 +99,6 @@ public class PrimeShopData implements IXmlReader
|
||||
|
||||
final int itemId = parseInteger(attrs, "itemId");
|
||||
final int count = parseInteger(attrs, "count");
|
||||
|
||||
final Item item = ItemTable.getInstance().getTemplate(itemId);
|
||||
if (item == null)
|
||||
{
|
||||
@@ -122,7 +121,6 @@ public class PrimeShopData implements IXmlReader
|
||||
public void showProductInfo(PlayerInstance player, int brId)
|
||||
{
|
||||
final PrimeShopGroup item = _primeItems.get(brId);
|
||||
|
||||
if ((player == null) || (item == null))
|
||||
{
|
||||
return;
|
||||
|
@@ -83,7 +83,6 @@ public class SayuneData implements IXmlReader
|
||||
final int x = parseInteger(attrs, "x");
|
||||
final int y = parseInteger(attrs, "y");
|
||||
final int z = parseInteger(attrs, "z");
|
||||
|
||||
parseEntries(lastEntry.addInnerEntry(new SayuneEntry("selector".equals(d.getNodeName()), id, x, y, z)), d);
|
||||
}
|
||||
}
|
||||
|
@@ -112,7 +112,6 @@ public class ShuttleData implements IXmlReader
|
||||
{
|
||||
attrs = a.getAttributes();
|
||||
final ShuttleStop stop = new ShuttleStop(parseInteger(attrs, "id"));
|
||||
|
||||
for (Node z = a.getFirstChild(); z != null; z = z.getNextSibling())
|
||||
{
|
||||
if ("dimension".equalsIgnoreCase(z.getNodeName()))
|
||||
@@ -186,7 +185,6 @@ public class ShuttleData implements IXmlReader
|
||||
return shuttle;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -188,12 +188,9 @@ public class SkillData implements IXmlReader
|
||||
public List<Skill> getSiegeSkills(boolean addNoble, boolean hasCastle)
|
||||
{
|
||||
final List<Skill> temp = new LinkedList<>();
|
||||
|
||||
temp.add(_skills.get(getSkillHashCode(CommonSkill.IMPRIT_OF_LIGHT.getId(), 1)));
|
||||
temp.add(_skills.get(getSkillHashCode(CommonSkill.IMPRIT_OF_DARKNESS.getId(), 1)));
|
||||
|
||||
temp.add(_skills.get(getSkillHashCode(247, 1))); // Build Headquarters
|
||||
|
||||
if (addNoble)
|
||||
{
|
||||
temp.add(_skills.get(getSkillHashCode(326, 1))); // Build Advanced Headquarters
|
||||
@@ -243,7 +240,6 @@ public class SkillData implements IXmlReader
|
||||
final Map<Integer, Set<Integer>> levels = new HashMap<>();
|
||||
final Map<Integer, Map<Integer, StatSet>> skillInfo = new HashMap<>();
|
||||
final StatSet generalSkillInfo = skillInfo.computeIfAbsent(-1, k -> new HashMap<>()).computeIfAbsent(-1, k -> new StatSet());
|
||||
|
||||
parseAttributes(attributes, "", generalSkillInfo);
|
||||
|
||||
final Map<String, Map<Integer, Map<Integer, Object>>> variableValues = new HashMap<>();
|
||||
@@ -309,7 +305,6 @@ public class SkillData implements IXmlReader
|
||||
|
||||
final int fromLevel = generalSkillInfo.getInt(".fromLevel", 1);
|
||||
final int toLevel = generalSkillInfo.getInt(".toLevel", 0);
|
||||
|
||||
for (int i = fromLevel; i <= toLevel; i++)
|
||||
{
|
||||
levels.computeIfAbsent(i, k -> new HashSet<>()).add(0);
|
||||
|
@@ -130,7 +130,6 @@ public class SkillTreeData implements IXmlReader
|
||||
public void load()
|
||||
{
|
||||
_loading = true;
|
||||
|
||||
_classSkillTrees.clear();
|
||||
_collectSkillTree.clear();
|
||||
_fishingSkillTree.clear();
|
||||
@@ -189,7 +188,6 @@ public class SkillTreeData implements IXmlReader
|
||||
final Map<Long, SkillLearn> transferSkillTree = new HashMap<>();
|
||||
final Map<Long, SkillLearn> raceSkillTree = new HashMap<>();
|
||||
final Map<Long, SkillLearn> revelationSkillTree = new HashMap<>();
|
||||
|
||||
type = d.getAttributes().getNamedItem("type").getNodeValue();
|
||||
attr = d.getAttributes().getNamedItem("classId");
|
||||
if (attr != null)
|
||||
@@ -240,7 +238,6 @@ public class SkillTreeData implements IXmlReader
|
||||
|
||||
// test if skill exists
|
||||
SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel());
|
||||
|
||||
for (Node b = c.getFirstChild(); b != null; b = b.getNextSibling())
|
||||
{
|
||||
attrs = b.getAttributes();
|
||||
@@ -657,7 +654,6 @@ public class SkillTreeData implements IXmlReader
|
||||
{
|
||||
final List<SkillLearn> result = new LinkedList<>();
|
||||
final Map<Long, SkillLearn> skills = getCompleteClassSkillTree(classId);
|
||||
|
||||
if (skills.isEmpty())
|
||||
{
|
||||
// The Skill Tree for this class is undefined.
|
||||
@@ -666,11 +662,9 @@ public class SkillTreeData implements IXmlReader
|
||||
}
|
||||
|
||||
final boolean isAwaken = player.isInCategory(CategoryType.SIXTH_CLASS_GROUP) && ((player.getRace() != Race.ERTHEIA) || player.isDualClassActive());
|
||||
|
||||
for (Entry<Long, SkillLearn> entry : skills.entrySet())
|
||||
{
|
||||
final SkillLearn skill = entry.getValue();
|
||||
|
||||
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && (!Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet) && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()) || (!includeByFp && (skill.getSkillId() > 11399) && (skill.getSkillId() < 11405)) || isRemoveSkill(classId, skill.getSkillId()))
|
||||
{
|
||||
continue;
|
||||
@@ -801,7 +795,6 @@ public class SkillTreeData implements IXmlReader
|
||||
|
||||
final int maxLvl = SkillData.getInstance().getMaxLevel(skill.getSkillId());
|
||||
final long hashCode = SkillData.getSkillHashCode(skill.getSkillId(), maxLvl);
|
||||
|
||||
if (skill.isAutoGet() && (player.getLevel() >= skill.getGetLevel()))
|
||||
{
|
||||
final Skill oldSkill = player.getKnownSkill(skill.getSkillId());
|
||||
@@ -867,11 +860,9 @@ public class SkillTreeData implements IXmlReader
|
||||
{
|
||||
final List<SkillLearn> result = new ArrayList<>();
|
||||
final Map<Long, SkillLearn> revelationSkills = _revelationSkillTree.get(type);
|
||||
|
||||
for (SkillLearn skill : revelationSkills.values())
|
||||
{
|
||||
final Skill oldSkill = player.getSkills().get(skill.getSkillId());
|
||||
|
||||
if (oldSkill == null)
|
||||
{
|
||||
result.add(skill);
|
||||
@@ -900,13 +891,11 @@ public class SkillTreeData implements IXmlReader
|
||||
public List<SkillLearn> getAvailableAlchemySkills(PlayerInstance player)
|
||||
{
|
||||
final List<SkillLearn> result = new ArrayList<>();
|
||||
|
||||
for (SkillLearn skill : _alchemySkillTree.values())
|
||||
{
|
||||
if (skill.isLearnedByNpc() && (player.getLevel() >= skill.getGetLevel()))
|
||||
{
|
||||
final Skill oldSkill = player.getSkills().get(skill.getSkillId());
|
||||
|
||||
if (oldSkill != null)
|
||||
{
|
||||
if (oldSkill.getLevel() == (skill.getSkillLevel() - 1))
|
||||
@@ -958,7 +947,6 @@ public class SkillTreeData implements IXmlReader
|
||||
{
|
||||
final List<SkillLearn> result = new ArrayList<>();
|
||||
final ClassId classId = player.getClassId();
|
||||
|
||||
if (!_transferSkillTrees.containsKey(classId))
|
||||
{
|
||||
return result;
|
||||
@@ -1013,7 +1001,6 @@ public class SkillTreeData implements IXmlReader
|
||||
public List<SkillLearn> getAvailablePledgeSkills(Clan clan)
|
||||
{
|
||||
final List<SkillLearn> result = new ArrayList<>();
|
||||
|
||||
for (SkillLearn skill : _pledgeSkillTree.values())
|
||||
{
|
||||
if (!skill.isResidencialSkill() && (clan.getLevel() >= skill.getGetLevel()))
|
||||
@@ -1429,7 +1416,6 @@ public class SkillTreeData implements IXmlReader
|
||||
return result;
|
||||
}
|
||||
final int minLevelForNewSkill = getMinLevelForNewSkill(player, completeClassSkillTree);
|
||||
|
||||
if (minLevelForNewSkill > 0)
|
||||
{
|
||||
for (SkillLearn skill : completeClassSkillTree.values())
|
||||
@@ -1468,7 +1454,6 @@ public class SkillTreeData implements IXmlReader
|
||||
{
|
||||
final int maxLvl = SkillData.getInstance().getMaxLevel(skill.getId());
|
||||
final long hashCode = SkillData.getSkillHashCode(skill.getId(), maxLvl);
|
||||
|
||||
if (!isCurrentClassSkillNoParent(player.getClassId(), hashCode) && !isRemoveSkill(player.getClassId(), skill.getId()) && !isAwakenSaveSkill(player.getClassId(), skill.getId()) && !isAlchemySkill(skill.getId(), skill.getLevel()))
|
||||
{
|
||||
// Do not remove equipped item skills.
|
||||
@@ -1700,7 +1685,6 @@ public class SkillTreeData implements IXmlReader
|
||||
|
||||
final int maxLvl = SkillData.getInstance().getMaxLevel(skill.getId());
|
||||
final long hashCode = SkillData.getSkillHashCode(skill.getId(), Math.min(skill.getLevel(), maxLvl));
|
||||
|
||||
if (Arrays.binarySearch(_skillsByClassIdHashCodes.get(player.getClassId().getId()), hashCode) >= 0)
|
||||
{
|
||||
return true;
|
||||
|
@@ -96,7 +96,6 @@ public class SpawnData implements IXmlReader
|
||||
}
|
||||
|
||||
LOGGER.info(getClass().getSimpleName() + ": Initializing spawns...");
|
||||
|
||||
if (Config.THREADS_FOR_LOADING)
|
||||
{
|
||||
final Collection<ScheduledFuture<?>> jobs = ConcurrentHashMap.newKeySet();
|
||||
@@ -215,7 +214,6 @@ public class SpawnData implements IXmlReader
|
||||
final String name = parseString(territoryNode.getAttributes(), "name", file.getName() + "_" + (spawnTemplate.getTerritories().size() + 1));
|
||||
final int minZ = parseInteger(territoryNode.getAttributes(), "minZ");
|
||||
final int maxZ = parseInteger(territoryNode.getAttributes(), "maxZ");
|
||||
|
||||
final List<Integer> xNodes = new ArrayList<>();
|
||||
final List<Integer> yNodes = new ArrayList<>();
|
||||
forEach(territoryNode, "node", node ->
|
||||
|
@@ -82,7 +82,6 @@ public class VariationData implements IXmlReader
|
||||
final String weaponTypeString = parseString(groupNode.getAttributes(), "weaponType").toUpperCase();
|
||||
final VariationWeaponType weaponType = VariationWeaponType.valueOf(weaponTypeString);
|
||||
final int order = parseInteger(groupNode.getAttributes(), "order");
|
||||
|
||||
final List<OptionDataCategory> sets = new ArrayList<>();
|
||||
forEach(groupNode, "optionCategory", categoryNode ->
|
||||
{
|
||||
|
@@ -124,7 +124,6 @@ public class BotReportTable
|
||||
final Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
||||
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
||||
|
||||
if (System.currentTimeMillis() < c.getTimeInMillis())
|
||||
{
|
||||
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) - 1);
|
||||
@@ -220,7 +219,6 @@ public class BotReportTable
|
||||
}
|
||||
|
||||
final Creature bot = ((Creature) target);
|
||||
|
||||
if ((!bot.isPlayer() && !bot.isFakePlayer()) || (bot.isFakePlayer() && !((Npc) bot).getTemplate().isFakePlayerTalkable()) || (target.getObjectId() == reporter.getObjectId()))
|
||||
{
|
||||
return false;
|
||||
@@ -304,14 +302,12 @@ public class BotReportTable
|
||||
}
|
||||
|
||||
final long curTime = System.currentTimeMillis();
|
||||
|
||||
if (rcd == null)
|
||||
{
|
||||
rcd = new ReportedCharData();
|
||||
_reports.put(bot.getObjectId(), rcd);
|
||||
}
|
||||
rcd.addReporter(reporterId, curTime);
|
||||
|
||||
if (rcdRep == null)
|
||||
{
|
||||
rcdRep = new ReporterCharData();
|
||||
@@ -422,7 +418,6 @@ public class BotReportTable
|
||||
final Calendar c = Calendar.getInstance();
|
||||
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
|
||||
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
|
||||
|
||||
if (System.currentTimeMillis() > c.getTimeInMillis())
|
||||
{
|
||||
c.set(Calendar.DAY_OF_YEAR, c.get(Calendar.DAY_OF_YEAR) + 1);
|
||||
@@ -456,7 +451,6 @@ public class BotReportTable
|
||||
{
|
||||
rawIp[i] = Integer.parseInt(rawByte[i]);
|
||||
}
|
||||
|
||||
return rawIp[0] | (rawIp[1] << 8) | (rawIp[2] << 16) | (rawIp[3] << 24);
|
||||
}
|
||||
|
||||
|
@@ -194,7 +194,6 @@ public class ItemTable
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return _allTemplates[id];
|
||||
}
|
||||
|
||||
@@ -214,7 +213,6 @@ public class ItemTable
|
||||
{
|
||||
// Create and Init the ItemInstance corresponding to the Item Identifier
|
||||
final ItemInstance item = new ItemInstance(IdFactory.getNextId(), itemId);
|
||||
|
||||
if (process.equalsIgnoreCase("loot") && !Config.AUTO_LOOT_ITEM_IDS.contains(itemId))
|
||||
{
|
||||
ScheduledFuture<?> itemLootShedule;
|
||||
|
@@ -70,7 +70,6 @@ public class DocumentEngine
|
||||
public Collection<Item> loadItems()
|
||||
{
|
||||
final Collection<Item> list = ConcurrentHashMap.newKeySet();
|
||||
|
||||
if (Config.THREADS_FOR_LOADING)
|
||||
{
|
||||
final Collection<ScheduledFuture<?>> jobs = ConcurrentHashMap.newKeySet();
|
||||
@@ -103,7 +102,6 @@ public class DocumentEngine
|
||||
list.addAll(document.getItemList());
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,6 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
|
||||
final String[] array = Config.PATHFIND_BUFFERS.split(";");
|
||||
_buffers = new BufferHolder[array.length];
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < array.length; i++)
|
||||
{
|
||||
@@ -99,7 +98,6 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
try
|
||||
{
|
||||
final Node result = buffer.findPath(gox, goy, goz, gtx, gty, gtz);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
return null;
|
||||
@@ -259,7 +257,6 @@ final class GeoEnginePathfinding extends GeoEngine
|
||||
{
|
||||
_size = size;
|
||||
_buffer = new ArrayList<>(count);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
_buffer.add(new NodeBuffer(size));
|
||||
|
@@ -37,7 +37,6 @@ public class BlockFlat extends ABlock
|
||||
{
|
||||
_height = bb.getShort();
|
||||
_nswe = format != GeoFormat.L2D ? 0x0F : (byte) (0xFF);
|
||||
|
||||
if (format == GeoFormat.L2OFF)
|
||||
{
|
||||
bb.getShort();
|
||||
|
@@ -71,7 +71,6 @@ public class BlockMultilayer extends ABlock
|
||||
{
|
||||
// get layer count for this cell
|
||||
final byte layers = format != GeoFormat.L2OFF ? bb.get() : (byte) bb.getShort();
|
||||
|
||||
if ((layers <= 0) || (layers > MAX_LAYERS))
|
||||
{
|
||||
throw new RuntimeException("Invalid layer count for MultilayerBlock");
|
||||
|
@@ -87,7 +87,6 @@ public class AdminCommandHandler implements IHandler<IAdminCommandHandler, Strin
|
||||
|
||||
final String command = fullCommand.split(" ")[0];
|
||||
final String commandNoPrefix = command.substring(6);
|
||||
|
||||
final IAdminCommandHandler handler = getHandler(command);
|
||||
if (handler == null)
|
||||
{
|
||||
|
@@ -55,20 +55,17 @@ public class AirShipManager
|
||||
npcDat.set("npcId", 9);
|
||||
npcDat.set("level", 0);
|
||||
npcDat.set("jClass", "boat");
|
||||
|
||||
npcDat.set("baseSTR", 0);
|
||||
npcDat.set("baseCON", 0);
|
||||
npcDat.set("baseDEX", 0);
|
||||
npcDat.set("baseINT", 0);
|
||||
npcDat.set("baseWIT", 0);
|
||||
npcDat.set("baseMEN", 0);
|
||||
|
||||
npcDat.set("baseShldDef", 0);
|
||||
npcDat.set("baseShldRate", 0);
|
||||
npcDat.set("baseAccCombat", 38);
|
||||
npcDat.set("baseEvasRate", 38);
|
||||
npcDat.set("baseCritRate", 38);
|
||||
|
||||
npcDat.set("collision_radius", 0);
|
||||
npcDat.set("collision_height", 0);
|
||||
npcDat.set("sex", "male");
|
||||
@@ -95,14 +92,12 @@ public class AirShipManager
|
||||
npcDat.set("basePDef", 100);
|
||||
npcDat.set("baseMDef", 100);
|
||||
_airShipTemplate = new CreatureTemplate(npcDat);
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
public AirShipInstance getNewAirShip(int x, int y, int z, int heading)
|
||||
{
|
||||
final AirShipInstance airShip = new AirShipInstance(_airShipTemplate);
|
||||
|
||||
airShip.setHeading(heading);
|
||||
airShip.setXYZInvisible(x, y, z);
|
||||
airShip.spawnMe();
|
||||
@@ -166,7 +161,6 @@ public class AirShipManager
|
||||
{
|
||||
final StatSet info = new StatSet();
|
||||
info.set("fuel", 600);
|
||||
|
||||
_airShipsInfo.put(ownerId, info);
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
|
@@ -157,7 +157,6 @@ public class AntiFeedManager
|
||||
|
||||
final Integer addrHash = client.getConnectionAddress().hashCode();
|
||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
||||
|
||||
if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS)
|
||||
{
|
||||
final String address = client.getConnectionAddress().getHostAddress();
|
||||
|
@@ -61,14 +61,12 @@ public class BoatManager
|
||||
npcDat.set("npcId", boatId);
|
||||
npcDat.set("level", 0);
|
||||
npcDat.set("jClass", "boat");
|
||||
|
||||
npcDat.set("baseSTR", 0);
|
||||
npcDat.set("baseCON", 0);
|
||||
npcDat.set("baseDEX", 0);
|
||||
npcDat.set("baseINT", 0);
|
||||
npcDat.set("baseWIT", 0);
|
||||
npcDat.set("baseMEN", 0);
|
||||
|
||||
npcDat.set("baseShldDef", 0);
|
||||
npcDat.set("baseShldRate", 0);
|
||||
npcDat.set("baseAccCombat", 38);
|
||||
|
@@ -152,7 +152,6 @@ public class CastleManager implements InstanceListManager
|
||||
{
|
||||
return _castleCirclets[castleId];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -173,7 +172,6 @@ public class CastleManager implements InstanceListManager
|
||||
}
|
||||
final PlayerInstance player = member.getPlayerInstance();
|
||||
final int circletId = getCircletByCastleId(castleId);
|
||||
|
||||
if (circletId != 0)
|
||||
{
|
||||
// online-player circlet removal
|
||||
|
@@ -90,7 +90,6 @@ public class CastleManorManager implements IXmlReader, IStorable
|
||||
final int hour = currentTime.get(Calendar.HOUR_OF_DAY);
|
||||
final int min = currentTime.get(Calendar.MINUTE);
|
||||
final int maintenanceMin = Config.ALT_MANOR_REFRESH_MIN + Config.ALT_MANOR_MAINTENANCE_MIN;
|
||||
|
||||
if (((hour >= Config.ALT_MANOR_REFRESH_TIME) && (min >= maintenanceMin)) || (hour < Config.ALT_MANOR_APPROVE_TIME) || ((hour == Config.ALT_MANOR_APPROVE_TIME) && (min <= Config.ALT_MANOR_APPROVE_MIN)))
|
||||
{
|
||||
_mode = ManorMode.MODIFIABLE;
|
||||
@@ -144,7 +143,6 @@ public class CastleManorManager implements IXmlReader, IStorable
|
||||
{
|
||||
set = new StatSet();
|
||||
set.set("castleId", castleId);
|
||||
|
||||
attrs = c.getAttributes();
|
||||
for (int i = 0; i < attrs.getLength(); i++)
|
||||
{
|
||||
@@ -329,7 +327,6 @@ public class CastleManorManager implements IXmlReader, IStorable
|
||||
// Change next period to current and prepare next period data
|
||||
final List<SeedProduction> nextProduction = _productionNext.get(castleId);
|
||||
final List<CropProcure> nextProcure = _procureNext.get(castleId);
|
||||
|
||||
_production.put(castleId, nextProduction);
|
||||
_procure.put(castleId, nextProcure);
|
||||
|
||||
@@ -381,7 +378,6 @@ public class CastleManorManager implements IXmlReader, IStorable
|
||||
case MODIFIABLE:
|
||||
{
|
||||
_mode = ManorMode.APPROVED;
|
||||
|
||||
for (Castle castle : CastleManager.getInstance().getCastles())
|
||||
{
|
||||
final Clan owner = castle.getOwner();
|
||||
@@ -582,7 +578,6 @@ public class CastleManorManager implements IXmlReader, IStorable
|
||||
{
|
||||
final List<CropProcure> procure = getCropProcure(castleId, nextPeriod);
|
||||
final List<SeedProduction> production = getSeedProduction(castleId, nextPeriod);
|
||||
|
||||
long total = 0;
|
||||
for (SeedProduction seed : production)
|
||||
{
|
||||
|
@@ -200,7 +200,6 @@ public class CeremonyOfChaosManager extends AbstractEventManager<CeremonyOfChaos
|
||||
final List<PlayerInstance> players = getRegisteredPlayers().stream().sorted(Comparator.comparingInt(PlayerInstance::getLevel)).collect(Collectors.toList());
|
||||
final int maxPlayers = getMaxPlayersInArena();
|
||||
final List<Integer> templates = getVariables().getList(INSTANCE_TEMPLATES_KEY, Integer.class);
|
||||
|
||||
for (PlayerInstance player : players)
|
||||
{
|
||||
if (player.isOnline() && canRegister(player, true))
|
||||
@@ -298,9 +297,7 @@ public class CeremonyOfChaosManager extends AbstractEventManager<CeremonyOfChaos
|
||||
boolean canRegister = true;
|
||||
|
||||
final Clan clan = player.getClan();
|
||||
|
||||
SystemMessageId sm = null;
|
||||
|
||||
if (player.getLevel() < 85)
|
||||
{
|
||||
sm = SystemMessageId.ONLY_CHARACTERS_LEVEL_85_OR_ABOVE_MAY_PARTICIPATE_IN_THE_TOURNAMENT;
|
||||
@@ -382,7 +379,6 @@ public class CeremonyOfChaosManager extends AbstractEventManager<CeremonyOfChaos
|
||||
}
|
||||
|
||||
// TODO : One player can take part in 16 matches per day.
|
||||
|
||||
if ((sm != null) && sendMessage)
|
||||
{
|
||||
player.sendPacket(sm);
|
||||
|
@@ -186,7 +186,6 @@ public class ClanEntryManager
|
||||
{
|
||||
LOGGER.log(Level.WARNING, e.getMessage(), e);
|
||||
}
|
||||
|
||||
return (clanApplicantList != null) && (clanApplicantList.remove(playerId) != null);
|
||||
}
|
||||
|
||||
|
@@ -376,7 +376,6 @@ public class CommissionManager
|
||||
{
|
||||
final long saleFee = (long) Math.max(MIN_REGISTRATION_AND_SALE_FEE, (totalPrice * SALE_FEE_PER_DAY) * commissionItem.getDurationInDays());
|
||||
final Message mail = new Message(itemInstance.getOwnerId(), itemInstance, MailType.COMMISSION_ITEM_SOLD);
|
||||
|
||||
final Mail attachement = mail.createAttachments();
|
||||
attachement.addItem("Commission Item Sold", Inventory.ADENA_ID, totalPrice - saleFee, player, null);
|
||||
MailManager.getInstance().sendMessage(mail);
|
||||
|
@@ -94,9 +94,7 @@ public class CursedWeaponsManager implements IXmlReader
|
||||
final int id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
|
||||
final int skillId = Integer.parseInt(attrs.getNamedItem("skillId").getNodeValue());
|
||||
final String name = attrs.getNamedItem("name").getNodeValue();
|
||||
|
||||
final CursedWeapon cw = new CursedWeapon(id, skillId, name);
|
||||
|
||||
int val;
|
||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||
{
|
||||
@@ -276,21 +274,18 @@ public class CursedWeaponsManager implements IXmlReader
|
||||
public void drop(int itemId, Creature killer)
|
||||
{
|
||||
final CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
|
||||
cw.dropIt(killer);
|
||||
}
|
||||
|
||||
public void increaseKills(int itemId)
|
||||
{
|
||||
final CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
|
||||
cw.increaseKills();
|
||||
}
|
||||
|
||||
public int getLevel(int itemId)
|
||||
{
|
||||
final CursedWeapon cw = _cursedWeapons.get(itemId);
|
||||
|
||||
return cw.getLevel();
|
||||
}
|
||||
|
||||
|
@@ -165,7 +165,6 @@ public class DBSpawnManager
|
||||
info.set("currentHP", npc.getCurrentHp());
|
||||
info.set("currentMP", npc.getCurrentMp());
|
||||
info.set("respawnTime", 0);
|
||||
|
||||
_storedInfo.put(npcId, info);
|
||||
_npcs.put(npcId, npc);
|
||||
LOGGER.info(getClass().getSimpleName() + ": Spawning NPC " + npc.getName());
|
||||
@@ -195,15 +194,12 @@ public class DBSpawnManager
|
||||
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
|
||||
final int respawnDelay = Rnd.get(respawnMinDelay, respawnMaxDelay);
|
||||
final long respawnTime = System.currentTimeMillis() + respawnDelay;
|
||||
|
||||
info.set("currentHP", npc.getMaxHp());
|
||||
info.set("currentMP", npc.getMaxMp());
|
||||
info.set("respawnTime", respawnTime);
|
||||
|
||||
if (!_schedules.containsKey(npc.getId()) && ((respawnMinDelay > 0) || (respawnMaxDelay > 0)))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Updated " + npc.getName() + " respawn time to " + Util.formatDate(new Date(respawnTime), "dd.MM.yyyy HH:mm"));
|
||||
|
||||
_schedules.put(npc.getId(), ThreadPool.schedule(() -> scheduleSpawn(npc.getId()), respawnDelay));
|
||||
updateDb();
|
||||
}
|
||||
@@ -240,9 +236,7 @@ public class DBSpawnManager
|
||||
|
||||
final int npcId = spawn.getId();
|
||||
final long time = System.currentTimeMillis();
|
||||
|
||||
SpawnTable.getInstance().addNewSpawn(spawn, false);
|
||||
|
||||
if ((respawnTime == 0) || (time > respawnTime))
|
||||
{
|
||||
final Npc npc = spawn.doSpawn();
|
||||
@@ -258,7 +252,6 @@ public class DBSpawnManager
|
||||
info.set("currentHP", currentHP);
|
||||
info.set("currentMP", currentMP);
|
||||
info.set("respawnTime", 0);
|
||||
|
||||
_storedInfo.put(npcId, info);
|
||||
}
|
||||
}
|
||||
@@ -320,7 +313,6 @@ public class DBSpawnManager
|
||||
info.set("currentHP", npc.getMaxHp());
|
||||
info.set("currentMP", npc.getMaxMp());
|
||||
info.set("respawnTime", 0);
|
||||
|
||||
_npcs.put(npcId, npc);
|
||||
_storedInfo.put(npcId, info);
|
||||
|
||||
@@ -364,7 +356,6 @@ public class DBSpawnManager
|
||||
}
|
||||
|
||||
final int npcId = spawn.getId();
|
||||
|
||||
_spawns.remove(npcId);
|
||||
_npcs.remove(npcId);
|
||||
_storedInfo.remove(npcId);
|
||||
@@ -533,7 +524,6 @@ public class DBSpawnManager
|
||||
info.set("currentHP", npc.getCurrentHp());
|
||||
info.set("currentMP", npc.getCurrentMp());
|
||||
info.set("respawnTime", 0);
|
||||
|
||||
npc.setDBStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
_storedInfo.put(npc.getId(), info);
|
||||
|
@@ -112,7 +112,6 @@ public class DailyTaskManager extends AbstractEventManager<AbstractEvent<?>>
|
||||
for (PlayerInstance player : World.getInstance().getPlayers())
|
||||
{
|
||||
player.setVitalityPoints(PlayerStat.MAX_VITALITY_POINTS, false);
|
||||
|
||||
for (SubClass subclass : player.getSubClasses().values())
|
||||
{
|
||||
subclass.setVitalityPoints(PlayerStat.MAX_VITALITY_POINTS);
|
||||
|
@@ -137,7 +137,6 @@ public class FortSiegeManager
|
||||
// Siege spawns settings
|
||||
_commanderSpawnList = new ConcurrentHashMap<>();
|
||||
_flagList = new ConcurrentHashMap<>();
|
||||
|
||||
for (Fort fort : FortManager.getInstance().getForts())
|
||||
{
|
||||
final List<FortSiegeSpawn> commanderSpawns = new CopyOnWriteArrayList<>();
|
||||
@@ -158,7 +157,6 @@ public class FortSiegeManager
|
||||
final int z = Integer.parseInt(st.nextToken());
|
||||
final int heading = Integer.parseInt(st.nextToken());
|
||||
final int npc_id = Integer.parseInt(st.nextToken());
|
||||
|
||||
commanderSpawns.add(new FortSiegeSpawn(fort.getResidenceId(), x, y, z, heading, npc_id, i));
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -184,7 +182,6 @@ public class FortSiegeManager
|
||||
final int y = Integer.parseInt(st.nextToken());
|
||||
final int z = Integer.parseInt(st.nextToken());
|
||||
final int flag_id = Integer.parseInt(st.nextToken());
|
||||
|
||||
flagSpawns.add(new CombatFlag(fort.getResidenceId(), x, y, z, 0, flag_id));
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -285,7 +282,6 @@ public class FortSiegeManager
|
||||
}
|
||||
|
||||
final Fort fort = FortManager.getInstance().getFort(player);
|
||||
|
||||
final List<CombatFlag> fcf = _flagList.get(fort.getResidenceId());
|
||||
for (CombatFlag cf : fcf)
|
||||
{
|
||||
|
@@ -210,7 +210,6 @@ public class GrandBossManager implements IStorable
|
||||
{
|
||||
final GrandBossInstance boss = _bosses.get(bossId);
|
||||
final StatSet info = _storedInfo.get(bossId);
|
||||
|
||||
if (statusOnly || (boss == null) || (info == null))
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement(UPDATE_GRAND_BOSS_DATA2))
|
||||
|
@@ -74,7 +74,6 @@ public class HandysBlockCheckerManager
|
||||
{
|
||||
final int newVotes = _arenaVotes.get(arena) + 1;
|
||||
final ArenaParticipantsHolder holder = _arenaPlayers[arena];
|
||||
|
||||
if ((newVotes > (holder.getAllPlayers().size() / 2)) && !holder.getEvent().isStarted())
|
||||
{
|
||||
clearArenaVotes(arena);
|
||||
@@ -152,7 +151,6 @@ public class HandysBlockCheckerManager
|
||||
synchronized (holder)
|
||||
{
|
||||
boolean isRed;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (_arenaPlayers[i].getAllPlayers().contains(player))
|
||||
@@ -192,7 +190,6 @@ public class HandysBlockCheckerManager
|
||||
// KrateiCubeManager.getInstance().removeParticipant(player);
|
||||
// player.sendPacket(SystemMessageId.APPLICANTS_FOR_THE_OLYMPIAD_UNDERGROUND_COLISEUM_OR_KRATEI_S_CUBE_MATCHES_CANNOT_REGISTER));
|
||||
// }
|
||||
|
||||
if (_registrationPenalty.contains(player.getObjectId()))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_MUST_WAIT_10_SECONDS_BEFORE_ATTEMPTING_TO_REGISTER_AGAIN);
|
||||
@@ -226,7 +223,6 @@ public class HandysBlockCheckerManager
|
||||
synchronized (holder)
|
||||
{
|
||||
final boolean isRed = team == 0;
|
||||
|
||||
holder.removePlayer(player, team);
|
||||
holder.broadCastPacketToTeam(new ExCubeGameRemovePlayer(player, isRed));
|
||||
|
||||
@@ -254,7 +250,6 @@ public class HandysBlockCheckerManager
|
||||
synchronized (holder)
|
||||
{
|
||||
final boolean isFromRed = holder.getRedPlayers().contains(player);
|
||||
|
||||
if (isFromRed && (holder.getBlueTeamSize() == 6))
|
||||
{
|
||||
player.sendMessage("The team is full");
|
||||
@@ -268,7 +263,6 @@ public class HandysBlockCheckerManager
|
||||
|
||||
final int futureTeam = isFromRed ? 1 : 0;
|
||||
holder.addPlayer(player, futureTeam);
|
||||
|
||||
if (isFromRed)
|
||||
{
|
||||
holder.removePlayer(player, 0);
|
||||
@@ -339,7 +333,6 @@ public class HandysBlockCheckerManager
|
||||
|
||||
// Remove the event items
|
||||
final PlayerInventory inv = player.getInventory();
|
||||
|
||||
if (inv.getItemByItemId(13787) != null)
|
||||
{
|
||||
final long count = inv.getInventoryItemCount(13787, 0);
|
||||
|
@@ -84,7 +84,6 @@ public class InstanceManager implements IXmlReader
|
||||
// --------------------------------------------------------------------
|
||||
// Instance data loader
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
|
@@ -95,7 +95,6 @@ public class ItemAuctionManager implements IXmlReader
|
||||
{
|
||||
final NamedNodeMap nab = nb.getAttributes();
|
||||
final int instanceId = Integer.parseInt(nab.getNamedItem("id").getNodeValue());
|
||||
|
||||
if (_managerInstances.containsKey(instanceId))
|
||||
{
|
||||
throw new Exception("Dublicated instanceId " + instanceId);
|
||||
|
@@ -64,14 +64,12 @@ public class MailManager
|
||||
while (rs.next())
|
||||
{
|
||||
final Message msg = new Message(rs);
|
||||
|
||||
final int msgId = msg.getId();
|
||||
_messages.put(msgId, msg);
|
||||
|
||||
count++;
|
||||
|
||||
final long expiration = msg.getExpiration();
|
||||
|
||||
if (expiration < System.currentTimeMillis())
|
||||
{
|
||||
ThreadPool.schedule(new MessageDeletionTask(msgId), 10000);
|
||||
|
@@ -75,7 +75,6 @@ public class MapRegionManager implements IXmlReader
|
||||
String town;
|
||||
int locId;
|
||||
int bbs;
|
||||
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
@@ -99,11 +98,9 @@ public class MapRegionManager implements IXmlReader
|
||||
final int spawnX = parseInteger(attrs, "X");
|
||||
final int spawnY = parseInteger(attrs, "Y");
|
||||
final int spawnZ = parseInteger(attrs, "Z");
|
||||
|
||||
final boolean other = parseBoolean(attrs, "isOther", false);
|
||||
final boolean chaotic = parseBoolean(attrs, "isChaotic", false);
|
||||
final boolean banish = parseBoolean(attrs, "isBanish", false);
|
||||
|
||||
if (other)
|
||||
{
|
||||
region.addOtherSpawn(spawnX, spawnY, spawnZ);
|
||||
@@ -226,11 +223,9 @@ public class MapRegionManager implements IXmlReader
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final PlayerInstance player = creature.getActingPlayer();
|
||||
|
||||
Castle castle = null;
|
||||
Fort fort = null;
|
||||
ClanHall clanhall = null;
|
||||
|
||||
if ((player.getClan() != null) && !player.isFlyingMounted() && !player.isFlying()) // flying players in gracia cant use teleports to aden continent
|
||||
{
|
||||
// If teleport to clan hall
|
||||
@@ -409,7 +404,6 @@ public class MapRegionManager implements IXmlReader
|
||||
{
|
||||
final PlayerInstance player = (PlayerInstance) creature;
|
||||
final MapRegion region = REGIONS.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
{
|
||||
getRestartRegion(player, region.getBannedRace().get(player.getRace()));
|
||||
|
@@ -46,7 +46,6 @@ public class PcCafePointsManager
|
||||
}
|
||||
|
||||
int points = (int) (exp * 0.0001 * Config.PC_CAFE_POINT_RATE);
|
||||
|
||||
if (Config.PC_CAFE_RANDOM_POINT)
|
||||
{
|
||||
points = Rnd.get(points / 2, points);
|
||||
|
@@ -53,7 +53,6 @@ public class PetitionManager
|
||||
public void clearCompletedPetitions()
|
||||
{
|
||||
final int numPetitions = _pendingPetitions.size();
|
||||
|
||||
_completedPetitions.clear();
|
||||
LOGGER.info(getClass().getSimpleName() + ": Completed petition data cleared. " + numPetitions + " petitions removed.");
|
||||
}
|
||||
@@ -61,7 +60,6 @@ public class PetitionManager
|
||||
public void clearPendingPetitions()
|
||||
{
|
||||
final int numPetitions = _pendingPetitions.size();
|
||||
|
||||
_pendingPetitions.clear();
|
||||
LOGGER.info(getClass().getSimpleName() + ": Pending petition queue cleared. " + numPetitions + " petitions removed.");
|
||||
}
|
||||
@@ -74,7 +72,6 @@ public class PetitionManager
|
||||
}
|
||||
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
|
||||
if (currPetition.getResponder() != null)
|
||||
{
|
||||
return false;
|
||||
@@ -189,7 +186,6 @@ public class PetitionManager
|
||||
}
|
||||
|
||||
int petitionCount = 0;
|
||||
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
@@ -313,7 +309,6 @@ public class PetitionManager
|
||||
}
|
||||
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
|
||||
if (currPetition.getResponder() != null)
|
||||
{
|
||||
return false;
|
||||
@@ -327,9 +322,7 @@ public class PetitionManager
|
||||
{
|
||||
// if (!isPlayerInConsultation(player))
|
||||
// return false;
|
||||
|
||||
CreatureSay cs;
|
||||
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
@@ -367,7 +360,6 @@ public class PetitionManager
|
||||
htmlContent.append("<html><body><center><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Petition Menu</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin7\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"270\"><tr><td><table width=\"270\"><tr><td><button value=\"Reset\" action=\"bypass -h admin_reset_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td align=right><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br></td></tr>");
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
@@ -424,7 +416,6 @@ public class PetitionManager
|
||||
// Notify all GMs that a new petition has been submitted.
|
||||
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
|
||||
AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner, ChatType.HERO_VOICE, "Petition System", msgContent));
|
||||
|
||||
return newPetitionId;
|
||||
}
|
||||
|
||||
@@ -442,7 +433,6 @@ public class PetitionManager
|
||||
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||
html.setFile(player, "data/html/admin/petition.htm");
|
||||
html.replace("%petition%", String.valueOf(currPetition.getId()));
|
||||
@@ -451,7 +441,6 @@ public class PetitionManager
|
||||
html.replace("%petitioner%", currPetition.getPetitioner().getName());
|
||||
html.replace("%online%", (currPetition.getPetitioner().isOnline() ? "00FF00" : "999999"));
|
||||
html.replace("%text%", currPetition.getContent());
|
||||
|
||||
player.sendPacket(html);
|
||||
}
|
||||
|
||||
|
@@ -82,7 +82,6 @@ public class PremiumManager
|
||||
final long now = System.currentTimeMillis();
|
||||
final long premiumExpiration = getPremiumExpiration(accountName);
|
||||
player.setPremiumStatus(premiumExpiration > now);
|
||||
|
||||
if (player.hasPremiumStatus())
|
||||
{
|
||||
startExpireTask(player, premiumExpiration - now);
|
||||
@@ -183,7 +182,6 @@ public class PremiumManager
|
||||
{
|
||||
stopExpireTask(playerOnline);
|
||||
startExpireTask(playerOnline, newPremiumExpiration - now);
|
||||
|
||||
if (!playerOnline.hasPremiumStatus())
|
||||
{
|
||||
playerOnline.setPremiumStatus(true);
|
||||
|
@@ -66,7 +66,6 @@ public class SiegeGuardManager
|
||||
final int x = rs.getInt("x");
|
||||
final int y = rs.getInt("y");
|
||||
final int z = rs.getInt("z");
|
||||
|
||||
final Castle castle = CastleManager.getInstance().getCastle(x, y, z);
|
||||
if (castle == null)
|
||||
{
|
||||
|
@@ -97,7 +97,6 @@ public class WalkingManager implements IXmlReader
|
||||
final String routeName = parseString(d.getAttributes(), "name");
|
||||
final boolean repeat = parseBoolean(d.getAttributes(), "repeat");
|
||||
final String repeatStyle = d.getAttributes().getNamedItem("repeatStyle").getNodeValue().toLowerCase();
|
||||
|
||||
final byte repeatType;
|
||||
switch (repeatStyle)
|
||||
{
|
||||
@@ -141,7 +140,6 @@ public class WalkingManager implements IXmlReader
|
||||
final boolean run = parseBoolean(attrs, "run");
|
||||
NpcStringId npcString = null;
|
||||
String chatString = null;
|
||||
|
||||
Node node = attrs.getNamedItem("string");
|
||||
if (node != null)
|
||||
{
|
||||
@@ -185,7 +183,6 @@ public class WalkingManager implements IXmlReader
|
||||
final int x = Integer.parseInt(attrs.getNamedItem("spawnX").getNodeValue());
|
||||
final int y = Integer.parseInt(attrs.getNamedItem("spawnY").getNodeValue());
|
||||
final int z = Integer.parseInt(attrs.getNamedItem("spawnZ").getNodeValue());
|
||||
|
||||
if (NpcData.getInstance().getTemplate(npcId) != null)
|
||||
{
|
||||
final NpcRoutesHolder holder = _routesToAttach.containsKey(npcId) ? _routesToAttach.get(npcId) : new NpcRoutesHolder();
|
||||
@@ -392,14 +389,12 @@ public class WalkingManager implements IXmlReader
|
||||
public void stopMoving(Npc npc, boolean suspend, boolean stoppedByAttack)
|
||||
{
|
||||
final MonsterInstance monster = npc.isMonster() ? ((MonsterInstance) npc).getLeader() == null ? (MonsterInstance) npc : ((MonsterInstance) npc).getLeader() : null;
|
||||
|
||||
if (((monster != null) && !isRegistered(monster)) || !isRegistered(npc))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final WalkInfo walk = monster != null ? _activeRoutes.get(monster.getObjectId()) : _activeRoutes.get(npc.getObjectId());
|
||||
|
||||
walk.setSuspended(suspend);
|
||||
walk.setStoppedByAttack(stoppedByAttack);
|
||||
|
||||
@@ -444,7 +439,6 @@ public class WalkingManager implements IXmlReader
|
||||
|
||||
walk.calculateNextNode(npc);
|
||||
walk.setBlocked(true); // prevents to be ran from walk check task, if there is delay in this node.
|
||||
|
||||
if (node.getNpcString() != null)
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, node.getNpcString());
|
||||
|
@@ -117,7 +117,6 @@ public class ZoneManager implements IXmlReader
|
||||
}
|
||||
}
|
||||
LOGGER.info(getClass().getSimpleName() + " " + _zoneRegions.length + " by " + _zoneRegions[0].length + " Zone Region Grid set up.");
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
@@ -186,7 +185,6 @@ public class ZoneManager implements IXmlReader
|
||||
String zoneType;
|
||||
String zoneShape;
|
||||
final List<int[]> rs = new ArrayList<>();
|
||||
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
@@ -203,7 +201,6 @@ public class ZoneManager implements IXmlReader
|
||||
if ("zone".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
attrs = d.getAttributes();
|
||||
|
||||
attribute = attrs.getNamedItem("type");
|
||||
if (attribute != null)
|
||||
{
|
||||
@@ -252,7 +249,6 @@ public class ZoneManager implements IXmlReader
|
||||
|
||||
minZ = parseInteger(attrs, "minZ");
|
||||
maxZ = parseInteger(attrs, "maxZ");
|
||||
|
||||
zoneType = parseString(attrs, "type");
|
||||
zoneShape = parseString(attrs, "shape");
|
||||
|
||||
@@ -374,7 +370,6 @@ public class ZoneManager implements IXmlReader
|
||||
attrs = cd.getAttributes();
|
||||
final String name = attrs.getNamedItem("name").getNodeValue();
|
||||
final String val = attrs.getNamedItem("val").getNodeValue();
|
||||
|
||||
temp.setParameter(name, val);
|
||||
}
|
||||
else if ("spawn".equalsIgnoreCase(cd.getNodeName()) && (temp instanceof ZoneRespawn))
|
||||
@@ -391,7 +386,6 @@ public class ZoneManager implements IXmlReader
|
||||
attrs = cd.getAttributes();
|
||||
final String race = attrs.getNamedItem("name").getNodeValue();
|
||||
final String point = attrs.getNamedItem("point").getNodeValue();
|
||||
|
||||
((RespawnZone) temp).addRaceRespawnPoint(race, point);
|
||||
}
|
||||
}
|
||||
@@ -418,7 +412,6 @@ public class ZoneManager implements IXmlReader
|
||||
final int bx = ((x + 1) - OFFSET_X) << SHIFT_BY;
|
||||
final int ay = (y - OFFSET_Y) << SHIFT_BY;
|
||||
final int by = ((y + 1) - OFFSET_Y) << SHIFT_BY;
|
||||
|
||||
if (temp.getZone().intersectsRectangle(ax, bx, ay, by))
|
||||
{
|
||||
_zoneRegions[x][y].getZones().put(temp.getId(), temp);
|
||||
@@ -716,7 +709,6 @@ public class ZoneManager implements IXmlReader
|
||||
temp.add(territory);
|
||||
}
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,6 @@ public class AggroInfo
|
||||
{
|
||||
_hate = 0;
|
||||
}
|
||||
|
||||
return _hate;
|
||||
}
|
||||
|
||||
|
@@ -171,7 +171,6 @@ public class BlockList
|
||||
}
|
||||
|
||||
final String charName = CharNameTable.getInstance().getNameById(targetId);
|
||||
|
||||
if (listOwner.getFriendList().contains(targetId))
|
||||
{
|
||||
listOwner.sendPacket(SystemMessageId.THIS_PLAYER_IS_ALREADY_REGISTERED_ON_YOUR_FRIENDS_LIST);
|
||||
@@ -191,7 +190,6 @@ public class BlockList
|
||||
listOwner.sendPacket(sm);
|
||||
|
||||
final PlayerInstance player = World.getInstance().getPlayer(targetId);
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
sm = new SystemMessage(SystemMessageId.C1_HAS_PLACED_YOU_ON_HIS_HER_IGNORE_LIST);
|
||||
@@ -210,7 +208,6 @@ public class BlockList
|
||||
SystemMessage sm;
|
||||
|
||||
final String charName = CharNameTable.getInstance().getNameById(targetId);
|
||||
|
||||
if (!listOwner.getBlockList().getBlockList().contains(targetId))
|
||||
{
|
||||
sm = new SystemMessage(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
|
@@ -68,7 +68,6 @@ public class CommandChannel extends AbstractPlayerGroup
|
||||
}
|
||||
// Update the CCinfo for existing players
|
||||
broadcastPacket(new ExMPCCPartyInfoUpdate(party, 1));
|
||||
|
||||
_parties.add(party);
|
||||
if (party.getLevel() > _channelLvl)
|
||||
{
|
||||
|
@@ -147,7 +147,6 @@ public class ContactList
|
||||
public void remove(String name)
|
||||
{
|
||||
final int contactId = CharNameTable.getInstance().getIdByName(name);
|
||||
|
||||
if (!_contacts.contains(name))
|
||||
{
|
||||
_player.sendPacket(SystemMessageId.THE_NAME_IS_NOT_CURRENTLY_REGISTERED);
|
||||
|
@@ -96,7 +96,6 @@ public class CursedWeapon implements INamable
|
||||
{
|
||||
// Remove from player
|
||||
LOGGER.info(_name + " being removed online.");
|
||||
|
||||
_player.abortAttack();
|
||||
|
||||
_player.setReputation(_playerReputation);
|
||||
@@ -253,7 +252,6 @@ public class CursedWeapon implements INamable
|
||||
private void dropIt(Attackable attackable, PlayerInstance player, Creature killer, boolean fromMonster)
|
||||
{
|
||||
_isActivated = false;
|
||||
|
||||
if (fromMonster)
|
||||
{
|
||||
_item = attackable.dropItem(player, _itemId, 1);
|
||||
@@ -388,10 +386,8 @@ public class CursedWeapon implements INamable
|
||||
// Start the Life Task
|
||||
_endTime = System.currentTimeMillis() + (_duration * 60000);
|
||||
_removeTask = ThreadPool.scheduleAtFixedRate(new RemoveTask(), _durationLost * 12000, _durationLost * 12000);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -459,7 +455,6 @@ public class CursedWeapon implements INamable
|
||||
_player.broadcastUserInfo();
|
||||
|
||||
final SocialAction atk = new SocialAction(_player.getObjectId(), 17);
|
||||
|
||||
_player.broadcastPacket(atk);
|
||||
|
||||
sm = new SystemMessage(SystemMessageId.THE_OWNER_OF_S2_HAS_APPEARED_IN_THE_S1_REGION);
|
||||
@@ -526,7 +521,6 @@ public class CursedWeapon implements INamable
|
||||
{
|
||||
_player.setPkKills(_nbKills);
|
||||
_player.sendPacket(new UserInfo(_player));
|
||||
|
||||
if (((_nbKills % _stageKills) == 0) && (_nbKills <= (_stageKills * (_skillMaxLevel - 1))))
|
||||
{
|
||||
giveSkill();
|
||||
|
@@ -47,7 +47,6 @@ public class DailyMissionDataHolder
|
||||
public DailyMissionDataHolder(StatSet set)
|
||||
{
|
||||
final Function<DailyMissionDataHolder, AbstractDailyMissionHandler> handler = DailyMissionHandler.getInstance().getHandler(set.getString("handler"));
|
||||
|
||||
_id = set.getInt("id");
|
||||
_rewardId = set.getInt("reward_id", 0);
|
||||
_requiredCompletions = set.getInt("requiredCompletion", 0);
|
||||
|
@@ -98,7 +98,6 @@ public class DropProtection implements Runnable
|
||||
|
||||
_isProtected = true;
|
||||
_owner = creature;
|
||||
|
||||
if (_owner == null)
|
||||
{
|
||||
throw new NullPointerException("Trying to protect dropped item to null owner");
|
||||
|
@@ -479,7 +479,6 @@ public class EffectList
|
||||
stopEffects(i -> i.isAbnormalType(type), true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -495,7 +494,6 @@ public class EffectList
|
||||
stopEffects(i -> types.contains(i.getSkill().getAbnormalType()), true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -585,7 +583,6 @@ public class EffectList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -734,7 +731,6 @@ public class EffectList
|
||||
|
||||
// Decrease specific buff count
|
||||
increaseDecreaseCount(info, false);
|
||||
|
||||
info.getSkill().applyEffectScope(EffectScope.END, info, true, false);
|
||||
}
|
||||
}
|
||||
@@ -977,7 +973,6 @@ public class EffectList
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
|
||||
if (!_actives.isEmpty())
|
||||
{
|
||||
//@formatter:off
|
||||
|
@@ -34,7 +34,6 @@ public class GroupSpawn extends Spawn
|
||||
{
|
||||
super(mobTemplate);
|
||||
_template = mobTemplate;
|
||||
|
||||
setAmount(1);
|
||||
}
|
||||
|
||||
@@ -50,7 +49,6 @@ public class GroupSpawn extends Spawn
|
||||
int newlocx = 0;
|
||||
int newlocy = 0;
|
||||
int newlocz = 0;
|
||||
|
||||
if ((getX() == 0) && (getY() == 0))
|
||||
{
|
||||
if (getLocationId() == 0)
|
||||
@@ -67,9 +65,7 @@ public class GroupSpawn extends Spawn
|
||||
|
||||
final Npc mob = new ControllableMobInstance(_template);
|
||||
mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp());
|
||||
|
||||
mob.setHeading(getHeading() == -1 ? Rnd.get(61794) : getHeading());
|
||||
|
||||
mob.setSpawn(this);
|
||||
mob.spawnMe(newlocx, newlocy, newlocz);
|
||||
return mob;
|
||||
|
@@ -141,7 +141,6 @@ public class ItemInfo
|
||||
_time = item.isTimeLimitedItem() ? (int) (item.getRemainingTime() / 1000) : -9999;
|
||||
_available = item.isAvailable();
|
||||
_location = item.getLocationSlot();
|
||||
|
||||
_elemAtkType = item.getAttackAttributeType().getClientId();
|
||||
_elemAtkPower = item.getAttackAttributePower();
|
||||
for (AttributeType type : AttributeType.ATTRIBUTE_TYPES)
|
||||
@@ -200,9 +199,7 @@ public class ItemInfo
|
||||
// Get shadow item mana
|
||||
_mana = -1;
|
||||
_time = -9999;
|
||||
|
||||
_location = item.getLocationSlot();
|
||||
|
||||
_elemAtkType = item.getAttackElementType();
|
||||
_elemAtkPower = item.getAttackElementPower();
|
||||
for (byte i = 0; i < 6; i++)
|
||||
@@ -251,9 +248,7 @@ public class ItemInfo
|
||||
// Get shadow item mana
|
||||
_mana = -1;
|
||||
_time = -9999;
|
||||
|
||||
_location = 0;
|
||||
|
||||
_soulCrystalOptions = Collections.emptyList();
|
||||
_soulCrystalSpecialOptions = Collections.emptyList();
|
||||
}
|
||||
@@ -291,7 +286,6 @@ public class ItemInfo
|
||||
_mana = item.getMana();
|
||||
_time = item.getTime();
|
||||
_location = item.getLocationSlot();
|
||||
|
||||
_elemAtkType = item.getAttackElementType();
|
||||
_elemAtkPower = item.getAttackElementPower();
|
||||
for (byte i = 0; i < 6; i++)
|
||||
|
@@ -67,7 +67,6 @@ public class MobGroup
|
||||
{
|
||||
_mobs = ConcurrentHashMap.newKeySet();
|
||||
}
|
||||
|
||||
return _mobs;
|
||||
}
|
||||
|
||||
@@ -146,12 +145,10 @@ public class MobGroup
|
||||
for (int i = 0; i < _maxMobCount; i++)
|
||||
{
|
||||
final GroupSpawn spawn = new GroupSpawn(_npcTemplate);
|
||||
|
||||
final int signX = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int signY = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
|
||||
spawn.setXYZ(x + (signX * randX), y + (signY * randY), z);
|
||||
spawn.stopRespawn();
|
||||
|
||||
@@ -187,7 +184,6 @@ public class MobGroup
|
||||
{
|
||||
final int x = player.getX() + Rnd.get(50);
|
||||
final int y = player.getY() + Rnd.get(50);
|
||||
|
||||
mobInst.teleToLocation(new Location(x, y, player.getZ()), true);
|
||||
((ControllableMobAI) mobInst.getAI()).follow(player);
|
||||
}
|
||||
@@ -325,7 +321,6 @@ public class MobGroup
|
||||
final int signY = Rnd.nextBoolean() ? -1 : 1;
|
||||
final int randX = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
final int randY = Rnd.get(MobGroupTable.RANDOM_RANGE);
|
||||
|
||||
final ControllableMobAI ai = (ControllableMobAI) mobInst.getAI();
|
||||
ai.move(creature.getX() + (signX * randX), creature.getY() + (signY * randY), creature.getZ());
|
||||
}
|
||||
|
@@ -64,7 +64,6 @@ public class MobGroupTable
|
||||
return mobGroup;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -208,7 +208,6 @@ public class Party extends AbstractPlayerGroup
|
||||
// continue, take another member if this just logged off
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -253,7 +252,6 @@ public class Party extends AbstractPlayerGroup
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return looter != null ? looter : player;
|
||||
}
|
||||
|
||||
@@ -435,7 +433,6 @@ public class Party extends AbstractPlayerGroup
|
||||
public void addTacticalSign(PlayerInstance player, int tacticalSignId, Creature target)
|
||||
{
|
||||
final Creature tacticalTarget = getTacticalSigns().get(tacticalSignId);
|
||||
|
||||
if (tacticalTarget == null)
|
||||
{
|
||||
// if the new sign is applied to an existing target, remove the old sign from map
|
||||
@@ -670,7 +667,6 @@ public class Party extends AbstractPlayerGroup
|
||||
final int p1 = _members.indexOf(player);
|
||||
_members.set(0, player);
|
||||
_members.set(p1, temp);
|
||||
|
||||
SystemMessage msg = new SystemMessage(SystemMessageId.C1_HAS_BECOME_THE_PARTY_LEADER);
|
||||
msg.addString(getLeader().getName());
|
||||
broadcastPacket(msg);
|
||||
@@ -760,7 +756,6 @@ public class Party extends AbstractPlayerGroup
|
||||
}
|
||||
|
||||
final PlayerInstance looter = getActualLooter(player, itemId, spoil, target);
|
||||
|
||||
looter.addItem(spoil ? "Sweeper Party" : "Party", itemId, itemCount, target, true);
|
||||
|
||||
// Send messages to other party members about reward
|
||||
@@ -840,10 +835,8 @@ public class Party extends AbstractPlayerGroup
|
||||
public void distributeXpAndSp(double xpReward, double spReward, List<PlayerInstance> rewardedMembers, int topLvl, Attackable target)
|
||||
{
|
||||
final List<PlayerInstance> validMembers = getValidMembers(rewardedMembers, topLvl);
|
||||
|
||||
xpReward *= getExpBonus(validMembers.size(), target.getInstanceWorld());
|
||||
spReward *= getSpBonus(validMembers.size(), target.getInstanceWorld());
|
||||
|
||||
int sqLevelSum = 0;
|
||||
for (PlayerInstance member : validMembers)
|
||||
{
|
||||
@@ -875,7 +868,6 @@ public class Party extends AbstractPlayerGroup
|
||||
// Add the XP/SP points to the requested party member
|
||||
double exp = member.getStat().getValue(Stat.EXPSP_RATE, xpReward * preCalculation);
|
||||
final double sp = member.getStat().getValue(Stat.EXPSP_RATE, spReward * preCalculation);
|
||||
|
||||
exp = calculateExpSpPartyCutoff(member.getActingPlayer(), topLvl, exp, sp, target.useVitalityRate());
|
||||
if (exp > 0)
|
||||
{
|
||||
@@ -894,7 +886,6 @@ public class Party extends AbstractPlayerGroup
|
||||
{
|
||||
addExp *= Config.EXP_AMOUNT_MULTIPLIERS.getOrDefault(player.getClassId(), 1f);
|
||||
addSp *= Config.SP_AMOUNT_MULTIPLIERS.getOrDefault(player.getClassId(), 1f);
|
||||
|
||||
double xp = addExp;
|
||||
double sp = addSp;
|
||||
if (Config.PARTY_XP_CUTOFF_METHOD.equalsIgnoreCase("highfive"))
|
||||
@@ -1026,7 +1017,6 @@ public class Party extends AbstractPlayerGroup
|
||||
{
|
||||
i = BONUS_EXP_SP.length - 1;
|
||||
}
|
||||
|
||||
return BONUS_EXP_SP[i];
|
||||
}
|
||||
|
||||
@@ -1086,7 +1076,6 @@ public class Party extends AbstractPlayerGroup
|
||||
_changeRequestDistributionType = partyDistributionType;
|
||||
_changeDistributionTypeAnswers = new HashSet<>();
|
||||
_changeDistributionTypeRequestTask = ThreadPool.schedule(() -> finishLootRequest(false), PARTY_DISTRIBUTION_TYPE_REQUEST_TIMEOUT.toMillis());
|
||||
|
||||
broadcastToPartyMembers(getLeader(), new ExAskModifyPartyLooting(getLeader().getName(), partyDistributionType));
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.REQUESTING_APPROVAL_FOR_CHANGING_PARTY_LOOT_TO_S1);
|
||||
|
@@ -224,7 +224,6 @@ public class PetLevelData
|
||||
return _fastFlySpeedOnRide;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -39,7 +39,6 @@ public class Radar
|
||||
public void addMarker(int x, int y, int z)
|
||||
{
|
||||
final RadarMarker newMarker = new RadarMarker(x, y, z);
|
||||
|
||||
_markers.add(newMarker);
|
||||
_player.sendPacket(new RadarControl(2, 2, x, y, z));
|
||||
_player.sendPacket(new RadarControl(0, 1, x, y, z));
|
||||
|
@@ -674,7 +674,6 @@ public class StatSet implements IParserAdvUtils
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (A) obj;
|
||||
}
|
||||
|
||||
@@ -686,7 +685,6 @@ public class StatSet implements IParserAdvUtils
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return (A) obj;
|
||||
}
|
||||
|
||||
@@ -697,7 +695,6 @@ public class StatSet implements IParserAdvUtils
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (SkillHolder) obj;
|
||||
}
|
||||
|
||||
@@ -719,7 +716,6 @@ public class StatSet implements IParserAdvUtils
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return (List<MinionHolder>) obj;
|
||||
}
|
||||
|
||||
|
@@ -104,7 +104,6 @@ public class Territory
|
||||
{
|
||||
final double dy1 = p1._y - y;
|
||||
final double dy2 = p2._y - y;
|
||||
|
||||
if (Math.abs(Math.signum(dy1) - Math.signum(dy2)) <= 1e-6)
|
||||
{
|
||||
return false;
|
||||
@@ -112,7 +111,6 @@ public class Territory
|
||||
|
||||
final double dx1 = p1._x - x;
|
||||
final double dx2 = p2._x - x;
|
||||
|
||||
if ((dx1 >= 0) && (dx2 >= 0))
|
||||
{
|
||||
return true;
|
||||
@@ -124,7 +122,6 @@ public class Territory
|
||||
}
|
||||
|
||||
final double dx0 = (dy1 * (p1._x - p2._x)) / (p1._y - p2._y);
|
||||
|
||||
return dx0 <= dx1;
|
||||
}
|
||||
|
||||
@@ -135,13 +132,11 @@ public class Territory
|
||||
{
|
||||
final Point p1 = _points.get(i > 0 ? i - 1 : _points.size() - 1);
|
||||
final Point p2 = _points.get(i);
|
||||
|
||||
if (isIntersect(x, y, p1, p2))
|
||||
{
|
||||
intersectCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return (intersectCount % 2) == 1;
|
||||
}
|
||||
|
||||
|
@@ -75,7 +75,6 @@ public class TradeItem
|
||||
_soulCrystalOptions = item.getSpecialAbilities();
|
||||
_soulCrystalSpecialOptions = item.getAdditionalSpecialAbilities();
|
||||
_visualId = item.getVisualId();
|
||||
|
||||
if (item.getAugmentation() != null)
|
||||
{
|
||||
_augmentationOption1 = item.getAugmentation().getOption1Id();
|
||||
|
@@ -524,7 +524,6 @@ public class TradeList
|
||||
private int countItemsSlots(PlayerInstance partner)
|
||||
{
|
||||
int slots = 0;
|
||||
|
||||
for (TradeItem item : _items)
|
||||
{
|
||||
if (item == null)
|
||||
@@ -545,7 +544,6 @@ public class TradeList
|
||||
slots++;
|
||||
}
|
||||
}
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
@@ -555,7 +553,6 @@ public class TradeList
|
||||
private int calcItemsWeight()
|
||||
{
|
||||
long weight = 0;
|
||||
|
||||
for (TradeItem item : _items)
|
||||
{
|
||||
if (item == null)
|
||||
@@ -569,7 +566,6 @@ public class TradeList
|
||||
}
|
||||
weight += item.getCount() * template.getWeight();
|
||||
}
|
||||
|
||||
return (int) Math.min(weight, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
@@ -657,11 +653,9 @@ public class TradeList
|
||||
|
||||
final PlayerInventory ownerInventory = _owner.getInventory();
|
||||
final PlayerInventory playerInventory = player.getInventory();
|
||||
|
||||
for (ItemRequest item : items)
|
||||
{
|
||||
boolean found = false;
|
||||
|
||||
for (TradeItem ti : _items)
|
||||
{
|
||||
if (ti.getObjectId() == item.getObjectId())
|
||||
@@ -753,7 +747,6 @@ public class TradeList
|
||||
// Prepare inventory update packets
|
||||
final InventoryUpdate ownerIU = new InventoryUpdate();
|
||||
final InventoryUpdate playerIU = new InventoryUpdate();
|
||||
|
||||
final ItemInstance adenaItem = playerInventory.getAdenaInstance();
|
||||
if (!playerInventory.reduceAdena("PrivateStore", totalPrice, player, _owner))
|
||||
{
|
||||
@@ -763,7 +756,6 @@ public class TradeList
|
||||
playerIU.addItem(adenaItem);
|
||||
ownerInventory.addAdena("PrivateStore", totalPrice, _owner, player);
|
||||
// ownerIU.addItem(ownerInventory.getAdenaInstance());
|
||||
|
||||
boolean ok = true;
|
||||
|
||||
// Transfer items
|
||||
@@ -869,16 +861,13 @@ public class TradeList
|
||||
// Prepare inventory update packet
|
||||
final InventoryUpdate ownerIU = new InventoryUpdate();
|
||||
final InventoryUpdate playerIU = new InventoryUpdate();
|
||||
|
||||
long totalPrice = 0;
|
||||
|
||||
final TradeItem[] sellerItems = _items.toArray(new TradeItem[0]);
|
||||
|
||||
for (ItemRequest item : requestedItems)
|
||||
{
|
||||
// searching item in tradelist using itemId
|
||||
boolean found = false;
|
||||
|
||||
for (TradeItem ti : sellerItems)
|
||||
{
|
||||
if (ti.getItem().getId() == item.getItemId())
|
||||
|
@@ -252,7 +252,6 @@ public class Attackable extends Npc
|
||||
if (isMonster())
|
||||
{
|
||||
MonsterInstance master = (MonsterInstance) this;
|
||||
|
||||
if (master.hasMinions())
|
||||
{
|
||||
master.getMinionList().onAssist(this, attacker);
|
||||
@@ -342,7 +341,6 @@ public class Attackable extends Npc
|
||||
|
||||
// NOTE: Concurrent-safe map is used because while iterating to verify all conditions sometimes an entry must be removed.
|
||||
final Map<PlayerInstance, DamageDoneInfo> rewards = new ConcurrentHashMap<>();
|
||||
|
||||
PlayerInstance maxDealer = null;
|
||||
long maxDamage = 0;
|
||||
long totalDamage = 0;
|
||||
@@ -388,7 +386,6 @@ public class Attackable extends Npc
|
||||
broadcastPacket(new SystemMessage(SystemMessageId.CONGRATULATIONS_YOUR_RAID_WAS_SUCCESSFUL));
|
||||
final int raidbossPoints = (int) (getTemplate().getRaidPoints() * Config.RATE_RAIDBOSS_POINTS);
|
||||
final Party party = player.getParty();
|
||||
|
||||
if (party != null)
|
||||
{
|
||||
final CommandChannel command = party.getCommandChannel();
|
||||
@@ -403,7 +400,6 @@ public class Attackable extends Npc
|
||||
final int points = Math.max(raidbossPoints / members.size(), 1);
|
||||
p.increaseRaidbossPoints(points);
|
||||
p.sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1_RAID_POINT_S).addInt(points));
|
||||
|
||||
if (p.getNobleLevel() > 0)
|
||||
{
|
||||
Hero.getInstance().setRBkilled(p.getObjectId(), getId());
|
||||
@@ -459,7 +455,6 @@ public class Attackable extends Npc
|
||||
if (summon.isPresent())
|
||||
{
|
||||
penalty = ((ServitorInstance) summon.get()).getExpMultiplier();
|
||||
|
||||
}
|
||||
|
||||
// If there's NO party in progress
|
||||
@@ -475,7 +470,6 @@ public class Attackable extends Npc
|
||||
final double[] expSp = calculateExpAndSp(attacker.getLevel(), damage, totalDamage);
|
||||
double exp = expSp[0];
|
||||
double sp = expSp[1];
|
||||
|
||||
if (Config.CHAMPION_ENABLE && _champion)
|
||||
{
|
||||
exp *= Config.CHAMPION_REWARDS_EXP_SP;
|
||||
@@ -498,7 +492,6 @@ public class Attackable extends Npc
|
||||
{
|
||||
exp = attacker.getStat().getValue(Stat.EXPSP_RATE, exp) * Config.EXP_AMOUNT_MULTIPLIERS.getOrDefault(attacker.getClassId(), 1f);
|
||||
sp = attacker.getStat().getValue(Stat.EXPSP_RATE, sp) * Config.SP_AMOUNT_MULTIPLIERS.getOrDefault(attacker.getClassId(), 1f);
|
||||
|
||||
attacker.addExpAndSp(exp, sp, useVitalityRate());
|
||||
if (exp > 0)
|
||||
{
|
||||
@@ -578,7 +571,6 @@ public class Attackable extends Npc
|
||||
final double[] expSp = calculateExpAndSp(partyLvl, partyDmg, totalDamage);
|
||||
double exp = expSp[0];
|
||||
double sp = expSp[1];
|
||||
|
||||
if (Config.CHAMPION_ENABLE && _champion)
|
||||
{
|
||||
exp *= Config.CHAMPION_REWARDS_EXP_SP;
|
||||
@@ -651,7 +643,6 @@ public class Attackable extends Npc
|
||||
|
||||
// Calculate the amount of hate this attackable receives from this attack.
|
||||
double hateValue = (damage * 100) / (getLevel() + 7);
|
||||
|
||||
if (skill == null)
|
||||
{
|
||||
hateValue *= attacker.getStat().getValue(Stat.HATE_ATTACK, 1);
|
||||
@@ -1007,9 +998,7 @@ public class Attackable extends Npc
|
||||
}
|
||||
|
||||
CursedWeaponsManager.getInstance().checkDrop(this, player);
|
||||
|
||||
npcTemplate.getExtendDrop().stream().map(ExtendDropData.getInstance()::getExtendDropById).filter(Objects::nonNull).forEach(e -> e.reward(player, this));
|
||||
|
||||
if (isSpoiled() && !_plundered)
|
||||
{
|
||||
_sweepItems.set(npcTemplate.calculateDrops(DropType.SPOIL, this, player));
|
||||
@@ -1284,12 +1273,10 @@ public class Attackable extends Npc
|
||||
final int levelDiff = charLevel - getLevel();
|
||||
double xp = 0;
|
||||
double sp = 0;
|
||||
|
||||
if ((levelDiff < 11) && (levelDiff > -11))
|
||||
{
|
||||
xp = Math.max(0, (getExpReward() * damage) / totalDamage);
|
||||
sp = Math.max(0, (getSpReward() * damage) / totalDamage);
|
||||
|
||||
if ((charLevel > 84) && (levelDiff <= -3))
|
||||
{
|
||||
double mul;
|
||||
@@ -1345,7 +1332,6 @@ public class Attackable extends Npc
|
||||
sp *= mul;
|
||||
}
|
||||
}
|
||||
|
||||
return new double[]
|
||||
{
|
||||
xp,
|
||||
@@ -1496,7 +1482,6 @@ public class Attackable extends Npc
|
||||
if ((_seed != null) && (_seederObjId == seeder.getObjectId()))
|
||||
{
|
||||
_seeded = true;
|
||||
|
||||
int count = 1;
|
||||
for (int skillId : getTemplate().getSkills().keySet())
|
||||
{
|
||||
|
@@ -456,7 +456,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
transform(transform, addSkills);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -646,7 +645,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
final double currentHp = _status.getCurrentHp();
|
||||
final double maxHp = _stat.getMaxHp();
|
||||
|
||||
if ((currentHp <= 1.0) || (maxHp < MAX_HP_BAR_PX))
|
||||
{
|
||||
return true;
|
||||
@@ -663,7 +661,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
final double doubleMulti = currentHp / _hpUpdateInterval;
|
||||
int intMulti = (int) doubleMulti;
|
||||
|
||||
_hpUpdateDecCheck = _hpUpdateInterval * (doubleMulti < intMulti ? intMulti-- : intMulti);
|
||||
_hpUpdateIncCheck = _hpUpdateDecCheck + _hpUpdateInterval;
|
||||
}
|
||||
@@ -704,7 +701,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// MP
|
||||
computeStatusUpdate(su, StatusUpdateType.MAX_MP);
|
||||
computeStatusUpdate(su, StatusUpdateType.CUR_MP);
|
||||
|
||||
broadcastPacket(su);
|
||||
}
|
||||
|
||||
@@ -938,7 +934,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// Get the active weapon item corresponding to the active weapon instance (always equipped in the right hand)
|
||||
final Weapon weaponItem = getActiveWeaponItem();
|
||||
final WeaponType weaponType = getAttackType();
|
||||
|
||||
if (getActingPlayer() != null)
|
||||
{
|
||||
if (getActingPlayer().inObserverMode())
|
||||
@@ -1597,7 +1592,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
EventDispatcher.getInstance().notifyEvent(new OnCreatureDeath(killer, this), this);
|
||||
EventDispatcher.getInstance().notifyEvent(new OnCreatureKilled(killer, this), killer);
|
||||
|
||||
abortAttack();
|
||||
abortCast();
|
||||
|
||||
@@ -1719,7 +1713,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
|
||||
// Start broadcast status
|
||||
broadcastPacket(new Revive(this));
|
||||
|
||||
ZoneManager.getInstance().getRegion(this).onRevive(this);
|
||||
}
|
||||
else
|
||||
@@ -2743,12 +2736,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
public int getXdestination()
|
||||
{
|
||||
final MoveData m = _move;
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
return m._xDestination;
|
||||
}
|
||||
|
||||
return getX();
|
||||
}
|
||||
|
||||
@@ -2758,12 +2749,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
public int getYdestination()
|
||||
{
|
||||
final MoveData m = _move;
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
return m._yDestination;
|
||||
}
|
||||
|
||||
return getY();
|
||||
}
|
||||
|
||||
@@ -2773,12 +2762,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
public int getZdestination()
|
||||
{
|
||||
final MoveData m = _move;
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
return m._zDestination;
|
||||
}
|
||||
|
||||
return getZ();
|
||||
}
|
||||
|
||||
@@ -2904,7 +2891,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2926,7 +2912,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
// Get movement data
|
||||
final MoveData m = _move;
|
||||
|
||||
if (m == null)
|
||||
{
|
||||
return true;
|
||||
@@ -2957,7 +2942,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
final int xPrev = getX();
|
||||
final int yPrev = getY();
|
||||
final int zPrev = getZ(); // the z coordinate may be modified by coordinate synchronizations
|
||||
|
||||
double dx;
|
||||
double dy;
|
||||
double dz;
|
||||
@@ -2976,7 +2960,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
|
||||
// Z coordinate will follow client values
|
||||
dz = m._zDestination - zPrev;
|
||||
|
||||
if (isPlayer() && !_isFlying)
|
||||
{
|
||||
final double distance = Math.hypot(dx, dy);
|
||||
@@ -3028,7 +3011,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// if (Config.DEVELOPER) LOGGER.warning("Move Ticks:" + (gameTicks - m._moveTimestamp) + ", distPassed:" + distPassed + ", distFraction:" + distFraction);
|
||||
|
||||
if (distFraction > 1)
|
||||
{
|
||||
// Set the position of the Creature to the destination
|
||||
@@ -3049,7 +3031,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
|
||||
// Send a Server->Client packet MoveToLocation to the actor and all known PlayerInstance.
|
||||
broadcastPacket(new MoveToLocation(this));
|
||||
|
||||
if (distFraction > 1)
|
||||
{
|
||||
ThreadPool.execute(() -> getAI().notifyEvent(CtrlEvent.EVT_ARRIVED));
|
||||
@@ -3225,7 +3206,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
double dy = (y - curY);
|
||||
double dz = (z - curZ);
|
||||
double distance = Math.hypot(dx, dy);
|
||||
|
||||
if (!_cursorKeyMovementActive && (distance > 200))
|
||||
{
|
||||
return;
|
||||
@@ -3288,7 +3268,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// Calculate movement angles needed
|
||||
sin = dy / distance;
|
||||
cos = dx / distance;
|
||||
|
||||
distance -= (offset - 5); // due to rounding error, we have to move a bit closer to be in range
|
||||
|
||||
// Calculate the new destination with offset included
|
||||
@@ -3308,7 +3287,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// GEODATA MOVEMENT CHECKS AND PATHFINDING
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!_isFlying && !isInWater && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
@@ -3326,7 +3304,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
final int originalZ = z;
|
||||
final int gtx = (originalX - World.MAP_MIN_X) >> 4;
|
||||
final int gty = (originalY - World.MAP_MIN_Y) >> 4;
|
||||
|
||||
if (isOnGeodataPath())
|
||||
{
|
||||
try
|
||||
@@ -3380,11 +3357,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPathGty = gty;
|
||||
m.geoPathAccurateTx = originalX;
|
||||
m.geoPathAccurateTy = originalY;
|
||||
|
||||
x = m.geoPath.get(m.onGeodataPathIndex).getX();
|
||||
y = m.geoPath.get(m.onGeodataPathIndex).getY();
|
||||
z = m.geoPath.get(m.onGeodataPathIndex).getZ();
|
||||
|
||||
dx = x - curX;
|
||||
dy = y - curY;
|
||||
dz = z - curZ;
|
||||
@@ -3491,7 +3466,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
m.geoPathGty = md.geoPathGty;
|
||||
m.geoPathAccurateTx = md.geoPathAccurateTx;
|
||||
m.geoPathAccurateTy = md.geoPathAccurateTy;
|
||||
|
||||
if (md.onGeodataPathIndex == (md.geoPath.size() - 2))
|
||||
{
|
||||
m._xDestination = md.geoPathAccurateTx;
|
||||
@@ -3515,9 +3489,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// Calculate the number of ticks between the current position and the destination
|
||||
// One tick added for rounding reasons
|
||||
final int ticksToMove = 1 + (int) ((GameTimeController.TICKS_PER_SECOND * distance) / speed);
|
||||
|
||||
m._heading = 0; // initial value for coordinate sync
|
||||
|
||||
m._moveStartTime = GameTimeController.getInstance().getGameTicks();
|
||||
|
||||
// Set the Creature _move object to MoveData object
|
||||
@@ -3538,14 +3510,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
|
||||
// Send a Server->Client packet CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers
|
||||
broadcastPacket(new MoveToLocation(this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean validateMovementHeading(int heading)
|
||||
{
|
||||
final MoveData m = _move;
|
||||
|
||||
if (m == null)
|
||||
{
|
||||
return true;
|
||||
@@ -3717,7 +3687,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// First dual attack is the first hit only.
|
||||
final Hit hit = attack.getHits().get(0);
|
||||
final Creature target = ((Creature) hit.getTarget());
|
||||
|
||||
if ((target == null) || target.isDead() || !isInSurroundingRegion(target))
|
||||
{
|
||||
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
||||
@@ -3773,7 +3742,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
// Notify to scripts when the attack has been done.
|
||||
EventDispatcher.getInstance().notifyEvent(new OnCreatureAttack(this, target, null), this);
|
||||
EventDispatcher.getInstance().notifyEvent(new OnCreatureAttacked(this, target, null), target);
|
||||
|
||||
if (_triggerSkills != null)
|
||||
{
|
||||
for (OptionsSkillHolder holder : _triggerSkills.values())
|
||||
@@ -4062,7 +4030,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
_stat.recalculateStats(true);
|
||||
}
|
||||
}
|
||||
|
||||
return oldSkill;
|
||||
}
|
||||
|
||||
@@ -4939,7 +4906,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -5069,7 +5035,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
filter = filter.and(additionalFilter);
|
||||
}
|
||||
|
||||
return _skillCasters.values().stream().filter(filter).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -5080,7 +5045,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
{
|
||||
filter = filter.and(additionalFilter);
|
||||
}
|
||||
|
||||
return _skillCasters.values().stream().filter(filter).findAny().orElse(null);
|
||||
}
|
||||
|
||||
@@ -5387,7 +5351,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _basicPropertyResists.computeIfAbsent(basicProperty, k -> new BasicPropertyResist());
|
||||
}
|
||||
|
||||
|
@@ -183,7 +183,6 @@ public class Npc extends Creature
|
||||
// initialize the "current" collisions
|
||||
_currentCollisionHeight = getTemplate().getfCollisionHeight();
|
||||
_currentCollisionRadius = getTemplate().getfCollisionRadius();
|
||||
|
||||
setFlying(template.isFlying());
|
||||
initStatusUpdateCache();
|
||||
}
|
||||
@@ -458,8 +457,6 @@ public class Npc extends Creature
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
// TODO: More checks...
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -655,7 +652,6 @@ public class Npc extends Creature
|
||||
public String getHtmlPath(int npcId, int value, PlayerInstance player)
|
||||
{
|
||||
String pom = "";
|
||||
|
||||
if (value == 0)
|
||||
{
|
||||
pom = Integer.toString(npcId);
|
||||
@@ -666,7 +662,6 @@ public class Npc extends Creature
|
||||
}
|
||||
|
||||
final String temp = "data/html/default/" + pom + ".htm";
|
||||
|
||||
if (!Config.LAZY_CACHE)
|
||||
{
|
||||
// If not running lazy cache the file must be in the cache or it doesnt exist
|
||||
@@ -765,7 +760,6 @@ public class Npc extends Creature
|
||||
}
|
||||
|
||||
final int npcId = getTemplate().getId();
|
||||
|
||||
String filename;
|
||||
switch (npcId)
|
||||
{
|
||||
@@ -900,7 +894,6 @@ public class Npc extends Creature
|
||||
|
||||
final Weapon weapon = (killer != null) ? killer.getActiveWeaponItem() : null;
|
||||
_killingBlowWeaponId = (weapon != null) ? weapon.getId() : 0;
|
||||
|
||||
if (_isFakePlayer && (killer != null) && killer.isPlayable())
|
||||
{
|
||||
final PlayerInstance player = killer.getActingPlayer();
|
||||
@@ -1033,7 +1026,6 @@ public class Npc extends Creature
|
||||
_killingBlowWeaponId = 0;
|
||||
_isRandomAnimationEnabled = getTemplate().isRandomAnimationEnabled();
|
||||
_isRandomWalkingEnabled = !WalkingManager.getInstance().isTargeted(this) && getTemplate().isRandomWalkEnabled();
|
||||
|
||||
if (isTeleporting())
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcTeleport(this), this);
|
||||
@@ -1516,7 +1508,6 @@ public class Npc extends Creature
|
||||
|
||||
final int radius = Rnd.get(radiusMin, radiusMax);
|
||||
final double angle = Rnd.nextDouble() * 2 * Math.PI;
|
||||
|
||||
return new Location((int) (getX() + (radius * Math.cos(angle))), (int) (getY() + (radius * Math.sin(angle))), getZ());
|
||||
}
|
||||
|
||||
@@ -1536,7 +1527,6 @@ public class Npc extends Creature
|
||||
final int newX = (getX() + Rnd.get((RANDOM_ITEM_DROP_LIMIT * 2) + 1)) - RANDOM_ITEM_DROP_LIMIT;
|
||||
final int newY = (getY() + Rnd.get((RANDOM_ITEM_DROP_LIMIT * 2) + 1)) - RANDOM_ITEM_DROP_LIMIT;
|
||||
final int newZ = getZ() + 20;
|
||||
|
||||
if (ItemTable.getInstance().getTemplate(itemId) == null)
|
||||
{
|
||||
LOGGER.severe("Item doesn't exist so cannot be dropped. Item ID: " + itemId + " Quest: " + getName());
|
||||
|
@@ -131,7 +131,6 @@ public abstract class Playable extends Creature
|
||||
getStatus().stopHpMpRegeneration();
|
||||
|
||||
boolean deleteBuffs = true;
|
||||
|
||||
if (isNoblesseBlessedAffected())
|
||||
{
|
||||
stopEffects(EffectFlag.NOBLESS_BLESSING);
|
||||
@@ -145,7 +144,6 @@ public abstract class Playable extends Creature
|
||||
if (isPlayer())
|
||||
{
|
||||
final PlayerInstance player = getActingPlayer();
|
||||
|
||||
if (player.hasCharmOfCourage())
|
||||
{
|
||||
if (player.isInSiege())
|
||||
@@ -169,7 +167,6 @@ public abstract class Playable extends Creature
|
||||
|
||||
// Notify Quest of Playable's death
|
||||
final PlayerInstance actingPlayer = getActingPlayer();
|
||||
|
||||
if (!actingPlayer.isNotifyQuestOfDeathEmpty())
|
||||
{
|
||||
for (QuestState qs : actingPlayer.getNotifyQuestOfDeath())
|
||||
@@ -204,7 +201,6 @@ public abstract class Playable extends Creature
|
||||
public boolean checkIfPvP(PlayerInstance target)
|
||||
{
|
||||
final PlayerInstance player = getActingPlayer();
|
||||
|
||||
if ((player == null) //
|
||||
|| (target == null) //
|
||||
|| (player == target) //
|
||||
@@ -220,7 +216,6 @@ public abstract class Playable extends Creature
|
||||
}
|
||||
|
||||
final Clan playerClan = player.getClan();
|
||||
|
||||
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
|
||||
{
|
||||
final ClanWar war = playerClan.getWarWith(target.getClanId());
|
||||
|
@@ -132,7 +132,6 @@ public abstract class Summon extends Playable
|
||||
setShowSummonAnimation(false); // addVisibleObject created the info packets with summon animation
|
||||
// if someone comes into range now, the animation shouldn't show any more
|
||||
_restoreSummon = false;
|
||||
|
||||
rechargeShots(true, true, false);
|
||||
|
||||
// Notify to scripts
|
||||
@@ -575,7 +574,6 @@ public abstract class Summon extends Playable
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return _owner.getParty();
|
||||
}
|
||||
|
||||
@@ -755,7 +753,6 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
|
||||
final SystemMessage sm;
|
||||
|
||||
if ((target.isHpBlocked() && !target.isNpc()) || (target.isPlayer() && target.isAffected(EffectFlag.DUELIST_FURY) && !_owner.isAffected(EffectFlag.FACEOFF)))
|
||||
{
|
||||
sm = new SystemMessage(SystemMessageId.THE_ATTACK_HAS_BEEN_BLOCKED);
|
||||
@@ -1060,7 +1057,6 @@ public abstract class Summon extends Playable
|
||||
{
|
||||
ItemInstance item;
|
||||
IItemHandler handler;
|
||||
|
||||
if ((_owner.getAutoSoulShot() == null) || _owner.getAutoSoulShot().isEmpty())
|
||||
{
|
||||
return;
|
||||
@@ -1069,7 +1065,6 @@ public abstract class Summon extends Playable
|
||||
for (int itemId : _owner.getAutoSoulShot())
|
||||
{
|
||||
item = _owner.getInventory().getItemByItemId(itemId);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
if (magic && (item.getItem().getDefaultAction() == ActionType.SUMMON_SPIRITSHOT))
|
||||
|
@@ -95,7 +95,6 @@ public abstract class Vehicle extends Creature
|
||||
{
|
||||
_runState = 0;
|
||||
_currentPath = path;
|
||||
|
||||
if ((_currentPath != null) && (_currentPath.length > 0))
|
||||
{
|
||||
final VehiclePathPoint point = _currentPath[0];
|
||||
@@ -118,7 +117,6 @@ public abstract class Vehicle extends Creature
|
||||
public boolean moveToNextRoutePoint()
|
||||
{
|
||||
_move = null;
|
||||
|
||||
if (_currentPath != null)
|
||||
{
|
||||
_runState++;
|
||||
@@ -160,7 +158,6 @@ public abstract class Vehicle extends Creature
|
||||
|
||||
m._moveStartTime = GameTimeController.getInstance().getGameTicks();
|
||||
_move = m;
|
||||
|
||||
GameTimeController.getInstance().registerMovingObject(this);
|
||||
return true;
|
||||
}
|
||||
@@ -322,7 +319,6 @@ public abstract class Vehicle extends Creature
|
||||
public boolean updatePosition()
|
||||
{
|
||||
final boolean result = super.updatePosition();
|
||||
|
||||
for (PlayerInstance player : _passengers)
|
||||
{
|
||||
if ((player != null) && (player.getVehicle() == this))
|
||||
@@ -331,7 +327,6 @@ public abstract class Vehicle extends Creature
|
||||
player.revalidateZone(false);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user