Faction respawn at base.

This commit is contained in:
mobius
2015-01-15 00:22:21 +00:00
parent 227f42cf73
commit 37b9e72fe2
3 changed files with 19 additions and 0 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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
{