Advertisement
Guest User

Untitled

a guest
May 14th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 381.03 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Threading;
  9. using Phoenix.Core;
  10. using Phoenix.HabboHotel.Misc;
  11. using Phoenix.HabboHotel.GameClients;
  12. using Phoenix.HabboHotel.Rooms;
  13. using Phoenix.HabboHotel.Items;
  14. using Phoenix.HabboHotel.Pets;
  15. using Phoenix.HabboHotel.Pathfinding;
  16.  
  17.  
  18. using Phoenix.Util;
  19. using Phoenix.Messages;
  20. using Phoenix.HabboHotel.RoomBots;
  21. using Phoenix.HabboHotel.Navigators;
  22. using Phoenix.Storage;
  23. using System.Threading.Tasks;
  24. namespace Phoenix.HabboHotel.Rooms
  25. {
  26.     internal sealed class Room
  27.     {
  28.         public Dictionary<RoomUser, int> OldValues;
  29.         /* Jukebox fix */
  30.         internal int JukeBoxSongId = 3;
  31.         /* End */
  32.         public delegate void Delegate2(int Team);
  33.         private uint uint_0;
  34.         public uint Achievement;
  35.         public string Name;
  36.         public string Description;
  37.         public string Type;
  38.         public string Owner;
  39.         public string Password;
  40.         public int Category;
  41.         public int State;
  42.         public int UsersNow;
  43.         public int UsersMax;
  44.         public string ModelName;
  45.         public string CCTs;
  46.         public int Score;
  47.         public List<string> Tags;
  48.         public bool AllowPet;
  49.         public bool AllowPetsEating;
  50.         public bool AllowWalkthrough;
  51.         public bool Hidewall;
  52.         public int Wallthick;
  53.         public int Floorthick;
  54.         internal bool bool_4;
  55.         internal bool bool_5;
  56.         private Timer timer_0;
  57.         private bool bool_6;
  58.         private bool bool_7;
  59.         internal RoomUser[] RoomUser_0;
  60.         public int int_7 = 0;
  61.         private int int_8;
  62.         public RoomIcon class29_0;
  63.         public List<uint> list_1;
  64.         internal bool bool_8;
  65.         private Dictionary<uint, double> dictionary_0;
  66.         public RoomEvent Event;
  67.         public string Wallpaper;
  68.         public string Floor;
  69.         public string Landscape;
  70.         private Hashtable hashtable_0;
  71.         private Hashtable hashtable_1;
  72.         private Hashtable hashtable_2;
  73.         private Hashtable hashtable_3;
  74.         private Hashtable hashtable_4;
  75.         public MoodlightData class67_0;
  76.         public List<Trade> list_2;
  77.         public bool bool_9;
  78.         public List<RoomItem> list_3;
  79.         public List<uint> list_4;
  80.         public List<RoomItem> list_5;
  81.         public List<RoomItem> list_6;
  82.         public List<RoomItem> list_7;
  83.         public List<RoomItem> list_8;
  84.         public List<RoomItem> list_9;
  85.         public List<RoomItem> list_10;
  86.         public List<RoomItem> list_11;
  87.         public List<RoomItem> list_12;
  88.         public List<RoomItem> list_13;
  89.         public List<RoomItem> Footballs;
  90.         public List<RoomItem> Goals;
  91.         public List<RoomItem> ScoreBoards;
  92.         public int int_9;
  93.         public int int_10;
  94.         public int int_11;
  95.         public int int_12;
  96.         public int int_13;
  97.         private bool bool_10;
  98.         public List<RoomItem> list_14;
  99.         public List<RoomItem> list_15;
  100.         public List<RoomItem> list_16;
  101.         public List<GroupsManager> list_17;
  102.         public double[,] double_0;
  103.         private byte[,] byte_0;
  104.         public ThreeDCoord[,] gstruct1_0;
  105.         private byte[,] byte_1;
  106.         private byte[,] byte_2;
  107.         private double[,] double_1;
  108.         private double[,] double_2;
  109.         private RoomModel class28_0;
  110.         private bool bool_11;
  111.         private int int_14;
  112.         private int int_15;
  113.         private RoomData class27_0;
  114.         private int int_16;
  115.         private bool bool_12;
  116.         private bool[,] HeightOverride;
  117.         internal Task FootballCycleTask;
  118.         public bool Boolean_0
  119.         {
  120.             get
  121.             {
  122.                 return this.Event != null;
  123.             }
  124.         }
  125.         public RoomIcon myIcon
  126.         {
  127.             get
  128.             {
  129.                 return this.class29_0;
  130.             }
  131.             set
  132.             {
  133.                 this.class29_0 = value;
  134.             }
  135.         }
  136.         internal bool Boolean_1
  137.         {
  138.             get
  139.             {
  140.                 return this.bool_11;
  141.             }
  142.             set
  143.             {
  144.                 this.bool_11 = value;
  145.             }
  146.         }
  147.         public int Int32_0
  148.         {
  149.             get
  150.             {
  151.                 int num = 0;
  152.                 int result;
  153.                 if (this.RoomUser_0 == null)
  154.                 {
  155.                     result = 0;
  156.                 }
  157.                 else
  158.                 {
  159.                     for (int i = 0; i < this.RoomUser_0.Length; i++)
  160.                     {
  161.                         if (this.RoomUser_0[i] != null && !this.RoomUser_0[i].Boolean_4 && !this.RoomUser_0[i].isPet)
  162.                         {
  163.                             num++;
  164.                         }
  165.                     }
  166.                     result = num;
  167.                 }
  168.                 return result;
  169.             }
  170.         }
  171.         public int Int32_1
  172.         {
  173.             get
  174.             {
  175.                 return this.Tags.Count;
  176.             }
  177.         }
  178.         public RoomModel Class28_0
  179.         {
  180.             get
  181.             {
  182.                 return this.class28_0;
  183.             }
  184.         }
  185.         public uint Id
  186.         {
  187.             get
  188.             {
  189.                 return this.uint_0;
  190.             }
  191.         }
  192.         public Hashtable Hashtable_0
  193.         {
  194.             get
  195.             {
  196.                 Hashtable result;
  197.                 if (this.hashtable_0 != null)
  198.                 {
  199.                     result = (this.hashtable_0.Clone() as Hashtable);
  200.                 }
  201.                 else
  202.                 {
  203.                     result = null;
  204.                 }
  205.                 return result;
  206.             }
  207.         }
  208.         public Hashtable Hashtable_1
  209.         {
  210.             get
  211.             {
  212.                 return this.hashtable_4.Clone() as Hashtable;
  213.             }
  214.         }
  215.         public bool Boolean_2
  216.         {
  217.             get
  218.             {
  219.                 if (this.Boolean_3)
  220.                 {
  221.                     return false;
  222.                 }
  223.                 else
  224.                 {
  225.                     FlatCat @class = Phoenix.GetGame().GetNavigator().method_2(this.Category);
  226.                     return (@class != null && @class.CanTrade);
  227.                 }
  228.             }
  229.         }
  230.         public bool Boolean_3
  231.         {
  232.             get
  233.             {
  234.                 return this.Type == "public";
  235.             }
  236.         }
  237.         public int Int32_2
  238.         {
  239.             get
  240.             {
  241.                 int num = 0;
  242.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  243.                 {
  244.                     RoomUser @class = this.RoomUser_0[i];
  245.                     if (@class != null && @class.isPet)
  246.                     {
  247.                         num++;
  248.                     }
  249.                 }
  250.                 return num;
  251.             }
  252.         }
  253.         internal RoomData Class27_0
  254.         {
  255.             get
  256.             {
  257.                 this.class27_0.Fill(this);
  258.                 return this.class27_0;
  259.             }
  260.         }
  261.         public byte[,] Byte_0
  262.         {
  263.             get
  264.             {
  265.                 return this.byte_0;
  266.             }
  267.         }
  268.         internal bool Boolean_4
  269.         {
  270.             get
  271.             {
  272.                 return this.method_2().Count > 0;
  273.             }
  274.         }
  275.         public Room(uint uint_2, string string_10, string string_11, string string_12, string string_13, int int_17, int int_18, int int_19, string string_14, string string_15, int int_20, List<string> list_18, bool bool_13, bool bool_14, bool bool_15, bool bool_16, RoomIcon class29_1, string string_16, string string_17, string string_18, string string_19, RoomData class27_1, bool bool_17, int int_21, int int_22, uint uint_3)
  276.         {
  277.             if (!(LicenseTools.String_0 == ""))
  278.             {
  279.                 this.bool_12 = false;
  280.                 this.uint_0 = uint_2;
  281.                 this.Name = string_10;
  282.                 this.Description = string_11;
  283.                 this.Owner = string_13;
  284.                 this.Category = int_17;
  285.                 this.Type = string_12;
  286.                 this.State = int_18;
  287.                 this.UsersNow = 0;
  288.                 this.UsersMax = int_19;
  289.                 this.ModelName = string_14;
  290.                 this.CCTs = string_15;
  291.                 this.Score = int_20;
  292.                 this.Tags = list_18;
  293.                 this.AllowPet = bool_13;
  294.                 this.AllowPetsEating = bool_14;
  295.                 this.AllowWalkthrough = bool_15;
  296.                 this.Hidewall = bool_16;
  297.                 this.Wallthick = int_21;
  298.                 this.Floorthick = int_22;
  299.                 this.int_7 = 0;
  300.                 this.RoomUser_0 = new RoomUser[500];
  301.                 this.class29_0 = class29_1;
  302.                 this.Password = string_16;
  303.                 this.dictionary_0 = new Dictionary<uint, double>();
  304.                 this.Event = null;
  305.                 this.Wallpaper = string_17;
  306.                 this.Floor = string_18;
  307.                 this.Landscape = string_19;
  308.                 this.hashtable_4 = new Hashtable();
  309.                 this.hashtable_0 = new Hashtable();
  310.                 this.list_2 = new List<Trade>();
  311.                 this.class28_0 = Phoenix.GetGame().GetRoomManager().GetModel(this.ModelName, this.uint_0);
  312.                 this.bool_6 = false;
  313.                 this.bool_7 = false;
  314.                 this.bool_5 = true;
  315.                 this.class27_0 = class27_1;
  316.                 this.bool_8 = bool_17;
  317.                 this.list_17 = new List<GroupsManager>();
  318.                 this.list_4 = new List<uint>();
  319.                 this.list_5 = new List<RoomItem>();
  320.                 this.list_9 = new List<RoomItem>();
  321.                 this.list_7 = new List<RoomItem>();
  322.                 this.list_6 = new List<RoomItem>();
  323.                 this.list_8 = new List<RoomItem>();
  324.                 this.list_10 = new List<RoomItem>();
  325.                 this.list_11 = new List<RoomItem>();
  326.                 this.list_12 = new List<RoomItem>();
  327.                 this.list_13 = new List<RoomItem>();
  328.                 this.Footballs = new List<RoomItem>();
  329.                 this.Goals = new List<RoomItem>();
  330.                 this.ScoreBoards = new List<RoomItem>();
  331.                 this.int_10 = 0;
  332.                 this.int_11 = 0;
  333.                 this.int_9 = 0;
  334.                 this.int_12 = 0;
  335.                 this.int_13 = 0;
  336.                 this.list_3 = new List<RoomItem>();
  337.                 this.list_14 = new List<RoomItem>();
  338.                 this.list_15 = new List<RoomItem>();
  339.                 this.list_16 = new List<RoomItem>();
  340.                 this.byte_0 = new byte[this.Class28_0.int_4, this.Class28_0.int_5];
  341.                 this.double_1 = new double[this.Class28_0.int_4, this.Class28_0.int_5];
  342.                 this.double_2 = new double[this.Class28_0.int_4, this.Class28_0.int_5];
  343.                 this.timer_0 = new Timer(new TimerCallback(this.method_32), null, 480, 480);
  344.                 this.int_8 = 0;
  345.                 this.bool_4 = false;
  346.                 this.bool_9 = true;
  347.                 this.bool_11 = false;
  348.                 this.int_16 = 0;
  349.                 this.int_15 = 4;
  350.                 this.Achievement = uint_3;
  351.                 this.bool_10 = false;
  352.                 this.hashtable_1 = new Hashtable();
  353.                 this.hashtable_2 = new Hashtable();
  354.                 this.hashtable_3 = new Hashtable();
  355.                 this.method_23();
  356.                 this.method_25();
  357.                 this.method_22();
  358.             }
  359.         }
  360.         public void method_0()
  361.         {
  362.             List<RoomBot> list = Phoenix.GetGame().GetBotManager().method_2(this.Id);
  363.             foreach (RoomBot current in list)
  364.             {
  365.                 this.method_3(current);
  366.             }
  367.         }
  368.         internal void ChangeQuick()
  369.         {
  370.             ServerMessage Msg = new ServerMessage(327u);
  371.             Msg.AppendInt32(0);
  372.             Msg.AppendInt32(6);
  373.             Msg.AppendInt32(0);
  374.             Msg.AppendInt32(0);
  375.             if (this != null)
  376.                 Msg.AppendInt32(this.int_13);
  377.             else
  378.                 Msg.AppendInt32(0);
  379.             this.SendMessage(Msg, null);
  380.             return;
  381.         }
  382.         public void method_1()
  383.         {
  384.             new List<Pet>();
  385.             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  386.             {
  387.                 @class.AddParamWithValue("roomid", this.Id);
  388.                 DataTable dataTable = @class.ReadDataTable("SELECT Id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z FROM user_pets WHERE room_id = @roomid;");
  389.                 if (dataTable != null)
  390.                 {
  391.                     foreach (DataRow dataRow_ in dataTable.Rows)
  392.                     {
  393.                         Pet class2 = Phoenix.GetGame().GetCatalog().method_12(dataRow_);
  394.                         List<RandomSpeech> list = new List<RandomSpeech>();
  395.                         List<BotResponse> list2 = new List<BotResponse>();
  396.                         //spawn bot
  397.                         this.method_4(new RoomBot(class2.PetId, this.Id, AIType.const_0, "freeroam", class2.Name, "", class2.Look, class2.X, class2.Y, (int)class2.Z, 0, 0, 0, 0, 0, ref list, ref list2, 0), class2);
  398.  
  399.                     }
  400.                 }
  401.             }
  402.         }
  403.         internal List<Pet> method_2()
  404.         {
  405.             List<Pet> list = new List<Pet>();
  406.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  407.             {
  408.                 if (this.RoomUser_0[i] != null && this.RoomUser_0[i].isPet)
  409.                 {
  410.                     list.Add(this.RoomUser_0[i].PetData);
  411.                 }
  412.             }
  413.             return list;
  414.         }
  415.         public RoomUser method_3(RoomBot class34_0)
  416.         {
  417.             return this.method_4(class34_0, null);
  418.         }
  419.         public RoomUser method_4(RoomBot Bot, Pet PetData)
  420.         {
  421.             int num = this.method_5();
  422.             RoomUser user = new RoomUser(Convert.ToUInt32(num + 100000), this.Id, this.int_7++, true);
  423.             user.int_20 = num;
  424.             this.RoomUser_0[num] = user;
  425.             if (Bot.x > 0 && Bot.y > 0 && Bot.x < this.Class28_0.int_4 && Bot.y < this.Class28_0.int_5)
  426.             {
  427.                 user.method_7(Bot.x, Bot.y, Bot.z);
  428.                 user.method_9(Bot.Rotation);
  429.             }
  430.             else
  431.             {
  432.                 Bot.x = this.Class28_0.int_0;
  433.                 Bot.y = this.Class28_0.int_1;
  434.                 user.method_7(this.Class28_0.int_0, this.Class28_0.int_1, this.Class28_0.double_0);
  435.                 user.method_9(this.Class28_0.int_2);
  436.             }
  437.             user.class34_0 = Bot;
  438.             user.BotAI = Bot.method_4(user.VirtualId);
  439.             if (user.isPet)
  440.             {
  441.                 user.BotAI.Init((int)Bot.Id, user.VirtualId, this.Id);
  442.                 user.PetData = PetData;
  443.                 user.PetData.VirtualId = user.VirtualId;
  444.             }
  445.             else
  446.             {
  447.                 user.BotAI.Init(-1, user.VirtualId, this.Id);
  448.             }
  449.             this.method_87(user, true, true);
  450.             user.bool_7 = true;
  451.             ServerMessage Message = new ServerMessage(28u);
  452.             Message.AppendInt32(1);
  453.             user.method_14(Message);
  454.             this.SendMessage(Message, null);
  455.             user.BotAI.OnSelfEnterRoom();
  456.             return user;
  457.         }
  458.         private int method_5()
  459.         {
  460.             return Array.IndexOf<RoomUser>(this.RoomUser_0, null);
  461.         }
  462.         public void method_6(int int_17, bool bool_13)
  463.         {
  464.  
  465.             RoomUser @class = this.method_52(int_17);
  466.             if (@class != null && @class.Boolean_4)
  467.             {
  468.                 @class.BotAI.OnSelfLeaveRoom(bool_13);
  469.  
  470.  
  471.                 ServerMessage Message = new ServerMessage(29u);
  472.                 Message.AppendRawInt32(@class.VirtualId);
  473.                 this.SendMessage(Message, null);
  474.                 uint num = @class.uint_0;
  475.  
  476.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  477.                 {
  478.                     RoomUser class2 = this.RoomUser_0[i];
  479.                     if (class2 != null && class2.uint_0 == num)
  480.                     {
  481.                         this.RoomUser_0[i] = null;
  482.                     }
  483.                 }
  484.             }
  485.         }
  486.         public void method_7(RoomUser RoomUser_1, string string_10, bool bool_13, uint id)
  487.         {
  488.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  489.             {
  490.                 RoomUser @class = this.RoomUser_0[i];
  491.                
  492.                 if (@class != null && @class.Boolean_4)
  493.                 {
  494.                     if (bool_13)
  495.                     {
  496.                         @class.BotAI.OnUserShout(RoomUser_1, string_10);
  497.                     }
  498.                     else
  499.                     {
  500.                         @class.BotAI.OnUserSay(RoomUser_1, string_10,id);
  501.                     }
  502.                 }
  503.             }
  504.         }
  505.         public void method_8(RoomUser RoomUser_1)
  506.         {
  507.             try
  508.             {
  509.                 foreach (RoomItem current in this.list_14)
  510.                 {
  511.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_enterroom")
  512.                     {
  513.                         this.method_21(RoomUser_1, current, "");
  514.                     }
  515.                 }
  516.             }
  517.             catch
  518.             {
  519.             }
  520.         }
  521.         public bool method_9(RoomUser RoomUser_1, string string_10)
  522.         {
  523.             bool result = false;
  524.             try
  525.             {
  526.                 foreach (RoomItem current in this.list_14)
  527.                 {
  528.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_onsay" && this.method_21(RoomUser_1, current, string_10.ToLower()))
  529.                     {
  530.                         result = true;
  531.                     }
  532.                 }
  533.             }
  534.             catch
  535.             {
  536.             }
  537.             return result;
  538.         }
  539.         public void method_10(RoomUser RoomUser_1, RoomItem RoomItem_0)
  540.         {
  541.             try
  542.             {
  543.                 foreach (RoomItem current in this.list_14)
  544.                 {
  545.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_furnistate")
  546.                     {
  547.                         this.method_21(RoomUser_1, current, Convert.ToString(RoomItem_0.uint_0));
  548.                     }
  549.                 }
  550.             }
  551.             catch
  552.             {
  553.             }
  554.         }
  555.         public void method_11(RoomUser RoomUser_1, RoomItem RoomItem_0)
  556.         {
  557.             try
  558.             {
  559.                 foreach (RoomItem current in this.list_14)
  560.                 {
  561.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_onfurni" || current.GetBaseItem().InteractionType.ToLower() == "torretta" || current.GetBaseItem().InteractionType.ToLower() == "torrettau")
  562.                     {
  563.                         this.method_21(RoomUser_1, current, Convert.ToString(RoomItem_0.uint_0));
  564.                     }
  565.                 }
  566.             }
  567.             catch
  568.             {
  569.             }
  570.         }
  571.         public void method_12(RoomUser RoomUser_1, RoomItem RoomItem_0)
  572.         {
  573.             try
  574.             {
  575.                 foreach (RoomItem current in this.list_14)
  576.                 {
  577.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_offfurni")
  578.                     {
  579.                         this.method_21(RoomUser_1, current, Convert.ToString(RoomItem_0.uint_0));
  580.                     }
  581.                 }
  582.             }
  583.             catch
  584.             {
  585.             }
  586.         }
  587.         public void method_13()
  588.         {
  589.             try
  590.             {
  591.                 foreach (RoomItem current in this.list_14)
  592.                 {
  593.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_gameend")
  594.                     {
  595.                         this.method_21(null, current, "GameEnded");
  596.                     }
  597.                 }
  598.             }
  599.             catch
  600.             {
  601.             }
  602.         }
  603.         public void method_14(RoomUser RoomUser_1)
  604.         {
  605.             try
  606.             {
  607.                 foreach (RoomItem current in this.list_14)
  608.                 {
  609.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_gamestart")
  610.                     {
  611.                         this.method_21(RoomUser_1, current, "GameBegun");
  612.                     }
  613.                 }
  614.             }
  615.             catch
  616.             {
  617.             }
  618.         }
  619.         public void method_15(RoomItem RoomItem_0)
  620.         {
  621.             this.method_21(null, RoomItem_0, "Timer");
  622.         }
  623.         public void method_16(double double_3)
  624.         {
  625.             try
  626.             {
  627.                 foreach (RoomItem current in this.list_14)
  628.                 {
  629.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_attime" && current.string_2.Length > 0 && Convert.ToDouble(current.string_2) == double_3)
  630.                     {
  631.                         this.method_21(null, current, "AtTime");
  632.                     }
  633.                 }
  634.             }
  635.             catch
  636.             {
  637.             }
  638.         }
  639.         public void method_17(int int_17)
  640.         {
  641.             try
  642.             {
  643.                 foreach (RoomItem current in this.list_14)
  644.                 {
  645.                     if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_atscore" && current.string_2 != "" && Convert.ToDouble(current.string_2) == (double)int_17)
  646.                     {
  647.                         this.method_21(null, current, "TheScore");
  648.                     }
  649.                 }
  650.             }
  651.             catch
  652.             {
  653.             }
  654.         }
  655.         public bool method_18(RoomUser RoomUser_1, string string_10, string string_11)
  656.         {
  657.             string_11 = this.method_20(RoomUser_1, string_11);
  658.             bool result;
  659.             if (string_10 != null)
  660.             {
  661.                 if (MusCommands.dictionary_4 == null)
  662.                 {
  663.                     MusCommands.dictionary_4 = new Dictionary<string, int>(39)
  664.                     {
  665.  
  666.                         {
  667.                             "roomuserseq",
  668.                             0
  669.                         },
  670.  
  671.                         {
  672.                             "roomuserslt",
  673.                             1
  674.                         },
  675.  
  676.                         {
  677.                             "roomusersmt",
  678.                             2
  679.                         },
  680.  
  681.                         {
  682.                             "roomusersmte",
  683.                             3
  684.                         },
  685.  
  686.                         {
  687.                             "roomuserslte",
  688.                             4
  689.                         },
  690.  
  691.                         {
  692.                             "userhasachievement",
  693.                             5
  694.                         },
  695.  
  696.                         {
  697.                             "userhasntachievement",
  698.                             6
  699.                         },
  700.  
  701.                         {
  702.                             "userhasbadge",
  703.                             7
  704.                         },
  705.  
  706.                         {
  707.                             "userhasntbadge",
  708.                             8
  709.                         },
  710.  
  711.                         {
  712.                             "userhasvip",
  713.                             9
  714.                         },
  715.  
  716.                         {
  717.                             "userhasntvip",
  718.                             10
  719.                         },
  720.  
  721.                         {
  722.                             "userhaseffect",
  723.                             11
  724.                         },
  725.  
  726.                         {
  727.                             "userhasnteffect",
  728.                             12
  729.                         },
  730.  
  731.                         {
  732.                             "userrankeq",
  733.                             13
  734.                         },
  735.  
  736.                         {
  737.                             "userrankmt",
  738.                             14
  739.                         },
  740.  
  741.                         {
  742.                             "userrankmte",
  743.                             15
  744.                         },
  745.  
  746.                         {
  747.                             "userranklt",
  748.                             16
  749.                         },
  750.  
  751.                         {
  752.                             "userranklte",
  753.                             17
  754.                         },
  755.  
  756.                         {
  757.                             "usercreditseq",
  758.                             18
  759.                         },
  760.  
  761.                         {
  762.                             "usercreditsmt",
  763.                             19
  764.                         },
  765.  
  766.                         {
  767.                             "usercreditsmte",
  768.                             20
  769.                         },
  770.  
  771.                         {
  772.                             "usercreditslt",
  773.                             21
  774.                         },
  775.  
  776.                         {
  777.                             "usercreditslte",
  778.                             22
  779.                         },
  780.  
  781.                         {
  782.                             "userpixelseq",
  783.                             23
  784.                         },
  785.  
  786.                         {
  787.                             "userpixelsmt",
  788.                             24
  789.                         },
  790.  
  791.                         {
  792.                             "userpixelsmte",
  793.                             25
  794.                         },
  795.  
  796.                         {
  797.                             "userpixelslt",
  798.                             26
  799.                         },
  800.  
  801.                         {
  802.                             "userpixelslte",
  803.                             27
  804.                         },
  805.  
  806.                         {
  807.                             "userpointseq",
  808.                             28
  809.                         },
  810.  
  811.                         {
  812.                             "userpointsmt",
  813.                             29
  814.                         },
  815.  
  816.                         {
  817.                             "userpointsmte",
  818.                             30
  819.                         },
  820.  
  821.                         {
  822.                             "userpointslt",
  823.                             31
  824.                         },
  825.  
  826.                         {
  827.                             "userpointslte",
  828.                             32
  829.                         },
  830.  
  831.                         {
  832.                             "usergroupeq",
  833.                             33
  834.                         },
  835.  
  836.                         {
  837.                             "userisingroup",
  838.                             34
  839.                         },
  840.  
  841.                         {
  842.                             "wearing",
  843.                             35
  844.                         },
  845.  
  846.                         {
  847.                             "notwearing",
  848.                             36
  849.                         },
  850.  
  851.                         {
  852.                             "carrying",
  853.                             37
  854.                         },
  855.  
  856.                         {
  857.                             "notcarrying",
  858.                             38
  859.                         },
  860.  
  861.                         {
  862.                             "furnihp",
  863.                             39
  864.                         }
  865.                     };
  866.                 }
  867.                 int num;
  868.                 if (MusCommands.dictionary_4.TryGetValue(string_10, out num))
  869.                 {
  870.                     switch (num)
  871.                     {
  872.                         case 0:
  873.                             if (this.Int32_0 == Convert.ToInt32(string_11))
  874.                             {
  875.                                 result = true;
  876.                                 return result;
  877.                             }
  878.                             goto IL_89E;
  879.                         case 1:
  880.                             if (this.Int32_0 < Convert.ToInt32(string_11))
  881.                             {
  882.                                 result = true;
  883.                                 return result;
  884.                             }
  885.                             goto IL_89E;
  886.                         case 2:
  887.                             if (this.Int32_0 > Convert.ToInt32(string_11))
  888.                             {
  889.                                 result = true;
  890.                                 return result;
  891.                             }
  892.                             goto IL_89E;
  893.                         case 3:
  894.                             if (this.Int32_0 >= Convert.ToInt32(string_11))
  895.                             {
  896.                                 result = true;
  897.                                 return result;
  898.                             }
  899.                             goto IL_89E;
  900.                         case 4:
  901.                             if (this.Int32_0 <= Convert.ToInt32(string_11))
  902.                             {
  903.                                 result = true;
  904.                                 return result;
  905.                             }
  906.                             goto IL_89E;
  907.                         case 5:
  908.                             result = Phoenix.GetGame().GetAchievementManager().method_1(RoomUser_1.GetClient(), (uint)Convert.ToUInt16(string_11), 1);
  909.                             return result;
  910.                         case 6:
  911.                             if (!Phoenix.GetGame().GetAchievementManager().method_1(RoomUser_1.GetClient(), (uint)Convert.ToUInt16(string_11), 1))
  912.                             {
  913.                                 result = true;
  914.                                 return result;
  915.                             }
  916.                             goto IL_89E;
  917.                         case 7:
  918.                             result = RoomUser_1.GetClient().GetHabbo().method_22().method_1(string_11);
  919.                             return result;
  920.                         case 8:
  921.                             if (!RoomUser_1.GetClient().GetHabbo().method_22().method_1(string_11))
  922.                             {
  923.                                 result = true;
  924.                                 return result;
  925.                             }
  926.                             goto IL_89E;
  927.                         case 9:
  928.                             result = RoomUser_1.GetClient().GetHabbo().Vip;
  929.                             return result;
  930.                         case 10:
  931.                             if (!RoomUser_1.GetClient().GetHabbo().Vip)
  932.                             {
  933.                                 result = true;
  934.                                 return result;
  935.                             }
  936.                             goto IL_89E;
  937.                         case 11:
  938.                             if (RoomUser_1.GetClient().GetHabbo().method_24().int_0 == Convert.ToInt32(string_11))
  939.                             {
  940.                                 result = true;
  941.                                 return result;
  942.                             }
  943.                             goto IL_89E;
  944.                         case 12:
  945.                             if (RoomUser_1.GetClient().GetHabbo().method_24().int_0 != Convert.ToInt32(string_11))
  946.                             {
  947.                                 result = true;
  948.                                 return result;
  949.                             }
  950.                             goto IL_89E;
  951.                         case 13:
  952.                             if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank == (ulong)((long)Convert.ToInt32(string_11)))
  953.                             {
  954.                                 result = true;
  955.                                 return result;
  956.                             }
  957.                             goto IL_89E;
  958.                         case 14:
  959.                             if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank > (ulong)((long)Convert.ToInt32(string_11)))
  960.                             {
  961.                                 result = true;
  962.                                 return result;
  963.                             }
  964.                             goto IL_89E;
  965.                         case 15:
  966.                             if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank >= (ulong)((long)Convert.ToInt32(string_11)))
  967.                             {
  968.                                 result = true;
  969.                                 return result;
  970.                             }
  971.                             goto IL_89E;
  972.                         case 16:
  973.                             if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank < (ulong)((long)Convert.ToInt32(string_11)))
  974.                             {
  975.                                 result = true;
  976.                                 return result;
  977.                             }
  978.                             goto IL_89E;
  979.                         case 17:
  980.                             if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank <= (ulong)((long)Convert.ToInt32(string_11)))
  981.                             {
  982.                                 result = true;
  983.                                 return result;
  984.                             }
  985.                             goto IL_89E;
  986.                         case 18:
  987.                             if (RoomUser_1.GetClient().GetHabbo().Credits == Convert.ToInt32(string_11))
  988.                             {
  989.                                 result = true;
  990.                                 return result;
  991.                             }
  992.                             goto IL_89E;
  993.                         case 19:
  994.                             if (RoomUser_1.GetClient().GetHabbo().Credits > Convert.ToInt32(string_11))
  995.                             {
  996.                                 result = true;
  997.                                 return result;
  998.                             }
  999.                             goto IL_89E;
  1000.                         case 20:
  1001.                             if (RoomUser_1.GetClient().GetHabbo().Credits >= Convert.ToInt32(string_11))
  1002.                             {
  1003.                                 result = true;
  1004.                                 return result;
  1005.                             }
  1006.                             goto IL_89E;
  1007.                         case 21:
  1008.                             if (RoomUser_1.GetClient().GetHabbo().Credits < Convert.ToInt32(string_11))
  1009.                             {
  1010.                                 result = true;
  1011.                                 return result;
  1012.                             }
  1013.                             goto IL_89E;
  1014.                         case 22:
  1015.                             if (RoomUser_1.GetClient().GetHabbo().Credits <= Convert.ToInt32(string_11))
  1016.                             {
  1017.                                 result = true;
  1018.                                 return result;
  1019.                             }
  1020.                             goto IL_89E;
  1021.                         case 23:
  1022.                             if (RoomUser_1.GetClient().GetHabbo().ActivityPoints == Convert.ToInt32(string_11))
  1023.                             {
  1024.                                 result = true;
  1025.                                 return result;
  1026.                             }
  1027.                             goto IL_89E;
  1028.                         case 24:
  1029.                             if (RoomUser_1.GetClient().GetHabbo().ActivityPoints > Convert.ToInt32(string_11))
  1030.                             {
  1031.                                 result = true;
  1032.                                 return result;
  1033.                             }
  1034.                             goto IL_89E;
  1035.                         case 25:
  1036.                             if (RoomUser_1.GetClient().GetHabbo().ActivityPoints >= Convert.ToInt32(string_11))
  1037.                             {
  1038.                                 result = true;
  1039.                                 return result;
  1040.                             }
  1041.                             goto IL_89E;
  1042.                         case 26:
  1043.                             if (RoomUser_1.GetClient().GetHabbo().ActivityPoints < Convert.ToInt32(string_11))
  1044.                             {
  1045.                                 result = true;
  1046.                                 return result;
  1047.                             }
  1048.                             goto IL_89E;
  1049.                         case 27:
  1050.                             if (RoomUser_1.GetClient().GetHabbo().ActivityPoints <= Convert.ToInt32(string_11))
  1051.                             {
  1052.                                 result = true;
  1053.                                 return result;
  1054.                             }
  1055.                             goto IL_89E;
  1056.                         case 28:
  1057.                             if (RoomUser_1.GetClient().GetHabbo().VipPoints == Convert.ToInt32(string_11))
  1058.                             {
  1059.                                 result = true;
  1060.                                 return result;
  1061.                             }
  1062.                             goto IL_89E;
  1063.                         case 29:
  1064.                             if (RoomUser_1.GetClient().GetHabbo().VipPoints > Convert.ToInt32(string_11))
  1065.                             {
  1066.                                 result = true;
  1067.                                 return result;
  1068.                             }
  1069.                             goto IL_89E;
  1070.                         case 30:
  1071.                             if (RoomUser_1.GetClient().GetHabbo().VipPoints >= Convert.ToInt32(string_11))
  1072.                             {
  1073.                                 result = true;
  1074.                                 return result;
  1075.                             }
  1076.                             goto IL_89E;
  1077.                         case 31:
  1078.                             if (RoomUser_1.GetClient().GetHabbo().VipPoints < Convert.ToInt32(string_11))
  1079.                             {
  1080.                                 result = true;
  1081.                                 return result;
  1082.                             }
  1083.                             goto IL_89E;
  1084.                         case 32:
  1085.                             if (RoomUser_1.GetClient().GetHabbo().VipPoints <= Convert.ToInt32(string_11))
  1086.                             {
  1087.                                 result = true;
  1088.                                 return result;
  1089.                             }
  1090.                             goto IL_89E;
  1091.                         case 33:
  1092.                             if (RoomUser_1.GetClient().GetHabbo().int_0 == Convert.ToInt32(string_11))
  1093.                             {
  1094.                                 result = true;
  1095.                                 return result;
  1096.                             }
  1097.                             goto IL_89E;
  1098.                         case 34:
  1099.                             {
  1100.                                 IEnumerator enumerator = RoomUser_1.GetClient().GetHabbo().dataTable_0.Rows.GetEnumerator();
  1101.                                 try
  1102.                                 {
  1103.                                     while (enumerator.MoveNext())
  1104.                                     {
  1105.                                         DataRow dataRow = (DataRow)enumerator.Current;
  1106.                                         if ((int)dataRow["groupid"] == Convert.ToInt32(string_11))
  1107.                                         {
  1108.                                             result = true;
  1109.                                             return result;
  1110.                                         }
  1111.                                     }
  1112.                                     goto IL_89E;
  1113.                                 }
  1114.                                 finally
  1115.                                 {
  1116.                                     IDisposable disposable = enumerator as IDisposable;
  1117.                                     if (disposable != null)
  1118.                                     {
  1119.                                         disposable.Dispose();
  1120.                                     }
  1121.                                 }
  1122.                             }
  1123.                         case 35:
  1124.                             break;
  1125.                         case 36:
  1126.                             if (!RoomUser_1.GetClient().GetHabbo().Figure.Contains(string_11))
  1127.                             {
  1128.                                 result = true;
  1129.                                 return result;
  1130.                             }
  1131.                             goto IL_89E;
  1132.                         case 37:
  1133.                             if (this.method_53(RoomUser_1.GetClient().GetHabbo().Id).int_5 == (int)Convert.ToInt16(string_11))
  1134.                             {
  1135.                                 result = true;
  1136.                                 return result;
  1137.                             }
  1138.                             goto IL_89E;
  1139.                         case 38:
  1140.                             if (this.method_53(RoomUser_1.GetClient().GetHabbo().Id).int_5 != (int)Convert.ToInt16(string_11))
  1141.                             {
  1142.                                 result = true;
  1143.                                 return result;
  1144.                             }
  1145.                             goto IL_89E;
  1146.  
  1147.                         case 39:
  1148.                             int idf;
  1149.                             int hp;
  1150.                             int hpa;
  1151.                          idf = int.Parse(string_11.Split(new char[]
  1152.                          {
  1153.                         ','
  1154.  
  1155.  
  1156.                         })[0]);
  1157.                             hp = int.Parse(string_11.Split(new char[]
  1158.                           {
  1159.                      ','
  1160.                           })[1]);
  1161.  
  1162.                             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1163.                             {
  1164.  
  1165.  
  1166.                                 hpa = @class.ReadInt32("SELECT hp FROM items WHERE Id = " + idf + " LIMIT 1;");
  1167.                                
  1168.                             }
  1169.                             if (hpa==hp)
  1170.                             {
  1171.                                 result = true;
  1172.                                 return result;
  1173.                             }
  1174.                             goto IL_89E;
  1175.                         default:
  1176.                             goto IL_89E;
  1177.                     }
  1178.                     if (RoomUser_1.GetClient().GetHabbo().Figure.Contains(string_11))
  1179.                     {
  1180.                         result = true;
  1181.                         return result;
  1182.                     }
  1183.                 }
  1184.             }
  1185.         IL_89E:
  1186.             result = false;
  1187.             return result;
  1188.         }
  1189.         public void method_19(RoomUser RoomUser_1, string string_10, string string_11)
  1190.         {
  1191.             string_11 = this.method_20(RoomUser_1, string_11);
  1192.             if (string_10 != null)
  1193.             {
  1194.                 if (MusCommands.dictionary_5 == null)
  1195.                 {
  1196.                     MusCommands.dictionary_5 = new Dictionary<string, int>(13)
  1197.                     {
  1198.  
  1199.                         {
  1200.                             "sql",
  1201.                             0
  1202.                         },
  1203.  
  1204.                         {
  1205.                             "badge",
  1206.                             1
  1207.                         },
  1208.  
  1209.                         {
  1210.                             "effect",
  1211.                             2
  1212.                         },
  1213.  
  1214.                         {
  1215.                             "award",
  1216.                             3
  1217.                         },
  1218.  
  1219.                         {
  1220.                             "dance",
  1221.                             4
  1222.                         },
  1223.  
  1224.                         {
  1225.                             "send",
  1226.                             5
  1227.                         },
  1228.  
  1229.                         {
  1230.                             "credits",
  1231.                             6
  1232.                         },
  1233.  
  1234.                         {
  1235.                             "pixels",
  1236.                             7
  1237.                         },
  1238.  
  1239.                         {
  1240.                             "points",
  1241.                             8
  1242.                         },
  1243.  
  1244.                         {
  1245.                             "rank",
  1246.                             9
  1247.                         },
  1248.  
  1249.                         {
  1250.                             "respect",
  1251.                             10
  1252.                         },
  1253.  
  1254.                         {
  1255.                             "handitem",
  1256.                             11
  1257.                         },
  1258.  
  1259.                         {
  1260.                             "alert",
  1261.                             12
  1262.                         },
  1263.  
  1264.                         {
  1265.                             "hp",
  1266.                             13
  1267.                         },
  1268.  
  1269.                         {
  1270.                             "hpf",
  1271.                             14
  1272.                         }
  1273.                     };
  1274.                 }
  1275.                 int num;
  1276.                 if (MusCommands.dictionary_5.TryGetValue(string_10, out num))
  1277.                 {
  1278.                     switch (num)
  1279.                     {
  1280.                         case 0:
  1281.                             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1282.                             {
  1283.                                 @class.ExecuteQuery(string_11);
  1284.                                 return;
  1285.                             }
  1286.                         case 1:
  1287.                             break;
  1288.                         case 2:
  1289.                             if (RoomUser_1.GetClient() != null)
  1290.                             {
  1291.                                 RoomUser_1.GetClient().GetHabbo().method_24().method_0(Convert.ToInt32(string_11), 3600);
  1292.                                 RoomUser_1.GetClient().GetHabbo().method_24().method_3(Convert.ToInt32(string_11));
  1293.                                 return;
  1294.                             }
  1295.                             return;
  1296.                         case 3:
  1297.                             if (RoomUser_1.GetClient() != null)
  1298.                             {
  1299.                                 Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), Convert.ToUInt32(string_11));
  1300.                                 return;
  1301.                             }
  1302.                             return;
  1303.                         case 4:
  1304.                             if (RoomUser_1.GetClient() != null)
  1305.                             {
  1306.                                 RoomUser class2 = this.method_53(RoomUser_1.GetClient().GetHabbo().Id);
  1307.                                 class2.int_15 = Convert.ToInt32(string_11);
  1308.                                 ServerMessage Message = new ServerMessage(480u);
  1309.                                 Message.AppendInt32(class2.VirtualId);
  1310.                                 Message.AppendInt32(Convert.ToInt32(string_11));
  1311.                                 this.SendMessage(Message, null);
  1312.                                 return;
  1313.                             }
  1314.                             return;
  1315.                         case 5:
  1316.                             {
  1317.                                 if (RoomUser_1.GetClient() == null)
  1318.                                 {
  1319.                                     return;
  1320.                                 }
  1321.                                 uint num2 = Convert.ToUInt32(string_11);
  1322.                                 Room class3;
  1323.                                 if (Phoenix.GetGame().GetRoomManager().method_13(num2) || Phoenix.GetGame().GetRoomManager().method_14(num2))
  1324.                                 {
  1325.                                     class3 = Phoenix.GetGame().GetRoomManager().GetRoom(num2);
  1326.                                 }
  1327.                                 else
  1328.                                 {
  1329.                                     class3 = Phoenix.GetGame().GetRoomManager().method_15(num2);
  1330.                                 }
  1331.                                 if (RoomUser_1 == null)
  1332.                                 {
  1333.                                     return;
  1334.                                 }
  1335.                                 if (class3 == null)
  1336.                                 {
  1337.                                     this.method_47(RoomUser_1.GetClient(), true, false);
  1338.                                     return;
  1339.                                 }
  1340.                                 ServerMessage Message2 = new ServerMessage(286u);
  1341.                                 Message2.AppendBoolean(class3.Boolean_3);
  1342.                                 Message2.AppendUInt(Convert.ToUInt32(string_11));
  1343.                                 RoomUser_1.GetClient().SendMessage(Message2);
  1344.                                 return;
  1345.                             }
  1346.                         case 6:
  1347.                             if (RoomUser_1.GetClient() != null)
  1348.                             {
  1349.                                 RoomUser_1.GetClient().GetHabbo().Credits = RoomUser_1.GetClient().GetHabbo().Credits + Convert.ToInt32(string_11);
  1350.                                 RoomUser_1.GetClient().GetHabbo().method_13(true);
  1351.                                 return;
  1352.                             }
  1353.                             return;
  1354.                         case 7:
  1355.                             if (RoomUser_1.GetClient() != null)
  1356.                             {
  1357.                                 RoomUser_1.GetClient().GetHabbo().ActivityPoints = RoomUser_1.GetClient().GetHabbo().ActivityPoints + Convert.ToInt32(string_11);
  1358.                                 RoomUser_1.GetClient().GetHabbo().method_15(true);
  1359.                                 return;
  1360.                             }
  1361.                             return;
  1362.                         case 8:
  1363.                             if (RoomUser_1.GetClient() != null)
  1364.                             {
  1365.                                 RoomUser_1.GetClient().GetHabbo().VipPoints = RoomUser_1.GetClient().GetHabbo().VipPoints + Convert.ToInt32(string_11);
  1366.                                 RoomUser_1.GetClient().GetHabbo().method_14(false, true);
  1367.                                 return;
  1368.                             }
  1369.                             return;
  1370.                         case 9:
  1371.                             if (RoomUser_1.GetClient() != null && (int)Convert.ToUInt16(string_11) < Phoenix.GetGame().GetRoleManager().method_9())
  1372.                             {
  1373.                                 /*using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1374.                                 {
  1375.                                     @class.ExecuteQuery(string.Concat(new object[]
  1376.                                     {
  1377.                                         "UPDATE users SET rank = '",
  1378.                                         Convert.ToUInt16(string_11),
  1379.                                         "' WHERE Id = ",
  1380.                                         RoomUser_1.GetClient().GetHabbo().Id,
  1381.                                         " LIMIT 1;"
  1382.                                     }));
  1383.                                 }
  1384.                                 RoomUser_1.GetClient().method_12();
  1385.                                  * is this an exploit.. i think so?! */
  1386.                                 return;
  1387.                             }
  1388.                             return;
  1389.                         case 10:
  1390.                             {
  1391.                                 if (RoomUser_1.GetClient() == null)
  1392.                                 {
  1393.                                     return;
  1394.                                 }
  1395.                                 RoomUser_1.GetClient().GetHabbo().Respect++;
  1396.                                 using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1397.                                 {
  1398.                                     @class.ExecuteQuery("UPDATE user_stats SET Respect = respect + 1 WHERE Id = '" + RoomUser_1.GetClient().GetHabbo().Id + "' LIMIT 1");
  1399.                                 }
  1400.                                 ServerMessage Message3 = new ServerMessage(440u);
  1401.                                 Message3.AppendUInt(RoomUser_1.GetClient().GetHabbo().Id);
  1402.                                 Message3.AppendInt32(RoomUser_1.GetClient().GetHabbo().Respect);
  1403.                                 this.SendMessage(Message3, null);
  1404.                                 int int_ = RoomUser_1.GetClient().GetHabbo().Respect;
  1405.                                 if (int_ <= 166)
  1406.                                 {
  1407.                                     if (int_ <= 6)
  1408.                                     {
  1409.                                         if (int_ == 1)
  1410.                                         {
  1411.                                             Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 1);
  1412.                                             return;
  1413.                                         }
  1414.                                         if (int_ != 6)
  1415.                                         {
  1416.                                             return;
  1417.                                         }
  1418.                                         Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 2);
  1419.                                         return;
  1420.                                     }
  1421.                                     else
  1422.                                     {
  1423.                                         if (int_ == 16)
  1424.                                         {
  1425.                                             Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 3);
  1426.                                             return;
  1427.                                         }
  1428.                                         if (int_ == 66)
  1429.                                         {
  1430.                                             Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 4);
  1431.                                             return;
  1432.                                         }
  1433.                                         if (int_ != 166)
  1434.                                         {
  1435.                                             return;
  1436.                                         }
  1437.                                         Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 5);
  1438.                                         return;
  1439.                                     }
  1440.                                 }
  1441.                                 else
  1442.                                 {
  1443.                                     if (int_ <= 566)
  1444.                                     {
  1445.                                         if (int_ == 366)
  1446.                                         {
  1447.                                             Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 6);
  1448.                                             return;
  1449.                                         }
  1450.                                         if (int_ != 566)
  1451.                                         {
  1452.                                             return;
  1453.                                         }
  1454.                                         Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 7);
  1455.                                         return;
  1456.                                     }
  1457.                                     else
  1458.                                     {
  1459.                                         if (int_ == 766)
  1460.                                         {
  1461.                                             Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 8);
  1462.                                             return;
  1463.                                         }
  1464.                                         if (int_ == 966)
  1465.                                         {
  1466.                                             Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 9);
  1467.                                             return;
  1468.                                         }
  1469.                                         if (int_ != 1116)
  1470.                                         {
  1471.                                             return;
  1472.                                         }
  1473.                                         Phoenix.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), 14u, 10);
  1474.                                         return;
  1475.                                     }
  1476.                                 }
  1477.                             }
  1478.                         case 11:
  1479.                             if (RoomUser_1.GetClient() != null)
  1480.                             {
  1481.                                 this.method_53(RoomUser_1.GetClient().GetHabbo().Id).method_8((int)Convert.ToInt16(string_11));
  1482.                                 return;
  1483.                             }
  1484.                             return;
  1485.                         case 12:
  1486.                             if (RoomUser_1.GetClient() != null)
  1487.                             {
  1488.                                 RoomUser_1.GetClient().SendNotif(string_11);
  1489.                                 return;
  1490.                             }
  1491.                             return;
  1492.  
  1493.                         case 13:
  1494.                             if (RoomUser_1.GetClient() != null)
  1495.                             {
  1496.                                 int hpa =Convert.ToInt32(string_11);
  1497.                                 int hpmax;
  1498.                                 int hp;
  1499.                                 int stato=1;
  1500.                                 int arm;
  1501.                                 using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1502.                                 {
  1503.                                    arm = @class.ReadInt32("SELECT arm FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1504.                                    
  1505.  
  1506.  
  1507.                                 }
  1508.  
  1509.                                 if (arm < 1)
  1510.                                 {
  1511.                                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1512.                                     {
  1513.                                         hp = @class.ReadInt32("SELECT hp FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1514.                                         hpmax = @class.ReadInt32("SELECT hpmax FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1515.  
  1516.                                         if (hpa == 0)
  1517.                                         {
  1518.                                             hpa = ((hp) * (-1));
  1519.                                         }
  1520.  
  1521.                                         else if (hp + hpa > hpmax)
  1522.                                         {
  1523.                                             hpa = hpmax - hp;
  1524.                                         }
  1525.                                         else if (hp + hpa < 0)
  1526.                                         {
  1527.                                             hpa = ((hp) * (-1));
  1528.                                         }
  1529.  
  1530.                                         @class.ExecuteQuery("UPDATE users SET hp=hp+'" + hpa + "' WHERE id='" + RoomUser_1.GetClient().GetHabbo().Id + "'");
  1531.                                         stato = @class.ReadInt32("SELECT hp FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1532.  
  1533.                                     }
  1534.                                 }
  1535.                                 else if (arm>0 && hpa<0)
  1536.                                 {
  1537.                                     if (arm + hpa < 0)
  1538.                                     {
  1539.                                         hpa = ((arm) * (-1));
  1540.                                     }
  1541.                                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1542.                                     {
  1543.                                         @class.ExecuteQuery("UPDATE users SET arm=arm+'" + hpa + "' WHERE id='" + RoomUser_1.GetClient().GetHabbo().Id + "'");
  1544.                                     }
  1545.                                  }
  1546.                                 if (stato == 0)
  1547.                                 {
  1548.                                     GameClient @class = null;
  1549.                                     @class = Phoenix.GetGame().GetClientManager().method_2(RoomUser_1.GetClient().GetHabbo().Id);
  1550.                                    
  1551.                                     ServerMessage Message5 = new ServerMessage(286u);
  1552.                                     Message5.AppendBoolean(@class.GetHabbo().Class14_0.Boolean_3);
  1553.                                     Message5.AppendUInt(59251);
  1554.                                     @class.SendMessage(Message5);
  1555.  
  1556.                                 }
  1557.                                 return;
  1558.                             }
  1559.                             return;
  1560.                         case 14:
  1561.                             {
  1562.                                 int idf;
  1563.                                 int hp;
  1564.                                 int stato;
  1565.  
  1566.  
  1567.                       idf = int.Parse(string_11.Split(new char[]
  1568.                        {
  1569.                         ','
  1570.  
  1571.  
  1572.                       })[0]);
  1573.                        hp = int.Parse(string_11.Split(new char[]
  1574.                      {
  1575.                      ','
  1576.                      })[1]);
  1577.  
  1578.                                 if (hp < 0)
  1579.                                 {
  1580.                                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1581.                                     {
  1582.  
  1583.  
  1584.                                         stato = @class.ReadInt32("SELECT hp FROM items WHERE Id = " + idf + " LIMIT 1;");
  1585.                                         if (stato > 0)
  1586.                                         {
  1587.                                             @class.ExecuteQuery("UPDATE items SET hp=hp+'" + hp + "' WHERE id='" + idf + "'");
  1588.                                         }
  1589.  
  1590.                                     }
  1591.                                 }
  1592.  
  1593.                                 else if(hp==0)
  1594.                                 {
  1595.                                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1596.                                     {
  1597.                                         @class.ExecuteQuery("UPDATE items SET hp='0' WHERE id='" + idf + "'");
  1598.                                     }
  1599.                                 }
  1600.  
  1601.                                 else
  1602.                                 {
  1603.                                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  1604.                                     {
  1605.                                         @class.ExecuteQuery("UPDATE items SET hp=hp+'" + hp + "' WHERE id='" + idf + "'");
  1606.                                     }
  1607.                                 }
  1608.  
  1609.                                 return;
  1610.  
  1611.  
  1612.                             }
  1613.                         default:
  1614.                             return;
  1615.                     }
  1616.                     if (RoomUser_1.GetClient() != null)
  1617.                     {
  1618.                         RoomUser_1.GetClient().GetHabbo().method_22().method_2(RoomUser_1.GetClient(), Phoenix.FilterString(string_11), true);
  1619.                         RoomUser_1.GetClient().SendMessage(RoomUser_1.GetClient().GetHabbo().method_22().method_7());
  1620.                     }
  1621.                 }
  1622.             }
  1623.         }
  1624.         public string method_20(RoomUser RoomUser_1, string string_10)
  1625.         {
  1626.             if (RoomUser_1 != null)
  1627.             {
  1628.                 if (string_10.ToUpper().Contains("#USERNAME#"))
  1629.                 {
  1630.                     string_10 = Regex.Replace(string_10, "#USERNAME#", RoomUser_1.GetClient().GetHabbo().Username, RegexOptions.IgnoreCase);
  1631.                 }
  1632.                 if (string_10.ToUpper().Contains("#USERID#"))
  1633.                 {
  1634.                     string_10 = Regex.Replace(string_10, "#USERID#", RoomUser_1.GetClient().GetHabbo().Id.ToString(), RegexOptions.IgnoreCase);
  1635.                 }
  1636.                 if (string_10.ToUpper().Contains("#USERRANK#"))
  1637.                 {
  1638.                     string_10 = Regex.Replace(string_10, "#USERRANK#", RoomUser_1.GetClient().GetHabbo().Rank.ToString(), RegexOptions.IgnoreCase);
  1639.                 }
  1640.             }
  1641.             if (string_10.ToUpper().Contains("#ROOMNAME#"))
  1642.             {
  1643.                 string_10 = Regex.Replace(string_10, "#ROOMNAME#", this.Name, RegexOptions.IgnoreCase);
  1644.             }
  1645.             if (string_10.ToUpper().Contains("#ROOMID#"))
  1646.             {
  1647.                 string_10 = Regex.Replace(string_10, "#ROOMID#", this.uint_0.ToString(), RegexOptions.IgnoreCase);
  1648.             }
  1649.             int num = Phoenix.GetGame().GetClientManager().ClientCount + -1;
  1650.             int int32_ = Phoenix.GetGame().GetRoomManager().LoadedRoomsCount;
  1651.             if (string_10.ToUpper().Contains("#ONLINECOUNT#"))
  1652.             {
  1653.                 string_10 = Regex.Replace(string_10, "#ONLINECOUNT#", num.ToString(), RegexOptions.IgnoreCase);
  1654.             }
  1655.             if (string_10.ToUpper().Contains("#ROOMSLOADED#"))
  1656.             {
  1657.                 string_10 = Regex.Replace(string_10, "#ROOMSLOADED#", int32_.ToString(), RegexOptions.IgnoreCase);
  1658.             }
  1659.             return string_10;
  1660.         }
  1661.         public bool method_21(RoomUser RoomUser_1, RoomItem RoomItem_0, string string_10)
  1662.         {
  1663.             bool result;
  1664.             try
  1665.             {
  1666.                 if (this.bool_6 || this.bool_7)
  1667.                 {
  1668.                     result = false;
  1669.                 }
  1670.                 else
  1671.                 {
  1672.                     bool flag = false;
  1673.                     int num = 0;
  1674.                     int num2 = 0;
  1675.                     bool flag2 = false;
  1676.                     string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
  1677.                     switch (text)
  1678.                     {
  1679.                         case "wf_trg_onsay":
  1680.                             if (string_10.Contains(RoomItem_0.string_2.ToLower()))
  1681.                             {
  1682.                                 flag = true;
  1683.                             }
  1684.                             break;
  1685.                         case "wf_trg_enterroom":
  1686.                             if (RoomItem_0.string_2 == "" || RoomItem_0.string_2 == RoomUser_1.GetClient().GetHabbo().Username)
  1687.                             {
  1688.                                 flag = true;
  1689.                             }
  1690.                             break;
  1691.                         case "wf_trg_furnistate":
  1692.                             if (RoomItem_0.string_3.Length > 0)
  1693.                             {
  1694.                                 string[] collection = RoomItem_0.string_3.Split(new char[]
  1695.                             {
  1696.                                 ','
  1697.                             });
  1698.                                 List<string> list = new List<string>(collection);
  1699.                                 foreach (string current in list)
  1700.                                 {
  1701.                                     if (current == string_10)
  1702.                                     {
  1703.                                         flag = true;
  1704.                                     }
  1705.                                 }
  1706.                             }
  1707.                             break;
  1708.                         case "wf_trg_onfurni":
  1709.                             if (RoomItem_0.string_3.Length > 0)
  1710.                             {
  1711.                                 string[] collection = RoomItem_0.string_3.Split(new char[]
  1712.                             {
  1713.                                 ','
  1714.                             });
  1715.                                 List<string> list = new List<string>(collection);
  1716.                                 List<string> list2 = list;
  1717.                                 foreach (string current in list)
  1718.                                 {
  1719.                                     if (!(current != string_10))
  1720.                                     {
  1721.                                         RoomItem @class = this.method_28(Convert.ToUInt32(string_10));
  1722.                                         if (@class != null)
  1723.                                         {
  1724.                                             flag = true;
  1725.                                         }
  1726.                                         else
  1727.                                         {
  1728.                                             list2.Remove(current);
  1729.                                         }
  1730.                                     }
  1731.                                 }
  1732.                                 RoomItem_0.string_3 = string.Join(",", list2.ToArray());
  1733.                             }
  1734.                             break;
  1735.                         case "torretta":
  1736.                             if (RoomItem_0.string_3.Length > 0)
  1737.                             {
  1738.                                 string[] collection = RoomItem_0.string_3.Split(new char[]
  1739.                             {
  1740.                                 ','
  1741.                             });
  1742.                                 List<string> list = new List<string>(collection);
  1743.                                 List<string> list2 = list;
  1744.                                 foreach (string current in list)
  1745.                                 {
  1746.                                     if (!(current != string_10))
  1747.                                     {
  1748.                                         RoomItem @class = this.method_28(Convert.ToUInt32(string_10));
  1749.                                         if (@class != null)
  1750.                                         {
  1751.                                             int danno;
  1752.                                             uint funi = RoomItem_0.uint_0;
  1753.                                             using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  1754.                                             {
  1755.                                                 danno = @class2.ReadInt32("SELECT danno FROM items WHERE id = " + funi + " LIMIT 1;");
  1756.                                                
  1757.                                             }
  1758.  
  1759.                                            
  1760.                                            
  1761.                                             int hpa = danno;
  1762.                                             int hpmax;
  1763.                                             int hp;
  1764.                                             int stato = 1;
  1765.                                             int cont;
  1766.                                             int idg = 0;
  1767.                                             int idu = 0;
  1768.                                             int arm;
  1769.                                             string nomeg = "";
  1770.                                             using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  1771.                                             {
  1772.                                                 cont = @class2.ReadInt32("SELECT COUNT(id) FROM groups WHERE roomid = " + RoomUser_1.GetClient().GetHabbo().CurrentRoomId + " LIMIT 1;");
  1773.                                                 if (cont > 0)
  1774.                                                 {
  1775.                                                     idg = @class2.ReadInt32("SELECT id FROM groups WHERE roomid = " + RoomUser_1.GetClient().GetHabbo().CurrentRoomId + " LIMIT 1;");
  1776.                                                     idu = @class2.ReadInt32("SELECT groupid FROM user_stats WHERE id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1777.                                                     nomeg = @class2.ReadString("SELECT name FROM groups WHERE id = " + idg + " LIMIT 1;");
  1778.                                                 }
  1779.                                             }
  1780.                                             if (cont < 1 || idg != idu)
  1781.                                             {
  1782.                                                 using (DatabaseClient @class3 = Phoenix.GetDatabase().GetClient())
  1783.                                                 {
  1784.                                                     arm = @class3.ReadInt32("SELECT arm FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1785.                                                     hp = @class3.ReadInt32("SELECT hp FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1786.                                                     hpmax = @class3.ReadInt32("SELECT hpmax FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1787.  
  1788.  
  1789.  
  1790.                                                     if (arm < 1)
  1791.                                                     {
  1792.                                                         if (hp - hpa < 0)
  1793.                                                         {
  1794.                                                             hpa = hp;
  1795.                                                         }
  1796.  
  1797.                                                         @class3.ExecuteQuery("UPDATE users SET hp=hp-'" + hpa + "' WHERE id='" + RoomUser_1.GetClient().GetHabbo().Id + "'");
  1798.                                                         if (cont > 0)
  1799.                                                         {
  1800.                                                             RoomUser_1.GetClient().GetHabbo().method_28("Torretta di " + nomeg + " [-" + hpa + " HP]");
  1801.                                                         }
  1802.  
  1803.  
  1804.                                                         else {
  1805.                                                             RoomUser_1.GetClient().GetHabbo().method_28("Torretta [-" + hpa + " HP]");
  1806.                                                         }
  1807.                                                         stato = @class3.ReadInt32("SELECT hp FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1808.  
  1809.                                                     }
  1810.  
  1811.                                                     else
  1812.                                                     {
  1813.                                                         if (arm - hpa < 0)
  1814.                                                         {
  1815.                                                             hpa = arm;
  1816.                                                         }
  1817.  
  1818.                                                         @class3.ExecuteQuery("UPDATE users SET arm=arm-'" + hpa + "' WHERE id='" + RoomUser_1.GetClient().GetHabbo().Id + "'");
  1819.                                                         if (cont > 0)
  1820.                                                         {
  1821.                                                             RoomUser_1.GetClient().GetHabbo().method_28("Torretta di " + nomeg + " [-" + hpa + " Corazza]");
  1822.                                                         }
  1823.  
  1824.  
  1825.                                                         else {
  1826.                                                             RoomUser_1.GetClient().GetHabbo().method_28("Torretta [-" + hpa + " Corazza]");
  1827.                                                         }
  1828.                                                     }
  1829.  
  1830.  
  1831.                                                 }
  1832.                                                 if (stato == 0)
  1833.                                                 {
  1834.                                                     GameClient @class1 = null;
  1835.                                                     @class1 = Phoenix.GetGame().GetClientManager().method_2(RoomUser_1.GetClient().GetHabbo().Id);
  1836.  
  1837.                                                     ServerMessage Message5 = new ServerMessage(286u);
  1838.                                                     Message5.AppendBoolean(@class1.GetHabbo().Class14_0.Boolean_3);
  1839.                                                     Message5.AppendUInt(59251);
  1840.                                                     @class1.SendMessage(Message5);
  1841.  
  1842.                                                 }
  1843.                                             }
  1844.                                             }
  1845.                                         else
  1846.                                         {
  1847.                                             list2.Remove(current);
  1848.                                         }
  1849.                                     }
  1850.                                 }
  1851.                                 RoomItem_0.string_3 = string.Join(",", list2.ToArray());
  1852.                                  
  1853.  
  1854.  
  1855.                                
  1856.  
  1857.  
  1858.                                
  1859.                                
  1860.  
  1861.                             }
  1862.                             break;
  1863.  
  1864.                         case "torrettau":
  1865.                            
  1866.                             if (RoomItem_0.string_3.Length > 0)
  1867.                             {
  1868.                                 string[] collection = RoomItem_0.string_3.Split(new char[]
  1869.                             {
  1870.                                 ','
  1871.                             });
  1872.                                 List<string> list = new List<string>(collection);
  1873.                                 List<string> list2 = list;
  1874.                                 foreach (string current in list)
  1875.                                 {
  1876.                                     if (!(current != string_10))
  1877.                                     {
  1878.                                         RoomItem @class = this.method_28(Convert.ToUInt32(string_10));
  1879.                                         if (@class != null)
  1880.                                         {
  1881.                                             int danno;
  1882.                                             int munizioni;
  1883.                                          
  1884.                                             using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  1885.                                             {
  1886.                                                 danno = @class2.ReadInt32("SELECT danno FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  1887.                                                
  1888.  
  1889.                                                
  1890.                                             }
  1891.                                             using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  1892.                                             {
  1893.                                                 munizioni = @class2.ReadInt32("SELECT munizioni FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  1894.  
  1895.                                             }
  1896.  
  1897.  
  1898.                                            
  1899.                                                 int hpa = danno;
  1900.                                                 int hpmax;
  1901.                                                 int hp;
  1902.                                                 int stato = 1;
  1903.                                                 int cont;
  1904.                                                 int idg = 0;
  1905.                                                 int idu = 0;
  1906.                                                 int arm;
  1907.                                                 string nomeg = "";
  1908.                                                 using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  1909.                                                 {
  1910.                                                     cont = @class2.ReadInt32("SELECT COUNT(id) FROM groups WHERE roomid = " + RoomUser_1.GetClient().GetHabbo().CurrentRoomId + " LIMIT 1;");
  1911.                                                     if (cont > 0)
  1912.                                                     {
  1913.                                                         idg = @class2.ReadInt32("SELECT id FROM groups WHERE roomid = " + RoomUser_1.GetClient().GetHabbo().CurrentRoomId + " LIMIT 1;");
  1914.                                                         idu = @class2.ReadInt32("SELECT groupid FROM user_stats WHERE id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1915.                                                         nomeg = @class2.ReadString("SELECT name FROM groups WHERE id = " + idg + " LIMIT 1;");
  1916.                                                    
  1917.                                                 }
  1918.                                                 }
  1919.                                                 if (cont < 1 || idg != idu)
  1920.                                                 {
  1921.                                                 if (munizioni > 0)
  1922.                                                 {
  1923.                                                     using (DatabaseClient @class3 = Phoenix.GetDatabase().GetClient())
  1924.                                                     {
  1925.                                                         arm = @class3.ReadInt32("SELECT arm FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1926.                                                         hp = @class3.ReadInt32("SELECT hp FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1927.                                                         hpmax = @class3.ReadInt32("SELECT hpmax FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1928.  
  1929.  
  1930.  
  1931.                                                         if (arm < 1)
  1932.                                                         {
  1933.                                                             if (hp - hpa < 0)
  1934.                                                             {
  1935.                                                                 hpa = hp;
  1936.                                                             }
  1937.                                                            
  1938.                                                             @class3.ExecuteQuery("UPDATE items SET munizioni=munizioni-1 WHERE id='" + RoomItem_0.uint_0 + "'");
  1939.                                                            
  1940.                                                             @class3.ExecuteQuery("UPDATE users SET hp=hp-'" + hpa + "' WHERE id='" + RoomUser_1.GetClient().GetHabbo().Id + "'");
  1941.                                                             if (cont > 0)
  1942.                                                             {
  1943.                                                                 RoomUser_1.GetClient().GetHabbo().method_28("Torretta di " + nomeg + " [-" + hpa + " HP]");
  1944.                                                             }
  1945.  
  1946.  
  1947.                                                             else {
  1948.                                                                 RoomUser_1.GetClient().GetHabbo().method_28("Torretta [-" + hpa + " HP]");
  1949.                                                             }
  1950.                                                             stato = @class3.ReadInt32("SELECT hp FROM users WHERE Id = " + RoomUser_1.GetClient().GetHabbo().Id + " LIMIT 1;");
  1951.  
  1952.                                                         }
  1953.  
  1954.                                                         else
  1955.                                                         {
  1956.                                                             if (arm - hpa < 0)
  1957.                                                             {
  1958.                                                                 hpa = arm;
  1959.                                                             }
  1960.  
  1961.                                                             @class3.ExecuteQuery("UPDATE users SET arm=arm-'" + hpa + "' WHERE id='" + RoomUser_1.GetClient().GetHabbo().Id + "'");
  1962.                                                             if (cont > 0)
  1963.                                                             {
  1964.                                                                 RoomUser_1.GetClient().GetHabbo().method_28("Torretta di " + nomeg + " [-" + hpa + " Corazza]");
  1965.                                                             }
  1966.  
  1967.  
  1968.                                                             else {
  1969.                                                                 RoomUser_1.GetClient().GetHabbo().method_28("Torretta [-" + hpa + " Corazza]");
  1970.                                                             }
  1971.                                                         }
  1972.  
  1973.  
  1974.                                                     }
  1975.                                                     if (stato == 0)
  1976.                                                     {
  1977.                                                         int exp;
  1978.                                                         int expx;
  1979.                                                         int liv;
  1980.                                                         int basei;
  1981.  
  1982.                                                         using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  1983.                                                         {
  1984.                                                             exp = @class2.ReadInt32("SELECT exp FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  1985.                                                             expx = @class2.ReadInt32("SELECT expx FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  1986.                                                             liv = @class2.ReadInt32("SELECT liv FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  1987.                                                             basei = @class2.ReadInt32("SELECT base_item FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  1988.                                                             if (liv != 3) {
  1989.                                                                 if (exp + 10 >= expx)
  1990.                                                                 {
  1991.  
  1992.                                                                     uint baze = Convert.ToUInt32(basei);
  1993.                                                                     string lal = "";
  1994.                                                                     RoomItem RoomItem_;
  1995.                                                                     Room @class12 = Phoenix.GetGame().GetRoomManager().GetRoom(RoomUser_1.GetClient().GetHabbo().CurrentRoomId);
  1996.                                                                     @class12.method_29(RoomUser_1.GetClient(), RoomItem_0.uint_0, false, true);
  1997.                                                                     RoomUser_1.GetClient().GetHabbo().method_23().method_11(RoomItem_0.uint_0, baze, lal, false);
  1998.                                                                     RoomUser_1.GetClient().GetHabbo().method_23().method_9(true);
  1999.                                                                     @class2.ExecuteQuery("UPDATE items SET liv=liv+1 WHERE id='" + RoomItem_0.uint_0 + "'");
  2000.                                                                     @class2.ExecuteQuery("UPDATE items SET base_item=base_item+1 WHERE id='" + RoomItem_0.uint_0 + "'");
  2001.                                                                     baze = baze + 1;
  2002.                                                                     @class2.ExecuteQuery("UPDATE items SET expx=expx+200 WHERE id='" + RoomItem_0.uint_0 + "'");
  2003.                                                                     @class2.ExecuteQuery("INSERT INTO notifiche (userid,groupid,text,descr) VALUES ('0','" + idg + "','Toretta Evoluta!','Toretta evoluta alla base!');");
  2004.                                                                     int exps = (exp + 10) - expx;
  2005.                                                                     int dannox = danno * 2;
  2006.                                                                     @class2.ExecuteQuery("UPDATE items SET exp='" + exps + "' WHERE id='" + RoomItem_0.uint_0 + "'");
  2007.                                                                     @class2.ExecuteQuery("UPDATE items SET focus='0' WHERE id='" + RoomItem_0.uint_0 + "'");
  2008.                                                                     @class2.ExecuteQuery("UPDATE items SET danno='" + dannox + "' WHERE id='" + RoomItem_0.uint_0 + "'");
  2009.  
  2010.                                                                     RoomItem_ = new RoomItem(RoomItem_0.uint_0, @class12.Id, baze, lal, 0, 0, 0.0, 0, "", @class12);
  2011.  
  2012.                                                                     if (@class12.method_79(RoomUser_1.GetClient(), RoomItem_, RoomItem_0.Int32_0, RoomItem_0.Int32_1, 0, true, false, false))
  2013.                                                                     {
  2014.                                                                         RoomUser_1.GetClient().GetHabbo().method_23().method_12(RoomItem_0.uint_0, 1u, false);
  2015.                                                                         using (DatabaseClient class3 = Phoenix.GetDatabase().GetClient())
  2016.                                                                         {
  2017.                                                                             class3.ExecuteQuery(string.Concat(new object[]
  2018.                                                                             {
  2019.                                                                               "UPDATE items SET room_id = '",
  2020.                                                                                 @class12.Id,
  2021.                                                                                 "' WHERE Id = '",
  2022.                                                                                  RoomItem_0.uint_0,
  2023.                                                                                 "' LIMIT 1"
  2024.                                                                             }));
  2025.                                                                         }
  2026.                                                                     }
  2027.  
  2028.  
  2029.                                                                  
  2030.                                                                        
  2031.                                                                    
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.                                                                 }
  2045.  
  2046.  
  2047.                                                                 else
  2048.                                                                 {
  2049.                                                                    
  2050.                                                                     @class2.ExecuteQuery("UPDATE items SET exp=exp+10 WHERE id='" + RoomItem_0.uint_0 + "'");
  2051.                                                                 }
  2052.                                                         }
  2053.                                                     }
  2054.                                                         GameClient @class1 = null;
  2055.                                                         @class1 = Phoenix.GetGame().GetClientManager().method_2(RoomUser_1.GetClient().GetHabbo().Id);
  2056.  
  2057.                                                         ServerMessage Message5 = new ServerMessage(286u);
  2058.                                                         Message5.AppendBoolean(@class1.GetHabbo().Class14_0.Boolean_3);
  2059.                                                         Message5.AppendUInt(59251);
  2060.                                                         @class1.SendMessage(Message5);
  2061.  
  2062.                                                     }
  2063.                                                 }
  2064.  
  2065.                                                 else
  2066.                                                 {
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.                                                     if (cont > 0)
  2073.                                                     {
  2074.                                                         RoomUser_1.GetClient().GetHabbo().method_28("Torretta di " + nomeg + " [Munizioni terminate]");
  2075.                                                        
  2076.                                                         using (DatabaseClient @class2 = Phoenix.GetDatabase().GetClient())
  2077.                                                         {
  2078.                                                             int scarica;
  2079.                                                             scarica = @class2.ReadInt32("SELECT scarica FROM items WHERE id = " + RoomItem_0.uint_0 + " LIMIT 1;");
  2080.                                                             if (scarica == 0)
  2081.                                                             {
  2082.                                                                 @class2.ExecuteQuery("INSERT INTO notifiche (userid,groupid,text,descr) VALUES ('0','" + idg + "','Toretta scarica!','Toretta scarica alla base!');");
  2083.                                                                 @class2.ExecuteQuery("UPDATE items SET scarica='1' WHERE id='" + RoomItem_0.uint_0 + "'");
  2084.                                                             }
  2085.                                                         }
  2086.  
  2087.                                                         }
  2088.  
  2089.  
  2090.                                                     else {
  2091.                                                         RoomUser_1.GetClient().GetHabbo().method_28("Torretta [Munizioni terminate]");
  2092.                                                     }
  2093.                                                 }
  2094.  
  2095.  
  2096.                                             }
  2097.  
  2098.                                            
  2099.                                         }
  2100.  
  2101.                                            
  2102.                                         else
  2103.                                         {
  2104.                                             list2.Remove(current);
  2105.                                         }
  2106.                                     }
  2107.                                 }
  2108.                                 RoomItem_0.string_3 = string.Join(",", list2.ToArray());
  2109.  
  2110.  
  2111.  
  2112.  
  2113.                             }
  2114.                             break;
  2115.                         case "wf_trg_offfurni":
  2116.                             if (RoomItem_0.string_3.Length > 0)
  2117.                             {
  2118.                                 string[] collection = RoomItem_0.string_3.Split(new char[]
  2119.                             {
  2120.                                 ','
  2121.                             });
  2122.                                 List<string> list = new List<string>(collection);
  2123.                                 List<string> list2 = list;
  2124.                                 foreach (string current in list)
  2125.                                 {
  2126.                                     if (!(current != string_10))
  2127.                                     {
  2128.                                         RoomItem @class = this.method_28(Convert.ToUInt32(string_10));
  2129.                                         if (@class != null)
  2130.                                         {
  2131.                                             flag = true;
  2132.                                         }
  2133.                                         else
  2134.                                         {
  2135.                                             list2.Remove(current);
  2136.                                         }
  2137.                                     }
  2138.                                 }
  2139.                                 RoomItem_0.string_3 = string.Join(",", list2.ToArray());
  2140.                             }
  2141.                             break;
  2142.                         case "wf_trg_gameend":
  2143.                             if (string_10 == "GameEnded")
  2144.                             {
  2145.                                 flag = true;
  2146.                             }
  2147.                             break;
  2148.                         case "wf_trg_gamestart":
  2149.                             if (string_10 == "GameBegun")
  2150.                             {
  2151.                                 flag = true;
  2152.                             }
  2153.                             break;
  2154.                         case "wf_trg_timer":
  2155.                             if (string_10 == "Timer")
  2156.                             {
  2157.                                 flag = true;
  2158.                             }
  2159.                             break;
  2160.                         case "wf_trg_attime":
  2161.                             if (string_10 == "AtTime")
  2162.                             {
  2163.                                 flag = true;
  2164.                             }
  2165.                             break;
  2166.                         case "wf_trg_atscore":
  2167.                             if (string_10 == "TheScore")
  2168.                             {
  2169.                                 flag = true;
  2170.                             }
  2171.                             break;
  2172.                     }
  2173.                     try
  2174.                     {
  2175.                         List<RoomItem> list3 = this.method_93(RoomItem_0.Int32_0, RoomItem_0.Int32_1);
  2176.                         if (list3 == null)
  2177.                         {
  2178.                             result = false;
  2179.                             return result;
  2180.                         }
  2181.                         foreach (RoomItem current2 in list3)
  2182.                         {
  2183.                             text = current2.GetBaseItem().InteractionType.ToLower();
  2184.                             if (text != null)
  2185.                             {
  2186.                                 int num4;
  2187.                                 if (!(text == "wf_cnd_phx"))
  2188.                                 {
  2189.                                     if (!(text == "wf_cnd_trggrer_on_frn"))
  2190.                                     {
  2191.                                         string[] collection;
  2192.                                         List<string> list;
  2193.                                         List<RoomItem> list4;
  2194.                                         if (!(text == "wf_cnd_furnis_hv_avtrs"))
  2195.                                         {
  2196.                                             if (!(text == "wf_cnd_has_furni_on"))
  2197.                                             {
  2198.                                                 continue;
  2199.                                             }
  2200.                                             num4 = num2;
  2201.                                             num++;
  2202.                                             current2.ExtraData = "1";
  2203.                                             current2.UpdateState(false, true);
  2204.                                             current2.ReqUpdate(1);
  2205.                                             current2.method_10();
  2206.                                             if (current2.string_3.Length <= 0)
  2207.                                             {
  2208.                                                 continue;
  2209.                                             }
  2210.                                             collection = current2.string_3.Split(new char[]
  2211.                                             {
  2212.                                                 ','
  2213.                                             });
  2214.                                             list = new List<string>(collection);
  2215.                                             list4 = new List<RoomItem>();
  2216.                                             foreach (string current3 in list)
  2217.                                             {
  2218.                                                 list4.Add(this.method_28(Convert.ToUInt32(current3)));
  2219.                                             }
  2220.                                             using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
  2221.                                             {
  2222.                                                 while (enumerator3.MoveNext())
  2223.                                                 {
  2224.                                                     RoomItem current4 = enumerator3.Current;
  2225.                                                     if (current4 != null)
  2226.                                                     {
  2227.                                                         Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0;
  2228.                                                         if (dictionary == null)
  2229.                                                         {
  2230.                                                             dictionary = new Dictionary<int, AffectedTile>();
  2231.                                                         }
  2232.                                                         List<RoomItem> list5 = new List<RoomItem>(this.method_45(current4.Int32_0, current4.Int32_1));
  2233.                                                         if (list5.Count > 1 && num4 + 1 != num2)
  2234.                                                         {
  2235.                                                             num2++;
  2236.                                                             break;
  2237.                                                         }
  2238.                                                         foreach (AffectedTile current5 in dictionary.Values)
  2239.                                                         {
  2240.                                                             list5 = new List<RoomItem>(this.method_45(current5.Int32_0, current5.Int32_1));
  2241.                                                             if (list5.Count > 1 && num4 + 1 != num2)
  2242.                                                             {
  2243.                                                                 num2++;
  2244.                                                                 break;
  2245.                                                             }
  2246.                                                         }
  2247.                                                     }
  2248.                                                 }
  2249.                                                 continue;
  2250.                                             }
  2251.                                         }
  2252.                                         num++;
  2253.                                         current2.ExtraData = "1";
  2254.                                         current2.UpdateState(false, true);
  2255.                                         current2.ReqUpdate(1);
  2256.                                         current2.method_10();
  2257.                                         if (current2.string_3.Length <= 0)
  2258.                                         {
  2259.                                             continue;
  2260.                                         }
  2261.                                         collection = current2.string_3.Split(new char[]
  2262.                                         {
  2263.                                             ','
  2264.                                         });
  2265.                                         list = new List<string>(collection);
  2266.                                         list4 = new List<RoomItem>();
  2267.                                         foreach (string current3 in list)
  2268.                                         {
  2269.                                             list4.Add(this.method_28(Convert.ToUInt32(current3)));
  2270.                                         }
  2271.                                         bool flag3 = true;
  2272.                                         foreach (RoomItem current4 in list4)
  2273.                                         {
  2274.                                             if (current4 != null)
  2275.                                             {
  2276.                                                 bool flag4 = false;
  2277.                                                 Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0;
  2278.                                                 if (dictionary == null)
  2279.                                                 {
  2280.                                                     dictionary = new Dictionary<int, AffectedTile>();
  2281.                                                 }
  2282.                                                 if (this.method_96(current4.Int32_0, current4.Int32_1))
  2283.                                                 {
  2284.                                                     flag4 = true;
  2285.                                                 }
  2286.                                                 foreach (AffectedTile current5 in dictionary.Values)
  2287.                                                 {
  2288.                                                     if (this.method_96(current5.Int32_0, current5.Int32_1))
  2289.                                                     {
  2290.                                                         flag4 = true;
  2291.                                                         break;
  2292.                                                     }
  2293.                                                 }
  2294.                                                 if (!flag4)
  2295.                                                 {
  2296.                                                     flag3 = false;
  2297.                                                 }
  2298.                                             }
  2299.                                         }
  2300.                                         if (flag3)
  2301.                                         {
  2302.                                             num2++;
  2303.                                             continue;
  2304.                                         }
  2305.                                         continue;
  2306.                                     }
  2307.                                     else
  2308.                                     {
  2309.                                         num4 = num2;
  2310.                                         num++;
  2311.                                         current2.ExtraData = "1";
  2312.                                         current2.UpdateState(false, true);
  2313.                                         current2.ReqUpdate(1);
  2314.                                         current2.method_10();
  2315.                                         if (current2.string_3.Length <= 0)
  2316.                                         {
  2317.                                             continue;
  2318.                                         }
  2319.                                         string[] collection = current2.string_3.Split(new char[]
  2320.                                         {
  2321.                                             ','
  2322.                                         });
  2323.                                         List<string> list = new List<string>(collection);
  2324.                                         List<RoomItem> list4 = new List<RoomItem>();
  2325.                                         foreach (string current3 in list)
  2326.                                         {
  2327.                                             list4.Add(this.method_28(Convert.ToUInt32(current3)));
  2328.                                         }
  2329.                                         if (RoomUser_1 == null)
  2330.                                         {
  2331.                                             continue;
  2332.                                         }
  2333.                                         using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
  2334.                                         {
  2335.                                             while (enumerator3.MoveNext())
  2336.                                             {
  2337.                                                 RoomItem current4 = enumerator3.Current;
  2338.                                                 if (current4 != null)
  2339.                                                 {
  2340.                                                     Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0;
  2341.                                                     if (dictionary == null)
  2342.                                                     {
  2343.                                                         dictionary = new Dictionary<int, AffectedTile>();
  2344.                                                     }
  2345.                                                     if (RoomUser_1.int_3 == current4.Int32_0 && RoomUser_1.int_4 == current4.Int32_1 && num4 + 1 != num2)
  2346.                                                     {
  2347.                                                         num2++;
  2348.                                                         break;
  2349.                                                     }
  2350.                                                     foreach (AffectedTile current5 in dictionary.Values)
  2351.                                                     {
  2352.                                                         if (RoomUser_1.int_3 == current5.Int32_0 && RoomUser_1.int_4 == current5.Int32_1 && num4 + 1 != num2)
  2353.                                                         {
  2354.                                                             num2++;
  2355.                                                             break;
  2356.                                                         }
  2357.                                                     }
  2358.                                                 }
  2359.                                             }
  2360.                                             continue;
  2361.                                         }
  2362.                                     }
  2363.                                 }
  2364.                                 num4 = num2;
  2365.                                 num++;
  2366.                                 current2.ExtraData = "1";
  2367.                                 current2.UpdateState(false, true);
  2368.                                 current2.ReqUpdate(1);
  2369.                                 if (current2.string_2.Length > 0)
  2370.                                 {
  2371.                                     string string_11 = current2.string_2.Split(new char[]
  2372.                                     {
  2373.                                         ':'
  2374.                                     })[0].ToLower();
  2375.                                     string string_12 = current2.string_2.Split(new char[]
  2376.                                     {
  2377.                                         ':'
  2378.                                     })[1];
  2379.                                     if (RoomUser_1 != null)
  2380.                                     {
  2381.                                         if (!RoomUser_1.Boolean_4 && this.method_18(RoomUser_1, string_11, string_12))
  2382.                                         {
  2383.                                             num2++;
  2384.                                         }
  2385.                                     }
  2386.                                     else
  2387.                                     {
  2388.                                         RoomUser[] array = this.RoomUser_0;
  2389.                                         for (int i = 0; i < array.Length; i++)
  2390.                                         {
  2391.                                             RoomUser class2 = array[i];
  2392.                                             if (class2 != null && !class2.Boolean_4 && this.method_18(class2, string_11, string_12) && num4 + 1 != num2)
  2393.                                             {
  2394.                                                 num2++;
  2395.                                                 break;
  2396.                                             }
  2397.                                         }
  2398.                                     }
  2399.                                 }
  2400.                             }
  2401.                         }
  2402.                         if (num != num2)
  2403.                         {
  2404.                             result = false;
  2405.                             return result;
  2406.                         }
  2407.                     }
  2408.                     catch
  2409.                     {
  2410.                     }
  2411.                     if (flag && num == num2)
  2412.                     {
  2413.                         RoomItem_0.ExtraData = "1";
  2414.                         RoomItem_0.UpdateState(false, true);
  2415.                         RoomItem_0.ReqUpdate(1);
  2416.                         List<RoomItem> list6 = this.method_93(RoomItem_0.Int32_0, RoomItem_0.Int32_1);
  2417.                         if (list6 == null)
  2418.                         {
  2419.                             result = false;
  2420.                             return result;
  2421.                         }
  2422.                         bool flag5 = false;
  2423.                         foreach (RoomItem current2 in list6)
  2424.                         {
  2425.                             if (current2.GetBaseItem().InteractionType.ToLower() == "wf_xtra_random")
  2426.                             {
  2427.                                 flag5 = true;
  2428.                                 break;
  2429.                             }
  2430.                         }
  2431.                         if (flag5)
  2432.                         {
  2433.                             List<RoomItem> list7 = new List<RoomItem>();
  2434.                             Random random = new Random();
  2435.                             while (list6.Count != 0)
  2436.                             {
  2437.                                 int index = random.Next(0, list6.Count);
  2438.                                 list7.Add(list6[index]);
  2439.                                 list6.RemoveAt(index);
  2440.                             }
  2441.                             list6 = list7;
  2442.                         }
  2443.                         foreach (RoomItem current2 in list6)
  2444.                         {
  2445.                             if (flag5 && flag2)
  2446.                             {
  2447.                                 break;
  2448.                             }
  2449.                             text = current2.GetBaseItem().InteractionType.ToLower();
  2450.                             switch (text)
  2451.                             {
  2452.                                 case "wf_act_give_phx":
  2453.                                     current2.ExtraData = "1";
  2454.                                     current2.UpdateState(false, true);
  2455.                                     current2.ReqUpdate(1);
  2456.                                     if (current2.string_2.Length > 0)
  2457.                                     {
  2458.                                         string string_11 = current2.string_2.Split(new char[]
  2459.                                     {
  2460.                                         ':'
  2461.                                     })[0].ToLower();
  2462.                                         string string_12 = current2.string_2.Split(new char[]
  2463.                                     {
  2464.                                         ':'
  2465.                                     })[1];
  2466.                                         if (RoomUser_1 != null)
  2467.                                         {
  2468.                                             if (!RoomUser_1.Boolean_4)
  2469.                                             {
  2470.                                                 this.method_19(RoomUser_1, string_11, string_12);
  2471.                                             }
  2472.                                         }
  2473.                                         else
  2474.                                         {
  2475.                                             RoomUser[] array = this.RoomUser_0;
  2476.                                             for (int i = 0; i < array.Length; i++)
  2477.                                             {
  2478.                                                 RoomUser class2 = array[i];
  2479.                                                 if (class2 != null && !class2.Boolean_4)
  2480.                                                 {
  2481.                                                     this.method_19(class2, string_11, string_12);
  2482.                                                 }
  2483.                                             }
  2484.                                         }
  2485.                                         flag2 = true;
  2486.                                     }
  2487.                                     break;
  2488.                                 case "wf_act_saymsg":
  2489.                                     current2.ExtraData = "1";
  2490.                                     current2.UpdateState(false, true);
  2491.                                     current2.ReqUpdate(1);
  2492.                                     if (current2.string_2.Length > 0)
  2493.                                     {
  2494.                                         string text2 = current2.string_2;
  2495.                                         text2 = ChatCommandHandler.smethod_4(text2);
  2496.                                         if (text2.Length > 100)
  2497.                                         {
  2498.                                             text2 = text2.Substring(0, 100);
  2499.                                         }
  2500.                                         if (RoomUser_1 != null)
  2501.                                         {
  2502.                                             if (!RoomUser_1.Boolean_4)
  2503.                                             {
  2504.                                                 RoomUser_1.GetClient().GetHabbo().method_28(text2);
  2505.                                             }
  2506.                                         }
  2507.                                         else
  2508.                                         {
  2509.                                             RoomUser[] array = this.RoomUser_0;
  2510.                                             for (int i = 0; i < array.Length; i++)
  2511.                                             {
  2512.                                                 RoomUser class2 = array[i];
  2513.                                                 if (class2 != null && !class2.Boolean_4)
  2514.                                                 {
  2515.                                                     class2.GetClient().GetHabbo().method_28(text2);
  2516.                                                 }
  2517.                                             }
  2518.                                         }
  2519.                                         flag2 = true;
  2520.                                     }
  2521.                                     break;
  2522.                                 case "wf_act_moveuser":
  2523.                                     current2.ExtraData = "1";
  2524.                                     current2.UpdateState(false, true);
  2525.                                     current2.ReqUpdate(1);
  2526.                                     current2.method_10();
  2527.                                     if (current2.string_3.Length > 0)
  2528.                                     {
  2529.                                         string[] collection = current2.string_3.Split(new char[]
  2530.                                     {
  2531.                                         ','
  2532.                                     });
  2533.                                         List<string> list = new List<string>(collection);
  2534.                                         Random random2 = new Random();
  2535.                                         int num5 = random2.Next(0, list.Count - 1);
  2536.                                         RoomItem class3 = this.method_28(Convert.ToUInt32(list[num5]));
  2537.                                         if (class3 != null)
  2538.                                         {
  2539.                                             if (RoomUser_1 != null)
  2540.                                             {
  2541.                                                 this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1;
  2542.                                                 this.byte_0[RoomUser_1.int_12, RoomUser_1.int_13] = 1;
  2543.                                                 this.byte_0[class3.Int32_0, class3.Int32_1] = 1;
  2544.                                                 RoomUser_1.bool_6 = false;
  2545.                                                 RoomUser_1.int_12 = class3.Int32_0;
  2546.                                                 RoomUser_1.int_13 = class3.Int32_1;
  2547.                                                 RoomUser_1.double_1 = class3.Double_0;
  2548.                                                 RoomUser_1.method_7(class3.Int32_0, class3.Int32_1, class3.Double_0);
  2549.                                                 RoomUser_1.bool_7 = true;
  2550.                                                 if (!current2.dictionary_1.ContainsKey(RoomUser_1))
  2551.                                                 {
  2552.                                                     current2.dictionary_1.Add(RoomUser_1, 10);
  2553.                                                 }
  2554.                                                 if (RoomUser_1.class34_1 != null)
  2555.                                                 {
  2556.                                                     RoomUser_1.class34_1.RoomUser_0 = null;
  2557.                                                     RoomUser_1.RoomUser_0 = null;
  2558.                                                     RoomUser_1.class34_1 = null;
  2559.                                                 }
  2560.                                                 this.method_87(RoomUser_1, true, false);
  2561.                                             }
  2562.                                             else
  2563.                                             {
  2564.                                                 RoomUser[] array = this.RoomUser_0;
  2565.                                                 for (int i = 0; i < array.Length; i++)
  2566.                                                 {
  2567.                                                     RoomUser class2 = array[i];
  2568.                                                     if (class2 != null)
  2569.                                                     {
  2570.                                                         this.byte_0[class2.int_3, class2.int_4] = 1;
  2571.                                                         this.byte_0[class3.Int32_0, class3.Int32_1] = 1;
  2572.                                                         class2.method_7(class3.Int32_0, class3.Int32_1, class3.Double_0);
  2573.                                                         class2.bool_7 = true;
  2574.                                                         if (!current2.dictionary_1.ContainsKey(class2))
  2575.                                                         {
  2576.                                                             current2.dictionary_1.Add(class2, 10);
  2577.                                                         }
  2578.                                                     }
  2579.                                                 }
  2580.                                             }
  2581.                                             flag2 = true;
  2582.                                         }
  2583.                                     }
  2584.                                     break;
  2585.                                 case "wf_act_togglefurni":
  2586.                                     current2.ExtraData = "1";
  2587.                                     current2.UpdateState(false, true);
  2588.                                     current2.ReqUpdate(1);
  2589.                                     if (current2.string_3.Length > 0)
  2590.                                     {
  2591.                                         string[] collection = current2.string_3.Split(new char[]
  2592.                                     {
  2593.                                         ','
  2594.                                     });
  2595.                                         IEnumerable<string> enumerable = new List<string>(collection);
  2596.                                         List<string> list2 = enumerable.ToList<string>();
  2597.                                         foreach (string current in enumerable)
  2598.                                         {
  2599.                                             RoomItem class3 = this.method_28(Convert.ToUInt32(current));
  2600.                                             if (class3 != null)
  2601.                                             {
  2602.                                                 class3.Class69_0.OnTrigger(null, class3, 0, true);
  2603.                                             }
  2604.                                             else
  2605.                                             {
  2606.                                                 list2.Remove(current);
  2607.                                             }
  2608.                                         }
  2609.                                         flag2 = true;
  2610.                                     }
  2611.                                     break;
  2612.                                 case "wf_act_givepoints":
  2613.                                     current2.ExtraData = "1";
  2614.                                     current2.UpdateState(false, true);
  2615.                                     current2.ReqUpdate(1);
  2616.                                     if (RoomUser_1 != null && current2.string_2.Length > 0)
  2617.                                     {
  2618.                                         this.method_88(RoomUser_1.int_14 + 2, Convert.ToInt32(current2.string_2), current2);
  2619.                                         flag2 = true;
  2620.                                     }
  2621.                                     break;
  2622.                                     //quo
  2623.                                 case "wf_act_moverotate":
  2624.                                     current2.ExtraData = "1";
  2625.                                     current2.UpdateState(false, true);
  2626.                                     current2.ReqUpdate(1);
  2627.                                     current2.method_9();
  2628.                                     if (current2.string_4.Length > 0)
  2629.                                     {
  2630.                                         string[] collection = current2.string_4.Split(new char[]
  2631.                                     {
  2632.                                         ','
  2633.                                     });
  2634.                                         IEnumerable<string> enumerable2 = new List<string>(collection);
  2635.                                         foreach (string current in enumerable2)
  2636.                                         {
  2637.                                             RoomItem class3 = this.method_28(Convert.ToUInt32(current));
  2638.                                             if (class3 != null)
  2639.                                             {
  2640.                                                 if (current2.string_2 != "0" && current2.string_2 != "")
  2641.                                                 {
  2642.                                                     ThreeDCoord gstruct1_ = class3.GStruct1_1;
  2643.                                                     int num5 = 0;
  2644.                                                     int num6 = 0;
  2645.                                                     int num7 = 0;
  2646.                                                     if (current2.string_2 == "1")
  2647.                                                     {
  2648.                                                         Random random3 = new Random();
  2649.                                                         num5 = random3.Next(1, 5);
  2650.                                                     }
  2651.                                                     else
  2652.                                                     {
  2653.                                                         if (current2.string_2 == "2")
  2654.                                                         {
  2655.                                                             Random random3 = new Random();
  2656.                                                             num6 = random3.Next(1, 3);
  2657.                                                         }
  2658.                                                         else
  2659.                                                         {
  2660.                                                             if (current2.string_2 == "3")
  2661.                                                             {
  2662.                                                                 Random random3 = new Random();
  2663.                                                                 num7 = random3.Next(1, 3);
  2664.                                                             }
  2665.                                                         }
  2666.                                                     }
  2667.                                                     if (current2.string_2 == "4" || num5 == 1 || num7 == 1)
  2668.                                                     {
  2669.                                                         gstruct1_ = class3.method_1(4);
  2670.                                                     }
  2671.                                                     else
  2672.                                                     {
  2673.                                                         if (current2.string_2 == "5" || num5 == 2 || num6 == 1)
  2674.                                                         {
  2675.                                                             gstruct1_ = class3.method_1(6);
  2676.                                                         }
  2677.                                                         else
  2678.                                                         {
  2679.                                                             if (current2.string_2 == "6" || num5 == 3 || num7 == 2)
  2680.                                                             {
  2681.                                                                 gstruct1_ = class3.method_1(0);
  2682.                                                             }
  2683.                                                             else
  2684.                                                             {
  2685.                                                                 if (current2.string_2 == "7" || num5 == 4 || num6 == 2)
  2686.                                                                 {
  2687.                                                                     gstruct1_ = class3.method_1(2);
  2688.                                                                 }
  2689.                                                             }
  2690.                                                         }
  2691.                                                     }
  2692.                                                     if (this.method_37(gstruct1_.x, gstruct1_.y, true, true, false, true, false) && class3.GetBaseItem().InteractionType != "wf_trg_timer")
  2693.                                                     {
  2694.                                                         this.method_41(class3, gstruct1_, current2.uint_0, class3.Double_0);
  2695.                                                     }
  2696.                                                 }
  2697.                                                 if (current2.string_3.Length > 0 && current2.string_3 != "0" && current2.string_3 != "")
  2698.                                                 {
  2699.                                                     int num5 = 0;
  2700.                                                     if (current2.string_3 == "1")
  2701.                                                     {
  2702.                                                         num5 = class3.int_3 + 2;
  2703.                                                         if (num5 > 6)
  2704.                                                         {
  2705.                                                             num5 = 0;
  2706.                                                         }
  2707.                                                     }
  2708.                                                     else
  2709.                                                     {
  2710.                                                         if (current2.string_3 == "2")
  2711.                                                         {
  2712.                                                             num5 = class3.int_3 - 2;
  2713.                                                             if (num5 < 0)
  2714.                                                             {
  2715.                                                                 num5 = 6;
  2716.                                                             }
  2717.                                                         }
  2718.                                                         else
  2719.                                                         {
  2720.                                                             if (current2.string_3 == "3")
  2721.                                                             {
  2722.                                                                 Random random3 = new Random();
  2723.                                                                 num5 = random3.Next(1, 5);
  2724.                                                                 if (num5 == 1)
  2725.                                                                 {
  2726.                                                                     num5 = 0;
  2727.                                                                 }
  2728.                                                                 else
  2729.                                                                 {
  2730.                                                                     if (num5 == 2)
  2731.                                                                     {
  2732.                                                                         num5 = 2;
  2733.                                                                     }
  2734.                                                                     else
  2735.                                                                     {
  2736.                                                                         if (num5 == 3)
  2737.                                                                         {
  2738.                                                                             num5 = 4;
  2739.                                                                         }
  2740.                                                                         else
  2741.                                                                         {
  2742.                                                                             if (num5 == 4)
  2743.                                                                             {
  2744.                                                                                 num5 = 6;
  2745.                                                                             }
  2746.                                                                         }
  2747.                                                                     }
  2748.                                                                 }
  2749.                                                             }
  2750.                                                         }
  2751.                                                     }
  2752.                                                     if (current2.method_8().method_79(null, class3, class3.Int32_0, class3.Int32_1, num5, false, true, false))
  2753.                                                     {
  2754.                                                         flag2 = true;
  2755.                                                     }
  2756.                                                 }
  2757.                                             }
  2758.                                         }
  2759.                                         flag2 = true;
  2760.                                     }
  2761.                                     break;
  2762.                                 case "wf_act_matchfurni":
  2763.                                     current2.ExtraData = "1";
  2764.                                     current2.UpdateState(false, true);
  2765.                                     current2.ReqUpdate(1);
  2766.                                     current2.method_9();
  2767.                                     if (current2.string_4.Length > 0 && current2.string_2.Length > 0)
  2768.                                     {
  2769.                                         string[] collection = current2.string_4.Split(new char[]
  2770.                                     {
  2771.                                         ','
  2772.                                     });
  2773.                                         IEnumerable<string> enumerable = new List<string>(collection);
  2774.                                         string[] collection2 = current2.string_2.Split(new char[]
  2775.                                     {
  2776.                                         ';'
  2777.                                     });
  2778.                                         List<string> list8 = new List<string>(collection2);
  2779.                                         int num8 = 0;
  2780.                                         foreach (string current in enumerable)
  2781.                                         {
  2782.                                             RoomItem class3 = this.method_28(Convert.ToUInt32(current));
  2783.                                             if (class3 != null && !(class3.GetBaseItem().InteractionType.ToLower() == "dice"))
  2784.                                             {
  2785.                                                 string[] collection3 = list8[num8].Split(new char[]
  2786.                                             {
  2787.                                                 ','
  2788.                                             });
  2789.                                                 List<string> list9 = new List<string>(collection3);
  2790.                                                 bool flag6 = false;
  2791.                                                 bool flag7 = false;
  2792.                                                 if (current2.string_3 != "" && class3 != null)
  2793.                                                 {
  2794.                                                     int int_ = class3.Int32_0;
  2795.                                                     int int_2 = class3.Int32_1;
  2796.                                                     if (current2.string_3.StartsWith("I"))
  2797.                                                     {
  2798.                                                         class3.ExtraData = list9[4];
  2799.                                                         flag7 = true;
  2800.                                                     }
  2801.                                                     if (current2.string_3.Substring(1, 1) == "I")
  2802.                                                     {
  2803.                                                         class3.int_3 = Convert.ToInt32(list9[3]);
  2804.                                                         flag6 = true;
  2805.                                                     }
  2806.                                                     if (current2.string_3.EndsWith("I"))
  2807.                                                     {
  2808.                                                         int_ = Convert.ToInt32(list9[0]);
  2809.                                                         int_2 = Convert.ToInt32(list9[1]);
  2810.                                                         flag6 = true;
  2811.                                                     }
  2812.                                                     if (flag6)
  2813.                                                     {
  2814.                                                         this.method_40(class3, int_, int_2, current2.uint_0, class3.Double_0);
  2815.                                                     }
  2816.                                                     if (flag7)
  2817.                                                     {
  2818.                                                         class3.UpdateState(false, true);
  2819.                                                     }
  2820.                                                     this.method_22();
  2821.                                                 }
  2822.                                                 num8++;
  2823.                                             }
  2824.                                         }
  2825.                                     }
  2826.                                     flag2 = true;
  2827.                                     break;
  2828.                             }
  2829.                         }
  2830.                     }
  2831.                     result = flag2;
  2832.                 }
  2833.             }
  2834.             catch
  2835.             {
  2836.                 result = false;
  2837.             }
  2838.             return result;
  2839.         }
  2840.         internal void method_22()
  2841.         {
  2842.             this.gstruct1_0 = new ThreeDCoord[this.Class28_0.int_4, this.Class28_0.int_5];
  2843.             this.double_0 = new double[this.Class28_0.int_4, this.Class28_0.int_5];
  2844.             this.byte_2 = new byte[this.Class28_0.int_4, this.Class28_0.int_5];
  2845.             this.byte_1 = new byte[this.Class28_0.int_4, this.Class28_0.int_5];
  2846.             this.byte_0 = new byte[this.Class28_0.int_4, this.Class28_0.int_5];
  2847.             this.double_1 = new double[this.Class28_0.int_4, this.Class28_0.int_5];
  2848.             this.double_2 = new double[this.Class28_0.int_4, this.Class28_0.int_5];
  2849.             for (int i = 0; i < this.Class28_0.int_5; i++)
  2850.             {
  2851.                 for (int j = 0; j < this.Class28_0.int_4; j++)
  2852.                 {
  2853.                     this.double_0[j, i] = 0.0;
  2854.                     this.byte_0[j, i] = 0;
  2855.                     this.byte_2[j, i] = 0;
  2856.                     this.byte_1[j, i] = 0;
  2857.                     this.gstruct1_0[j, i] = new ThreeDCoord(j, i);
  2858.                     if (j == this.Class28_0.int_0 && i == this.Class28_0.int_1)
  2859.                     {
  2860.                         this.byte_0[j, i] = 3;
  2861.                     }
  2862.                     else
  2863.                     {
  2864.                         if (this.Class28_0.squareState[j, i] == SquareState.OPEN)
  2865.                         {
  2866.                             this.byte_0[j, i] = 1;
  2867.                         }
  2868.                         else
  2869.                         {
  2870.                             if (this.Class28_0.squareState[j, i] == SquareState.SEAT)
  2871.                             {
  2872.                                 this.byte_0[j, i] = 3;
  2873.                             }
  2874.                         }
  2875.                     }
  2876.                 }
  2877.             }
  2878.             foreach (RoomItem @class in this.Hashtable_0.Values)
  2879.             {
  2880.                 try
  2881.                 {
  2882.                     if (@class.GetBaseItem().Type == 's')
  2883.                     {
  2884.                         if (@class.Int32_0 >= this.Class28_0.int_4 || @class.Int32_1 >= this.Class28_0.int_5 || @class.Int32_1 < 0 || @class.Int32_0 < 0)
  2885.                         {
  2886.                             this.method_29(null, @class.uint_0, true, false);
  2887.                             GameClient class2 = Phoenix.GetGame().GetClientManager().GetClientByHabbo(this.Owner);
  2888.                             if (class2 != null)
  2889.                             {
  2890.                                 class2.GetHabbo().method_23().method_11(@class.uint_0, @class.uint_2, @class.ExtraData, true);
  2891.                             }
  2892.                         }
  2893.                         else
  2894.                         {
  2895.                             if (@class.Double_1 > this.double_1[@class.Int32_0, @class.Int32_1])
  2896.                             {
  2897.                                 this.double_1[@class.Int32_0, @class.Int32_1] = @class.Double_1;
  2898.                             }
  2899.                             if (@class.GetBaseItem().IsSeat)
  2900.                             {
  2901.                                 this.double_2[@class.Int32_0, @class.Int32_1] = @class.Double_1;
  2902.                             }
  2903.                             if (@class.GetBaseItem().Height > 0.0 || @class.GetBaseItem().EffectF != 0 || @class.GetBaseItem().EffectM != 0 || @class.GetBaseItem().IsSeat || !(@class.GetBaseItem().InteractionType.ToLower() != "bed"))
  2904.                             {
  2905.                                 if (this.double_0[@class.Int32_0, @class.Int32_1] <= @class.Double_0)
  2906.                                 {
  2907.                                     this.double_0[@class.Int32_0, @class.Int32_1] = @class.Double_0;
  2908.                                     if (@class.GetBaseItem().EffectF > 0)
  2909.                                     {
  2910.                                         this.byte_2[@class.Int32_0, @class.Int32_1] = @class.GetBaseItem().EffectF;
  2911.                                     }
  2912.                                     else
  2913.                                     {
  2914.                                         if (this.byte_1[@class.Int32_0, @class.Int32_1] != 0)
  2915.                                         {
  2916.                                             this.byte_2[@class.Int32_0, @class.Int32_1] = 0;
  2917.                                         }
  2918.                                     }
  2919.                                     if (@class.GetBaseItem().EffectM > 0)
  2920.                                     {
  2921.                                         this.byte_1[@class.Int32_0, @class.Int32_1] = @class.GetBaseItem().EffectM;
  2922.                                     }
  2923.                                     else
  2924.                                     {
  2925.                                         if (this.byte_1[@class.Int32_0, @class.Int32_1] != 0)
  2926.                                         {
  2927.                                             this.byte_1[@class.Int32_0, @class.Int32_1] = 0;
  2928.                                         }
  2929.                                     }
  2930.                                     if (@class.GetBaseItem().Walkable)
  2931.                                     {
  2932.                                         if (this.byte_0[@class.Int32_0, @class.Int32_1] != 3)
  2933.                                         {
  2934.                                             this.byte_0[@class.Int32_0, @class.Int32_1] = 1;
  2935.                                         }
  2936.                                     }
  2937.                                     else
  2938.                                     {
  2939.                                         if (@class.Double_0 <= this.Class28_0.double_1[@class.Int32_0, @class.Int32_1] + 0.1 && @class.GetBaseItem().InteractionType.ToLower() == "gate" && @class.ExtraData == "1")
  2940.                                         {
  2941.                                             if (this.byte_0[@class.Int32_0, @class.Int32_1] != 3)
  2942.                                             {
  2943.                                                 this.byte_0[@class.Int32_0, @class.Int32_1] = 1;
  2944.                                             }
  2945.                                         }
  2946.                                         else
  2947.                                         {
  2948.                                             if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  2949.                                             {
  2950.                                                 this.byte_0[@class.Int32_0, @class.Int32_1] = 3;
  2951.                                             }
  2952.                                             else
  2953.                                             {
  2954.                                                 if (this.byte_0[@class.Int32_0, @class.Int32_1] != 3)
  2955.                                                 {
  2956.                                                     this.byte_0[@class.Int32_0, @class.Int32_1] = 0;
  2957.                                                 }
  2958.                                             }
  2959.                                         }
  2960.                                     }
  2961.                                 }
  2962.                                 if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  2963.                                 {
  2964.                                     this.byte_0[@class.Int32_0, @class.Int32_1] = 3;
  2965.                                 }
  2966.                                 Dictionary<int, AffectedTile> dictionary = @class.Dictionary_0;
  2967.                                 if (dictionary == null)
  2968.                                 {
  2969.                                     dictionary = new Dictionary<int, AffectedTile>();
  2970.                                 }
  2971.                                 foreach (AffectedTile current in dictionary.Values)
  2972.                                 {
  2973.                                     if (@class.Double_1 > this.double_1[current.Int32_0, current.Int32_1])
  2974.                                     {
  2975.                                         this.double_1[current.Int32_0, current.Int32_1] = @class.Double_1;
  2976.                                     }
  2977.                                     if (@class.GetBaseItem().IsSeat)
  2978.                                     {
  2979.                                         this.double_2[current.Int32_0, current.Int32_1] = @class.Double_1;
  2980.                                     }
  2981.                                     if (this.double_0[current.Int32_0, current.Int32_1] <= @class.Double_0)
  2982.                                     {
  2983.                                         this.double_0[current.Int32_0, current.Int32_1] = @class.Double_0;
  2984.                                         if (@class.GetBaseItem().EffectF > 0)
  2985.                                         {
  2986.                                             this.byte_2[current.Int32_0, current.Int32_1] = @class.GetBaseItem().EffectF;
  2987.                                         }
  2988.                                         else
  2989.                                         {
  2990.                                             if (this.byte_1[current.Int32_0, current.Int32_1] != 0)
  2991.                                             {
  2992.                                                 this.byte_2[current.Int32_0, current.Int32_1] = 0;
  2993.                                             }
  2994.                                         }
  2995.                                         if (@class.GetBaseItem().EffectM > 0)
  2996.                                         {
  2997.                                             this.byte_1[current.Int32_0, current.Int32_1] = @class.GetBaseItem().EffectM;
  2998.                                         }
  2999.                                         else
  3000.                                         {
  3001.                                             if (this.byte_1[current.Int32_0, current.Int32_1] != 0)
  3002.                                             {
  3003.                                                 this.byte_1[current.Int32_0, current.Int32_1] = 0;
  3004.                                             }
  3005.                                             else
  3006.                                             {
  3007.                                                 if (@class.GetBaseItem().Walkable)
  3008.                                                 {
  3009.                                                     if (this.byte_0[current.Int32_0, current.Int32_1] != 3)
  3010.                                                     {
  3011.                                                         this.byte_0[current.Int32_0, current.Int32_1] = 1;
  3012.                                                     }
  3013.                                                 }
  3014.                                                 else
  3015.                                                 {
  3016.                                                     if (@class.Double_0 <= this.Class28_0.double_1[@class.Int32_0, @class.Int32_1] + 0.1 && @class.GetBaseItem().InteractionType.ToLower() == "gate" && @class.ExtraData == "1")
  3017.                                                     {
  3018.                                                         if (this.byte_0[current.Int32_0, current.Int32_1] != 3)
  3019.                                                         {
  3020.                                                             this.byte_0[current.Int32_0, current.Int32_1] = 1;
  3021.                                                         }
  3022.                                                     }
  3023.                                                     else
  3024.                                                     {
  3025.                                                         if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  3026.                                                         {
  3027.                                                             this.byte_0[current.Int32_0, current.Int32_1] = 3;
  3028.                                                         }
  3029.                                                         else
  3030.                                                         {
  3031.                                                             if (this.byte_0[current.Int32_0, current.Int32_1] != 3)
  3032.                                                             {
  3033.                                                                 this.byte_0[current.Int32_0, current.Int32_1] = 0;
  3034.                                                             }
  3035.                                                         }
  3036.                                                     }
  3037.                                                 }
  3038.                                             }
  3039.                                         }
  3040.                                     }
  3041.                                     if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  3042.                                     {
  3043.                                         this.byte_0[current.Int32_0, current.Int32_1] = 3;
  3044.                                     }
  3045.                                     if (@class.GetBaseItem().InteractionType.ToLower() == "bed")
  3046.                                     {
  3047.                                         this.byte_0[current.Int32_0, current.Int32_1] = 3;
  3048.                                         if (@class.int_3 == 0 || @class.int_3 == 4)
  3049.                                         {
  3050.                                             this.gstruct1_0[current.Int32_0, current.Int32_1].y = @class.Int32_1;
  3051.                                         }
  3052.                                         if (@class.int_3 == 2 || @class.int_3 == 6)
  3053.                                         {
  3054.                                             this.gstruct1_0[current.Int32_0, current.Int32_1].x = @class.Int32_0;
  3055.                                         }
  3056.                                     }
  3057.                                 }
  3058.                             }
  3059.                         }
  3060.                     }
  3061.                 }
  3062.                 catch
  3063.                 {
  3064.                     this.method_29(null, @class.uint_0, true, false);
  3065.                     GameClient class2 = Phoenix.GetGame().GetClientManager().GetClientByHabbo(this.Owner);
  3066.                     if (class2 != null)
  3067.                     {
  3068.                         class2.GetHabbo().method_23().method_11(@class.uint_0, @class.uint_2, @class.ExtraData, true);
  3069.                     }
  3070.                 }
  3071.             }
  3072.             if (!this.AllowWalkthrough)
  3073.             {
  3074.                 for (int k = 0; k < this.RoomUser_0.Length; k++)
  3075.                 {
  3076.                     RoomUser class3 = this.RoomUser_0[k];
  3077.                     if (class3 != null)
  3078.                     {
  3079.                         this.byte_0[class3.int_3, class3.int_4] = 0;
  3080.                     }
  3081.                 }
  3082.             }
  3083.             this.byte_0[this.Class28_0.int_0, this.Class28_0.int_1] = 3;
  3084.         }
  3085.         public void method_23()
  3086.         {
  3087.             this.list_1 = new List<uint>();
  3088.             DataTable dataTable = null;
  3089.             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  3090.             {
  3091.                 dataTable = @class.ReadDataTable("SELECT room_rights.user_id FROM room_rights WHERE room_id = '" + this.uint_0 + "'");
  3092.             }
  3093.             if (dataTable != null)
  3094.             {
  3095.                 foreach (DataRow dataRow in dataTable.Rows)
  3096.                 {
  3097.                     this.list_1.Add((uint)dataRow["user_id"]);
  3098.                 }
  3099.             }
  3100.         }
  3101.         internal List<RoomItem> method_24(GameClient Session)
  3102.         {
  3103.             List<RoomItem> list = new List<RoomItem>();
  3104.             foreach (RoomItem @class in this.Hashtable_0.Values)
  3105.             {
  3106.                 @class.Class69_0.OnRemove(Session, @class);
  3107.                 ServerMessage Message = new ServerMessage(94u);
  3108.                 Message.AppendRawUInt(@class.uint_0);
  3109.                 Message.AppendStringWithBreak("");
  3110.                 Message.AppendBoolean(false);
  3111.                 this.SendMessage(Message, null);
  3112.                 list.Add(@class);
  3113.             }
  3114.             foreach (RoomItem @class in this.Hashtable_1.Values)
  3115.             {
  3116.                 @class.Class69_0.OnRemove(Session, @class);
  3117.                 ServerMessage Message = new ServerMessage(84u);
  3118.                 Message.AppendRawUInt(@class.uint_0);
  3119.                 Message.AppendStringWithBreak("");
  3120.                 Message.AppendBoolean(false);
  3121.                 this.SendMessage(Message, null);
  3122.                 list.Add(@class);
  3123.             }
  3124.             this.hashtable_4.Clear();
  3125.             this.hashtable_0.Clear();
  3126.             this.hashtable_1.Clear();
  3127.             this.hashtable_2.Clear();
  3128.             this.hashtable_3.Clear();
  3129.             using (DatabaseClient class2 = Phoenix.GetDatabase().GetClient())
  3130.             {
  3131.                 class2.ExecuteQuery(string.Concat(new object[]
  3132.                 {
  3133.                     "UPDATE items SET room_id = 0, user_id = '",
  3134.                     Session.GetHabbo().Id,
  3135.                     "' WHERE room_id = '",
  3136.                     this.Id,
  3137.                     "'"
  3138.                 }));
  3139.             }
  3140.             this.method_22();
  3141.             this.method_83();
  3142.             return list;
  3143.         }
  3144.         public void method_25()
  3145.         {
  3146.             this.hashtable_0.Clear();
  3147.             this.hashtable_4.Clear();
  3148.             DataTable dataTable;
  3149.             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  3150.             {
  3151.                 dataTable = @class.ReadDataTable("SELECT Id, base_item, extra_data, x, y, z, rot, wall_pos FROM items WHERE room_id = '" + this.uint_0 + "' ORDER BY room_id DESC");
  3152.             }
  3153.             if (dataTable != null)
  3154.             {
  3155.                 foreach (DataRow dataRow in dataTable.Rows)
  3156.                 {
  3157.                     RoomItem class2 = new RoomItem((uint)dataRow["Id"], this.Id, (uint)dataRow["base_item"], (string)dataRow["extra_data"], (int)dataRow["x"], (int)dataRow["y"], (double)dataRow["z"], (int)dataRow["rot"], (string)dataRow["wall_pos"], this);
  3158.                     if (class2.Boolean_0)
  3159.                     {
  3160.                         this.bool_11 = true;
  3161.                     }
  3162.                     if (class2.GetBaseItem().InteractionType.ToLower().Contains("wf_") || class2.GetBaseItem().InteractionType.ToLower().Contains("fbgate") || class2.GetBaseItem().InteractionType.ToLower().Contains("torretta") || class2.GetBaseItem().InteractionType.ToLower().Contains("torrettau"))
  3163.                     {
  3164.                         DataRow dataRow2;
  3165.                         using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  3166.                         {
  3167.                             dataRow2 = @class.ReadDataRow("SELECT extra1,extra2,extra3,extra4,extra5 FROM wired_items WHERE item_id = '" + class2.uint_0 + "'");
  3168.                         }
  3169.                         if (dataRow2 != null)
  3170.                         {
  3171.                             class2.string_2 = (string)dataRow2["extra1"];
  3172.                             class2.string_3 = (string)dataRow2["extra2"];
  3173.                             class2.string_4 = (string)dataRow2["extra3"];
  3174.                             class2.string_5 = (string)dataRow2["extra4"];
  3175.                             class2.string_6 = (string)dataRow2["extra5"];
  3176.                         }
  3177.                     }
  3178.                     string text = class2.GetBaseItem().InteractionType.ToLower();
  3179.                     switch (text)
  3180.                     {
  3181.                         case "dice":
  3182.                             if (class2.ExtraData == "-1")
  3183.                             {
  3184.                                 class2.ExtraData = "0";
  3185.                             }
  3186.                             break;
  3187.                         case "fbgate":
  3188.                             if (class2.ExtraData != "" && class2.ExtraData.Contains(','))
  3189.                             {
  3190.                                 class2.string_2 = class2.ExtraData.Split(new char[]
  3191.                             {
  3192.                                 ','
  3193.                             })[0];
  3194.                                 class2.string_3 = class2.ExtraData.Split(new char[]
  3195.                             {
  3196.                                 ','
  3197.                             })[1];
  3198.                             }
  3199.                             break;
  3200.                         case "dimmer":
  3201.                             if (this.class67_0 == null)
  3202.                             {
  3203.                                 this.class67_0 = new MoodlightData(class2.uint_0);
  3204.                             }
  3205.                             break;
  3206.                         case "bb_patch":
  3207.                             this.list_5.Add(class2);
  3208.                             if (class2.ExtraData == "5")
  3209.                             {
  3210.                                 this.list_6.Add(class2);
  3211.                             }
  3212.                             else
  3213.                             {
  3214.                                 if (class2.ExtraData == "8")
  3215.                                 {
  3216.                                     this.list_7.Add(class2);
  3217.                                 }
  3218.                                 else
  3219.                                 {
  3220.                                     if (class2.ExtraData == "11")
  3221.                                     {
  3222.                                         this.list_9.Add(class2);
  3223.                                     }
  3224.                                     else
  3225.                                     {
  3226.                                         if (class2.ExtraData == "14")
  3227.                                         {
  3228.                                             this.list_8.Add(class2);
  3229.                                         }
  3230.                                     }
  3231.                                 }
  3232.                             }
  3233.                             break;
  3234.                         case "ballop":
  3235.                             this.Footballs.Add(class2);
  3236.                             break;
  3237.                         case "green_goal":
  3238.                         case "blue_goal":
  3239.                         case "yellow_goal":
  3240.                         case "red_goal":
  3241.                             this.Goals.Add(class2);
  3242.                             break;
  3243.                         case "football_scoreboard_green":
  3244.                         case "football_scoreboard_blue":
  3245.                         case "football_scoreboard_yellow":
  3246.                         case "football_scoreboard_red":
  3247.                             this.ScoreBoards.Add(class2);
  3248.                             break;
  3249.                         case "blue_score":
  3250.                             this.list_12.Add(class2);
  3251.                             break;
  3252.                         case "green_score":
  3253.                             this.list_13.Add(class2);
  3254.                             break;
  3255.                         case "red_score":
  3256.                             this.list_10.Add(class2);
  3257.                             break;
  3258.                         case "yellow_score":
  3259.                             this.list_11.Add(class2);
  3260.                             break;
  3261.                         case "stickiepole":
  3262.                             this.list_3.Add(class2);
  3263.                             break;
  3264.                         case "wf_trg_onsay":
  3265.                         case "wf_trg_enterroom":
  3266.                         case "wf_trg_furnistate":
  3267.                         case "wf_trg_onfurni":
  3268.                         case "torretta":
  3269.                         case "torrettau":
  3270.                         case "wf_trg_offfurni":
  3271.                         case "wf_trg_gameend":
  3272.                         case "wf_trg_gamestart":
  3273.                         case "wf_trg_attime":
  3274.                         case "wf_trg_atscore":
  3275.                             if (!this.list_14.Contains(class2))
  3276.                             {
  3277.                                 this.list_14.Add(class2);
  3278.                                 //s
  3279.                             }
  3280.                             break;
  3281.                         case "wf_trg_timer":
  3282.                             if (class2.string_2.Length <= 0)
  3283.                             {
  3284.                                 class2.string_2 = "10";
  3285.                             }
  3286.                             if (!this.list_14.Contains(class2))
  3287.                             {
  3288.                                 this.list_14.Add(class2);
  3289.                             }
  3290.                             class2.bool_0 = true;
  3291.                             class2.ReqUpdate(1);
  3292.                             break;
  3293.                         case "wf_act_saymsg":
  3294.                         case "wf_act_moveuser":
  3295.                         case "wf_act_togglefurni":
  3296.                         case "wf_act_givepoints":
  3297.                         case "wf_act_moverotate":
  3298.                         case "wf_act_matchfurni":
  3299.                         case "wf_act_give_phx":
  3300.                             if (!this.list_15.Contains(class2))
  3301.                             {
  3302.                                 this.list_15.Add(class2);
  3303.                             }
  3304.                             break;
  3305.                         case "wf_cnd_trggrer_on_frn":
  3306.                         case "wf_cnd_furnis_hv_avtrs":
  3307.                         case "wf_cnd_has_furni_on":
  3308.                         case "wf_cnd_phx":
  3309.                             if (!this.list_16.Contains(class2))
  3310.                             {
  3311.                                 this.list_16.Add(class2);
  3312.                             }
  3313.                             break;
  3314.                     }
  3315.                     if (this.hashtable_0.Contains(class2.uint_0))
  3316.                     {
  3317.                         this.hashtable_0.Remove(class2.uint_0);
  3318.                     }
  3319.                     if (this.hashtable_4.Contains(class2.uint_0))
  3320.                     {
  3321.                         this.hashtable_4.Remove(class2.uint_0);
  3322.                     }
  3323.                     if (class2.Boolean_2)
  3324.                     {
  3325.                         this.hashtable_0.Add(class2.uint_0, class2);
  3326.                     }
  3327.                     else
  3328.                     {
  3329.                         this.hashtable_4.Add(class2.uint_0, class2);
  3330.                     }
  3331.                 }
  3332.             }
  3333.         }
  3334.         public bool method_26(GameClient Session)
  3335.         {
  3336.             return this.method_27(Session, false);
  3337.         }
  3338.         public bool method_27(GameClient Session, bool bool_13)
  3339.         {
  3340.  
  3341.             if (Session.GetHabbo().CurrentRoomId != 0)
  3342.             {
  3343.                 using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
  3344.  
  3345.                 {
  3346.                     dbClient.ExecuteQuery("UPDATE users SET roomid=" + Session.GetHabbo().CurrentRoomId + " WHERE id=" + Session.GetHabbo().Id + ";");
  3347.                 }
  3348.             }
  3349.  
  3350.             int checkhp;
  3351.             using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
  3352.             {
  3353.                 checkhp = dbClient.ReadInt32("SELECT hp FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
  3354.             }
  3355.  
  3356.             int hpmaxa;
  3357.             using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
  3358.             {
  3359.                 hpmaxa = dbClient.ReadInt32("SELECT hpmax FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
  3360.             }
  3361.             int ospedale = 0;
  3362.             if (checkhp < hpmaxa)
  3363.             {
  3364.                 int stanza;
  3365.                 using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
  3366.                 {
  3367.  
  3368.                     stanza = dbClient.ReadInt32("SELECT roomid FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
  3369.  
  3370.  
  3371.                 }
  3372.                
  3373.                 using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
  3374.                 {
  3375.                     ospedale = dbClient.ReadInt32("SELECT ospedale  FROM rooms WHERE Id = " + stanza + ";");
  3376.                 }
  3377.             }
  3378.             if (checkhp == 0 && ospedale == 1)
  3379.             {
  3380.                 using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
  3381.                 {
  3382.                     int hpmax;
  3383.  
  3384.  
  3385.                     hpmax = dbClient.ReadInt32("SELECT hpmax FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
  3386.                     dbClient.ExecuteQuery("UPDATE users SET hp =  " + hpmax + " WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
  3387.                 }
  3388.             }
  3389.            
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.           /*else if (Session.GetHabbo().Rank == 10)
  3396.           {
  3397.               Session.GetHabbo().method_24().method_2(503, true);
  3398.           }
  3399.           else if (Session.GetHabbo().Rank == 9)
  3400.           {
  3401.               Session.GetHabbo().method_24().method_2(102, true);
  3402.           }
  3403.           else if (Session.GetHabbo().Rank == 5)
  3404.           {
  3405.               Session.GetHabbo().method_24().method_2(502, true);
  3406.           }*/
  3407.           bool result;
  3408.             try
  3409.             {
  3410.                 if (Session.GetHabbo().Username.ToLower() == this.Owner.ToLower())
  3411.                 {
  3412.                     result = true;
  3413.                     return result;
  3414.                 }
  3415.                 if (Session.GetHabbo().HasFuse("acc_anyroomowner") && bool_13)
  3416.                 {
  3417.                     result = true;
  3418.                     return result;
  3419.                 }
  3420.                 if (!bool_13)
  3421.                 {
  3422.                     if (Session.GetHabbo().HasFuse("acc_anyroomrights"))
  3423.                     {
  3424.                         result = true;
  3425.                         return result;
  3426.                     }
  3427.                     if (this.list_1.Contains(Session.GetHabbo().Id))
  3428.                     {
  3429.                         result = true;
  3430.                         return result;
  3431.                     }
  3432.                     if (this.bool_8)
  3433.                     {
  3434.                         result = true;
  3435.                         return result;
  3436.                     }
  3437.                 }
  3438.             }
  3439.             catch
  3440.             {
  3441.             }
  3442.             result = false;
  3443.             return result;
  3444.         }
  3445.         public RoomItem method_28(uint uint_2)
  3446.         {
  3447.             RoomItem result;
  3448.             if ((this.hashtable_0 != null && this.hashtable_0.ContainsKey(uint_2)) || (this.hashtable_4 != null && this.hashtable_4.ContainsKey(uint_2)))
  3449.             {
  3450.                 RoomItem @class = this.hashtable_0[uint_2] as RoomItem;
  3451.                 if (@class != null)
  3452.                 {
  3453.                     result = @class;
  3454.                 }
  3455.                 else
  3456.                 {
  3457.                     result = (this.hashtable_4[uint_2] as RoomItem);
  3458.                 }
  3459.             }
  3460.             else
  3461.             {
  3462.                 result = null;
  3463.             }
  3464.             return result;
  3465.         }
  3466.         public void method_29(GameClient Session, uint uint_2, bool bool_13, bool bool_14)
  3467.         {
  3468.             RoomItem @class = this.method_28(uint_2);
  3469.             if (@class != null)
  3470.             {
  3471.                 Dictionary<int, AffectedTile> dictionary = this.method_94(@class.GetBaseItem().Length, @class.GetBaseItem().Width, @class.Int32_0, @class.Int32_1, @class.int_3);
  3472.                 @class.Class69_0.OnRemove(Session, @class);
  3473.                 if (@class.Boolean_1)
  3474.                 {
  3475.                     ServerMessage Message = new ServerMessage(84u);
  3476.                     Message.AppendRawUInt(@class.uint_0);
  3477.                     Message.AppendStringWithBreak("");
  3478.                     Message.AppendBoolean(false);
  3479.                     this.SendMessage(Message, null);
  3480.                 }
  3481.                 else
  3482.                 {
  3483.                     if (@class.Boolean_2)
  3484.                     {
  3485.                         ServerMessage Message = new ServerMessage(94u);
  3486.                         Message.AppendRawUInt(@class.uint_0);
  3487.                         Message.AppendStringWithBreak("");
  3488.                         Message.AppendBoolean(false);
  3489.                         this.SendMessage(Message, null);
  3490.                         string text = @class.GetBaseItem().InteractionType.ToLower();
  3491.                         switch (text)
  3492.                         {
  3493.                             case "bb_patch":
  3494.                                 this.list_5.Remove(@class);
  3495.                                 if (@class.ExtraData == "5")
  3496.                                 {
  3497.                                     this.list_6.Remove(@class);
  3498.                                 }
  3499.                                 else
  3500.                                 {
  3501.                                     if (@class.ExtraData == "8")
  3502.                                     {
  3503.                                         this.list_7.Remove(@class);
  3504.                                     }
  3505.                                     else
  3506.                                     {
  3507.                                         if (@class.ExtraData == "11")
  3508.                                         {
  3509.                                             this.list_9.Remove(@class);
  3510.                                         }
  3511.                                         else
  3512.                                         {
  3513.                                             if (@class.ExtraData == "14")
  3514.                                             {
  3515.                                                 this.list_8.Remove(@class);
  3516.                                             }
  3517.                                         }
  3518.                                     }
  3519.                                 }
  3520.                                 break;
  3521.                             case "ballop":
  3522.                                 this.Footballs.Remove(@class);
  3523.                                 break;
  3524.                             case "green_goal":
  3525.                             case "blue_goal":
  3526.                             case "yellow_goal":
  3527.                             case "red_goal":
  3528.                                 this.Goals.Remove(@class);
  3529.                                 break;
  3530.                             case "football_scoreboard_green":
  3531.                             case "football_scoreboard_blue":
  3532.                             case "football_scoreboard_yellow":
  3533.                             case "football_scoreboard_red":
  3534.                                 this.ScoreBoards.Remove(@class);
  3535.                                 break;
  3536.                             case "blue_score":
  3537.                                 this.list_12.Remove(@class);
  3538.                                 break;
  3539.                             case "green_score":
  3540.                                 this.list_13.Remove(@class);
  3541.                                 break;
  3542.                             case "red_score":
  3543.                                 this.list_10.Remove(@class);
  3544.                                 break;
  3545.                             case "yellow_score":
  3546.                                 this.list_11.Remove(@class);
  3547.                                 break;
  3548.                             case "stickiepole":
  3549.                                 this.list_3.Remove(@class);
  3550.                                 break;
  3551.                             case "wf_trg_onsay":
  3552.                             case "wf_trg_enterroom":
  3553.                             case "wf_trg_furnistate":
  3554.                             case "wf_trg_onfurni":
  3555.                             case "torretta":
  3556.                             case "torrettau":
  3557.                             case "wf_trg_offfurni":
  3558.                             case "wf_trg_gameend":
  3559.                             case "wf_trg_gamestart":
  3560.                             case "wf_trg_attime":
  3561.                             case "wf_trg_atscore":
  3562.                                 this.list_14.Remove(@class);
  3563.                                 break;
  3564.                             case "wf_trg_timer":
  3565.                                 @class.bool_0 = false;
  3566.                                 this.list_14.Remove(@class);
  3567.                                 break;
  3568.                             case "wf_act_saymsg":
  3569.                             case "wf_act_moveuser":
  3570.                             case "wf_act_togglefurni":
  3571.                             case "wf_act_givepoints":
  3572.                             case "wf_act_moverotate":
  3573.                             case "wf_act_matchfurni":
  3574.                             case "wf_act_give_phx":
  3575.                                 this.list_15.Remove(@class);
  3576.                                 break;
  3577.                             case "wf_cnd_trggrer_on_frn":
  3578.                             case "wf_cnd_furnis_hv_avtrs":
  3579.                             case "wf_cnd_has_furni_on":
  3580.                             case "wf_cnd_phx":
  3581.                                 this.list_16.Remove(@class);
  3582.                                 break;
  3583.                         }
  3584.                     }
  3585.                 }
  3586.                 if (@class.Boolean_1)
  3587.                 {
  3588.                     this.hashtable_4.Remove(@class.uint_0);
  3589.                 }
  3590.                 else
  3591.                 {
  3592.                     this.hashtable_0.Remove(@class.uint_0);
  3593.                 }
  3594.                 if (this.hashtable_3.Contains(@class.uint_0))
  3595.                 {
  3596.                     this.hashtable_3.Remove(@class.uint_0);
  3597.                 }
  3598.                 if (this.hashtable_2.Contains(@class.uint_0))
  3599.                 {
  3600.                     this.hashtable_2.Remove(@class.uint_0);
  3601.                 }
  3602.                 if (!this.hashtable_1.Contains(@class.uint_0))
  3603.                 {
  3604.                     this.hashtable_1.Add(@class.uint_0, @class);
  3605.                 }
  3606.                 if (bool_13)
  3607.                 {
  3608.                     using (DatabaseClient class2 = Phoenix.GetDatabase().GetClient())
  3609.                     {
  3610.                         class2.ExecuteQuery("DELETE FROM items WHERE Id = '" + uint_2 + "' LIMIT 1");
  3611.                     }
  3612.                 }
  3613.                 if (bool_14)
  3614.                 {
  3615.                     this.method_22();
  3616.                 }
  3617.                 this.method_87(this.method_43(@class.Int32_0, @class.Int32_1), true, true);
  3618.                 foreach (AffectedTile current in dictionary.Values)
  3619.                 {
  3620.                     this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  3621.                 }
  3622.             }
  3623.         }
  3624.         public bool method_30(int int_17, int int_18, double double_3, bool bool_13, bool bool_14)
  3625.         {
  3626.             return this.AllowWalkthrough || bool_14 || this.method_43(int_17, int_18) == null;
  3627.         }
  3628.         private void method_31(string string_10)
  3629.         {
  3630.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  3631.             {
  3632.                 RoomUser @class = this.RoomUser_0[i];
  3633.                 if (@class != null && !@class.Boolean_4)
  3634.                 {
  3635.                     @class.GetClient().SendNotif(string_10);
  3636.                 }
  3637.             }
  3638.         }
  3639.         private void method_32(object object_0)
  3640.         {
  3641.             this.method_33();
  3642.         }
  3643.         private void method_33()
  3644.         {
  3645.             int num = 0;
  3646.             if (!this.bool_6 && !this.bool_7)
  3647.             {
  3648.                 try
  3649.                 {
  3650.                     this.int_14++;
  3651.                     if (this.bool_10 && this.int_14 >= 30)
  3652.                     {
  3653.                         using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  3654.                         {
  3655.                             @class.ExecuteQuery(string.Concat(new object[]
  3656.                             {
  3657.                                 "UPDATE rooms SET users_now = '",
  3658.                                 this.Int32_0,
  3659.                                 "' WHERE Id = '",
  3660.                                 this.uint_0,
  3661.                                 "' LIMIT 1"
  3662.                             }));
  3663.                         }
  3664.                         this.int_14 = 0;
  3665.                     }
  3666.                     this.method_35();
  3667.                     int num2 = 0;
  3668.                     try
  3669.                     {
  3670.                         if (this.hashtable_0 != null)
  3671.                         {
  3672.                             foreach (RoomItem class2 in this.Hashtable_0.Values)
  3673.                             {
  3674.                                 if (class2.bool_1)
  3675.                                 {
  3676.                                     class2.method_2();
  3677.                                 }
  3678.                             }
  3679.                         }
  3680.                     }
  3681.                     catch (Exception ex)
  3682.                     {
  3683.                         Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Process Floor Items");
  3684.                         this.method_34();
  3685.                     }
  3686.                     try
  3687.                     {
  3688.                         if (this.hashtable_4 != null)
  3689.                         {
  3690.                             foreach (RoomItem class2 in this.Hashtable_1.Values)
  3691.                             {
  3692.                                 if (class2.bool_1)
  3693.                                 {
  3694.                                     class2.method_2();
  3695.                                 }
  3696.                             }
  3697.                         }
  3698.                     }
  3699.                     catch (Exception ex)
  3700.                     {
  3701.                         Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Process Wall Items");
  3702.                         this.method_34();
  3703.                     }
  3704.                     List<uint> list = new List<uint>();
  3705.                     int num3 = 0;
  3706.                     if (this.RoomUser_0 != null)
  3707.                     {
  3708.                         try
  3709.                         {
  3710.                             for (int i = 0; i < this.RoomUser_0.Length; i++)
  3711.                             {
  3712.                                 RoomUser class3 = this.RoomUser_0[i];
  3713.                                 if (class3 != null)
  3714.                                 {
  3715.                                     num = 1;
  3716.                                     if (!class3.Boolean_4 && class3.GetClient() != null)
  3717.                                     {
  3718.                                         num3++;
  3719.                                         if (class3.GetClient().GetHabbo() != null && class3.GetClient().GetHabbo().int_4 > 0)
  3720.                                         {
  3721.                                             class3.GetClient().GetHabbo().int_4--;
  3722.                                             if (class3.GetClient().GetHabbo().int_4 == 0)
  3723.                                             {
  3724.                                                 class3.GetClient().GetHabbo().bool_3 = false;
  3725.                                             }
  3726.                                         }
  3727.                                     }
  3728.                                     class3.int_1++;
  3729.                                     num = 2;
  3730.                                     if (!class3.bool_8 && class3.int_1 >= LicenseTools.int_14)
  3731.                                     {
  3732.                                         class3.bool_8 = true;
  3733.                                         ServerMessage Message = new ServerMessage(486u);
  3734.                                         Message.AppendInt32(class3.VirtualId);
  3735.                                         Message.AppendBoolean(true);
  3736.                                         this.SendMessage(Message, null);
  3737.                                     }
  3738.                                     num = 3;
  3739.                                     if (class3.GetClient() == null && !class3.Boolean_4)
  3740.                                     {
  3741.                                         this.RoomUser_0[i] = null;
  3742.                                         if (!class3.bool_1)
  3743.                                         {
  3744.                                             this.byte_0[class3.int_3, class3.int_4] = class3.byte_0;
  3745.                                         }
  3746.                                         ServerMessage Message2 = new ServerMessage(29u);
  3747.                                         Message2.AppendRawInt32(class3.VirtualId);
  3748.                                         this.SendMessage(Message2, null);
  3749.                                         this.method_50();
  3750.                                     }
  3751.                                     num = 4;
  3752.                                     if (class3.Boolean_2 && !list.Contains(class3.uint_0))
  3753.                                     {
  3754.                                         list.Add(class3.uint_0);
  3755.                                     }
  3756.                                     num = 5;
  3757.                                     if (class3.int_5 > 0)
  3758.                                     {
  3759.                                         class3.int_6--;
  3760.                                         if (class3.int_6 <= 0)
  3761.                                         {
  3762.                                             class3.method_8(0);
  3763.                                         }
  3764.                                     }
  3765.                                     num = 6;
  3766.                                     if (class3.bool_4 && class3.class34_1 == null)
  3767.                                     {
  3768.                                         num = 7;
  3769.                                         if (class3.Boolean_4 && class3.class34_0.RoomUser_0 != null && this.method_30(class3.int_12, class3.int_13, 0.0, true, true))
  3770.                                         {
  3771.                                             num = 8;
  3772.                                             this.method_85(class3);
  3773.                                             class3.int_3 = class3.int_12;
  3774.                                             class3.int_4 = class3.int_13;
  3775.                                             class3.double_0 = class3.double_1;
  3776.                                             class3.class34_0.RoomUser_0.int_3 = class3.int_12;
  3777.                                             class3.class34_0.RoomUser_0.int_4 = class3.int_13;
  3778.                                             class3.class34_0.RoomUser_0.double_0 = class3.double_1 + 1.0;
  3779.                                             class3.class34_0.RoomUser_0.bool_4 = false;
  3780.                                             class3.class34_0.RoomUser_0.method_12("mv");
  3781.                                             if (class3.int_3 == this.Class28_0.int_0 && class3.int_4 == this.Class28_0.int_1 && !list.Contains(class3.class34_0.RoomUser_0.uint_0))
  3782.                                             {
  3783.                                                 list.Add(class3.class34_0.RoomUser_0.uint_0);
  3784.                                             }
  3785.                                             this.method_87(class3, true, true);
  3786.                                         }
  3787.                                         else
  3788.                                         {
  3789.                                             if (this.method_30(class3.int_12, class3.int_13, 0.0, true, class3.bool_1))
  3790.                                             {
  3791.                                                 num = 8;
  3792.                                                 this.method_85(class3);
  3793.                                                 class3.int_3 = class3.int_12;
  3794.                                                 class3.int_4 = class3.int_13;
  3795.                                                 class3.double_0 = class3.double_1;
  3796.                                                 if (class3.int_3 == this.Class28_0.int_0 && class3.int_4 == this.Class28_0.int_1 && !list.Contains(class3.uint_0) && !class3.Boolean_4)
  3797.                                                 {
  3798.                                                     list.Add(class3.uint_0);
  3799.                                                 }
  3800.                                                 this.method_87(class3, true, true);
  3801.                                             }
  3802.                                         }
  3803.                                         class3.bool_4 = false;
  3804.                                     }
  3805.                                     num = 9;
  3806.                                     if (class3.bool_6 && !class3.bool_5 && class3.class34_1 == null)
  3807.                                     {
  3808.                                         num = 10;
  3809.                                         SquarePoint @struct = DreamPathfinder.GetNextStep(class3.int_3, class3.int_4, class3.int_10, class3.int_11, this.byte_0, this.double_1, this.class28_0.double_1, this.double_2, this.class28_0.int_4, this.class28_0.int_5, class3.bool_1, this.bool_5);
  3810.                                         num = 11;
  3811.                                         if (@struct.X != class3.int_3 || @struct.Y != class3.int_4)
  3812.                                         {
  3813.                                             num = 12;
  3814.                                             int int32_ = @struct.X;
  3815.                                             int int32_2 = @struct.Y;
  3816.                                             class3.method_12("mv");
  3817.                                             double num4 = this.method_84(int32_, int32_2, this.method_93(int32_, int32_2));
  3818.                                             class3.Statusses.Remove("lay");
  3819.                                             class3.Statusses.Remove("sit");
  3820.                                             class3.method_11("mv", string.Concat(new object[]
  3821.                                                                                         {
  3822.                                                                                                 int32_,
  3823.                                                                                                 ",",
  3824.                                                                                                 int32_2,
  3825.                                                                                                 ",",
  3826.                                                                                                 num4.ToString().Replace(',', '.')
  3827.                                                                                         }));
  3828.                                             num = 13;
  3829.                                             if (class3.Boolean_4 && class3.class34_0.RoomUser_0 != null)
  3830.                                             {
  3831.                                                 class3.class34_0.RoomUser_0.method_11("mv", string.Concat(new object[]
  3832.                                                                                                 {
  3833.                                                                                                         int32_,
  3834.                                                                                                         ",",
  3835.                                                                                                         int32_2,
  3836.                                                                                                         ",",
  3837.                                                                                                         (num4 + 1.0).ToString().Replace(',', '.')
  3838.                                                                                                 }));
  3839.                                             }
  3840.                                             int num5;
  3841.                                             if (class3.bool_3)
  3842.                                             {
  3843.                                                 num5 = Class107.smethod_1(class3.int_3, class3.int_4, int32_, int32_2);
  3844.                                             }
  3845.                                             else
  3846.                                             {
  3847.                                                 num5 = Class107.smethod_0(class3.int_3, class3.int_4, int32_, int32_2);
  3848.                                             }
  3849.                                             class3.int_8 = num5;
  3850.                                             class3.int_7 = num5;
  3851.                                             class3.bool_4 = true;
  3852.                                             class3.int_12 = int32_;
  3853.                                             class3.int_13 = int32_2;
  3854.                                             class3.double_1 = num4;
  3855.                                             num = 14;
  3856.                                             if (class3.Boolean_4 && class3.class34_0.RoomUser_0 != null)
  3857.                                             {
  3858.                                                 class3.class34_0.RoomUser_0.int_8 = num5;
  3859.                                                 class3.class34_0.RoomUser_0.int_7 = num5;
  3860.                                                 class3.class34_0.RoomUser_0.bool_4 = true;
  3861.                                                 class3.class34_0.RoomUser_0.int_12 = int32_;
  3862.                                                 class3.class34_0.RoomUser_0.int_13 = int32_2;
  3863.                                                 class3.class34_0.RoomUser_0.double_1 = num4 + 1.0;
  3864.                                             }
  3865.                                             try
  3866.                                             {
  3867.                                                 num = 15;
  3868.                                                 if (!class3.Boolean_4)
  3869.                                                 {
  3870.                                                     if (class3.GetClient().GetHabbo().Gender.ToLower() == "m" && this.byte_1[int32_, int32_2] > 0 && class3.byte_1 != this.byte_1[int32_, int32_2])
  3871.                                                     {
  3872.                                                         class3.GetClient().GetHabbo().method_24().method_2((int)this.byte_1[int32_, int32_2], true);
  3873.                                                         class3.byte_1 = this.byte_1[int32_, int32_2];
  3874.                                                     }
  3875.                                                     else
  3876.                                                     {
  3877.                                                         if (class3.GetClient().GetHabbo().Gender.ToLower() == "f" && this.byte_2[int32_, int32_2] > 0 && class3.byte_1 != this.byte_2[int32_, int32_2])
  3878.                                                         {
  3879.                                                             class3.GetClient().GetHabbo().method_24().method_2((int)this.byte_2[int32_, int32_2], true);
  3880.                                                             class3.byte_1 = this.byte_2[int32_, int32_2];
  3881.                                                         }
  3882.                                                     }
  3883.                                                 }
  3884.                                                 else
  3885.                                                 {
  3886.                                                     if (!class3.isPet)
  3887.                                                     {
  3888.                                                         if (this.byte_1[int32_, int32_2] > 0)
  3889.                                                         {
  3890.                                                             class3.class34_0.EffectId = (int)this.byte_1[int32_, int32_2];
  3891.                                                             class3.byte_1 = this.byte_1[int32_, int32_2];
  3892.                                                         }
  3893.                                                         ServerMessage Message3 = new ServerMessage(485u);
  3894.                                                         Message3.AppendInt32(class3.VirtualId);
  3895.                                                         Message3.AppendInt32(class3.class34_0.EffectId);
  3896.                                                         this.SendMessage(Message3, null);
  3897.                                                     }
  3898.                                                 }
  3899.                                                 goto IL_CE1;
  3900.                                             }
  3901.                                             catch
  3902.                                             {
  3903.                                                 goto IL_CE1;
  3904.                                             }
  3905.                                         IL_B8B:
  3906.                                             this.method_87(class3, false, true);
  3907.                                             class3.bool_7 = true;
  3908.                                             if (class3.Boolean_4 && class3.class34_0.RoomUser_0 != null)
  3909.                                             {
  3910.                                                 this.method_87(class3.class34_0.RoomUser_0, true, true);
  3911.                                                 class3.class34_0.RoomUser_0.bool_7 = true;
  3912.                                                 goto IL_BE0;
  3913.                                             }
  3914.                                             goto IL_BE0;
  3915.                                         IL_CE1:
  3916.                                             num = 16;
  3917.                                             this.byte_0[class3.int_3, class3.int_4] = class3.byte_0;
  3918.                                             class3.byte_0 = this.byte_0[class3.int_12, class3.int_13];
  3919.                                             if (this.AllowWalkthrough)
  3920.                                             {
  3921.                                                 goto IL_B8B;
  3922.                                             }
  3923.                                             this.byte_0[int32_, int32_2] = 0;
  3924.                                             goto IL_B8B;
  3925.                                         }
  3926.                                         num = 12;
  3927.                                         class3.bool_6 = false;
  3928.                                         class3.method_12("mv");
  3929.                                         class3.bool_10 = false;
  3930.                                         if (class3.Boolean_4 && class3.class34_0.RoomUser_0 != null)
  3931.                                         {
  3932.                                             class3.class34_0.RoomUser_0.method_12("mv");
  3933.                                             class3.class34_0.RoomUser_0.bool_6 = false;
  3934.                                             class3.class34_0.RoomUser_0.bool_10 = false;
  3935.                                             class3.class34_0.RoomUser_0.bool_7 = true;
  3936.                                         }
  3937.                                     IL_BE0:
  3938.                                         class3.bool_7 = true;
  3939.                                     }
  3940.                                     else
  3941.                                     {
  3942.                                         num = 17;
  3943.                                         if (class3.Statusses.ContainsKey("mv") && class3.class34_1 == null)
  3944.                                         {
  3945.                                             num = 18;
  3946.                                             class3.method_12("mv");
  3947.                                             class3.bool_7 = true;
  3948.                                             if (class3.Boolean_4 && class3.class34_0.RoomUser_0 != null)
  3949.                                             {
  3950.                                                 class3.class34_0.RoomUser_0.method_12("mv");
  3951.                                                 class3.class34_0.RoomUser_0.bool_7 = true;
  3952.                                             }
  3953.                                         }
  3954.                                     }
  3955.                                     if (class3.Boolean_4 || class3.isPet)
  3956.                                     {
  3957.                                         try
  3958.                                         {
  3959.                                             class3.BotAI.OnTimerTick();
  3960.                                             goto IL_C9F;
  3961.                                         }
  3962.                                         catch
  3963.                                         {
  3964.                                             goto IL_C9F;
  3965.                                         }
  3966.                                     }
  3967.                                     goto IL_C9B;
  3968.                                 IL_C9F:
  3969.                                     if (class3.int_9 > 0)
  3970.                                     {
  3971.                                         if (class3.int_9 == 1)
  3972.                                         {
  3973.                                             this.method_87(class3, true, true);
  3974.                                         }
  3975.                                         class3.int_9--;
  3976.                                         goto IL_CD6;
  3977.                                     }
  3978.                                     goto IL_CD6;
  3979.                                 IL_C9B:
  3980.                                     num2++;
  3981.                                     goto IL_C9F;
  3982.                                 }
  3983.                             IL_CD6:;
  3984.                             }
  3985.                         }
  3986.                         catch (Exception ex)
  3987.                         {
  3988.                             Logging.LogThreadException(ex.ToString(), string.Concat(new object[]
  3989.                                                         {
  3990.                                                                 "Room [ID: ",
  3991.                                                                 this.Id,
  3992.                                                                 "] [Part: ",
  3993.                                                                 num,
  3994.                                                                 " cycle task -- Process Users Updates"
  3995.                                                         }));
  3996.                             this.method_34();
  3997.                         }
  3998.                     }
  3999.                     try
  4000.                     {
  4001.                         foreach (uint current in list)
  4002.                         {
  4003.                             this.method_47(Phoenix.GetGame().GetClientManager().method_2(current), true, false);
  4004.                         }
  4005.                     }
  4006.                     catch (Exception ex)
  4007.                     {
  4008.                         Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Remove Users");
  4009.                         this.method_34();
  4010.                     }
  4011.                     if (num2 >= 1)
  4012.                     {
  4013.                         this.int_8 = 0;
  4014.                     }
  4015.                     else
  4016.                     {
  4017.                         this.int_8++;
  4018.                     }
  4019.                     if (!this.bool_6 && !this.bool_7)
  4020.                     {
  4021.                         try
  4022.                         {
  4023.                             if (this.int_8 >= 60)
  4024.                             {
  4025.                                 Phoenix.GetGame().GetRoomManager().method_16(this);
  4026.                                 return;
  4027.                             }
  4028.                             ServerMessage Logging = this.method_67(false);
  4029.                             if (Logging != null)
  4030.                             {
  4031.                                 this.SendMessage(Logging, null);
  4032.                             }
  4033.                         }
  4034.                         catch (Exception ex)
  4035.                         {
  4036.                             Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Cycle End");
  4037.                             this.method_34();
  4038.                         }
  4039.                     }
  4040.                     this.class27_0.UsersNow = num3;
  4041.                 }
  4042.                 catch (Exception ex)
  4043.                 {
  4044.                     Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task");
  4045.                 }
  4046.             }
  4047.         }
  4048.         private void method_34()
  4049.         {
  4050.             if (!this.bool_7 && LicenseTools.bool_18)
  4051.             {
  4052.                 this.bool_7 = true;
  4053.                 try
  4054.                 {
  4055.                     this.method_31(PhoenixEnvironment.smethod_1("error_roomunload"));
  4056.                 }
  4057.                 catch
  4058.                 {
  4059.                 }
  4060.                 Phoenix.GetGame().GetRoomManager().method_16(this);
  4061.             }
  4062.         }
  4063.         private void method_35()
  4064.         {
  4065.             if (this.bool_11)
  4066.             {
  4067.                 if (this.int_16 >= this.int_15 || this.int_15 == 0)
  4068.                 {
  4069.                     Hashtable hashtable = this.hashtable_0.Clone() as Hashtable;
  4070.                     List<uint> list = new List<uint>();
  4071.                     List<uint> list2 = new List<uint>();
  4072.                     foreach (RoomItem @class in hashtable.Values)
  4073.                     {
  4074.                         if (@class.Boolean_0)
  4075.                         {
  4076.                             ThreeDCoord gStruct1_ = @class.GStruct1_1;
  4077.                             if (gStruct1_.x >= this.Class28_0.int_4 || gStruct1_.y >= this.Class28_0.int_5 || gStruct1_.x < 0 || gStruct1_.y < 0)
  4078.                             {
  4079.                                 return;
  4080.                             }
  4081.                             List<RoomItem> list3 = this.method_45(@class.Int32_0, @class.Int32_1);
  4082.                             RoomUser class2 = this.method_43(@class.Int32_0, @class.Int32_1);
  4083.                             if (list3.Count > 0 || class2 != null)
  4084.                             {
  4085.                                 List<RoomItem> list4 = this.method_45(gStruct1_.x, gStruct1_.y);
  4086.                                 double num = this.Class28_0.double_1[gStruct1_.x, gStruct1_.y];
  4087.                                 int num2 = 0;
  4088.                                 int num3 = 0;
  4089.                                 bool flag = false;
  4090.                                 foreach (RoomItem current in list4)
  4091.                                 {
  4092.                                     if (current.Double_1 > num)
  4093.                                     {
  4094.                                         num = current.Double_1;
  4095.                                     }
  4096.                                     if (!current.Boolean_0)
  4097.                                     {
  4098.                                         num2++;
  4099.                                     }
  4100.                                     else
  4101.                                     {
  4102.                                         num3++;
  4103.                                     }
  4104.                                     if (!flag && current.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer")
  4105.                                     {
  4106.                                         flag = true;
  4107.                                     }
  4108.                                 }
  4109.                                 bool flag2 = num2 > 0;
  4110.                                 if (this.method_43(gStruct1_.x, gStruct1_.y) != null)
  4111.                                 {
  4112.                                     flag2 = true;
  4113.                                 }
  4114.                                 bool flag3 = num3 > 0;
  4115.                                 foreach (RoomItem current in list3)
  4116.                                 {
  4117.                                     bool flag4 = current.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer";
  4118.                                     if (!current.Boolean_0 && !list.Contains(current.uint_0) && this.method_36(gStruct1_.x, gStruct1_.y) && (!flag2 || !flag3) && @class.Double_0 < current.Double_0 && this.method_43(gStruct1_.x, gStruct1_.y) == null && (!flag4 || !flag))
  4119.                                     {
  4120.                                         double double_;
  4121.                                         if (flag3)
  4122.                                         {
  4123.                                             double_ = current.Double_0;
  4124.                                         }
  4125.                                         else
  4126.                                         {
  4127.                                             double_ = current.Double_0 - @class.Double_1 + this.Class28_0.double_1[gStruct1_.x, gStruct1_.y];
  4128.                                         }
  4129.                                         this.method_41(current, gStruct1_, @class.uint_0, double_);
  4130.                                         list.Add(current.uint_0);
  4131.                                     }
  4132.                                 }
  4133.                                 if (class2 != null && (!flag2 || !flag3) && this.method_37(gStruct1_.x, gStruct1_.y, false, true, false, true, true) && !list2.Contains(class2.uint_0) && !class2.bool_6)
  4134.                                 {
  4135.                                     if (this.double_2[gStruct1_.x, gStruct1_.y] > 0.0)
  4136.                                     {
  4137.                                         num = this.method_84(gStruct1_.x, gStruct1_.y, this.method_93(gStruct1_.x, gStruct1_.y));
  4138.                                     }
  4139.                                     if (class2.Boolean_4 && class2.class34_0.RoomUser_0 != null)
  4140.                                     {
  4141.                                         this.method_42(class2, gStruct1_, @class.uint_0, num);
  4142.                                         list2.Add(class2.uint_0);
  4143.                                         this.method_42(class2.class34_0.RoomUser_0, gStruct1_, @class.uint_0, num + 1.0);
  4144.                                         list2.Add(class2.class34_0.RoomUser_0.uint_0);
  4145.                                     }
  4146.                                     else
  4147.                                     {
  4148.                                         if (class2.class34_1 == null)
  4149.                                         {
  4150.                                             this.method_42(class2, gStruct1_, @class.uint_0, num);
  4151.                                             list2.Add(class2.uint_0);
  4152.                                         }
  4153.                                     }
  4154.                                 }
  4155.                             }
  4156.                         }
  4157.                     }
  4158.                     hashtable.Clear();
  4159.                     hashtable = null;
  4160.                     list.Clear();
  4161.                     list2.Clear();
  4162.                     this.int_16 = 0;
  4163.                 }
  4164.                 else
  4165.                 {
  4166.                     this.int_16++;
  4167.                 }
  4168.             }
  4169.         }
  4170.         public bool method_36(int int_17, int int_18)
  4171.         {
  4172.             bool result;
  4173.             if (!this.method_92(int_17, int_18))
  4174.             {
  4175.                 result = false;
  4176.             }
  4177.             else
  4178.             {
  4179.                 if (this.Class28_0.squareState[int_17, int_18] == SquareState.BLOCKED)
  4180.                 {
  4181.                     result = false;
  4182.                 }
  4183.                 else
  4184.                 {
  4185.                     List<RoomItem> list = this.method_93(int_17, int_18);
  4186.                     if (list.Count > 1)
  4187.                     {
  4188.                         foreach (RoomItem current in list)
  4189.                         {
  4190.                             if (current.Boolean_0)
  4191.                             {
  4192.                                 result = true;
  4193.                                 return result;
  4194.                             }
  4195.                         }
  4196.                     }
  4197.                     result = true;
  4198.                 }
  4199.             }
  4200.             return result;
  4201.         }
  4202.         public bool method_37(int int_17, int int_18, bool bool_13, bool bool_14, bool bool_15, bool bool_16, bool bool_17)
  4203.         {
  4204.             bool result;
  4205.             if (!this.method_92(int_17, int_18))
  4206.             {
  4207.                 result = false;
  4208.             }
  4209.             else
  4210.             {
  4211.                 if (this.Class28_0.squareState[int_17, int_18] == SquareState.BLOCKED)
  4212.                 {
  4213.                     result = false;
  4214.                 }
  4215.                 else
  4216.                 {
  4217.                     if (bool_17 && this.double_2[int_17, int_18] > 0.0)
  4218.                     {
  4219.                         result = true;
  4220.                     }
  4221.                     else
  4222.                     {
  4223.                         if (bool_13 && this.method_97(int_17, int_18))
  4224.                         {
  4225.                             result = false;
  4226.                         }
  4227.                         else
  4228.                         {
  4229.                             if (bool_14)
  4230.                             {
  4231.                                 List<RoomItem> list = this.method_93(int_17, int_18);
  4232.                                 if (list.Count > 0)
  4233.                                 {
  4234.                                     if (!bool_15 && !bool_16 && !bool_17)
  4235.                                     {
  4236.                                         result = false;
  4237.                                         return result;
  4238.                                     }
  4239.                                     if (bool_15)
  4240.                                     {
  4241.                                         foreach (RoomItem current in list)
  4242.                                         {
  4243.                                             if (!current.GetBaseItem().Stackable)
  4244.                                             {
  4245.                                                 result = false;
  4246.                                                 return result;
  4247.                                             }
  4248.                                         }
  4249.                                     }
  4250.                                     if (bool_16 && bool_17)
  4251.                                     {
  4252.                                         using (List<RoomItem>.Enumerator enumerator = list.GetEnumerator())
  4253.                                         {
  4254.                                             while (enumerator.MoveNext())
  4255.                                             {
  4256.                                                 RoomItem current = enumerator.Current;
  4257.                                                 if (!current.GetBaseItem().Walkable && !current.GetBaseItem().IsSeat)
  4258.                                                 {
  4259.                                                     result = false;
  4260.                                                     return result;
  4261.                                                 }
  4262.                                             }
  4263.                                             goto IL_1DD;
  4264.                                         }
  4265.                                     }
  4266.                                     if (bool_16)
  4267.                                     {
  4268.                                         using (List<RoomItem>.Enumerator enumerator = list.GetEnumerator())
  4269.                                         {
  4270.                                             while (enumerator.MoveNext())
  4271.                                             {
  4272.                                                 RoomItem current = enumerator.Current;
  4273.                                                 if (!current.GetBaseItem().Walkable)
  4274.                                                 {
  4275.                                                     result = false;
  4276.                                                     return result;
  4277.                                                 }
  4278.                                             }
  4279.                                             goto IL_1DD;
  4280.                                         }
  4281.                                     }
  4282.                                     if (bool_17)
  4283.                                     {
  4284.                                         foreach (RoomItem current in list)
  4285.                                         {
  4286.                                             if (!current.GetBaseItem().IsSeat)
  4287.                                             {
  4288.                                                 result = false;
  4289.                                                 return result;
  4290.                                             }
  4291.                                         }
  4292.                                     }
  4293.                                 }
  4294.                             }
  4295.                         IL_1DD:
  4296.                             result = true;
  4297.                         }
  4298.                     }
  4299.                 }
  4300.             }
  4301.             return result;
  4302.         }
  4303.         internal void method_38(int int_17, int int_18)
  4304.         {
  4305.             this.byte_0[int_17, int_18] = 1;
  4306.         }
  4307.         internal void method_39(int int_17, int int_18)
  4308.         {
  4309.             this.byte_0[int_17, int_18] = 0;
  4310.         }
  4311.         private void method_40(RoomItem RoomItem_0, int int_17, int int_18, uint uint_2, double double_3)
  4312.         {
  4313.             ServerMessage Message = new ServerMessage();
  4314.             Message.Init(230u);
  4315.             Message.AppendInt32(RoomItem_0.Int32_0);
  4316.             Message.AppendInt32(RoomItem_0.Int32_1);
  4317.             Message.AppendInt32(int_17);
  4318.             Message.AppendInt32(int_18);
  4319.             Message.AppendInt32(1);
  4320.             Message.AppendUInt(RoomItem_0.uint_0);
  4321.             Message.AppendStringWithBreak(RoomItem_0.Double_0.ToString().Replace(',', '.'));
  4322.             Message.AppendStringWithBreak(double_3.ToString().Replace(',', '.'));
  4323.             Message.AppendUInt(uint_2);
  4324.             this.SendMessage(Message, null);
  4325.             this.method_81(RoomItem_0, int_17, int_18, double_3);
  4326.         }
  4327.         private void method_41(RoomItem RoomItem_0, ThreeDCoord gstruct1_1, uint uint_2, double double_3)
  4328.         {
  4329.             this.method_40(RoomItem_0, gstruct1_1.x, gstruct1_1.y, uint_2, double_3);
  4330.         }
  4331.         private void method_42(RoomUser RoomUser_1, ThreeDCoord gstruct1_1, uint uint_2, double double_3)
  4332.         {
  4333.             ServerMessage Message = new ServerMessage();
  4334.             Message.Init(230u);
  4335.             Message.AppendInt32(RoomUser_1.int_3);
  4336.             Message.AppendInt32(RoomUser_1.int_4);
  4337.             Message.AppendInt32(gstruct1_1.x);
  4338.             Message.AppendInt32(gstruct1_1.y);
  4339.             Message.AppendInt32(0);
  4340.             Message.AppendUInt(uint_2);
  4341.             Message.AppendString("J");
  4342.             Message.AppendInt32(RoomUser_1.VirtualId);
  4343.             Message.AppendStringWithBreak(RoomUser_1.double_0.ToString().Replace(',', '.'));
  4344.             Message.AppendStringWithBreak(double_3.ToString().Replace(',', '.'));
  4345.             this.SendMessage(Message, null);
  4346.             this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1;
  4347.             RoomUser_1.int_3 = gstruct1_1.x;
  4348.             RoomUser_1.int_4 = gstruct1_1.y;
  4349.             RoomUser_1.double_0 = double_3;
  4350.             RoomUser_1.int_12 = gstruct1_1.x;
  4351.             RoomUser_1.int_13 = gstruct1_1.y;
  4352.             RoomUser_1.double_1 = double_3;
  4353.             RoomUser_1.int_9 = 2;
  4354.             this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 0;
  4355.             this.method_87(RoomUser_1, false, true);
  4356.         }
  4357.         internal RoomUser method_43(int int_17, int int_18)
  4358.         {
  4359.             RoomUser result;
  4360.             if (this.RoomUser_0 != null)
  4361.             {
  4362.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  4363.                 {
  4364.                     RoomUser @class = this.RoomUser_0[i];
  4365.                     if (@class != null && (@class.int_3 == int_17 && @class.int_4 == int_18))
  4366.                     {
  4367.                         result = @class;
  4368.                         return result;
  4369.                     }
  4370.                 }
  4371.             }
  4372.             result = null;
  4373.             return result;
  4374.         }
  4375.         internal RoomUser method_44(int int_17, int int_18)
  4376.         {
  4377.             RoomUser result;
  4378.             if (this.RoomUser_0 != null)
  4379.             {
  4380.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  4381.                 {
  4382.                     RoomUser @class = this.RoomUser_0[i];
  4383.                     if (@class != null)
  4384.                     {
  4385.                         if (@class.int_3 == int_17 && @class.int_4 == int_18)
  4386.                         {
  4387.                             result = @class;
  4388.                             return result;
  4389.                         }
  4390.                         if (@class.int_12 == int_17 && @class.int_13 == int_18)
  4391.                         {
  4392.                             result = @class;
  4393.                             return result;
  4394.                         }
  4395.                     }
  4396.                 }
  4397.             }
  4398.             result = null;
  4399.             return result;
  4400.         }
  4401.         private List<RoomItem> method_45(int int_17, int int_18)
  4402.         {
  4403.             List<RoomItem> list = new List<RoomItem>();
  4404.             foreach (RoomItem @class in this.Hashtable_0.Values)
  4405.             {
  4406.                 if (@class.Int32_0 == int_17 && @class.Int32_1 == int_18)
  4407.                 {
  4408.                     list.Add(@class);
  4409.                 }
  4410.             }
  4411.             return list;
  4412.         }
  4413.         public void method_46(GameClient Session, bool bool_13)
  4414.         {
  4415.             RoomUser @class = new RoomUser(Session.GetHabbo().Id, this.Id, this.int_7++, Session.GetHabbo().isVisible);
  4416.             if (@class != null && @class.GetClient() != null && @class.GetClient().GetHabbo() != null)
  4417.             {
  4418.                 if (bool_13 || !@class.bool_12)
  4419.                 {
  4420.                     @class.bool_11 = true;
  4421.                 }
  4422.                 else
  4423.                 {
  4424.                    @class.method_7(this.Class28_0.int_0, this.Class28_0.int_1, this.Class28_0.double_0);
  4425.                     @class.method_9(this.Class28_0.int_2);
  4426.                     if (this.method_27(Session, true))
  4427.                     {
  4428.                         @class.method_11("flatctrl", "useradmin");
  4429.                     }
  4430.                     else
  4431.                     {
  4432.                         if (this.method_26(Session))
  4433.                         {
  4434.                             @class.method_11("flatctrl", "");
  4435.                         }
  4436.                     }
  4437.                     if (!@class.Boolean_4 && @class.GetClient().GetHabbo().bool_7)
  4438.                     {
  4439.                         RoomItem class2 = this.method_28(@class.GetClient().GetHabbo().uint_5);
  4440.                         if (class2 != null)
  4441.                         {
  4442.                            @class.method_7(class2.Int32_0, class2.Int32_1, class2.Double_0);
  4443.                             @class.method_9(class2.int_3);
  4444.                             class2.uint_4 = Session.GetHabbo().Id;
  4445.                             class2.ExtraData = "2";
  4446.                             class2.UpdateState(false, true);
  4447.                         }
  4448.                     }
  4449.                     @class.GetClient().GetHabbo().bool_7 = false;
  4450.                     @class.GetClient().GetHabbo().uint_5 = 0u;
  4451.                     ServerMessage Message = new ServerMessage(28u);
  4452.                     Message.AppendInt32(1);
  4453.                     @class.method_14(Message);
  4454.                     this.SendMessage(Message, null);
  4455.                 }
  4456.                 int num = this.method_5();
  4457.                 @class.int_20 = num;
  4458.                 this.RoomUser_0[num] = @class;
  4459.                 if (!bool_13)
  4460.                 {
  4461.                     this.bool_10 = true;
  4462.                 }
  4463.                 Session.GetHabbo().CurrentRoomId = this.uint_0;
  4464.                 Session.GetHabbo().GetMessenger().method_5(false);
  4465.                 Session.GetHabbo().RoomVisits++;
  4466.                 int num2 = Session.GetHabbo().RoomVisits;
  4467.                 if (num2 <= 500)
  4468.                 {
  4469.                     if (num2 <= 50)
  4470.                     {
  4471.                         if (num2 != 5)
  4472.                         {
  4473.                             if (num2 == 50)
  4474.                             {
  4475.                                 Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 2);
  4476.                             }
  4477.                         }
  4478.                         else
  4479.                         {
  4480.                             Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 1);
  4481.                         }
  4482.                     }
  4483.                     else
  4484.                     {
  4485.                         if (num2 != 100)
  4486.                         {
  4487.                             if (num2 != 200)
  4488.                             {
  4489.                                 if (num2 == 500)
  4490.                                 {
  4491.                                     Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 5);
  4492.                                 }
  4493.                             }
  4494.                             else
  4495.                             {
  4496.                                 Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 4);
  4497.                             }
  4498.                         }
  4499.                         else
  4500.                         {
  4501.                             Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 3);
  4502.                         }
  4503.                     }
  4504.                 }
  4505.                 else
  4506.                 {
  4507.                     if (num2 <= 1500)
  4508.                     {
  4509.                         if (num2 != 750)
  4510.                         {
  4511.                             if (num2 == 1500)
  4512.                             {
  4513.                                 Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 7);
  4514.                             }
  4515.                         }
  4516.                         else
  4517.                         {
  4518.                             Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 6);
  4519.                         }
  4520.                     }
  4521.                     else
  4522.                     {
  4523.                         if (num2 != 2500)
  4524.                         {
  4525.                             if (num2 != 4000)
  4526.                             {
  4527.                                 if (num2 == 5000)
  4528.                                 {
  4529.                                     Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 10);
  4530.                                 }
  4531.                             }
  4532.                             else
  4533.                             {
  4534.                                 Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 9);
  4535.                             }
  4536.                         }
  4537.                         else
  4538.                         {
  4539.                             Phoenix.GetGame().GetAchievementManager().addAchievement(Session, 13u, 8);
  4540.                         }
  4541.                     }
  4542.                 }
  4543.                 Session.GetHabbo().method_10(this.uint_0);
  4544.                 if (Session.GetHabbo().int_0 > 0)
  4545.                 {
  4546.                     GroupsManager class3 = Groups.smethod_2(Session.GetHabbo().int_0);
  4547.                     if (class3 != null && !this.list_17.Contains(class3))
  4548.                     {
  4549.                         this.list_17.Add(class3);
  4550.                         ServerMessage Message2 = new ServerMessage(309u);
  4551.                         Message2.AppendInt32(this.list_17.Count);
  4552.                         foreach (GroupsManager current in this.list_17)
  4553.                         {
  4554.                             Message2.AppendInt32(current.int_0);
  4555.                             Message2.AppendStringWithBreak(current.string_2);
  4556.                         }
  4557.                         this.SendMessage(Message2, null);
  4558.                     }
  4559.                 }
  4560.                 if (!bool_13)
  4561.                 {
  4562.                     this.method_51();
  4563.                     for (int i = 0; i < this.RoomUser_0.Length; i++)
  4564.                     {
  4565.                         RoomUser class4 = this.RoomUser_0[i];
  4566.                         if (class4 != null && class4.Boolean_4)
  4567.                         {
  4568.                             class4.BotAI.OnUserEnterRoom(@class);
  4569.                         }
  4570.                     }
  4571.                 }
  4572.             }
  4573.         }
  4574.         public void method_47(GameClient Session, bool bool_13, bool bool_14)
  4575.         {
  4576.             int num = 1;
  4577.             if (!bool_14 || !Session.GetHabbo().isAaron)
  4578.             {
  4579.                 if (this.bool_12)
  4580.                 {
  4581.                     if (bool_13 && Session != null)
  4582.                     {
  4583.                         if (bool_14)
  4584.                         {
  4585.                             ServerMessage Message = new ServerMessage(33u);
  4586.                             Message.AppendInt32(4008);
  4587.                             Session.SendMessage(Message);
  4588.                         }
  4589.                         ServerMessage Message5_ = new ServerMessage(18u);
  4590.                         Session.SendMessage(Message5_);
  4591.                     }
  4592.                 }
  4593.                 else
  4594.                 {
  4595.                     try
  4596.                     {
  4597.                         if (Session != null && Session.GetHabbo() != null)
  4598.                         {
  4599.                             num = 2;
  4600.                             RoomUser @class = this.method_53(Session.GetHabbo().Id);
  4601.                             if (@class != null)
  4602.                             {
  4603.                                 this.RoomUser_0[@class.int_20] = null;
  4604.                                 @class.int_20 = -1;
  4605.                                 this.byte_0[@class.int_3, @class.int_4] = @class.byte_0;
  4606.                             }
  4607.                             num = 3;
  4608.                             if (bool_13)
  4609.                             {
  4610.                                 if (bool_14)
  4611.                                 {
  4612.                                     ServerMessage Message = new ServerMessage(33u);
  4613.                                     Message.AppendInt32(4008);
  4614.                                     Session.SendMessage(Message);
  4615.                                 }
  4616.                                 ServerMessage Message5_ = new ServerMessage(18u);
  4617.                                 Session.SendMessage(Message5_);
  4618.                             }
  4619.                             num = 4;
  4620.                             if (@class != null && !@class.bool_11)
  4621.                             {
  4622.                                 if (@class.byte_1 > 0 && @class.GetClient() != null)
  4623.                                 {
  4624.                                     @class.GetClient().GetHabbo().method_24().int_0 = -1;
  4625.                                 }
  4626.                                 this.byte_0[@class.int_3, @class.int_4] = @class.byte_0;
  4627.                                 if (!this.Boolean_3)
  4628.                                 {
  4629.                                     ServerMessage Message2 = new ServerMessage(700u);
  4630.                                     Message2.AppendBoolean(false);
  4631.                                     Session.SendMessage(Message2);
  4632.                                 }
  4633.                                 ServerMessage Message3 = new ServerMessage(29u);
  4634.                                 Message3.AppendRawInt32(@class.VirtualId);
  4635.                                 this.SendMessage(Message3, null);
  4636.                                 if (this.method_74(Session.GetHabbo().Id))
  4637.                                 {
  4638.                                     this.method_78(Session.GetHabbo().Id);
  4639.                                 }
  4640.                                 num = 5;
  4641.                                 if (Session.GetHabbo().Username.ToLower() == this.Owner.ToLower() && this.Boolean_0)
  4642.                                 {
  4643.                                     this.Event = null;
  4644.                                     ServerMessage Logging = new ServerMessage(370u);
  4645.                                     Logging.AppendStringWithBreak("-1");
  4646.                                     this.SendMessage(Logging, null);
  4647.                                 }
  4648.                                 num = 6;
  4649.                                 if (@class.class34_1 != null)
  4650.                                 {
  4651.                                     @class.class34_1.RoomUser_0 = null;
  4652.                                     @class.class34_1 = null;
  4653.                                     Session.GetHabbo().method_24().int_0 = -1;
  4654.                                 }
  4655.                                 Session.GetHabbo().method_11();
  4656.                                 this.bool_10 = true;
  4657.                                 this.method_51();
  4658.                                 List<RoomUser> list = new List<RoomUser>();
  4659.                                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  4660.                                 {
  4661.                                     RoomUser class2 = this.RoomUser_0[i];
  4662.                                     if (class2 != null && class2.Boolean_4)
  4663.                                     {
  4664.                                         list.Add(class2);
  4665.                                     }
  4666.                                 }
  4667.                                 num = 7;
  4668.                                 foreach (RoomUser current in list)
  4669.                                 {
  4670.                                     //current.BotAI.OnUserLeaveRoom(Session);
  4671.                                 }
  4672.                             }
  4673.                         }
  4674.                     }
  4675.                     catch (Exception ex)
  4676.                     {
  4677.                         Logging.LogCriticalException(string.Concat(new object[]
  4678.                         {
  4679.                             "Error during removing user from room [Part: ",
  4680.                             num,
  4681.                             "]: ",
  4682.                             ex.ToString()
  4683.                         }));
  4684.                     }
  4685.                 }
  4686.             }
  4687.         }
  4688.         public RoomUser method_48(uint uint_2)
  4689.         {
  4690.             RoomUser result;
  4691.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4692.             {
  4693.                 RoomUser @class = this.RoomUser_0[i];
  4694.                 if (@class != null && @class.Boolean_4 && @class.isPet && @class.PetData != null && @class.PetData.PetId == uint_2)
  4695.                 {
  4696.                     result = @class;
  4697.                     return result;
  4698.                 }
  4699.             }
  4700.             result = null;
  4701.             return result;
  4702.         }
  4703.         public bool method_49(uint uint_2)
  4704.         {
  4705.             return this.method_48(uint_2) != null;
  4706.         }
  4707.         public void method_50()
  4708.         {
  4709.             this.UsersNow = this.Int32_0;
  4710.             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  4711.             {
  4712.                 @class.ExecuteQuery(string.Concat(new object[]
  4713.                 {
  4714.                     "UPDATE rooms SET users_now = '",
  4715.                     this.Int32_0,
  4716.                     "' WHERE Id = '",
  4717.                     this.uint_0,
  4718.                     "' LIMIT 1"
  4719.                 }));
  4720.             }
  4721.         }
  4722.         public void method_51()
  4723.         {
  4724.             this.UsersNow = this.Int32_0;
  4725.         }
  4726.         public RoomUser method_52(int int_17)
  4727.         {
  4728.             RoomUser result;
  4729.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4730.             {
  4731.                 RoomUser @class = this.RoomUser_0[i];
  4732.                 if (@class != null && @class.VirtualId == int_17)
  4733.                 {
  4734.                     result = @class;
  4735.                     return result;
  4736.                 }
  4737.             }
  4738.             result = null;
  4739.             return result;
  4740.         }
  4741.         public RoomUser method_53(uint uint_2)
  4742.         {
  4743.             RoomUser result;
  4744.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4745.             {
  4746.                 RoomUser @class = this.RoomUser_0[i];
  4747.                 if (@class != null && !@class.Boolean_4 && @class.uint_0 == uint_2)
  4748.                 {
  4749.                     result = @class;
  4750.                     return result;
  4751.                 }
  4752.             }
  4753.             result = null;
  4754.             return result;
  4755.         }
  4756.         public void method_54()
  4757.         {
  4758.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4759.             {
  4760.                 RoomUser @class = this.RoomUser_0[i];
  4761.                 if (@class != null && (!@class.Boolean_4 && @class.class34_1 == null))
  4762.                 {
  4763.                     @class.int_15 = 1;
  4764.                     ServerMessage Message = new ServerMessage(480u);
  4765.                     Message.AppendInt32(@class.VirtualId);
  4766.                     Message.AppendInt32(1);
  4767.                     this.SendMessage(Message, null);
  4768.                 }
  4769.             }
  4770.         }
  4771.         public void method_55()
  4772.         {
  4773.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4774.             {
  4775.                 RoomUser @class = this.RoomUser_0[i];
  4776.                 if (@class != null && (!@class.Boolean_4 && @class.class34_1 == null) && (!@class.Statusses.ContainsKey("sit") && !@class.Statusses.ContainsKey("lay") && @class.int_8 != 1 && @class.int_8 != 3 && @class.int_8 != 5 && @class.int_8 != 7))
  4777.                 {
  4778.                     @class.method_11("sit", ((@class.double_0 + 1.0) / 2.0 - @class.double_0 * 0.5).ToString());
  4779.                     @class.bool_7 = true;
  4780.                 }
  4781.             }
  4782.         }
  4783.         public RoomUser method_56(string string_10)
  4784.         {
  4785.             RoomUser result;
  4786.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4787.             {
  4788.                 RoomUser @class = this.RoomUser_0[i];
  4789.                 if (@class != null && !@class.Boolean_4 && @class.GetClient().GetHabbo() != null && @class.GetClient().GetHabbo().Username.ToLower() == string_10.ToLower())
  4790.                 {
  4791.                     result = @class;
  4792.                     return result;
  4793.                 }
  4794.             }
  4795.             result = null;
  4796.             return result;
  4797.         }
  4798.         public RoomUser method_57(string string_10)
  4799.         {
  4800.             RoomUser result;
  4801.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  4802.             {
  4803.                 RoomUser @class = this.RoomUser_0[i];
  4804.                 if (@class != null && @class.Boolean_4 && @class.class34_0.Name.ToLower() == string_10.ToLower())
  4805.                 {
  4806.                     result = @class;
  4807.                     return result;
  4808.                 }
  4809.             }
  4810.             result = null;
  4811.             return result;
  4812.         }
  4813.         internal void method_58(ServerMessage Message5_0, List<uint> list_18, uint uint_2)
  4814.         {
  4815.             List<uint> list = new List<uint>();
  4816.             if (list_18 != null)
  4817.             {
  4818.                 if (this.RoomUser_0 == null)
  4819.                 {
  4820.                     return;
  4821.                 }
  4822.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  4823.                 {
  4824.                     RoomUser @class = this.RoomUser_0[i];
  4825.                     if (@class != null && !@class.Boolean_4)
  4826.                     {
  4827.                         GameClient class2 = @class.GetClient();
  4828.                         if (class2 != null && class2.GetHabbo().Id != uint_2 && class2.GetHabbo().list_2.Contains(uint_2))
  4829.                         {
  4830.                             list.Add(class2.GetHabbo().Id);
  4831.                         }
  4832.                     }
  4833.                 }
  4834.             }
  4835.             this.SendMessage(Message5_0, list);
  4836.         }
  4837.         internal void SendMessage(ServerMessage Message5_0, List<uint> list_18)
  4838.         {
  4839.             try
  4840.             {
  4841.                 if (this.RoomUser_0 != null)
  4842.                 {
  4843.                     byte[] array = Message5_0.GetBytes();
  4844.                     for (int i = 0; i < this.RoomUser_0.Length; i++)
  4845.                     {
  4846.                         RoomUser @class = this.RoomUser_0[i];
  4847.                         if (@class != null && !@class.Boolean_4)
  4848.                         {
  4849.                             GameClient class2 = @class.GetClient();
  4850.                             if (class2 != null && (list_18 == null || !list_18.Contains(class2.GetHabbo().Id)))
  4851.                             {
  4852.                                 try
  4853.                                 {
  4854.                                     class2.GetConnection().SendData(array);
  4855.                                 }
  4856.                                 catch
  4857.                                 {
  4858.                                 }
  4859.                             }
  4860.                         }
  4861.                     }
  4862.                 }
  4863.             }
  4864.             catch (InvalidOperationException)
  4865.             {
  4866.             }
  4867.         }
  4868.         internal void method_60(ServerMessage Message5_0, int int_17)
  4869.         {
  4870.             try
  4871.             {
  4872.                 byte[] array = Message5_0.GetBytes();
  4873.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  4874.                 {
  4875.                     RoomUser @class = this.RoomUser_0[i];
  4876.                     if (@class != null && !@class.Boolean_4)
  4877.                     {
  4878.                         GameClient class2 = @class.GetClient();
  4879.                         if (class2 != null && class2.GetHabbo() != null && (ulong)class2.GetHabbo().Rank >= (ulong)((long)int_17))
  4880.                         {
  4881.                             try
  4882.                             {
  4883.                                 class2.GetConnection().SendData(array);
  4884.                             }
  4885.                             catch
  4886.                             {
  4887.                             }
  4888.                         }
  4889.                     }
  4890.                 }
  4891.             }
  4892.             catch (InvalidOperationException)
  4893.             {
  4894.             }
  4895.         }
  4896.         public void method_61(ServerMessage Message5_0)
  4897.         {
  4898.             try
  4899.             {
  4900.                 byte[] array = Message5_0.GetBytes();
  4901.                 for (int i = 0; i < this.RoomUser_0.Length; i++)
  4902.                 {
  4903.                     RoomUser @class = this.RoomUser_0[i];
  4904.                     if (@class != null && !@class.Boolean_4)
  4905.                     {
  4906.                         GameClient class2 = @class.GetClient();
  4907.                         if (class2 != null && this.method_26(class2))
  4908.                         {
  4909.                             try
  4910.                             {
  4911.                                 class2.GetConnection().SendData(array);
  4912.                             }
  4913.                             catch
  4914.                             {
  4915.                             }
  4916.                         }
  4917.                     }
  4918.                 }
  4919.             }
  4920.             catch (InvalidOperationException)
  4921.             {
  4922.             }
  4923.         }
  4924.         public void method_62()
  4925.         {
  4926.             this.SendMessage(new ServerMessage(18u), null);
  4927.             this.method_63();
  4928.         }
  4929.         public void method_63()
  4930.         {
  4931.             this.method_66(true);
  4932.             GC.SuppressFinalize(this);
  4933.         }
  4934.         internal void method_64()
  4935.         {
  4936.             StringBuilder stringBuilder = new StringBuilder();
  4937.             Dictionary<uint, bool> dictionary = new Dictionary<uint, bool>();
  4938.             try
  4939.             {
  4940.                 try
  4941.                 {
  4942.                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  4943.                     {
  4944.                         if (this.list_14.Count > 0)
  4945.                         {
  4946.                             lock (this.list_14)
  4947.                             {
  4948.                                 foreach (RoomItem class2 in this.list_14)
  4949.                                 {
  4950.                                     try
  4951.                                     {
  4952.                                         if (!dictionary.ContainsKey(class2.uint_0))
  4953.                                         {
  4954.                                             if (class2.string_2 != "" || class2.string_3 != "" || class2.string_4 != "" || class2.string_5 != "" || class2.string_6 != "")
  4955.                                             {
  4956.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra1", class2.string_2);
  4957.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra2", class2.string_3);
  4958.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra3", class2.string_4);
  4959.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra4", class2.string_5);
  4960.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra5", class2.string_6);
  4961.                                                 stringBuilder.Append(string.Concat(new object[]
  4962.                                                 {
  4963.                                                     "DELETE FROM wired_items WHERE item_id = '",
  4964.                                                     class2.uint_0,
  4965.                                                     "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  4966.                                                     class2.uint_0,
  4967.                                                     "',@",
  4968.                                                     class2.uint_0,
  4969.                                                     "Extra1,@",
  4970.                                                     class2.uint_0,
  4971.                                                     "Extra2,@",
  4972.                                                     class2.uint_0,
  4973.                                                     "Extra3,@",
  4974.                                                     class2.uint_0,
  4975.                                                     "Extra4,@",
  4976.                                                     class2.uint_0,
  4977.                                                     "Extra5); "
  4978.                                                 }));
  4979.                                             }
  4980.                                             dictionary.Add(class2.uint_0, true);
  4981.                                         }
  4982.                                     }
  4983.                                     catch
  4984.                                     {
  4985.                                     }
  4986.                                 }
  4987.                             }
  4988.                         }
  4989.                         if (this.list_15.Count > 0)
  4990.                         {
  4991.                             lock (this.list_15)
  4992.                             {
  4993.                                 foreach (RoomItem class2 in this.list_15)
  4994.                                 {
  4995.                                     try
  4996.                                     {
  4997.                                         if (!dictionary.ContainsKey(class2.uint_0))
  4998.                                         {
  4999.                                             if (class2.string_2 != "" || class2.string_3 != "" || class2.string_4 != "" || class2.string_5 != "" || class2.string_6 != "")
  5000.                                             {
  5001.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra1", class2.string_2);
  5002.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra2", class2.string_3);
  5003.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra3", class2.string_4);
  5004.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra4", class2.string_5);
  5005.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra5", class2.string_6);
  5006.                                                 stringBuilder.Append(string.Concat(new object[]
  5007.                                                 {
  5008.                                                     "DELETE FROM wired_items WHERE item_id = '",
  5009.                                                     class2.uint_0,
  5010.                                                     "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5011.                                                     class2.uint_0,
  5012.                                                     "',@",
  5013.                                                     class2.uint_0,
  5014.                                                     "Extra1,@",
  5015.                                                     class2.uint_0,
  5016.                                                     "Extra2,@",
  5017.                                                     class2.uint_0,
  5018.                                                     "Extra3,@",
  5019.                                                     class2.uint_0,
  5020.                                                     "Extra4,@",
  5021.                                                     class2.uint_0,
  5022.                                                     "Extra5); "
  5023.                                                 }));
  5024.                                             }
  5025.                                             dictionary.Add(class2.uint_0, true);
  5026.                                         }
  5027.                                     }
  5028.                                     catch
  5029.                                     {
  5030.                                     }
  5031.                                 }
  5032.                             }
  5033.                         }
  5034.                         if (this.list_16.Count > 0)
  5035.                         {
  5036.                             lock (this.list_16)
  5037.                             {
  5038.                                 foreach (RoomItem class2 in this.list_16)
  5039.                                 {
  5040.                                     try
  5041.                                     {
  5042.                                         if (!dictionary.ContainsKey(class2.uint_0))
  5043.                                         {
  5044.                                             if (class2.string_2 != "" || class2.string_3 != "" || class2.string_4 != "" || class2.string_5 != "" || class2.string_6 != "")
  5045.                                             {
  5046.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra1", class2.string_2);
  5047.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra2", class2.string_3);
  5048.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra3", class2.string_4);
  5049.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra4", class2.string_5);
  5050.                                                 @class.AddParamWithValue(class2.uint_0 + "Extra5", class2.string_6);
  5051.                                                 stringBuilder.Append(string.Concat(new object[]
  5052.                                                 {
  5053.                                                     "DELETE FROM wired_items WHERE item_id = '",
  5054.                                                     class2.uint_0,
  5055.                                                     "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5056.                                                     class2.uint_0,
  5057.                                                     "',@",
  5058.                                                     class2.uint_0,
  5059.                                                     "Extra1,@",
  5060.                                                     class2.uint_0,
  5061.                                                     "Extra2,@",
  5062.                                                     class2.uint_0,
  5063.                                                     "Extra3,@",
  5064.                                                     class2.uint_0,
  5065.                                                     "Extra4,@",
  5066.                                                     class2.uint_0,
  5067.                                                     "Extra5); "
  5068.                                                 }));
  5069.                                             }
  5070.                                             dictionary.Add(class2.uint_0, true);
  5071.                                         }
  5072.                                     }
  5073.                                     catch
  5074.                                     {
  5075.                                     }
  5076.                                 }
  5077.                             }
  5078.                         }
  5079.                         if (stringBuilder.Length > 0)
  5080.                         {
  5081.                             @class.ExecuteQuery(stringBuilder.ToString());
  5082.                         }
  5083.                         dictionary.Clear();
  5084.                     }
  5085.                 }
  5086.                 catch (Exception ex)
  5087.                 {
  5088.                     Logging.LogCriticalException(string.Concat(new object[]
  5089.                     {
  5090.                         "Error during saving wired items for room ",
  5091.                         this.Id,
  5092.                         ". Stack: ",
  5093.                         ex.ToString(),
  5094.                         "\rQuery: ",
  5095.                         stringBuilder.ToString()
  5096.                     }));
  5097.                 }
  5098.                 if (this.hashtable_3.Count > 0 || this.hashtable_1.Count > 0 || this.hashtable_2.Count > 0 || this.Boolean_4)
  5099.                 {
  5100.                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  5101.                     {
  5102.                         stringBuilder.Clear();
  5103.                         lock (this.hashtable_1)
  5104.                         {
  5105.                             foreach (RoomItem class2 in this.hashtable_1.Values)
  5106.                             {
  5107.                                 stringBuilder.Append(string.Concat(new object[]
  5108.                                 {
  5109.                                     "UPDATE items SET room_id = '0' WHERE Id = '",
  5110.                                     class2.uint_0,
  5111.                                     "' AND room_id = '",
  5112.                                     this.Id,
  5113.                                     "' LIMIT 1; "
  5114.                                 }));
  5115.                             }
  5116.                         }
  5117.                         this.hashtable_1.Clear();
  5118.                         lock (this.hashtable_3)
  5119.                         {
  5120.                             if (this.hashtable_3.Count > 0)
  5121.                             {
  5122.                                 int num = 0;
  5123.                                 int num2 = 0;
  5124.                                 foreach (RoomItem class2 in this.hashtable_3.Values)
  5125.                                 {
  5126.                                     if (class2.Boolean_2)
  5127.                                     {
  5128.                                         num2++;
  5129.                                     }
  5130.                                     else
  5131.                                     {
  5132.                                         num++;
  5133.                                     }
  5134.                                 }
  5135.                                 if (num2 > 0)
  5136.                                 {
  5137.                                     foreach (RoomItem class2 in this.hashtable_3.Values)
  5138.                                     {
  5139.                                         if (class2.Boolean_2)
  5140.                                         {
  5141.                                             @class.AddParamWithValue("extra_data" + class2.uint_0, class2.ExtraData);
  5142.                                             stringBuilder.Append(string.Concat(new object[]
  5143.                                             {
  5144.                                                 "UPDATE items SET room_id = '",
  5145.                                                 this.Id,
  5146.                                                 "', base_item = '",
  5147.                                                 class2.uint_2,
  5148.                                                 "', extra_data = @extra_data",
  5149.                                                 class2.uint_0,
  5150.                                                 ", x = '",
  5151.                                                 class2.Int32_0,
  5152.                                                 "', y = '",
  5153.                                                 class2.Int32_1,
  5154.                                                 "', z = '",
  5155.                                                 class2.Double_0,
  5156.                                                 "', rot = '",
  5157.                                                 class2.int_3,
  5158.                                                 "', wall_pos = '' WHERE Id = '",
  5159.                                                 class2.uint_0,
  5160.                                                 "' LIMIT 1; "
  5161.                                             }));
  5162.                                         }
  5163.                                     }
  5164.                                 }
  5165.                                 if (num > 0)
  5166.                                 {
  5167.                                     foreach (RoomItem class2 in this.hashtable_3.Values)
  5168.                                     {
  5169.                                         if (class2.Boolean_1)
  5170.                                         {
  5171.                                             @class.AddParamWithValue("extra_data" + class2.uint_0, class2.ExtraData);
  5172.                                             @class.AddParamWithValue("pos" + class2.uint_0, class2.string_7);
  5173.                                             stringBuilder.Append(string.Concat(new object[]
  5174.                                             {
  5175.                                                 "UPDATE items SET room_id = '",
  5176.                                                 this.Id,
  5177.                                                 "', base_item = '",
  5178.                                                 class2.uint_2,
  5179.                                                 "', extra_data = @extra_data",
  5180.                                                 class2.uint_0,
  5181.                                                 ", x = '0', y = '0', z = '0', rot = '0', wall_pos = @pos",
  5182.                                                 class2.uint_0,
  5183.                                                 " WHERE Id = '",
  5184.                                                 class2.uint_0,
  5185.                                                 "' LIMIT 1; "
  5186.                                             }));
  5187.                                         }
  5188.                                     }
  5189.                                 }
  5190.                             }
  5191.                         }
  5192.                         this.hashtable_3.Clear();
  5193.                         lock (this.hashtable_2)
  5194.                         {
  5195.                             foreach (RoomItem class2 in this.hashtable_2.Values)
  5196.                             {
  5197.                                 @class.AddParamWithValue("mextra_data" + class2.uint_0, class2.ExtraData);
  5198.                                 stringBuilder.Append(string.Concat(new object[]
  5199.                                 {
  5200.                                     "UPDATE items SET x = '",
  5201.                                     class2.Int32_0,
  5202.                                     "', y = '",
  5203.                                     class2.Int32_1,
  5204.                                     "', z = '",
  5205.                                     class2.Double_0,
  5206.                                     "', rot = '",
  5207.                                     class2.int_3,
  5208.                                     "', wall_pos = '",
  5209.                                     class2.string_7,
  5210.                                     "', extra_data = @mextra_data",
  5211.                                     class2.uint_0,
  5212.                                     " WHERE Id = '",
  5213.                                     class2.uint_0,
  5214.                                     "' LIMIT 1; "
  5215.                                 }));
  5216.                             }
  5217.                         }
  5218.                         this.hashtable_2.Clear();
  5219.                         lock (this.method_2())
  5220.                         {
  5221.                             foreach (Pet current in this.method_2())
  5222.                             {
  5223.                                 if (current.DBState == DatabaseUpdateState.NeedsInsert)
  5224.                                 {
  5225.                                     @class.AddParamWithValue("petname" + current.PetId, current.Name);
  5226.                                     @class.AddParamWithValue("petcolor" + current.PetId, current.Color);
  5227.                                     @class.AddParamWithValue("petrace" + current.PetId, current.Race);
  5228.                                     stringBuilder.Append(string.Concat(new object[]
  5229.                                     {
  5230.                                         "INSERT INTO `user_pets` VALUES ('",
  5231.                                         current.PetId,
  5232.                                         "', '",
  5233.                                         current.OwnerId,
  5234.                                         "', '",
  5235.                                         current.RoomId,
  5236.                                         "', @petname",
  5237.                                         current.PetId,
  5238.                                         ", @petrace",
  5239.                                         current.PetId,
  5240.                                         ", @petcolor",
  5241.                                         current.PetId,
  5242.                                         ", '",
  5243.                                         current.Type,
  5244.                                         "', '",
  5245.                                         current.Expirience,
  5246.                                         "', '",
  5247.                                         current.Energy,
  5248.                                         "', '",
  5249.                                         current.Nutrition,
  5250.                                         "', '",
  5251.                                         current.Respect,
  5252.                                         "', '",
  5253.                                         current.CreationStamp,
  5254.                                         "', '",
  5255.                                         current.X,
  5256.                                         "', '",
  5257.                                         current.Y,
  5258.                                         "', '",
  5259.                                         current.Z,
  5260.                                         "'); "
  5261.                                     }));
  5262.                                 }
  5263.                                 else
  5264.                                 {
  5265.                                     if (current.DBState == DatabaseUpdateState.NeedsUpdate)
  5266.                                     {
  5267.                                         stringBuilder.Append(string.Concat(new object[]
  5268.                                         {
  5269.                                             "UPDATE user_pets SET room_id = '",
  5270.                                             current.RoomId,
  5271.                                             "', expirience = '",
  5272.                                             current.Expirience,
  5273.                                             "', energy = '",
  5274.                                             current.Energy,
  5275.                                             "', nutrition = '",
  5276.                                             current.Nutrition,
  5277.                                             "', respect = '",
  5278.                                             current.Respect,
  5279.                                             "', x = '",
  5280.                                             current.X,
  5281.                                             "', y = '",
  5282.                                             current.Y,
  5283.                                             "', z = '",
  5284.                                             current.Z,
  5285.                                             "' WHERE Id = '",
  5286.                                             current.PetId,
  5287.                                             "' LIMIT 1; "
  5288.                                         }));
  5289.                                     }
  5290.                                 }
  5291.                                 current.DBState = DatabaseUpdateState.Updated;
  5292.                             }
  5293.                         }
  5294.                         if (stringBuilder.Length > 0)
  5295.                         {
  5296.                             @class.ExecuteQuery(stringBuilder.ToString());
  5297.                         }
  5298.                     }
  5299.                 }
  5300.             }
  5301.             catch (Exception ex)
  5302.             {
  5303.                 Logging.LogCriticalException(string.Concat(new object[]
  5304.                 {
  5305.                     "Error during saving furniture for room ",
  5306.                     this.Id,
  5307.                     ". Stack: ",
  5308.                     ex.ToString(),
  5309.                     "\r Query: ",
  5310.                     stringBuilder.ToString()
  5311.                 }));
  5312.             }
  5313.         }
  5314.         internal void method_65(DatabaseClient class6_0)
  5315.         {
  5316.             try
  5317.             {
  5318.                 Dictionary<uint, bool> dictionary = new Dictionary<uint, bool>();
  5319.                 StringBuilder stringBuilder = new StringBuilder();
  5320.                 if (this.list_14.Count > 0)
  5321.                 {
  5322.                     foreach (RoomItem @class in this.list_14)
  5323.                     {
  5324.                         if (@class.string_2 != "" || @class.string_3 != "" || @class.string_4 != "" || @class.string_5 != "" || @class.string_6 != "")
  5325.                         {
  5326.                             try
  5327.                             {
  5328.                                 if (!dictionary.ContainsKey(@class.uint_0))
  5329.                                 {
  5330.                                     if (@class.string_2 != "" || @class.string_3 != "" || @class.string_4 != "" || @class.string_5 != "" || @class.string_6 != "")
  5331.                                     {
  5332.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra1", @class.string_2);
  5333.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra2", @class.string_3);
  5334.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra3", @class.string_4);
  5335.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra4", @class.string_5);
  5336.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra5", @class.string_6);
  5337.                                         stringBuilder.Append(string.Concat(new object[]
  5338.                                         {
  5339.                                             "DELETE FROM wired_items WHERE item_id = '",
  5340.                                             @class.uint_0,
  5341.                                             "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5342.                                             @class.uint_0,
  5343.                                             "',@",
  5344.                                             @class.uint_0,
  5345.                                             "Extra1,@",
  5346.                                             @class.uint_0,
  5347.                                             "Extra2,@",
  5348.                                             @class.uint_0,
  5349.                                             "Extra3,@",
  5350.                                             @class.uint_0,
  5351.                                             "Extra4,@",
  5352.                                             @class.uint_0,
  5353.                                             "Extra5); "
  5354.                                         }));
  5355.                                     }
  5356.                                     dictionary.Add(@class.uint_0, true);
  5357.                                 }
  5358.                             }
  5359.                             catch
  5360.                             {
  5361.                             }
  5362.                         }
  5363.                     }
  5364.                 }
  5365.                 if (this.list_15.Count > 0)
  5366.                 {
  5367.                     foreach (RoomItem @class in this.list_15)
  5368.                     {
  5369.                         if (@class.string_2 != "" || @class.string_3 != "" || @class.string_4 != "" || @class.string_5 != "" || @class.string_6 != "")
  5370.                         {
  5371.                             try
  5372.                             {
  5373.                                 if (!dictionary.ContainsKey(@class.uint_0))
  5374.                                 {
  5375.                                     if (@class.string_2 != "" || @class.string_3 != "" || @class.string_4 != "" || @class.string_5 != "" || @class.string_6 != "")
  5376.                                     {
  5377.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra1", @class.string_2);
  5378.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra2", @class.string_3);
  5379.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra3", @class.string_4);
  5380.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra4", @class.string_5);
  5381.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra5", @class.string_6);
  5382.                                         stringBuilder.Append(string.Concat(new object[]
  5383.                                         {
  5384.                                             "DELETE FROM wired_items WHERE item_id = '",
  5385.                                             @class.uint_0,
  5386.                                             "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5387.                                             @class.uint_0,
  5388.                                             "',@",
  5389.                                             @class.uint_0,
  5390.                                             "Extra1,@",
  5391.                                             @class.uint_0,
  5392.                                             "Extra2,@",
  5393.                                             @class.uint_0,
  5394.                                             "Extra3,@",
  5395.                                             @class.uint_0,
  5396.                                             "Extra4,@",
  5397.                                             @class.uint_0,
  5398.                                             "Extra5); "
  5399.                                         }));
  5400.                                     }
  5401.                                     dictionary.Add(@class.uint_0, true);
  5402.                                 }
  5403.                             }
  5404.                             catch
  5405.                             {
  5406.                             }
  5407.                         }
  5408.                     }
  5409.                 }
  5410.                 if (this.list_16.Count > 0)
  5411.                 {
  5412.                     foreach (RoomItem @class in this.list_16)
  5413.                     {
  5414.                         if (@class.string_2 != "" || @class.string_3 != "" || @class.string_4 != "" || @class.string_5 != "" || @class.string_6 != "")
  5415.                         {
  5416.                             try
  5417.                             {
  5418.                                 if (!dictionary.ContainsKey(@class.uint_0))
  5419.                                 {
  5420.                                     if (@class.string_2 != "" || @class.string_3 != "" || @class.string_4 != "" || @class.string_5 != "" || @class.string_6 != "")
  5421.                                     {
  5422.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra1", @class.string_2);
  5423.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra2", @class.string_3);
  5424.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra3", @class.string_4);
  5425.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra4", @class.string_5);
  5426.                                         class6_0.AddParamWithValue(@class.uint_0 + "Extra5", @class.string_6);
  5427.                                         stringBuilder.Append(string.Concat(new object[]
  5428.                                         {
  5429.                                             "DELETE FROM wired_items WHERE item_id = '",
  5430.                                             @class.uint_0,
  5431.                                             "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5432.                                             @class.uint_0,
  5433.                                             "',@",
  5434.                                             @class.uint_0,
  5435.                                             "Extra1,@",
  5436.                                             @class.uint_0,
  5437.                                             "Extra2,@",
  5438.                                             @class.uint_0,
  5439.                                             "Extra3,@",
  5440.                                             @class.uint_0,
  5441.                                             "Extra4,@",
  5442.                                             @class.uint_0,
  5443.                                             "Extra5); "
  5444.                                         }));
  5445.                                     }
  5446.                                     dictionary.Add(@class.uint_0, true);
  5447.                                 }
  5448.                             }
  5449.                             catch
  5450.                             {
  5451.                             }
  5452.                         }
  5453.                     }
  5454.                 }
  5455.                 dictionary.Clear();
  5456.                 if (this.hashtable_3.Count > 0 || this.hashtable_1.Count > 0 || this.hashtable_2.Count > 0 || this.Boolean_4)
  5457.                 {
  5458.                     foreach (RoomItem @class in this.hashtable_1.Values)
  5459.                     {
  5460.                         stringBuilder.Append(string.Concat(new object[]
  5461.                         {
  5462.                             "UPDATE items SET room_id = 0 WHERE Id = '",
  5463.                             @class.uint_0,
  5464.                             "' AND room_id = '",
  5465.                             this.Id,
  5466.                             "' LIMIT 1; "
  5467.                         }));
  5468.                     }
  5469.                     this.hashtable_1.Clear();
  5470.                     IEnumerator enumerator2;
  5471.                     if (this.hashtable_3.Count > 0)
  5472.                     {
  5473.                         enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5474.                         try
  5475.                         {
  5476.                             while (enumerator2.MoveNext())
  5477.                             {
  5478.                                 RoomItem @class = (RoomItem)enumerator2.Current;
  5479.                                 stringBuilder.Append("UPDATE items SET room_id = 0 WHERE Id = '" + @class.uint_0 + "' LIMIT 1; ");
  5480.                             }
  5481.                         }
  5482.                         finally
  5483.                         {
  5484.                             IDisposable disposable = enumerator2 as IDisposable;
  5485.                             if (disposable != null)
  5486.                             {
  5487.                                 disposable.Dispose();
  5488.                             }
  5489.                         }
  5490.                         int num = 0;
  5491.                         int num2 = 0;
  5492.                         enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5493.                         try
  5494.                         {
  5495.                             while (enumerator2.MoveNext())
  5496.                             {
  5497.                                 RoomItem @class = (RoomItem)enumerator2.Current;
  5498.                                 if (@class.Boolean_2)
  5499.                                 {
  5500.                                     num2++;
  5501.                                 }
  5502.                                 else
  5503.                                 {
  5504.                                     num++;
  5505.                                 }
  5506.                             }
  5507.                         }
  5508.                         finally
  5509.                         {
  5510.                             IDisposable disposable = enumerator2 as IDisposable;
  5511.                             if (disposable != null)
  5512.                             {
  5513.                                 disposable.Dispose();
  5514.                             }
  5515.                         }
  5516.                         if (num2 > 0)
  5517.                         {
  5518.                             enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5519.                             try
  5520.                             {
  5521.                                 while (enumerator2.MoveNext())
  5522.                                 {
  5523.                                     RoomItem @class = (RoomItem)enumerator2.Current;
  5524.                                     if (@class.Boolean_2)
  5525.                                     {
  5526.                                         class6_0.AddParamWithValue("extra_data" + @class.uint_0, @class.ExtraData);
  5527.                                         stringBuilder.Append(string.Concat(new object[]
  5528.                                         {
  5529.                                             "UPDATE items SET room_id = '",
  5530.                                             this.Id,
  5531.                                             "', base_item = '",
  5532.                                             @class.uint_2,
  5533.                                             "', extra_data = @extra_data",
  5534.                                             @class.uint_0,
  5535.                                             ", x = '",
  5536.                                             @class.Int32_0,
  5537.                                             "', y = '",
  5538.                                             @class.Int32_1,
  5539.                                             "', z = '",
  5540.                                             @class.Double_0,
  5541.                                             "', rot = '",
  5542.                                             @class.int_3,
  5543.                                             "', wall_pos = '' WHERE Id = '",
  5544.                                             @class.uint_0,
  5545.                                             "' LIMIT 1; "
  5546.                                         }));
  5547.                                     }
  5548.                                 }
  5549.                             }
  5550.                             finally
  5551.                             {
  5552.                                 IDisposable disposable = enumerator2 as IDisposable;
  5553.                                 if (disposable != null)
  5554.                                 {
  5555.                                     disposable.Dispose();
  5556.                                 }
  5557.                             }
  5558.                         }
  5559.                         if (num > 0)
  5560.                         {
  5561.                             enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5562.                             try
  5563.                             {
  5564.                                 while (enumerator2.MoveNext())
  5565.                                 {
  5566.                                     RoomItem @class = (RoomItem)enumerator2.Current;
  5567.                                     if (@class.Boolean_1)
  5568.                                     {
  5569.                                         class6_0.AddParamWithValue("extra_data" + @class.uint_0, @class.ExtraData);
  5570.                                         class6_0.AddParamWithValue("pos" + @class.uint_0, @class.string_7);
  5571.                                         stringBuilder.Append(string.Concat(new object[]
  5572.                                         {
  5573.                                             "UPDATE items SET room_id = '",
  5574.                                             this.Id,
  5575.                                             "', base_item = '",
  5576.                                             @class.uint_2,
  5577.                                             "', extra_data = @extra_data",
  5578.                                             @class.uint_0,
  5579.                                             ", x = '0', y = '0', z = '0', rot = '0', wall_pos = @pos",
  5580.                                             @class.uint_0,
  5581.                                             " WHERE Id = '",
  5582.                                             @class.uint_0,
  5583.                                             "' LIMIT 1; "
  5584.                                         }));
  5585.                                     }
  5586.                                 }
  5587.                             }
  5588.                             finally
  5589.                             {
  5590.                                 IDisposable disposable = enumerator2 as IDisposable;
  5591.                                 if (disposable != null)
  5592.                                 {
  5593.                                     disposable.Dispose();
  5594.                                 }
  5595.                             }
  5596.                         }
  5597.                         this.hashtable_3.Clear();
  5598.                     }
  5599.                     enumerator2 = this.hashtable_2.Values.GetEnumerator();
  5600.                     try
  5601.                     {
  5602.                         while (enumerator2.MoveNext())
  5603.                         {
  5604.                             RoomItem @class = (RoomItem)enumerator2.Current;
  5605.                             stringBuilder.Append(string.Concat(new object[]
  5606.                             {
  5607.                                 "UPDATE items SET x = '",
  5608.                                 @class.Int32_0,
  5609.                                 "', y = '",
  5610.                                 @class.Int32_1,
  5611.                                 "', z = '",
  5612.                                 @class.Double_0,
  5613.                                 "', rot = '",
  5614.                                 @class.int_3,
  5615.                                 "', wall_pos = '' WHERE Id = '",
  5616.                                 @class.uint_0,
  5617.                                 "' LIMIT 1; "
  5618.                             }));
  5619.                         }
  5620.                     }
  5621.                     finally
  5622.                     {
  5623.                         IDisposable disposable = enumerator2 as IDisposable;
  5624.                         if (disposable != null)
  5625.                         {
  5626.                             disposable.Dispose();
  5627.                         }
  5628.                     }
  5629.                     this.hashtable_2.Clear();
  5630.                     foreach (Pet current in this.method_2())
  5631.                     {
  5632.                         if (current.DBState == DatabaseUpdateState.NeedsInsert)
  5633.                         {
  5634.                             class6_0.AddParamWithValue("petname" + current.PetId, current.Name);
  5635.                             class6_0.AddParamWithValue("petcolor" + current.PetId, current.Color);
  5636.                             class6_0.AddParamWithValue("petrace" + current.PetId, current.Race);
  5637.                             stringBuilder.Append(string.Concat(new object[]
  5638.                             {
  5639.                                 "INSERT INTO `user_pets` VALUES ('",
  5640.                                 current.PetId,
  5641.                                 "', '",
  5642.                                 current.OwnerId,
  5643.                                 "', '",
  5644.                                 current.RoomId,
  5645.                                 "', @petname",
  5646.                                 current.PetId,
  5647.                                 ", @petrace",
  5648.                                 current.PetId,
  5649.                                 ", @petcolor",
  5650.                                 current.PetId,
  5651.                                 ", '",
  5652.                                 current.Type,
  5653.                                 "', '",
  5654.                                 current.Expirience,
  5655.                                 "', '",
  5656.                                 current.Energy,
  5657.                                 "', '",
  5658.                                 current.Nutrition,
  5659.                                 "', '",
  5660.                                 current.Respect,
  5661.                                 "', '",
  5662.                                 current.CreationStamp,
  5663.                                 "', '",
  5664.                                 current.X,
  5665.                                 "', '",
  5666.                                 current.Y,
  5667.                                 "', '",
  5668.                                 current.Z,
  5669.                                 "');"
  5670.                             }));
  5671.                         }
  5672.                         else
  5673.                         {
  5674.                             if (current.DBState == DatabaseUpdateState.NeedsUpdate)
  5675.                             {
  5676.                                 stringBuilder.Append(string.Concat(new object[]
  5677.                                 {
  5678.                                     "UPDATE user_pets SET room_id = '",
  5679.                                     current.RoomId,
  5680.                                     "', expirience = '",
  5681.                                     current.Expirience,
  5682.                                     "', energy = '",
  5683.                                     current.Energy,
  5684.                                     "', nutrition = '",
  5685.                                     current.Nutrition,
  5686.                                     "', respect = '",
  5687.                                     current.Respect,
  5688.                                     "', x = '",
  5689.                                     current.X,
  5690.                                     "', y = '",
  5691.                                     current.Y,
  5692.                                     "', z = '",
  5693.                                     current.Z,
  5694.                                     "' WHERE Id = '",
  5695.                                     current.PetId,
  5696.                                     "' LIMIT 1; "
  5697.                                 }));
  5698.                             }
  5699.                         }
  5700.                         current.DBState = DatabaseUpdateState.Updated;
  5701.                     }
  5702.                 }
  5703.                 if (stringBuilder.Length > 0)
  5704.                 {
  5705.                     class6_0.ExecuteQuery(stringBuilder.ToString());
  5706.                 }
  5707.             }
  5708.             catch (Exception ex)
  5709.             {
  5710.                 Logging.LogCriticalException(string.Concat(new object[]
  5711.                 {
  5712.                     "Error during saving furniture for room ",
  5713.                     this.Id,
  5714.                     ". Stack: ",
  5715.                     ex.ToString()
  5716.                 }));
  5717.             }
  5718.         }
  5719.         private void method_66(bool bool_13)
  5720.         {
  5721.             if (!this.bool_12)
  5722.             {
  5723.                 this.bool_12 = true;
  5724.                 if (bool_13)
  5725.                 {
  5726.                     this.bool_11 = false;
  5727.                     if (this.timer_0 != null)
  5728.                     {
  5729.                         this.bool_6 = true;
  5730.                         this.timer_0.Change(-1, -1);
  5731.                     }
  5732.                     this.method_64();
  5733.                     using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  5734.                     {
  5735.                         @class.ExecuteQuery(string.Concat(new object[]
  5736.                         {
  5737.                             "UPDATE user_pets SET room_id = 0 WHERE room_id = ",
  5738.                             this.uint_0,
  5739.                             " AND NOT user_id = ",
  5740.                             Phoenix.GetGame().GetClientManager().method_27(this.Owner)
  5741.                         }));
  5742.                     }
  5743.                     this.timer_0.Dispose();
  5744.                     this.timer_0 = null;
  5745.                     this.bool_9 = false;
  5746.                     if (this.Tags != null)
  5747.                     {
  5748.                         this.Tags.Clear();
  5749.                     }
  5750.                     this.Tags = null;
  5751.                     if (this.RoomUser_0 != null)
  5752.                     {
  5753.                         Array.Clear(this.RoomUser_0, 0, this.RoomUser_0.Length);
  5754.                     }
  5755.                     this.RoomUser_0 = null;
  5756.                     this.class29_0 = null;
  5757.                     if (this.list_1 != null)
  5758.                     {
  5759.                         this.list_1.Clear();
  5760.                     }
  5761.                     this.class29_0 = null;
  5762.                     if (this.dictionary_0 != null)
  5763.                     {
  5764.                         this.dictionary_0.Clear();
  5765.                     }
  5766.                     this.dictionary_0 = null;
  5767.                     this.Wallpaper = null;
  5768.                     this.Floor = null;
  5769.                     this.Landscape = null;
  5770.                     if (this.hashtable_0 != null)
  5771.                     {
  5772.                         this.hashtable_0.Clear();
  5773.                     }
  5774.                     this.hashtable_0 = null;
  5775.                     if (this.hashtable_4 != null)
  5776.                     {
  5777.                         this.hashtable_4.Clear();
  5778.                     }
  5779.                     this.hashtable_4 = null;
  5780.                     this.class67_0 = null;
  5781.                     if (this.list_2 != null)
  5782.                     {
  5783.                         this.list_2.Clear();
  5784.                     }
  5785.                     this.list_2 = null;
  5786.                 }
  5787.             }
  5788.         }
  5789.         public ServerMessage method_67(bool bool_13)
  5790.         {
  5791.             List<RoomUser> list = new List<RoomUser>();
  5792.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  5793.             {
  5794.                 RoomUser @class = this.RoomUser_0[i];
  5795.                 if (@class != null)
  5796.                 {
  5797.                     if (!bool_13)
  5798.                     {
  5799.                         if (!@class.bool_7)
  5800.                         {
  5801.                             goto IL_35;
  5802.                         }
  5803.                         @class.bool_7 = false;
  5804.                     }
  5805.                     list.Add(@class);
  5806.                 }
  5807.             IL_35:;
  5808.             }
  5809.             ServerMessage result;
  5810.             if (list.Count == 0)
  5811.             {
  5812.                 result = null;
  5813.             }
  5814.             else
  5815.             {
  5816.                 ServerMessage Message = new ServerMessage(34u);
  5817.                 Message.AppendInt32(list.Count);
  5818.                 foreach (RoomUser @class in list)
  5819.                 {
  5820.                     @class.method_15(Message);
  5821.                 }
  5822.                 result = Message;
  5823.             }
  5824.             return result;
  5825.         }
  5826.         public bool method_68(uint uint_2)
  5827.         {
  5828.             return this.dictionary_0.ContainsKey(uint_2);
  5829.         }
  5830.         public void method_69(uint uint_2)
  5831.         {
  5832.             this.dictionary_0.Remove(uint_2);
  5833.         }
  5834.         public void method_70(uint uint_2)
  5835.         {
  5836.             this.dictionary_0.Add(uint_2, Phoenix.GetUnixTimestamp());
  5837.         }
  5838.         public bool method_71(uint uint_2)
  5839.         {
  5840.             bool result;
  5841.             if (!this.method_68(uint_2))
  5842.             {
  5843.                 result = true;
  5844.             }
  5845.             else
  5846.             {
  5847.                 double num = Phoenix.GetUnixTimestamp() - this.dictionary_0[uint_2];
  5848.                 result = (num > 900.0);
  5849.             }
  5850.             return result;
  5851.         }
  5852.         public int method_72(string string_10)
  5853.         {
  5854.             int num = 0;
  5855.             foreach (RoomItem @class in this.Hashtable_1.Values)
  5856.             {
  5857.                 if (@class.GetBaseItem().InteractionType.ToLower() == string_10.ToLower())
  5858.                 {
  5859.                     num++;
  5860.                 }
  5861.             }
  5862.             foreach (RoomItem @class in this.Hashtable_0.Values)
  5863.             {
  5864.                 if (@class.GetBaseItem().InteractionType.ToLower() == string_10.ToLower())
  5865.                 {
  5866.                     num++;
  5867.                 }
  5868.             }
  5869.             return num;
  5870.         }
  5871.         public bool method_73(RoomUser RoomUser_1)
  5872.         {
  5873.             return !RoomUser_1.Boolean_4 && this.method_74(RoomUser_1.GetClient().GetHabbo().Id);
  5874.         }
  5875.         public bool method_74(uint uint_2)
  5876.         {
  5877.             bool result;
  5878.             using (TimedLock.Lock(this.list_2))
  5879.             {
  5880.                 foreach (Trade current in this.list_2)
  5881.                 {
  5882.                     if (current.method_0(uint_2))
  5883.                     {
  5884.                         result = true;
  5885.                         return result;
  5886.                     }
  5887.                 }
  5888.             }
  5889.             result = false;
  5890.             return result;
  5891.         }
  5892.         public Trade method_75(RoomUser RoomUser_1)
  5893.         {
  5894.             Trade result;
  5895.             if (RoomUser_1.Boolean_4)
  5896.             {
  5897.                 result = null;
  5898.             }
  5899.             else
  5900.             {
  5901.                 result = this.method_76(RoomUser_1.GetClient().GetHabbo().Id);
  5902.             }
  5903.             return result;
  5904.         }
  5905.         public Trade method_76(uint uint_2)
  5906.         {
  5907.             Trade result;
  5908.             using (TimedLock.Lock(this.list_2))
  5909.             {
  5910.                 foreach (Trade current in this.list_2)
  5911.                 {
  5912.                     if (current.method_0(uint_2))
  5913.                     {
  5914.                         result = current;
  5915.                         return result;
  5916.                     }
  5917.                 }
  5918.             }
  5919.             result = null;
  5920.             return result;
  5921.         }
  5922.         public void method_77(RoomUser RoomUser_1, RoomUser RoomUser_2)
  5923.         {
  5924.             if (RoomUser_1 != null && RoomUser_2 != null && (!RoomUser_1.Boolean_4 || RoomUser_1.class34_0.Boolean_1) && (!RoomUser_2.Boolean_4 || RoomUser_2.class34_0.Boolean_1) && !RoomUser_1.Boolean_3 && !RoomUser_2.Boolean_3 && !this.method_73(RoomUser_1) && !this.method_73(RoomUser_2))
  5925.             {
  5926.                 this.list_2.Add(new Trade(RoomUser_1.GetClient().GetHabbo().Id, RoomUser_2.GetClient().GetHabbo().Id, this.Id));
  5927.             }
  5928.         }
  5929.         public void method_78(uint uint_2)
  5930.         {
  5931.             Trade @class = this.method_76(uint_2);
  5932.             if (@class != null)
  5933.             {
  5934.                 @class.method_12(uint_2);
  5935.                 this.list_2.Remove(@class);
  5936.             }
  5937.         }
  5938.         public bool method_79(GameClient Session, RoomItem RoomItem_0, int int_17, int int_18, int int_19, bool bool_13, bool bool_14, bool bool_15)
  5939.         {
  5940.             Dictionary<int, AffectedTile> dictionary = this.method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, int_19);
  5941.             bool result;
  5942.             if (!this.method_92(int_17, int_18))
  5943.             {
  5944.                 result = false;
  5945.             }
  5946.             else
  5947.             {
  5948.                 foreach (AffectedTile current in dictionary.Values)
  5949.                 {
  5950.                     if (!this.method_92(current.Int32_0, current.Int32_1))
  5951.                     {
  5952.                         result = false;
  5953.                         return result;
  5954.                     }
  5955.                 }
  5956.                 double num = this.Class28_0.double_1[int_17, int_18];
  5957.                 if (!bool_14)
  5958.                 {
  5959.                     if (RoomItem_0.int_3 == int_19 && RoomItem_0.Int32_0 == int_17 && RoomItem_0.Int32_1 == int_18 && RoomItem_0.Double_0 != num)
  5960.                     {
  5961.                         result = false;
  5962.                         return result;
  5963.                     }
  5964.                     if (this.Class28_0.squareState[int_17, int_18] != SquareState.OPEN)
  5965.                     {
  5966.                         result = false;
  5967.                         return result;
  5968.                     }
  5969.                     foreach (AffectedTile current in dictionary.Values)
  5970.                     {
  5971.                         if (this.Class28_0.squareState[current.Int32_0, current.Int32_1] != SquareState.OPEN)
  5972.                         {
  5973.                             result = false;
  5974.                             return result;
  5975.                         }
  5976.                     }
  5977.                     if (RoomItem_0.GetBaseItem().IsSeat || RoomItem_0.Boolean_0)
  5978.                     {
  5979.                         goto IL_1FE;
  5980.                     }
  5981.                     if (this.method_97(int_17, int_18))
  5982.                     {
  5983.                         result = false;
  5984.                         return result;
  5985.                     }
  5986.                     using (Dictionary<int, AffectedTile>.ValueCollection.Enumerator enumerator = dictionary.Values.GetEnumerator())
  5987.                     {
  5988.                         while (enumerator.MoveNext())
  5989.                         {
  5990.                             AffectedTile current = enumerator.Current;
  5991.                             if (this.method_97(current.Int32_0, current.Int32_1))
  5992.                             {
  5993.                                 result = false;
  5994.                                 return result;
  5995.                             }
  5996.                         }
  5997.                         goto IL_1FE;
  5998.                     }
  5999.                 }
  6000.                 if (this.Class28_0.squareState[int_17, int_18] != SquareState.OPEN)
  6001.                 {
  6002.                     result = false;
  6003.                     return result;
  6004.                 }
  6005.                 if (!bool_15 && this.method_97(int_17, int_18))
  6006.                 {
  6007.                     result = false;
  6008.                     return result;
  6009.                 }
  6010.             IL_1FE:
  6011.                 List<RoomItem> list = this.method_93(int_17, int_18);
  6012.                 List<RoomItem> list2 = new List<RoomItem>();
  6013.                 List<RoomItem> list3 = new List<RoomItem>();
  6014.                 foreach (AffectedTile current in dictionary.Values)
  6015.                 {
  6016.                     List<RoomItem> list4 = this.method_93(current.Int32_0, current.Int32_1);
  6017.                     if (list4 != null)
  6018.                     {
  6019.                         list2.AddRange(list4);
  6020.                     }
  6021.                 }
  6022.                 if (list == null)
  6023.                 {
  6024.                     list = new List<RoomItem>();
  6025.                 }
  6026.                 list3.AddRange(list);
  6027.                 list3.AddRange(list2);
  6028.                 int num2 = 0;
  6029.                 foreach (RoomItem current2 in list3)
  6030.                 {
  6031.                     if (current2 != null && current2.uint_0 != RoomItem_0.uint_0 && current2.GetBaseItem() != null)
  6032.                     {
  6033.                         if (!current2.GetBaseItem().Stackable)
  6034.                         {
  6035.                             result = false;
  6036.                             return result;
  6037.                         }
  6038.                         if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer" && current2.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer")
  6039.                         {
  6040.                             result = false;
  6041.                             return result;
  6042.                         }
  6043.                         if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "ball")
  6044.                         {
  6045.                             if (current2.GetBaseItem().InteractionType.ToLower() == "blue_goal")
  6046.                             {
  6047.                                 num2 = 11;
  6048.                             }
  6049.                             if (current2.GetBaseItem().InteractionType.ToLower() == "red_goal")
  6050.                             {
  6051.                                 num2 = 5;
  6052.                             }
  6053.                             if (current2.GetBaseItem().InteractionType.ToLower() == "yellow_goal")
  6054.                             {
  6055.                                 num2 = 14;
  6056.                             }
  6057.                             if (current2.GetBaseItem().InteractionType.ToLower() == "green_goal")
  6058.                             {
  6059.                                 num2 = 8;
  6060.                             }
  6061.                         }
  6062.                         if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "pallabug")
  6063.                         {
  6064.                             if (current2.GetBaseItem().InteractionType.ToLower() == "blue_goal")
  6065.                             {
  6066.                                 num2 = 11;
  6067.                             }
  6068.                             if (current2.GetBaseItem().InteractionType.ToLower() == "red_goal")
  6069.                             {
  6070.                                 num2 = 5;
  6071.                             }
  6072.                             if (current2.GetBaseItem().InteractionType.ToLower() == "yellow_goal")
  6073.                             {
  6074.                                 num2 = 14;
  6075.                             }
  6076.                             if (current2.GetBaseItem().InteractionType.ToLower() == "green_goal")
  6077.                             {
  6078.                                 num2 = 8;
  6079.                             }
  6080.                         }
  6081.                     }
  6082.                 }
  6083.                 if (num2 > 0)
  6084.                 {
  6085.                     this.method_89(num2, RoomItem_0, false);
  6086.                 }
  6087.                 if (!RoomItem_0.Boolean_0)
  6088.                 {
  6089.                     if (RoomItem_0.int_3 != int_19 && RoomItem_0.Int32_0 == int_17 && RoomItem_0.Int32_1 == int_18)
  6090.                     {
  6091.                         num = RoomItem_0.Double_0;
  6092.                     }
  6093.                     foreach (RoomItem current2 in list3)
  6094.                     {
  6095.                         if (current2.uint_0 != RoomItem_0.uint_0 && current2.Double_1 > num)
  6096.                         {
  6097.                             num = current2.Double_1;
  6098.                         }
  6099.                     }
  6100.                 }
  6101.                 if (int_19 != 0 && int_19 != 2 && int_19 != 4 && int_19 != 6 && int_19 != 8)
  6102.                 {
  6103.                     int_19 = 0;
  6104.                 }
  6105.                 Dictionary<int, AffectedTile> dictionary2 = new Dictionary<int, AffectedTile>();
  6106.                 dictionary2 = this.method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.Int32_0, RoomItem_0.Int32_1, RoomItem_0.int_3);
  6107.                 int num3 = 0;
  6108.                 int num4 = 0;
  6109.                 if (!bool_13)
  6110.                 {
  6111.                     num3 = RoomItem_0.Int32_0;
  6112.                     num4 = RoomItem_0.Int32_1;
  6113.                 }
  6114.                 RoomItem_0.int_3 = int_19;
  6115.                 RoomItem_0.method_0(int_17, int_18, num);
  6116.                 if (!bool_14 && Session != null)
  6117.                 {
  6118.                     RoomItem_0.Class69_0.OnPlace(Session, RoomItem_0);
  6119.                 }
  6120.                 if (bool_13)
  6121.                 {
  6122.                     if (this.hashtable_1.Contains(RoomItem_0.uint_0))
  6123.                     {
  6124.                         this.hashtable_1.Remove(RoomItem_0.uint_0);
  6125.                     }
  6126.                     if (this.hashtable_3.Contains(RoomItem_0.uint_0))
  6127.                     {
  6128.                         result = false;
  6129.                         return result;
  6130.                     }
  6131.                     this.hashtable_3.Add(RoomItem_0.uint_0, RoomItem_0);
  6132.                     if (RoomItem_0.Boolean_2)
  6133.                     {
  6134.                         if (this.hashtable_0.Contains(RoomItem_0.uint_0))
  6135.                         {
  6136.                             this.hashtable_0.Remove(RoomItem_0.uint_0);
  6137.                         }
  6138.                         this.hashtable_0.Add(RoomItem_0.uint_0, RoomItem_0);
  6139.                     }
  6140.                     else
  6141.                     {
  6142.                         if (this.hashtable_4.Contains(RoomItem_0.uint_0))
  6143.                         {
  6144.                             this.hashtable_4.Remove(RoomItem_0.uint_0);
  6145.                         }
  6146.                         this.hashtable_4.Add(RoomItem_0.uint_0, RoomItem_0);
  6147.                     }
  6148.                     ServerMessage Message5_ = new ServerMessage(93u);
  6149.                     RoomItem_0.method_6(Message5_);
  6150.                     this.SendMessage(Message5_, null);
  6151.                     string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
  6152.                     switch (text)
  6153.                     {
  6154.                         case "bb_patch":
  6155.                             this.list_5.Add(RoomItem_0);
  6156.                             if (RoomItem_0.ExtraData == "5")
  6157.                             {
  6158.                                 this.list_6.Add(RoomItem_0);
  6159.                             }
  6160.                             else
  6161.                             {
  6162.                                 if (RoomItem_0.ExtraData == "8")
  6163.                                 {
  6164.                                     this.list_7.Add(RoomItem_0);
  6165.                                 }
  6166.                                 else
  6167.                                 {
  6168.                                     if (RoomItem_0.ExtraData == "11")
  6169.                                     {
  6170.                                         this.list_9.Add(RoomItem_0);
  6171.                                     }
  6172.                                     else
  6173.                                     {
  6174.                                         if (RoomItem_0.ExtraData == "14")
  6175.                                         {
  6176.                                             this.list_8.Add(RoomItem_0);
  6177.                                         }
  6178.                                     }
  6179.                                 }
  6180.                             }
  6181.                             break;
  6182.                         case "ballop":
  6183.                             this.Footballs.Add(RoomItem_0);
  6184.                             break;
  6185.                         case "green_goal":
  6186.                         case "blue_goal":
  6187.                         case "yellow_goal":
  6188.                         case "red_goal":
  6189.                             this.Goals.Add(RoomItem_0);
  6190.                             break;
  6191.                         case "football_scoreboard_green":
  6192.                         case "football_scoreboard_blue":
  6193.                         case "football_scoreboard_yellow":
  6194.                         case "football_scoreboard_red":
  6195.                             this.ScoreBoards.Add(RoomItem_0);
  6196.                             break;
  6197.                         case "blue_score":
  6198.                             this.list_12.Add(RoomItem_0);
  6199.                             break;
  6200.                         case "green_score":
  6201.                             this.list_13.Add(RoomItem_0);
  6202.                             break;
  6203.                         case "red_score":
  6204.                             this.list_10.Add(RoomItem_0);
  6205.                             break;
  6206.                         case "yellow_score":
  6207.                             this.list_11.Add(RoomItem_0);
  6208.                             break;
  6209.                         case "stickiepole":
  6210.                             this.list_3.Add(RoomItem_0);
  6211.                             break;
  6212.                         case "wf_trg_onsay":
  6213.                         case "wf_trg_enterroom":
  6214.                         case "wf_trg_furnistate":
  6215.                         case "wf_trg_onfurni":
  6216.                         case "torretta":
  6217.                         case "torrettau":
  6218.                         case "wf_trg_offfurni":
  6219.                         case "wf_trg_gameend":
  6220.                         case "wf_trg_gamestart":
  6221.                         case "wf_trg_attime":
  6222.                         case "wf_trg_atscore":
  6223.                             if (!this.list_14.Contains(RoomItem_0))
  6224.                             {
  6225.                                 this.list_14.Add(RoomItem_0);
  6226.                             }
  6227.                             break;
  6228.                         case "wf_trg_timer":
  6229.                             if (RoomItem_0.string_2.Length <= 0)
  6230.                             {
  6231.                                 RoomItem_0.string_2 = "10";
  6232.                             }
  6233.                             if (!this.list_14.Contains(RoomItem_0))
  6234.                             {
  6235.                                 this.list_14.Add(RoomItem_0);
  6236.                             }
  6237.                             RoomItem_0.bool_0 = true;
  6238.                             RoomItem_0.ReqUpdate(1);
  6239.                             break;
  6240.                         case "wf_act_saymsg":
  6241.                         case "wf_act_moveuser":
  6242.                         case "wf_act_togglefurni":
  6243.                         case "wf_act_givepoints":
  6244.                         case "wf_act_moverotate":
  6245.                         case "wf_act_matchfurni":
  6246.                         case "wf_act_give_phx":
  6247.                             if (!this.list_15.Contains(RoomItem_0))
  6248.                             {
  6249.                                 this.list_15.Add(RoomItem_0);
  6250.                             }
  6251.                             break;
  6252.                         case "wf_cnd_trggrer_on_frn":
  6253.                         case "wf_cnd_furnis_hv_avtrs":
  6254.                         case "wf_cnd_has_furni_on":
  6255.                         case "wf_cnd_phx":
  6256.                             if (!this.list_16.Contains(RoomItem_0))
  6257.                             {
  6258.                                 this.list_16.Add(RoomItem_0);
  6259.                             }
  6260.                             break;
  6261.                     }
  6262.                 }
  6263.                 else
  6264.                 {
  6265.                     if (!this.hashtable_2.Contains(RoomItem_0.uint_0) && !this.hashtable_3.ContainsKey(RoomItem_0.uint_0))
  6266.                     {
  6267.                         this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6268.                     }
  6269.                     if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_act_give_phx" && Session != null)
  6270.                     {
  6271.                         string text2 = RoomItem_0.string_2.Split(new char[]
  6272.                         {
  6273.                             ':'
  6274.                         })[0].ToLower();
  6275.                         if (!Phoenix.GetGame().GetRoleManager().method_12(text2, Session))
  6276.                         {
  6277.                             RoomItem_0.string_2 = "";
  6278.                         }
  6279.                     }
  6280.                     if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_cnd_phx" && Session != null)
  6281.                     {
  6282.                         string text2 = RoomItem_0.string_2.Split(new char[]
  6283.                         {
  6284.                             ':'
  6285.                         })[0].ToLower();
  6286.                         if (!Phoenix.GetGame().GetRoleManager().method_11(text2, Session))
  6287.                         {
  6288.                             RoomItem_0.string_2 = "";
  6289.                         }
  6290.                     }
  6291.                     ServerMessage Message5_ = new ServerMessage(95u);
  6292.                     RoomItem_0.method_6(Message5_);
  6293.                     this.SendMessage(Message5_, null);
  6294.                 }
  6295.                 this.method_22();
  6296.                 if (!bool_14)
  6297.                 {
  6298.                     this.method_87(this.method_43(int_17, int_18), true, true);
  6299.                     foreach (AffectedTile current in dictionary.Values)
  6300.                     {
  6301.                         this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  6302.                     }
  6303.                     if (num3 > 0 || num4 > 0)
  6304.                     {
  6305.                         this.method_87(this.method_43(num3, num4), true, true);
  6306.                     }
  6307.                     foreach (AffectedTile current in dictionary2.Values)
  6308.                     {
  6309.                         this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  6310.                     }
  6311.                 }
  6312.                 result = true;
  6313.             }
  6314.             return result;
  6315.         }
  6316.         internal void method_80(RoomItem RoomItem_0)
  6317.         {
  6318.             if (!this.hashtable_2.Contains(RoomItem_0.uint_0) && !this.hashtable_3.ContainsKey(RoomItem_0.uint_0))
  6319.             {
  6320.                 this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6321.             }
  6322.         }
  6323.         public bool method_81(RoomItem RoomItem_0, int int_17, int int_18, double double_3)
  6324.         {
  6325.             Dictionary<int, AffectedTile> dictionary = this.method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, RoomItem_0.int_3);
  6326.             RoomItem_0.method_0(int_17, int_18, double_3);
  6327.             if (!this.hashtable_2.Contains(RoomItem_0.uint_0))
  6328.             {
  6329.                 this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6330.             }
  6331.             this.method_22();
  6332.             this.method_87(this.method_43(int_17, int_18), true, true);
  6333.             foreach (AffectedTile current in dictionary.Values)
  6334.             {
  6335.                 this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  6336.             }
  6337.             return true;
  6338.         }
  6339.         public bool method_82(GameClient Session, RoomItem RoomItem_0, bool bool_13, string string_10)
  6340.         {
  6341.             if (bool_13)
  6342.             {
  6343.                 RoomItem_0.Class69_0.OnPlace(Session, RoomItem_0);
  6344.                 string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
  6345.                 if (text != null && text == "dimmer" && this.class67_0 == null)
  6346.                 {
  6347.                     this.class67_0 = new MoodlightData(RoomItem_0.uint_0);
  6348.                     RoomItem_0.ExtraData = this.class67_0.method_7();
  6349.                 }
  6350.                 if (!this.hashtable_3.ContainsKey(RoomItem_0.uint_0))
  6351.                 {
  6352.                     this.hashtable_3.Add(RoomItem_0.uint_0, RoomItem_0);
  6353.                     if (RoomItem_0.Boolean_2)
  6354.                     {
  6355.                         this.hashtable_0.Add(RoomItem_0.uint_0, RoomItem_0);
  6356.                     }
  6357.                     else
  6358.                     {
  6359.                         if (!this.hashtable_4.Contains(RoomItem_0.uint_0))
  6360.                         {
  6361.                             this.hashtable_4.Add(RoomItem_0.uint_0, RoomItem_0);
  6362.                         }
  6363.                     }
  6364.                 }
  6365.                 ServerMessage Message5_ = new ServerMessage(83u);
  6366.                 RoomItem_0.method_6(Message5_);
  6367.                 this.SendMessage(Message5_, null);
  6368.             }
  6369.             else
  6370.             {
  6371.                 if (!this.hashtable_2.Contains(RoomItem_0.uint_0))
  6372.                 {
  6373.                     this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6374.                 }
  6375.             }
  6376.             if (!bool_13)
  6377.             {
  6378.                 RoomItem_0.string_7 = string_10;
  6379.                 ServerMessage Message5_ = new ServerMessage(85u);
  6380.                 RoomItem_0.method_6(Message5_);
  6381.                 this.SendMessage(Message5_, null);
  6382.             }
  6383.             return true;
  6384.         }
  6385.         public void method_83()
  6386.         {
  6387.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  6388.             {
  6389.                 RoomUser @class = this.RoomUser_0[i];
  6390.                 if (@class != null)
  6391.                 {
  6392.                     this.method_87(@class, true, true);
  6393.                 }
  6394.             }
  6395.         }
  6396.         public double method_84(int int_17, int int_18, List<RoomItem> list_18)
  6397.         {
  6398.             double result;
  6399.             try
  6400.             {
  6401.                 bool flag = false;
  6402.                 if (this.double_2[int_17, int_18] != 0.0)
  6403.                 {
  6404.                     flag = true;
  6405.                 }
  6406.                 double num = 0.0;
  6407.                 bool flag2 = false;
  6408.                 double num2 = 0.0;
  6409.                 if (list_18 == null)
  6410.                 {
  6411.                     list_18 = new List<RoomItem>();
  6412.                 }
  6413.                 if (list_18 != null)
  6414.                 {
  6415.                     foreach (RoomItem current in list_18)
  6416.                     {
  6417.                         if ((current.GetBaseItem().IsSeat || current.GetBaseItem().InteractionType.ToLower() == "bed") && flag)
  6418.                         {
  6419.                             result = current.Double_0;
  6420.                             return result;
  6421.                         }
  6422.                         if (current.Double_1 > num)
  6423.                         {
  6424.                             if (current.GetBaseItem().IsSeat || current.GetBaseItem().InteractionType.ToLower() == "bed")
  6425.                             {
  6426.                                 if (flag)
  6427.                                 {
  6428.                                     result = current.Double_0;
  6429.                                     return result;
  6430.                                 }
  6431.                                 flag2 = true;
  6432.                                 num2 = current.GetBaseItem().Height;
  6433.                             }
  6434.                             else
  6435.                             {
  6436.                                 flag2 = false;
  6437.                             }
  6438.                             num = current.Double_1;
  6439.                         }
  6440.                     }
  6441.                 }
  6442.                 double num3 = this.Class28_0.double_1[int_17, int_18];
  6443.                 double num4 = num - this.Class28_0.double_1[int_17, int_18];
  6444.                 if (flag2)
  6445.                 {
  6446.                     num4 -= num2;
  6447.                 }
  6448.                 if (num4 < 0.0)
  6449.                 {
  6450.                     num4 = 0.0;
  6451.                 }
  6452.                 result = num3 + num4;
  6453.             }
  6454.             catch
  6455.             {
  6456.                 result = 0.0;
  6457.             }
  6458.             return result;
  6459.         }
  6460.         public void method_85(RoomUser RoomUser_1)
  6461.         {
  6462.             List<RoomItem> list = this.method_93(RoomUser_1.int_3, RoomUser_1.int_4);
  6463.             foreach (RoomItem current in list)
  6464.             {
  6465.                 this.method_12(RoomUser_1, current);
  6466.                 if (current.GetBaseItem().InteractionType.ToLower() == "pressure_pad")
  6467.                 {
  6468.                     current.ExtraData = "0";
  6469.                     current.UpdateState(false, true);
  6470.                 }
  6471.             }
  6472.             this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1;
  6473.         }
  6474.         public void method_86(RoomUser RoomUser_1)
  6475.         {
  6476.             List<RoomItem> list = this.method_93(RoomUser_1.int_3, RoomUser_1.int_4);
  6477.             foreach (RoomItem current in list)
  6478.             {
  6479.                 string text = current.GetBaseItem().InteractionType.ToLower();
  6480.                 if (text != null)
  6481.                 {
  6482.                     if (!(text == "pressure_pad"))
  6483.                     {
  6484.                         if (text == "fbgate" && (!string.IsNullOrEmpty(current.string_2) || !string.IsNullOrEmpty(current.string_3)))
  6485.                         {
  6486.                             RoomUser_1 = this.method_43(current.GStruct1_0.x, current.GStruct1_0.y);
  6487.                             if (RoomUser_1 != null && !RoomUser_1.Boolean_4 && current.string_2 != null && current.string_3 != null)
  6488.                             {
  6489.                                 string a = RoomUser_1.GetClient().GetHabbo().Gender;
  6490.                                 if (a == "m")
  6491.                                 {
  6492.                                     AntiMutant.smethod_1(RoomUser_1, current.string_2);
  6493.                                 }
  6494.                                 else
  6495.                                 {
  6496.                                     AntiMutant.smethod_1(RoomUser_1, current.string_3);
  6497.                                 }
  6498.                                 ServerMessage Message = new ServerMessage(266u);
  6499.                                 Message.AppendInt32(RoomUser_1.VirtualId);
  6500.                                 Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Figure);
  6501.                                 Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Gender.ToLower());
  6502.                                 Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Motto);
  6503.                                 Message.AppendInt32(RoomUser_1.GetClient().GetHabbo().AchievementScore);
  6504.                                 Message.AppendStringWithBreak("");
  6505.                                 this.SendMessage(Message, null);
  6506.                             }
  6507.                         }
  6508.                     }
  6509.                     else
  6510.                     {
  6511.                         current.ExtraData = "1";
  6512.                         current.UpdateState(false, true);
  6513.                     }
  6514.                 }
  6515.             }
  6516.         }
  6517.         public void method_87(RoomUser User, bool bool_13, bool bool_14)
  6518.         {
  6519.             int num = 0;
  6520.             try
  6521.             {
  6522.                 if (User != null)
  6523.                 {
  6524.                     num = 1;
  6525.                     if (User.isPet)
  6526.                     {
  6527.                         User.PetData.X = User.int_3;
  6528.                         User.PetData.Y = User.int_4;
  6529.                         User.PetData.Z = User.double_0;
  6530.                     }
  6531.                     else
  6532.                     {
  6533.                         if (User.Boolean_4)
  6534.                         {
  6535.                             User.class34_0.x = User.int_3;
  6536.                             User.class34_0.y = User.int_4;
  6537.                             User.class34_0.z = User.double_0;
  6538.                         }
  6539.                         else
  6540.                         {
  6541.                             if (User.class34_1 != null && User.RoomUser_0 != null)
  6542.                             {
  6543.                                 return;
  6544.                             }
  6545.                         }
  6546.                     }
  6547.                     num = 2;
  6548.                     if (!User.bool_12)
  6549.                     {
  6550.                         User.bool_7 = false;
  6551.                     }
  6552.                     else
  6553.                     {
  6554.                         num = 3;
  6555.                         if (bool_13)
  6556.                         {
  6557.                             num = 4;
  6558.                             if (User.byte_1 > 0)
  6559.                             {
  6560.                                 num = 5;
  6561.                                 if (User.Boolean_4)
  6562.                                 {
  6563.                                     if (this.byte_1[User.int_3, User.int_4] == 0)
  6564.                                     {
  6565.                                         User.class34_0.EffectId = -1;
  6566.                                         User.byte_1 = 0;
  6567.                                     }
  6568.                                 }
  6569.                                 else
  6570.                                 {
  6571.                                     num = 6;
  6572.                                     if ((User.GetClient().GetHabbo().Gender.ToLower() == "m" && this.byte_1[User.int_3, User.int_4] == 0) || (User.GetClient().GetHabbo().Gender.ToLower() == "f" && this.byte_2[User.int_3, User.int_4] == 0))
  6573.                                     {
  6574.                                         User.GetClient().GetHabbo().method_24().method_2(-1, true);
  6575.                                         User.byte_1 = 0;
  6576.                                     }
  6577.                                 }
  6578.                             }
  6579.                             num = 7;
  6580.                             if (User.Statusses.ContainsKey("lay") || User.Statusses.ContainsKey("sit"))
  6581.                             {
  6582.                                 User.Statusses.Remove("lay");
  6583.                                 User.Statusses.Remove("sit");
  6584.                                 User.bool_7 = true;
  6585.                             }
  6586.                             List<RoomItem> list = this.method_93(User.int_3, User.int_4);
  6587.                             double num2 = this.method_84(User.int_3, User.int_4, list);
  6588.                             if (num2 != User.double_0)
  6589.                             {
  6590.                                 User.double_0 = num2;
  6591.                                 User.bool_7 = true;
  6592.                             }
  6593.                             num = 8;
  6594.                             if (this.Class28_0.squareState[User.int_3, User.int_4] == SquareState.SEAT)
  6595.                             {
  6596.                                 if (!User.Statusses.ContainsKey("sit"))
  6597.                                 {
  6598.                                     User.Statusses.Add("sit", "1.0");
  6599.                                     if (User.byte_1 > 0)
  6600.                                     {
  6601.                                         if (!User.Boolean_4)
  6602.                                         {
  6603.                                             User.GetClient().GetHabbo().method_24().method_2(-1, true);
  6604.                                         }
  6605.                                         else
  6606.                                         {
  6607.                                             User.class34_0.EffectId = -1;
  6608.                                         }
  6609.                                         User.byte_1 = 0;
  6610.                                     }
  6611.                                 }
  6612.                                 num = 9;
  6613.                                 User.double_0 = this.Class28_0.double_1[User.int_3, User.int_4];
  6614.                                 User.int_7 = this.Class28_0.int_3[User.int_3, User.int_4];
  6615.                                 User.int_8 = this.Class28_0.int_3[User.int_3, User.int_4];
  6616.                                 if (User.Boolean_4 && User.class34_0.RoomUser_0 != null)
  6617.                                 {
  6618.                                     User.class34_0.RoomUser_0.double_0 = User.double_0 + 1.0;
  6619.                                     User.class34_0.RoomUser_0.int_7 = User.int_7;
  6620.                                     User.class34_0.RoomUser_0.int_8 = User.int_8;
  6621.                                 }
  6622.                                 User.bool_7 = true;
  6623.                             }
  6624.                             if (list.Count < 1 && this.list_4.Contains(User.uint_0))
  6625.                             {
  6626.                                 User.GetClient().GetHabbo().method_24().method_2(-1, false);
  6627.                                 this.list_4.Remove(User.uint_0);
  6628.                                 User.int_14 = 0;
  6629.                                 User.bool_7 = true;
  6630.                             }
  6631.                             num = 10;
  6632.                             lock (list)
  6633.                             {
  6634.                                 foreach (RoomItem Item in list)
  6635.                                 {
  6636.                                     num = 11;
  6637.                                     if (Item.GetBaseItem().IsSeat && (!User.isPet || User.class34_0.RoomUser_0 == null))
  6638.                                     {
  6639.                                         if (!User.Statusses.ContainsKey("sit"))
  6640.                                         {
  6641.                                             double num3;
  6642.                                             try
  6643.                                             {
  6644.                                                 if (Item.GetBaseItem().Height_Adjustable.Count > 1)
  6645.                                                 {
  6646.                                                     num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
  6647.                                                 }
  6648.                                                 else
  6649.                                                 {
  6650.                                                     num3 = Item.GetBaseItem().Height;
  6651.                                                 }
  6652.                                                 goto IL_BCA;
  6653.                                             }
  6654.                                             catch
  6655.                                             {
  6656.                                                 num3 = Item.GetBaseItem().Height;
  6657.                                                 goto IL_BCA;
  6658.                                             }
  6659.                                         IL_51B:
  6660.                                             if (User.byte_1 > 0)
  6661.                                             {
  6662.                                                 if (!User.Boolean_4)
  6663.                                                 {
  6664.                                                     User.GetClient().GetHabbo().method_24().method_2(-1, true);
  6665.                                                 }
  6666.                                                 else
  6667.                                                 {
  6668.                                                     User.class34_0.EffectId = -1;
  6669.                                                 }
  6670.                                                 User.byte_1 = 0;
  6671.                                                 goto IL_55D;
  6672.                                             }
  6673.                                             goto IL_55D;
  6674.                                         IL_BCA:
  6675.                                             if (User.Statusses.ContainsKey("sit"))
  6676.                                             {
  6677.                                                 goto IL_51B;
  6678.                                             }
  6679.                                             User.Statusses.Add("sit", num3.ToString().Replace(',', '.'));
  6680.                                             goto IL_51B;
  6681.                                         }
  6682.                                     IL_55D:
  6683.                                         User.double_0 = Item.Double_0;
  6684.                                         User.int_7 = Item.int_3;
  6685.                                         User.int_8 = Item.int_3;
  6686.                                         if (User.Boolean_4 && User.class34_0.RoomUser_0 != null)
  6687.                                         {
  6688.                                             User.class34_0.RoomUser_0.double_0 = User.double_0 + 1.0;
  6689.                                             User.class34_0.RoomUser_0.int_7 = User.int_7;
  6690.                                             User.class34_0.RoomUser_0.int_8 = User.int_8;
  6691.                                         }
  6692.                                         User.bool_7 = true;
  6693.                                     }
  6694.                                     num = 12;
  6695.                                     if (Item.GetBaseItem().InteractionType.ToLower() == "bed")
  6696.                                     {
  6697.                                         if (!User.Statusses.ContainsKey("lay"))
  6698.                                         {
  6699.                                             double num3;
  6700.                                             try
  6701.                                             {
  6702.                                                 if (Item.GetBaseItem().Height_Adjustable.Count > 1)
  6703.                                                 {
  6704.                                                     num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
  6705.                                                 }
  6706.                                                 else
  6707.                                                 {
  6708.                                                     num3 = Item.GetBaseItem().Height;
  6709.                                                 }
  6710.                                             }
  6711.                                             catch
  6712.                                             {
  6713.                                                 //num3 = ;
  6714.                                             }
  6715.                                             if (!User.Statusses.ContainsKey("lay"))
  6716.                                             {
  6717.                                                 User.Statusses.Add("lay", Item.GetBaseItem().Height.ToString().Replace(',', '.') + " null");
  6718.                                             }
  6719.                                             if (User.byte_1 > 0)
  6720.                                             {
  6721.                                                 if (!User.Boolean_4)
  6722.                                                 {
  6723.                                                     User.GetClient().GetHabbo().method_24().method_2(-1, true);
  6724.                                                 }
  6725.                                                 else
  6726.                                                 {
  6727.                                                     User.class34_0.EffectId = -1;
  6728.                                                 }
  6729.                                                 User.byte_1 = 0;
  6730.                                             }
  6731.                                         }
  6732.                                         User.double_0 = Item.Double_0;
  6733.                                         User.int_7 = Item.int_3;
  6734.                                         User.int_8 = Item.int_3;
  6735.                                         if (User.Boolean_4 && User.class34_0.RoomUser_0 != null)
  6736.                                         {
  6737.                                             User.class34_0.RoomUser_0.double_0 = User.double_0 + 1.0;
  6738.                                             User.class34_0.RoomUser_0.int_7 = User.int_7;
  6739.                                             User.class34_0.RoomUser_0.int_8 = User.int_8;
  6740.                                         }
  6741.                                         User.bool_7 = true;
  6742.                                     }
  6743.                                     num = 13;
  6744.                                     if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("bb_") > -1 && !User.Boolean_4)
  6745.                                     {
  6746.                                         if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("_gate") > -1)
  6747.                                         {
  6748.                                             int num4 = 0;
  6749.                                             int num5 = 0;
  6750.                                             if (Item.GetBaseItem().InteractionType.ToLower() == "bb_yellow_gate")
  6751.                                             {
  6752.                                                 num5 = 12;
  6753.                                                 num4 = 36;
  6754.                                             }
  6755.                                             else
  6756.                                             {
  6757.                                                 if (Item.GetBaseItem().InteractionType.ToLower() == "bb_red_gate")
  6758.                                                 {
  6759.                                                     num5 = 3;
  6760.                                                     num4 = 33;
  6761.                                                 }
  6762.                                                 else
  6763.                                                 {
  6764.                                                     if (Item.GetBaseItem().InteractionType.ToLower() == "bb_green_gate")
  6765.                                                     {
  6766.                                                         num5 = 6;
  6767.                                                         num4 = 34;
  6768.                                                     }
  6769.                                                     else
  6770.                                                     {
  6771.                                                         if (Item.GetBaseItem().InteractionType.ToLower() == "bb_blue_gate")
  6772.                                                         {
  6773.                                                             num5 = 9;
  6774.                                                             num4 = 35;
  6775.                                                         }
  6776.                                                     }
  6777.                                                 }
  6778.                                             }
  6779.                                             if (!this.list_4.Contains(User.uint_0))
  6780.                                             {
  6781.                                                 User.GetClient().GetHabbo().method_24().method_2(num4, true);
  6782.                                                 User.bool_7 = true;
  6783.                                                 User.int_14 = num5;
  6784.                                                 this.list_4.Add(User.uint_0);
  6785.                                             }
  6786.                                             else
  6787.                                             {
  6788.                                                 User.GetClient().GetHabbo().method_24().method_2(-1, false);
  6789.                                                 User.bool_7 = true;
  6790.                                                 User.int_14 = 0;
  6791.                                                 this.list_4.Remove(User.uint_0);
  6792.                                             }
  6793.                                         }
  6794.                                         if (Item.GetBaseItem().InteractionType.ToLower() == "bb_teleport")
  6795.                                         {
  6796.                                             this.method_91(Item, User);
  6797.                                         }
  6798.                                         if (Item.GetBaseItem().InteractionType.ToLower() == "bb_patch" && User.int_14 > 0 && User.bool_6 && Item.ExtraData != "14" && Item.ExtraData != "5" && Item.ExtraData != "8" && Item.ExtraData != "11" && Item.ExtraData != "1")
  6799.                                         {
  6800.                                             if (Item.ExtraData == "0" || Item.ExtraData == "")
  6801.                                             {
  6802.                                                 Item.ExtraData = Convert.ToString(User.int_14);
  6803.                                             }
  6804.                                             else
  6805.                                             {
  6806.                                                 if (Convert.ToInt32(Item.ExtraData) > 0)
  6807.                                                 {
  6808.                                                     if (User.int_14 == 12 && (Item.ExtraData == "12" || Item.ExtraData == "13"))
  6809.                                                     {
  6810.                                                         Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6811.                                                     }
  6812.                                                     else
  6813.                                                     {
  6814.                                                         if (User.int_14 == 3 && (Item.ExtraData == "3" || Item.ExtraData == "4"))
  6815.                                                         {
  6816.                                                             Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6817.                                                         }
  6818.                                                         else
  6819.                                                         {
  6820.                                                             if (User.int_14 == 6 && (Item.ExtraData == "6" || Item.ExtraData == "7"))
  6821.                                                             {
  6822.                                                                 Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6823.                                                             }
  6824.                                                             else
  6825.                                                             {
  6826.                                                                 if (User.int_14 == 9 && (Item.ExtraData == "9" || Item.ExtraData == "10"))
  6827.                                                                 {
  6828.                                                                     Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6829.                                                                 }
  6830.                                                                 else
  6831.                                                                 {
  6832.                                                                     Item.ExtraData = Convert.ToString(User.int_14);
  6833.                                                                 }
  6834.                                                             }
  6835.                                                         }
  6836.                                                     }
  6837.                                                 }
  6838.                                             }
  6839.                                             this.method_89(User.int_14 + 2, Item, false);
  6840.                                             Item.UpdateState(true, true);
  6841.                                         }
  6842.                                     }
  6843.                                 }
  6844.                                 goto IL_1155;
  6845.                             }
  6846.                         }
  6847.                         num = 14;
  6848.                         List<RoomItem> list2 = this.method_93(User.int_12, User.int_13);
  6849.                         lock (list2)
  6850.                         {
  6851.                             foreach (RoomItem current in list2)
  6852.                             {
  6853.                                 if (this.double_0[current.Int32_0, current.Int32_1] <= current.Double_0)
  6854.                                 {
  6855.                                     if (bool_14)
  6856.                                     {
  6857.                                         this.method_11(User, current);
  6858.                                     }
  6859.                                     if (current.GetBaseItem().InteractionType.ToLower() == "pressure_pad")
  6860.                                     {
  6861.                                         current.ExtraData = "1";
  6862.                                         current.UpdateState(false, true);
  6863.                                     }
  6864.                                     num = 15;
  6865.                                     if (current.GetBaseItem().InteractionType.ToLower() == "fbgate" && (!string.IsNullOrEmpty(current.string_2) || !string.IsNullOrEmpty(current.string_3)) && User != null && !User.Boolean_4)
  6866.                                     {
  6867.                                         if (User.string_0 != "")
  6868.                                         {
  6869.                                             User.GetClient().GetHabbo().Figure = User.string_0;
  6870.                                             User.string_0 = "";
  6871.                                             ServerMessage Message = new ServerMessage(266u);
  6872.                                             Message.AppendInt32(User.VirtualId);
  6873.                                             Message.AppendStringWithBreak(User.GetClient().GetHabbo().Figure);
  6874.                                             Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
  6875.                                             Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
  6876.                                             Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
  6877.                                             Message.AppendStringWithBreak("");
  6878.                                             this.SendMessage(Message, null);
  6879.                                         }
  6880.                                         else
  6881.                                         {
  6882.                                             string a = User.GetClient().GetHabbo().Gender;
  6883.                                             User.string_0 = User.GetClient().GetHabbo().Figure;
  6884.                                             if (a == "m")
  6885.                                             {
  6886.                                                 AntiMutant.smethod_1(User, current.string_2);
  6887.                                             }
  6888.                                             else
  6889.                                             {
  6890.                                                 AntiMutant.smethod_1(User, current.string_3);
  6891.                                             }
  6892.                                             ServerMessage Message = new ServerMessage(266u);
  6893.                                             Message.AppendInt32(User.VirtualId);
  6894.                                             Message.AppendStringWithBreak(User.GetClient().GetHabbo().Figure);
  6895.                                             Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
  6896.                                             Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
  6897.                                             Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
  6898.                                             Message.AppendStringWithBreak("");
  6899.                                             this.SendMessage(Message, null);
  6900.                                         }
  6901.                                     }
  6902.                                     num = 16;
  6903.                                     if (current.GetBaseItem().InteractionType.ToLower() == "pallabug" || current.GetBaseItem().InteractionType.ToLower() == "ball")
  6904.                                     {
  6905.                                         int num6 = current.Int32_0;
  6906.                                         int num7 = current.Int32_1;
  6907.                                         current.ExtraData = "11";
  6908.                                         if (User.int_8 == 4)
  6909.                                         {
  6910.                                             num7++;
  6911.                                             if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6912.                                             {
  6913.                                                 this.method_79(null, current, num6, num7 - 2, 0, false, true, true);
  6914.                                             }
  6915.                                         }
  6916.                                         else
  6917.                                         {
  6918.                                             if (User.int_8 == 0)
  6919.                                             {
  6920.                                                 num7--;
  6921.                                                 if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6922.                                                 {
  6923.                                                     this.method_79(null, current, num6, num7 + 2, 0, false, true, true);
  6924.                                                 }
  6925.                                             }
  6926.                                             else
  6927.                                             {
  6928.                                                 if (User.int_8 == 6)
  6929.                                                 {
  6930.                                                     num6--;
  6931.                                                     if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6932.                                                     {
  6933.                                                         this.method_79(null, current, num6 + 2, num7, 0, false, true, true);
  6934.                                                     }
  6935.                                                 }
  6936.                                                 else
  6937.                                                 {
  6938.                                                     if (User.int_8 == 2)
  6939.                                                     {
  6940.                                                         num6++;
  6941.                                                         if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6942.                                                         {
  6943.                                                             this.method_79(null, current, num6 - 2, num7, 0, false, true, true);
  6944.                                                         }
  6945.                                                     }
  6946.                                                     else
  6947.                                                     {
  6948.                                                         if (User.int_8 == 3)
  6949.                                                         {
  6950.                                                             num6++;
  6951.                                                             num7++;
  6952.                                                             if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6953.                                                             {
  6954.                                                                 this.method_79(null, current, num6 - 2, num7 - 2, 0, false, true, true);
  6955.                                                             }
  6956.                                                         }
  6957.                                                         else
  6958.                                                         {
  6959.                                                             if (User.int_8 == 1)
  6960.                                                             {
  6961.                                                                 num6++;
  6962.                                                                 num7--;
  6963.                                                                 if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6964.                                                                 {
  6965.                                                                     this.method_79(null, current, num6 - 2, num7 + 2, 0, false, true, true);
  6966.                                                                 }
  6967.                                                             }
  6968.                                                             else
  6969.                                                             {
  6970.                                                                 if (User.int_8 == 7)
  6971.                                                                 {
  6972.                                                                     num6--;
  6973.                                                                     num7--;
  6974.                                                                     if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6975.                                                                     {
  6976.                                                                         this.method_79(null, current, num6 + 2, num7 + 2, 0, false, true, true);
  6977.                                                                     }
  6978.                                                                 }
  6979.                                                                 else
  6980.                                                                 {
  6981.                                                                     if (User.int_8 == 5)
  6982.                                                                     {
  6983.                                                                         num6--;
  6984.                                                                         num7++;
  6985.                                                                         if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6986.                                                                         {
  6987.                                                                             this.method_79(null, current, num6 + 2, num7 - 2, 0, false, true, true);
  6988.                                                                         }
  6989.                                                                     }
  6990.                                                                 }
  6991.                                                             }
  6992.                                                         }
  6993.                                                     }
  6994.                                                 }
  6995.                                             }
  6996.                                         }
  6997.                                     }
  6998.  
  6999.                                     if (current.GetBaseItem().InteractionType.ToLower() == "ballop")
  7000.                                         this.UserKickFootball(User, current);
  7001.                                 }
  7002.                             }
  7003.                         }
  7004.                     IL_1155:;
  7005.                     }
  7006.                 }
  7007.             }
  7008.             catch (Exception ex)
  7009.             {
  7010.                 Logging.LogThreadException(ex.ToString(), string.Concat(new object[]
  7011.                 {
  7012.                     "Room [ID: ",
  7013.                     this.Id,
  7014.                     "] [Part: ",
  7015.                     num,
  7016.                     "] Update User Status"
  7017.                 }));
  7018.                 this.method_34();
  7019.             }
  7020.         }
  7021.         public void method_88(int int_17, int int_18, RoomItem RoomItem_0)
  7022.         {
  7023.             if (int_17 == 5)
  7024.             {
  7025.                 this.int_9 += int_18 - 1;
  7026.             }
  7027.             else
  7028.             {
  7029.                 if (int_17 == 8)
  7030.                 {
  7031.                     this.int_12 += int_18 - 1;
  7032.                 }
  7033.                 else
  7034.                 {
  7035.                     if (int_17 == 11)
  7036.                     {
  7037.                         this.int_11 += int_18 - 1;
  7038.                     }
  7039.                     else
  7040.                     {
  7041.                         if (int_17 == 14)
  7042.                         {
  7043.                             this.int_10 += int_18 - 1;
  7044.                         }
  7045.                     }
  7046.                 }
  7047.             }
  7048.             this.method_89(int_17, RoomItem_0, false);
  7049.         }
  7050.         public void method_89(int int_17, RoomItem RoomItem_0, bool bool_13)
  7051.         {
  7052.             if (int_17 == 5)
  7053.             {
  7054.                 this.int_9++;
  7055.                 if (RoomItem_0.ExtraData == "5")
  7056.                 {
  7057.                     this.list_6.Add(RoomItem_0);
  7058.                 }
  7059.                 if (this.list_10.Count > 0)
  7060.                 {
  7061.                     foreach (RoomItem current in this.list_10)
  7062.                     {
  7063.                         current.ExtraData = Convert.ToString(this.int_9);
  7064.                         current.UpdateState(true, true);
  7065.                     }
  7066.                 }
  7067.                 this.method_17(this.int_9);
  7068.             }
  7069.             else
  7070.             {
  7071.                 if (int_17 == 8)
  7072.                 {
  7073.                     this.int_12++;
  7074.                     if (RoomItem_0.ExtraData == "8")
  7075.                     {
  7076.                         this.list_7.Add(RoomItem_0);
  7077.                     }
  7078.                     if (this.list_13.Count > 0)
  7079.                     {
  7080.                         foreach (RoomItem current in this.list_13)
  7081.                         {
  7082.                             current.ExtraData = Convert.ToString(this.int_12);
  7083.                             current.UpdateState(true, true);
  7084.                         }
  7085.                     }
  7086.                     this.method_17(this.int_12);
  7087.                 }
  7088.                 else
  7089.                 {
  7090.                     if (int_17 == 11)
  7091.                     {
  7092.                         this.int_11++;
  7093.                         if (RoomItem_0.ExtraData == "11")
  7094.                         {
  7095.                             this.list_9.Add(RoomItem_0);
  7096.                         }
  7097.                         if (this.list_12.Count > 0)
  7098.                         {
  7099.                             foreach (RoomItem current in this.list_12)
  7100.                             {
  7101.                                 current.ExtraData = Convert.ToString(this.int_11);
  7102.                                 current.UpdateState(true, true);
  7103.                             }
  7104.                         }
  7105.                         this.method_17(this.int_11);
  7106.                     }
  7107.                     else
  7108.                     {
  7109.                         if (int_17 == 14)
  7110.                         {
  7111.                             this.int_10++;
  7112.                             if (RoomItem_0.ExtraData == "14")
  7113.                             {
  7114.                                 this.list_8.Add(RoomItem_0);
  7115.                             }
  7116.                             if (this.list_11.Count > 0)
  7117.                             {
  7118.                                 foreach (RoomItem current in this.list_11)
  7119.                                 {
  7120.                                     current.ExtraData = Convert.ToString(this.int_10);
  7121.                                     current.UpdateState(true, true);
  7122.                                 }
  7123.                             }
  7124.                             this.method_17(this.int_10);
  7125.                         }
  7126.                     }
  7127.                 }
  7128.             }
  7129.             if (bool_13 || (this.list_5.Count > 0 && this.list_6.Count + this.list_7.Count + this.list_9.Count + this.list_8.Count >= this.list_5.Count))
  7130.             {
  7131.                 bool_13 = true;
  7132.                 if (this.int_10 > this.int_9 && this.int_10 > this.int_11 && this.int_10 > this.int_12)
  7133.                 {
  7134.                     new Room.Delegate2(this.method_90).BeginInvoke(14, null, null);
  7135.                 }
  7136.                 else
  7137.                 {
  7138.                     if (this.int_9 > this.int_10 && this.int_9 > this.int_11 && this.int_9 > this.int_12)
  7139.                     {
  7140.                         new Room.Delegate2(this.method_90).BeginInvoke(5, null, null);
  7141.                     }
  7142.                     else
  7143.                     {
  7144.                         if (this.int_11 > this.int_9 && this.int_11 > this.int_10 && this.int_11 > this.int_12)
  7145.                         {
  7146.                             new Room.Delegate2(this.method_90).BeginInvoke(11, null, null);
  7147.                         }
  7148.                         else
  7149.                         {
  7150.                             if (this.int_12 > this.int_9 && this.int_12 > this.int_11 && this.int_12 > this.int_10)
  7151.                             {
  7152.                                 new Room.Delegate2(this.method_90).BeginInvoke(8, null, null);
  7153.                             }
  7154.                         }
  7155.                     }
  7156.                 }
  7157.             }
  7158.             if (bool_13)
  7159.             {
  7160.                 this.method_13();
  7161.             }
  7162.         }
  7163.         public void method_90(int int_17)
  7164.         {
  7165.             List<RoomItem> list = new List<RoomItem>();
  7166.             if (int_17 == 5)
  7167.             {
  7168.                 list = this.list_6;
  7169.             }
  7170.             else
  7171.             {
  7172.                 if (int_17 == 8)
  7173.                 {
  7174.                     list = this.list_7;
  7175.                 }
  7176.                 else
  7177.                 {
  7178.                     if (int_17 == 11)
  7179.                     {
  7180.                         list = this.list_9;
  7181.                     }
  7182.                     else
  7183.                     {
  7184.                         if (int_17 == 14)
  7185.                         {
  7186.                             list = this.list_8;
  7187.                         }
  7188.                     }
  7189.                 }
  7190.             }
  7191.             try
  7192.             {
  7193.                 for (int i = 4; i > 0; i--)
  7194.                 {
  7195.                     Thread.Sleep(500);
  7196.                     foreach (RoomItem current in list)
  7197.                     {
  7198.                         current.ExtraData = "1";
  7199.                         current.UpdateState(false, true);
  7200.                     }
  7201.                     Thread.Sleep(500);
  7202.                     foreach (RoomItem current in list)
  7203.                     {
  7204.                         current.ExtraData = Convert.ToString(int_17);
  7205.                         current.UpdateState(false, true);
  7206.                     }
  7207.                 }
  7208.                 foreach (RoomItem current in this.list_5)
  7209.                 {
  7210.                     current.ExtraData = "0";
  7211.                     current.UpdateState(true, true);
  7212.                 }
  7213.             }
  7214.             catch
  7215.             {
  7216.             }
  7217.             this.list_9.Clear();
  7218.             this.list_7.Clear();
  7219.             this.list_6.Clear();
  7220.             this.list_8.Clear();
  7221.             this.int_10 = 0;
  7222.             this.int_11 = 0;
  7223.             this.int_9 = 0;
  7224.             this.int_12 = 0;
  7225.             foreach (RoomItem current in this.list_10)
  7226.             {
  7227.                 current.ExtraData = "0";
  7228.                 current.UpdateState(true, true);
  7229.             }
  7230.             foreach (RoomItem current in this.list_13)
  7231.             {
  7232.                 current.ExtraData = "0";
  7233.                 current.UpdateState(true, true);
  7234.             }
  7235.             foreach (RoomItem current in this.list_12)
  7236.             {
  7237.                 current.ExtraData = "0";
  7238.                 current.UpdateState(true, true);
  7239.             }
  7240.             foreach (RoomItem current in this.list_11)
  7241.             {
  7242.                 current.ExtraData = "0";
  7243.                 current.UpdateState(true, true);
  7244.             }
  7245.         }
  7246.         public void method_91(RoomItem RoomItem_0, RoomUser RoomUser_1)
  7247.         {
  7248.             RoomItem_0.ExtraData = "1";
  7249.             RoomItem_0.UpdateState(false, true);
  7250.             RoomItem_0.ReqUpdate(1);
  7251.             List<RoomItem> list = new List<RoomItem>();
  7252.             RoomUser_1.method_3(true);
  7253.             foreach (RoomItem @class in this.Hashtable_0.Values)
  7254.             {
  7255.                 if (@class != RoomItem_0 && !(@class.GetBaseItem().InteractionType.ToLower() != "bb_teleport"))
  7256.                 {
  7257.                     list.Add(@class);
  7258.                 }
  7259.             }
  7260.             if (list.Count > 0)
  7261.             {
  7262.                 Random random = new Random((int)Phoenix.GetUnixTimestamp() * (int)RoomUser_1.uint_0);
  7263.                 int index = random.Next(0, list.Count);
  7264.                 list[index].ExtraData = "1";
  7265.                 list[index].UpdateState(false, true);
  7266.                 list[index].ReqUpdate(1);
  7267.                 this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1;
  7268.                 this.byte_0[list[index].Int32_0, list[index].Int32_1] = 1;
  7269.                 RoomUser_1.method_7(list[index].Int32_0, list[index].Int32_1, list[index].Double_0);
  7270.                 RoomUser_1.bool_7 = true;
  7271.             }
  7272.         }
  7273.         public bool method_92(int int_17, int int_18)
  7274.         {
  7275.             return int_17 >= 0 && int_18 >= 0 && int_17 < this.Class28_0.int_4 && int_18 < this.Class28_0.int_5;
  7276.         }
  7277.         public List<RoomItem> method_93(int int_17, int int_18)
  7278.         {
  7279.             List<RoomItem> list = new List<RoomItem>();
  7280.             List<RoomItem> result;
  7281.             if (this.Hashtable_0 != null)
  7282.             {
  7283.                 foreach (RoomItem @class in this.Hashtable_0.Values)
  7284.                 {
  7285.                     if (@class.Int32_0 == int_17 && @class.Int32_1 == int_18)
  7286.                     {
  7287.                         list.Add(@class);
  7288.                     }
  7289.                     Dictionary<int, AffectedTile> dictionary = this.method_94(@class.GetBaseItem().Length, @class.GetBaseItem().Width, @class.Int32_0, @class.Int32_1, @class.int_3);
  7290.                     foreach (AffectedTile current in dictionary.Values)
  7291.                     {
  7292.                         if (current.Int32_0 == int_17 && current.Int32_1 == int_18)
  7293.                         {
  7294.                             list.Add(@class);
  7295.                         }
  7296.                     }
  7297.                 }
  7298.                 result = list;
  7299.             }
  7300.             else
  7301.             {
  7302.                 result = null;
  7303.             }
  7304.             return result;
  7305.         }
  7306.         public Dictionary<int, AffectedTile> method_94(int int_17, int int_18, int int_19, int int_20, int int_21)
  7307.         {
  7308.             int num = 0;
  7309.             Dictionary<int, AffectedTile> dictionary = new Dictionary<int, AffectedTile>();
  7310.             if (int_17 > 1)
  7311.             {
  7312.                 if (int_21 == 0 || int_21 == 4)
  7313.                 {
  7314.                     for (int i = 1; i < int_17; i++)
  7315.                     {
  7316.                         dictionary.Add(num++, new AffectedTile(int_19, int_20 + i, i));
  7317.                         for (int j = 1; j < int_18; j++)
  7318.                         {
  7319.                             dictionary.Add(num++, new AffectedTile(int_19 + j, int_20 + i, (i < j) ? j : i));
  7320.                         }
  7321.                     }
  7322.                 }
  7323.                 else
  7324.                 {
  7325.                     if (int_21 == 2 || int_21 == 6)
  7326.                     {
  7327.                         for (int i = 1; i < int_17; i++)
  7328.                         {
  7329.                             dictionary.Add(num++, new AffectedTile(int_19 + i, int_20, i));
  7330.                             for (int j = 1; j < int_18; j++)
  7331.                             {
  7332.                                 dictionary.Add(num++, new AffectedTile(int_19 + i, int_20 + j, (i < j) ? j : i));
  7333.                             }
  7334.                         }
  7335.                     }
  7336.                 }
  7337.             }
  7338.             if (int_18 > 1)
  7339.             {
  7340.                 if (int_21 == 0 || int_21 == 4)
  7341.                 {
  7342.                     for (int i = 1; i < int_18; i++)
  7343.                     {
  7344.                         dictionary.Add(num++, new AffectedTile(int_19 + i, int_20, i));
  7345.                         for (int j = 1; j < int_17; j++)
  7346.                         {
  7347.                             dictionary.Add(num++, new AffectedTile(int_19 + i, int_20 + j, (i < j) ? j : i));
  7348.                         }
  7349.                     }
  7350.                 }
  7351.                 else
  7352.                 {
  7353.                     if (int_21 == 2 || int_21 == 6)
  7354.                     {
  7355.                         for (int i = 1; i < int_18; i++)
  7356.                         {
  7357.                             dictionary.Add(num++, new AffectedTile(int_19, int_20 + i, i));
  7358.                             for (int j = 1; j < int_17; j++)
  7359.                             {
  7360.                                 dictionary.Add(num++, new AffectedTile(int_19 + j, int_20 + i, (i < j) ? j : i));
  7361.                             }
  7362.                         }
  7363.                     }
  7364.                 }
  7365.             }
  7366.             return dictionary;
  7367.         }
  7368.         public bool method_95(int int_17, int int_18, bool bool_13)
  7369.         {
  7370.             return !this.AllowWalkthrough && this.method_96(int_17, int_18);
  7371.         }
  7372.         public bool method_96(int int_17, int int_18)
  7373.         {
  7374.             return this.method_43(int_17, int_18) != null;
  7375.         }
  7376.         public bool method_97(int int_17, int int_18)
  7377.         {
  7378.             return this.method_44(int_17, int_18) != null;
  7379.         }
  7380.         public string method_98(string string_10)
  7381.         {
  7382.             string result;
  7383.             try
  7384.             {
  7385.                 if (string_10.Contains(Convert.ToChar(13)))
  7386.                 {
  7387.                     result = null;
  7388.                 }
  7389.                 else
  7390.                 {
  7391.                     if (string_10.Contains(Convert.ToChar(9)))
  7392.                     {
  7393.                         result = null;
  7394.                     }
  7395.                     else
  7396.                     {
  7397.                         string[] array = string_10.Split(new char[]
  7398.                         {
  7399.                             ' '
  7400.                         });
  7401.                         if (array[2] != "l" && array[2] != "r")
  7402.                         {
  7403.                             result = null;
  7404.                         }
  7405.                         else
  7406.                         {
  7407.                             string[] array2 = array[0].Substring(3).Split(new char[]
  7408.                             {
  7409.                                 ','
  7410.                             });
  7411.                             int num = int.Parse(array2[0]);
  7412.                             int num2 = int.Parse(array2[1]);
  7413.                             if (num < 0 || num2 < 0 || num > 200 || num2 > 200)
  7414.                             {
  7415.                                 result = null;
  7416.                             }
  7417.                             else
  7418.                             {
  7419.                                 string[] array3 = array[1].Substring(2).Split(new char[]
  7420.                                 {
  7421.                                     ','
  7422.                                 });
  7423.                                 int num3 = int.Parse(array3[0]);
  7424.                                 int num4 = int.Parse(array3[1]);
  7425.                                 if (num3 < 0 || num4 < 0 || num3 > 200 || num4 > 200)
  7426.                                 {
  7427.                                     result = null;
  7428.                                 }
  7429.                                 else
  7430.                                 {
  7431.                                     result = string.Concat(new object[]
  7432.                                     {
  7433.                                         ":w=",
  7434.                                         num,
  7435.                                         ",",
  7436.                                         num2,
  7437.                                         " l=",
  7438.                                         num3,
  7439.                                         ",",
  7440.                                         num4,
  7441.                                         " ",
  7442.                                         array[2]
  7443.                                     });
  7444.                                 }
  7445.                             }
  7446.                         }
  7447.                     }
  7448.                 }
  7449.             }
  7450.             catch
  7451.             {
  7452.                 result = null;
  7453.             }
  7454.             return result;
  7455.         }
  7456.         public bool method_99(int int_17, int int_18, int int_19, int int_20)
  7457.         {
  7458.             return (Math.Abs(int_17 - int_19) <= 1 && Math.Abs(int_18 - int_20) <= 1) || (int_17 == int_19 && int_18 == int_20);
  7459.         }
  7460.         public int method_100(int int_17, int int_18, int int_19, int int_20)
  7461.         {
  7462.             return Math.Abs(int_17 - int_19) + Math.Abs(int_18 - int_20);
  7463.         }
  7464.         internal void method_101()
  7465.         {
  7466.             for (int i = 0; i < this.RoomUser_0.Length; i++)
  7467.             {
  7468.                 RoomUser @class = this.RoomUser_0[i];
  7469.                 if (@class != null)
  7470.                 {
  7471.                     @class.int_10 = @class.int_3;
  7472.                     @class.int_11 = @class.int_4;
  7473.                     @class.method_13();
  7474.                     @class.method_3(false);
  7475.                 }
  7476.             }
  7477.         }
  7478.         internal void method_102(int int_17)
  7479.         {
  7480.             this.int_15 = int_17;
  7481.         }
  7482.         private void ProgressFootballAchievement(RoomItem football)
  7483.         {
  7484.             // Don't need :)
  7485.         }
  7486.         public void UserKickFootball(RoomUser user, RoomItem football)
  7487.         {
  7488.             if (((user != null) && (user.GetClient() != null)) && (user.GetClient().GetHabbo() != null))
  7489.             {
  7490.                 football.LastPlayerHitFootball = user;
  7491.             }
  7492.             if ((user.int_10 == football.Int32_0) && (user.int_11 == football.Int32_1))
  7493.             {
  7494.                 this.DoFootballMath(football, user.int_8, 0x10);
  7495.             }
  7496.             else
  7497.             {
  7498.                 this.DoFootballMath(football, user.int_8, 11);
  7499.             }
  7500.         }
  7501.         public void DoFootballMath(RoomItem football, int direction, int power)
  7502.         {
  7503.             int num = football.Int32_0;
  7504.             int num2 = football.Int32_1;
  7505.             football.ExtraData = power.ToString();
  7506.             if (direction == 4)
  7507.             {
  7508.                 num2++;
  7509.                 if (this.method_37(num, num2, true, true, true, true, false))
  7510.                 {
  7511.                     this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7512.                     football.FootballDirection = 4;
  7513.                 }
  7514.                 else if (this.method_97(num, num2))
  7515.                 {
  7516.                     football.ExtraData = "10";
  7517.                     football.UpdateState(false, true);
  7518.                 }
  7519.                 else
  7520.                 {
  7521.                     football.FootballDirection = 0;
  7522.                     football.FootballWaitTime = 3;
  7523.                 }
  7524.             }
  7525.             else if (direction == 0)
  7526.             {
  7527.                 num2--;
  7528.                 if (this.method_37(num, num2, true, true, true, true, false))
  7529.                 {
  7530.                     this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7531.                     football.FootballDirection = 0;
  7532.                 }
  7533.                 else if (this.method_97(num, num2))
  7534.                 {
  7535.                     football.ExtraData = "10";
  7536.                     football.UpdateState(false, true);
  7537.                 }
  7538.                 else
  7539.                 {
  7540.                     football.FootballDirection = 4;
  7541.                     football.FootballWaitTime = 3;
  7542.                 }
  7543.             }
  7544.             else if (direction == 6)
  7545.             {
  7546.                 num--;
  7547.                 if (this.method_37(num, num2, true, true, true, true, false))
  7548.                 {
  7549.                     this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7550.                     football.FootballDirection = 6;
  7551.                 }
  7552.                 else if (this.method_97(num, num2))
  7553.                 {
  7554.                     football.ExtraData = "10";
  7555.                     football.UpdateState(false, true);
  7556.                 }
  7557.                 else
  7558.                 {
  7559.                     football.FootballDirection = 2;
  7560.                     football.FootballWaitTime = 3;
  7561.                 }
  7562.             }
  7563.             else if (direction == 2)
  7564.             {
  7565.                 num++;
  7566.                 if (this.method_37(num, num2, true, true, true, true, false))
  7567.                 {
  7568.                     this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7569.                     football.FootballDirection = 2;
  7570.                 }
  7571.                 else if (this.method_97(num, num2))
  7572.                 {
  7573.                     football.ExtraData = "10";
  7574.                     football.UpdateState(false, true);
  7575.                 }
  7576.                 else
  7577.                 {
  7578.                     football.FootballDirection = 6;
  7579.                     football.FootballWaitTime = 3;
  7580.                 }
  7581.             }
  7582.             else
  7583.             {
  7584.                 bool flag;
  7585.                 bool flag2;
  7586.                 if (direction == 3)
  7587.                 {
  7588.                     num++;
  7589.                     num2++;
  7590.                     if (this.method_37(num, num2, true, true, true, true, false))
  7591.                     {
  7592.                         this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7593.                         football.FootballDirection = 3;
  7594.                     }
  7595.                     else if (this.method_97(num, num2))
  7596.                     {
  7597.                         football.ExtraData = "10";
  7598.                         football.UpdateState(false, true);
  7599.                     }
  7600.                     else
  7601.                     {
  7602.                         flag = this.method_37(football.Int32_0 + 1, football.Int32_1, true, true, true, true, false);
  7603.                         flag2 = this.method_37(football.Int32_0, football.Int32_1 + 1, true, true, true, true, false);
  7604.                         if (!(flag || flag2))
  7605.                         {
  7606.                             football.FootballDirection = 7;
  7607.                         }
  7608.                         else if (!(flag || !flag2))
  7609.                         {
  7610.                             football.FootballDirection = 5;
  7611.                         }
  7612.                         else
  7613.                         {
  7614.                             football.FootballDirection = 1;
  7615.                         }
  7616.                         football.FootballWaitTime = 3;
  7617.                     }
  7618.                 }
  7619.                 else if (direction == 1)
  7620.                 {
  7621.                     num++;
  7622.                     num2--;
  7623.                     if (this.method_37(num, num2, true, true, true, true, false))
  7624.                     {
  7625.                         this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7626.                         football.FootballDirection = 1;
  7627.                     }
  7628.                     else if (this.method_97(num, num2))
  7629.                     {
  7630.                         football.ExtraData = "10";
  7631.                         football.UpdateState(false, true);
  7632.                     }
  7633.                     else
  7634.                     {
  7635.                         flag2 = this.method_37(football.Int32_0 + 1, football.Int32_1, true, true, true, true, false);
  7636.                         flag = this.method_37(football.Int32_0, football.Int32_1 - 1, true, true, true, true, false);
  7637.                         if (!(flag2 || flag))
  7638.                         {
  7639.                             football.FootballDirection = 5;
  7640.                         }
  7641.                         else if (flag2)
  7642.                         {
  7643.                             football.FootballDirection = 3;
  7644.                         }
  7645.                         else
  7646.                         {
  7647.                             football.FootballDirection = 7;
  7648.                         }
  7649.                         football.FootballWaitTime = 3;
  7650.                     }
  7651.                 }
  7652.                 else if (direction == 7)
  7653.                 {
  7654.                     num--;
  7655.                     num2--;
  7656.                     if (this.method_37(num, num2, true, true, true, true, false))
  7657.                     {
  7658.                         this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7659.                         football.FootballDirection = 7;
  7660.                     }
  7661.                     else if (this.method_97(num, num2))
  7662.                     {
  7663.                         football.ExtraData = "10";
  7664.                         football.UpdateState(false, true);
  7665.                     }
  7666.                     else
  7667.                     {
  7668.                         flag2 = this.method_37(football.Int32_0 - 1, football.Int32_1, true, true, true, true, false);
  7669.                         flag = this.method_37(football.Int32_0 - 1, football.Int32_1, true, true, true, true, false);
  7670.                         if (!(!flag2 || flag))
  7671.                         {
  7672.                             football.FootballDirection = 3;
  7673.                         }
  7674.                         else if (flag2 && flag)
  7675.                         {
  7676.                             football.FootballDirection = 5;
  7677.                         }
  7678.                         else
  7679.                         {
  7680.                             football.FootballDirection = 1;
  7681.                         }
  7682.                         football.FootballWaitTime = 3;
  7683.                     }
  7684.                 }
  7685.                 else if (direction == 5)
  7686.                 {
  7687.                     num--;
  7688.                     num2++;
  7689.                     if (this.method_37(num, num2, true, true, true, true, false))
  7690.                     {
  7691.                         this.method_40(football, num, num2, football.uint_0, this.double_1[num, num2]);
  7692.                         football.FootballDirection = 5;
  7693.                     }
  7694.                     else if (this.method_97(num, num2))
  7695.                     {
  7696.                         football.ExtraData = "10";
  7697.                         football.UpdateState(false, true);
  7698.                     }
  7699.                     else
  7700.                     {
  7701.                         flag2 = this.method_37(football.Int32_0 - 1, football.Int32_1, true, true, true, true, false);
  7702.                         flag = this.method_37(football.Int32_0, football.Int32_1 + 1, true, true, true, true, false);
  7703.                         if (!(flag2 || !flag))
  7704.                         {
  7705.                             football.FootballDirection = 3;
  7706.                         }
  7707.                         else
  7708.                         {
  7709.                             football.FootballDirection = 7;
  7710.                         }
  7711.                         football.FootballWaitTime = 3;
  7712.                     }
  7713.                 }
  7714.             }
  7715.             if ((football.ExtraData != "10") && ((num != football.Int32_0) || (num2 != football.Int32_1)))
  7716.             {
  7717.                 int team = -1;
  7718.                 foreach (RoomItem item in this.Goals.Where(o => o.GetBaseItem().InteractionType.ToLower() == "green_goal").ToList<RoomItem>())
  7719.                 {
  7720.                     if (team > -1)
  7721.                     {
  7722.                         break;
  7723.                     }
  7724.                     if ((football.Int32_0 == item.Int32_0) && (football.Int32_1 == item.Int32_1))
  7725.                     {
  7726.                         team = 0;
  7727.                         this.ProgressFootballAchievement(football);
  7728.                         break;
  7729.                     }
  7730.                     foreach (AffectedTile tile in item.Dictionary_0.Values.ToList<AffectedTile>())
  7731.                     {
  7732.                         if ((football.Int32_0 == tile.Int32_0) && (football.Int32_1 == tile.Int32_1))
  7733.                         {
  7734.                             team = 0;
  7735.                             this.ProgressFootballAchievement(football);
  7736.                             break;
  7737.                         }
  7738.                     }
  7739.                 }
  7740.                 foreach (RoomItem item2 in this.Goals.Where(o => o.GetBaseItem().InteractionType.ToLower() == "blue_goal").ToList<RoomItem>())
  7741.                 {
  7742.                     if (team > -1)
  7743.                     {
  7744.                         break;
  7745.                     }
  7746.                     if ((football.Int32_0 == item2.Int32_0) && (football.Int32_1 == item2.Int32_1))
  7747.                     {
  7748.                         team = 1;
  7749.                         this.ProgressFootballAchievement(football);
  7750.                         break;
  7751.                     }
  7752.                     foreach (AffectedTile tile in item2.Dictionary_0.Values.ToList<AffectedTile>())
  7753.                     {
  7754.                         if ((football.Int32_0 == tile.Int32_0) && (football.Int32_1 == tile.Int32_1))
  7755.                         {
  7756.                             team = 1;
  7757.                             this.ProgressFootballAchievement(football);
  7758.                             break;
  7759.                         }
  7760.                     }
  7761.                 }
  7762.                 foreach (RoomItem item3 in this.Goals.Where(o => o.GetBaseItem().InteractionType.ToLower() == "yellow_goal").ToList<RoomItem>())
  7763.                 {
  7764.                     if (team > -1)
  7765.                     {
  7766.                         break;
  7767.                     }
  7768.                     if ((football.Int32_0 == item3.Int32_0) && (football.Int32_1 == item3.Int32_1))
  7769.                     {
  7770.                         team = 2;
  7771.                         this.ProgressFootballAchievement(football);
  7772.                         break;
  7773.                     }
  7774.                     foreach (AffectedTile tile in item3.Dictionary_0.Values.ToList<AffectedTile>())
  7775.                     {
  7776.                         if ((football.Int32_0 == tile.Int32_0) && (football.Int32_1 == tile.Int32_1))
  7777.                         {
  7778.                             team = 2;
  7779.                             this.ProgressFootballAchievement(football);
  7780.                             break;
  7781.                         }
  7782.                     }
  7783.                 }
  7784.                 foreach (RoomItem item4 in this.Goals.Where(o => o.GetBaseItem().InteractionType.ToLower() == "red_goal").ToList<RoomItem>())
  7785.                 {
  7786.                     if (team > -1)
  7787.                     {
  7788.                         break;
  7789.                     }
  7790.                     if ((football.Int32_0 == item4.Int32_0) && (football.Int32_1 == item4.Int32_1))
  7791.                     {
  7792.                         team = 3;
  7793.                         this.ProgressFootballAchievement(football);
  7794.                         break;
  7795.                     }
  7796.                     foreach (AffectedTile tile in item4.Dictionary_0.Values.ToList<AffectedTile>())
  7797.                     {
  7798.                         if ((football.Int32_0 == tile.Int32_0) && (football.Int32_1 == tile.Int32_1))
  7799.                         {
  7800.                             team = 3;
  7801.                             this.ProgressFootballAchievement(football);
  7802.                             break;
  7803.                         }
  7804.                     }
  7805.                 }
  7806.                 if (team > -1)
  7807.                 {
  7808.                     football.LastPlayerHitFootball.Wave();
  7809.                     this.ScoreFootball(team);
  7810.                 }
  7811.             }
  7812.         }
  7813.         public void ScoreFootball(int team)
  7814.         {
  7815.             int num;
  7816.             int num3;
  7817.             switch (team)
  7818.             {
  7819.                 case 0:
  7820.                     foreach (RoomItem item in this.ScoreBoards.Where(o => o.GetBaseItem().InteractionType == "football_scoreboard_green"))
  7821.                     {
  7822.                         if (int.TryParse(item.ExtraData, out num))
  7823.                         {
  7824.                             num3 = num + 1;
  7825.                             item.ExtraData = num3.ToString();
  7826.                         }
  7827.                         else
  7828.                         {
  7829.                             item.ExtraData = "1";
  7830.                         }
  7831.                         item.UpdateState(true, true);
  7832.                     }
  7833.                     break;
  7834.  
  7835.                 case 1:
  7836.                     foreach (RoomItem item in this.ScoreBoards.Where(o => o.GetBaseItem().InteractionType == "football_scoreboard_blue"))
  7837.                     {
  7838.                         if (int.TryParse(item.ExtraData, out num))
  7839.                         {
  7840.                             num3 = num + 1;
  7841.                             item.ExtraData = num3.ToString();
  7842.                         }
  7843.                         else
  7844.                         {
  7845.                             item.ExtraData = "1";
  7846.                         }
  7847.                         item.UpdateState(true, true);
  7848.                     }
  7849.                     break;
  7850.  
  7851.                 case 2:
  7852.                     foreach (RoomItem item in this.ScoreBoards.Where(o => o.GetBaseItem().InteractionType == "football_scoreboard_yellow"))
  7853.                     {
  7854.                         if (int.TryParse(item.ExtraData, out num))
  7855.                         {
  7856.                             num3 = num + 1;
  7857.                             item.ExtraData = num3.ToString();
  7858.                         }
  7859.                         else
  7860.                         {
  7861.                             item.ExtraData = "1";
  7862.                         }
  7863.                         item.UpdateState(true, true);
  7864.                     }
  7865.                     break;
  7866.  
  7867.                 case 3:
  7868.                     foreach (RoomItem item in this.ScoreBoards.Where(o => o.GetBaseItem().InteractionType == "football_scoreboard_red"))
  7869.                     {
  7870.                         if (int.TryParse(item.ExtraData, out num))
  7871.                         {
  7872.                             item.ExtraData = (num + 1).ToString();
  7873.                         }
  7874.                         else
  7875.                         {
  7876.                             item.ExtraData = "1";
  7877.                         }
  7878.                         item.UpdateState(true, true);
  7879.                     }
  7880.                     break;
  7881.             }
  7882.         }
  7883.         public void OnCycleFootball()
  7884.         {
  7885.             foreach (RoomItem item in this.Footballs.ToList<RoomItem>())
  7886.             {
  7887.                 if (item.FootballWaitTime > 0)
  7888.                 {
  7889.                     item.FootballWaitTime--;
  7890.                 }
  7891.                 else
  7892.                 {
  7893.                     string extraData = item.ExtraData;
  7894.                     if (extraData != null)
  7895.                     {
  7896.                         if (!(extraData == "16"))
  7897.                         {
  7898.                             if (extraData == "15")
  7899.                             {
  7900.                                 goto Label_00B4;
  7901.                             }
  7902.                             if (extraData == "14")
  7903.                             {
  7904.                                 goto Label_00C6;
  7905.                             }
  7906.                             if (extraData == "13")
  7907.                             {
  7908.                                 goto Label_00DF;
  7909.                             }
  7910.                             if (extraData == "12")
  7911.                             {
  7912.                                 goto Label_00F8;
  7913.                             }
  7914.                             if (extraData == "11")
  7915.                             {
  7916.                                 goto Label_010A;
  7917.                             }
  7918.                         }
  7919.                         else
  7920.                         {
  7921.                             this.DoFootballMath(item, item.FootballDirection, 15);
  7922.                         }
  7923.                     }
  7924.                 }
  7925.                 continue;
  7926.             Label_00B4:
  7927.                 this.DoFootballMath(item, item.FootballDirection, 14);
  7928.                 continue;
  7929.             Label_00C6:
  7930.                 this.DoFootballMath(item, item.FootballDirection, 13);
  7931.                 item.FootballWaitTime = 1;
  7932.                 continue;
  7933.             Label_00DF:
  7934.                 this.DoFootballMath(item, item.FootballDirection, 12);
  7935.                 item.FootballWaitTime = 2;
  7936.                 continue;
  7937.             Label_00F8:
  7938.                 this.DoFootballMath(item, item.FootballDirection, 11);
  7939.                 continue;
  7940.             Label_010A:
  7941.                 item.ExtraData = "10";
  7942.                 item.UpdateState(false, true);
  7943.             }
  7944.         }
  7945.  
  7946.         public static implicit operator Room(int v)
  7947.         {
  7948.             throw new NotImplementedException();
  7949.         }
  7950.     }
  7951. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement