Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [Lineage] Java Mods (https://secretexperience.net/forumdisplay.php?f=636)
-   -   [L2JServer] Enchant Protection Packet (https://secretexperience.net/showthread.php?t=33313)

polarbr 04-01-2012 08:11 PM

Enchant Protection Packet
 
Bem pessoal,vim postar pra vocês uma pacote de proteções para enchantar, Meu Primeiro Post :horse:

Código:

### Eclipse Workspace Patch 1.0
#P L2JWind_Gameserver
#by BrunoBR
Index: java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java        (revision 5117)
+++ java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java        (working copy)
@@ -69,6 +69,121 @@
                activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            return;
        }
+        if(activeChar.isInCraftMode())
+        {
+            activeChar.setActiveEnchantItem(null);
+            activeChar.sendMessage("Can't enchant while Crafting");
+            return;
+        }
+        if(activeChar.isTeleporting())
+            {
+            activeChar.setActiveEnchantItem(null);
+            activeChar.sendMessage("Can't enchant while You Teleporting");
+            return;
+            }
+        if(activeChar.isDead())
+            {
+            activeChar.setActiveEnchantItem(null);
+            activeChar.sendMessage("Can't enchant while You Are Dead");
+            return;
+            }
+        if(activeChar.isSleeping())
+            {
+            activeChar.setActiveEnchantItem(null);
+            activeChar.sendMessage("Can't enchant while You Are In Sleep");
+            return;
+            }
+        if(activeChar.isParalyzed())
+            {
+            activeChar.setActiveEnchantItem(null);
+            activeChar.sendMessage("Can't enchant while You Are In Para");
+            return;
+            }
+       
+        if(activeChar.isCastingNow())
+            {
+            activeChar.setActiveEnchantItem(null);
+            activeChar.sendMessage("Can't enchant while Casting");
+            return;
+            }
+       
+        if(activeChar.isMoving())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while moving");
+        return;
+        }
+
+        if(activeChar.isProcessingTransaction())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while trading");
+        return;
+        }
+
+        if(activeChar.isStunned())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while stunned");
+        return;
+        }
+
+        if(activeChar.isMounted())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while mounted");
+        return;
+        }
+
+        if(activeChar.isFakeDeath())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while fake death");
+        return;
+        }
+
+        if(activeChar.isInJail())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while in jail");
+        return;
+        }
+
+        if(activeChar.isCursedWeaponEquiped())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while cursed weapon");
+        return;
+        }
+
+        if(activeChar.isInWater())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while in water");
+        return;
+        }
+
+        if(activeChar.isFlying())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while flying");
+        return;
+        }
+
+        if(activeChar.isFishing())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while fishing");
+        return;
+        }
+
+        if(activeChar.isSitting())
+        {
+        activeChar.setActiveEnchantItem(null);
+        activeChar.sendMessage("Can't enchant while sitting");
+        return;
+        }
+       
        if(item.isWear())
        {
            Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" tried to enchant a weared Item", IllegalPlayerAction.PUNISH_KICK);

Creditos: BrunoBR(Eu)

Bom Uso !

OliverSykes 05-01-2012 12:16 AM

Poderia por mais explicações sobre o uso dele porque muitas pessoas irão ver e ficaram sem entender !

leonardoalves 06-01-2012 11:37 AM

isso são restrições de enchant, provavelmente se você adcionar todas o char só vai enchantar se tiver imóvel, "parado".

OliverSykes 06-01-2012 11:53 AM

Eu conheço a proteção amigo to falando pra ele explica mais porque vai ter pessoas que não sabem o que ela faz por isso pedi !


Horários baseados na GMT -3. Agora são 11:29 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.