Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: /trunk/L2_GameServer_CT1.5/config/siege.properties
- ===================================================================
- --- /trunk/L2_GameServer_CT1.5/config/siege.properties (revision 3589)
- +++ /trunk/L2_GameServer_CT1.5/config/siege.properties (revision 3835)
- @@ -24,4 +24,7 @@
- #Respawn time penalty for loosing each Control tower
- CTLossPenalty=20000
- +
- +#Allow only registered clans/allys to fight each other on siege ground during sieges
- +OnlyRegistered = True
- #Caste Artefacts and Control Towers spawns
- Index: /trunk/L2_GameServer_CT1.5/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- /trunk/L2_GameServer_CT1.5/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3831)
- +++ /trunk/L2_GameServer_CT1.5/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3835)
- @@ -87,4 +87,5 @@
- import net.sf.l2j.gameserver.model.BlockList;
- import net.sf.l2j.gameserver.model.CursedWeapon;
- +import net.sf.l2j.gameserver.model.L2SiegeClan;
- import net.sf.l2j.gameserver.model.FishData;
- import net.sf.l2j.gameserver.model.ForceBuff;
- @@ -3409,4 +3410,68 @@
- }
- + private boolean canBeTargetedByAtSiege(L2PcInstance player)
- + {
- + Siege siege = SiegeManager.getInstance().getSiege(this);
- + if (siege != null && siege.getIsInProgress())
- + {
- + L2Clan selfClan = getClan();
- + L2Clan oppClan = player.getClan();
- + if (selfClan != null && oppClan != null)
- + {
- + boolean self = false;
- + for (L2SiegeClan clan : siege.getAttackerClans())
- + {
- + L2Clan cl = ClanTable.getInstance().getClan(clan.getClanId());
- +
- + if (cl == selfClan || cl.getAllyId() == getAllyId())
- + {
- + self = true;
- + break;
- + }
- + }
- +
- + for (L2SiegeClan clan : siege.getDefenderClans())
- + {
- + L2Clan cl = ClanTable.getInstance().getClan(clan.getClanId());
- +
- + if (cl == selfClan || cl.getAllyId() == getAllyId())
- + {
- + self = true;
- + break;
- + }
- + }
- +
- + boolean opp = false;
- + for (L2SiegeClan clan : siege.getAttackerClans())
- + {
- + L2Clan cl = ClanTable.getInstance().getClan(clan.getClanId());
- +
- + if (cl == oppClan || cl.getAllyId() == player.getAllyId())
- + {
- + opp = true;
- + break;
- + }
- + }
- +
- + for (L2SiegeClan clan : siege.getDefenderClans())
- + {
- + L2Clan cl = ClanTable.getInstance().getClan(clan.getClanId());
- +
- + if (cl == oppClan || cl.getAllyId() == player.getAllyId())
- + {
- + opp = true;
- + break;
- + }
- + }
- +
- + return self && opp;
- + }
- +
- + return false;
- + }
- +
- + return true;
- + }
- +
- /**
- * Manage actions when a player click on this L2PcInstance.<BR><BR>
- @@ -3441,4 +3506,14 @@
- }
- + if(Config.SIEGE_ONLY_REGISTERED)
- + {
- + if (!canBeTargetedByAtSiege(player))
- + {
- + player.sendMessage("Player interaction disabled during sieges.");
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- +
- if ((TvT._started && !Config.TVT_ALLOW_INTERFERENCE) || (CTF._started && !Config.CTF_ALLOW_INTERFERENCE) || (DM._started && !Config.DM_ALLOW_INTERFERENCE))
- {
- Index: /trunk/L2_GameServer_CT1.5/src/main/java/net/sf/l2j/Config.java
- ===================================================================
- --- /trunk/L2_GameServer_CT1.5/src/main/java/net/sf/l2j/Config.java (revision 3831)
- +++ /trunk/L2_GameServer_CT1.5/src/main/java/net/sf/l2j/Config.java (revision 3835)
- @@ -1876,4 +1876,6 @@
- public static int SIEGE_CLAN_MIN_LEVEL;
- public static int SIEGE_LENGTH_MINUTES;
- +
- + public static boolean SIEGE_ONLY_REGISTERED;
- public static void loadSiegeConfig()
- @@ -1896,4 +1898,6 @@
- SIEGE_CLAN_MIN_LEVEL = Integer.parseInt(siegeSettings.getProperty("SiegeClanMinLevel", "5"));
- SIEGE_LENGTH_MINUTES = Integer.parseInt(siegeSettings.getProperty("SiegeLength", "120"));
- +
- + SIEGE_ONLY_REGISTERED = Boolean.parseBoolean(siegeSettings.getProperty("OnlyRegistered", "true"));
- }
- catch (Exception e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement