Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo.
Caso seja registrado, efetue login.
Esqueceu sua senha? Clique aqui
Recomendamos o uso do Mozilla Firefox para uma melhor visualização.    


Início Postados Hoje Marcar Fóruns Como Lidos Álbums Banidos SE Team Medalhas
Voltar   Secret Experience > Área L2J > [L2J] Downloads > [Lineage] Java Mods
Registrar Loteria VIPStaff SERegras do fórum Membros Arcade Pesquisar Postados Hoje Marcar Fóruns Como Lidos Experience
   

Secret Experience.NET   Secret Experience Corporation - Welcome To The Real World
     Anúncios SE

Resposta
 
LinkBack Ferramentas do Tópico Modos de Exibição
Antigo 14-09-2010, 05:34 PM   #1 (permalink)
Membro - Veterano
 
Avatar de Mazokista
 
Registrado em: Dec 2009
Posts: 1,335
Agradeceu: 490
Agradecido 803 Vezes em 427 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Sistema
Rate Designer: Iniciante
Meu Estado:
Enviar mensagem via Windows Live Messenger para Mazokista
Nome Real: Roberto

Inventório de Mazokista

Icon2 Restricao de Item Em Olympiad

Creditos : GUMA

Esse Mod Faz com qui Voce Possa impedir qual quer item qui voce nao Deseja nas Olympiads ;) Basta Colokar o ID do Item

Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: /Trunk/L2JStep_CORE/config/altsettings.properties
===================================================================
--- /Trunk/L2JStep_CORE/config/altsettings.properties (revision 99)
+++ /Trunk/L2JStep_CORE/config/altsettings.properties (revision 100)
@@ -133,2 +133,19 @@

+
+# This is the item restriction for olympiad. if an item is restricted , then a player cannot 
+# Use it in olympiad mode. this is a fastlist. so it has to be like  (OlyRestrictedItems = 1,2,3)  
+OlyRestrictedItems = 0
+

Index: /TrunK/L2JStep_CORE/java/com/l2jstep/Config.java
===================================================================
--- /TrunK/L2JStep_CORE/java/com/l2jstep/Config.java (revision 99)
+++ /TrunK/L2JStep_CORE/java/com/l2jstep/Config.java (revision 100)
@@ -834,4 +834,9 @@
 
+    public static FastList<Integer> ALT_OLY_RESTRICTED_ITEMS = new FastList<Integer>(); 

@@ -1984,4 +1989,8 @@
+                ALT_OLY_RESTRICTED_ITEMS = new FastList<Integer>();  
+                     for (String id : AltSettings.getProperty("OlyRestrictedItems","0").split(","))  
+                     {  
+                                ALT_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));  
+                     } 

Index: /Trunk/L2JStep_CORE/java/com/l2jstep/gameserver/model/L2ItemInstance.java
===================================================================
--- /Trunk/L2JStep_CORE/java/com/l2jstep/gameserver/model/L2ItemInstance.java (revision 99)
+++ /Trunk/L2JStep_CORE/java/com/l2jstep/gameserver/model/L2ItemInstance.java (revision 100)
@@ -107,4 +107,10 @@
 
     public long getDropTime()
     {
         return _dropTime;
     }
+    public boolean isOlyRestrictedItem()
+    {
+        return (Config.ALT_OLY_RESTRICTED_ITEMS.contains(_itemId));
+    }
    
Index: /Trunk/L2JStep_CORE/java/com/l2jstep/gameserver/Olympiad.java
===================================================================
--- /Trunk/L2JStep_CORE/java/com/l2jstep/gameserver/Olympiad.java (revision 99)
+++ /Trunk/L2JStep_CORE/java/com/l2jstep/gameserver/Olympiad.java (revision 100)
@@ -107,4 +107,10 @@
             //Remove Hero Weapons
             //Possible fix for Exploits With Conversion SA Weapons
             // check to prevent the using of weapon/shield on strider/wyvern
-            L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
-            if (wpn == null) wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
-            if (wpn != null &&
-                    (
-                            (wpn.getItemId() >= 6611 && wpn.getItemId() <= 6621) ||
-                            wpn.getItemId() == 6842 ||
-                            wpn.getItemId() == 5597 || 
-                            wpn.getItemId() == 5605 || 
-                            wpn.getItemId() == 6314 || 
-                            wpn.getItemId() == 7715 || 
-                            wpn.getItemId() == 8119 || 
-                            wpn.getItemId() == 8138 || 
-                            wpn.getItemId() == 8146 || 
-                            wpn.getItemId() == 8815 
-                    )
-                )
+            L2ItemInstance wpn;
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != null)
             {
-                L2ItemInstance[] unequiped = player.getInventory().unEquipItemInBodySlotAndRecord(wpn.getItem().getBodyPart());
-                InventoryUpdate iu = new InventoryUpdate();
-                for (int i = 0; i < unequiped.length; i++)
-                    iu.addModifiedItem(unequiped[i]);
-                player.sendPacket(iu);
-                player.abortAttack();
-                player.broadcastUserInfo();
-
-                // this can be 0 if the user pressed the right mousebutton twice very fast
-                if (unequiped.length > 0)
-                {
-                    if (unequiped[0].isWear())
-                        return;
-                    SystemMessage sm = null;
-                    if (unequiped[0].getEnchantLevel() > 0)
-                    {
-                        sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
-                        sm.addNumber(unequiped[0].getEnchantLevel());
-                        sm.addItemName(unequiped[0].getItemId());
-                    }
-                    else
-                    {
-                        sm = new SystemMessage(SystemMessageId.S1_DISARMED);
-                        sm.addItemName(unequiped[0].getItemId());
-                    }
-                    player.sendPacket(sm);
-                }
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
+                checkWeaponArmor(player, wpn);
             }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_UNDER) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_UNDER);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_BACK) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_BACK);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FACE) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FACE);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HAIR) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HAIR);
+                checkWeaponArmor(player, wpn);
+            }
+            if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_DHAIR) != null)
+            {
+                wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_DHAIR);
+                checkWeaponArmor(player, wpn);
+            }
 
             //Remove ss/sps/bsps automation
             Map<Integer, Integer> activeSoulShots = player.getAutoSoulShot();
@@ -702,4 +748,35 @@
                 }
         }
     }
-}
\ No newline at end of file
+    private void checkWeaponArmor(L2PcInstance player, L2ItemInstance wpn)
+    {
+        if (wpn != null && (wpn.isOlyRestrictedItem()))
+        {
+            L2ItemInstance[] unequiped = player.getInventory().unEquipItemInBodySlotAndRecord(wpn.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequiped)
+                iu.addModifiedItem(element);
+            player.sendPacket(iu);
+            player.abortAttack();
+            player.broadcastUserInfo();
+            if (unequiped.length > 0)
+            {
+                if (unequiped[0].isWear())
+                    return;
+                SystemMessage sm = null;
+                if (unequiped[0].getEnchantLevel() > 0)
+                {
+                    sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
+                    sm.addNumber(unequiped[0].getEnchantLevel());
+                    sm.addItemName(unequiped[0].getItemId());
+                }
+                else
+                {
+                    sm = new SystemMessage(SystemMessageId.S1_DISARMED);
+                    sm.addItemName(unequiped[0].getItemId());
+                }
+                player.sendPacket(sm);
+            }
+        }
+    }
+}

Index: TrunK/*********_CORE/java/com/it/br/gameserver/clientpackets/UseItem.java
===================================================================
--- TrunK/*********_CORE/java/com/it/br/gameserver/clientpackets/UseItem.java (revision 1332)
+++ TrunK/*********_CORE/java/com/it/br/gameserver/clientpackets/UseItem.java (revision 1430)
@@ -337,6 +337,10 @@
                                             return; 
                                     }    
                             } 
+                if (activeChar.isInOlympiadMode() && (item.isOlyRestrictedItem()))
+                {
+                    return;
+                }
                 // Don't allow weapon/shield hero equipment during Olympiads
                 if (activeChar.isInOlympiadMode() && (bodyPart == L2Item.SLOT_LR_HAND || bodyPart == L2Item.SLOT_L_HAND || bodyPart == L2Item.SLOT_R_HAND) && ((item.getItemId() >= 6611 && item.getItemId() <= 6621) || item.getItemId() == 6842))
                 {return;}

Arquivos Anexados
Tipo de Arquivo: txt Restricao De Item.txt (11.7 KB, 24 visualizações) Baixar
Mazokista está offline  
Os Seguintes 3 Usuários disseram Obrigado(a) para Mazokista por gostarem deste post :
C.Bartowski (17-09-2010), campos (13-11-2010), The Death (27-07-2014)
Links Patrocinados
Resposta

Ferramentas do Tópico
Modos de Exibição

Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Sim



Horários baseados na GMT -3. Agora são 08:37 AM.