Examples of useMagic()

  • com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()
    Check if the active L2Skill can be casted.

    Actions :

  • Check if the skill isn't toggle and is offensive
  • Check if the target is in the skill cast range
  • Check if the skill is Spoil type and if the target isn't already spoiled
  • Check if the caster owns enought consummed Item, enough HP and MP to cast the skill
  • Check if the caster isn't sitting
  • Check if all skills are enabled and this skill is enabled


  • Check if the caster own the weapon needed


  • Check if the skill is active


  • Check if all casting conditions are completed


  • Notify the AI with AI_INTENTION_CAST and target


  • @param skill The L2Skill to use @param forceUse used to force ATTACK on players @param dontMove used to prevent movement, if not in range
  • net.sf.l2j.gameserver.model.L2Summon.useMagic()
    Check if the active L2Skill can be casted.

    Actions :

  • Check if the target is correct
  • Check if the target is in the skill cast range
  • Check if the summon owns enough HP and MP to cast the skill
  • Check if all skills are enabled and this skill is enabled


  • Check if the skill is active


  • Notify the AI with AI_INTENTION_CAST and target


  • @param skill The L2Skill to use @param forceUse used to force ATTACK on players @param dontMove used to prevent movement, if not in range
  • net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.useMagic()
    Check if the active L2Skill can be casted.
    Actions :
  • Check if the skill isn't toggle and is offensive
  • Check if the target is in the skill cast range
  • Check if the skill is Spoil type and if the target isn't already spoiled
  • Check if the caster owns enought consummed Item, enough HP and MP to cast the skill
  • Check if the caster isn't sitting
  • Check if all skills are enabled and this skill is enabled

  • Check if the caster own the weapon needed

  • Check if the skill is active

  • Check if all casting conditions are completed

  • Notify the AI with AI_INTENTION_CAST and target

  • @param skill The L2Skill to use @param forceUse used to force ATTACK on players @param dontMove used to prevent movement, if not in range

    Examples of com.l2jfrozen.gameserver.model.L2Summon.useMagic()

            {
              force = true;
            }
          }
         
          activeSummon.useMagic(skill, force, _shiftPressed);
        }
      }

      /*
       * Cast a skill for active pet/servitor.
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

         
          //final L2Object target = activeChar.getTarget();
          //if(target!=null && target instanceof L2Character)
          //  activeChar.sendPacket(new ValidateLocation((L2Character)target));
         
          activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
        }
        else
        {
          activeChar.sendPacket(ActionFailed.STATIC_PACKET);
          _log.severe(" [ERROR] [WARNING]No skill found with id " + _magicId + " and level " + level + " !!");
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

          activeChar.setCurrentSkillWorldPosition(new Point3D(_x, _y, _z));

          // normally magicskilluse packet turns char client side but for these skills, it doesn't (even with correct target)
          activeChar.setHeading(Util.calculateHeadingFrom(activeChar.getX(), activeChar.getY(), _x , _y));
          activeChar.broadcastPacket(new ValidateLocation(activeChar));
          activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);
        }
        else
        {
          sendPacket(ActionFailed.STATIC_PACKET);
        }
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

        targets[0] = activeChar.getTarget();

        int itemId = item.getItemId();
        if(itemId == 6643) // Golden Spice
        {
          activeChar.useMagic(SkillTable.getInstance().getInfo(2188, 1), false, false);
        }
        else if(itemId == 6644) // Crystal Spice
        {
          activeChar.useMagic(SkillTable.getInstance().getInfo(2189, 1), false, false);
        }
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

        {
          activeChar.useMagic(SkillTable.getInstance().getInfo(2188, 1), false, false);
        }
        else if(itemId == 6644) // Crystal Spice
        {
          activeChar.useMagic(SkillTable.getInstance().getInfo(2189, 1), false, false);
        }

        activeChar = null;
      }
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

            break;
          case 1: // pet summons
            activeChar.setTarget(activeChar);
            // Skill 2046 used only for animation
            L2Skill skill = SkillTable.getInstance().getInfo(2046, 1);
            activeChar.useMagic(skill, true, true);
            activeChar.sendPacket(new SystemMessage(SystemMessageId.SUMMON_A_PET));
            ThreadPoolManager.getInstance().scheduleGeneral(new PetSummonFinalizer(activeChar, npcTemplate, item), 4800);
           
            break;
          case 2: // wyvern
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

            activeChar.sendMessage("The chest Is empty.");
            activeChar.sendPacket(ActionFailed.STATIC_PACKET);

            return;
          }
          activeChar.useMagic(skill, false, false);
          chest = null;
        }

        activeChar = null;
        skill = null;
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

        targets[0] = activeChar.getTarget();

        int itemId = item.getItemId();
        if(itemId == 6391)
        {
          activeChar.useMagic(SkillTable.getInstance().getInfo(9999, 1), false, false);
        }

        activeChar = null;
      }
    View Full Code Here

    Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance.useMagic()

        int crystalId = item.getItemId();

        // Soul Crystal Casting section
        L2Skill skill = SkillTable.getInstance().getInfo(2096, 1);
        activeChar.useMagic(skill, false, true);
        // End Soul Crystal Casting section

        // Continue execution later
        CrystalFinalizer cf = new CrystalFinalizer(activeChar, target, crystalId);
        ThreadPoolManager.getInstance().scheduleEffect(cf, skill.getHitTime());
    View Full Code Here

    Examples of net.sf.l2j.gameserver.model.L2Summon.useMagic()

              _log.warning("Skill " + skillId + " missing from npcskills.sql for a summon id " + activeSummon.getNpcId());
            return;
          }

          activeSummon.setTarget(target);
          activeSummon.useMagic(skill, _ctrlPressed, _shiftPressed);
        }
      }

      /*
       * Cast a skill for active pet/servitor.
    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.