Package com.l2jfrozen.gameserver.model

Examples of com.l2jfrozen.gameserver.model.L2Effect


    }else if(sps){
      activeChar.removeSps();
    }
   
    // self Effect :]
    L2Effect effect = activeChar.getFirstEffect(skill.getId());
    if(effect != null && effect.isSelfEffect())
    {
      //Replace old effect with new one.
      effect.exit(false);
    }
    effect = null;
    skill.getEffectsSelf(activeChar);

    if(skill.isSuicideAttack())
View Full Code Here


      skill.getEffects(activeChar, target,false,false,false);
      target = null;
    }
    // self Effect :]

    L2Effect effect = activeChar.getFirstEffect(skill.getId());
    if(effect != null && effect.isSelfEffect())
    {
      //Replace old effect with new one.
      effect.exit(false);
    }
    skill.getEffectsSelf(activeChar);

    effect = null;
  }
View Full Code Here

      activeChar.removeSs();
     
    }
   
    // self Effect :]
    L2Effect effect = activeChar.getFirstEffect(skill.getId());
    if(effect != null && effect.isSelfEffect())
    {
      //Replace old effect with new one.
      effect.exit(false);
    }
    effect = null;
    skill.getEffectsSelf(activeChar);

  } //end void
View Full Code Here

  public boolean testImpl(Env env)
  {
    int neededBattle = _battleForces;
    if(neededBattle > 0)
    {
      L2Effect battleForce = env.player.getFirstEffect(BATTLE_FORCE);
      if(!(battleForce instanceof EffectBattleForce) || ((EffectBattleForce) battleForce).forces < neededBattle)
        return false;
    }
    int neededSpell = _spellForces;
    if(neededSpell > 0)
    {
      L2Effect spellForce = env.player.getFirstEffect(SPELL_FORCE);
      if(!(spellForce instanceof EffectSpellForce) || ((EffectSpellForce) spellForce).forces < neededSpell)
        return false;
    }
    return true;
  }
View Full Code Here

              {
                L2Effect[] effects = _actor.getAllEffects();

                for(int i = 0; effects != null && i < effects.length; i++)
                {
                  L2Effect effect = effects[i];

                  if(effect.getSkill() == sk)
                  {
                    useSkillSelf = false;
                    break;
                  }
                }

                effects = null;
              }
              if(useSkillSelf)
              {
                _actor.setTarget(_actor);
              }
            }

            L2Object OldTarget = _actor.getTarget();

            clientStopMoving(null);
            _accessor.doCast(sk);
            _actor.setTarget(OldTarget);

            OldTarget = null;

            return;
          }
        }
      }

      // Check if the L2SiegeGuardInstance is attacking, knows the target and can't run
      if(!_actor.isAttackingNow() && _actor.getRunSpeed() == 0 && _actor.getKnownList().knowsObject(attackTarget))
      {
        // Cancel the target
        _actor.getKnownList().removeKnownObject(attackTarget);
        _actor.setTarget(null);
        setIntention(AI_INTENTION_IDLE, null, null);
      }
      else
      {
        double dx = _actor.getX() - attackTarget.getX();
        double dy = _actor.getY() - attackTarget.getY();
        double dz = _actor.getZ() - attackTarget.getZ();
        double homeX = attackTarget.getX() - sGuard.getHomeX();
        double homeY = attackTarget.getY() - sGuard.getHomeY();

        // Check if the L2SiegeGuardInstance isn't too far from it's home location
        if(dx * dx + dy * dy > 10000 && homeX * homeX + homeY * homeY > 3240000 && _actor.getKnownList().knowsObject(attackTarget))
        {
          // Cancel the target
          _actor.getKnownList().removeKnownObject(attackTarget);
          _actor.setTarget(null);
          setIntention(AI_INTENTION_IDLE, null, null);
        }
        else
        // Move the actor to Pawn server side AND client side by sending Server->Client packet MoveToPawn (broadcast)
        {
          // Temporary hack for preventing guards jumping off towers,
          // before replacing this with effective geodata checks and AI modification
          if(dz * dz < 170 * 170)
          {
            moveToPawn(attackTarget, range);
          }
        }
      }

      return;

    }
    // Else, if the actor is muted and far from target, just "move to pawn"
    else if(_actor.isMuted() && dist_2 > (range + 20) * (range + 20))
    {
      // Temporary hack for preventing guards jumping off towers,
      // before replacing this with effective geodata checks and AI modification
      double dz = _actor.getZ() - attackTarget.getZ();

      // normally 130 if guard z coordinates correct
      if(dz * dz < 170 * 170)
      {
        moveToPawn(attackTarget, range);
      }

      return;
    }
    // Else, if this is close enough to attack
    else if(dist_2 <= (range + 20) * (range + 20))
    {
      // Force mobs to attak anybody if confused
      L2Character hated = null;

      if(_actor.isConfused())
      {
        hated = attackTarget;
      }
      else
      {
        hated = ((L2Attackable) _actor).getMostHated();
      }

      if(hated == null)
      {
        setIntention(AI_INTENTION_ACTIVE, null, null);
        return;
      }

      if(hated != attackTarget)
      {
        setAttackTarget(hated);
      }

      _attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getGameTicks();

      // check for close combat skills && heal/buff skills
      if(!_actor.isMuted() && Rnd.nextInt(100) <= 5)
      {
        for(L2Skill sk : skills)
        {
          int castRange = sk.getCastRange();

          if(castRange * castRange >= dist_2 && castRange <= 70 && !sk.isPassive() && _actor.getCurrentMp() >= _actor.getStat().getMpConsume(sk) && !_actor.isSkillDisabled(sk.getId()))
          {
            if(sk.getSkillType() == L2Skill.SkillType.BUFF || sk.getSkillType() == L2Skill.SkillType.HEAL)
            {
              boolean useSkillSelf = true;

              if(sk.getSkillType() == L2Skill.SkillType.HEAL && _actor.getCurrentHp() > (int) (_actor.getMaxHp() / 1.5))
              {
                useSkillSelf = false;
                break;
              }

              if(sk.getSkillType() == L2Skill.SkillType.BUFF)
              {
                L2Effect[] effects = _actor.getAllEffects();

                for(int i = 0; effects != null && i < effects.length; i++)
                {
                  L2Effect effect = effects[i];

                  if(effect.getSkill() == sk)
                  {
                    useSkillSelf = false;
                    break;
                  }
                }
View Full Code Here

    {
      activeChar.removeSps();
    }
   
    // effect self :]
    L2Effect effect = activeChar.getFirstEffect(getId());
    if (effect != null && effect.isSelfEffect())
    {
      // Replace old effect with new one.
      effect.exit(false);
    }
    // cast self effect if any
    getEffectsSelf(activeChar);
  }
View Full Code Here

          }
        }
        effect = null;
      }
      // self Effect :]
      L2Effect effect = activeChar.getFirstEffect(skill.getId());
      if (effect != null && effect.isSelfEffect())
      {
        // Replace old effect with new one.
        effect.exit(false);
      }
      skill.getEffectsSelf(activeChar);
      effect = null;
    }
   
View Full Code Here

      }
     
      // Self Effect
      if (skill.hasSelfEffects())
      {
        final L2Effect effect = activeChar.getFirstEffect(skill.getId());
        if (effect != null && effect.isSelfEffect())
          effect.exit(false);
        skill.getEffectsSelf(activeChar);
      }
    }
   
    if (skill.isMagic())
View Full Code Here

        }
        castle = null;
      }
    }

    L2Effect effect = player.getFirstEffect(skill.getId());
    if(effect != null && effect.isSelfEffect())
      effect.exit(false);
    skill.getEffectsSelf(player);

    player = null;
    clan = null;
  }
View Full Code Here

      damage = attacker.calcStat(Stats.CRITICAL_DAMAGE, (damage+power), target, skill);
      damage += attacker.calcStat(Stats.CRITICAL_DAMAGE_ADD, 0, target, skill) * 6.5;
      damage *= target.calcStat(Stats.CRIT_VULN, target.getTemplate().baseCritVuln, target, skill);
      */
     
      L2Effect vicious = attacker.getFirstEffect(312);
      if (vicious != null && damage > 1)
      {
        for (Func func : vicious.getStatFuncs())
        {
          Env env = new Env();
          env.player = attacker;
          env.target = target;
          env.skill = skill;
View Full Code Here

TOP

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

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.