Sync with L2JServer Jan 24th 2015.
This commit is contained in:
@@ -58,7 +58,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.IllegalActionPunishmentType;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
@@ -156,7 +156,6 @@ public final class Config
|
||||
public static boolean DIVINE_SP_BOOK_NEEDED;
|
||||
public static boolean ALT_GAME_SKILL_LEARN;
|
||||
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
|
||||
public static boolean ALT_GAME_SUBCLASS_EVERYWHERE;
|
||||
public static boolean ALLOW_TRANSFORM_WITHOUT_QUEST;
|
||||
public static int FEE_DELETE_TRANSFER_SKILLS;
|
||||
public static int FEE_DELETE_SUBCLASS_SKILLS;
|
||||
@@ -174,6 +173,7 @@ public final class Config
|
||||
public static int MAX_ABNORMAL_STATE_SUCCESS_RATE;
|
||||
public static byte MAX_SUBCLASS;
|
||||
public static byte BASE_SUBCLASS_LEVEL;
|
||||
public static byte BASE_DUALCLASS_LEVEL;
|
||||
public static byte MAX_SUBCLASS_LEVEL;
|
||||
public static int MAX_PVTSTORESELL_SLOTS_DWARF;
|
||||
public static int MAX_PVTSTORESELL_SLOTS_OTHER;
|
||||
@@ -468,7 +468,6 @@ public final class Config
|
||||
public static boolean HTML_ACTION_CACHE_DEBUG;
|
||||
public static boolean PACKET_HANDLER_DEBUG;
|
||||
public static boolean DEVELOPER;
|
||||
public static boolean ACCEPT_GEOEDITOR_CONN;
|
||||
public static boolean ALT_DEV_NO_HANDLERS;
|
||||
public static boolean ALT_DEV_NO_QUESTS;
|
||||
public static boolean ALT_DEV_NO_SPAWNS;
|
||||
@@ -1179,9 +1178,8 @@ public final class Config
|
||||
public static int CHS_FAME_FREQUENCY;
|
||||
|
||||
// GeoData Settings
|
||||
public static int GEODATA;
|
||||
public static int PATHFINDING;
|
||||
public static File PATHNODE_DIR;
|
||||
public static boolean GEODATA_CELLFINDING;
|
||||
public static String PATHFIND_BUFFERS;
|
||||
public static float LOW_WEIGHT;
|
||||
public static float MEDIUM_WEIGHT;
|
||||
@@ -1583,7 +1581,6 @@ public final class Config
|
||||
DIVINE_SP_BOOK_NEEDED = Character.getBoolean("DivineInspirationSpBookNeeded", true);
|
||||
ALT_GAME_SKILL_LEARN = Character.getBoolean("AltGameSkillLearn", false);
|
||||
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Character.getBoolean("AltSubClassWithoutQuests", false);
|
||||
ALT_GAME_SUBCLASS_EVERYWHERE = Character.getBoolean("AltSubclassEverywhere", false);
|
||||
RESTORE_SERVITOR_ON_RECONNECT = Character.getBoolean("RestoreServitorOnReconnect", true);
|
||||
RESTORE_PET_ON_RECONNECT = Character.getBoolean("RestorePetOnReconnect", true);
|
||||
ALLOW_TRANSFORM_WITHOUT_QUEST = Character.getBoolean("AltTransformationWithoutQuest", false);
|
||||
@@ -1600,7 +1597,7 @@ public final class Config
|
||||
ALT_VITALITY_HOUR_RESET = Character.getString("AltVitalityHourReset", "06:30:00");
|
||||
MAX_BONUS_EXP = Character.getDouble("MaxExpBonus", 3.5);
|
||||
MAX_BONUS_SP = Character.getDouble("MaxSpBonus", 3.5);
|
||||
MAX_RUN_SPEED = Character.getInt("MaxRunSpeed", 250);
|
||||
MAX_RUN_SPEED = Character.getInt("MaxRunSpeed", 300);
|
||||
MAX_PCRIT_RATE = Character.getInt("MaxPCritRate", 500);
|
||||
MAX_MCRIT_RATE = Character.getInt("MaxMCritRate", 200);
|
||||
MAX_PATK_SPEED = Character.getInt("MaxPAtkSpeed", 1500);
|
||||
@@ -1608,8 +1605,9 @@ public final class Config
|
||||
MAX_EVASION = Character.getInt("MaxEvasion", 250);
|
||||
MIN_ABNORMAL_STATE_SUCCESS_RATE = Character.getInt("MinAbnormalStateSuccessRate", 10);
|
||||
MAX_ABNORMAL_STATE_SUCCESS_RATE = Character.getInt("MaxAbnormalStateSuccessRate", 90);
|
||||
MAX_SUBCLASS = Character.getByte("MaxSubclass", (byte) 3);
|
||||
MAX_SUBCLASS = (byte) Math.min(3, Character.getByte("MaxSubclass", (byte) 3));
|
||||
BASE_SUBCLASS_LEVEL = Character.getByte("BaseSubclassLevel", (byte) 40);
|
||||
BASE_DUALCLASS_LEVEL = Character.getByte("BaseDualclassLevel", (byte) 85);
|
||||
MAX_SUBCLASS_LEVEL = Character.getByte("MaxSubclassLevel", (byte) 80);
|
||||
MAX_PVTSTORESELL_SLOTS_DWARF = Character.getInt("MaxPvtStoreSellSlotsDwarf", 4);
|
||||
MAX_PVTSTORESELL_SLOTS_OTHER = Character.getInt("MaxPvtStoreSellSlotsOther", 3);
|
||||
@@ -1867,7 +1865,6 @@ public final class Config
|
||||
HTML_ACTION_CACHE_DEBUG = General.getBoolean("HtmlActionCacheDebug", false);
|
||||
PACKET_HANDLER_DEBUG = General.getBoolean("PacketHandlerDebug", false);
|
||||
DEVELOPER = General.getBoolean("Developer", false);
|
||||
ACCEPT_GEOEDITOR_CONN = General.getBoolean("AcceptGeoeditorConn", false);
|
||||
ALT_DEV_NO_HANDLERS = General.getBoolean("AltDevNoHandlers", false) || Boolean.getBoolean("nohandlers");
|
||||
ALT_DEV_NO_QUESTS = General.getBoolean("AltDevNoQuests", false) || Boolean.getBoolean("noquests");
|
||||
ALT_DEV_NO_SPAWNS = General.getBoolean("AltDevNoSpawns", false) || Boolean.getBoolean("nospawns");
|
||||
@@ -2078,6 +2075,7 @@ public final class Config
|
||||
BOTREPORT_RESETPOINT_HOUR = General.getString("BotReportPointsResetHour", "00:00").split(":");
|
||||
BOTREPORT_REPORT_DELAY = General.getInt("BotReportDelay", 30) * 60000;
|
||||
BOTREPORT_ALLOW_REPORTS_FROM_SAME_CLAN_MEMBERS = General.getBoolean("AllowReportsFromSameClanMembers", false);
|
||||
ENABLE_FALLING_DAMAGE = General.getBoolean("EnableFallingDamage", true);
|
||||
|
||||
// Load FloodProtector L2Properties file
|
||||
final PropertiesParser FloodProtectors = new PropertiesParser(FLOOD_PROTECTOR_FILE);
|
||||
@@ -2974,8 +2972,6 @@ public final class Config
|
||||
|
||||
final PropertiesParser geoData = new PropertiesParser(GEODATA_FILE);
|
||||
|
||||
GEODATA = geoData.getInt("GeoData", 0);
|
||||
|
||||
try
|
||||
{
|
||||
PATHNODE_DIR = new File(geoData.getString("PathnodeDirectory", "data/pathnode").replaceAll("\\\\", "/")).getCanonicalFile();
|
||||
@@ -2986,7 +2982,7 @@ public final class Config
|
||||
PATHNODE_DIR = new File("data/pathnode");
|
||||
}
|
||||
|
||||
GEODATA_CELLFINDING = geoData.getBoolean("CellPathFinding", false);
|
||||
PATHFINDING = geoData.getInt("PathFinding", 0);
|
||||
PATHFIND_BUFFERS = geoData.getString("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
|
||||
LOW_WEIGHT = geoData.getFloat("LowWeight", 0.5f);
|
||||
MEDIUM_WEIGHT = geoData.getFloat("MediumWeight", 2);
|
||||
@@ -3011,9 +3007,6 @@ public final class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String str = General.getString("EnableFallingDamage", "auto");
|
||||
ENABLE_FALLING_DAMAGE = "auto".equalsIgnoreCase(str) ? GEODATA > 0 : Boolean.parseBoolean(str);
|
||||
}
|
||||
else if (Server.serverMode == Server.MODE_LOGINSERVER)
|
||||
{
|
||||
@@ -3701,9 +3694,6 @@ public final class Config
|
||||
case "altsubclasswithoutquests":
|
||||
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
|
||||
break;
|
||||
case "altsubclasseverywhere":
|
||||
ALT_GAME_SUBCLASS_EVERYWHERE = Boolean.parseBoolean(pValue);
|
||||
break;
|
||||
case "altmemberscanwithdrawfromclanwh":
|
||||
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
|
||||
break;
|
||||
@@ -3992,37 +3982,44 @@ public final class Config
|
||||
|
||||
public static int getServerTypeId(String[] serverTypes)
|
||||
{
|
||||
int tType = 0;
|
||||
int serverType = 0;
|
||||
for (String cType : serverTypes)
|
||||
{
|
||||
switch (cType.trim().toLowerCase())
|
||||
{
|
||||
case "Normal":
|
||||
tType |= 0x01;
|
||||
case "normal":
|
||||
serverType |= 0x01;
|
||||
break;
|
||||
case "Relax":
|
||||
tType |= 0x02;
|
||||
case "relax":
|
||||
serverType |= 0x02;
|
||||
break;
|
||||
case "Test":
|
||||
tType |= 0x04;
|
||||
case "test":
|
||||
serverType |= 0x04;
|
||||
break;
|
||||
case "NoLabel":
|
||||
tType |= 0x08;
|
||||
case "broad":
|
||||
serverType |= 0x08;
|
||||
break;
|
||||
case "Restricted":
|
||||
tType |= 0x10;
|
||||
case "restricted":
|
||||
serverType |= 0x10;
|
||||
break;
|
||||
case "Event":
|
||||
tType |= 0x20;
|
||||
case "event":
|
||||
serverType |= 0x20;
|
||||
break;
|
||||
case "Free":
|
||||
tType |= 0x40;
|
||||
case "free":
|
||||
serverType |= 0x40;
|
||||
break;
|
||||
default:
|
||||
case "world":
|
||||
serverType |= 0x100;
|
||||
break;
|
||||
case "new":
|
||||
serverType |= 0x200;
|
||||
break;
|
||||
case "classic":
|
||||
serverType |= 0x400;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return tType;
|
||||
return serverType;
|
||||
}
|
||||
|
||||
public static final class ClassMasterSettings
|
||||
@@ -4225,7 +4222,7 @@ public final class Config
|
||||
return result;
|
||||
}
|
||||
|
||||
private static class IPConfigData implements DocumentParser
|
||||
private static class IPConfigData implements IXmlReader
|
||||
{
|
||||
private static final List<String> _subnets = new ArrayList<>(5);
|
||||
private static final List<String> _hosts = new ArrayList<>(5);
|
||||
|
@@ -38,62 +38,61 @@ import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.Server;
|
||||
import com.l2jserver.UPnPService;
|
||||
import com.l2jserver.gameserver.cache.HtmCache;
|
||||
import com.l2jserver.gameserver.datatables.AbilityPointsData;
|
||||
import com.l2jserver.gameserver.datatables.AdminTable;
|
||||
import com.l2jserver.gameserver.datatables.AnnouncementsTable;
|
||||
import com.l2jserver.gameserver.datatables.ArmorSetsData;
|
||||
import com.l2jserver.gameserver.data.sql.impl.AnnouncementsTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CharNameTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CharSummonTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CrestTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.NpcBufferTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.OfflineTradersTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.SummonSkillsTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.TeleportLocationTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AbilityPointsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.ArmorSetsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.BeautyShopData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.BuyListData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.CategoryData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.ClassListData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantItemData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantItemGroupsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantItemOptionsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantSkillGroupsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.ExperienceData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.FishData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.FishingMonstersData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.FishingRodsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.HennaData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.HitConditionBonusData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.InitialEquipmentData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.InitialShortcutData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.ItemCrystalizationData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.KarmaData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.MultisellData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.OptionData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.PetDataTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.PlayerTemplateData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.PlayerXpPercentLostData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.RecipeData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.SecondaryAuthData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.ShuttleData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.SiegeScheduleData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.SkillLearnData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.StaticObjectData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.TeleportersData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.TransformData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.UIData;
|
||||
import com.l2jserver.gameserver.datatables.AugmentationData;
|
||||
import com.l2jserver.gameserver.datatables.BeautyShopData;
|
||||
import com.l2jserver.gameserver.datatables.BotReportTable;
|
||||
import com.l2jserver.gameserver.datatables.BuyListData;
|
||||
import com.l2jserver.gameserver.datatables.CategoryData;
|
||||
import com.l2jserver.gameserver.datatables.CharNameTable;
|
||||
import com.l2jserver.gameserver.datatables.CharSummonTable;
|
||||
import com.l2jserver.gameserver.datatables.CharTemplateTable;
|
||||
import com.l2jserver.gameserver.datatables.ClanTable;
|
||||
import com.l2jserver.gameserver.datatables.ClassListData;
|
||||
import com.l2jserver.gameserver.datatables.CrestTable;
|
||||
import com.l2jserver.gameserver.datatables.DoorTable;
|
||||
import com.l2jserver.gameserver.datatables.EnchantItemData;
|
||||
import com.l2jserver.gameserver.datatables.EnchantItemGroupsData;
|
||||
import com.l2jserver.gameserver.datatables.EnchantItemHPBonusData;
|
||||
import com.l2jserver.gameserver.datatables.EnchantItemOptionsData;
|
||||
import com.l2jserver.gameserver.datatables.EnchantSkillGroupsData;
|
||||
import com.l2jserver.gameserver.datatables.EventDroplist;
|
||||
import com.l2jserver.gameserver.datatables.ExperienceTable;
|
||||
import com.l2jserver.gameserver.datatables.FishData;
|
||||
import com.l2jserver.gameserver.datatables.FishingMonstersData;
|
||||
import com.l2jserver.gameserver.datatables.FishingRodsData;
|
||||
import com.l2jserver.gameserver.datatables.HennaData;
|
||||
import com.l2jserver.gameserver.datatables.HitConditionBonus;
|
||||
import com.l2jserver.gameserver.datatables.InitialEquipmentData;
|
||||
import com.l2jserver.gameserver.datatables.InitialShortcutData;
|
||||
import com.l2jserver.gameserver.datatables.ItemCrystalizationData;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.datatables.KarmaData;
|
||||
import com.l2jserver.gameserver.datatables.MerchantPriceConfigTable;
|
||||
import com.l2jserver.gameserver.datatables.MultisellData;
|
||||
import com.l2jserver.gameserver.datatables.NpcBufferTable;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.OfflineTradersTable;
|
||||
import com.l2jserver.gameserver.datatables.OptionsData;
|
||||
import com.l2jserver.gameserver.datatables.PetDataTable;
|
||||
import com.l2jserver.gameserver.datatables.PlayerXpPercentLostData;
|
||||
import com.l2jserver.gameserver.datatables.RecipeData;
|
||||
import com.l2jserver.gameserver.datatables.SecondaryAuthData;
|
||||
import com.l2jserver.gameserver.datatables.ShuttleData;
|
||||
import com.l2jserver.gameserver.datatables.SiegeScheduleData;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.datatables.SkillLearnData;
|
||||
import com.l2jserver.gameserver.datatables.SkillTreesData;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.datatables.StaticObjects;
|
||||
import com.l2jserver.gameserver.datatables.SummonSkillsTable;
|
||||
import com.l2jserver.gameserver.datatables.TeleportLocationTable;
|
||||
import com.l2jserver.gameserver.datatables.TeleportersData;
|
||||
import com.l2jserver.gameserver.datatables.TransformData;
|
||||
import com.l2jserver.gameserver.datatables.UIData;
|
||||
import com.l2jserver.gameserver.geoeditorcon.GeoEditorListener;
|
||||
import com.l2jserver.gameserver.handler.EffectHandler;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.instancemanager.AirShipManager;
|
||||
@@ -229,7 +228,7 @@ public class GameServer
|
||||
EnchantItemData.getInstance();
|
||||
EnchantItemOptionsData.getInstance();
|
||||
ItemCrystalizationData.getInstance();
|
||||
OptionsData.getInstance();
|
||||
OptionData.getInstance();
|
||||
EnchantItemHPBonusData.getInstance();
|
||||
MerchantPriceConfigTable.getInstance().loadInstances();
|
||||
BuyListData.getInstance();
|
||||
@@ -245,13 +244,13 @@ public class GameServer
|
||||
ClassListData.getInstance();
|
||||
InitialEquipmentData.getInstance();
|
||||
InitialShortcutData.getInstance();
|
||||
ExperienceTable.getInstance();
|
||||
ExperienceData.getInstance();
|
||||
PlayerXpPercentLostData.getInstance();
|
||||
KarmaData.getInstance();
|
||||
HitConditionBonus.getInstance();
|
||||
CharTemplateTable.getInstance();
|
||||
HitConditionBonusData.getInstance();
|
||||
PlayerTemplateData.getInstance();
|
||||
CharNameTable.getInstance();
|
||||
AdminTable.getInstance();
|
||||
AdminData.getInstance();
|
||||
RaidBossPointsManager.getInstance();
|
||||
PetDataTable.getInstance();
|
||||
CharSummonTable.getInstance().init();
|
||||
@@ -272,7 +271,8 @@ public class GameServer
|
||||
|
||||
printSection("Geodata");
|
||||
GeoData.getInstance();
|
||||
if (Config.GEODATA == 2)
|
||||
|
||||
if (Config.PATHFINDING > 0)
|
||||
{
|
||||
PathFinding.getInstance();
|
||||
}
|
||||
@@ -281,9 +281,9 @@ public class GameServer
|
||||
SkillLearnData.getInstance();
|
||||
NpcData.getInstance();
|
||||
WalkingManager.getInstance();
|
||||
StaticObjects.getInstance();
|
||||
StaticObjectData.getInstance();
|
||||
ZoneManager.getInstance();
|
||||
DoorTable.getInstance();
|
||||
DoorData.getInstance();
|
||||
ItemAuctionManager.getInstance();
|
||||
CastleManager.getInstance().loadInstances();
|
||||
NpcBufferTable.getInstance();
|
||||
@@ -385,11 +385,6 @@ public class GameServer
|
||||
MailManager.getInstance();
|
||||
}
|
||||
|
||||
if (Config.ACCEPT_GEOEDITOR_CONN)
|
||||
{
|
||||
GeoEditorListener.getInstance();
|
||||
}
|
||||
|
||||
PunishmentManager.getInstance();
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(Shutdown.getInstance());
|
||||
|
@@ -18,13 +18,13 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.datatables.DoorTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
@@ -50,12 +50,6 @@ public class GeoData
|
||||
|
||||
protected GeoData()
|
||||
{
|
||||
if (Config.GEODATA == 0)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
int loadedRegions = 0;
|
||||
try
|
||||
{
|
||||
@@ -74,7 +68,7 @@ public class GeoData
|
||||
loadedRegions++;
|
||||
}
|
||||
}
|
||||
else if (Config.TRY_LOAD_UNSPECIFIED_REGIONS)
|
||||
else if (Config.TRY_LOAD_UNSPECIFIED_REGIONS && Files.exists(geoFilePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -84,11 +78,7 @@ public class GeoData
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// ignore file not found errors
|
||||
if (!(e instanceof FileNotFoundException))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Failed to load " + geoFilePath.getFileName() + "!", e);
|
||||
}
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Failed to load " + geoFilePath.getFileName() + "!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,25 +111,25 @@ public class GeoData
|
||||
public boolean checkNearestNsweAntiCornerCut(int geoX, int geoY, int worldZ, int nswe)
|
||||
{
|
||||
boolean can = true;
|
||||
if ((nswe & Cell.NSWE_NORTH_EAST) != 0)
|
||||
if ((nswe & Cell.NSWE_NORTH_EAST) == Cell.NSWE_NORTH_EAST)
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY - 1, prevGeoZ, Direction.EAST) && canEnterNeighbors(prevX + 1, prevY, prevGeoZ, Direction.NORTH);
|
||||
can = checkNearestNswe(geoX, geoY - 1, worldZ, Cell.NSWE_EAST) && checkNearestNswe(geoX + 1, geoY, worldZ, Cell.NSWE_NORTH);
|
||||
}
|
||||
|
||||
if (can && ((nswe & Cell.NSWE_NORTH_WEST) != 0))
|
||||
if (can && ((nswe & Cell.NSWE_NORTH_WEST) == Cell.NSWE_NORTH_WEST))
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY - 1, prevGeoZ, Direction.WEST) && canEnterNeighbors(prevX - 1, prevY, prevGeoZ, Direction.NORTH);
|
||||
can = checkNearestNswe(geoX, geoY - 1, worldZ, Cell.NSWE_WEST) && checkNearestNswe(geoX, geoY - 1, worldZ, Cell.NSWE_NORTH);
|
||||
}
|
||||
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_EAST) != 0))
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_EAST) == Cell.NSWE_SOUTH_EAST))
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY + 1, prevGeoZ, Direction.EAST) && canEnterNeighbors(prevX + 1, prevY, prevGeoZ, Direction.SOUTH);
|
||||
can = checkNearestNswe(geoX, geoY + 1, worldZ, Cell.NSWE_EAST) && checkNearestNswe(geoX + 1, geoY, worldZ, Cell.NSWE_SOUTH);
|
||||
}
|
||||
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_WEST) != 0))
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_WEST) == Cell.NSWE_SOUTH_WEST))
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY + 1, prevGeoZ, Direction.WEST) && canEnterNeighbors(prevX - 1, prevY, prevGeoZ, Direction.SOUTH);
|
||||
can = checkNearestNswe(geoX, geoY + 1, worldZ, Cell.NSWE_WEST) && checkNearestNswe(geoX - 1, geoY, worldZ, Cell.NSWE_SOUTH);
|
||||
@@ -151,25 +141,25 @@ public class GeoData
|
||||
public boolean checkNearestNsweAntiCornerCut(int geoX, int geoY, int worldZ, int nswe, int zDeltaLimit)
|
||||
{
|
||||
boolean can = true;
|
||||
if ((nswe & Cell.NSWE_NORTH_EAST) != 0)
|
||||
if ((nswe & Cell.NSWE_NORTH_EAST) == Cell.NSWE_NORTH_EAST)
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY - 1, prevGeoZ, Direction.EAST) && canEnterNeighbors(prevX + 1, prevY, prevGeoZ, Direction.NORTH);
|
||||
can = checkNearestNswe(geoX, geoY - 1, worldZ, Cell.NSWE_EAST, zDeltaLimit) && checkNearestNswe(geoX + 1, geoY, worldZ, Cell.NSWE_NORTH, zDeltaLimit);
|
||||
}
|
||||
|
||||
if (can && ((nswe & Cell.NSWE_NORTH_WEST) != 0))
|
||||
if (can && ((nswe & Cell.NSWE_NORTH_WEST) == Cell.NSWE_NORTH_WEST))
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY - 1, prevGeoZ, Direction.WEST) && canEnterNeighbors(prevX - 1, prevY, prevGeoZ, Direction.NORTH);
|
||||
can = checkNearestNswe(geoX, geoY - 1, worldZ, Cell.NSWE_WEST, zDeltaLimit) && checkNearestNswe(geoX, geoY - 1, worldZ, Cell.NSWE_NORTH, zDeltaLimit);
|
||||
}
|
||||
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_EAST) != 0))
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_EAST) == Cell.NSWE_SOUTH_EAST))
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY + 1, prevGeoZ, Direction.EAST) && canEnterNeighbors(prevX + 1, prevY, prevGeoZ, Direction.SOUTH);
|
||||
can = checkNearestNswe(geoX, geoY + 1, worldZ, Cell.NSWE_EAST, zDeltaLimit) && checkNearestNswe(geoX + 1, geoY, worldZ, Cell.NSWE_SOUTH, zDeltaLimit);
|
||||
}
|
||||
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_WEST) != 0))
|
||||
if (can && ((nswe & Cell.NSWE_SOUTH_WEST) == Cell.NSWE_SOUTH_WEST))
|
||||
{
|
||||
// can = canEnterNeighbors(prevX, prevY + 1, prevGeoZ, Direction.WEST) && canEnterNeighbors(prevX - 1, prevY, prevGeoZ, Direction.SOUTH);
|
||||
can = checkNearestNswe(geoX, geoY + 1, worldZ, Cell.NSWE_WEST, zDeltaLimit) && checkNearestNswe(geoX - 1, geoY, worldZ, Cell.NSWE_SOUTH, zDeltaLimit);
|
||||
@@ -326,7 +316,7 @@ public class GeoData
|
||||
*/
|
||||
public boolean canSeeTarget(int x, int y, int z, int instanceId, int tx, int ty, int tz)
|
||||
{
|
||||
if (DoorTable.getInstance().checkIfDoorsBetween(x, y, z, tx, ty, tz, instanceId, true))
|
||||
if (DoorData.getInstance().checkIfDoorsBetween(x, y, z, tx, ty, tz, instanceId, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -442,25 +432,25 @@ public class GeoData
|
||||
boolean canSeeThrough = false;
|
||||
if ((curGeoZ <= maxHeight) && (curGeoZ <= beeCurGeoZ))
|
||||
{
|
||||
if ((nswe & Cell.NSWE_NORTH_EAST) != 0)
|
||||
if ((nswe & Cell.NSWE_NORTH_EAST) == Cell.NSWE_NORTH_EAST)
|
||||
{
|
||||
int northGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX, prevY - 1, Cell.NSWE_EAST);
|
||||
int eastGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX + 1, prevY, Cell.NSWE_NORTH);
|
||||
canSeeThrough = (northGeoZ <= maxHeight) && (eastGeoZ <= maxHeight) && (northGeoZ <= getNearestZ(prevX, prevY - 1, beeCurZ)) && (eastGeoZ <= getNearestZ(prevX + 1, prevY, beeCurZ));
|
||||
}
|
||||
else if ((nswe & Cell.NSWE_NORTH_WEST) != 0)
|
||||
else if ((nswe & Cell.NSWE_NORTH_WEST) == Cell.NSWE_NORTH_WEST)
|
||||
{
|
||||
int northGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX, prevY - 1, Cell.NSWE_WEST);
|
||||
int westGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX - 1, prevY, Cell.NSWE_NORTH);
|
||||
canSeeThrough = (northGeoZ <= maxHeight) && (westGeoZ <= maxHeight) && (northGeoZ <= getNearestZ(prevX, prevY - 1, beeCurZ)) && (westGeoZ <= getNearestZ(prevX - 1, prevY, beeCurZ));
|
||||
}
|
||||
else if ((nswe & Cell.NSWE_SOUTH_EAST) != 0)
|
||||
else if ((nswe & Cell.NSWE_SOUTH_EAST) == Cell.NSWE_SOUTH_EAST)
|
||||
{
|
||||
int southGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX, prevY + 1, Cell.NSWE_EAST);
|
||||
int eastGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX + 1, prevY, Cell.NSWE_SOUTH);
|
||||
canSeeThrough = (southGeoZ <= maxHeight) && (eastGeoZ <= maxHeight) && (southGeoZ <= getNearestZ(prevX, prevY + 1, beeCurZ)) && (eastGeoZ <= getNearestZ(prevX + 1, prevY, beeCurZ));
|
||||
}
|
||||
else if ((nswe & Cell.NSWE_SOUTH_WEST) != 0)
|
||||
else if ((nswe & Cell.NSWE_SOUTH_WEST) == Cell.NSWE_SOUTH_WEST)
|
||||
{
|
||||
int southGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX, prevY + 1, Cell.NSWE_WEST);
|
||||
int westGeoZ = getLosGeoZ(prevX, prevY, prevGeoZ, prevX - 1, prevY, Cell.NSWE_SOUTH);
|
||||
@@ -507,7 +497,7 @@ public class GeoData
|
||||
int tGeoY = getGeoY(ty);
|
||||
tz = getNearestZ(tGeoX, tGeoY, tz, Z_DELTA_LIMIT);
|
||||
|
||||
if (DoorTable.getInstance().checkIfDoorsBetween(x, y, z, tx, ty, tz, instanceId, false))
|
||||
if (DoorData.getInstance().checkIfDoorsBetween(x, y, z, tx, ty, tz, instanceId, false))
|
||||
{
|
||||
return new Location(x, y, getHeight(x, y, z));
|
||||
}
|
||||
@@ -569,7 +559,7 @@ public class GeoData
|
||||
int tGeoY = getGeoY(toY);
|
||||
toZ = getNearestZ(tGeoX, tGeoY, toZ, Z_DELTA_LIMIT);
|
||||
|
||||
if (DoorTable.getInstance().checkIfDoorsBetween(fromX, fromY, fromZ, toX, toY, toZ, instanceId, false))
|
||||
if (DoorData.getInstance().checkIfDoorsBetween(fromX, fromY, fromZ, toX, toY, toZ, instanceId, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ import java.lang.reflect.Constructor;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
|
@@ -26,8 +26,8 @@ import java.util.logging.Logger;
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.data.xml.impl.RecipeData;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.datatables.RecipeData;
|
||||
import com.l2jserver.gameserver.enums.StatType;
|
||||
import com.l2jserver.gameserver.model.L2ManufactureItem;
|
||||
import com.l2jserver.gameserver.model.L2RecipeInstance;
|
||||
|
@@ -24,9 +24,9 @@ import java.util.logging.Logger;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.UPnPService;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.OfflineTradersTable;
|
||||
import com.l2jserver.gameserver.datatables.BotReportTable;
|
||||
import com.l2jserver.gameserver.datatables.ClanTable;
|
||||
import com.l2jserver.gameserver.datatables.OfflineTradersTable;
|
||||
import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
|
||||
import com.l2jserver.gameserver.instancemanager.CastleManorManager;
|
||||
import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
|
||||
|
@@ -690,7 +690,12 @@ public abstract class AbstractAI implements Ctrl
|
||||
{
|
||||
if (_actor.isPlayer() && _actor.hasSummon())
|
||||
{
|
||||
_actor.getSummon().broadcastPacket(new AutoAttackStart(_actor.getSummon().getObjectId()));
|
||||
final L2Summon pet = _actor.getPet();
|
||||
if (pet != null)
|
||||
{
|
||||
pet.broadcastPacket(new AutoAttackStart(pet.getObjectId()));
|
||||
}
|
||||
_actor.getServitors().values().forEach(s -> s.broadcastPacket(new AutoAttackStart(s.getObjectId())));
|
||||
}
|
||||
// Send a Server->Client packet AutoAttackStart to the actor and all L2PcInstance in its _knownPlayers
|
||||
_actor.broadcastPacket(new AutoAttackStart(_actor.getObjectId()));
|
||||
|
@@ -31,8 +31,8 @@ import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GameTimeController;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.TerritoryTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.TerritoryTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.enums.AISkillScope;
|
||||
import com.l2jserver.gameserver.enums.AIType;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
@@ -845,7 +845,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||
{
|
||||
int newZ = npc.getZ() + 30;
|
||||
if ((Config.GEODATA == 0) || GeoData.getInstance().canMove(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceId()))
|
||||
if (GeoData.getInstance().canMove(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceId()))
|
||||
{
|
||||
moveTo(newX, newY, newZ);
|
||||
}
|
||||
@@ -885,7 +885,7 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
||||
posY = posY - 300;
|
||||
}
|
||||
|
||||
if ((Config.GEODATA == 0) || GeoData.getInstance().canMove(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceId()))
|
||||
if (GeoData.getInstance().canMove(npc.getX(), npc.getY(), npc.getZ(), posX, posY, posZ, npc.getInstanceId()))
|
||||
{
|
||||
setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(posX, posY, posZ, 0));
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@ import java.util.List;
|
||||
|
||||
import javolution.util.FastList;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GameTimeController;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
@@ -1190,7 +1189,7 @@ public class L2CharacterAI extends AbstractAI
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
return true;
|
||||
}
|
||||
if ((_actor != null) && (_skill != null) && _skill.isBad() && (_skill.getAffectRange() > 0) && (Config.GEODATA > 0) && !GeoData.getInstance().canSeeTarget(_actor, target))
|
||||
if ((_actor != null) && (_skill != null) && _skill.isBad() && (_skill.getAffectRange() > 0) && !GeoData.getInstance().canSeeTarget(_actor, target))
|
||||
{
|
||||
setIntention(AI_INTENTION_ACTIVE);
|
||||
return true;
|
||||
|
@@ -24,7 +24,6 @@ import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GeoData;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
@@ -236,7 +235,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
|
||||
final int targetX = ownerX + (int) (AVOID_RADIUS * Math.cos(angle));
|
||||
final int targetY = ownerY + (int) (AVOID_RADIUS * Math.sin(angle));
|
||||
if ((Config.GEODATA == 0) || GeoData.getInstance().canMove(_actor.getX(), _actor.getY(), _actor.getZ(), targetX, targetY, _actor.getZ(), _actor.getInstanceId()))
|
||||
if (GeoData.getInstance().canMove(_actor.getX(), _actor.getY(), _actor.getZ(), targetX, targetY, _actor.getZ(), _actor.getInstanceId()))
|
||||
{
|
||||
moveTo(targetX, targetY, _actor.getZ());
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ import javolution.util.FastMap;
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Forum;
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Post;
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Topic;
|
||||
import com.l2jserver.gameserver.datatables.ClanTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.handler.CommunityBoardHandler;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.util.StringUtil;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
@@ -37,6 +37,7 @@ import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
* Loads announcements from database.
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class AnnouncementsTable
|
||||
@@ -50,9 +51,6 @@ public final class AnnouncementsTable
|
||||
load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all announcements from database.
|
||||
*/
|
||||
private void load()
|
||||
{
|
||||
_announcements.clear();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -34,8 +34,8 @@ import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.3.2.2.2.1 $ $Date: 2005/03/27 15:29:18 $
|
||||
* Loads name and access level for all players.
|
||||
* @version 2005/03/27
|
||||
*/
|
||||
public class CharNameTable
|
||||
{
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -24,11 +24,15 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.PetDataTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.model.L2PetData;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
|
||||
@@ -45,21 +49,21 @@ public class CharSummonTable
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(CharSummonTable.class.getName());
|
||||
private static final Map<Integer, Integer> _pets = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, Integer> _servitors = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, Set<Integer>> _servitors = new ConcurrentHashMap<>();
|
||||
|
||||
// SQL
|
||||
private static final String INIT_PET = "SELECT ownerId, item_obj_id FROM pets WHERE restore = 'true'";
|
||||
private static final String INIT_SUMMONS = "SELECT ownerId, summonSkillId FROM character_summons";
|
||||
private static final String LOAD_SUMMON = "SELECT curHp, curMp, time FROM character_summons WHERE ownerId = ? AND summonSkillId = ?";
|
||||
private static final String REMOVE_SUMMON = "DELETE FROM character_summons WHERE ownerId = ?";
|
||||
private static final String SAVE_SUMMON = "REPLACE INTO character_summons (ownerId,summonSkillId,curHp,curMp,time) VALUES (?,?,?,?,?)";
|
||||
private static final String INIT_SUMMONS = "SELECT ownerId, summonId FROM character_summons";
|
||||
private static final String LOAD_SUMMON = "SELECT summonSkillId, summonId, curHp, curMp, time FROM character_summons WHERE ownerId = ?";
|
||||
private static final String REMOVE_SUMMON = "DELETE FROM character_summons WHERE ownerId = ? and summonId = ?";
|
||||
private static final String SAVE_SUMMON = "REPLACE INTO character_summons (ownerId,summonId,summonSkillId,curHp,curMp,time) VALUES (?,?,?,?,?,?)";
|
||||
|
||||
public Map<Integer, Integer> getPets()
|
||||
{
|
||||
return _pets;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getServitors()
|
||||
public Map<Integer, Set<Integer>> getServitors()
|
||||
{
|
||||
return _servitors;
|
||||
}
|
||||
@@ -74,7 +78,7 @@ public class CharSummonTable
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
_servitors.put(rs.getInt("ownerId"), rs.getInt("summonSkillId"));
|
||||
_servitors.computeIfAbsent(rs.getInt("ownerId"), k -> ConcurrentHashMap.newKeySet()).add(rs.getInt("summonId"));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -101,13 +105,19 @@ public class CharSummonTable
|
||||
}
|
||||
}
|
||||
|
||||
public void removeServitor(L2PcInstance activeChar)
|
||||
public void removeServitor(L2PcInstance activeChar, int summonObjectId)
|
||||
{
|
||||
_servitors.remove(activeChar.getObjectId());
|
||||
_servitors.computeIfPresent(activeChar.getObjectId(), (k, v) ->
|
||||
{
|
||||
v.remove(summonObjectId);
|
||||
return !v.isEmpty() ? v : null;
|
||||
});
|
||||
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(REMOVE_SUMMON))
|
||||
{
|
||||
ps.setInt(1, activeChar.getObjectId());
|
||||
ps.setInt(2, summonObjectId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
@@ -173,37 +183,34 @@ public class CharSummonTable
|
||||
|
||||
public void restoreServitor(L2PcInstance activeChar)
|
||||
{
|
||||
int skillId = _servitors.get(activeChar.getObjectId());
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(LOAD_SUMMON))
|
||||
{
|
||||
ps.setInt(1, activeChar.getObjectId());
|
||||
ps.setInt(2, skillId);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
Skill skill;
|
||||
|
||||
while (rs.next())
|
||||
{
|
||||
int summonObjId = rs.getInt("summonId");
|
||||
int skillId = rs.getInt("summonSkillId");
|
||||
int curHp = rs.getInt("curHp");
|
||||
int curMp = rs.getInt("curMp");
|
||||
int time = rs.getInt("time");
|
||||
|
||||
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
|
||||
if (skill == null)
|
||||
if ((skill == null) || !activeChar.hasServitor(summonObjId))
|
||||
{
|
||||
removeServitor(activeChar);
|
||||
removeServitor(activeChar, summonObjId);
|
||||
return;
|
||||
}
|
||||
|
||||
skill.applyEffects(activeChar, activeChar);
|
||||
if (activeChar.hasServitor())
|
||||
{
|
||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getSummon();
|
||||
summon.setCurrentHp(curHp);
|
||||
summon.setCurrentMp(curMp);
|
||||
summon.setLifeTimeRemaining(time);
|
||||
}
|
||||
|
||||
final L2ServitorInstance summon = (L2ServitorInstance) activeChar.getServitor(summonObjId);
|
||||
summon.setCurrentHp(curHp);
|
||||
summon.setCurrentMp(curMp);
|
||||
summon.setLifeTimeRemaining(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,16 +227,17 @@ public class CharSummonTable
|
||||
return;
|
||||
}
|
||||
|
||||
_servitors.put(summon.getOwner().getObjectId(), summon.getReferenceSkill());
|
||||
_servitors.computeIfAbsent(summon.getOwner().getObjectId(), k -> ConcurrentHashMap.newKeySet()).add(summon.getObjectId());
|
||||
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(SAVE_SUMMON))
|
||||
{
|
||||
ps.setInt(1, summon.getOwner().getObjectId());
|
||||
ps.setInt(2, summon.getReferenceSkill());
|
||||
ps.setInt(3, (int) Math.round(summon.getCurrentHp()));
|
||||
ps.setInt(4, (int) Math.round(summon.getCurrentMp()));
|
||||
ps.setInt(5, summon.getLifeTimeRemaining());
|
||||
ps.setInt(2, summon.getObjectId());
|
||||
ps.setInt(3, summon.getReferenceSkill());
|
||||
ps.setInt(4, (int) Math.round(summon.getCurrentHp()));
|
||||
ps.setInt(5, (int) Math.round(summon.getCurrentMp()));
|
||||
ps.setInt(6, summon.getLifeTimeRemaining());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
@@ -41,6 +41,7 @@ import com.l2jserver.gameserver.model.L2Crest.CrestType;
|
||||
import com.l2jserver.util.file.filter.BMPFilter;
|
||||
|
||||
/**
|
||||
* Loads and saves crests from database.
|
||||
* @author NosBit
|
||||
*/
|
||||
public final class CrestTable
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -30,6 +30,7 @@ import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.data.xml.impl.PetDataTable;
|
||||
|
||||
public class PetNameTable
|
||||
{
|
||||
@@ -53,7 +54,7 @@ public class PetNameTable
|
||||
cond.append(", ");
|
||||
}
|
||||
|
||||
cond.append(PetDataTable.getPetItemsByNpc(petNpcId));
|
||||
cond.append(PetDataTable.getInstance().getPetItemsByNpc(petNpcId));
|
||||
ps.setString(2, cond.toString());
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
@@ -30,6 +30,7 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
|
||||
public class SummonSkillsTable
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.sql.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.engines;
|
||||
package com.l2jserver.gameserver.data.xml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
@@ -38,9 +38,9 @@ import com.l2jserver.util.file.filter.XMLFilter;
|
||||
* Abstract class for XML parsers.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public interface DocumentParser
|
||||
public interface IXmlReader
|
||||
{
|
||||
static final Logger LOGGER = Logger.getLogger(DocumentParser.class.getName());
|
||||
static final Logger LOGGER = Logger.getLogger(IXmlReader.class.getName());
|
||||
|
||||
static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
|
||||
static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -27,13 +27,13 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.holders.RangeAbilityPointsHolder;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class AbilityPointsData implements DocumentParser
|
||||
public final class AbilityPointsData implements IXmlReader
|
||||
{
|
||||
private final List<RangeAbilityPointsHolder> _points = new ArrayList<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -31,7 +31,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.L2AccessLevel;
|
||||
import com.l2jserver.gameserver.model.L2AdminCommandAccessRight;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
@@ -41,16 +41,17 @@ import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* Loads administrator access levels and commands.
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class AdminTable implements DocumentParser
|
||||
public final class AdminData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2AccessLevel> _accessLevels = new HashMap<>();
|
||||
private static final Map<String, L2AdminCommandAccessRight> _adminCommandAccessRights = new HashMap<>();
|
||||
private static final Map<L2PcInstance, Boolean> _gmList = new FastMap<L2PcInstance, Boolean>().shared();
|
||||
private final Map<Integer, L2AccessLevel> _accessLevels = new HashMap<>();
|
||||
private final Map<String, L2AdminCommandAccessRight> _adminCommandAccessRights = new HashMap<>();
|
||||
private final Map<L2PcInstance, Boolean> _gmList = new FastMap<L2PcInstance, Boolean>().shared();
|
||||
private int _highestLevel = 0;
|
||||
|
||||
protected AdminTable()
|
||||
protected AdminData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -61,9 +62,9 @@ public class AdminTable implements DocumentParser
|
||||
_accessLevels.clear();
|
||||
_adminCommandAccessRights.clear();
|
||||
parseDatapackFile("config/accessLevels.xml");
|
||||
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _accessLevels.size() + " Access Levels");
|
||||
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _accessLevels.size() + " Access Levels.");
|
||||
parseDatapackFile("config/adminCommands.xml");
|
||||
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _adminCommandAccessRights.size() + " Access Commands");
|
||||
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _adminCommandAccessRights.size() + " Access Commands.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -344,13 +345,13 @@ public class AdminTable implements DocumentParser
|
||||
* Gets the single instance of AdminTable.
|
||||
* @return AccessLevels: the one and only instance of this class<br>
|
||||
*/
|
||||
public static AdminTable getInstance()
|
||||
public static AdminData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final AdminTable _instance = new AdminTable();
|
||||
protected static final AdminData _instance = new AdminData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,17 +25,18 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.L2ArmorSet;
|
||||
import com.l2jserver.gameserver.model.holders.ArmorsetSkillHolder;
|
||||
import com.l2jserver.gameserver.model.holders.SkillHolder;
|
||||
|
||||
/**
|
||||
* Loads armor set bonuses.
|
||||
* @author godson, Luno, UnAfraid
|
||||
*/
|
||||
public final class ArmorSetsData implements DocumentParser
|
||||
public final class ArmorSetsData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2ArmorSet> _armorSets = new HashMap<>();
|
||||
private final Map<Integer, L2ArmorSet> _armorSets = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new armor sets data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.enums.Sex;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
@@ -35,7 +35,7 @@ import com.l2jserver.gameserver.model.beautyshop.BeautyItem;
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public final class BeautyShopData implements DocumentParser
|
||||
public final class BeautyShopData implements IXmlReader
|
||||
{
|
||||
private final Map<Race, Map<Sex, BeautyData>> _beautyList = new HashMap<>();
|
||||
private final Map<Sex, BeautyData> _beautyData = new HashMap<>();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
@@ -33,16 +33,18 @@ import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.model.buylist.L2BuyList;
|
||||
import com.l2jserver.gameserver.model.buylist.Product;
|
||||
import com.l2jserver.gameserver.model.items.L2Item;
|
||||
import com.l2jserver.util.file.filter.NumericNameFilter;
|
||||
|
||||
/**
|
||||
* Loads buy lists for NPCs.
|
||||
* @author NosBit
|
||||
*/
|
||||
public final class BuyListData implements DocumentParser
|
||||
public final class BuyListData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, L2BuyList> _buyLists = new HashMap<>();
|
||||
private static final FileFilter NUMERIC_FILTER = new NumericNameFilter();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -29,14 +29,14 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.CastleSide;
|
||||
import com.l2jserver.gameserver.model.holders.CastleSpawnHolder;
|
||||
|
||||
/**
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class CastleData implements DocumentParser
|
||||
public final class CastleData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, List<CastleSpawnHolder>> _castles = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -29,14 +29,14 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
|
||||
/**
|
||||
* This class holds different categories containing class ids or npc ids.
|
||||
* Loads the category data with Class or NPC IDs.
|
||||
* @author NosBit, xban1x
|
||||
*/
|
||||
public final class CategoryData implements DocumentParser
|
||||
public final class CategoryData implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(CategoryData.class.getName());
|
||||
|
||||
@@ -90,10 +90,10 @@ public final class CategoryData implements DocumentParser
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if id is in category.
|
||||
* @param type The category type.
|
||||
* @param id The id to be checked.
|
||||
* @return {@code true} if id is in category, {@code false} if id is not in category or category was not found.
|
||||
* Checks if ID is in category.
|
||||
* @param type The category type
|
||||
* @param id The id to be checked
|
||||
* @return {@code true} if id is in category, {@code false} if id is not in category or category was not found
|
||||
*/
|
||||
public boolean isInCategory(CategoryType type, int id)
|
||||
{
|
||||
@@ -107,8 +107,9 @@ public final class CategoryData implements DocumentParser
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the category by category type.
|
||||
* @param type The category type
|
||||
* @return A {@code Set} containing all the ids in category if category is found, {@code null} if category was not found.
|
||||
* @return A {@code Set} containing all the IDs in category if category is found, {@code null} if category was not found
|
||||
*/
|
||||
public Set<Integer> getCategoryByType(CategoryType type)
|
||||
{
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,18 +25,17 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.base.ClassId;
|
||||
import com.l2jserver.gameserver.model.base.ClassInfo;
|
||||
|
||||
/**
|
||||
* This class holds the list of classes and it's info.<br>
|
||||
* It's in <i>beta</i> state, so it's expected to change over time.
|
||||
* Loads the the list of classes and it's info.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public final class ClassListData implements DocumentParser
|
||||
public final class ClassListData implements IXmlReader
|
||||
{
|
||||
private static final Map<ClassId, ClassInfo> _classData = new HashMap<>();
|
||||
private final Map<ClassId, ClassInfo> _classData = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new class list data.
|
||||
@@ -98,7 +97,7 @@ public final class ClassListData implements DocumentParser
|
||||
* @param classId the class Id.
|
||||
* @return the class info related to the given {@code classId}.
|
||||
*/
|
||||
public ClassInfo getClass(final ClassId classId)
|
||||
public ClassInfo getClass(ClassId classId)
|
||||
{
|
||||
return _classData.get(classId);
|
||||
}
|
||||
@@ -108,7 +107,7 @@ public final class ClassListData implements DocumentParser
|
||||
* @param classId the class Id as integer.
|
||||
* @return the class info related to the given {@code classId}.
|
||||
*/
|
||||
public ClassInfo getClass(final int classId)
|
||||
public ClassInfo getClass(int classId)
|
||||
{
|
||||
final ClassId id = ClassId.getClassId(classId);
|
||||
return (id != null) ? _classData.get(id) : null;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -30,7 +30,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.instancemanager.InstanceManager;
|
||||
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
|
||||
@@ -40,17 +40,17 @@ import com.l2jserver.gameserver.model.actor.templates.L2DoorTemplate;
|
||||
import com.l2jserver.gameserver.pathfinding.AbstractNodeLoc;
|
||||
|
||||
/**
|
||||
* Loads doors.
|
||||
* @author JIV, GodKratos, UnAfraid
|
||||
*/
|
||||
public class DoorTable implements DocumentParser
|
||||
public class DoorData implements IXmlReader
|
||||
{
|
||||
private static final Map<String, Set<Integer>> _groups = new HashMap<>();
|
||||
|
||||
private final Map<Integer, L2DoorInstance> _doors = new HashMap<>();
|
||||
private final Map<Integer, StatsSet> _templates = new HashMap<>();
|
||||
private final Map<Integer, List<L2DoorInstance>> _regions = new HashMap<>();
|
||||
|
||||
protected DoorTable()
|
||||
protected DoorData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -251,13 +251,13 @@ public class DoorTable implements DocumentParser
|
||||
return false;
|
||||
}
|
||||
|
||||
public static DoorTable getInstance()
|
||||
public static DoorData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final DoorTable _instance = new DoorTable();
|
||||
protected static final DoorData _instance = new DoorData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,20 +26,20 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.items.enchant.EnchantScroll;
|
||||
import com.l2jserver.gameserver.model.items.enchant.EnchantSupportItem;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* This class holds the Enchant Item information.
|
||||
* Loads item enchant data.
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class EnchantItemData implements DocumentParser
|
||||
public class EnchantItemData implements IXmlReader
|
||||
{
|
||||
public static final Map<Integer, EnchantScroll> _scrolls = new HashMap<>();
|
||||
public static final Map<Integer, EnchantSupportItem> _supports = new HashMap<>();
|
||||
private final Map<Integer, EnchantScroll> _scrolls = new HashMap<>();
|
||||
private final Map<Integer, EnchantSupportItem> _supports = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new enchant item data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,7 +26,8 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.model.holders.RangeChanceHolder;
|
||||
import com.l2jserver.gameserver.model.items.L2Item;
|
||||
import com.l2jserver.gameserver.model.items.enchant.EnchantItemGroup;
|
||||
@@ -37,7 +38,7 @@ import com.l2jserver.gameserver.util.Util;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class EnchantItemGroupsData implements DocumentParser
|
||||
public final class EnchantItemGroupsData implements IXmlReader
|
||||
{
|
||||
private final Map<String, EnchantItemGroup> _itemGroups = new HashMap<>();
|
||||
private final Map<Integer, EnchantScrollGroup> _scrollGroups = new HashMap<>();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -27,7 +27,8 @@ import java.util.Map;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.enums.StatFunction;
|
||||
import com.l2jserver.gameserver.model.items.L2Item;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
@@ -39,7 +40,7 @@ import com.l2jserver.gameserver.model.stats.functions.FuncTemplate;
|
||||
* This class holds the Enchant HP Bonus Data.
|
||||
* @author MrPoke, Zoey76
|
||||
*/
|
||||
public class EnchantItemHPBonusData implements DocumentParser
|
||||
public class EnchantItemHPBonusData implements IXmlReader
|
||||
{
|
||||
private final Map<CrystalType, List<Integer>> _armorHPBonuses = new EnumMap<>(CrystalType.class);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +25,7 @@ import java.util.logging.Level;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.model.options.EnchantOptions;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
@@ -33,7 +33,7 @@ import com.l2jserver.gameserver.util.Util;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class EnchantItemOptionsData implements DocumentParser
|
||||
public class EnchantItemOptionsData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, Map<Integer, EnchantOptions>> _data = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.L2EnchantSkillGroup;
|
||||
import com.l2jserver.gameserver.model.L2EnchantSkillGroup.EnchantSkillHolder;
|
||||
import com.l2jserver.gameserver.model.L2EnchantSkillLearn;
|
||||
@@ -39,7 +39,7 @@ import com.l2jserver.gameserver.model.skills.Skill;
|
||||
* This class holds the Enchant Groups information.
|
||||
* @author Micr0
|
||||
*/
|
||||
public class EnchantSkillGroupsData implements DocumentParser
|
||||
public class EnchantSkillGroupsData implements IXmlReader
|
||||
{
|
||||
public static final int NORMAL_ENCHANT_COST_MULTIPLIER = Config.NORMAL_ENCHANT_COST_MULTIPLIER;
|
||||
public static final int SAFE_ENCHANT_COST_MULTIPLIER = Config.SAFE_ENCHANT_COST_MULTIPLIER;
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,13 +25,13 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
|
||||
/**
|
||||
* This class holds the Experience points for each level for players and pets.
|
||||
* @author mrTJO
|
||||
*/
|
||||
public final class ExperienceTable implements DocumentParser
|
||||
public final class ExperienceData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, Long> _expTable = new HashMap<>();
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class ExperienceTable implements DocumentParser
|
||||
/**
|
||||
* Instantiates a new experience table.
|
||||
*/
|
||||
protected ExperienceTable()
|
||||
protected ExperienceData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -108,13 +108,13 @@ public final class ExperienceTable implements DocumentParser
|
||||
* Gets the single instance of ExperienceTable.
|
||||
* @return single instance of ExperienceTable
|
||||
*/
|
||||
public static ExperienceTable getInstance()
|
||||
public static ExperienceData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final ExperienceTable _instance = new ExperienceTable();
|
||||
protected static final ExperienceData _instance = new ExperienceData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.fishing.L2Fish;
|
||||
|
||||
@@ -35,11 +35,11 @@ import com.l2jserver.gameserver.model.fishing.L2Fish;
|
||||
* This class holds the Fish information.
|
||||
* @author nonom
|
||||
*/
|
||||
public final class FishData implements DocumentParser
|
||||
public final class FishData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2Fish> _fishNormal = new HashMap<>();
|
||||
private static final Map<Integer, L2Fish> _fishEasy = new HashMap<>();
|
||||
private static final Map<Integer, L2Fish> _fishHard = new HashMap<>();
|
||||
private final Map<Integer, L2Fish> _fishNormal = new HashMap<>();
|
||||
private final Map<Integer, L2Fish> _fishEasy = new HashMap<>();
|
||||
private final Map<Integer, L2Fish> _fishHard = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new fish data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.fishing.L2FishingMonster;
|
||||
|
||||
@@ -33,9 +33,9 @@ import com.l2jserver.gameserver.model.fishing.L2FishingMonster;
|
||||
* This class holds the Fishing Monsters information.
|
||||
* @author nonom
|
||||
*/
|
||||
public final class FishingMonstersData implements DocumentParser
|
||||
public final class FishingMonstersData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2FishingMonster> _fishingMonstersData = new HashMap<>();
|
||||
private final Map<Integer, L2FishingMonster> _fishingMonstersData = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new fishing monsters data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.fishing.L2FishingRod;
|
||||
|
||||
@@ -33,9 +33,9 @@ import com.l2jserver.gameserver.model.fishing.L2FishingRod;
|
||||
* This class holds the Fishing Rods information.
|
||||
* @author nonom
|
||||
*/
|
||||
public final class FishingRodsData implements DocumentParser
|
||||
public final class FishingRodsData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2FishingRod> _fishingRods = new HashMap<>();
|
||||
private final Map<Integer, L2FishingRod> _fishingRods = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new fishing rods data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.base.ClassId;
|
||||
import com.l2jserver.gameserver.model.items.L2Henna;
|
||||
@@ -39,9 +39,9 @@ import com.l2jserver.gameserver.model.items.L2Henna;
|
||||
* Allowed classes to wear each henna.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public final class HennaData implements DocumentParser
|
||||
public final class HennaData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2Henna> _hennaList = new HashMap<>();
|
||||
private final Map<Integer, L2Henna> _hennaList = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new henna data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
@@ -24,14 +24,14 @@ import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.GameTimeController;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
|
||||
/**
|
||||
* This class load, holds and calculates the hit condition bonuses.
|
||||
* @author Nik
|
||||
*/
|
||||
public final class HitConditionBonus implements DocumentParser
|
||||
public final class HitConditionBonusData implements IXmlReader
|
||||
{
|
||||
private int frontBonus = 0;
|
||||
private int sideBonus = 0;
|
||||
@@ -44,7 +44,7 @@ public final class HitConditionBonus implements DocumentParser
|
||||
/**
|
||||
* Instantiates a new hit condition bonus.
|
||||
*/
|
||||
protected HitConditionBonus()
|
||||
protected HitConditionBonusData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -69,34 +69,46 @@ public final class HitConditionBonus implements DocumentParser
|
||||
@Override
|
||||
public void parseDocument(Document doc)
|
||||
{
|
||||
final Node n = doc.getFirstChild();
|
||||
NamedNodeMap attrs;
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
for (Node d = doc.getFirstChild().getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
attrs = d.getAttributes();
|
||||
NamedNodeMap attrs = d.getAttributes();
|
||||
switch (d.getNodeName())
|
||||
{
|
||||
case "front":
|
||||
{
|
||||
frontBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
case "side":
|
||||
{
|
||||
sideBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
case "back":
|
||||
{
|
||||
backBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
case "high":
|
||||
{
|
||||
highBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
case "low":
|
||||
{
|
||||
lowBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
case "dark":
|
||||
{
|
||||
darkBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
case "rain":
|
||||
{
|
||||
rainBonus = parseInteger(attrs, "val");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,13 +162,13 @@ public final class HitConditionBonus implements DocumentParser
|
||||
* Gets the single instance of HitConditionBonus.
|
||||
* @return single instance of HitConditionBonus
|
||||
*/
|
||||
public static HitConditionBonus getInstance()
|
||||
public static HitConditionBonusData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final HitConditionBonus _instance = new HitConditionBonus();
|
||||
protected static final HitConditionBonusData _instance = new HitConditionBonusData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -28,7 +28,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.base.ClassId;
|
||||
import com.l2jserver.gameserver.model.items.PcItemTemplate;
|
||||
@@ -38,11 +38,11 @@ import com.l2jserver.gameserver.model.items.PcItemTemplate;
|
||||
* What items get each newly created character and if this item is equipped upon creation (<b>Requires the item to be equippable</b>).
|
||||
* @author Zoey76
|
||||
*/
|
||||
public final class InitialEquipmentData implements DocumentParser
|
||||
public final class InitialEquipmentData implements IXmlReader
|
||||
{
|
||||
private final Map<ClassId, List<PcItemTemplate>> _initialEquipmentList = new HashMap<>();
|
||||
private static final String NORMAL = "data/stats/initialEquipment.xml";
|
||||
private static final String EVENT = "data/stats/initialEquipmentEvent.xml";
|
||||
private final Map<ClassId, List<PcItemTemplate>> _initialEquipmentList = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new initial equipment data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.MacroType;
|
||||
import com.l2jserver.gameserver.enums.ShortcutType;
|
||||
import com.l2jserver.gameserver.model.Macro;
|
||||
@@ -43,7 +43,7 @@ import com.l2jserver.gameserver.network.serverpackets.ShortCutRegister;
|
||||
* What shortcuts get each newly created character.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public final class InitialShortcutData implements DocumentParser
|
||||
public final class InitialShortcutData implements IXmlReader
|
||||
{
|
||||
private final Map<ClassId, List<Shortcut>> _initialShortcutData = new HashMap<>();
|
||||
private final List<Shortcut> _initialGlobalShortcutList = new ArrayList<>();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,14 +26,14 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.CrystalizationData;
|
||||
import com.l2jserver.gameserver.model.holders.ItemChanceHolder;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class ItemCrystalizationData implements DocumentParser
|
||||
public final class ItemCrystalizationData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, CrystalizationData> _items = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,12 +26,12 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class KarmaData implements DocumentParser
|
||||
public class KarmaData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, Double> _karmaTable = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
@@ -31,7 +31,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
@@ -46,18 +46,18 @@ import com.l2jserver.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
import com.l2jserver.util.file.filter.NumericNameFilter;
|
||||
|
||||
public final class MultisellData implements DocumentParser
|
||||
public final class MultisellData implements IXmlReader
|
||||
{
|
||||
public static final int PAGE_SIZE = 40;
|
||||
private final Map<Integer, ListContainer> _entries = new HashMap<>();
|
||||
|
||||
public static final int PAGE_SIZE = 40;
|
||||
// Special IDs.
|
||||
public static final int PC_BANG_POINTS = -100;
|
||||
public static final int CLAN_REPUTATION = -200;
|
||||
public static final int FAME = -300;
|
||||
|
||||
// Misc
|
||||
private static final FileFilter NUMERIC_FILTER = new NumericNameFilter();
|
||||
|
||||
private final Map<Integer, ListContainer> _entries = new HashMap<>();
|
||||
|
||||
protected MultisellData()
|
||||
{
|
||||
load();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -36,7 +36,8 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.enums.AISkillScope;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
@@ -55,7 +56,7 @@ import com.l2jserver.gameserver.util.Util;
|
||||
* NPC data parser.
|
||||
* @author NosBit
|
||||
*/
|
||||
public class NpcData implements DocumentParser
|
||||
public class NpcData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, L2NpcTemplate> _npcs = new ConcurrentHashMap<>();
|
||||
private final Map<String, Integer> _clans = new ConcurrentHashMap<>();
|
||||
@@ -806,7 +807,7 @@ public class NpcData implements DocumentParser
|
||||
* Once Spawn System gets reworked delete this class<br>
|
||||
* @author Zealar
|
||||
*/
|
||||
private final class MinionData implements DocumentParser
|
||||
private final class MinionData implements IXmlReader
|
||||
{
|
||||
public final Map<Integer, List<MinionHolder>> _tempMinions = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jserver.gameserver.model.options.Options;
|
||||
import com.l2jserver.gameserver.model.options.OptionsSkillHolder;
|
||||
@@ -37,11 +37,11 @@ import com.l2jserver.gameserver.model.stats.functions.FuncTemplate;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class OptionsData implements DocumentParser
|
||||
public class OptionData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, Options> _data = new HashMap<>();
|
||||
private final Map<Integer, Options> _optionData = new HashMap<>();
|
||||
|
||||
protected OptionsData()
|
||||
protected OptionData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -49,9 +49,9 @@ public class OptionsData implements DocumentParser
|
||||
@Override
|
||||
public synchronized void load()
|
||||
{
|
||||
_data.clear();
|
||||
_optionData.clear();
|
||||
parseDatapackDirectory("data/stats/options", false);
|
||||
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _data.size() + " Options.");
|
||||
LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _optionData.size() + " Options.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -123,7 +123,7 @@ public class OptionsData implements DocumentParser
|
||||
}
|
||||
}
|
||||
}
|
||||
_data.put(op.getId(), op);
|
||||
_optionData.put(op.getId(), op);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,20 +145,20 @@ public class OptionsData implements DocumentParser
|
||||
|
||||
public Options getOptions(int id)
|
||||
{
|
||||
return _data.get(id);
|
||||
return _optionData.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the single instance of OptionsData.
|
||||
* @return single instance of OptionsData
|
||||
*/
|
||||
public static final OptionsData getInstance()
|
||||
public static final OptionData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final OptionsData _instance = new OptionsData();
|
||||
protected static final OptionData _instance = new OptionData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +25,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.MountType;
|
||||
import com.l2jserver.gameserver.model.L2PetData;
|
||||
import com.l2jserver.gameserver.model.L2PetLevelData;
|
||||
@@ -36,9 +36,9 @@ import com.l2jserver.gameserver.model.StatsSet;
|
||||
* TODO: load and use all pet parameters.
|
||||
* @author Zoey76 (rework)
|
||||
*/
|
||||
public final class PetDataTable implements DocumentParser
|
||||
public final class PetDataTable implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2PetData> _pets = new HashMap<>();
|
||||
private final Map<Integer, L2PetData> _pets = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new pet data table.
|
||||
@@ -212,7 +212,7 @@ public final class PetDataTable implements DocumentParser
|
||||
* @param npcId the NPC ID to get its summoning item
|
||||
* @return summoning item for the given NPC ID
|
||||
*/
|
||||
public static int getPetItemsByNpc(int npcId)
|
||||
public int getPetItemsByNpc(int npcId)
|
||||
{
|
||||
return _pets.get(npcId).getItemId();
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -28,25 +28,25 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
|
||||
import com.l2jserver.gameserver.model.base.ClassId;
|
||||
|
||||
/**
|
||||
* This will be reworked Soon(tm).
|
||||
* Loads player's base stats.
|
||||
* @author Forsaiken, Zoey76, GKR
|
||||
*/
|
||||
public final class CharTemplateTable implements DocumentParser
|
||||
public final class PlayerTemplateData implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(CharTemplateTable.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(PlayerTemplateData.class.getName());
|
||||
|
||||
private static final Map<ClassId, L2PcTemplate> _charTemplates = new HashMap<>();
|
||||
private final Map<ClassId, L2PcTemplate> _playerTemplates = new HashMap<>();
|
||||
|
||||
private int _dataCount = 0;
|
||||
|
||||
protected CharTemplateTable()
|
||||
protected PlayerTemplateData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -54,9 +54,9 @@ public final class CharTemplateTable implements DocumentParser
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
_charTemplates.clear();
|
||||
_playerTemplates.clear();
|
||||
parseDatapackDirectory("data/stats/chars/baseStats", false);
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _charTemplates.size() + " character templates.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _playerTemplates.size() + " character templates.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _dataCount + " level up gain records.");
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public final class CharTemplateTable implements DocumentParser
|
||||
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.set("baseMDef", (set.getInt("baseMDefrear", 0) + set.getInt("baseMDeflear", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefneck", 0)));
|
||||
|
||||
_charTemplates.put(ClassId.getClassId(classId), new L2PcTemplate(set, creationPoints));
|
||||
_playerTemplates.put(ClassId.getClassId(classId), new L2PcTemplate(set, creationPoints));
|
||||
}
|
||||
else if ("lvlUpgainData".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
@@ -157,9 +157,9 @@ public final class CharTemplateTable implements DocumentParser
|
||||
{
|
||||
String nodeName = valNode.getNodeName();
|
||||
|
||||
if ((nodeName.startsWith("hp") || nodeName.startsWith("mp") || nodeName.startsWith("cp")) && _charTemplates.containsKey(ClassId.getClassId(classId)))
|
||||
if ((nodeName.startsWith("hp") || nodeName.startsWith("mp") || nodeName.startsWith("cp")) && _playerTemplates.containsKey(ClassId.getClassId(classId)))
|
||||
{
|
||||
_charTemplates.get(ClassId.getClassId(classId)).setUpgainValue(nodeName, level, Double.parseDouble(valNode.getTextContent()));
|
||||
_playerTemplates.get(ClassId.getClassId(classId)).setUpgainValue(nodeName, level, Double.parseDouble(valNode.getTextContent()));
|
||||
_dataCount++;
|
||||
}
|
||||
}
|
||||
@@ -171,23 +171,23 @@ public final class CharTemplateTable implements DocumentParser
|
||||
}
|
||||
}
|
||||
|
||||
public L2PcTemplate getTemplate(final ClassId classId)
|
||||
public L2PcTemplate getTemplate(ClassId classId)
|
||||
{
|
||||
return _charTemplates.get(classId);
|
||||
return _playerTemplates.get(classId);
|
||||
}
|
||||
|
||||
public L2PcTemplate getTemplate(final int classId)
|
||||
public L2PcTemplate getTemplate(int classId)
|
||||
{
|
||||
return _charTemplates.get(ClassId.getClassId(classId));
|
||||
return _playerTemplates.get(ClassId.getClassId(classId));
|
||||
}
|
||||
|
||||
public static final CharTemplateTable getInstance()
|
||||
public static final PlayerTemplateData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final CharTemplateTable _instance = new CharTemplateTable();
|
||||
protected static final PlayerTemplateData _instance = new PlayerTemplateData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -24,15 +24,15 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
|
||||
/**
|
||||
* This class holds the Player Xp Percent Lost Data for each level for players.
|
||||
* @author Zealar
|
||||
*/
|
||||
public final class PlayerXpPercentLostData implements DocumentParser
|
||||
public final class PlayerXpPercentLostData implements IXmlReader
|
||||
{
|
||||
private final int _maxlevel = ExperienceTable.getInstance().getMaxLevel();
|
||||
private final int _maxlevel = ExperienceData.getInstance().getMaxLevel();
|
||||
private final double[] _playerXpPercentLost = new double[_maxlevel + 1];
|
||||
|
||||
protected PlayerXpPercentLostData()
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.L2RecipeInstance;
|
||||
import com.l2jserver.gameserver.model.L2RecipeList;
|
||||
import com.l2jserver.gameserver.model.L2RecipeStatInstance;
|
||||
@@ -38,9 +38,9 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
* The Class RecipeData.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class RecipeData implements DocumentParser
|
||||
public class RecipeData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2RecipeList> _recipes = new HashMap<>();
|
||||
private final Map<Integer, L2RecipeList> _recipes = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new recipe data.
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
@@ -26,18 +26,18 @@ import java.util.logging.Level;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
|
||||
/**
|
||||
* @author NosBit
|
||||
*/
|
||||
public class SecondaryAuthData implements DocumentParser
|
||||
public class SecondaryAuthData implements IXmlReader
|
||||
{
|
||||
private final Set<String> _forbiddenPasswords = new HashSet<>();
|
||||
private boolean _enabled = false;
|
||||
private int _maxAttempts = 5;
|
||||
private int _banTime = 480;
|
||||
private String _recoveryLink = "";
|
||||
private final Set<String> _forbiddenPasswords = new HashSet<>();
|
||||
|
||||
protected SecondaryAuthData()
|
||||
{
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -28,7 +28,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
@@ -42,7 +42,7 @@ import com.l2jserver.gameserver.model.shuttle.L2ShuttleStop;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class ShuttleData implements DocumentParser
|
||||
public final class ShuttleData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, L2ShuttleData> _shuttles = new HashMap<>();
|
||||
private final Map<Integer, L2ShuttleInstance> _shuttleInstances = new HashMap<>();
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -27,7 +27,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.SiegeScheduleDate;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
@@ -35,7 +35,7 @@ import com.l2jserver.gameserver.util.Util;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class SiegeScheduleData implements DocumentParser
|
||||
public class SiegeScheduleData implements IXmlReader
|
||||
{
|
||||
private final List<SiegeScheduleDate> _scheduleData = new ArrayList<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -26,14 +26,14 @@ import java.util.Map;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.base.ClassId;
|
||||
|
||||
/**
|
||||
* Holds all skill learn data for all npcs.
|
||||
* @author xban1x
|
||||
*/
|
||||
public final class SkillLearnData implements DocumentParser
|
||||
public final class SkillLearnData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, List<ClassId>> _skillLearn = new HashMap<>();
|
||||
|
@@ -16,13 +16,14 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -34,7 +35,9 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.enums.SubclassType;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
@@ -74,7 +77,7 @@ import com.l2jserver.gameserver.model.skills.Skill;
|
||||
* For XML schema please refer to skillTrees.xsd in datapack in xsd folder and for parameters documentation refer to documentation.txt in skillTrees folder.<br>
|
||||
* @author Zoey76
|
||||
*/
|
||||
public final class SkillTreesData implements DocumentParser
|
||||
public final class SkillTreesData implements IXmlReader
|
||||
{
|
||||
// ClassId, FastMap of Skill Hash Code, L2SkillLearn
|
||||
private static final Map<ClassId, Map<Integer, L2SkillLearn>> _classSkillTrees = new HashMap<>();
|
||||
@@ -97,6 +100,8 @@ public final class SkillTreesData implements DocumentParser
|
||||
private static final Map<Integer, L2SkillLearn> _heroSkillTree = new HashMap<>();
|
||||
private static final Map<Integer, L2SkillLearn> _gameMasterSkillTree = new HashMap<>();
|
||||
private static final Map<Integer, L2SkillLearn> _gameMasterAuraSkillTree = new HashMap<>();
|
||||
// Remove skill tree
|
||||
private static final Map<ClassId, Set<Integer>> _removeSkillCache = new HashMap<>();
|
||||
|
||||
// Checker, sorted arrays of hash codes
|
||||
private Map<Integer, int[]> _skillsByClassIdHashCodes; // Occupation skills
|
||||
@@ -248,7 +253,9 @@ public final class SkillTreesData implements DocumentParser
|
||||
skillLearn.addSubclassConditions(parseInteger(attrs, "slot"), parseInteger(attrs, "lvl"));
|
||||
break;
|
||||
case "removeSkill":
|
||||
skillLearn.addRemoveSkills(parseInteger(attrs, "id"));
|
||||
final int removeSkillId = parseInteger(attrs, "id");
|
||||
skillLearn.addRemoveSkills(removeSkillId);
|
||||
_removeSkillCache.computeIfAbsent(classId, k -> new HashSet<>()).add(removeSkillId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -427,10 +434,6 @@ public final class SkillTreesData implements DocumentParser
|
||||
*/
|
||||
public Map<Integer, L2SkillLearn> getTransferSkillTree(ClassId classId)
|
||||
{
|
||||
if (classId.level() >= 3)
|
||||
{
|
||||
return getTransferSkillTree(classId.getParent());
|
||||
}
|
||||
return _transferSkillTrees.get(classId);
|
||||
}
|
||||
|
||||
@@ -655,9 +658,18 @@ public final class SkillTreesData implements DocumentParser
|
||||
return result;
|
||||
}
|
||||
|
||||
for (L2SkillLearn skill : skills.values())
|
||||
final boolean isAwaken = player.isInCategory(CategoryType.AWAKEN_GROUP);
|
||||
|
||||
for (Entry<Integer, L2SkillLearn> entry : skills.entrySet())
|
||||
{
|
||||
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && (!Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet) && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()))
|
||||
final L2SkillLearn skill = entry.getValue();
|
||||
|
||||
if (((skill.getSkillId() == CommonSkill.DIVINE_INSPIRATION.getId()) && (!Config.AUTO_LEARN_DIVINE_INSPIRATION && includeAutoGet) && !player.isGM()) || (!includeAutoGet && skill.isAutoGet()) || (!includeByFs && skill.isLearnedByFS()) || isRemoveSkill(classId, skill.getSkillId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isAwaken && !isCurrentClassSkillNoParent(classId, entry.getKey()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -877,12 +889,7 @@ public final class SkillTreesData implements DocumentParser
|
||||
public List<L2SkillLearn> getAvailableTransferSkills(L2PcInstance player)
|
||||
{
|
||||
final List<L2SkillLearn> result = new ArrayList<>();
|
||||
ClassId classId = player.getClassId();
|
||||
// If new classes are implemented over 3rd class, a different way should be implemented.
|
||||
if (classId.level() == 3)
|
||||
{
|
||||
classId = classId.getParent();
|
||||
}
|
||||
final ClassId classId = player.getClassId();
|
||||
|
||||
if (!_transferSkillTrees.containsKey(classId))
|
||||
{
|
||||
@@ -1208,13 +1215,9 @@ public final class SkillTreesData implements DocumentParser
|
||||
*/
|
||||
public L2SkillLearn getTransferSkill(int id, int lvl, ClassId classId)
|
||||
{
|
||||
if (classId.getParent() != null)
|
||||
if (_transferSkillTrees.get(classId) != null)
|
||||
{
|
||||
final ClassId parentId = classId.getParent();
|
||||
if (_transferSkillTrees.get(parentId) != null)
|
||||
{
|
||||
return _transferSkillTrees.get(parentId).get(SkillData.getSkillHashCode(id, lvl));
|
||||
}
|
||||
return _transferSkillTrees.get(classId).get(SkillData.getSkillHashCode(id, lvl));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1330,7 +1333,7 @@ public final class SkillTreesData implements DocumentParser
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (minLevelForNewSkill == skill.getGetLevel())
|
||||
if (minLevelForNewSkill <= skill.getGetLevel())
|
||||
{
|
||||
final Skill oldSkill = player.getKnownSkill(skill.getSkillId());
|
||||
if (oldSkill != null)
|
||||
@@ -1350,6 +1353,20 @@ public final class SkillTreesData implements DocumentParser
|
||||
return result;
|
||||
}
|
||||
|
||||
public void cleanSkillUponAwakening(L2PcInstance player)
|
||||
{
|
||||
for (Skill skill : player.getAllSkills())
|
||||
{
|
||||
final int maxLvl = SkillData.getInstance().getMaxLevel(skill.getId());
|
||||
final int hashCode = SkillData.getSkillHashCode(skill.getId(), maxLvl);
|
||||
|
||||
if (!isCurrentClassSkillNoParent(player.getClassId(), hashCode) && !isRemoveSkill(player.getClassId(), skill.getId()))
|
||||
{
|
||||
player.removeSkill(skill, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is hero skill.
|
||||
* @param skillId the Id of the skill to check
|
||||
@@ -1422,6 +1439,16 @@ public final class SkillTreesData implements DocumentParser
|
||||
return _subClassChangeSkillTree.containsKey(SkillData.getSkillHashCode(skillId, skillLevel));
|
||||
}
|
||||
|
||||
public boolean isRemoveSkill(ClassId classId, int skillId)
|
||||
{
|
||||
return _removeSkillCache.getOrDefault(classId, Collections.emptySet()).contains(skillId);
|
||||
}
|
||||
|
||||
public boolean isCurrentClassSkillNoParent(ClassId classId, Integer hashCode)
|
||||
{
|
||||
return _classSkillTrees.getOrDefault(classId, Collections.emptyMap()).containsKey(hashCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the skills.
|
||||
* @param gmchar the player to add the Game Master skills
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2StaticObjectInstance;
|
||||
@@ -36,14 +36,14 @@ import com.l2jserver.gameserver.model.actor.templates.L2CharTemplate;
|
||||
* This class loads and holds all static object data.
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class StaticObjects implements DocumentParser
|
||||
public final class StaticObjectData implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, L2StaticObjectInstance> _staticObjects = new HashMap<>();
|
||||
private final Map<Integer, L2StaticObjectInstance> _staticObjects = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new static objects.
|
||||
*/
|
||||
protected StaticObjects()
|
||||
protected StaticObjectData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
@@ -111,13 +111,13 @@ public final class StaticObjects implements DocumentParser
|
||||
* Gets the single instance of StaticObjects.
|
||||
* @return single instance of StaticObjects
|
||||
*/
|
||||
public static StaticObjects getInstance()
|
||||
public static StaticObjectData getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final StaticObjects _instance = new StaticObjects();
|
||||
protected static final StaticObjectData _instance = new StaticObjectData();
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.teleporter.TeleportHolder;
|
||||
import com.l2jserver.gameserver.model.teleporter.TeleportLocation;
|
||||
@@ -35,7 +35,7 @@ import com.l2jserver.gameserver.model.teleporter.TeleportType;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class TeleportersData implements DocumentParser
|
||||
public class TeleportersData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, TeleportHolder> _teleporters = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -26,7 +26,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.transform.Transform;
|
||||
@@ -40,7 +40,7 @@ import com.l2jserver.gameserver.network.serverpackets.ExBasicActionList;
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class TransformData implements DocumentParser
|
||||
public final class TransformData implements IXmlReader
|
||||
{
|
||||
private final Map<Integer, Transform> _transformData = new HashMap<>();
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.datatables;
|
||||
package com.l2jserver.gameserver.data.xml.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -27,14 +27,14 @@ import java.util.logging.Logger;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.ActionKey;
|
||||
|
||||
/**
|
||||
* UI Data parser.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class UIData implements DocumentParser
|
||||
public class UIData implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(UIData.class.getName());
|
||||
|
@@ -33,6 +33,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.data.xml.impl.OptionData;
|
||||
import com.l2jserver.gameserver.model.L2Augmentation;
|
||||
import com.l2jserver.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jserver.gameserver.model.items.L2Item;
|
||||
@@ -42,11 +43,12 @@ import com.l2jserver.gameserver.network.clientpackets.AbstractRefinePacket;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* This class manages the augmentation data and can also create new augmentations.
|
||||
* Loads augmentation bonuses and skills.
|
||||
* @author durgus, Gigiikun, Sandro, UnAfraid
|
||||
*/
|
||||
public class AugmentationData
|
||||
{
|
||||
// Zoey76: TODO: Implement using IXmlReader.
|
||||
private static final Logger LOGGER = Logger.getLogger(AugmentationData.class.getName());
|
||||
|
||||
// stats
|
||||
@@ -974,7 +976,7 @@ public class AugmentationData
|
||||
{
|
||||
// second augmentation (skill)
|
||||
stat34 = base + Rnd.get(skillsLength);
|
||||
op = OptionsData.getInstance().getOptions(stat34);
|
||||
op = OptionData.getInstance().getOptions(stat34);
|
||||
}
|
||||
|
||||
if ((op == null) || (!op.hasActiveSkill() && !op.hasPassiveSkill() && !op.hasActivationSkills()))
|
||||
|
@@ -53,6 +53,7 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
*/
|
||||
public final class BotReportTable
|
||||
{
|
||||
// Zoey76: TODO: Split XML parsing from SQL operations, use IXmlReader instead of SAXParser.
|
||||
private static final Logger LOGGER = Logger.getLogger(BotReportTable.class.getName());
|
||||
|
||||
private static final int COLUMN_BOT_ID = 1;
|
||||
|
@@ -34,6 +34,7 @@ import javolution.util.FastMap;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantItemHPBonusData;
|
||||
import com.l2jserver.gameserver.engines.DocumentEngine;
|
||||
import com.l2jserver.gameserver.enums.ItemLocation;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
@@ -298,24 +299,6 @@ public class ItemTable
|
||||
return createItem(process, itemId, count, actor, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a dummy item.<br>
|
||||
* <U><I>Concept :</I></U><BR>
|
||||
* Dummy item is created by setting the ID of the object in the world at null value
|
||||
* @param itemId : int designating the item
|
||||
* @return L2ItemInstance designating the dummy item created
|
||||
*/
|
||||
public L2ItemInstance createDummyItem(int itemId)
|
||||
{
|
||||
L2Item item = getTemplate(itemId);
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
L2ItemInstance temp = new L2ItemInstance(0, item);
|
||||
return temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the L2ItemInstance.<br>
|
||||
* <B><U> Actions</U> :</B>
|
||||
|
@@ -44,6 +44,7 @@ import com.l2jserver.gameserver.model.entity.Castle;
|
||||
*/
|
||||
public class MerchantPriceConfigTable implements InstanceListManager
|
||||
{
|
||||
// Zoey76: TODO: Implement using IXmlReader.
|
||||
private static Logger LOGGER = Logger.getLogger(MerchantPriceConfigTable.class.getName());
|
||||
|
||||
public static MerchantPriceConfigTable getInstance()
|
||||
|
@@ -28,6 +28,7 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jserver.gameserver.engines.DocumentEngine;
|
||||
import com.l2jserver.gameserver.model.skills.CommonSkill;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
@@ -183,4 +184,4 @@ public final class SkillData
|
||||
{
|
||||
protected static final SkillData _instance = new SkillData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -39,7 +39,8 @@ import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.instancemanager.DayNightSpawnManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ZoneManager;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
@@ -50,7 +51,7 @@ import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
* Spawn data retriever.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public final class SpawnTable implements DocumentParser
|
||||
public final class SpawnTable implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(SpawnTable.class.getName());
|
||||
// SQL
|
||||
|
@@ -61,7 +61,8 @@ import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanCreateBase;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanEscape;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanRefuelAirship;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanResurrect;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanSummon;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanSummonPet;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanSummonServitor;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanSummonSiegeGolem;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanSweep;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerCanSwitchSubclass;
|
||||
@@ -79,6 +80,7 @@ import com.l2jserver.gameserver.model.conditions.ConditionPlayerGrade;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerHasCastle;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerHasClanHall;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerHasFort;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerHasFreeSummonPoints;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerHasPet;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerHp;
|
||||
import com.l2jserver.gameserver.model.conditions.ConditionPlayerImmobile;
|
||||
@@ -847,9 +849,19 @@ public abstract class DocumentBase
|
||||
cond = joinAnd(cond, new ConditionPlayerCanResurrect(Boolean.parseBoolean(a.getNodeValue())));
|
||||
break;
|
||||
}
|
||||
case "cansummon":
|
||||
case "cansummonpet":
|
||||
{
|
||||
cond = joinAnd(cond, new ConditionPlayerCanSummon(Boolean.parseBoolean(a.getNodeValue())));
|
||||
cond = joinAnd(cond, new ConditionPlayerCanSummonPet(Boolean.parseBoolean(a.getNodeValue())));
|
||||
break;
|
||||
}
|
||||
case "cansummonservitor":
|
||||
{
|
||||
cond = joinAnd(cond, new ConditionPlayerCanSummonServitor(Boolean.parseBoolean(a.getNodeValue())));
|
||||
break;
|
||||
}
|
||||
case "hasfreesummonpoints":
|
||||
{
|
||||
cond = joinAnd(cond, new ConditionPlayerHasFreeSummonPoints(Integer.parseInt(a.getNodeValue())));
|
||||
break;
|
||||
}
|
||||
case "cansummonsiegegolem":
|
||||
|
@@ -28,7 +28,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.EnchantSkillGroupsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantSkillGroupsData;
|
||||
import com.l2jserver.gameserver.engines.DocumentBase;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.enums;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.CategoryData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.CategoryData;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
|
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.geoeditorcon;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* @author Dezmond
|
||||
*/
|
||||
public class GeoEditorListener extends Thread
|
||||
{
|
||||
private static GeoEditorListener _instance;
|
||||
private static final int PORT = 9011;
|
||||
private static final Logger _log = Logger.getLogger(GeoEditorListener.class.getName());
|
||||
private final ServerSocket _serverSocket;
|
||||
private GeoEditorThread _geoEditor;
|
||||
|
||||
public static GeoEditorListener getInstance()
|
||||
{
|
||||
synchronized (GeoEditorListener.class)
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
_instance = new GeoEditorListener();
|
||||
_instance.start();
|
||||
_log.info("GeoEditorListener Initialized.");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
_log.log(Level.SEVERE, "Error creating geoeditor listener! " + e.getMessage(), e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
private GeoEditorListener() throws IOException
|
||||
{
|
||||
_serverSocket = new ServerSocket(PORT);
|
||||
}
|
||||
|
||||
public GeoEditorThread getThread()
|
||||
{
|
||||
return _geoEditor;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
if ((_geoEditor != null) && _geoEditor.isWorking())
|
||||
{
|
||||
return "Geoeditor connected.";
|
||||
}
|
||||
return "Geoeditor not connected.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try (Socket connection = _serverSocket.accept())
|
||||
{
|
||||
while (!isInterrupted())
|
||||
{
|
||||
if ((_geoEditor != null) && _geoEditor.isWorking())
|
||||
{
|
||||
_log.warning("Geoeditor already connected!");
|
||||
connection.close();
|
||||
continue;
|
||||
}
|
||||
_log.info("Received geoeditor connection from: " + connection.getInetAddress().getHostAddress());
|
||||
_geoEditor = new GeoEditorThread(connection);
|
||||
_geoEditor.start();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "GeoEditorListener: " + e.getMessage(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
_serverSocket.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "GeoEditorListener: " + e.getMessage(), e);
|
||||
}
|
||||
_log.warning("GeoEditorListener Closed!");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,287 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* L2J Server is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.geoeditorcon;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javolution.util.FastList;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Luno, Dezmond
|
||||
*/
|
||||
public class GeoEditorThread extends Thread
|
||||
{
|
||||
private static Logger _log = Logger.getLogger(GeoEditorThread.class.getName());
|
||||
|
||||
private boolean _working = false;
|
||||
|
||||
private int _mode = 0; // 0 - don't send coords, 1 - send each
|
||||
|
||||
// validateposition from client, 2 - send in intervals of _sendDelay ms.
|
||||
private int _sendDelay = 1000; // default - once in second
|
||||
|
||||
private final Socket _geSocket;
|
||||
|
||||
private OutputStream _out;
|
||||
|
||||
private final FastList<L2PcInstance> _gms;
|
||||
|
||||
public GeoEditorThread(Socket ge)
|
||||
{
|
||||
_geSocket = ge;
|
||||
_working = true;
|
||||
_gms = new FastList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void interrupt()
|
||||
{
|
||||
try
|
||||
{
|
||||
_geSocket.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
super.interrupt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
_out = _geSocket.getOutputStream();
|
||||
int timer = 0;
|
||||
|
||||
while (_working)
|
||||
{
|
||||
if (!isConnected())
|
||||
{
|
||||
_working = false;
|
||||
}
|
||||
|
||||
if ((_mode == 2) && (timer > _sendDelay))
|
||||
{
|
||||
for (L2PcInstance gm : _gms)
|
||||
{
|
||||
if (!gm.getClient().getConnection().isClosed())
|
||||
{
|
||||
sendGmPosition(gm);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gms.remove(gm);
|
||||
}
|
||||
}
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
sleep(100);
|
||||
if (_mode == 2)
|
||||
{
|
||||
timer += 100;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "GeoEditor disconnected. " + e.getMessage(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
_geSocket.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
_working = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void sendGmPosition(int gx, int gy, short z)
|
||||
{
|
||||
if (!isConnected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
synchronized (_out)
|
||||
{
|
||||
writeC(0x0b); // length 11 bytes!
|
||||
writeC(0x01); // Cmd = save cell;
|
||||
writeD(gx); // Global coord X;
|
||||
writeD(gy); // Global coord Y;
|
||||
writeH(z); // Coord Z;
|
||||
_out.flush();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "GeoEditor disconnected. " + e.getMessage(), e);
|
||||
_working = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
_geSocket.close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
_working = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void sendGmPosition(L2PcInstance _gm)
|
||||
{
|
||||
sendGmPosition(_gm.getX(), _gm.getY(), (short) _gm.getZ());
|
||||
}
|
||||
|
||||
public void sendPing()
|
||||
{
|
||||
if (!isConnected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
synchronized (_out)
|
||||
{
|
||||
writeC(0x01); // length 1 byte!
|
||||
writeC(0x02); // Cmd = ping (dummy packet for connection
|
||||
// test);
|
||||
_out.flush();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.log(Level.WARNING, "GeoEditor disconnected. " + e.getMessage(), e);
|
||||
_working = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
_geSocket.close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
_working = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeD(int value) throws IOException
|
||||
{
|
||||
_out.write(value & 0xff);
|
||||
_out.write((value >> 8) & 0xff);
|
||||
_out.write((value >> 16) & 0xff);
|
||||
_out.write((value >> 24) & 0xff);
|
||||
}
|
||||
|
||||
private void writeH(int value) throws IOException
|
||||
{
|
||||
_out.write(value & 0xff);
|
||||
_out.write((value >> 8) & 0xff);
|
||||
}
|
||||
|
||||
private void writeC(int value) throws IOException
|
||||
{
|
||||
_out.write(value & 0xff);
|
||||
}
|
||||
|
||||
public void setMode(int value)
|
||||
{
|
||||
_mode = value;
|
||||
}
|
||||
|
||||
public void setTimer(int value)
|
||||
{
|
||||
if (value < 500)
|
||||
{
|
||||
_sendDelay = 500; // maximum - 2 times per second!
|
||||
}
|
||||
else if (value > 60000)
|
||||
{
|
||||
_sendDelay = 60000; // Minimum - 1 time per minute.
|
||||
}
|
||||
else
|
||||
{
|
||||
_sendDelay = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void addGM(L2PcInstance gm)
|
||||
{
|
||||
if (!_gms.contains(gm))
|
||||
{
|
||||
_gms.add(gm);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeGM(L2PcInstance gm)
|
||||
{
|
||||
if (_gms.contains(gm))
|
||||
{
|
||||
_gms.remove(gm);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isSend(L2PcInstance gm)
|
||||
{
|
||||
if ((_mode == 1) && _gms.contains(gm))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isConnected()
|
||||
{
|
||||
return _geSocket.isConnected() && !_geSocket.isClosed();
|
||||
}
|
||||
|
||||
public boolean isWorking()
|
||||
{
|
||||
sendPing();
|
||||
return _working;
|
||||
}
|
||||
|
||||
public int getMode()
|
||||
{
|
||||
return _mode;
|
||||
}
|
||||
}
|
@@ -107,7 +107,8 @@ public abstract class IdFactory
|
||||
"SELECT ally_id FROM clan_data WHERE ally_id >= ? AND ally_id < ?",
|
||||
"SELECT leader_id FROM clan_data WHERE leader_id >= ? AND leader_id < ?",
|
||||
"SELECT item_obj_id FROM pets WHERE item_obj_id >= ? AND item_obj_id < ?",
|
||||
"SELECT object_id FROM itemsonground WHERE object_id >= ? AND object_id < ?"
|
||||
"SELECT object_id FROM itemsonground WHERE object_id >= ? AND object_id < ?",
|
||||
"SELECT summonId FROM characters_summons WHERE summonId >= ? AND summonId < ?"
|
||||
};
|
||||
|
||||
//@formatter:off
|
||||
|
@@ -40,7 +40,7 @@ import org.w3c.dom.Node;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.ManorMode;
|
||||
import com.l2jserver.gameserver.model.CropProcure;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
@@ -58,7 +58,7 @@ import com.l2jserver.util.Rnd;
|
||||
* Castle manor system.
|
||||
* @author malyelfik
|
||||
*/
|
||||
public final class CastleManorManager implements DocumentParser, IStorable
|
||||
public final class CastleManorManager implements IXmlReader, IStorable
|
||||
{
|
||||
// SQL queries
|
||||
private static final String INSERT_PRODUCT = "INSERT INTO castle_manor_production VALUES (?, ?, ?, ?, ?, ?)";
|
||||
|
@@ -28,7 +28,7 @@ import java.util.logging.Logger;
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.ClanTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
|
@@ -28,7 +28,7 @@ import javolution.util.FastList;
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.model.entity.Fort;
|
||||
|
@@ -37,8 +37,8 @@ import javolution.util.FastMap;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.DoorTable;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeAttackTimeTask;
|
||||
import com.l2jserver.gameserver.instancemanager.tasks.FourSepulchersChangeCoolDownTimeTask;
|
||||
@@ -1501,7 +1501,7 @@ public final class FourSepulchersManager
|
||||
{
|
||||
try
|
||||
{
|
||||
L2DoorInstance door = DoorTable.getInstance().getDoor(doorId);
|
||||
L2DoorInstance door = DoorData.getInstance().getDoor(doorId);
|
||||
if (door != null)
|
||||
{
|
||||
door.closeMe();
|
||||
|
@@ -37,7 +37,7 @@ import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.instancemanager.tasks.GrandBossManagerStoreTask;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
|
@@ -32,7 +32,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.entity.Instance;
|
||||
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
|
||||
@@ -40,7 +40,7 @@ import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
|
||||
/**
|
||||
* @author evill33t, GodKratos
|
||||
*/
|
||||
public final class InstanceManager implements DocumentParser
|
||||
public final class InstanceManager implements IXmlReader
|
||||
{
|
||||
private static final Map<Integer, Instance> _instanceList = new FastMap<>();
|
||||
private final Map<Integer, InstanceWorld> _instanceWorlds = new FastMap<>();
|
||||
|
@@ -27,7 +27,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.L2MapRegion;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
@@ -46,7 +46,7 @@ import com.l2jserver.gameserver.model.zone.type.L2RespawnZone;
|
||||
/**
|
||||
* @author Nyaran
|
||||
*/
|
||||
public final class MapRegionManager implements DocumentParser
|
||||
public final class MapRegionManager implements IXmlReader
|
||||
{
|
||||
private static final Map<String, L2MapRegion> _regions = new HashMap<>();
|
||||
private static final String defaultRespawn = "talking_island_town";
|
||||
|
@@ -29,7 +29,7 @@ import java.util.logging.Logger;
|
||||
import javolution.util.FastList;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.enums.ItemLocation;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
|
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.datatables.AdminTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
import com.l2jserver.gameserver.enums.PetitionState;
|
||||
import com.l2jserver.gameserver.model.Petition;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
@@ -425,7 +425,7 @@ public final class PetitionManager
|
||||
|
||||
// Notify all GMs that a new petition has been submitted.
|
||||
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
|
||||
AdminTable.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), Say2.HERO_VOICE, "Petition System", msgContent));
|
||||
AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), Say2.HERO_VOICE, "Petition System", msgContent));
|
||||
|
||||
return newPetitionId;
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ import javolution.util.FastMap;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
|
@@ -28,7 +28,7 @@ import java.util.logging.Logger;
|
||||
import javolution.util.FastList;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
|
@@ -29,7 +29,7 @@ import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.instancemanager.tasks.StartMovingTask;
|
||||
import com.l2jserver.gameserver.model.L2NpcWalkerNode;
|
||||
import com.l2jserver.gameserver.model.L2WalkRoute;
|
||||
@@ -50,7 +50,7 @@ import com.l2jserver.gameserver.util.Broadcast;
|
||||
* This class manages walking monsters.
|
||||
* @author GKR
|
||||
*/
|
||||
public final class WalkingManager implements DocumentParser
|
||||
public final class WalkingManager implements IXmlReader
|
||||
{
|
||||
// Repeat style:
|
||||
// 0 - go back
|
||||
|
@@ -32,7 +32,7 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.engines.DocumentParser;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.L2WorldRegion;
|
||||
@@ -54,7 +54,7 @@ import com.l2jserver.gameserver.model.zone.type.NpcSpawnTerritory;
|
||||
* This class manages the zones
|
||||
* @author durgus
|
||||
*/
|
||||
public final class ZoneManager implements DocumentParser
|
||||
public final class ZoneManager implements IXmlReader
|
||||
{
|
||||
private static final Map<String, AbstractZoneSettings> _settings = new HashMap<>();
|
||||
|
||||
|
@@ -34,7 +34,7 @@ import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.NpcData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
|
||||
|
@@ -30,7 +30,7 @@ import java.util.logging.Logger;
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.CharNameTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CharNameTable;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.BlockListPacket;
|
||||
|
@@ -28,8 +28,8 @@ import java.util.logging.Logger;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.xml.impl.TransformData;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.datatables.TransformData;
|
||||
import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
|
||||
import com.l2jserver.gameserver.model.L2Party.messageType;
|
||||
import com.l2jserver.gameserver.model.actor.L2Attackable;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.AdminTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
@@ -222,7 +222,7 @@ public class L2AccessLevel
|
||||
return false;
|
||||
}
|
||||
|
||||
_childsAccessLevel = AdminTable.getInstance().getAccessLevel(_child);
|
||||
_childsAccessLevel = AdminData.getInstance().getAccessLevel(_child);
|
||||
}
|
||||
return ((_childsAccessLevel.getLevel() == accessLevel.getLevel()) || _childsAccessLevel.hasChildAccess(accessLevel));
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.AdminTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
@@ -57,7 +57,7 @@ public class L2AdminCommandAccessRight
|
||||
*/
|
||||
public boolean hasAccess(L2AccessLevel characterAccessLevel)
|
||||
{
|
||||
L2AccessLevel accessLevel = AdminTable.getInstance().getAccessLevel(_accessLevel);
|
||||
L2AccessLevel accessLevel = AdminData.getInstance().getAccessLevel(_accessLevel);
|
||||
return ((accessLevel.getLevel() == characterAccessLevel.getLevel()) || characterAccessLevel.hasChildAccess(accessLevel));
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.OptionsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.OptionData;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.options.Options;
|
||||
|
||||
@@ -57,7 +57,7 @@ public final class L2Augmentation
|
||||
|
||||
for (int stat : stats)
|
||||
{
|
||||
Options op = OptionsData.getInstance().getOptions(stat);
|
||||
Options op = OptionData.getInstance().getOptions(stat);
|
||||
if (op != null)
|
||||
{
|
||||
_options.add(op);
|
||||
|
@@ -36,9 +36,9 @@ import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Forum;
|
||||
import com.l2jserver.gameserver.communitybbs.Manager.ForumsBBSManager;
|
||||
import com.l2jserver.gameserver.datatables.CharNameTable;
|
||||
import com.l2jserver.gameserver.datatables.ClanTable;
|
||||
import com.l2jserver.gameserver.datatables.CrestTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CharNameTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CrestTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.enums.UserInfoType;
|
||||
import com.l2jserver.gameserver.instancemanager.CastleManager;
|
||||
|
@@ -28,7 +28,7 @@ import java.util.logging.Logger;
|
||||
import javolution.util.FastList;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.datatables.CharNameTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.CharNameTable;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.model;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.EnchantSkillGroupsData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.EnchantSkillGroupsData;
|
||||
import com.l2jserver.gameserver.model.L2EnchantSkillGroup.EnchantSkillHolder;
|
||||
|
||||
public final class L2EnchantSkillLearn
|
||||
|
@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.model;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.datatables.TerritoryTable;
|
||||
import com.l2jserver.gameserver.data.sql.impl.TerritoryTable;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2ControllableMobInstance;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.RecipeData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.RecipeData;
|
||||
|
||||
public class L2ManufactureItem
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user