Package com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance

Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.SkillDat


        if (getAI().getNextIntention() == null && (skill.getSkillType() == SkillType.PDAM && skill.getCastRange() < 400) || skill.getSkillType() == SkillType.BLOW || skill.getSkillType() == SkillType.DRAIN_SOUL || skill.getSkillType() == SkillType.SOW || skill.getSkillType() == SkillType.SPOIL)
        {
          if (this instanceof L2PcInstance)
          {
            L2PcInstance currPlayer = (L2PcInstance) this;
            SkillDat skilldat = currPlayer.getCurrentSkill();
            // Like L2OFF if the skill is BLOW the player doesn't auto attack
            // If on XML skill nextActionAttack = true the char auto attack
            // If CTRL is pressed the autoattack is aborted (like L2OFF)
            if (skilldat != null && !skilldat.isCtrlPressed() && skill.nextActionIsAttack() && getTarget() != null && getTarget() instanceof L2Character)
            {
              getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());
            }
          }
          else
          // case NPC
          {
            if (skill.nextActionIsAttack() && getTarget() != null && getTarget() instanceof L2Character)
            {
              getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());
            }
            else if ((skill.isOffensive()) && !(skill.getSkillType() == SkillType.UNLOCK) && !(skill.getSkillType() == SkillType.BLOW) && !(skill.getSkillType() == SkillType.DELUXE_KEY_UNLOCK) && skill.getId() != 345 && skill.getId() != 346)
            {
              getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());
              getAI().clientStartAutoAttack();
            }
          }
        }
        if (this instanceof L2PcInstance)
        {
          L2PcInstance currPlayer = (L2PcInstance) this;
          SkillDat skilldat = currPlayer.getCurrentSkill();
          if (skilldat != null && !skilldat.isCtrlPressed() && (skill.isOffensive()) && !(skill.getSkillType() == SkillType.UNLOCK) && !(skill.getSkillType() == SkillType.BLOW) && !(skill.getSkillType() == SkillType.DELUXE_KEY_UNLOCK) && skill.getId() != 345 && skill.getId() != 346)
          {
            if(!skill.isMagic() && skill.nextActionIsAttack())
              getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());
           
            getAI().clientStartAutoAttack();
          }
        }
        else
        // case npc
        {
          if ((skill.isOffensive()) && !(skill.getSkillType() == SkillType.UNLOCK) && !(skill.getSkillType() == SkillType.BLOW) && !(skill.getSkillType() == SkillType.DELUXE_KEY_UNLOCK) && skill.getId() != 345 && skill.getId() != 346)
          {
            if(!skill.isMagic())
              getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getTarget());
           
            getAI().clientStartAutoAttack();
          }
        }
      }
      else
      {
        getAI().clientStopAutoAttack();
      }
     
      // Notify the AI of the L2Character with EVT_FINISH_CASTING
      getAI().notifyEvent(CtrlEvent.EVT_FINISH_CASTING);
     
      notifyQuestEventSkillFinished(skill, getTarget());
     
      /*
       * If character is a player, then wipe their current cast state and check if a skill is queued. If there is a queued skill, launch it and wipe the queue.
       */
      if (this instanceof L2PcInstance)
      {
        L2PcInstance currPlayer = (L2PcInstance) this;
        SkillDat queuedSkill = currPlayer.getQueuedSkill();
       
        currPlayer.setCurrentSkill(null, false, false);
       
        if (queuedSkill != null)
        {
          currPlayer.setQueuedSkill(null, false, false);
         
          // DON'T USE : Recursive call to useMagic() method
          // currPlayer.useMagic(queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed());
          ThreadPoolManager.getInstance().executeTask(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
        }
       
        queuedSkill = null;
       
        final L2Weapon activeWeapon = getActiveWeaponItem();
View Full Code Here


    @Override
    public void run()
    {
      try
      {
        SkillDat skilldat = _activeChar.getCurrentSkill();
       
        if (!_activeChar.isCastingNow() || ( skilldat != null && skilldat.getSkillId() != 2046))
          return;
       
        _activeChar.sendPacket(new MagicSkillLaunched(_activeChar, 2046, 1));
       
        // check for summon item validity
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.SkillDat

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.