Jump to content
  • 0

[Help] Removing Kamaels


Question

4 answers to this question

Recommended Posts

  • 0
Posted

edit for  this java code and test :)

Index: L2_GameServer_t1/java/config/altsettings.properties
===================================================================
--- L2_GameServer_t1/java/config/altsettings.properties	(revision 1457)
+++ L2_GameServer_t1/java/config/altsettings.properties	(working copy)
@@ -308,3 +308,11 @@
CaptainCost = 27
CommanderCost = 30
HeroCost = 33
+
+#Allowing race to be created (Default True)
+AltAllowHuman = True
+AltAllowElf = True
+AltAllowDarkElf = True
+AltAllowOrc = True
+AltAllowDwarf = True
+AltAllowKamael = False
\ No newline at end of file
Index: L2_GameServer_t1/java/net/sf/l2j/Config.java
===================================================================
--- L2_GameServer_t1/java/net/sf/l2j/Config.java	(revision 1457)
+++ L2_GameServer_t1/java/net/sf/l2j/Config.java	(working copy)
@@ -1175,6 +1175,14 @@
     /** Alt Settings for devs */
     public static boolean ALT_DEV_NO_QUESTS;
     public static boolean ALT_DEV_NO_SPAWNS;
+    
+    /** Allow races to be created */
+    public static boolean ALLOW_HUMAN;
+    public static boolean ALLOW_ELF;
+    public static boolean ALLOW_DARKELF;
+    public static boolean ALLOW_ORC; 
+    public static boolean ALLOW_DWARF;
+    public static boolean ALLOW_KAMAEL; // Kamel, the new race


     /**
@@ -1729,6 +1737,13 @@

                 ALT_DEV_NO_QUESTS                = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
                 ALT_DEV_NO_SPAWNS                = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
+                
+                ALLOW_HUMAN                     = Boolean.parseBoolean(altSettings.getProperty("AltAllowHuman", "True"));
+                ALLOW_ELF                       = Boolean.parseBoolean(altSettings.getProperty("AltAllowElf", "True"));
+                ALLOW_DARKELF                   = Boolean.parseBoolean(altSettings.getProperty("AltAllowDarkElf", "True"));
+                ALLOW_ORC                       = Boolean.parseBoolean(altSettings.getProperty("AltAllowOrc", "True"));
+                ALLOW_DWARF                     = Boolean.parseBoolean(altSettings.getProperty("AltAllowDwarf", "True"));
+                ALLOW_KAMAEL                    = Boolean.parseBoolean(altSettings.getProperty("AltAllowKamael", "True"));

                 // Dimensional Rift Config
                 RIFT_MIN_PARTY_SIZE              = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "5"));
@@ -2428,6 +2443,14 @@
         else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
         else if (pName.equalsIgnoreCase("TradeChat"))  DEFAULT_TRADE_CHAT = pValue;
         else if (pName.equalsIgnoreCase("MenuStyle"))  GM_ADMIN_MENU_STYLE = pValue;
+        
+        else if(pName.equalsIgnoreCase("AllowHuman")) ALLOW_HUMAN = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowElf")) ALLOW_ELF = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowDarkElf")) ALLOW_DARKELF = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowOrc")) ALLOW_ORC = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowDwarf")) ALLOW_DWARF = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowKamael")) ALLOW_KAMAEL = Boolean.valueOf(pValue);
+        
         else return false;
         return true;
     }
Index: L2_GameServer_t1/java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java
===================================================================
--- L2_GameServer_t1/java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java	(revision 1457)
+++ L2_GameServer_t1/java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java	(working copy)
@@ -114,6 +114,22 @@
			sendPacket(ccf);
			return;
		}
+        //Disallow a race to be created, Example: Kamael coudn't be created if AltKamaelAllow = False
+        else if(
+                (!Config.ALLOW_HUMAN && (_classId==0x00 || _classId==0x0a))   ||
+                (!Config.ALLOW_ELF && (_classId==0x12 || _classId==0x19))     || 
+                (!Config.ALLOW_DARKELF && (_classId==0x1f || _classId==0x26)) || 
+                (!Config.ALLOW_ORC && (_classId==0x2c || _classId==0x31))     || 
+                (!Config.ALLOW_DWARF && _classId==0x35)                       || 
+                (!Config.ALLOW_KAMAEL && (_classId==0x7b || _classId==0x7C))
+               )
+        {
+            if (Config.DEBUG)
+                _log.fine("charname: "+ _name + " is kamael and has been disabled.");
+            CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
+            sendPacket(ccf);
+            return;
+        }

  • 0
Posted

edit for  this java code and test :)

Index: L2_GameServer_t1/java/config/altsettings.properties
===================================================================
--- L2_GameServer_t1/java/config/altsettings.properties	(revision 1457)
+++ L2_GameServer_t1/java/config/altsettings.properties	(working copy)
@@ -308,3 +308,11 @@
CaptainCost = 27
CommanderCost = 30
HeroCost = 33
+
+#Allowing race to be created (Default True)
+AltAllowHuman = True
+AltAllowElf = True
+AltAllowDarkElf = True
+AltAllowOrc = True
+AltAllowDwarf = True
+AltAllowKamael = False
\ No newline at end of file
Index: L2_GameServer_t1/java/net/sf/l2j/Config.java
===================================================================
--- L2_GameServer_t1/java/net/sf/l2j/Config.java	(revision 1457)
+++ L2_GameServer_t1/java/net/sf/l2j/Config.java	(working copy)
@@ -1175,6 +1175,14 @@
     /** Alt Settings for devs */
     public static boolean ALT_DEV_NO_QUESTS;
     public static boolean ALT_DEV_NO_SPAWNS;
+    
+    /** Allow races to be created */
+    public static boolean ALLOW_HUMAN;
+    public static boolean ALLOW_ELF;
+    public static boolean ALLOW_DARKELF;
+    public static boolean ALLOW_ORC; 
+    public static boolean ALLOW_DWARF;
+    public static boolean ALLOW_KAMAEL; // Kamel, the new race


     /**
@@ -1729,6 +1737,13 @@

                 ALT_DEV_NO_QUESTS                = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
                 ALT_DEV_NO_SPAWNS                = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
+                
+                ALLOW_HUMAN                     = Boolean.parseBoolean(altSettings.getProperty("AltAllowHuman", "True"));
+                ALLOW_ELF                       = Boolean.parseBoolean(altSettings.getProperty("AltAllowElf", "True"));
+                ALLOW_DARKELF                   = Boolean.parseBoolean(altSettings.getProperty("AltAllowDarkElf", "True"));
+                ALLOW_ORC                       = Boolean.parseBoolean(altSettings.getProperty("AltAllowOrc", "True"));
+                ALLOW_DWARF                     = Boolean.parseBoolean(altSettings.getProperty("AltAllowDwarf", "True"));
+                ALLOW_KAMAEL                    = Boolean.parseBoolean(altSettings.getProperty("AltAllowKamael", "True"));

                 // Dimensional Rift Config
                 RIFT_MIN_PARTY_SIZE              = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "5"));
@@ -2428,6 +2443,14 @@
         else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
         else if (pName.equalsIgnoreCase("TradeChat"))  DEFAULT_TRADE_CHAT = pValue;
         else if (pName.equalsIgnoreCase("MenuStyle"))  GM_ADMIN_MENU_STYLE = pValue;
+        
+        else if(pName.equalsIgnoreCase("AllowHuman")) ALLOW_HUMAN = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowElf")) ALLOW_ELF = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowDarkElf")) ALLOW_DARKELF = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowOrc")) ALLOW_ORC = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowDwarf")) ALLOW_DWARF = Boolean.valueOf(pValue);
+        else if(pName.equalsIgnoreCase("AllowKamael")) ALLOW_KAMAEL = Boolean.valueOf(pValue);
+        
         else return false;
         return true;
     }
Index: L2_GameServer_t1/java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java
===================================================================
--- L2_GameServer_t1/java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java	(revision 1457)
+++ L2_GameServer_t1/java/net/sf/l2j/gameserver/clientpackets/CharacterCreate.java	(working copy)
@@ -114,6 +114,22 @@
			sendPacket(ccf);
			return;
		}
+        //Disallow a race to be created, Example: Kamael coudn't be created if AltKamaelAllow = False
+        else if(
+                (!Config.ALLOW_HUMAN && (_classId==0x00 || _classId==0x0a))   ||
+                (!Config.ALLOW_ELF && (_classId==0x12 || _classId==0x19))     || 
+                (!Config.ALLOW_DARKELF && (_classId==0x1f || _classId==0x26)) || 
+                (!Config.ALLOW_ORC && (_classId==0x2c || _classId==0x31))     || 
+                (!Config.ALLOW_DWARF && _classId==0x35)                       || 
+                (!Config.ALLOW_KAMAEL && (_classId==0x7b || _classId==0x7C))
+               )
+        {
+            if (Config.DEBUG)
+                _log.fine("charname: "+ _name + " is kamael and has been disabled.");
+            CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
+            sendPacket(ccf);
+            return;
+        }

 

Thats not remove only disallow to be created which dont make sense at all but anyway...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...