Package lineage2.gameserver.model.instances

Examples of lineage2.gameserver.model.instances.MerchantInstance.spawnMe()


      NpcTemplate template = NpcHolder.getInstance().getTemplate(ANNIHILATION_FURNACE);
      for (int i = 0; i < sr.af_spawns.length; i++)
      {
        NpcInstance npc = template.getNewInstance();
        npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
        npc.spawnMe(new Location(sr.af_spawns[i][0], sr.af_spawns[i][1], sr.af_spawns[i][2], sr.af_spawns[i][3]));
        npc.setNpcState(sr.activeBuff);
        sr.af_npcs[i] = npc;
      }
      chanceZoneActive(sr.buff_zone_pc[sr.activeBuff - 1], true);
      chanceZoneActive(sr.buff_zone_npc[sr.activeBuff - 1], true);
View Full Code Here


    {
      final NpcInstance mob = NpcHolder.getInstance().getTemplate(CANNIBALISTIC_STAKATO_CHIEF).getNewInstance();
      mob.setSpawnedLoc(actor.getLoc());
      mob.setReflection(actor.getReflection());
      mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp(), true);
      mob.spawnMe(mob.getSpawnedLoc());
      mob.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, caster.getPlayer(), Rnd.get(1, 100));
    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

    {
      final NpcInstance npc = NpcHolder.getInstance().getTemplate(mobId).getNewInstance();
      npc.setSpawnedLoc(actor.getSpawnedLoc());
      npc.setReflection(actor.getReflection());
      npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp(), true);
      npc.spawnMe(actor.getSpawnedLoc());
      if (killer != null)
      {
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, Rnd.get(1, 100));
      }
    }
View Full Code Here

      {
        final NpcInstance npc = NpcHolder.getInstance().getTemplate(RANDOM_SPAWN_MOBS[Rnd.get(RANDOM_SPAWN_MOBS.length)]).getNewInstance();
        npc.setSpawnedLoc(actor.getLoc());
        npc.setReflection(actor.getReflection());
        npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp(), true);
        npc.spawnMe(npc.getSpawnedLoc());
        npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, killer, Rnd.get(1, 100));
      }
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here

      return;
    }
    NpcInstance rewarder = new NpcInstance(IdFactory.getInstance().getNextId(), template);
    rewarder.setLoc(spawnLoc);
    rewarder.setHeading((int) (Math.atan2(spawnLoc.y - rewarded.getY(), spawnLoc.x - rewarded.getX()) * Creature.HEADINGS_IN_PI) + 32768);
    rewarder.spawnMe();
    Functions.npcSayCustomMessage(rewarder, "scripts.events.SavingSnowman.RewarderPhrase1");
    Location targetLoc = Location.findFrontPosition(rewarded, rewarded, 40, 50);
    rewarder.setSpawnedLoc(targetLoc);
    rewarder.broadcastPacket(new CharMoveToLocation(rewarder.getObjectId(), rewarder.getLoc(), targetLoc));
    executeTask("events.SavingSnowman.SavingSnowman", "reward", new Object[]
View Full Code Here

      if (template != null)
      {
        NpcInstance npc = NpcHolder.getInstance().getTemplate(npcId).getNewInstance();
        npc.setReflection(refId);
        npc.setSpawnedLoc(randomOffset > 50 ? Location.findPointToStay(loc, 50, randomOffset, npc.getGeoIndex()) : loc);
        npc.spawnMe(npc.getSpawnedLoc());
        return npc;
      }
    }
    catch (Exception e1)
    {
View Full Code Here

      if (fortress.getSupplyCount() > 0)
      {
        filename = "residence2/fortress/fortress_supply_officer016.htm";
        NpcInstance npc = NpcHolder.getInstance().getTemplate(SUPPLY_NPC[fortress.getSupplyCount() - 1]).getNewInstance();
        npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
        npc.spawnMe(new Location(getX() - 23, getY() + 41, getZ()));
      }
      else
      {
        filename = "residence2/fortress/fortress_supply_officer017.htm";
      }
View Full Code Here

      }
    }
    NpcInstance GilmoreInstance = _oldGilmoreRef.get();
    if (GilmoreInstance != null)
    {
      GilmoreInstance.spawnMe();
    }
  }
 
  /**
   * Method isActive.
View Full Code Here

        NpcInstance normalnpc = new NpcInstance(IdFactory.getInstance().getNextId(), npcTemplate);
        normalnpc.setCurrentHp(normalnpc.getMaxHp(), false);
        normalnpc.setCurrentMp(normalnpc.getMaxMp());
        normalnpc.setHeading(activeChar.getHeading());
        normalnpc.setReflection(activeChar.getReflection());
        normalnpc.spawnMe(activeChar.getLoc());
        ThreadPoolManager.getInstance().schedule(new GameObjectTasks.DeleteTask(normalnpc), _lifeTime);
        break;
      default:
        break;
    }
View Full Code Here

  private void chestSelect(NpcInstance actor, int npcId)
  {
    NpcInstance chest = NpcHolder.getInstance().getTemplate(npcId).getNewInstance();

    chest.spawnMe(actor.getLoc());
    ThreadPoolManager.getInstance().schedule(new ChestDespawnTask(chest), 120 * 1000);
  }

  class ChestDespawnTask extends RunnableImpl
  {
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.