Advertisement
tensador125

Skin con sistema de l2jorion para buff con stats

Apr 16th, 2023
1,040
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.15 KB | Gaming | 0 0
  1.  * l2jwins Project - www.l2jwins.com
  2.  *
  3.  * This program is free software; you can redistribute it and/or modify
  4.  * it under the terms of the GNU General Public License as published by
  5.  * the Free Software Foundation; either version 2, or (at your option)
  6.  * any later version.
  7.  *
  8.  * This program is distributed in the hope that it will be useful,
  9.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.  * GNU General Public License for more details.
  12.  *
  13.  * You should have received a copy of the GNU General Public License
  14.  * along with this program; if not, write to the Free Software
  15.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  16.  * 02111-1307, USA.
  17.  *
  18.  * http://www.gnu.org/copyleft/gpl.html
  19.  */
  20. package l2jwins.game.skills.effects;
  21.  
  22. import l2jwins.game.model.L2Character;
  23. import l2jwins.game.model.L2Effect;
  24. import l2jwins.game.model.actor.instance.L2PcInstance;
  25. import l2jwins.game.skills.Env;
  26.  
  27. final class EffectBuff extends L2Effect
  28. {
  29.    
  30.     private static final int BUFF_SKILL_ID = 2635; // Cambia el ID del buff que quieres monitorear
  31.    
  32.     private static final int HUMAN_SKIN_TRANSFO = 1; // Cambia el ID del ítem de apariencia que quieres establecer
  33.    
  34.     private static final int ELF_SKIN_TRANSFO = 1; // Cambia el ID del ítem de apariencia que quieres establecer
  35.    
  36.     private static final int DARK_ELF_SKIN_TRANSFO = 3; // Cambia el ID del ítem de apariencia que quieres establecer
  37.    
  38.     private static final int ORC_SKIN_TRANSFO = 1; // Cambia el ID del ítem de apariencia que quieres establecer
  39.    
  40.     private static final int DWARF_SKIN_TRANSFO = 1; // Cambia el ID del ítem de apariencia que quieres establecer
  41.    
  42.     private static final int CRUSADER_SKILL_ID = 2636; // Cambia el ID del buff que quieres monitorear
  43.    
  44.     private static final int CRUSADER_TRANSFORMATION = 7; // Cambia el ID del ítem de apariencia que quieres establecer
  45.    
  46.     public EffectBuff(final Env envbuff, final EffectTemplate template)
  47.     {
  48.         super(envbuff, template);
  49.     }
  50.    
  51.     @Override
  52.     public EffectType getEffectType()
  53.     {
  54.         return EffectType.BUFF;
  55.     }
  56.    
  57.     @Override
  58.     public void onStart()
  59.     {
  60.         super.onStart();
  61.         if (getEffected() instanceof L2PcInstance)
  62.         {
  63.             L2PcInstance player = (L2PcInstance) getEffected();
  64.             if (_skill.getId() == BUFF_SKILL_ID)
  65.             {
  66.                 int armorSkinOption = 0; // Default armor skin option
  67.                
  68.                 // Set armor skin option based on player's race
  69.                 switch (player.getRace())
  70.                 {
  71.                     case human:
  72.                         armorSkinOption = HUMAN_SKIN_TRANSFO;
  73.                         player.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_SLEEP);
  74.                         break;
  75.                     case elf:
  76.                         armorSkinOption = ELF_SKIN_TRANSFO;
  77.                         player.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_SLEEP);
  78.                         break;
  79.                     case darkelf:
  80.                         armorSkinOption = DARK_ELF_SKIN_TRANSFO;
  81.                         player.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_SLEEP);
  82.                         break;
  83.                     case orc:
  84.                         armorSkinOption = ORC_SKIN_TRANSFO;
  85.                         player.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_SLEEP);
  86.                         break;
  87.                     case dwarf:
  88.                         armorSkinOption = DWARF_SKIN_TRANSFO;
  89.                         player.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_SLEEP);
  90.                         break;
  91.                     // Add more cases for other races if needed
  92.                    
  93.                 }
  94.                
  95.                 player.setArmorSkinOption(armorSkinOption); // Set armor skin option
  96.                 player.broadcastUserInfo();
  97.             }
  98.             else if (_skill.getId() == CRUSADER_SKILL_ID)
  99.             {
  100.                 player.setArmorSkinOption(CRUSADER_TRANSFORMATION);
  101.                 player.broadcastUserInfo();
  102.             }
  103.            
  104.         }
  105.     }
  106.    
  107.     @Override
  108.     public void onExit()
  109.     {
  110.         super.onExit();
  111.         if (getEffected() instanceof L2PcInstance)
  112.         {
  113.             L2PcInstance player = (L2PcInstance) getEffected();
  114.             if (_skill.getId() == BUFF_SKILL_ID)
  115.             {
  116.                 player.setArmorSkinOption(0); // Restore original armor skin option when buff is removed
  117.                 player.stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_SLEEP);
  118.                 player.broadcastUserInfo();
  119.             }
  120.             else if (_skill.getId() == CRUSADER_SKILL_ID)
  121.             {
  122.                 player.setArmorSkinOption(0);
  123.                 player.broadcastUserInfo();
  124.             }
  125.         }
  126.     }
  127.    
  128.     @Override
  129.     public boolean onActionTime()
  130.     {
  131.         return false;
  132.     }
  133. }
  134.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement