Guest User

InteractorGateVIP

a guest
May 4th, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.33 KB | None | 0 0
  1. using Plus.HabboHotel.GameClients;
  2. using Plus.HabboHotel.Items.Wired;
  3. using Plus.HabboHotel.Rooms;
  4. using System;
  5. using System.Threading;
  6.  
  7.  
  8. namespace Plus.HabboHotel.Items.Interactor
  9. {
  10.     public class InteractorGateVP : IFurniInteractor
  11.     {
  12.         public void OnPlace(GameClient Session, Item Item)
  13.         {
  14.         }
  15.  
  16.         public void OnRemove(GameClient Session, Item Item)
  17.         {
  18.         }
  19.  
  20.         public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
  21.         {
  22.             int Modes = Item.GetBaseItem().Modes - 1;
  23.                 if (Session.GetHabbo().VIPRank != 1)
  24.                 {
  25.                     Session.SendWhisper("Tu n'es pas VIP ! :(");
  26.                     return;
  27.                 }
  28.                 else
  29.                 {
  30.                     if (!HasRights)
  31.                     {
  32.                         return;
  33.                     }
  34.                     else if (Modes <= 0)
  35.                     {
  36.                         Item.UpdateState(false, true);
  37.                     }
  38.  
  39.                     int CurrentMode = 0;
  40.                     int NewMode = 0;
  41.  
  42.                     if (!int.TryParse(Item.ExtraData, out CurrentMode))
  43.                     {
  44.                     }
  45.  
  46.                     if (CurrentMode <= 0)
  47.                     {
  48.                         NewMode = 1;
  49.                     }
  50.                     else if (CurrentMode >= Modes)
  51.                     {
  52.                         NewMode = 0;
  53.                     }
  54.                     else
  55.                     {
  56.                         NewMode = CurrentMode + 1;
  57.                     }
  58.  
  59.                     if (NewMode == 0)
  60.                     {
  61.                         if (!Item.GetRoom().GetGameMap().itemCanBePlacedHere(Item.GetX, Item.GetY))
  62.                         {
  63.                             return;
  64.                         }
  65.                     }
  66.                     Item.ExtraData = NewMode.ToString();
  67.                     Item.UpdateState();
  68.  
  69.                     Item.GetRoom().GetGameMap().updateMapForItem(Item);
  70.                     Item.GetRoom().GetWired().TriggerEvent(WiredBoxType.TriggerStateChanges, Session.GetHabbo(), Item);
  71.                 }
  72.             }
  73.  
  74.  
  75.         public void OnWiredTrigger(Item Item)
  76.         {
  77.            
  78.         }
  79.     }
  80.     }
Advertisement
Add Comment
Please, Sign In to add comment