Package net.sf.l2j.gameserver.model.actor.instance

Examples of net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance


        if (attacker != null) addDamage(attacker, (int)damage);

        // If this L2Attackable is a L2MonsterInstance and it has spawned minions, call its minions to battle
        if (this instanceof L2MonsterInstance)
        {
            L2MonsterInstance master = (L2MonsterInstance) this;
            if (this instanceof L2MinionInstance)
            {
                master = ((L2MinionInstance)this).getLeader();
                if (!master.isInCombat()&&!master.isDead()) master.addDamage(attacker, 1);
            }
            if (master.hasMinions())
                master.callMinionsToAssist(attacker);
        }

        // Reduce the current HP of the L2Attackable and launch the doDie Task if necessary
        super.reduceCurrentHp(damage, attacker, awake);
    }
View Full Code Here


            }
        }
        else if ((Config.ALLOW_GUARDS) && (object instanceof L2MonsterInstance))
        {
            // Check if the object added is an aggressive L2MonsterInstance
            L2MonsterInstance mob = (L2MonsterInstance) object;

            if (mob.isAggressive() )
            {
                if (Config.DEBUG) _log.fine(getActiveChar().getObjectId()+": Aggressive mob "+mob.getObjectId()+" entered scan range");

                // Set the L2GuardInstance Intention to AI_INTENTION_ACTIVE
                if (getActiveChar().getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE)
                    getActiveChar().getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, null);
            }
View Full Code Here

      int mid2 = 0;
      StringTokenizer st = new StringTokenizer(params);
      mid1 = Integer.parseInt(st.nextToken());
      mid2 = Integer.parseInt(st.nextToken());

      npc1 = new L2MonsterInstance(IdFactory.getInstance().getNextId(),
          NpcTable.getInstance().getTemplate(mid1));
      npc2 = new L2MonsterInstance(IdFactory.getInstance().getNextId(),
          NpcTable.getInstance().getTemplate(mid2));
    }

    int miss1 = 0;
    int miss2 = 0;
View Full Code Here

    for (int index = 0; index < targetList.length; index++)
    {
      if (!(targetList[index] instanceof L2MonsterInstance))
        continue;

      L2MonsterInstance target = (L2MonsterInstance) targetList[index];

      if (target.isSpoil()) {
        activeChar.sendPacket(new SystemMessage(SystemMessageId.ALREDAY_SPOILED));
        continue;
      }

      // SPOIL SYSTEM by Lbaldi
      boolean spoil = false;
      if ( target.isDead() == false )
      {
        spoil = Formulas.getInstance().calcMagicSuccess(activeChar, (L2Character)targetList[index], skill);
       
        if (spoil)
        {
          target.setSpoil(true);
          target.setIsSpoiledBy(activeChar.getObjectId());
          activeChar.sendPacket(new SystemMessage(SystemMessageId.SPOIL_SUCCESS));
        }
        else
        {
          SystemMessage sm = new SystemMessage(SystemMessageId.S1_WAS_UNAFFECTED_BY_S2);
          sm.addString(target.getName());
          sm.addSkillName(skill.getDisplayId());
          activeChar.sendPacket(sm);
        }       
        target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, activeChar);
      }
    }
    }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance

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.