A Project for Chronicle 4 based on L2JServer.


    anti heavy sistem

    Share
    avatar
    jamaica

    Posts : 135
    Join date : 2013-02-24
    Age : 28
    Location : Romania

    anti heavy sistem

    Post  jamaica on 18th September 2013, 22:40

    Code:
    Index: java/net/sf/l2j/Config.java
    ===================================================================
    --- java/net/sf/l2j/Config.java (revision 45)
    +++ java/net/sf/l2j/Config.java (working copy)
    @@ -558,7 +558,26 @@
     public static int HOPZONE_DUALBOXES_ALLOWED;
         public static boolean ALLOW_HOPZONE_GAME_SERVER_REPORT;
        
    +    public static boolean ENABLE_ANTI_HEAVY;
    +    
        //--------------------------------------------------
     // Server
     //--------------------------------------------------
    @@ -1462,6 +1481,38 @@
                     }
                     HOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(mods.getProperty("HopzoneDualboxesAllowed", "1"));
                     ALLOW_HOPZONE_GAME_SERVER_REPORT = Boolean.parseBoolean(mods.getProperty("AllowHopzoneGameServerReport", "false"));
     
    +                ENABLE_ANTI_HEAVY = Boolean.parseBoolean(mods.getProperty("EnableAntiHeavySystem", "True"));
    +                  
                }
                 catch (Exception e)
                 {

    ### Eclipse Workspace Patch 1.0

    Index: config/custom.properties
    ===================================================================
    --- config/custom.properties (revision 44)
    +++ config/custom.properties (working copy)
    @@ -5,7 +5,7 @@
    +
    +# Enable or Disable anti-heavy system.
    +# Dagger, tyrant, and bow classes won't be able to equip heavy type armours.
    +EnableAntiHeavySystem = True
    \ No newline at end of file

    ### Eclipse Workspace Patch 1.0

    Index: java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (revision 44)
    +++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java (working copy)
    @@ -31,6 +31,7 @@
     import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
     import net.sf.l2j.gameserver.network.serverpackets.ShowCalculator;
     import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.templates.item.L2ArmorType;
     import net.sf.l2j.gameserver.templates.item.L2Item;
     import net.sf.l2j.gameserver.templates.item.L2Weapon;
     import net.sf.l2j.gameserver.templates.item.L2WeaponType;
    @@ -116,6 +117,17 @@
     return;
     }
     
    + if (Config.ENABLE_ANTI_HEAVY && item.getItemType() == L2ArmorType.HEAVY) {
    + if (activeChar.getClassId().getId() == 48 || activeChar.getClassId().getId() == 114 || activeChar.getClassId().getId() == 109
    + || activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 108 || activeChar.getClassId().getId() == 36
    + || activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 24 || activeChar.getClassId().getId() == 101
    + || activeChar.getClassId().getId() == 23 || activeChar.getClassId().getId() == 93 || activeChar.getClassId().getId() == 8
    + || activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 9) {
    + activeChar.sendMessage("Your class can't equip heavy type armors.");
    + return;
    + }
    + }
    +
    if (!Config.KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0)
     {
     switch (_itemId)
    avatar
    DnR
    Admin
    Admin

    Posts : 1023
    Join date : 2012-12-03

    Re: anti heavy sistem

    Post  DnR on 20th September 2013, 16:39

    Thanks a lot for your share. Smile
    avatar
    yusuketh

    Posts : 58
    Join date : 2013-07-12

    Re: anti heavy sistem

    Post  yusuketh on 20th September 2013, 19:01

    It would be a good add on custom.properties, this is very useful, perhaps in a future SVN, thanks for sharing.
    avatar
    jamaica

    Posts : 135
    Join date : 2013-02-24
    Age : 28
    Location : Romania

    Re: anti heavy sistem

    Post  jamaica on 21st September 2013, 12:00

    its up to DnR if he is going to add this as feature....anyways more little stuffs will come soon but as i see only i come with improves and there is another pshyco guy arround here to test every part of this project and report all buggs....where is everybody else? :/

    Sponsored content

    Re: anti heavy sistem

    Post  Sponsored content


      Current date/time is 24th September 2017, 09:52