Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JServer] Restrição MageUseHeavyOrLight (https://secretexperience.net/lineage-java-mods/27874-restricao-mageuseheavyorlight.html)

Mazokista 26-11-2010 08:38 PM

Restrição MageUseHeavyOrLight
 
1 Anexo(s)
Esse Mod faz com qui Mago nao Usse Set Heavy Ow Light

Código:

Index: CORE/java/config/customs.ini
====================================================================
--- CORE/java/config/customs.ini (revision 203)
+++ CORE/java/config/customs.ini (revision 210)

@@ -175,7 +175,9 @@
 # Default: False
 GMTradeRestrictedItems = False
 
-# Heavy Equipment Restriction
+# Heavy/Light Equipment Restriction
+# IF False , Mage Classes Won't Be Able To Use Heavy/Lights Armors
+AllowMageUseHeavyOrLight = False

 # IF False , Dagger Classes Won't Be Able To Use Heavy Armors
 AllowDaggersUseHeavy = True
 # IF False , Archer Classes Won't Be Able To Use Heavy Armors

 
Index: CORE/java/l2j/umbrella/il/Config.java
====================================================================
--- CORE/java/l2j/umbrella/il/Config.java (revision 208)
+++ CORE/java/l2j/umbrella/il/Config.java (revision 210
)
@@ -574,6 +574,7 @@
    public static int MAX_SPEED;
    public static int MAX_PCRIT_RATE;
    public static int MAX_MCRIT_RATE;
+    public static boolean ALLOW_MAGE_USE_HEAVY_OR_LIGHT;
    public static boolean ALLOW_DAGGERS_WEAR_HEAVY;
    public static boolean ALLOW_ARCHERS_WEAR_HEAVY;
    public static boolean ALLOW_SAME_IP_NOT_GIVE_PVP_POINT;
@@ -1020,6 +1021,7 @@
              MAX_SPEED = Integer.parseInt(Customs.getProperty("MaxSpeed", "250"));
              MAX_PCRIT_RATE = Integer.parseInt(Customs.getProperty("MaxPCritRate", "500"));
              MAX_MCRIT_RATE = Integer.parseInt(Customs.getProperty("MaxMCritRate", "300"));
+              ALLOW_MAGE_USE_HEAVY_OR_LIGHT = Boolean.parseBoolean(Customs.getProperty("AllowMageUseHeavyOrLight", "True"));
              ALLOW_DAGGERS_WEAR_HEAVY = Boolean.parseBoolean(Customs.getProperty("AllowDaggersUseHeavy", "True"));
              ALLOW_ARCHERS_WEAR_HEAVY = Boolean.parseBoolean(Customs.getProperty("AllowArchersUseHeavy", "True"));
                        ALT_SUBCLASS_LEVEL = Integer.parseInt(Customs.getProperty("AltSubClassLevel", "40"));
Index: CORE/java/l2j/umbrella/il/gameserver/network/clientpackets/UseItem.java
====================================================================
--- CORE/java/l2j/umbrella/il/gameserver/network/clientpackets/UseItem.java (revision 208)
+++ CORE/java/l2j/umbrella/il/gameserver/network/clientpackets/UseItem.java (revision 210)

@@ -189,7 +189,7 @@
                        if (Config.BOW_TANK_RESTRICTION)
                        {
                                int classid = activeChar.getClassId().getId();
-                                if (!activeChar.isInOlympiadMode() && (classid == 88 || classid == 89 || classid == 6 || classid == 90 || classid == 91 || classid == 100 || classid == 99 || classid == 113 || classid == 114))
+                                if (!activeChar.isGM() && !activeChar.isInOlympiadMode() && (classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 19 || classid == 20 || classid == 21 || classid == 32 || classid == 33 || classid == 34 || classid == 44 || classid == 45 || classid == 46 || classid == 47 || classid == 48 || classid == 53 || classid == 54 || classid == 55 || classid == 56 || classid == 57 || classid == 88 || classid == 89 || classid == 90 || classid == 99 || classid == 100 || classid == 106 || classid == 107 || classid == 113 || classid == 114 || classid == 117 || classid == 118))
                                {
                                        if (item.getItemType() == L2WeaponType.BOW)
                                        {
@@ -200,7 +200,7 @@
                        }
 
                        if (Config.DEBUG)
-                        _log.finest(activeChar.getObjectId() + ": use item " + _objectId);
+                                _log.finest(activeChar.getObjectId() + ": use item " + _objectId);
 
                        if (item.isEquipable())
                        {
@@ -316,6 +316,16 @@
                                                return;
                                }   
                        }
+                                               
+                                if (!Config.ALLOW_MAGE_USE_HEAVY_OR_LIGHT)
+                                        if (activeChar.getClassId().getId() == 10 || activeChar.getClassId().getId() == 11 || activeChar.getClassId().getId() == 12 || activeChar.getClassId().getId() == 13 || activeChar.getClassId().getId() == 14 || activeChar.getClassId().getId() == 15 || activeChar.getClassId().getId() == 16 || activeChar.getClassId().getId() == 17 || activeChar.getClassId().getId() == 25 || activeChar.getClassId().getId() == 26 || activeChar.getClassId().getId() == 27 || activeChar.getClassId().getId() == 28 || activeChar.getClassId().getId() == 29 || activeChar.getClassId().getId() == 30 || activeChar.getClassId().getId() == 38 || activeChar.getClassId().getId() == 39 || activeChar.getClassId().getId() == 40 || activeChar.getClassId().getId() == 41 || activeChar.getClassId().getId() == 42 || activeChar.getClassId().getId() == 43 || activeChar.getClassId().getId() == 49 || activeChar.getClassId().getId() == 50 || activeChar.getClassId().getId() == 51 || activeChar.getClassId().getId() == 52 || activeChar.getClassId().getId() == 94 || activeChar.getClassId().getId() == 95 || activeChar.getClassId().getId() == 96 || activeChar.getClassId().getId() == 97 || activeChar.getClassId().getId() == 98 || activeChar.getClassId().getId() == 103 || activeChar.getClassId().getId() == 104 || activeChar.getClassId().getId() == 105 || activeChar.getClassId().getId() == 110 || activeChar.getClassId().getId() == 111 || activeChar.getClassId().getId() == 112 || activeChar.getClassId().getId() == 115 || activeChar.getClassId().getId() == 116)
+                                        {
+                                                if (item.getItemType() == L2ArmorType.HEAVY || item.getItemType() == L2ArmorType.LIGHT)
+                                                {
+                                                        activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_EQUIP_ITEM_DUE_TO_BAD_CONDITION));
+                                                        return;
+                                                }
+                                        }

                 
                if (!Config.ALLOW_ARCHERS_WEAR_HEAVY)
                                if (activeChar.getClassId().getId() == 9 || activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 24 || activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 109)


Creditos : Manoel-Adm,Mazokista

paytaly 26-11-2010 09:09 PM

Código:

+                                if (!Config.ALLOW_MAGE_USE_HEAVY_OR_LIGHT)
+                                        if (activeChar.getClassId().getId() == 10 || activeChar.getClassId().getId() == 11 || activeChar.getClassId().getId() == 12 || activeChar.getClassId().getId() == 13 || activeChar.getClassId().getId() == 14 || activeChar.getClassId().getId() == 15 || activeChar.getClassId().getId() == 16 || activeChar.getClassId().getId() == 17 || activeChar.getClassId().getId() == 25 || activeChar.getClassId().getId() == 26 || activeChar.getClassId().getId() == 27 || activeChar.getClassId().getId() == 28 || activeChar.getClassId().getId() == 29 || activeChar.getClassId().getId() == 30 || activeChar.getClassId().getId() == 38 || activeChar.getClassId().getId() == 39 || activeChar.getClassId().getId() == 40 || activeChar.getClassId().getId() == 41 || activeChar.getClassId().getId() == 42 || activeChar.getClassId().getId() == 43 || activeChar.getClassId().getId() == 49 || activeChar.getClassId().getId() == 50 || activeChar.getClassId().getId() == 51 || activeChar.getClassId().getId() == 52 || activeChar.getClassId().getId() == 94 || activeChar.getClassId().getId() == 95 || activeChar.getClassId().getId() == 96 || activeChar.getClassId().getId() == 97 || activeChar.getClassId().getId() == 98 || activeChar.getClassId().getId() == 103 || activeChar.getClassId().getId() == 104 || activeChar.getClassId().getId() == 105 || activeChar.getClassId().getId() == 110 || activeChar.getClassId().getId() == 111 || activeChar.getClassId().getId() == 112 || activeChar.getClassId().getId() == 115 || activeChar.getClassId().getId() == 116)

+                                        {
+                                                if (item.getItemType() == L2ArmorType.HEAVY || item.getItemType() == L2ArmorType.LIGHT)
+                                                {
+                                                        activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_EQUIP_ITEM_DUE_TO_BAD_CONDITION));
+                                                        return;
+                                                }
+                                        }

Mais prático:
Código:

+                                if (!Config.ALLOW_MAGE_USE_HEAVY_OR_LIGHT && activeChar.isMageClass())

Inspector 26-11-2010 09:36 PM

So por Curiosidade, vcs nao esquecerao os Magos que tem como Skill Passivas outros Sets nao ne ou seja, bloqueando assim a chance de eles atuarem com 100% do seu potencial, ou seja colocando esse mod por exemplo vc inibira o Dominator por exemplo assim que soltar 3 magias e esgotar sua mana de colocar ums et Heavy ou light para ganhar seus bonus passivos e ativos e continuar uma luta na olly por exemplo como fighter

ou seja uma faca de 2 gumes

ManoeL-ADM 26-11-2010 09:57 PM

@paytaly

e pra fight ficaria como?

Citação:

if (activeChar.isFightClass())
?

paytaly 26-11-2010 11:52 PM

Pensa mais um pouco. Se o Player não é Mago, obviamente é Fighter...
Código:

!activeChar.isMageClass()
E como o Inspector disse, isso é totalmente Custom. Essa Restrição para quem valoriza todas as classes no Servidor não deve existir. Além do Overlord citado por ele, todos os outros Summoners, Buffers, por exemplo usam os outros Sets.


Horários baseados na GMT -3. Agora são 04:40 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0