Faction balance online players.
This commit is contained in:
10
trunk/dist/game/config/Custom.properties
vendored
10
trunk/dist/game/config/Custom.properties
vendored
@@ -667,10 +667,18 @@ EnableFactionGuards = True
|
||||
# Default: True
|
||||
RespawnAtFactionBase = True
|
||||
|
||||
# Disable chat between factions.
|
||||
# Disallow chat between factions.
|
||||
# Default: True
|
||||
EnableFactionChat = True
|
||||
|
||||
# Prohibit login when faction has more online players.
|
||||
# Default: True
|
||||
BalanceOnlinePlayers = True
|
||||
|
||||
# Online player exceed limit (used by setting above).
|
||||
# Default: 20
|
||||
BalancePlayerExceedLimit = 20
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Premium System (VIP)
|
||||
|
3
trunk/dist/game/data/html/mods/Faction/ExceededOnlineLimit.htm
vendored
Normal file
3
trunk/dist/game/data/html/mods/Faction/ExceededOnlineLimit.htm
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><title>Restriction</title></head><body>It seems that there are currently more %more% than %less% players online.<br>
|
||||
Try selecting an opposing faction character or wait for some %more% players to logout.
|
||||
</body></html>
|
@@ -63,6 +63,17 @@ public class FactionManager extends AbstractNpcAI
|
||||
{
|
||||
case "selectGoodFaction":
|
||||
{
|
||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllGoodPlayersCount() >= ((L2World.getInstance().getAllEvilPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
||||
{
|
||||
String htmltext = null;
|
||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||
packet.setHtml(getHtm(player.getHtmlPrefix(), "onlinelimit.html"));
|
||||
packet.replace("%name%", player.getName());
|
||||
packet.replace("%more%", Config.FACTION_GOOD_TEAM_NAME);
|
||||
packet.replace("%less%", Config.FACTION_EVIL_TEAM_NAME);
|
||||
player.sendPacket(packet);
|
||||
return htmltext;
|
||||
}
|
||||
player.setGood();
|
||||
player.getAppearance().setNameColor(Config.FACTION_GOOD_NAME_COLOR);
|
||||
player.getAppearance().setTitleColor(Config.FACTION_GOOD_NAME_COLOR);
|
||||
@@ -75,6 +86,17 @@ public class FactionManager extends AbstractNpcAI
|
||||
}
|
||||
case "selectEvilFaction":
|
||||
{
|
||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllEvilPlayersCount() >= ((L2World.getInstance().getAllGoodPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
||||
{
|
||||
String htmltext = null;
|
||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||
packet.setHtml(getHtm(player.getHtmlPrefix(), "onlinelimit.html"));
|
||||
packet.replace("%name%", player.getName());
|
||||
packet.replace("%more%", Config.FACTION_EVIL_TEAM_NAME);
|
||||
packet.replace("%less%", Config.FACTION_GOOD_TEAM_NAME);
|
||||
player.sendPacket(packet);
|
||||
return htmltext;
|
||||
}
|
||||
player.setEvil();
|
||||
player.getAppearance().setNameColor(Config.FACTION_EVIL_NAME_COLOR);
|
||||
player.getAppearance().setTitleColor(Config.FACTION_EVIL_NAME_COLOR);
|
||||
|
5
trunk/dist/game/data/scripts/custom/FactionManager/onlinelimit.html
vendored
Normal file
5
trunk/dist/game/data/scripts/custom/FactionManager/onlinelimit.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Faction Manager:<br>
|
||||
I am sorry %name%.<br1>
|
||||
It seems that there are currently more %more% than %less% players online.<br>
|
||||
Try selecting the opposing faction or wait for some %more% players to logout.
|
||||
</body></html>
|
Reference in New Issue
Block a user