public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         ServerMessage Message = new ServerMessage(650u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         Message.AppendInt32(0);
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendStringWithBreak("");
         Message.AppendString("I");
         if (RoomItem_0.string_3.Length > 0)
         {
             Message.AppendString(RoomItem_0.string_3);
         }
         else
         {
             Message.AppendString("RB");
         }
         Message.AppendStringWithBreak("HRAH");
         Session.SendMessage(Message);
         RoomItem_0.ReqUpdate(1);
     }
 }
 public override void OnPlace(GameClient Session, RoomItem Item)
 {
     RoomMusicController roomMusicController = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
     roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(Item);
     roomMusicController.Stop();
     Session.GetHabbo().CurrentRoom.LoadMusic();
 }
 public override void OnPlace(GameClient Session, RoomItem RoomItem_0)
 {
     RoomItem_0.ExtraData = "0";
     if (RoomItem_0.uint_3 != 0u)
     {
         RoomUser @class = RoomItem_0.method_8().GetRoomUserByHabbo(RoomItem_0.uint_3);
         if (@class != null)
         {
             @class.method_3(true);
             @class.bool_1 = false;
             @class.bool_0 = true;
         }
         RoomItem_0.uint_3 = 0u;
     }
     if (RoomItem_0.uint_4 != 0u)
     {
         RoomUser @class = RoomItem_0.method_8().GetRoomUserByHabbo(RoomItem_0.uint_4);
         if (@class != null)
         {
             @class.method_3(true);
             @class.bool_1 = false;
             @class.bool_0 = true;
         }
         RoomItem_0.uint_4 = 0u;
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     RoomUser @class = RoomItem_0.method_8().GetRoomUserByHabbo(Session.GetHabbo().Id);
     if (@class != null && @class.class34_1 == null)
     {
         if (ThreeDCoord.smethod_0(@class.GStruct1_0, RoomItem_0.GStruct1_0) || ThreeDCoord.smethod_0(@class.GStruct1_0, RoomItem_0.GStruct1_1))
         {
             if (RoomItem_0.uint_3 == 0u)
             {
                 @class.int_19 = -1;
                 RoomItem_0.uint_3 = @class.GetClient().GetHabbo().Id;
                 @class.RoomItem_0 = RoomItem_0;
             }
         }
         else
         {
             if (@class.bool_0)
             {
                 try
                 {
                     @class.method_4(RoomItem_0.GStruct1_1);
                 }
                 catch
                 {
                 }
             }
         }
     }
 }
 public override void OnRemove(GameClient Session, RoomItem Item)
 {
     RoomMusicController roomMusicController = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
     roomMusicController.Stop();
     roomMusicController.UnLinkRoomOutputItem();
     Item.UpdateState(true, true);
 }
        public void Action(RoomItem Item, Task Task, string ExtraData)
        {
            if (ExtraData == "1")
            {
                Task.Wait(7000);
                Item.FireWorkCount--;

                using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient())
                {
                    dbClient.AddParamWithValue("itemid", Item.uint_0);
                    dbClient.ExecuteQuery("UPDATE items SET fw_count = fw_count - 1 WHERE id = @itemid LIMIT 1");
                }
            }

            if (Item.FireWorkCount == 0)
            {
                ExtraData = "0";
            }

            Item.ExtraData = ExtraData;
            Item.UpdateState(true, true);

            Task.Wait();
            Task.Dispose();
        }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     RoomUser @class = RoomItem_0.method_8().GetRoomUserByHabbo(Session.GetHabbo().Id);
     if (@class != null && (RoomItem_0.GStruct1_2.x < RoomItem_0.method_8().Class28_0.int_4 && RoomItem_0.GStruct1_2.y < RoomItem_0.method_8().Class28_0.int_5))
     {
         if (ThreeDCoord.smethod_1(@class.GStruct1_0, RoomItem_0.GStruct1_1) && @class.bool_0)
         {
             @class.method_4(RoomItem_0.GStruct1_1);
         }
         else
         {
             if (RoomItem_0.method_8().method_30(RoomItem_0.GStruct1_2.x, RoomItem_0.GStruct1_2.y, RoomItem_0.Double_0, true, false) && RoomItem_0.uint_3 == 0u)
             {
                 RoomItem_0.uint_3 = @class.uint_0;
                 @class.bool_0 = false;
                 if (@class.bool_6 && (@class.int_10 != RoomItem_0.GStruct1_1.x || @class.int_11 != RoomItem_0.GStruct1_1.y))
                 {
                     @class.method_3(true);
                 }
                 @class.bool_1 = true;
                 @class.method_4(RoomItem_0.GStruct1_0);
                 RoomItem_0.ReqUpdate(3);
             }
         }
     }
 }
 internal void AddFreezeScoreboard(RoomItem item)
 {
     if (this.freezeScoreboards.Contains(item.uint_0))
     {
         this.freezeScoreboards.Remove(item.uint_0);
     }
     this.freezeScoreboards.Add(item.uint_0, item);
 }
 internal void AddFreezeGate(RoomItem item)
 {
     if (this.freezeGates.Contains(item.uint_0))
     {
         this.freezeGates.Remove(item.uint_0);
     }
     this.freezeGates.Add(item.uint_0, item);
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0 && RoomItem_0.ExtraData != "-1")
     {
         RoomItem_0.ExtraData = "-1";
         RoomItem_0.method_4();
         RoomItem_0.ReqUpdate(10);
     }
 }
 public void Handle(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null)
         {
             if (@class.method_72("stickiepole") > 0 || @class.method_26(Session))
             {
                 uint uint_ = Event.PopWiredUInt();
                 string text = Event.PopFixedString();
                 string[] array = text.Split(new char[]
                 {
                     ' '
                 });
                 if (array[0].Contains("-"))
                 {
                     array[0] = array[0].Replace("-", "");
                 }
                 UserItem class2 = Session.GetHabbo().method_23().method_10(uint_);
                 if (class2 != null)
                 {
                     if (array[0].StartsWith(":"))
                     {
                         string text2 = @class.method_98(text);
                         if (text2 == null)
                         {
                             ServerMessage Message = new ServerMessage(516u);
                             Message.AppendInt32(11);
                             Session.SendMessage(Message);
                             return;
                         }
                         RoomItem RoomItem_ = new RoomItem(class2.uint_0, @class.Id, class2.uint_1, class2.string_0, 0, 0, 0.0, 0, text2, @class);
                         if (@class.method_82(Session, RoomItem_, true, null))
                         {
                             Session.GetHabbo().method_23().method_12(uint_, 1u, false);
                         }
                     }
                     using (DatabaseClient class3 = GoldTree.GetDatabase().GetClient())
                     {
                         class3.ExecuteQuery(string.Concat(new object[]
                         {
                             "UPDATE items SET room_id = '",
                             @class.Id,
                             "' WHERE Id = '",
                             class2.uint_0,
                             "' LIMIT 1"
                         }));
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }
Example #12
0
 public Freeze(Room room)
 {
     this.room = room;
     this.freezeTiles = new Hashtable();
     this.freezeBlocks = new Hashtable();
     this.exitTeleport = null;
     this.rnd = new Random();
     this.gameStarted = false;
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (RoomItem_0.ExtraData != "-1")
     {
         RoomItem_0.ExtraData = "-1";
         RoomItem_0.UpdateState(false, true);
         RoomItem_0.ReqUpdate(3);
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_1, bool bool_0)
 {
     if (bool_0)
     {
         if (this.Modes == 0)
         {
             RoomItem_0.UpdateState(false, true);
         }
         int num = 0;
         int num2 = 0;
         if (RoomItem_0.ExtraData.Length > 0)
         {
             num = int.Parse(RoomItem_0.ExtraData);
         }
         if (num <= 0)
         {
             num2 = 1;
         }
         else
         {
             if (num >= this.Modes)
             {
                 num2 = 0;
             }
             else
             {
                 num2 = num + 1;
             }
         }
         if (num2 == 0)
         {
             if (RoomItem_0.method_8().method_97(RoomItem_0.Int32_0, RoomItem_0.Int32_1))
             {
                 return;
             }
             Dictionary<int, AffectedTile> dictionary = RoomItem_0.method_8().method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.Int32_0, RoomItem_0.Int32_1, RoomItem_0.int_3);
             if (dictionary == null)
             {
                 dictionary = new Dictionary<int, AffectedTile>();
             }
             foreach (AffectedTile current in dictionary.Values)
             {
                 if (RoomItem_0.method_8().method_97(current.Int32_0, current.Int32_1))
                 {
                     return;
                 }
             }
         }
         RoomItem_0.ExtraData = num2.ToString();
         RoomItem_0.method_4();
         RoomItem_0.method_8().method_22();
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         int num = 0;
         if (RoomItem_0.ExtraData.Length > 0)
         {
             num = int.Parse(RoomItem_0.ExtraData);
         }
         if (int_0 == 0)
         {
             if (num <= -1)
             {
                 num = 0;
             }
             else
             {
                 if (num >= 0)
                 {
                     num = -1;
                 }
             }
         }
         else
         {
             if (int_0 >= 1)
             {
                 if (int_0 == 1)
                 {
                     num--;
                     if (num < 0)
                     {
                         num = 0;
                     }
                 }
                 else
                 {
                     if (int_0 == 2)
                     {
                         num++;
                         if (num >= 100)
                         {
                             num = 0;
                         }
                     }
                 }
             }
         }
         RoomItem_0.ExtraData = num.ToString();
         RoomItem_0.method_4();
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         ServerMessage Message = new ServerMessage(651u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         Message.AppendInt32(1);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Session.SendMessage(Message);
     }
 }
 public override void OnRemove(GameClient Session, RoomItem RoomItem_0)
 {
     RoomItem_0.ExtraData = "0";
     if (RoomItem_0.uint_3 != 0u)
     {
         RoomUser @class = RoomItem_0.method_8().GetRoomUserByHabbo(RoomItem_0.uint_3);
         if (@class != null)
         {
             @class.method_3(true);
             @class.method_6();
         }
         RoomItem_0.uint_3 = 0u;
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         RoomItem_0.method_9();
         ServerMessage Message = new ServerMessage(651u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         if (RoomItem_0.string_5.Length > 0)
         {
             Message.AppendString(RoomItem_0.string_5);
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendStringWithBreak("");
         Message.AppendString("J");
         if (RoomItem_0.string_2.Length > 0)
         {
             Message.AppendInt32(Convert.ToInt32(RoomItem_0.string_2));
         }
         else
         {
             Message.AppendInt32(0);
         }
         if (RoomItem_0.string_3.Length > 0)
         {
             Message.AppendInt32(Convert.ToInt32(RoomItem_0.string_3));
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendString("HPA");
         if (RoomItem_0.string_6.Length > 0)
         {
             Message.AppendInt32(Convert.ToInt32(RoomItem_0.string_6));
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendStringWithBreak("H");
         Session.SendMessage(Message);
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0)
     {
         ServerMessage Message = new ServerMessage(650u);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(0);
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendStringWithBreak(RoomItem_0.string_2);
         Message.AppendStringWithBreak("HHSAH");
         Session.SendMessage(Message);
     }
 }
        public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            RoomMusicController roomMusicController = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
            roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(Item);

            if ((UserHasRights && (Session != null)) && (Item != null))
            {
                if (roomMusicController.IsPlaying)
                {
                    roomMusicController.Stop();
                }
                else
                {
                    roomMusicController.Start(Request);
                }
            }
        }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (RoomItem_0.GetBaseItem().Height_Adjustable.Count > 1)
     {
         Dictionary<int, AffectedTile> dictionary = RoomItem_0.method_8().method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.Int32_0, RoomItem_0.Int32_1, RoomItem_0.int_3);
         RoomItem_0.method_8().method_22();
         RoomItem_0.method_8().method_87(RoomItem_0.method_8().method_43(RoomItem_0.Int32_0, RoomItem_0.Int32_1), true, true);
         foreach (AffectedTile current in dictionary.Values)
         {
             RoomItem_0.method_8().method_87(RoomItem_0.method_8().method_43(current.Int32_0, current.Int32_1), true, true);
         }
     }
     if (Session != null)
     {
         RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
         RoomItem_0.method_8().method_10(RoomUser_, RoomItem_0);
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     RoomUser @class = null;
     if (Session != null)
     {
         @class = RoomItem_0.method_8().GetRoomUserByHabbo(Session.GetHabbo().Id);
         if (@class == null)
         {
             return;
         }
     }
     if (Session == null || RoomItem_0.method_8().method_99(RoomItem_0.Int32_0, RoomItem_0.Int32_1, @class.int_3, @class.int_4))
     {
         if (RoomItem_0.ExtraData != "-1")
         {
             if (int_0 == -1)
             {
                 RoomItem_0.ExtraData = "0";
                 RoomItem_0.method_4();
             }
             else
             {
                 RoomItem_0.uint_3 = @class.uint_0;
                 RoomItem_0.ExtraData = "-1";
                 RoomItem_0.UpdateState(false, true);
                 RoomItem_0.ReqUpdate(4);
             }
         }
     }
     else
     {
         if (Session != null && @class != null && @class.bool_0)
         {
             try
             {
                 @class.method_4(RoomItem_0.GStruct1_1);
             }
             catch
             {
             }
         }
     }
 }
 public void FreezeUser(RoomItem Item, RoomItem Item2)
 {
     if (Item.method_8().frzTimer == true)
     {
         for (int i = 0; i < Item.method_8().RoomUser_0.Length; i++)
         {
             RoomUser User2 = Item.method_8().RoomUser_0[i];
             if (User2 != null)
             {
                 if (User2.int_3 == Item2.Int32_0 && User2.int_4 == Item2.Int32_1)
                 {
                     ThreadPool.QueueUserWorkItem(o =>
                     {
                         Item.method_8().GetFreeze().FreezeUser(User2);
                     });
                 }
             }
         }
     }
 }
 public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
 {
     if (UserHasRights && Session != null)
     {
         Item.method_9();
         ServerMessage Message = new ServerMessage(651u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         if (Item.string_5.Length > 0)
         {
             Message.AppendString(Item.string_5);
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendInt32(Item.GetBaseItem().Sprite);
         Message.AppendUInt(Item.uint_0);
         Message.AppendStringWithBreak("");
         Message.AppendString("K");
         if (Item.string_3.Length > 0)
         {
             Message.AppendString(Item.string_3);
         }
         else
         {
             Message.AppendString("HHH");
         }
         Message.AppendString("IK");
         if (Item.string_6.Length > 0)
         {
             Message.AppendInt32(Convert.ToInt32(Item.string_6));
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendStringWithBreak("H");
         Session.SendMessage(Message);
     }
 }
        public bool BreakIceBlock(RoomItem Item, RoomItem Item2)
        {
            if (Item.method_8().frzTimer == true)
            {
                Item2.ExtraData = "11200";
                Item2.UpdateState(false, true);

                int rand = GoldTreeEnvironment.GetRandomNumber(1, 11);
                foreach (RoomItem Item3 in Item.method_8().GetFreeze().freezeBlocks.Values)
                {
                    if (Item2.Int32_0 == Item3.Int32_0 && Item2.Int32_1 == Item3.Int32_1)
                    {
                        if (string.IsNullOrEmpty(Item3.ExtraData))
                        {
                            Item3.method_8().GetFreeze().SetRandomPowerUp(Item3);
                            return true;
                        }
                    }
                }
            }
            return false;
        }
Example #26
0
        public void PickUpPowerUp(RoomItem item, RoomUser user)
        {
            switch (item.freezePowerUp)
            {
                case FreezePowerUp.BlueArrow:
                    user.FreezeRange++;
                    break;
                case FreezePowerUp.Snowballs:
                    user.FreezeBalls++;
                    break;
                case FreezePowerUp.GreenArrow:
                case FreezePowerUp.OrangeSnowball:
                    user.freezePowerUp = item.freezePowerUp;
                    break;

                case FreezePowerUp.Shield:
                    ActivateShield(user);
                    break;

                case FreezePowerUp.Heart:
                    {
                        if (user.FreezeLives <= 2)
                        {
                            user.FreezeLives++;
                            this.room.GetGameManager().AddPointToTeam(user.team, 10, user);
                        }
                        /*ServerMessage message = new ServerMessage();
                        message.Init(Outgoing.UpdateFreezeLives);
                        message.AppendInt32(user.InternalRoomID);
                        message.AppendInt32(user.FreezeLives);
                        user.GetClient().SendMessage(message);*/
                        break;
                    }
            }
            item.freezePowerUp = FreezePowerUp.None;
            item.ExtraData = "1" + item.ExtraData;
            item.UpdateState(false, true);
        }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (bool_0 && Session != null)
     {
         RoomItem_0.method_10();
         ServerMessage Message = new ServerMessage(652u);
         Message.AppendInt32(0);
         Message.AppendInt32(5);
         if (RoomItem_0.string_2.Length > 0)
         {
             Message.AppendString(RoomItem_0.string_2);
         }
         else
         {
             Message.AppendInt32(0);
         }
         Message.AppendInt32(RoomItem_0.GetBaseItem().Sprite);
         Message.AppendUInt(RoomItem_0.uint_0);
         Message.AppendStringWithBreak("");
         Message.AppendStringWithBreak("HH");
         Session.SendMessage(Message);
     }
 }
        public override void OnRemove(GameClient Session, RoomItem Item)
        {
            DataRow dataRow2;
            using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
            {
                dataRow2 = @class.ReadDataRow("SELECT fw_count FROM items WHERE id = '" + Item.uint_0 + "'");
            }
            if (dataRow2 != null)
            {
                Item.FireWorkCount = (int)dataRow2["fw_count"];
            }

            if (Item.FireWorkCount > 0)
            {
                Item.ExtraData = "1";
                Item.UpdateState(true, true);
            }

            else if (Item.FireWorkCount <= 0)
            {
                Item.ExtraData = "0";
                Item.UpdateState(true, true);
            }
        }
 public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (Session != null)
     {
         RoomUser @class = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
         Room class2 = RoomItem_0.method_8();
         if (RoomItem_0.method_8().method_99(RoomItem_0.Int32_0, RoomItem_0.Int32_1, @class.int_3, @class.int_4))
         {
             RoomItem_0.method_8().method_10(@class, RoomItem_0);
             int num = RoomItem_0.Int32_0;
             int num2 = RoomItem_0.Int32_1;
             RoomItem_0.ExtraData = "11";
             if (@class.int_8 == 4)
             {
                 num2--;
             }
             else
             {
                 if (@class.int_8 == 0)
                 {
                     num2++;
                 }
                 else
                 {
                     if (@class.int_8 == 6)
                     {
                         num++;
                     }
                     else
                     {
                         if (@class.int_8 == 2)
                         {
                             num--;
                         }
                         else
                         {
                             if (@class.int_8 == 3)
                             {
                                 num--;
                                 num2--;
                             }
                             else
                             {
                                 if (@class.int_8 == 1)
                                 {
                                     num--;
                                     num2++;
                                 }
                                 else
                                 {
                                     if (@class.int_8 == 7)
                                     {
                                         num++;
                                         num2++;
                                     }
                                     else
                                     {
                                         if (@class.int_8 == 5)
                                         {
                                             num++;
                                             num2--;
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             @class.MoveTo(RoomItem_0.Int32_0, RoomItem_0.Int32_1);
             class2.method_79(null, RoomItem_0, num, num2, 0, false, true, true);
         }
     }
 }
 public override void OnRemove(GameClient Session, RoomItem RoomItem_0)
 {
 }