Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Object


        {
          activeChar.sendMessage("This cursed weapon is already active.");
        }
        else
        {
          L2Object target = activeChar.getTarget();
          if(target != null && target.isPlayer() && !((L2Player) target).isInOlympiadMode())
          {
            L2Player player = (L2Player) target;
            L2ItemInstance item = ItemTable.getInstance().createItem(cw.getItemId());
            cwm.activate(player, player.getInventory().addItem(item));
            cwm.showUsageTime(player, cw);
          }
        }
        break;
      case admin_cw_drop:
        if(cw == null)
        {
          return false;
        }
        if(cw.isActive())
        {
          activeChar.sendMessage("This cursed weapon is already active.");
        }
        else
        {
          L2Object target = activeChar.getTarget();
          if(target != null && target.isPlayer() && !((L2Player) target).isInOlympiadMode())
          {
            L2Player player = (L2Player) target;
            cw.create(null, player, true);
          }
        }
View Full Code Here


      return false;
    }
    switch(command)
    {
      case admin_delete:
        L2Object obj = activeChar.getTarget();
        if(obj != null && obj.isNpc())
        {
          L2NpcInstance target = (L2NpcInstance) obj;
          target.deleteMe();
          L2Spawn spawn = target.getSpawn();
          if(spawn != null)
View Full Code Here

    }
    String out;
    switch(command)
    {
      case admin_dump_obj:
        L2Object target = activeChar.getTarget();
        if(target == null)
        {
          activeChar.sendMessage("No Target");
        }
        else
        {
          System.out.println(target.dump());
          activeChar.sendMessage("Object dumped to stdout");
        }
        break;
      case admin_dump_mobs_aggro_info:
        L2NpcTemplate[] npcs = NpcTable.getAll();
View Full Code Here

    return true;
  }

  private void setEnchant(L2Player activeChar, int value, byte element , int armorType)
  {
    L2Object target = activeChar.getTarget();
    if(target == null)
      target = activeChar;
    if(!target.isPlayer())
    {
      activeChar.sendMessage("Wrong target type.");
      return;
    }
View Full Code Here

        if(activeChar.getVehicle() == null)
        {
          break;
        }
        L2Player target = null;
        L2Object obj = activeChar.getTarget();
        if(obj != null && obj.isPlayer())
        {
          target = (L2Player) obj;
          L2AirShip airship = (L2AirShip) activeChar.getVehicle();
          target.setInVehiclePosition(new Location());
          target.setLoc(airship.getLoc());
View Full Code Here

        {
          System.out.println("AI Params not setted.");
        }
        break;
      case admin_setheading:
        L2Object obj = activeChar.getTarget();
        if(!obj.isNpc())
        {
          activeChar.sendMessage("Target is incorrect!");
          return false;
        }
        npc = (L2NpcInstance) obj;
View Full Code Here

    return Commands.values();
  }

  private void spawnMonster(L2Player activeChar, String monsterId, int respawnTime, int mobCount)
  {
    L2Object target = activeChar.getTarget();
    if(target == null)
    {
      target = activeChar;
    }
    Pattern pattern = Pattern.compile("[0-9]*");
    Matcher regexp = pattern.matcher(monsterId);
    L2NpcTemplate template;
    if(regexp.matches())
    {
      // First parameter was an ID number
      int monsterTemplate = Integer.parseInt(monsterId);
      template = NpcTable.getTemplate(monsterTemplate);
    }
    else
    {
      // First parameter wasn't just numbers so go by name not ID
      monsterId = monsterId.replace('_', ' ');
      template = NpcTable.getTemplateByName(monsterId);
    }
    if(template == null)
    {
      activeChar.sendMessage("Incorrect monster template.");
      return;
    }
    try
    {
      L2Spawn spawn = new L2Spawn(template);
      spawn.setLoc(target.getLoc());
      spawn.setLocation(0);
      spawn.setAmount(mobCount);
      spawn.setHeading(activeChar.getHeading());
      spawn.setRespawnDelay(respawnTime);
      spawn.setReflection(activeChar.getReflection().getId());
      if(RaidBossSpawnManager.getInstance().isDefined(spawn.getNpcId()))
      {
        activeChar.sendMessage("Raid Boss " + template.name + " already spawned.");
      }
      else
      {
        spawn.init();
        if(respawnTime == 0)
        {
          spawn.stopRespawn();
        }
        activeChar.sendMessage("Created " + template.name + " on " + target.getObjectId() + ".");
      }
    }
    catch(Exception e)
    {
      activeChar.sendMessage("Target is not ingame.");
View Full Code Here

    Commands command = (Commands) comm;
    if(!activeChar.getPlayerAccess().CanEditNPC)
    {
      return false;
    }
    L2Object target = activeChar.getTarget();
    L2Player player = activeChar;
    if(target != null && target.isPlayer())
    {
      player = (L2Player) target;
    }
    StringTokenizer st = new StringTokenizer(fullString, " ");
    fullString = st.nextToken();
View Full Code Here

    {
      case admin_clanhall:
        showClanHallSelectPage(activeChar);
        break;
      case admin_clanhallset:
        L2Object target = activeChar.getTarget();
        L2Player player = activeChar;
        if(target != null && target.isPlayer())
        {
          player = (L2Player) target;
        }
        if(player.getClan() == null)
        {
View Full Code Here

        {
          activeChar.sendMessage("USAGE: //callskill skillid skilllevel");
          return false;
        }
        L2Character target = null;
        L2Object obj = activeChar.getTarget();
        if(obj != null && obj.isCharacter())
        {
          target = (L2Character) obj;
        }
        if(target == null)
        {
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.L2Object

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.