Package net.sf.l2j.gameserver.handler

Examples of net.sf.l2j.gameserver.handler.ISkillHandler


                         if (stat == "poison") negateEffect(target,SkillType.POISON,_negatePower);
                         if (stat == "bleed") negateEffect(target,SkillType.BLEED,_negatePower);
                         if (stat == "paralyze") negateEffect(target,SkillType.PARALYZE,-1);
                         if (stat == "heal")
                         {
                           ISkillHandler Healhandler = SkillHandler.getInstance().getSkillHandler(SkillType.HEAL);
                           if (Healhandler == null)
                           {
                             _log.severe("Couldn't find skill handler for HEAL.");
                             continue;
                           }
                           L2Object tgts[] = new L2Object[]{target};
                           try {
                             Healhandler.useSkill(activeChar, skill, tgts);
                           } catch (IOException e) {
                           _log.log(Level.WARNING, "", e);
                           }
                              }
                          }//end for
View Full Code Here


                continue; // Skill condition not met

            try
            {
                // Get the skill handler corresponding to the skill type
                ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());

                L2Character[] targets = new L2Character[1];
                targets[0] = target;

                // Launch the magic skill and calculate its effects
                if (handler != null)
                    handler.useSkill(caster, skill, targets);
                else
                    skill.useSkill(caster, targets);

                if ((caster instanceof L2PcInstance) && (target instanceof L2NpcInstance))
                {
View Full Code Here

                                                                         _skills.get(Rnd.get(_skills.size())),
                                                                         _level);
                        if (skill != null)
                        {
                            L2Character[] targets = {_target};
                            ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(
                                                                                               skill.getSkillType());

                            int x, y, z;
                            // temporary range check until real behavior of cubics is known/coded
                            int range = _target.getTemplate().collisionRadius + 400; //skill.getCastRange();

                            x = (_owner.getX() - _target.getX());
                            y = (_owner.getY() - _target.getY());
                            z = (_owner.getZ() - _target.getZ());
                            if ((x * x) + (y * y) + (z * z) <= (range * range))
                            {
                                if (handler != null)
                                {
                                    handler.useSkill(_owner, skill, targets);
                                }
                                else
                                {
                                    skill.useSkill(_owner, targets);
                                }
View Full Code Here

                            if (_owner.getCurrentHp() < _owner.getMaxHp()) target = _owner;
                        }
                        if (target != null)
                        {
                            L2Character[] targets = {target};
                            ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
                            if (handler != null)
                            {
                                handler.useSkill(_owner, skill, targets);
                            }
                            else
                            {
                                skill.useSkill(_owner, targets);
                            }
View Full Code Here

  public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets)
  {
//    L2Character activeChar = activeChar;
    //check for other effects
      try {
          ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(SkillType.BUFF);

            if (handler != null)
                handler.useSkill(activeChar, skill, targets);
      }
        catch (Exception e) {}

        L2Character target = null;
    L2ItemInstance weaponInst = activeChar.getActiveWeaponInstance();
View Full Code Here

  {
    // L2Character activeChar = activeChar;
    // check for other effects
    try
    {
      ISkillHandler handler = SkillHandler.getInstance().getSkillHandler(
          SkillType.BUFF);

      if (handler != null)
        handler.useSkill(activeChar, skill, targets);
    } catch (Exception e)
    {
    }

    L2Character target = null;
View Full Code Here

            }
          }
        }
      }
     
      ISkillHandler handler = null;
     
      // TODO Remove this useless section
      if (skill.isToggle())
      {
        // Check if the skill effects are already in progress on the L2Character
        if (getFirstEffect(skill.getId()) != null)
        {
          handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
         
          if (handler != null)
          {
            handler.useSkill(this, skill, targets);
          }
          else
          {
            skill.useSkill(this, targets);
          }
         
          if ((this instanceof L2PcInstance) || (this instanceof L2Summon))
          {
            L2PcInstance caster = (this instanceof L2PcInstance) ? (L2PcInstance) this : ((L2Summon) this).getOwner();
            for (L2Object target : targets)
            {
              if (target instanceof L2NpcInstance)
              {
                for (Quest quest : ((L2NpcInstance) target).getTemplate().getEventQuests(Quest.QuestEventType.MOB_TARGETED_BY_SKILL))
                {
                  quest.notifySkillUse((L2NpcInstance) target, caster, skill);
                }
              }
            }
          }
         
          return;
        }
      }
     
      // Check if over-hit is possible
      if (skill.isOverhit())
      {
        // Set the "over-hit enabled" flag on each of the possible targets
        for (L2Object target : targets)
        {
          L2Character player = (L2Character) target;
          if (player instanceof L2Attackable)
          {
            ((L2Attackable) player).overhitEnabled(true);
          }
        }
      }
     
      // Get the skill handler corresponding to the skill type (PDAM, MDAM, SWEEP...) started in gameserver
      handler = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
     
      // Launch the magic skill and calculate its effects
      if (handler != null)
      {
        handler.useSkill(this, skill, targets);
      }
      else
      {
        skill.useSkill(this, targets);
      }
View Full Code Here

        {
          continue;
        }
       
        L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLvl);
        ISkillHandler IHand = SkillHandler.getInstance().getSkillHandler(skill.getSkillType());
        if (IHand != null)
        {
          IHand.useSkill(this, skill, targets);
        }
        else
        {
          skill.useSkill(this, targets);
        }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.handler.ISkillHandler

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.