Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.L2Skill


        return;

      int totalBuffsOnOwner = 0;
      int i = 0;
      int rand = Rnd.get(_numBuffs);
      L2Skill buffToGive = null;

      // get this npc's skills:  getSkills()
      for(L2Skill skill : _tamedBeast.getTemplate().getSkills().values())
      {
        // if the skill is a buff, check if the owner has it already [  owner.getEffect(L2Skill skill) ]
View Full Code Here


    }

    if(player.isDead() || !player.isVisible() || !player.isInsideRadius(this, getDistanceToWatchObject(player), false, false))
      return false;

    L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);

    if(player.getFirstEffect(skill) == null)
    {
      skill.getEffects(this, player,false,false,false);
      broadcastPacket(new MagicSkillUser(this, player, skill.getId(), skillLevel, skill.getHitTime(), 0));
      skill = null;
      return true;
    }
    return false;
  }
View Full Code Here

      int skillLevel = player.getLevel() > 40 ? 1 : 2;

      if(player.isDead() || !player.isVisible() || !isInsideRadius(player, getDistanceToWatchObject(player), false, false))
        return false;

      L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);
      if(player.getFirstEffect(skill) == null)
      {
        skill.getEffects(_caster, player,false,false,false);
        broadcastPacket(new MagicSkillUser(_caster, player, skill.getId(), skillLevel, skill.getHitTime(), 0));
        SystemMessage sm = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
        sm.addSkillName(skillId);
        player.sendPacket(sm);
        skill = null;
        return true;
View Full Code Here

    sId = set.getInteger("onCast_skill_id");
    sLv = set.getInteger("onCast_skill_lvl");
    int sCh = set.getInteger("onCast_skill_chance");
    if(sId > 0 && sLv > 0 && sCh > 0)
    {
      L2Skill skill = SkillTable.getInstance().getInfo(sId, sLv);
      skill.attach(new ConditionGameChance(sCh), true);
      attachOnCast(skill);
    }

    sId = set.getInteger("onCrit_skill_id");
    sLv = set.getInteger("onCrit_skill_lvl");
    sCh = set.getInteger("onCrit_skill_chance");
    if(sId > 0 && sLv > 0 && sCh > 0)
    {
      L2Skill skill = SkillTable.getInstance().getInfo(sId, sLv);
      skill.attach(new ConditionGameChance(sCh), true);
      attachOnCrit(skill);
    }
  }
View Full Code Here

          }
        }
       
        // Smart Cubic debuff cancel is 100%
        boolean UseCubicCure = false;
        L2Skill skill = null;
       
        if (_id >= SMART_CUBIC_EVATEMPLAR && _id <= SMART_CUBIC_SPECTRALMASTER)
        {
          L2Effect[] effects = owner.getAllEffects();
         
          for (L2Effect e : effects)
          {
            if (e != null && e.getSkill().isOffensive())
            {
              UseCubicCure = true;
              e.exit(true);
            }
          }
        }
       
        if (UseCubicCure)
        {
          // Smart Cubic debuff cancel is needed, no other skill is used in this
          // activation period
          MagicSkillUser msu = new MagicSkillUser(owner, owner, SKILL_CUBIC_CURE, 1, 0, 0);
          owner.broadcastPacket(msu);
        }
        else if (Rnd.get(100) < _chance)
        {
          skill = _skills.get(Rnd.get(_skills.size()));
          if (skill != null)
          {
           
            if (skill.getId() == SKILL_CUBIC_HEAL)
            {
              // friendly skill, so we look a target in owner's party
              cubicTargetForHeal();
            }
            else
            {
              // offensive skill, we look for an enemy target
              getCubicTarget();
              if (_target == owner || !isInCubicRange(owner, _target))
                _target = null;
            }
           
            final L2Character target = _target;
           
            if ((target != null) && (!target.isDead()))
            {
              if (Config.DEBUG)
              {
                _log.info("L2CubicInstance: Action.run();");
                _log.info("Cubic Id: "
                    + _id
                    + " Target: "
                    + target.getName()
                    + " distance: "
                    + Math.sqrt(target.getDistanceSq(owner.getX(), owner.getY(), owner.getZ())));
              }
             
              owner.broadcastPacket(new MagicSkillUser(owner, target, skill.getId(), skill.getLevel(), 0, 0));
             
              SkillType type = skill.getSkillType();
              ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
              L2Character[] targets = { target };
             
              if ((type == SkillType.PARALYZE) || (type == SkillType.STUN)
                  || (type == SkillType.ROOT)
                  || (type == SkillType.AGGDAMAGE))
View Full Code Here

        cancelDisappear();
        return;
      }
      try
      {
        L2Skill skill = null;
        for (L2Skill sk : _skills)
        {
          if (sk.getId() == SKILL_CUBIC_HEAL)
          {
            skill = sk;
            break;
          }
        }
       
        if (skill != null)
        {
          cubicTargetForHeal();
          L2Character target = _target;
          if (target != null && !target.isDead())
          {
            if (target.getMaxHp() - target.getCurrentHp() > skill.getPower())
            {
              L2Character[] targets = { target };
              ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
              if (handler != null)
              {
                handler.useSkill(_owner, skill, targets);
              }
              else
              {
                skill.useSkill(_owner, targets);
              }
             
              MagicSkillUser msu = new MagicSkillUser(_owner, target, skill.getId(), skill.getLevel(), 0, 0);
              _owner.broadcastPacket(msu);
            }
          }
        }
      }
View Full Code Here

        {
          if(temp != null && !temp.isDead())
          {
            if((temp instanceof L2PlayableInstance && getTargetType().equalsIgnoreCase("pc") || temp instanceof L2PcInstance && getTargetType().equalsIgnoreCase("pc_only") || temp instanceof L2MonsterInstance && getTargetType().equalsIgnoreCase("npc")) && Rnd.get(100) < getChance())
            {
              L2Skill skill = null;
              if((skill=getSkill())==null){
                System.out.println("ATTENTION: error on zone with id "+getId());
                System.out.println("Skill "+_skillId+","+_skillLvl+" not present between skills");
              }else
                skill.getEffects(temp, temp,false,false,false);
            }
          }
        }
      }
    }
View Full Code Here

    if(command.equals("admin_addbufftest"))
    {
      L2Character target = (L2Character) activeChar.getTarget();
      activeChar.sendMessage("cast");
     
      L2Skill skill = SkillTable.getInstance().getInfo(1085,3);

      if (target != null)
      {
        activeChar.sendMessage("target locked");
       
View Full Code Here

        return;
      }
      else if(actualCommand.equalsIgnoreCase("support"))
      {
        setTarget(player);
        L2Skill skill;
        if(val == "")
          return;

        try
        {
          int skill_id = Integer.parseInt(val);
          try
          {
            int skill_lvl = 0;
            if(st.countTokens() >= 1)
            {
              skill_lvl = Integer.parseInt(st.nextToken());
            }
            skill = SkillTable.getInstance().getInfo(skill_id, skill_lvl);
            if(skill.getSkillType() == SkillType.SUMMON)
            {
              player.doCast(skill);
            }
            else
            {
              if(!(skill.getMpConsume() + skill.getMpInitialConsume() > getCurrentMp()))
              {
                doCast(skill);
              }
              else
              {
View Full Code Here

    }
  }

  public boolean usePotion(L2PcInstance activeChar, int magicId, int level)
  {
    L2Skill skill = SkillTable.getInstance().getInfo(magicId, level);
    if(skill != null)
    {
      activeChar.doCast(skill);
      if(!((activeChar.isSitting() || activeChar.isParalyzed() || activeChar.isAway() || activeChar.isFakeDeath()) && !skill.isPotion()))
        return true;
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.L2Skill

Copyright © 2018 www.massapicom. 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.