Ejemplo n.º 1
0
 public static bool freezeTarget(int i, Entity target)
 {
     if ((i != 34 && i != 36 && i != 40 && i != 19 && i != 23 && i != 27 && i != 31) || target.isFrozen())
     {
         return false;
     }
     int delay = getFreezeDelay(i);
     target.setFrozen(true);
     if (target is Player)
     {
         ((Player)target).getPackets().sendMessage("You have been frozen!");
         ((Player)target).getWalkingQueue().resetWalkingQueue();
     }
     Event unFreezeEvent = new Event(delay);
     unFreezeEvent.setAction(() =>
     {
         unFreezeEvent.stop();
         target.setFrozen(false);
     });
     Server.registerEvent(unFreezeEvent);
     return true;
 }