Examples of AutoSpawnInstance


Examples of com.l2jfrozen.gameserver.model.spawn.AutoSpawn.AutoSpawnInstance

    */

    int npcId = 0;
    int teleportIndex = -1;

    AutoSpawnInstance blackSpawnInst = AutoSpawn.getInstance().getAutoSpawnInstance(SevenSigns.MAMMON_BLACKSMITH_ID, false);
    AutoSpawnInstance merchSpawnInst = AutoSpawn.getInstance().getAutoSpawnInstance(SevenSigns.MAMMON_MERCHANT_ID, false);

    if(command.startsWith("admin_mammon_find"))
    {
      try
      {
        if(command.length() > 17)
        {
          teleportIndex = Integer.parseInt(command.substring(18));
        }
      }
      catch(Exception NumberFormatException)
      {
        if(Config.ENABLE_ALL_EXCEPTIONS)
          NumberFormatException.printStackTrace();
       
        activeChar.sendMessage("Usage: //mammon_find [teleportIndex] (where 1 = Blacksmith, 2 = Merchant)");
      }

      if(!_isSealValidation)
      {
        activeChar.sendMessage("The competition period is currently in effect.");
        return true;
      }

      if(blackSpawnInst != null)
      {
        L2NpcInstance[] blackInst = blackSpawnInst.getNPCInstanceList();
        if(blackInst.length > 0)
        {
          int x1 = blackInst[0].getX(), y1 = blackInst[0].getY(), z1 = blackInst[0].getZ();
          activeChar.sendMessage("Blacksmith of Mammon: " + x1 + " " + y1 + " " + z1);

          if(teleportIndex == 1)
          {
            activeChar.teleToLocation(x1, y1, z1, true);
          }
        }

        blackInst = null;
      }
      else
      {
        activeChar.sendMessage("Blacksmith of Mammon isn't registered for spawn.");
      }

      if(merchSpawnInst != null)
      {
        L2NpcInstance[] merchInst = merchSpawnInst.getNPCInstanceList();

        if(merchInst.length > 0)
        {
          int x2 = merchInst[0].getX(), y2 = merchInst[0].getY(), z2 = merchInst[0].getZ();

View Full Code Here

Examples of l2p.gameserver.model.AutoSpawnHandler.AutoSpawnInstance

    }
  }

  public void spawnSevenSignsNPC()
  {
    AutoSpawnInstance _merchantSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(MAMMON_MERCHANT_ID, false);
    AutoSpawnInstance _blacksmithSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(MAMMON_BLACKSMITH_ID, false);
    Map<Integer, AutoSpawnInstance> _marketeerSpawns = AutoSpawnHandler.getInstance().getAllAutoSpawnInstance(MAMMON_MARKETEER_ID);
    AutoSpawnInstance _spiritInSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(SPIRIT_IN_ID, false);
    AutoSpawnInstance _spiritOutSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(SPIRIT_OUT_ID, false);
    AutoSpawnInstance _lilithSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(LILITH_NPC_ID, false);
    AutoSpawnInstance _anakimSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(ANAKIM_NPC_ID, false);
    AutoSpawnInstance _crestOfDawnSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(CREST_OF_DAWN_ID, false);
    AutoSpawnInstance _crestOfDuskSpawn = AutoSpawnHandler.getInstance().getAutoSpawnInstance(CREST_OF_DUSK_ID, false);
    Map<Integer, AutoSpawnInstance> _oratorSpawns = AutoSpawnHandler.getInstance().getAllAutoSpawnInstance(ORATOR_NPC_ID);
    Map<Integer, AutoSpawnInstance> _preacherSpawns = AutoSpawnHandler.getInstance().getAllAutoSpawnInstance(PREACHER_NPC_ID);
    if(isSealValidationPeriod() || isCompResultsPeriod())
    {
      for(AutoSpawnInstance spawnInst : _marketeerSpawns.values())
      {
        AutoSpawnHandler.getInstance().setSpawnActive(spawnInst, true);
      }
      if(getSealOwner(SEAL_GNOSIS) == getCabalHighestScore() && getSealOwner(SEAL_GNOSIS) != CABAL_NULL)
      {
        if(!Config.ANNOUNCE_MAMMON_SPAWN)
        {
          _blacksmithSpawn.setBroadcast(false);
        }
        if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_blacksmithSpawn.getObjectId(), true).isSpawnActive())
        {
          AutoSpawnHandler.getInstance().setSpawnActive(_blacksmithSpawn, true);
        }
        for(AutoSpawnInstance spawnInst : _oratorSpawns.values())
        {
          if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(spawnInst.getObjectId(), true).isSpawnActive())
          {
            AutoSpawnHandler.getInstance().setSpawnActive(spawnInst, true);
          }
        }
        for(AutoSpawnInstance spawnInst : _preacherSpawns.values())
        {
          if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(spawnInst.getObjectId(), true).isSpawnActive())
          {
            AutoSpawnHandler.getInstance().setSpawnActive(spawnInst, true);
          }
        }
        if(AutoChatHandler.getInstance().getAutoChatInstance(PREACHER_NPC_ID, false) != null && AutoChatHandler.getInstance().getAutoChatInstance(ORATOR_NPC_ID, false) != null && !AutoChatHandler.getInstance().getAutoChatInstance(PREACHER_NPC_ID, false).isActive() && !AutoChatHandler.getInstance().getAutoChatInstance(ORATOR_NPC_ID, false).isActive())
        {
          AutoChatHandler.getInstance().setAutoChatActive(true);
        }
      }
      else
      {
        AutoSpawnHandler.getInstance().setSpawnActive(_blacksmithSpawn, false);
        for(AutoSpawnInstance spawnInst : _oratorSpawns.values())
        {
          AutoSpawnHandler.getInstance().setSpawnActive(spawnInst, false);
        }
        for(AutoSpawnInstance spawnInst : _preacherSpawns.values())
        {
          AutoSpawnHandler.getInstance().setSpawnActive(spawnInst, false);
        }
        AutoChatHandler.getInstance().setAutoChatActive(false);
      }
      if(getSealOwner(SEAL_AVARICE) == getCabalHighestScore() && getSealOwner(SEAL_AVARICE) != CABAL_NULL)
      {
        if(!Config.ANNOUNCE_MAMMON_SPAWN)
        {
          _merchantSpawn.setBroadcast(false);
        }
        if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_merchantSpawn.getObjectId(), true).isSpawnActive())
        {
          AutoSpawnHandler.getInstance().setSpawnActive(_merchantSpawn, true);
        }
        if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_spiritInSpawn.getObjectId(), true).isSpawnActive())
        {
          AutoSpawnHandler.getInstance().setSpawnActive(_spiritInSpawn, true);
        }
        if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_spiritOutSpawn.getObjectId(), true).isSpawnActive())
        {
          AutoSpawnHandler.getInstance().setSpawnActive(_spiritOutSpawn, true);
        }
        switch(getCabalHighestScore())
        {
          case CABAL_DAWN:
            if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_lilithSpawn.getObjectId(), true).isSpawnActive())
            {
              AutoSpawnHandler.getInstance().setSpawnActive(_lilithSpawn, true);
            }
            AutoSpawnHandler.getInstance().setSpawnActive(_anakimSpawn, false);
            if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_crestOfDawnSpawn.getObjectId(), true).isSpawnActive())
            {
              AutoSpawnHandler.getInstance().setSpawnActive(_crestOfDawnSpawn, true);
            }
            AutoSpawnHandler.getInstance().setSpawnActive(_crestOfDuskSpawn, false);
            break;
          case CABAL_DUSK:
            if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_anakimSpawn.getObjectId(), true).isSpawnActive())
            {
              AutoSpawnHandler.getInstance().setSpawnActive(_anakimSpawn, true);
            }
            AutoSpawnHandler.getInstance().setSpawnActive(_lilithSpawn, false);
            if(!AutoSpawnHandler.getInstance().getAutoSpawnInstance(_crestOfDuskSpawn.getObjectId(), true).isSpawnActive())
            {
              AutoSpawnHandler.getInstance().setSpawnActive(_crestOfDuskSpawn, true);
            }
            AutoSpawnHandler.getInstance().setSpawnActive(_crestOfDawnSpawn, false);
            break;
View Full Code Here

Examples of net.sf.l2j.gameserver.model.AutoSpawnHandler.AutoSpawnInstance

      if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
        return false;

    int npcId = 0;
    int teleportIndex = -1;
    AutoSpawnInstance blackSpawnInst = AutoSpawnHandler.getInstance().getAutoSpawnInstance(
        SevenSigns.MAMMON_BLACKSMITH_ID,
        false);
    AutoSpawnInstance merchSpawnInst = AutoSpawnHandler.getInstance().getAutoSpawnInstance(
        SevenSigns.MAMMON_MERCHANT_ID,
        false);

    if (command.startsWith("admin_mammon_find"))
    {
      try
      {
        if (command.length() > 17) teleportIndex = Integer.parseInt(command.substring(18));
      }
      catch (Exception NumberFormatException)
      {
        activeChar.sendMessage("Usage: //mammon_find [teleportIndex] (where 1 = Blacksmith, 2 = Merchant)");
      }

      if (!_isSealValidation)
      {
        activeChar.sendMessage("The competition period is currently in effect.");
        return true;
      }
      if (blackSpawnInst!=null)
      {
        L2NpcInstance[] blackInst = blackSpawnInst.getNPCInstanceList();
        if (blackInst.length > 0)
        {
          int x1=blackInst[0].getX(),y1=blackInst[0].getY(),z1=blackInst[0].getZ();
          activeChar.sendMessage("Blacksmith of Mammon: "+x1+" "+y1+" "+z1);
          if (teleportIndex == 1)
            activeChar.teleToLocation(x1, y1, z1, true);
        }
      }
      else
        activeChar.sendMessage("Blacksmith of Mammon isn't registered for spawn.");
      if (merchSpawnInst!=null)
      {
        L2NpcInstance[] merchInst = merchSpawnInst.getNPCInstanceList();
        if (merchInst.length > 0)
        {
          int x2=merchInst[0].getX(),y2=merchInst[0].getY(),z2=merchInst[0].getZ();
          activeChar.sendMessage("Merchant of Mammon: "+x2+" "+y2+" "+z2);
          if (teleportIndex == 2)
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.