A Project for Chronicle 4 based on L2JServer.


    Buff time in rates.

    Share
    avatar
    arteon

    Posts : 82
    Join date : 2013-12-14

    Buff time in rates.

    Post  arteon on 21st July 2015, 10:11

    So i was looking for a faster way of changing bufftimes and i remembed l2jfree used to have something like this.

    It was created for rev 513.

    https://gist.github.com/JMD13/70b1c760249049cfc823

    Code:
    Index: java/config/rates.properties
    ===================================================================
    --- java/config/rates.properties (revision 4)
    +++ java/config/rates.properties (working copy)
    @@ -57,4 +57,9 @@
     #   is LastLevelSpoilIsLearned for calculations on success rate
     #   72 = spoil lvl 11 (c3)
     LastLevelSpoilIsLearned = 72
    -# ----
    \ No newline at end of file
    +# ------------------------
    +#  Buff Time Rates
    +# ------------------------
    +BuffMultiplier=1.00
    +SpiritMultiplier=1.00
    +DanceTimeMultiplier=1.00
    \ No newline at end of file
    Index: java/net/sf/l2j/Config.java
    ===================================================================
    --- java/net/sf/l2j/Config.java (revision 4)
    +++ java/net/sf/l2j/Config.java (working copy)
    @@ -555,6 +555,11 @@
         public static int   KARMA_RATE_DROP_EQUIP;
         /** Karma drop rate for equipment and weapon */
         public static int   KARMA_RATE_DROP_EQUIP_WEAPON;
    +    
    +    // Buff rates
    +    public static float BUFF_TIME_MULTIPLIER;
    +    public static float SPIRIT_TIME_MULTIPLIER;
    +    public static float DANCE_TIME_MULTIPLIER;
     
         /** Time after which item will auto-destroy */
         public static int     AUTODESTROY_ITEM_AFTER;
    @@ -1772,6 +1777,10 @@
                     KARMA_RATE_DROP_EQUIP           = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
                     KARMA_RATE_DROP_EQUIP_WEAPON    = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
                
    +                BUFF_TIME_MULTIPLIER = Float.parseFloat(ratesSettings.getProperty("BuffMultiplier", "1.00"));
    +                SPIRIT_TIME_MULTIPLIER = Float.parseFloat(ratesSettings.getProperty("SpiritMultiplier", "1.00"));
    +                DANCE_TIME_MULTIPLIER = Float.parseFloat(ratesSettings.getProperty("DanceTimeMultiplier", "1.00"));
    +                
                CAN_SPOIL_LOWER_LEVEL_MOBS              = Boolean.parseBoolean(ratesSettings.getProperty("CanSpoilLowerLevelMobs", "false"));
                CAN_DELEVEL_AND_SPOIL_MOBS              = Boolean.parseBoolean(ratesSettings.getProperty("CanDelevelToSpoil", "true"));                      
                MAXIMUM_PLAYER_AND_MOB_LEVEL_DIFFERENCE = Float.parseFloat(ratesSettings.getProperty("MaximumPlayerAndMobLevelDifference", "9."));
    Index: java/net/sf/l2j/gameserver/skills/DocumentBase.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/skills/DocumentBase.java (revision 4)
    +++ java/net/sf/l2j/gameserver/skills/DocumentBase.java (working copy)
    @@ -222,8 +222,15 @@
                     }
                 }
             }
    -        else
    -            time = ((L2Skill) template).getBuffDuration() / 1000 / count;
    +       else time = ((L2Skill) template).getBuffDuration() / 1000 / count;
    +        
    +      if (attrs.getNamedItem("name").getNodeValue().equalsIgnoreCase("buff"))
    +         //if (((L2Skill)template).isDance()) time = (int)((float)time * Config.DANCE_TIME_MULTIPLIER);
    +      if (119 < time && time < 151) time = (int)((float)time * Config.DANCE_TIME_MULTIPLIER);
    +         else
    +          if (1199 < time && time < 1501) time = (int)((float)time * Config.BUFF_TIME_MULTIPLIER);
    +         else
    +          if (299 < time && time < 481) time = (int)((float)time * Config.SPIRIT_TIME_MULTIPLIER);
     
             boolean self = false;
             if (attrs.getNamedItem("self") != null)

    Example 59 minutes (1hour) buff duration:
    # ------------------------
    # Buff Time Rates
    # ------------------------
    BuffMultiplier=3.00
    SpiritMultiplier=12.00
    DanceTimeMultiplier=30.00

      Current date/time is 25th September 2017, 21:57