Addition of OfflineAbnormalEffect configuration.

This commit is contained in:
MobiusDevelopment
2022-08-21 21:32:28 +00:00
parent 19241a0080
commit f9cad86ed8
112 changed files with 784 additions and 0 deletions
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1098,6 +1099,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3291,6 +3293,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1109,6 +1110,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3317,6 +3319,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1122,6 +1123,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3339,6 +3341,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1109,6 +1110,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3313,6 +3315,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1108,6 +1109,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3322,6 +3324,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1115,6 +1116,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3334,6 +3336,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1137,6 +1138,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3377,6 +3379,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1145,6 +1146,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3393,6 +3395,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1137,6 +1138,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3369,6 +3371,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1148,6 +1149,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3405,6 +3407,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1148,6 +1149,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3405,6 +3407,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1148,6 +1149,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3405,6 +3407,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -297,6 +298,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -63,6 +63,7 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1118,6 +1119,7 @@ public class Config
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
public static boolean STORE_OFFLINE_TRADE_IN_REALTIME; public static boolean STORE_OFFLINE_TRADE_IN_REALTIME;
public static boolean ENABLE_OFFLINE_COMMAND; public static boolean ENABLE_OFFLINE_COMMAND;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean DISPLAY_SERVER_TIME; public static boolean DISPLAY_SERVER_TIME;
public static int BUFFER_MAX_SCHEMES; public static int BUFFER_MAX_SCHEMES;
public static int BUFFER_STATIC_BUFF_COST; public static int BUFFER_STATIC_BUFF_COST;
@@ -2762,6 +2764,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.startAbnormalVisualEffect(false, Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -149,6 +150,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.startAbnormalVisualEffect(true, Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -63,6 +63,7 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1172,6 +1173,7 @@ public class Config
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
public static boolean STORE_OFFLINE_TRADE_IN_REALTIME; public static boolean STORE_OFFLINE_TRADE_IN_REALTIME;
public static boolean ENABLE_OFFLINE_COMMAND; public static boolean ENABLE_OFFLINE_COMMAND;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean DISPLAY_SERVER_TIME; public static boolean DISPLAY_SERVER_TIME;
public static int BUFFER_MAX_SCHEMES; public static int BUFFER_MAX_SCHEMES;
public static int BUFFER_STATIC_BUFF_COST; public static int BUFFER_STATIC_BUFF_COST;
@@ -2880,6 +2882,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.startAbnormalVisualEffect(false, Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -149,6 +150,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.startAbnormalVisualEffect(true, Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -63,6 +63,7 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1172,6 +1173,7 @@ public class Config
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
public static boolean STORE_OFFLINE_TRADE_IN_REALTIME; public static boolean STORE_OFFLINE_TRADE_IN_REALTIME;
public static boolean ENABLE_OFFLINE_COMMAND; public static boolean ENABLE_OFFLINE_COMMAND;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean DISPLAY_SERVER_TIME; public static boolean DISPLAY_SERVER_TIME;
public static int BUFFER_MAX_SCHEMES; public static int BUFFER_MAX_SCHEMES;
public static int BUFFER_STATIC_BUFF_COST; public static int BUFFER_STATIC_BUFF_COST;
@@ -2887,6 +2889,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.startAbnormalVisualEffect(false, Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -149,6 +150,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.startAbnormalVisualEffect(true, Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1048,6 +1049,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3192,6 +3194,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1058,6 +1059,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3221,6 +3223,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1057,6 +1058,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3219,6 +3221,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1061,6 +1062,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3225,6 +3227,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1061,6 +1062,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3225,6 +3227,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1061,6 +1062,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3225,6 +3227,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1066,6 +1067,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3234,6 +3236,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1072,6 +1073,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3279,6 +3281,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: SLEEP
OfflineAbnormalEffect =
@@ -65,6 +65,7 @@ import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.type.CrystalType; import org.l2jmobius.gameserver.model.item.type.CrystalType;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1073,6 +1074,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3239,6 +3241,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
# Enable .offline command for logging out. # Enable .offline command for logging out.
EnableOfflineCommand = True EnableOfflineCommand = True
# Abnormal effect for offline traders.
# Can use multiple enums separated by commas to choose random effect.
# Leave empty to disable.
# Example: DORMANT_USER
OfflineAbnormalEffect =
@@ -64,6 +64,7 @@ import org.l2jmobius.gameserver.enums.ClassId;
import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType; import org.l2jmobius.gameserver.enums.IllegalActionPunishmentType;
import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.holders.ItemHolder; import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.skill.AbnormalVisualEffect;
import org.l2jmobius.gameserver.util.FloodProtectorConfig; import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util; import org.l2jmobius.gameserver.util.Util;
@@ -1098,6 +1099,7 @@ public class Config
public static int OFFLINE_MAX_DAYS; public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED; public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT; public static boolean OFFLINE_DISCONNECT_SAME_ACCOUNT;
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
public static boolean OFFLINE_SET_NAME_COLOR; public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR; public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_FAME; public static boolean OFFLINE_FAME;
@@ -3332,6 +3334,15 @@ public class Config
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false); OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true); STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", true);
ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true); ENABLE_OFFLINE_COMMAND = offlineTradeConfig.getBoolean("EnableOfflineCommand", true);
OFFLINE_ABNORMAL_EFFECTS.clear();
final String offlineAbnormalEffects = offlineTradeConfig.getString("OfflineAbnormalEffect", "").trim();
if (!offlineAbnormalEffects.isEmpty())
{
for (String ave : offlineAbnormalEffects.split(","))
{
OFFLINE_ABNORMAL_EFFECTS.add(Enum.valueOf(AbnormalVisualEffect.class, ave.trim()));
}
}
// Load PasswordChange config file (if exists) // Load PasswordChange config file (if exists)
final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE); final PropertiesParser passwordChangeConfig = new PropertiesParser(CUSTOM_PASSWORD_CHANGE_CONFIG_FILE);
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.PrivateStoreType; import org.l2jmobius.gameserver.enums.PrivateStoreType;
import org.l2jmobius.gameserver.model.ManufactureItem; import org.l2jmobius.gameserver.model.ManufactureItem;
import org.l2jmobius.gameserver.model.TradeItem; import org.l2jmobius.gameserver.model.TradeItem;
@@ -293,6 +294,10 @@ public class OfflineTraderTable
player.setPrivateStoreType(type); player.setPrivateStoreType(type);
player.setOnlineStatus(true, true); player.setOnlineStatus(true, true);
player.restoreEffects(); player.restoreEffects();
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
player.broadcastUserInfo(); player.broadcastUserInfo();
nTraders++; nTraders++;
} }
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.l2jmobius.Config; import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager; import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.World;
@@ -155,6 +156,12 @@ public class OfflineTradeUtil
player.storeMe(); player.storeMe();
LOGGER_ACCOUNTING.info("Entering offline mode, " + client); LOGGER_ACCOUNTING.info("Entering offline mode, " + client);
if (!Config.OFFLINE_ABNORMAL_EFFECTS.isEmpty())
{
player.getEffectList().startAbnormalVisualEffect(Config.OFFLINE_ABNORMAL_EFFECTS.get(Rnd.get(Config.OFFLINE_ABNORMAL_EFFECTS.size())));
}
return true; return true;
} }
} }

Some files were not shown because too many files have changed in this diff Show More