Package l2p.gameserver.model

Examples of l2p.gameserver.model.L2Object


    return true;
  }

  private void debug_stats(L2Player activeChar)
  {
    L2Object target_obj = activeChar.getTarget();
    if(!target_obj.isCharacter())
    {
      activeChar.sendPacket(Msg.INVALID_TARGET);
      return;
    }
    L2Character target = (L2Character) target_obj;
View Full Code Here


   *
   * @param activeChar: the gm char
   */
  private void adminGiveAllSkills(L2Player activeChar)
  {
    L2Object target = activeChar.getTarget();
    L2Player player;
    if(target != null && target.isPlayer() && (activeChar == target || activeChar.getPlayerAccess().CanEditCharAll))
    {
      player = (L2Player) target;
    }
    else
    {
View Full Code Here

    return Commands.values();
  }

  private void removeSkillsPage(L2Player activeChar)
  {
    L2Object target = activeChar.getTarget();
    L2Player player;
    if(target.isPlayer() && (activeChar == target || activeChar.getPlayerAccess().CanEditCharAll))
    {
      player = (L2Player) target;
    }
    else
    {
View Full Code Here

    activeChar.sendPacket(adminReply);
  }

  private void showSkillsPage(L2Player activeChar)
  {
    L2Object target = activeChar.getTarget();
    L2Player player;
    if(target != null && target.isPlayer() && (activeChar == target || activeChar.getPlayerAccess().CanEditCharAll))
    {
      player = (L2Player) target;
    }
    else
    {
View Full Code Here

            reloadQuestStates(p);
          }
        }
        else
        {
          L2Object t = activeChar.getTarget();
          if(t != null && t.isPlayer())
          {
            L2Player p = (L2Player) t;
            reloadQuestStates(p);
          }
          else
View Full Code Here

    Commands command = (Commands) comm;
    if(!activeChar.getPlayerAccess().CanPolymorph)
    {
      return false;
    }
    L2Object target = activeChar.getTarget();
    switch(command)
    {
      case admin_polyself:
        target = activeChar;
      case admin_polymorph:
      case admin_poly:
        if(target == null)
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        try
        {
          int id = Integer.parseInt(wordList[1]);
          int type = L2Object.POLY_NPC;
          if(wordList.length > 2 && (wordList[2].equalsIgnoreCase("item") || wordList[2].equalsIgnoreCase("i")))
          {
            type = L2Object.POLY_ITEM;
          }
          target.setPolyInfo(type, id);
        }
        catch(Exception e)
        {
          activeChar.sendMessage("USAGE: //poly id [type:npc|item]");
          return false;
        }
        break;
      case admin_unpolyself:
        target = activeChar;
      case admin_unpolymorph:
      case admin_unpoly:
        if(target == null)
        {
          activeChar.sendPacket(Msg.INVALID_TARGET);
          return false;
        }
        target.setPolyInfo(0, 0);
        break;
    }
    return true;
  }
View Full Code Here

        activeChar.sendMessage("Can't find player: " + wordList[wordListIndex]);
      }
      return player;
    }
    // цель задана текущим таргетом
    L2Object my_target = activeChar.getTarget();
    if(my_target != null && my_target.isPlayer())
    {
      return (L2Player) my_target;
    }
    // в качестве цели сам админ
    return activeChar;
View Full Code Here

      case admin_reset_skill_cool:
        final L2Player player;
        if(wordList.length == 1)
        {
          // Обработка по таргету
          L2Object target = activeChar.getTarget();
          if(target == null)
          {
            activeChar.sendMessage("Select character or specify player name.");
            break;
          }
          if(!target.isPlayer())
          {
            activeChar.sendPacket(Msg.INVALID_TARGET);
            break;
          }
          player = (L2Player) target;
View Full Code Here

        {
          activeChar.sendMessage("USAGE: //toobject objectId");
          return false;
        }
        Integer target = Integer.parseInt(wordList[1]);
        L2Object obj;
        if((obj = L2ObjectsStorage.findObject(target)) != null)
        {
          teleportToCharacter(activeChar, obj);
          return true;
        }
        activeChar.sendMessage("Object " + target + " not found");
        break;
    }
    if(!activeChar.getPlayerAccess().CanEditChar)
    {
      return false;
    }
    switch(command)
    {
      case admin_teleport_character:
        if(wordList.length < 2)
        {
          activeChar.sendMessage("USAGE: //teleport_character x y z");
          return false;
        }
        teleportCharacter(activeChar, Util.joinStrings(" ", wordList, 1));
        showTeleportCharWindow(activeChar);
        break;
      case admin_recall:
        if(wordList.length < 2)
        {
          activeChar.sendMessage("USAGE: //recall charName");
          return false;
        }
        String targetName = Util.joinStrings(" ", wordList, 1);
        L2Player recall_player = L2ObjectsStorage.getPlayer(targetName);
        if(recall_player != null)
        {
          teleportTo(activeChar, recall_player, activeChar.getLoc());
          return true;
        }
        int obj_id = Util.GetCharIDbyName(targetName);
        if(obj_id > 0)
        {
          teleportCharacter_offline(obj_id, activeChar.getLoc());
          activeChar.sendMessage(targetName + " is offline. Offline teleport used...");
        }
        else
        {
          activeChar.sendMessage("->" + targetName + "<- is incorrect.");
        }
        break;
      case admin_fix_gh_1:
        L2Territory gh_spawn_loc;
        // Зона крафта
        gh_spawn_loc = new L2Territory(10000001);
        gh_spawn_loc.add(45704, 186617, -3480, -3380);
        gh_spawn_loc.add(46086, 186419, -3488, -3388);
        gh_spawn_loc.add(46733, 187506, -3480, -3380);
        gh_spawn_loc.add(46294, 187709, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE && player.getReflection().getId() == -2)
          {
            int[] point = gh_spawn_loc.getRandomPoint();
            player.decayMe();
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона покупки
        gh_spawn_loc = new L2Territory(10000002);
        gh_spawn_loc.add(46091, 186412, -3488, -3388);
        gh_spawn_loc.add(47218, 185902, -3488, -3388);
        gh_spawn_loc.add(47761, 186929, -3480, -3380);
        gh_spawn_loc.add(46742, 187511, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY && player.getReflection().getId() == -2)
          {
            int[] point = gh_spawn_loc.getRandomPoint();
            player.decayMe();
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона продажи
        gh_spawn_loc = new L2Territory(10000003);
        gh_spawn_loc.add(47665, 186755, -3480, -3380);
        gh_spawn_loc.add(48167, 186488, -3480, -3380);
        gh_spawn_loc.add(48397, 186625, -3480, -3380);
        gh_spawn_loc.add(50156, 184674, -3488, -3388);
        gh_spawn_loc.add(49292, 183916, -3488, -3388);
        gh_spawn_loc.add(47758, 185654, -3488, -3388);
        gh_spawn_loc.add(47244, 185894, -3488, -3388);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if((player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE) && player.getReflection().getId() == -2)
          {
            int[] point = gh_spawn_loc.getRandomPoint();
            player.decayMe();
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        break;
      case admin_fix_gh_2:
        L2Territory gh_spawn_loc2;
        // Зона покупки
        gh_spawn_loc2 = new L2Territory(10000004);
        gh_spawn_loc2.add(46091, 186412, -3488, -3388);
        gh_spawn_loc2.add(47218, 185902, -3488, -3388);
        gh_spawn_loc2.add(47761, 186929, -3480, -3380);
        gh_spawn_loc2.add(46742, 187511, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY)
          {
            int[] point = gh_spawn_loc2.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона крафта
        gh_spawn_loc2 = new L2Territory(10000005);
        gh_spawn_loc2.add(45704, 186617, -3480, -3380);
        gh_spawn_loc2.add(46086, 186419, -3488, -3388);
        gh_spawn_loc2.add(46733, 187506, -3480, -3380);
        gh_spawn_loc2.add(46294, 187709, -3480, -3380);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE)
          {
            int[] point = gh_spawn_loc2.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона продажи
        gh_spawn_loc2 = new L2Territory(10000006);
        gh_spawn_loc2.add(47665, 186755, -3480, -3380);
        gh_spawn_loc2.add(48167, 186488, -3480, -3380);
        gh_spawn_loc2.add(48397, 186625, -3480, -3380);
        gh_spawn_loc2.add(50156, 184674, -3488, -3388);
        gh_spawn_loc2.add(49292, 183916, -3488, -3388);
        gh_spawn_loc2.add(47758, 185654, -3488, -3388);
        gh_spawn_loc2.add(47244, 185894, -3488, -3388);
        for(L2Player player : L2ObjectsStorage.getAllPlayers())
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE)
          {
            int[] point = gh_spawn_loc2.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        break;
      case admin_fix_gh_r:
        int radius = 500;
        if(wordList.length > 1)
        {
          radius = Integer.parseInt(wordList[1]);
        }
        L2Territory spawn_loc;
        // Зона покупки
        spawn_loc = new L2Territory(10000004);
        spawn_loc.add(46091, 186412, -3488, -3388);
        spawn_loc.add(47218, 185902, -3488, -3388);
        spawn_loc.add(47761, 186929, -3480, -3380);
        spawn_loc.add(46742, 187511, -3480, -3380);
        for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_BUY)
          {
            int[] point = spawn_loc.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона крафта
        spawn_loc = new L2Territory(10000005);
        spawn_loc.add(45704, 186617, -3480, -3380);
        spawn_loc.add(46086, 186419, -3488, -3388);
        spawn_loc.add(46733, 187506, -3480, -3380);
        spawn_loc.add(46294, 187709, -3480, -3380);
        for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_MANUFACTURE)
          {
            int[] point = spawn_loc.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        // Зона продажи
        spawn_loc = new L2Territory(10000006);
        spawn_loc.add(47665, 186755, -3480, -3380);
        spawn_loc.add(48167, 186488, -3480, -3380);
        spawn_loc.add(48397, 186625, -3480, -3380);
        spawn_loc.add(50156, 184674, -3488, -3388);
        spawn_loc.add(49292, 183916, -3488, -3388);
        spawn_loc.add(47758, 185654, -3488, -3388);
        spawn_loc.add(47244, 185894, -3488, -3388);
        for(L2Player player : L2World.getAroundPlayers(activeChar, radius, 200))
        {
          if(player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL || player.getPrivateStoreType() == L2Player.STORE_PRIVATE_SELL_PACKAGE)
          {
            int[] point = spawn_loc.getRandomPoint();
            player.decayMe();
            if(player.getReflection().getId() != -2)
            {
              player.setVar("backCoords", player.getLoc().toXYZString());
              player.setReflection(-2);
            }
            player.setXYZ(point[0], point[1], point[2]);
            player.spawnMe();
          }
        }
        break;
      case admin_setref:
      {
        if(wordList.length < 2)
        {
          activeChar.sendMessage("Usage: //setref <reflection>");
          return false;
        }
        int ref_id = Integer.parseInt(wordList[1]);
        if(ref_id != 0 && ReflectionTable.getInstance().get(ref_id) == null)
        {
          activeChar.sendMessage("Reflection <" + ref_id + "> not found.");
          return false;
        }
        L2Object target = activeChar;
        L2Object obj = activeChar.getTarget();
        if(obj != null)
        {
          target = obj;
        }
        target.setReflection(ref_id);
View Full Code Here

    activeChar.sendPacket(adminReply);
  }

  private void showTeleportCharWindow(L2Player activeChar)
  {
    L2Object target = activeChar.getTarget();
    L2Player player;
    if(target.isPlayer())
    {
      player = (L2Player) target;
    }
    else
    {
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.