Addition of OfflineAbnormalEffect configuration.
This commit is contained in:
@@ -44,3 +44,8 @@ StoreOfflineTradeInRealtime = True
|
||||
# Enable .offline command for logging out.
|
||||
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.model.Location;
|
||||
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.Util;
|
||||
|
||||
@@ -1118,6 +1119,7 @@ public class Config
|
||||
public static boolean OFFLINE_FAME;
|
||||
public static boolean STORE_OFFLINE_TRADE_IN_REALTIME;
|
||||
public static boolean ENABLE_OFFLINE_COMMAND;
|
||||
public static List<AbnormalVisualEffect> OFFLINE_ABNORMAL_EFFECTS = new ArrayList<>();
|
||||
public static boolean DISPLAY_SERVER_TIME;
|
||||
public static int BUFFER_MAX_SCHEMES;
|
||||
public static int BUFFER_STATIC_BUFF_COST;
|
||||
@@ -2762,6 +2764,15 @@ public class Config
|
||||
OFFLINE_DISCONNECT_SAME_ACCOUNT = offlineTradeConfig.getBoolean("OfflineDisconnectSameAccount", false);
|
||||
STORE_OFFLINE_TRADE_IN_REALTIME = offlineTradeConfig.getBoolean("StoreOfflineTradeInRealtime", 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)
|
||||
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.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import org.l2jmobius.gameserver.model.ManufactureItem;
|
||||
import org.l2jmobius.gameserver.model.TradeItem;
|
||||
@@ -293,6 +294,10 @@ public class OfflineTraderTable
|
||||
player.setPrivateStoreType(type);
|
||||
player.setOnlineStatus(true, true);
|
||||
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();
|
||||
nTraders++;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.util;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
@@ -149,6 +150,12 @@ public class OfflineTradeUtil
|
||||
|
||||
player.storeMe();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user