Browse Source

Correcting L2J Champion mod config: ChampionHpRegen
This also expands on Champions by allowing Titles, and allowing a config on the overall aggro state of champion mobs (if normal, or all passive).

Also, please visit the below thread, as this was requested for a purpose:

http://www.l2jserver.com/forum/thread.php?threadid=27602

Also a little txt change in GameServerRegister Console :)

Ahmed 17 years ago
parent
commit
aab6d3a2ee

+ 7 - 1
L2_GameServer_T1/java/config/l2jmods.properties

@@ -13,15 +13,21 @@
 #---------------------------------------------------------------
 # Enable Champions L2JMod
 ChampionEnable = false
+# Force Champion mobs to be Passive:
+# To leave champion mobs to default aggro, set to false.
+# To set all champion mobs to Passive (not aggro), set true.
+ChampionPassive = false
 # Chance for a mob to became champion (in percents) - 0 to disable
 ChampionFrequency = 5
+# Title of all Champion Mobs
+ChampionTitle = Champion
 # Min and max lvl allowed for a mob to be champion.
 ChampionMinLevel = 20
 ChampionMaxLevel = 70
 # Hp multiplier
 ChampionHp = 8
 # Hp Regen Multiplier
-ChampionRegenHp = 1.
+ChampionHpRegen = 1.
 # Rewards multiplier
 ChampionRewards = 8
 # Adenas & seal stones rewards multiplier

+ 17 - 13
L2_GameServer_T1/java/net/sf/l2j/Config.java

@@ -859,7 +859,9 @@ public final class Config
     /**define L2JMODS */
     /** Champion Mod*/
     public static boolean L2JMOD_CHAMPION_ENABLE;
+    public static boolean L2JMOD_CHAMPION_PASSIVE;
     public static int L2JMOD_CHAMPION_FREQUENCY;
+    public static String L2JMOD_CHAMP_TITLE;
     public static int L2JMOD_CHAMP_MIN_LVL;
     public static int L2JMOD_CHAMP_MAX_LVL;
     public static int L2JMOD_CHAMPION_HP;
@@ -1870,19 +1872,21 @@ public final class Config
                 L2JModSettings.load(is);
                 is.close();
 
-                L2JMOD_CHAMPION_ENABLE              = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
-                L2JMOD_CHAMPION_FREQUENCY              = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
-                L2JMOD_CHAMP_MIN_LVL                = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
-                L2JMOD_CHAMP_MAX_LVL                = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
-                L2JMOD_CHAMPION_HP                     = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
-                L2JMOD_CHAMPION_HP_REGEN               = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
-                L2JMOD_CHAMPION_REWARDS                = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
-                L2JMOD_CHAMPION_ADENAS_REWARDS         = Integer.parseInt(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
-                L2JMOD_CHAMPION_ATK                 = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
-                L2JMOD_CHAMPION_SPD_ATK             = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
-                L2JMOD_CHAMPION_REWARD                 = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItem", "0"));
-                L2JMOD_CHAMPION_REWARD_ID             = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
-                L2JMOD_CHAMPION_REWARD_QTY            = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
+                L2JMOD_CHAMPION_ENABLE              	= Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
+                L2JMOD_CHAMPION_PASSIVE					= Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
+                L2JMOD_CHAMPION_FREQUENCY              	= Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
+                L2JMOD_CHAMP_TITLE                      = L2JModSettings.getProperty("ChampionTitle", "Champion");
+                L2JMOD_CHAMP_MIN_LVL                	= Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
+                L2JMOD_CHAMP_MAX_LVL                	= Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
+                L2JMOD_CHAMPION_HP                     	= Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
+                L2JMOD_CHAMPION_HP_REGEN               	= Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
+                L2JMOD_CHAMPION_REWARDS                	= Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
+                L2JMOD_CHAMPION_ADENAS_REWARDS         	= Integer.parseInt(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
+                L2JMOD_CHAMPION_ATK                 	= Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
+                L2JMOD_CHAMPION_SPD_ATK             	= Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
+                L2JMOD_CHAMPION_REWARD                 	= Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItem", "0"));
+                L2JMOD_CHAMPION_REWARD_ID             	= Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
+                L2JMOD_CHAMPION_REWARD_QTY            	= Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
 
                 TVT_EVENT_ENABLED                        = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
                 TVT_EVENT_INTERVAL                        = Integer.parseInt(L2JModSettings.getProperty("TvTEventInterval", "18000"));

+ 3 - 0
L2_GameServer_T1/java/net/sf/l2j/gameserver/ai/L2AttackableAI.java

@@ -223,6 +223,9 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
             // unless they are already following those players from outside the peacezone.
             if (!Config.ALT_MOB_AGRO_IN_PEACEZONE && target.isInsideZone(L2Character.ZONE_PEACE))
                 return false;
+            
+            if (me.isChampion() && Config.L2JMOD_CHAMPION_PASSIVE)
+            	return false;
 
             // Check if the actor is Aggressive
             return (me.isAggressive() && GeoData.getInstance().canSeeTarget(me, target));

+ 1 - 1
L2_GameServer_T1/java/net/sf/l2j/gameserver/serverpackets/NpcInfo.java

@@ -65,7 +65,7 @@ public final class NpcInfo extends L2GameServerPacket
         	_name = cha.getTemplate().name;
 
         if(Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion())
-            _title = ("Champion");
+            _title = (Config.L2JMOD_CHAMP_TITLE);
         else if (cha.getTemplate().serverSideTitle)
     		_title = cha.getTemplate().title;
     	else

+ 1 - 1
L2_GameServer_T1/java/net/sf/l2j/gsregistering/GameServerRegister.java

@@ -51,7 +51,7 @@ public class GameServerRegister
 			System.exit(1);
 		}
 		GameServerTable gameServerTable = GameServerTable.getInstance();
-		System.out.println("Welcome to L2J GameServer Regitering");
+		System.out.println("Welcome to L2J GameServer Registration");
 		System.out.println("Enter The id of the server you want to register");
 		System.out.println("Type 'help' to get a list of ids.");
 		System.out.println("Type 'clean' to unregister all currently registered gameservers on this LoginServer.");