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

Examples of com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance


      if (!result.isEmpty() && result.size() != 0)
      {
        Object[] characters = result.toArray();
        for (Object obj : characters)
        {
          L2PlayableInstance target = (L2PlayableInstance) (obj instanceof L2PcInstance ? obj : ((L2Summon) obj).getOwner());
         
          if(target.getActiveWeaponInstance() == null || (target instanceof L2PcInstance && ((L2PcInstance)target).isSilentMoving()) || (target instanceof L2Summon && ((L2Summon)target).getOwner().isSilentMoving())){
            continue;
          }
         
          if (target.getActiveWeaponInstance() != null && !npc.isInCombat() && npc.getTarget() == null)
          {
            npc.setTarget(target);
            npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(),  text[0]));
            switch (npc.getNpcId())
            {
View Full Code Here


                    }
                  }
                }
              }

              L2PlayableInstance summon = pl.getPet();
              if(summon != null && summon instanceof L2PetInstance)
              {
                reward2 = rewards.get(summon);

                if(reward2 != null) // Pets are only added if they have done damage
                {
                  if(Util.checkIfInRange(Config.ALT_PARTY_RANGE, this, summon, true))
                  {
                    partyDmg += reward2._dmg; // Add summon damages to party damages
                    rewardedMembers.add(summon);

                    if(summon.getLevel() > partyLvl)
                    {
                      partyLvl = summon.getLevel();
                    }
                  }

                  rewards.remove(summon); // Remove the summon from the L2Attackable rewards
                }
View Full Code Here

        {
          activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT)); // incorrect
          return false;
        }

        final L2PlayableInstance targetPlayer = (L2PlayableInstance) targetChar;

        final byte lvl = Byte.parseByte(val);
        int max_level = ExperienceData.getInstance().getMaxLevel();

        if(targetChar instanceof L2PcInstance && ((L2PcInstance) targetPlayer).isSubClassActive())
        {
          max_level = Config.MAX_SUBCLASS_LEVEL;
        }

        if(lvl >= 1 && lvl <= max_level)
        {
          final long pXp = targetPlayer.getStat().getExp();
          final long tXp = ExperienceData.getInstance().getExpForLevel(lvl);

          if(pXp > tXp)
          {
            targetPlayer.getStat().removeExpAndSp(pXp - tXp, 0);
          }
          else if(pXp < tXp)
          {
            targetPlayer.getStat().addExpAndSp(tXp - pXp, 0);
          }
        }
        else
        {
          activeChar.sendMessage("You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");
View Full Code Here

      Iterator<L2PlayableInstance> playables = regions.get(i).iterateAllPlayers();

      // Go through visible object of the selected region
      while(playables.hasNext())
      {
        L2PlayableInstance _object = playables.next();

        if(_object == null)
        {
          continue;
        }

        if(_object.equals(object))
        {
          continue; // skip our own character
        }

        if(!_object.isVisible())
        {
          continue; // skip dying objects
        }

        result.add(_object);
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance

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.