diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index c97536b2bd..712b3441e9 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java index 2152b12247..94b6ec6491 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java @@ -1090,7 +1090,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1099,8 +1098,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2467,7 +2464,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2479,8 +2475,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index b04a6d3620..d9b4e22f7d 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8355,6 +8355,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index b237e827cd..f83cd937f0 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java index f557245c44..0b5fc606d4 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java @@ -1097,7 +1097,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1106,8 +1105,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2483,7 +2480,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2495,8 +2491,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 7056137b66..cfddebfc44 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8362,6 +8362,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index b237e827cd..f83cd937f0 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java index 47013ac733..172fa3d68b 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java @@ -1105,7 +1105,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1114,8 +1113,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2498,7 +2495,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2510,8 +2506,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ec099aa370..d926b19bc6 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8364,6 +8364,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index b237e827cd..f83cd937f0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java index fb5b6c6407..a252a8190e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java @@ -1098,7 +1098,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1107,8 +1106,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2484,7 +2481,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2496,8 +2492,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 14cdea214c..37a456aa32 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8362,6 +8362,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_5.0_Salvation/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index b237e827cd..f83cd937f0 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/Config.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/Config.java index fb5b6c6407..a252a8190e 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/Config.java @@ -1098,7 +1098,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1107,8 +1106,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2484,7 +2481,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2496,8 +2492,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 9b1614f061..47154211f4 100644 --- a/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_5.0_Salvation/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8364,6 +8364,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index b237e827cd..f83cd937f0 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/Config.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/Config.java index fb5b6c6407..a252a8190e 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/Config.java @@ -1098,7 +1098,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1107,8 +1106,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2484,7 +2481,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2496,8 +2492,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 34cc7ba3d8..429fa96c54 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_5.5_EtinasFate/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8364,6 +8364,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index 124bb78e5b..712b3441e9 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -19,7 +19,6 @@ package custom.FactionSystem; import com.l2jmobius.Config; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.model.L2World; -import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; @@ -32,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -49,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addSeeCreatureId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -169,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && creature.isPlayer() && ((creature.getActingPlayer().isGood() && (npc.getId() == EVIL_GUARD)) || (creature.getActingPlayer().isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, creature); - } - return super.onSeeCreature(npc, creature, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java index 74cbb8112d..2ff75acd08 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java @@ -1278,7 +1278,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1287,8 +1286,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2798,7 +2795,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2810,8 +2806,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java index 884d5eefbd..7d0dcc2554 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/ai/L2AttackableAI.java @@ -225,6 +225,11 @@ public class L2AttackableAI extends L2CharacterAI return false; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && ((L2Npc) _actor).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && ((L2Npc) _actor).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } + if (player.isInParty() && player.getParty().isInDimensionalRift()) { final byte riftType = player.getParty().getDimensionalRift().getType(); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index a7a53e9d9b..41857befcd 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -51,6 +51,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index abbee68cd1..bab465ffcc 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8469,6 +8469,15 @@ public final class L2PcInstance extends L2Playable } } + if (attacker instanceof L2GuardInstance) + { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } + return (getKarma() > 0); // Guards attack only PK players. + } + // Check if the L2PcInstance has Karma if ((getKarma() > 0) || (_pvpFlag > 0)) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/guard/501.htm b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/guard/501.htm new file mode 100644 index 0000000000..ae4b343c3e --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/guard/501.htm @@ -0,0 +1,4 @@ +Sentinel:
+You must use extreme caution, sir! There have been reports of roaming thugs in this area, who think nothing of killing for the sheer pleasure of it. Please let me know if you see any of them. My bow will protect you from these murderers.
+May the divine protection of Eva be with you always. + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/guard/502.htm b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/guard/502.htm new file mode 100644 index 0000000000..8910ad01a0 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/guard/502.htm @@ -0,0 +1,3 @@ +Centurion:
+I am sworn by the will of Paagrio to destroy all evildoers! If you see any of them, tell me. My bow will put an end to their treachery! + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index c97536b2bd..712b3441e9 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/custom/gve_factions.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/custom/gve_factions.xml index b6fb0a9d13..fc45e59cd0 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/custom/gve_factions.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/custom/gve_factions.xml @@ -1,6 +1,6 @@ - + ELF FEMALE diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java index b466a43f94..99aecead17 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java @@ -1043,7 +1043,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1052,8 +1051,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2379,7 +2376,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2391,8 +2387,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 7b72197aa1..6531b4e324 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8307,6 +8307,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/html/guard/501.htm b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/html/guard/501.htm new file mode 100644 index 0000000000..ae4b343c3e --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/html/guard/501.htm @@ -0,0 +1,4 @@ +Sentinel:
+You must use extreme caution, sir! There have been reports of roaming thugs in this area, who think nothing of killing for the sheer pleasure of it. Please let me know if you see any of them. My bow will protect you from these murderers.
+May the divine protection of Eva be with you always. + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/html/guard/502.htm b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/html/guard/502.htm new file mode 100644 index 0000000000..8910ad01a0 --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/html/guard/502.htm @@ -0,0 +1,3 @@ +Centurion:
+I am sworn by the will of Paagrio to destroy all evildoers! If you see any of them, tell me. My bow will put an end to their treachery! + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index c97536b2bd..712b3441e9 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/custom/gve_factions.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/custom/gve_factions.xml index b6fb0a9d13..fc45e59cd0 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/custom/gve_factions.xml +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/custom/gve_factions.xml @@ -1,6 +1,6 @@ - + ELF FEMALE diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java index 1c863383e6..26317cab80 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java @@ -1047,7 +1047,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1056,8 +1055,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2386,7 +2383,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2398,8 +2394,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 6f985cba2f..bdbc472eaa 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8308,6 +8308,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/html/guard/501.htm b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/html/guard/501.htm new file mode 100644 index 0000000000..ae4b343c3e --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/html/guard/501.htm @@ -0,0 +1,4 @@ +Sentinel:
+You must use extreme caution, sir! There have been reports of roaming thugs in this area, who think nothing of killing for the sheer pleasure of it. Please let me know if you see any of them. My bow will protect you from these murderers.
+May the divine protection of Eva be with you always. + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/html/guard/502.htm b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/html/guard/502.htm new file mode 100644 index 0000000000..8910ad01a0 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/html/guard/502.htm @@ -0,0 +1,3 @@ +Centurion:
+I am sworn by the will of Paagrio to destroy all evildoers! If you see any of them, tell me. My bow will put an end to their treachery! + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index c97536b2bd..712b3441e9 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/custom/gve_factions.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/custom/gve_factions.xml index b6fb0a9d13..fc45e59cd0 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/custom/gve_factions.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/custom/gve_factions.xml @@ -1,6 +1,6 @@ - + ELF FEMALE diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java index 1c863383e6..26317cab80 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java @@ -1047,7 +1047,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1056,8 +1055,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2386,7 +2383,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2398,8 +2394,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index b9859e0ff7..f34ae2eedc 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8310,6 +8310,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Custom/FactionSystem.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Custom/FactionSystem.ini index c91e452123..ca1de8904b 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Custom/FactionSystem.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Custom/FactionSystem.ini @@ -10,10 +10,6 @@ EnableFactionSystem = False # Default: 85332,16199,-1252 StartingLocation = 85332,16199,-1252 -# Faction manager NPC ID. -# Default: 500 -FactionManagerNpcId = 500 - # Spawn location for faction manager NPC. # Default: 85712,15974,-1260,26808 ManagerSpawnLocation = 85712,15974,-1260,26808 @@ -47,14 +43,6 @@ EvilNameColor = 0000FF # Default: True EnableFactionGuards = True -# Good Guard NPC ID. -# Default: 501 -GoodGuardNpcId = 501 - -# Evil Guard NPC ID. -# Default: 502 -EvilGuardNpcId = 502 - # Upon death, respawn at faction base. # Default: True RespawnAtFactionBase = True diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/html/guard/501.htm b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/html/guard/501.htm new file mode 100644 index 0000000000..ae4b343c3e --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/html/guard/501.htm @@ -0,0 +1,4 @@ +Sentinel:
+You must use extreme caution, sir! There have been reports of roaming thugs in this area, who think nothing of killing for the sheer pleasure of it. Please let me know if you see any of them. My bow will protect you from these murderers.
+May the divine protection of Eva be with you always. + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/html/guard/502.htm b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/html/guard/502.htm new file mode 100644 index 0000000000..8910ad01a0 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/html/guard/502.htm @@ -0,0 +1,3 @@ +Centurion:
+I am sworn by the will of Paagrio to destroy all evildoers! If you see any of them, tell me. My bow will put an end to their treachery! + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java index c97536b2bd..712b3441e9 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/custom/FactionSystem/FactionSystem.java @@ -31,9 +31,7 @@ import ai.AbstractNpcAI; public final class FactionSystem extends AbstractNpcAI { // NPCs - private static final int MANAGER = Config.FACTION_MANAGER_NPCID; - private static final int GOOD_GUARD = Config.FACTION_GOOD_GUARD_NPCID; - private static final int EVIL_GUARD = Config.FACTION_EVIL_GUARD_NPCID; + private static final int MANAGER = 500; // Other private static final String[] TEXTS = { @@ -48,7 +46,6 @@ public final class FactionSystem extends AbstractNpcAI addStartNpc(MANAGER); addTalkId(MANAGER); addFirstTalkId(MANAGER); - addAggroRangeEnterId(EVIL_GUARD, GOOD_GUARD); if (Config.FACTION_SYSTEM_ENABLED) { @@ -168,16 +165,6 @@ public final class FactionSystem extends AbstractNpcAI } } - @Override - public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon) - { - if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((player.isGood() && (npc.getId() == EVIL_GUARD)) || (player.isEvil() && (npc.getId() == GOOD_GUARD)))) - { - addAttackDesire(npc, player); - } - return super.onAggroRangeEnter(npc, player, isSummon); - } - public static void main(String[] args) { new FactionSystem(); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/custom/gve_factions.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/custom/gve_factions.xml index b6fb0a9d13..fc45e59cd0 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/custom/gve_factions.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/custom/gve_factions.xml @@ -1,6 +1,6 @@ - + ELF FEMALE diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/Config.java index 1c863383e6..26317cab80 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/Config.java @@ -1047,7 +1047,6 @@ public final class Config public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; - public static int FACTION_MANAGER_NPCID; public static Location FACTION_MANAGER_LOCATION; public static Location FACTION_GOOD_BASE_LOCATION; public static Location FACTION_EVIL_BASE_LOCATION; @@ -1056,8 +1055,6 @@ 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 int FACTION_GOOD_GUARD_NPCID; - public static int FACTION_EVIL_GUARD_NPCID; public static boolean FACTION_RESPAWN_AT_BASE; public static boolean FACTION_AUTO_NOBLESS; public static boolean FACTION_SPECIFIC_CHAT; @@ -2386,7 +2383,6 @@ public final class Config FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false)); tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(","); FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2])); - FACTION_MANAGER_NPCID = FactionSystem.getInt("FactionManagerNpcId", 500); tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(","); FACTION_MANAGER_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]), tempString[3] != null ? Integer.parseInt(tempString[3]) : 0); tempString = FactionSystem.getString("GoodBaseLocation", "45306,48878,-3058").split(","); @@ -2398,8 +2394,6 @@ public final class Config FACTION_GOOD_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("GoodNameColor", "00FF00")); FACTION_EVIL_NAME_COLOR = Integer.decode("0x" + FactionSystem.getString("EvilNameColor", "0000FF")); FACTION_GUARDS_ENABLED = FactionSystem.getBoolean("EnableFactionGuards", true); - FACTION_GOOD_GUARD_NPCID = FactionSystem.getInt("GoodGuardNpcId", 501); - FACTION_EVIL_GUARD_NPCID = FactionSystem.getInt("EvilGuardNpcId", 502); FACTION_RESPAWN_AT_BASE = FactionSystem.getBoolean("RespawnAtFactionBase", true); FACTION_AUTO_NOBLESS = FactionSystem.getBoolean("FactionAutoNobless", false); FACTION_SPECIFIC_CHAT = FactionSystem.getBoolean("EnableFactionChat", true); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java index 02328dbae9..05c3ae9e72 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2GuardInstance.java @@ -57,6 +57,14 @@ public class L2GuardInstance extends L2Attackable { return true; } + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && attacker.isPlayable()) + { + L2PcInstance player = attacker.getActingPlayer(); + if ((player.isGood() && getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (player.isEvil() && getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME))) + { + return true; + } + } return super.isAutoAttackable(attacker); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index f2b557a52d..c4074a1ea2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -8310,6 +8310,10 @@ public final class L2PcInstance extends L2Playable if (attacker instanceof L2GuardInstance) { + if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_GUARDS_ENABLED && ((_isGood && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_EVIL_TEAM_NAME)) || (_isEvil && ((L2Npc) attacker).getTemplate().isClan(Config.FACTION_GOOD_TEAM_NAME)))) + { + return true; + } return (getReputation() < 0); // Guards attack only PK players. }