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

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


           
            List<L2MinionInstance> spawnedMinions = ((L2MinionInstance) target).getLeader().getSpawnedMinions();
            if (spawnedMinions != null && spawnedMinions.size() > 0)
            {
              Iterator<L2MinionInstance> itr = spawnedMinions.iterator();
              L2MinionInstance minion;
              while (itr.hasNext())
              {
                minion = itr.next();
                if (((L2MinionInstance) target).getLeader().getMostHated() == null)
                {
                  ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                  minion.clearAggroList();
                  minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                  minion.setWalking();
                }
                if (minion != null && !minion.isDead())
                {
                  ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                  minion.clearAggroList();
                  minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                  minion.addDamage(((L2MinionInstance) target).getLeader().getMostHated(), 100);
                }
              }
              itr = null;
              spawnedMinions = null;
              minion = null;
            }
          }
          else
          {
            ((L2Attackable) target).stopHating(this);
            List<L2MinionInstance> spawnedMinions = ((L2MonsterInstance) target).getSpawnedMinions();
            if (spawnedMinions != null && spawnedMinions.size() > 0)
            {
              Iterator<L2MinionInstance> itr = spawnedMinions.iterator();
              L2MinionInstance minion;
              while (itr.hasNext())
              {
                minion = itr.next();
                if (((L2Attackable) target).getMostHated() == null)
                {
                  ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                  minion.clearAggroList();
                  minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                  minion.setWalking();
                }
                if (minion != null && !minion.isDead())
                {
                  ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                  minion.clearAggroList();
                  minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                  minion.addDamage(((L2Attackable) target).getMostHated(), 100);
                }
              }
              itr = null;
              spawnedMinions = null;
              minion = null;
View Full Code Here


                  ((L2MinionInstance) player).getLeader().stopHating(this);
                  List<L2MinionInstance> spawnedMinions = ((L2MonsterInstance) player).getSpawnedMinions();
                  if (spawnedMinions != null && spawnedMinions.size() > 0)
                  {
                    Iterator<L2MinionInstance> itr = spawnedMinions.iterator();
                    L2MinionInstance minion;
                    while (itr.hasNext())
                    {
                      minion = itr.next();
                      if (((L2Attackable) player).getMostHated() == null)
                      {
                        ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                        minion.clearAggroList();
                        minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                        minion.setWalking();
                      }
                      if (minion != null && !minion.isDead())
                      {
                        ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                        minion.clearAggroList();
                        minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                        minion.addDamage(((L2Attackable) player).getMostHated(), 100);
                      }
                    }
                    itr = null;
                    spawnedMinions = null;
                    minion = null;
                  }
                }
                else
                {
                  ((L2Attackable) player).stopHating(this);
                  List<L2MinionInstance> spawnedMinions = ((L2MonsterInstance) player).getSpawnedMinions();
                  if (spawnedMinions != null && spawnedMinions.size() > 0)
                  {
                    Iterator<L2MinionInstance> itr = spawnedMinions.iterator();
                    L2MinionInstance minion;
                    while (itr.hasNext())
                    {
                      minion = itr.next();
                      if (((L2Attackable) player).getMostHated() == null)
                      {
                        ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                        minion.clearAggroList();
                        minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                        minion.setWalking();
                      }
                      if (minion != null && !minion.isDead())
                      {
                        ((L2AttackableAI) minion.getAI()).setGlobalAggro(-25);
                        minion.clearAggroList();
                        minion.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
                        minion.addDamage(((L2Attackable) player).getMostHated(), 100);
                      }
                    }
                    itr = null;
                    spawnedMinions = null;
                    minion = null;
View Full Code Here

  {
    // Get the template of the Minion to spawn
    L2NpcTemplate minionTemplate = NpcTable.getInstance().getTemplate(minionid);

    // Create and Init the Minion and generate its Identifier
    L2MinionInstance monster = new L2MinionInstance(IdFactory.getInstance().getNextId(), minionTemplate);

    // Set the Minion HP, MP and Heading
    monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
    monster.setHeading(master.getHeading());

    // Set the Minion leader to this RaidBoss
    monster.setLeader(master);

    // Init the position of the Minion and add it in the world as a visible object
    int spawnConstant;
    int randSpawnLim = 170;
    int randPlusMin = 1;
    spawnConstant = Rnd.nextInt(randSpawnLim);
    //randomize +/-
    randPlusMin = Rnd.nextInt(2);
    if(randPlusMin == 1)
    {
      spawnConstant *= -1;
    }

    int newX = master.getX() + spawnConstant;
    spawnConstant = Rnd.nextInt(randSpawnLim);
    //randomize +/-
    randPlusMin = Rnd.nextInt(2);

    if(randPlusMin == 1)
    {
      spawnConstant *= -1;
    }

    int newY = master.getY() + spawnConstant;

    monster.spawnMe(newX, newY, master.getZ());

    if(Config.DEBUG)
    {
      _log.fine("Spawned minion template " + minionTemplate.npcId + " with objid: " + monster.getObjectId() + " to boss " + master.getObjectId() + " ,at: " + monster.getX() + " x, " + monster.getY() + " y, " + monster.getZ() + " z");
    }
  }
View Full Code Here

TOP

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

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.