示例#1
0
 public static void ItemonObject(Client c, int objectID, int objectX, int objectY, int itemId) {
   if (!c.getItems().playerHasItem(itemId, 1)) return;
   switch (objectID) {
     case 2783:
       c.getSmithingInt().showSmithInterface(itemId);
       break;
     case 7965:
     case 8389:
       c.getFarming().checkItemOnObject(itemId);
       break;
     case 2728:
     case 12269:
       c.getCooking().itemOnObject(itemId);
       break;
     case 15621:
       if (c.absX == 2857 && c.absY == 3537 || c.absX == 2851 && c.absY == 3537) {
         c.getWarriorsGuild().handleArmor(c, itemId, objectX, objectY);
       }
       break;
     case 409:
       if (c.getPrayer().isBone(itemId)) c.getPrayer().bonesOnAltar(itemId);
       break;
     default:
       if (c.playerRights == 3)
         Misc.println("Player At Object id: " + objectID + " with Item id: " + itemId);
       break;
   }
 }
示例#2
0
  public static void ItemonObject(Client c, int objectID, int objectX, int objectY, int itemId) {
    if (!c.getItems().playerHasItem(itemId, 1)) return;
    switch (objectID) {
      case 15621:
        Server.getWarriorsGuild().handleArmor(c, itemId, objectX, objectY);
        break;
      case 2783:
        c.getSmithingInt().showSmithInterface(itemId);
        break;
      case 8151:
      case 8389:
        c.getFarming().checkItemOnObject(itemId);
        break;
      case 2644:
        c.getFlaxStringer().itemOnObject(itemId);
        break;

      case 409:
        if (c.getPrayer().IsABone(itemId)) c.getPrayer().bonesOnAltar(itemId);
        break;
      default:
        if (c.playerRights == 3)
          Misc.println("Player At Object id: " + objectID + " with Item id: " + itemId);
        break;
    }
  }
示例#3
0
 /** Update objects when entering a new region or logging in */
 public void updateObjects(Client c) {
   for (Objects o : globalObjects) {
     if (c != null) {
       if (c.heightLevel == o.getObjectHeight() && o.objectTicks == 0) {
         if (c.distanceToPoint(o.getObjectX(), o.getObjectY()) <= 60) {
           c.getPA()
               .object(
                   o.getObjectId(),
                   o.getObjectX(),
                   o.getObjectY(),
                   o.getObjectFace(),
                   o.getObjectType());
         }
       }
     }
   }
   if (10 + Misc.random(10) == 15 && !Flax.flaxRemoved.isEmpty()) {
     int[] flax =
         Flax.flaxRemoved.get(Flax.flaxRemoved.indexOf(Flax.flaxRemoved.iterator().next()));
     // Server.objectHandler.createAnObject(2646, flax[0], flax[1]);
     // c.getPA().checkObjectSpawn(2646, flax[0], flax[1]);
     Flax.flaxRemoved.remove(Flax.flaxRemoved.indexOf(flax));
   }
   if (c.distanceToPoint(2813, 3463) <= 60) {
     c.getFarming().updateHerbPatch();
   }
   if (c.distanceToPoint(2961, 3389) <= 60) {
     c.getPA().object(6552, 2961, 3389, -1, 10);
   }
 }