Advertisement
Guest User

EffectBuff.java

a guest
Aug 3rd, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.77 KB | None | 0 0
  1. /*
  2.  * This program is free software: you can redistribute it and/or modify it under
  3.  * the terms of the GNU General Public License as published by the Free Software
  4.  * Foundation, either version 3 of the License, or (at your option) any later
  5.  * version.
  6.  *
  7.  * This program is distributed in the hope that it will be useful, but WITHOUT
  8.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10.  * details.
  11.  *
  12.  * You should have received a copy of the GNU General Public License along with
  13.  * this program. If not, see <http://www.gnu.org/licenses/>.
  14.  */
  15. package net.sf.l2j.gameserver.skills.effects;
  16.  
  17. import net.sf.l2j.commons.config.Config;
  18. import net.sf.l2j.gameserver.model.L2Effect;
  19. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  20. import net.sf.l2j.gameserver.model.item.kind.Premium;
  21. import net.sf.l2j.gameserver.skills.Env;
  22. import net.sf.l2j.gameserver.templates.skills.L2EffectType;
  23.  
  24. /**
  25.  * @author mkizub
  26.  */
  27. public class EffectBuff extends L2Effect
  28. {
  29.     public EffectBuff(Env env, EffectTemplate template)
  30.     {
  31.         super(env, template);
  32.         if (env != null)
  33.         {
  34.             if (Config.PREMIUM_ITEM_ENABLED && env.getTarget() != null)
  35.             {
  36.                 if (env.getTarget() instanceof L2PcInstance)
  37.                 {
  38.                     final L2PcInstance player = (L2PcInstance) env.getTarget();
  39.                     if (player.getPremiumAttribute(Premium.MODIFIER_BUFFS_TIME) != 0)
  40.                     {
  41.                         this.setPeriod((int) (this.getPeriod() * player.getPremiumAttribute(Premium.MODIFIER_BUFFS_TIME)));
  42.                     }
  43.                 }
  44.             }
  45.         }
  46.     }
  47.    
  48.     @Override
  49.     public L2EffectType getEffectType()
  50.     {
  51.         return L2EffectType.BUFF;
  52.     }
  53.    
  54.     @Override
  55.     public boolean onActionTime()
  56.     {
  57.         // just stop this effect
  58.         return false;
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement