Package net.sf.l2j.gameserver.model

Examples of net.sf.l2j.gameserver.model.L2Character.reduceCurrentHp()


                  damage = (int)Formulas.getInstance().calcPhysDam(
                  activeChar, target, skill, shld, crit, dual, soul);

                if (damage > 0)
                {
                  target.reduceCurrentHp(damage, activeChar);
                  if (soul && weapon!= null)
                    weapon.setChargedSoulshot(L2ItemInstance.CHARGED_NONE);

                  activeChar.sendDamageMessage(target, damage, false, false, false);
View Full Code Here


                               player.reduceCurrentHp(damage, activeChar);
                    }
                   }
                    else if (target instanceof L2MonsterInstance) // If is a monster remove first damage and after 50% of current hp
                    {
                     target.reduceCurrentHp(damage, activeChar);
                     target.reduceCurrentHp(target.getCurrentHp()/2, activeChar);
                    }
                  }
                  else //2nd lethal effect activate (cp,hp to 1 or if target is npc then hp to 1)
                  {
View Full Code Here

                    }
                   }
                    else if (target instanceof L2MonsterInstance) // If is a monster remove first damage and after 50% of current hp
                    {
                     target.reduceCurrentHp(damage, activeChar);
                     target.reduceCurrentHp(target.getCurrentHp()/2, activeChar);
                    }
                  }
                  else //2nd lethal effect activate (cp,hp to 1 or if target is npc then hp to 1)
                  {
                         // If is a monster damage is (CurrentHp - 1) so HP = 1
View Full Code Here

                  }
                  else //2nd lethal effect activate (cp,hp to 1 or if target is npc then hp to 1)
                  {
                         // If is a monster damage is (CurrentHp - 1) so HP = 1
                        if (target instanceof L2NpcInstance)
                            target.reduceCurrentHp(target.getCurrentHp()-1, activeChar);
                  else if (target instanceof L2PcInstance) // If is a active player set his HP and CP to 1
                  {
                    L2PcInstance player = (L2PcInstance)target;
                    if (!player.isInvul())
                    {
View Full Code Here

                      smsg.addNumber(damage);
                      player.sendPacket(smsg);

                }
                else
                  target.reduceCurrentHp(damage, activeChar);
                  }
                  else
                  {
                    target.reduceCurrentHp(damage, activeChar);
                  }
View Full Code Here

                else
                  target.reduceCurrentHp(damage, activeChar);
                  }
                  else
                  {
                    target.reduceCurrentHp(damage, activeChar);
                  }
                }
            }
            else // No - damage
            {
View Full Code Here

              smsg.addString(activeChar.getName());
              smsg.addNumber((int)damage);
              player.sendPacket(smsg);
            }
            else
              target.reduceCurrentHp(damage, activeChar);
        if(activeChar instanceof L2PcInstance)
          activeChar.sendPacket(new SystemMessage(SystemMessageId.CRITICAL_HIT));
        SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DID_S1_DMG);
              sm.addNumber((int)damage);
              activeChar.sendPacket(sm);
View Full Code Here

        int chance = Rnd.get(100);
        //2nd lethal effect activate (cp,hp to 1 or if target is npc then hp to 1)
        if(skill.getLethalChance2() > 0 && chance < Formulas.getInstance().calcLethal(activeChar, target, skill.getLethalChance2()))
              {
                if (target instanceof L2NpcInstance)
                        target.reduceCurrentHp(target.getCurrentHp()-1, activeChar);
              else if (target instanceof L2PcInstance) // If is a active player set his HP and CP to 1
              {
                L2PcInstance player = (L2PcInstance)target;
                if (!player.isInvul()){
                  player.setCurrentHp(1);
View Full Code Here

                  L2PcInstance player = (L2PcInstance)target;
                if (!player.isInvul())
                  player.setCurrentCp(1); // Set CP to 1
                  }
                else if (target instanceof L2NpcInstance) // If is a monster remove first damage and after 50% of current hp
                  target.reduceCurrentHp(target.getCurrentHp()/2, activeChar);
                activeChar.sendPacket(new SystemMessage(SystemMessageId.LETHAL_STRIKE));
        }
      }
            L2Effect effect = activeChar.getFirstEffect(skill.getId());
            //Self Effect
View Full Code Here

    }
    if (target != null)
    {
      if (target instanceof L2PcInstance)
      {
        target.reduceCurrentHp(target.getMaxHp() + target.getMaxCp() + 1, activeChar);
        filename = "charmanage.htm";
      }
      else if (Config.L2JMOD_CHAMPION_ENABLE && target.isChampion())
        target.reduceCurrentHp(target.getMaxHp()*Config.L2JMOD_CHAMPION_HP + 1, activeChar);
      else
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.