From 37b9e72fe265335769e29ba10c7def093162a2a3 Mon Sep 17 00:00:00 2001 From: mobius <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 15 Jan 2015 00:22:21 +0000 Subject: [PATCH] Faction respawn at base. --- trunk/dist/game/config/Custom.properties | 4 ++++ trunk/java/com/l2jserver/Config.java | 2 ++ .../instancemanager/MapRegionManager.java | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/trunk/dist/game/config/Custom.properties b/trunk/dist/game/config/Custom.properties index 0d1a51fc34..cea7c226de 100644 --- a/trunk/dist/game/config/Custom.properties +++ b/trunk/dist/game/config/Custom.properties @@ -663,6 +663,10 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True +# Upon death, respawn at faction base. +# Default: True +RespawnAtFactionBase = True + # Disable chat between factions. # Default: True EnableFactionChat = True diff --git a/trunk/java/com/l2jserver/Config.java b/trunk/java/com/l2jserver/Config.java index 520eed59fe..4e0b063e3d 100644 --- a/trunk/java/com/l2jserver/Config.java +++ b/trunk/java/com/l2jserver/Config.java @@ -832,6 +832,7 @@ public final class Config public static int FACTION_GOOD_NAME_COLOR; public static int FACTION_EVIL_NAME_COLOR; public static boolean FACTION_GUARDS_ENABLED; + public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_SPECIFIC_CHAT; public static boolean PREMIUM_SYSTEM_ENABLED; public static float PREMIUM_RATE_XP; @@ -2653,6 +2654,7 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + CustomSettings.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + CustomSettings.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = CustomSettings.getBoolean("EnableFactionGuards", true); + FACTION_RESPAWN_AT_BASE = CustomSettings.getBoolean("RespawnAtFactionBase", true); FACTION_SPECIFIC_CHAT = Boolean.valueOf(CustomSettings.getBoolean("EnableFactionChat", true)); PREMIUM_SYSTEM_ENABLED = CustomSettings.getBoolean("EnablePremiumSystem", false); diff --git a/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java b/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java index 10941c02ae..3fe4b62c01 100644 --- a/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java +++ b/trunk/java/com/l2jserver/gameserver/instancemanager/MapRegionManager.java @@ -26,6 +26,7 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; +import com.l2jserver.Config; import com.l2jserver.gameserver.engines.DocumentParser; import com.l2jserver.gameserver.model.L2MapRegion; import com.l2jserver.gameserver.model.L2Object; @@ -419,6 +420,18 @@ public final class MapRegionManager implements DocumentParser } } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_RESPAWN_AT_BASE) + { + if (activeChar.getActingPlayer().isGood()) + { + return Config.FACTION_GOOD_BASE_LOCATION; + } + if (activeChar.getActingPlayer().isEvil()) + { + return Config.FACTION_EVIL_BASE_LOCATION; + } + } + // Get the nearest town try {