Ejemplo n.º 1
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				if (this.Modes == 0)
				{
					Item.UpdateState(false, true);
				}
				int num = 0;
				int num2 = 0;
				if (Item.ExtraData.Length > 0)
				{
					num = int.Parse(Item.ExtraData);
				}
				if (num <= 0)
				{
					num2 = 1;
				}
				else
				{
					if (num >= this.Modes)
					{
						num2 = 0;
					}
					else
					{
						num2 = num + 1;
					}
				}
				if (num2 == 0)
				{
					if (Item.GetRoom().method_97(Item.GetX, Item.GetY))
					{
						return;
					}
					Dictionary<int, AffectedTile> dictionary = Item.GetRoom().GetAffectedTiles(Item.GetBaseItem().Length, Item.GetBaseItem().Width, Item.GetX, Item.GetY, Item.Rot);
					if (dictionary == null)
					{
						dictionary = new Dictionary<int, AffectedTile>();
					}
					foreach (AffectedTile current in dictionary.Values)
					{
						if (Item.GetRoom().method_97(current.X, current.Y))
						{
							return;
						}
					}
				}
				Item.ExtraData = num2.ToString();
				Item.UpdateState();
				Item.GetRoom().GenerateMaps();
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				ServerMessage Message = new ServerMessage(650);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(0);
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("I");
				if (Item.Extra2.Length > 0)
				{
					Message.AppendString(Item.Extra2);
				}
				else
				{
					Message.AppendString("RB");
				}
				Message.AppendStringWithBreak("HRAH");
				Session.SendMessage(Message);
				Item.ReqUpdate(1);
			}
		}
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight && Session != null)
			{
				Item.method_10();
				ServerMessage Message = new ServerMessage(651);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				if (Item.Extra1.Length > 0)
				{
					Message.AppendString(Item.Extra1);
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Message.AppendStringWithBreak("");
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendInt32(0);
				Message.AppendStringWithBreak("");
				Session.SendMessage(Message);
			}
		}
Ejemplo n.º 4
0
		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.GetRoom().GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.GetX, RoomItem_0.GetY, RoomItem_0.Rot);
				RoomItem_0.GetRoom().GenerateMaps();
				RoomItem_0.GetRoom().UpdateUserStatus(RoomItem_0.GetRoom().GetUserForSquare(RoomItem_0.GetX, RoomItem_0.GetY), true, true);
				foreach (AffectedTile current in dictionary.Values)
				{
					RoomItem_0.GetRoom().UpdateUserStatus(RoomItem_0.GetRoom().GetUserForSquare(current.X, current.Y), true, true);
				}
			}
			if (Session != null)
			{
				RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
				RoomItem_0.GetRoom().method_10(RoomUser_, RoomItem_0);
			}
		}
Ejemplo n.º 5
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (UserHasRight)
			{
				ServerMessage Message = new ServerMessage(651);
				Message.AppendInt32(0);
				Message.AppendInt32(5);
				Message.AppendInt32(1);
				Message.AppendUInt(Item.Id);
				Message.AppendInt32(Item.GetBaseItem().SpriteId);
				Message.AppendUInt(Item.Id);
				Session.SendMessage(Message);
			}
		}
		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.Extra1.Length > 0)
				{
					Message.AppendString(RoomItem_0.Extra1);
				}
				else
				{
					Message.AppendInt32(0);
				}
				Message.AppendInt32(RoomItem_0.GetBaseItem().SpriteId);
				Message.AppendUInt(RoomItem_0.Id);
				Message.AppendStringWithBreak("");
				Message.AppendStringWithBreak("HH");
				Session.SendMessage(Message);
			}
		}
Ejemplo n.º 7
0
		public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
		{
			if (RoomItem_0.ExtraData != "1" && RoomItem_0.GetBaseItem().VendingIds.Count >= 1 && RoomItem_0.InteractingUser == 0u)
			{
				if (Session != null)
				{
					RoomUser @class = RoomItem_0.GetRoom().GetRoomUserByHabbo(Session.GetHabbo().Id);
					if (@class == null)
					{
						return;
					}
					if (!RoomItem_0.GetRoom().method_99(@class.X, @class.Y, RoomItem_0.GetX, RoomItem_0.GetY))
					{
						if ([email protected])
						{
							return;
						}
						try
						{
							@class.MoveTo(RoomItem_0.SquareInFront);
							return;
						}
						catch
						{
							return;
						}
					}
					RoomItem_0.InteractingUser = Session.GetHabbo().Id;
					@class.CanWalk = false;
					@class.ClearMovement(true);
					@class.SetRot(Rotation.Calculate(@class.X, @class.Y, RoomItem_0.GetX, RoomItem_0.GetY));
				}
				RoomItem_0.ReqUpdate(2);
				RoomItem_0.ExtraData = "1";
				RoomItem_0.UpdateState(false, true);
			}
		}
Ejemplo n.º 8
0
		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().SpriteId);
				Message.AppendUInt(RoomItem_0.Id);
				Message.AppendStringWithBreak("");
				Message.AppendString("I");
				if (RoomItem_0.Extra2.Length > 0)
				{
					Message.AppendString(RoomItem_0.Extra2);
				}
				else
				{
					Message.AppendString("PY");
				}
				Message.AppendStringWithBreak("HRBH");
				Session.SendMessage(Message);
			}
		}
Ejemplo n.º 9
0
 public bool method_82(GameClient Session, RoomItem RoomItem_0, bool bool_13, string string_10)
 {
     if (bool_13)
     {
         RoomItem_0.Interactor.OnPlace(Session, RoomItem_0);
         string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
         if (text != null && text == "dimmer" && this.MoodlightData == null)
         {
             this.MoodlightData = new MoodlightData(RoomItem_0.Id);
             RoomItem_0.ExtraData = this.MoodlightData.method_7();
         }
         if (!this.mAddedItems.ContainsKey(RoomItem_0.Id))
         {
             this.mAddedItems.Add(RoomItem_0.Id, RoomItem_0);
             if (RoomItem_0.IsFloorItem)
             {
                 this.mFloorItems.Add(RoomItem_0.Id, RoomItem_0);
             }
             else
             {
                 if (!this.mWallItems.Contains(RoomItem_0.Id))
                 {
                     this.mWallItems.Add(RoomItem_0.Id, RoomItem_0);
                 }
             }
         }
         ServerMessage Message5_ = new ServerMessage(83u);
         RoomItem_0.Serialize(Message5_);
         this.SendMessage(Message5_, null);
     }
     else
     {
         if (!this.mMovedItems.Contains(RoomItem_0.Id))
         {
             this.mMovedItems.Add(RoomItem_0.Id, RoomItem_0);
         }
     }
     if (!bool_13)
     {
         RoomItem_0.string_7 = string_10;
         ServerMessage Message5_ = new ServerMessage(85u);
         RoomItem_0.Serialize(Message5_);
         this.SendMessage(Message5_, null);
     }
     return true;
 }
Ejemplo n.º 10
0
 public bool method_81(RoomItem RoomItem_0, int int_17, int int_18, double double_3)
 {
     Dictionary<int, AffectedTile> dictionary = this.GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, RoomItem_0.Rot);
     RoomItem_0.method_0(int_17, int_18, double_3);
     if (!this.mMovedItems.Contains(RoomItem_0.Id))
     {
         this.mMovedItems.Add(RoomItem_0.Id, RoomItem_0);
     }
     this.GenerateMaps();
     this.UpdateUserStatus(this.GetUserForSquare(int_17, int_18), true, true);
     foreach (AffectedTile current in dictionary.Values)
     {
         this.UpdateUserStatus(this.GetUserForSquare(current.X, current.Y), true, true);
     }
     return true;
 }
Ejemplo n.º 11
0
        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)
        {
            Dictionary<int, AffectedTile> dictionary = this.GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, int_19);
            bool result;
            if (!this.ValidTile(int_17, int_18))
            {
                result = false;
            }
            else
            {
                foreach (AffectedTile current in dictionary.Values)
                {
                    if (!this.ValidTile(current.X, current.Y))
                    {
                        result = false;
                        return result;
                    }
                }
                double num = this.Model.SqFloorHeight[int_17, int_18];
                if (!bool_14)
                {
                    if (RoomItem_0.Rot == int_19 && RoomItem_0.GetX == int_17 && RoomItem_0.GetY == int_18 && RoomItem_0.GetZ != num)
                    {
                        result = false;
                        return result;
                    }
                    if (this.Model.SqState[int_17, int_18] != SquareState.OPEN)
                    {
                        result = false;
                        return result;
                    }
                    foreach (AffectedTile current in dictionary.Values)
                    {
                        if (this.Model.SqState[current.X, current.Y] != SquareState.OPEN)
                        {
                            result = false;
                            return result;
                        }
                    }
                    if (RoomItem_0.GetBaseItem().IsSeat || RoomItem_0.IsRoller)
                    {
                        goto IL_1FE;
                    }
                    if (this.method_97(int_17, int_18))
                    {
                        result = false;
                        return result;
                    }
                    using (Dictionary<int, AffectedTile>.ValueCollection.Enumerator enumerator = dictionary.Values.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            AffectedTile current = enumerator.Current;
                            if (this.method_97(current.X, current.Y))
                            {
                                result = false;
                                return result;
                            }
                        }
                        goto IL_1FE;
                    }
                }
                if (this.Model.SqState[int_17, int_18] != SquareState.OPEN)
                {
                    result = false;
                    return result;
                }
                if (!bool_15 && this.method_97(int_17, int_18))
                {
                    result = false;
                    return result;
                }
            IL_1FE:
                List<RoomItem> list = this.method_93(int_17, int_18);
                List<RoomItem> list2 = new List<RoomItem>();
                List<RoomItem> list3 = new List<RoomItem>();
                foreach (AffectedTile current in dictionary.Values)
                {
                    List<RoomItem> list4 = this.method_93(current.X, current.Y);
                    if (list4 != null)
                    {
                        list2.AddRange(list4);
                    }
                }
                if (list == null)
                {
                    list = new List<RoomItem>();
                }
                list3.AddRange(list);
                list3.AddRange(list2);
                int num2 = 0;
                foreach (RoomItem current2 in list3)
                {
                    if (current2 != null && current2.Id != RoomItem_0.Id && current2.GetBaseItem() != null)
                    {
                        if (!current2.GetBaseItem().Stackable)
                        {
                            result = false;
                            return result;
                        }
                        if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer" && current2.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer")
                        {
                            result = false;
                            return result;
                        }
                        if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "ball")
                        {
                            if (current2.GetBaseItem().InteractionType.ToLower() == "blue_goal")
                            {
                                num2 = 11;
                            }
                            if (current2.GetBaseItem().InteractionType.ToLower() == "red_goal")
                            {
                                num2 = 5;
                            }
                            if (current2.GetBaseItem().InteractionType.ToLower() == "yellow_goal")
                            {
                                num2 = 14;
                            }
                            if (current2.GetBaseItem().InteractionType.ToLower() == "green_goal")
                            {
                                num2 = 8;
                            }
                        }
                    }
                }
                if (num2 > 0)
                {
                    this.method_89(num2, RoomItem_0, false);
                }
                if (!RoomItem_0.IsRoller)
                {
                    if (RoomItem_0.Rot != int_19 && RoomItem_0.GetX == int_17 && RoomItem_0.GetY == int_18)
                    {
                        num = RoomItem_0.GetZ;
                    }
                    foreach (RoomItem current2 in list3)
                    {
                        if (current2.Id != RoomItem_0.Id && current2.TotalHeight > num)
                        {
                            num = current2.TotalHeight;
                        }
                    }
                }
                if (int_19 != 0 && int_19 != 2 && int_19 != 4 && int_19 != 6 && int_19 != 8)
                {
                    int_19 = 0;
                }
                Dictionary<int, AffectedTile> dictionary2 = new Dictionary<int, AffectedTile>();
                dictionary2 = this.GetAffectedTiles(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.GetX, RoomItem_0.GetY, RoomItem_0.Rot);
                int num3 = 0;
                int num4 = 0;
                if (!bool_13)
                {
                    num3 = RoomItem_0.GetX;
                    num4 = RoomItem_0.GetY;
                }
                RoomItem_0.Rot = int_19;
                RoomItem_0.method_0(int_17, int_18, num);
                if (!bool_14 && Session != null)
                {
                    RoomItem_0.Interactor.OnPlace(Session, RoomItem_0);
                }
                if (bool_13)
                {
                    if (this.mRemovedItems.Contains(RoomItem_0.Id))
                    {
                        this.mRemovedItems.Remove(RoomItem_0.Id);
                    }
                    if (this.mAddedItems.Contains(RoomItem_0.Id))
                    {
                        result = false;
                        return result;
                    }
                    this.mAddedItems.Add(RoomItem_0.Id, RoomItem_0);
                    if (RoomItem_0.IsFloorItem)
                    {
                        if (this.mFloorItems.Contains(RoomItem_0.Id))
                        {
                            this.mFloorItems.Remove(RoomItem_0.Id);
                        }
                        this.mFloorItems.Add(RoomItem_0.Id, RoomItem_0);
                    }
                    else
                    {
                        if (this.mWallItems.Contains(RoomItem_0.Id))
                        {
                            this.mWallItems.Remove(RoomItem_0.Id);
                        }
                        this.mWallItems.Add(RoomItem_0.Id, RoomItem_0);
                    }
                    ServerMessage Message5_ = new ServerMessage(93u);
                    RoomItem_0.Serialize(Message5_);
                    this.SendMessage(Message5_, null);
                    string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
                    switch (text)
                    {
                        case "bb_patch":
                            this.bbTiles.Add(RoomItem_0);
                            if (RoomItem_0.ExtraData == "5")
                            {
                                this.bbrTiles.Add(RoomItem_0);
                            }
                            else
                            {
                                if (RoomItem_0.ExtraData == "8")
                                {
                                    this.bbgTiles.Add(RoomItem_0);
                                }
                                else
                                {
                                    if (RoomItem_0.ExtraData == "11")
                                    {
                                        this.bbbTiles.Add(RoomItem_0);
                                    }
                                    else
                                    {
                                        if (RoomItem_0.ExtraData == "14")
                                        {
                                            this.bbyTiles.Add(RoomItem_0);
                                        }
                                    }
                                }
                            }
                            break;
                        case "blue_score":
                            this.BlueScoreboards.Add(RoomItem_0);
                            break;
                        case "green_score":
                            this.GreenScoreboards.Add(RoomItem_0);
                            break;
                        case "red_score":
                            this.RedScoreboards.Add(RoomItem_0);
                            break;
                        case "yellow_score":
                            this.YellowScoreboards.Add(RoomItem_0);
                            break;
                        case "stickiepole":
                            this.StickiePoles.Add(RoomItem_0);
                            break;
                        case "wf_trg_onsay":
                        case "wf_trg_enterroom":
                        case "wf_trg_furnistate":
                        case "wf_trg_onfurni":
                        case "wf_trg_offfurni":
                        case "wf_trg_gameend":
                        case "wf_trg_gamestart":
                        case "wf_trg_attime":
                        case "wf_trg_atscore":
                            if (!this.WF_Triggers.Contains(RoomItem_0))
                            {
                                this.WF_Triggers.Add(RoomItem_0);
                            }
                            break;
                        case "wf_trg_timer":
                            if (RoomItem_0.Extra1.Length <= 0)
                            {
                                RoomItem_0.Extra1 = "10";
                            }
                            if (!this.WF_Triggers.Contains(RoomItem_0))
                            {
                                this.WF_Triggers.Add(RoomItem_0);
                            }
                            RoomItem_0.TimerRunning = true;
                            RoomItem_0.ReqUpdate(1);
                            break;
                        case "wf_act_saymsg":
                        case "wf_act_moveuser":
                        case "wf_act_togglefurni":
                        case "wf_act_givepoints":
                        case "wf_act_moverotate":
                        case "wf_act_matchfurni":
                        case "wf_act_give_phx":
                            if (!this.WF_Effects.Contains(RoomItem_0))
                            {
                                this.WF_Effects.Add(RoomItem_0);
                            }
                            break;
                        case "wf_cnd_trggrer_on_frn":
                        case "wf_cnd_furnis_hv_avtrs":
                        case "wf_cnd_has_furni_on":
                        case "wf_cnd_phx":
                            if (!this.WF_Conditions.Contains(RoomItem_0))
                            {
                                this.WF_Conditions.Add(RoomItem_0);
                            }
                            break;
                    }
                }
                else
                {
                    if (!this.mMovedItems.Contains(RoomItem_0.Id) && !this.mAddedItems.ContainsKey(RoomItem_0.Id))
                    {
                        this.mMovedItems.Add(RoomItem_0.Id, RoomItem_0);
                    }
                    if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_act_give_phx" && Session != null)
                    {
                        string text2 = RoomItem_0.Extra1.Split(new char[]
						{
							':'
						})[0].ToLower();
                        if (!PhoenixEnvironment.GetGame().GetRoleManager().HasWiredEffectRole(text2, Session))
                        {
                            RoomItem_0.Extra1 = "";
                        }
                    }
                    if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_cnd_phx" && Session != null)
                    {
                        string text2 = RoomItem_0.Extra1.Split(new char[]
						{
							':'
						})[0].ToLower();
                        if (!PhoenixEnvironment.GetGame().GetRoleManager().HasWiredConditionRole(text2, Session))
                        {
                            RoomItem_0.Extra1 = "";
                        }
                    }
                    ServerMessage Message5_ = new ServerMessage(95u);
                    RoomItem_0.Serialize(Message5_);
                    this.SendMessage(Message5_, null);
                }
                this.GenerateMaps();
                if (!bool_14)
                {
                    this.UpdateUserStatus(this.GetUserForSquare(int_17, int_18), true, true);
                    foreach (AffectedTile current in dictionary.Values)
                    {
                        this.UpdateUserStatus(this.GetUserForSquare(current.X, current.Y), true, true);
                    }
                    if (num3 > 0 || num4 > 0)
                    {
                        this.UpdateUserStatus(this.GetUserForSquare(num3, num4), true, true);
                    }
                    foreach (AffectedTile current in dictionary2.Values)
                    {
                        this.UpdateUserStatus(this.GetUserForSquare(current.X, current.Y), true, true);
                    }
                }
                result = true;
            }
            return result;
        }
Ejemplo n.º 12
0
 public void LoadFurniture()
 {
     this.mFloorItems.Clear();
     this.mWallItems.Clear();
     DataTable table;
     using (DatabaseClient client = PhoenixEnvironment.GetDatabase().GetClient())
     {
         table = client.ReadDataTable("SELECT Id, base_item, extra_data, x, y, z, rot, wall_pos FROM items WHERE room_id = '" + this.Id + "' ORDER BY room_id DESC");
     }
     if (table != null)
     {
         foreach (DataRow row in table.Rows)
         {
             RoomItem item = new RoomItem((uint)row["Id"], this.RoomId, (uint)row["base_item"], (string)row["extra_data"], (int)row["x"], (int)row["y"], (double)row["z"], (int)row["rot"], (string)row["wall_pos"], this);
             if (item.IsRoller)
             {
                 this.mGotRollers = true;
             }
             if (item.GetBaseItem().InteractionType.ToLower().Contains("wf_") || item.GetBaseItem().InteractionType.ToLower().Contains("fbgate"))
             {
                 DataRow row2;
                 using (DatabaseClient client2 = PhoenixEnvironment.GetDatabase().GetClient())
                 {
                     row2 = client2.ReadDataRow("SELECT extra1,extra2,extra3,extra4,extra5 FROM wired_items WHERE item_id = '" + item.Id + "'");
                 }
                 if (row2 != null)
                 {
                     item.Extra1 = (string)row2["extra1"];
                     item.Extra2 = (string)row2["extra2"];
                     item.Extra3 = (string)row2["extra3"];
                     item.Extra4 = (string)row2["extra4"];
                     item.Extra5 = (string)row2["extra5"];
                 }
             }
             switch (item.GetBaseItem().InteractionType.ToLower())
             {
                 case "dice":
                     if (item.ExtraData == "-1")
                     {
                         item.ExtraData = "0";
                     }
                     break;
                 case "fbgate":
                     if (item.ExtraData != "" && item.ExtraData.Contains(','))
                     {
                         item.Extra1 = item.ExtraData.Split(new char[] {	','	})[0];
                         item.Extra2 = item.ExtraData.Split(new char[] {	','	})[1];
                     }
                     break;
                 case "dimmer":
                     if (this.MoodlightData == null)
                     {
                         this.MoodlightData = new MoodlightData(item.Id);
                     }
                     break;
                 case "bb_patch":
                     this.bbTiles.Add(item);
                     if (item.ExtraData == "5")
                     {
                         this.bbrTiles.Add(item);
                     }
                     else if (item.ExtraData == "8")    
                     {    
                         this.bbgTiles.Add(item);
                     }
                     else if (item.ExtraData == "11")
                     {
                         this.bbbTiles.Add(item);
                     }
                     else if (item.ExtraData == "14")
                     {
                         this.bbyTiles.Add(item);
                     }
                     break;
                 case "blue_score":
                     this.BlueScoreboards.Add(item);
                     break;
                 case "green_score":
                     this.GreenScoreboards.Add(item);
                     break;
                 case "red_score":
                     this.RedScoreboards.Add(item);
                     break;
                 case "yellow_score":
                     this.YellowScoreboards.Add(item);
                     break;
                 case "stickiepole":
                     this.StickiePoles.Add(item);
                     break;
                 case "wf_trg_onsay":
                 case "wf_trg_enterroom":
                 case "wf_trg_furnistate":
                 case "wf_trg_onfurni":
                 case "wf_trg_offfurni":
                 case "wf_trg_gameend":
                 case "wf_trg_gamestart":
                 case "wf_trg_attime":
                 case "wf_trg_atscore":
                     if (!this.WF_Triggers.Contains(item))
                     {
                         this.WF_Triggers.Add(item);
                     }
                     break;
                 case "wf_trg_timer":
                     if (item.Extra1.Length <= 0)
                     {
                         item.Extra1 = "10";
                     }
                     if (!this.WF_Triggers.Contains(item))
                     {
                         this.WF_Triggers.Add(item);
                     }
                     item.TimerRunning = true;
                     item.ReqUpdate(1);
                     break;
                 case "wf_act_saymsg":
                 case "wf_act_moveuser":
                 case "wf_act_togglefurni":
                 case "wf_act_givepoints":
                 case "wf_act_moverotate":
                 case "wf_act_matchfurni":
                 case "wf_act_give_phx":
                     if (!this.WF_Effects.Contains(item))
                     {
                         this.WF_Effects.Add(item);
                     }
                     break;
                 case "wf_cnd_trggrer_on_frn":
                 case "wf_cnd_furnis_hv_avtrs":
                 case "wf_cnd_has_furni_on":
                 case "wf_cnd_phx":
                     if (!this.WF_Conditions.Contains(item))
                     {
                         this.WF_Conditions.Add(item);
                     }
                     break;
                 case "jukebox":
                     RoomMusicController roomMusicController = this.GetRoomMusicController();
                     roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(item);
                     break;
             }
             if (this.mFloorItems.Contains(item.Id))
             {
                 this.mFloorItems.Remove(item.Id);
             }
             if (this.mWallItems.Contains(item.Id))
             {
                 this.mWallItems.Remove(item.Id);
             }
             if (item.IsFloorItem)
             {
                 this.mFloorItems.Add(item.Id, item);
             }
             else
             {
                 this.mWallItems.Add(item.Id, item);
             }
         }
     }
 }
Ejemplo n.º 13
0
        public bool method_21(RoomUser RoomUser_1, RoomItem RoomItem_0, string string_10)
        {
            bool result;
            try
            {
                if (this.bool_6 || this.bool_7)
                {
                    result = false;
                }
                else
                {
                    bool flag = false;
                    int num = 0;
                    int num2 = 0;
                    bool flag2 = false;
                    string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
                    switch (text)
                    {
                        case "wf_trg_onsay":
                            if (string_10.Contains(RoomItem_0.Extra1.ToLower()))
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_enterroom":
                            if (RoomItem_0.Extra1 == "" || RoomItem_0.Extra1 == RoomUser_1.GetClient().GetHabbo().Username)
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_furnistate":
                            if (RoomItem_0.Extra2.Length > 0)
                            {
                                string[] collection = RoomItem_0.Extra2.Split(new char[]
							{
								','
							});
                                List<string> list = new List<string>(collection);
                                foreach (string current in list)
                                {
                                    if (current == string_10)
                                    {
                                        flag = true;
                                    }
                                }
                            }
                            break;
                        case "wf_trg_onfurni":
                            if (RoomItem_0.Extra2.Length > 0)
                            {
                                string[] collection = RoomItem_0.Extra2.Split(new char[]
							{
								','
							});
                                List<string> list = new List<string>(collection);
                                List<string> list2 = list;
                                foreach (string current in list)
                                {
                                    if (!(current != string_10))
                                    {
                                        RoomItem @class = this.GetItem(Convert.ToUInt32(string_10));
                                        if (@class != null)
                                        {
                                            flag = true;
                                        }
                                        else
                                        {
                                            list2.Remove(current);
                                        }
                                    }
                                }
                                RoomItem_0.Extra2 = string.Join(",", list2.ToArray());
                            }
                            break;
                        case "wf_trg_offfurni":
                            if (RoomItem_0.Extra2.Length > 0)
                            {
                                string[] collection = RoomItem_0.Extra2.Split(new char[]
							{
								','
							});
                                List<string> list = new List<string>(collection);
                                List<string> list2 = list;
                                foreach (string current in list)
                                {
                                    if (!(current != string_10))
                                    {
                                        RoomItem @class = this.GetItem(Convert.ToUInt32(string_10));
                                        if (@class != null)
                                        {
                                            flag = true;
                                        }
                                        else
                                        {
                                            list2.Remove(current);
                                        }
                                    }
                                }
                                RoomItem_0.Extra2 = string.Join(",", list2.ToArray());
                            }
                            break;
                        case "wf_trg_gameend":
                            if (string_10 == "GameEnded")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_gamestart":
                            if (string_10 == "GameBegun")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_timer":
                            if (string_10 == "Timer")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_attime":
                            if (string_10 == "AtTime")
                            {
                                flag = true;
                            }
                            break;
                        case "wf_trg_atscore":
                            if (string_10 == "TheScore")
                            {
                                flag = true;
                            }
                            break;
                    }
                    try
                    {
                        List<RoomItem> list3 = this.method_93(RoomItem_0.GetX, RoomItem_0.GetY);
                        if (list3 == null)
                        {
                            result = false;
                            return result;
                        }
                        foreach (RoomItem current2 in list3)
                        {
                            text = current2.GetBaseItem().InteractionType.ToLower();
                            if (text != null)
                            {
                                int num4;
                                if (!(text == "wf_cnd_phx"))
                                {
                                    if (!(text == "wf_cnd_trggrer_on_frn"))
                                    {
                                        string[] collection;
                                        List<string> list;
                                        List<RoomItem> list4;
                                        if (!(text == "wf_cnd_furnis_hv_avtrs"))
                                        {
                                            if (!(text == "wf_cnd_has_furni_on"))
                                            {
                                                continue;
                                            }
                                            num4 = num2;
                                            num++;
                                            current2.ExtraData = "1";
                                            current2.UpdateState(false, true);
                                            current2.ReqUpdate(1);
                                            current2.method_10();
                                            if (current2.Extra2.Length <= 0)
                                            {
                                                continue;
                                            }
                                            collection = current2.Extra2.Split(new char[]
											{
												','
											});
                                            list = new List<string>(collection);
                                            list4 = new List<RoomItem>();
                                            foreach (string current3 in list)
                                            {
                                                list4.Add(this.GetItem(Convert.ToUInt32(current3)));
                                            }
                                            using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
                                            {
                                                while (enumerator3.MoveNext())
                                                {
                                                    RoomItem current4 = enumerator3.Current;
                                                    if (current4 != null)
                                                    {
                                                        Dictionary<int, AffectedTile> dictionary = current4.GetAffectedTiles;
                                                        if (dictionary == null)
                                                        {
                                                            dictionary = new Dictionary<int, AffectedTile>();
                                                        }
                                                        List<RoomItem> list5 = new List<RoomItem>(this.method_45(current4.GetX, current4.GetY));
                                                        if (list5.Count > 1 && num4 + 1 != num2)
                                                        {
                                                            num2++;
                                                            break;
                                                        }
                                                        foreach (AffectedTile current5 in dictionary.Values)
                                                        {
                                                            list5 = new List<RoomItem>(this.method_45(current5.X, current5.Y));
                                                            if (list5.Count > 1 && num4 + 1 != num2)
                                                            {
                                                                num2++;
                                                                break;
                                                            }
                                                        }
                                                    }
                                                }
                                                continue;
                                            }
                                        }
                                        num++;
                                        current2.ExtraData = "1";
                                        current2.UpdateState(false, true);
                                        current2.ReqUpdate(1);
                                        current2.method_10();
                                        if (current2.Extra2.Length <= 0)
                                        {
                                            continue;
                                        }
                                        collection = current2.Extra2.Split(new char[]
										{
											','
										});
                                        list = new List<string>(collection);
                                        list4 = new List<RoomItem>();
                                        foreach (string current3 in list)
                                        {
                                            list4.Add(this.GetItem(Convert.ToUInt32(current3)));
                                        }
                                        bool flag3 = true;
                                        foreach (RoomItem current4 in list4)
                                        {
                                            if (current4 != null)
                                            {
                                                bool flag4 = false;
                                                Dictionary<int, AffectedTile> dictionary = current4.GetAffectedTiles;
                                                if (dictionary == null)
                                                {
                                                    dictionary = new Dictionary<int, AffectedTile>();
                                                }
                                                if (this.SquareHasUsers(current4.GetX, current4.GetY))
                                                {
                                                    flag4 = true;
                                                }
                                                foreach (AffectedTile current5 in dictionary.Values)
                                                {
                                                    if (this.SquareHasUsers(current5.X, current5.Y))
                                                    {
                                                        flag4 = true;
                                                        break;
                                                    }
                                                }
                                                if (!flag4)
                                                {
                                                    flag3 = false;
                                                }
                                            }
                                        }
                                        if (flag3)
                                        {
                                            num2++;
                                            continue;
                                        }
                                        continue;
                                    }
                                    else
                                    {
                                        num4 = num2;
                                        num++;
                                        current2.ExtraData = "1";
                                        current2.UpdateState(false, true);
                                        current2.ReqUpdate(1);
                                        current2.method_10();
                                        if (current2.Extra2.Length <= 0)
                                        {
                                            continue;
                                        }
                                        string[] collection = current2.Extra2.Split(new char[]
										{
											','
										});
                                        List<string> list = new List<string>(collection);
                                        List<RoomItem> list4 = new List<RoomItem>();
                                        foreach (string current3 in list)
                                        {
                                            list4.Add(this.GetItem(Convert.ToUInt32(current3)));
                                        }
                                        if (RoomUser_1 == null)
                                        {
                                            continue;
                                        }
                                        using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
                                        {
                                            while (enumerator3.MoveNext())
                                            {
                                                RoomItem current4 = enumerator3.Current;
                                                if (current4 != null)
                                                {
                                                    Dictionary<int, AffectedTile> dictionary = current4.GetAffectedTiles;
                                                    if (dictionary == null)
                                                    {
                                                        dictionary = new Dictionary<int, AffectedTile>();
                                                    }
                                                    if (RoomUser_1.X == current4.GetX && RoomUser_1.Y == current4.GetY && num4 + 1 != num2)
                                                    {
                                                        num2++;
                                                        break;
                                                    }
                                                    foreach (AffectedTile current5 in dictionary.Values)
                                                    {
                                                        if (RoomUser_1.X == current5.X && RoomUser_1.Y == current5.Y && num4 + 1 != num2)
                                                        {
                                                            num2++;
                                                            break;
                                                        }
                                                    }
                                                }
                                            }
                                            continue;
                                        }
                                    }
                                }
                                num4 = num2;
                                num++;
                                current2.ExtraData = "1";
                                current2.UpdateState(false, true);
                                current2.ReqUpdate(1);
                                if (current2.Extra1.Length > 0)
                                {
                                    string string_11 = current2.Extra1.Split(new char[]
									{
										':'
									})[0].ToLower();
                                    string string_12 = current2.Extra1.Split(new char[]
									{
										':'
									})[1];
                                    if (RoomUser_1 != null)
                                    {
                                        if (!RoomUser_1.IsBot && this.IsPhxMagicAllowed(RoomUser_1, string_11, string_12))
                                        {
                                            num2++;
                                        }
                                    }
                                    else
                                    {
                                        RoomUser[] array = this.UserList;
                                        for (int i = 0; i < array.Length; i++)
                                        {
                                            RoomUser class2 = array[i];
                                            if (class2 != null && !class2.IsBot && this.IsPhxMagicAllowed(class2, string_11, string_12) && num4 + 1 != num2)
                                            {
                                                num2++;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        if (num != num2)
                        {
                            result = false;
                            return result;
                        }
                    }
                    catch
                    {
                    }
                    if (flag && num == num2)
                    {
                        RoomItem_0.ExtraData = "1";
                        RoomItem_0.UpdateState(false, true);
                        RoomItem_0.ReqUpdate(1);
                        List<RoomItem> list6 = this.method_93(RoomItem_0.GetX, RoomItem_0.GetY);
                        if (list6 == null)
                        {
                            result = false;
                            return result;
                        }
                        bool flag5 = false;
                        foreach (RoomItem current2 in list6)
                        {
                            if (current2.GetBaseItem().InteractionType.ToLower() == "wf_xtra_random")
                            {
                                flag5 = true;
                                break;
                            }
                        }
                        if (flag5)
                        {
                            List<RoomItem> list7 = new List<RoomItem>();
                            Random random = new Random();
                            while (list6.Count != 0)
                            {
                                int index = random.Next(0, list6.Count);
                                list7.Add(list6[index]);
                                list6.RemoveAt(index);
                            }
                            list6 = list7;
                        }
                        foreach (RoomItem current2 in list6)
                        {
                            if (flag5 && flag2)
                            {
                                break;
                            }
                            text = current2.GetBaseItem().InteractionType.ToLower();
                            switch (text)
                            {
                                case "wf_act_give_phx":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (current2.Extra1.Length > 0)
                                    {
                                        string string_11 = current2.Extra1.Split(new char[]
									{
										':'
									})[0].ToLower();
                                        string string_12 = current2.Extra1.Split(new char[]
									{
										':'
									})[1];
                                        if (RoomUser_1 != null)
                                        {
                                            if (!RoomUser_1.IsBot)
                                            {
                                                this.RunPhxMagic(RoomUser_1, string_11, string_12);
                                            }
                                        }
                                        else
                                        {
                                            RoomUser[] array = this.UserList;
                                            for (int i = 0; i < array.Length; i++)
                                            {
                                                RoomUser class2 = array[i];
                                                if (class2 != null && !class2.IsBot)
                                                {
                                                    this.RunPhxMagic(class2, string_11, string_12);
                                                }
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_saymsg":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (current2.Extra1.Length > 0)
                                    {
                                        string text2 = current2.Extra1;
                                        text2 = ChatCommandHandler.ApplyWordFilter(text2);
                                        if (text2.Length > 100)
                                        {
                                            text2 = text2.Substring(0, 100);
                                        }
                                        if (RoomUser_1 != null)
                                        {
                                            if (!RoomUser_1.IsBot)
                                            {
                                                RoomUser_1.GetClient().GetHabbo().Sendselfwhisper(text2);
                                            }
                                        }
                                        else
                                        {
                                            RoomUser[] array = this.UserList;
                                            for (int i = 0; i < array.Length; i++)
                                            {
                                                RoomUser class2 = array[i];
                                                if (class2 != null && !class2.IsBot)
                                                {
                                                    class2.GetClient().GetHabbo().Sendselfwhisper(text2);
                                                }
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_moveuser":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    current2.method_10();
                                    if (current2.Extra2.Length > 0)
                                    {
                                        string[] collection = current2.Extra2.Split(new char[]
									{
										','
									});
                                        List<string> list = new List<string>(collection);
                                        Random random2 = new Random();
                                        int num5 = random2.Next(0, list.Count - 1);
                                        RoomItem class3 = this.GetItem(Convert.ToUInt32(list[num5]));
                                        if (class3 != null)
                                        {
                                            if (RoomUser_1 != null)
                                            {
                                                this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
                                                this.byte_0[RoomUser_1.SetX, RoomUser_1.SetY] = 1;
                                                this.byte_0[class3.GetX, class3.GetY] = 1;
                                                RoomUser_1.IsWalking = false;
                                                RoomUser_1.SetX = class3.GetX;
                                                RoomUser_1.SetY = class3.GetY;
                                                RoomUser_1.SetZ = class3.GetZ;
                                                RoomUser_1.SetPos(class3.GetX, class3.GetY, class3.GetZ);
                                                RoomUser_1.UpdateNeeded = true;
                                                if (!current2.dictionary_1.ContainsKey(RoomUser_1))
                                                {
                                                    current2.dictionary_1.Add(RoomUser_1, 10);
                                                }
                                                if (RoomUser_1.Riding != null)
                                                {
                                                    RoomUser_1.Riding.Rider = null;
                                                    RoomUser_1.Target = null;
                                                    RoomUser_1.Riding = null;
                                                }
                                                this.UpdateUserStatus(RoomUser_1, true, false);
                                            }
                                            else
                                            {
                                                RoomUser[] array = this.UserList;
                                                for (int i = 0; i < array.Length; i++)
                                                {
                                                    RoomUser class2 = array[i];
                                                    if (class2 != null)
                                                    {
                                                        this.byte_0[class2.X, class2.Y] = 1;
                                                        this.byte_0[class3.GetX, class3.GetY] = 1;
                                                        class2.SetPos(class3.GetX, class3.GetY, class3.GetZ);
                                                        class2.UpdateNeeded = true;
                                                        if (!current2.dictionary_1.ContainsKey(class2))
                                                        {
                                                            current2.dictionary_1.Add(class2, 10);
                                                        }
                                                    }
                                                }
                                            }
                                            flag2 = true;
                                        }
                                    }
                                    break;
                                case "wf_act_togglefurni":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (current2.Extra2.Length > 0)
                                    {
                                        string[] collection = current2.Extra2.Split(new char[]
									{
										','
									});
                                        IEnumerable<string> enumerable = new List<string>(collection);
                                        List<string> list2 = enumerable.ToList<string>();
                                        foreach (string current in enumerable)
                                        {
                                            RoomItem class3 = this.GetItem(Convert.ToUInt32(current));
                                            if (class3 != null)
                                            {
                                                class3.Interactor.OnTrigger(null, class3, 0, true);
                                            }
                                            else
                                            {
                                                list2.Remove(current);
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_givepoints":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    if (RoomUser_1 != null && current2.Extra1.Length > 0)
                                    {
                                        this.method_88(RoomUser_1.int_14 + 2, Convert.ToInt32(current2.Extra1), current2);
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_moverotate":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    current2.method_9();
                                    if (current2.Extra3.Length > 0)
                                    {
                                        string[] collection = current2.Extra3.Split(new char[]
									{
										','
									});
                                        IEnumerable<string> enumerable2 = new List<string>(collection);
                                        foreach (string current in enumerable2)
                                        {
                                            RoomItem class3 = this.GetItem(Convert.ToUInt32(current));
                                            if (class3 != null)
                                            {
                                                if (current2.Extra1 != "0" && current2.Extra1 != "")
                                                {
                                                    Coord gstruct1_ = class3.SquareInFront;
                                                    int num5 = 0;
                                                    int num6 = 0;
                                                    int num7 = 0;
                                                    if (current2.Extra1 == "1")
                                                    {
                                                        Random random3 = new Random();
                                                        num5 = random3.Next(1, 5);
                                                    }
                                                    else
                                                    {
                                                        if (current2.Extra1 == "2")
                                                        {
                                                            Random random3 = new Random();
                                                            num6 = random3.Next(1, 3);
                                                        }
                                                        else
                                                        {
                                                            if (current2.Extra1 == "3")
                                                            {
                                                                Random random3 = new Random();
                                                                num7 = random3.Next(1, 3);
                                                            }
                                                        }
                                                    }
                                                    if (current2.Extra1 == "4" || num5 == 1 || num7 == 1)
                                                    {
                                                        gstruct1_ = class3.method_1(4);
                                                    }
                                                    else
                                                    {
                                                        if (current2.Extra1 == "5" || num5 == 2 || num6 == 1)
                                                        {
                                                            gstruct1_ = class3.method_1(6);
                                                        }
                                                        else
                                                        {
                                                            if (current2.Extra1 == "6" || num5 == 3 || num7 == 2)
                                                            {
                                                                gstruct1_ = class3.method_1(0);
                                                            }
                                                            else
                                                            {
                                                                if (current2.Extra1 == "7" || num5 == 4 || num6 == 2)
                                                                {
                                                                    gstruct1_ = class3.method_1(2);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (this.method_37(gstruct1_.X, gstruct1_.Y, true, true, false, true, false) && class3.GetBaseItem().InteractionType != "wf_trg_timer")
                                                    {
                                                        this.method_41(class3, gstruct1_, current2.Id, class3.GetZ);
                                                    }
                                                }
                                                if (current2.Extra2.Length > 0 && current2.Extra2 != "0" && current2.Extra2 != "")
                                                {
                                                    int num5 = 0;
                                                    if (current2.Extra2 == "1")
                                                    {
                                                        num5 = class3.Rot + 2;
                                                        if (num5 > 6)
                                                        {
                                                            num5 = 0;
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (current2.Extra2 == "2")
                                                        {
                                                            num5 = class3.Rot - 2;
                                                            if (num5 < 0)
                                                            {
                                                                num5 = 6;
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (current2.Extra2 == "3")
                                                            {
                                                                Random random3 = new Random();
                                                                num5 = random3.Next(1, 5);
                                                                if (num5 == 1)
                                                                {
                                                                    num5 = 0;
                                                                }
                                                                else
                                                                {
                                                                    if (num5 == 2)
                                                                    {
                                                                        num5 = 2;
                                                                    }
                                                                    else
                                                                    {
                                                                        if (num5 == 3)
                                                                        {
                                                                            num5 = 4;
                                                                        }
                                                                        else
                                                                        {
                                                                            if (num5 == 4)
                                                                            {
                                                                                num5 = 6;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (current2.GetRoom().method_79(null, class3, class3.GetX, class3.GetY, num5, false, true, false))
                                                    {
                                                        flag2 = true;
                                                    }
                                                }
                                            }
                                        }
                                        flag2 = true;
                                    }
                                    break;
                                case "wf_act_matchfurni":
                                    current2.ExtraData = "1";
                                    current2.UpdateState(false, true);
                                    current2.ReqUpdate(1);
                                    current2.method_9();
                                    if (current2.Extra3.Length > 0 && current2.Extra1.Length > 0)
                                    {
                                        string[] collection = current2.Extra3.Split(new char[]
									{
										','
									});
                                        IEnumerable<string> enumerable = new List<string>(collection);
                                        string[] collection2 = current2.Extra1.Split(new char[]
									{
										';'
									});
                                        List<string> list8 = new List<string>(collection2);
                                        int num8 = 0;
                                        foreach (string current in enumerable)
                                        {
                                            RoomItem class3 = this.GetItem(Convert.ToUInt32(current));
                                            if (class3 != null && !(class3.GetBaseItem().InteractionType.ToLower() == "dice"))
                                            {
                                                string[] collection3 = list8[num8].Split(new char[]
											{
												','
											});
                                                List<string> list9 = new List<string>(collection3);
                                                bool flag6 = false;
                                                bool flag7 = false;
                                                if (current2.Extra2 != "" && class3 != null)
                                                {
                                                    int int_ = class3.GetX;
                                                    int int_2 = class3.GetY;
                                                    if (current2.Extra2.StartsWith("I"))
                                                    {
                                                        class3.ExtraData = list9[4];
                                                        flag7 = true;
                                                    }
                                                    if (current2.Extra2.Substring(1, 1) == "I")
                                                    {
                                                        class3.Rot = Convert.ToInt32(list9[3]);
                                                        flag6 = true;
                                                    }
                                                    if (current2.Extra2.EndsWith("I"))
                                                    {
                                                        int_ = Convert.ToInt32(list9[0]);
                                                        int_2 = Convert.ToInt32(list9[1]);
                                                        flag6 = true;
                                                    }
                                                    if (flag6)
                                                    {
                                                        this.method_40(class3, int_, int_2, current2.Id, class3.GetZ);
                                                    }
                                                    if (flag7)
                                                    {
                                                        class3.UpdateState(false, true);
                                                    }
                                                    this.GenerateMaps();
                                                }
                                                num8++;
                                            }
                                        }
                                    }
                                    flag2 = true;
                                    break;
                            }
                        }
                    }
                    result = flag2;
                }
            }
            catch
            {
                result = false;
            }
            return result;
        }
Ejemplo n.º 14
0
		public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRight)
		{
			if (this.Modes != 0 && (UserHasRight || Item.GetBaseItem().InteractionType.ToLower() == "switch"))
			{
				if (Item.GetBaseItem().InteractionType.ToLower() == "switch" && Session != null)
				{
					RoomUser @class = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
					if (@class.Coordinate.X - Item.SquareInFront.X > 1 || @class.Coordinate.Y - Item.SquareInFront.Y > 1)
					{
						if (@class.CanWalk)
						{
							@class.MoveTo(Item.Coordinate);
							return;
						}
						return;
					}
				}
				int num = 0;
				if (Item.ExtraData.Length > 0)
				{
					num = int.Parse(Item.ExtraData);
				}
				int num2;
				if (num <= 0)
				{
					num2 = 1;
				}
				else
				{
					if (num >= this.Modes)
					{
						num2 = 0;
					}
					else
					{
						num2 = num + 1;
					}
				}
				if (Item.GetBaseItem().Name.Contains("jukebox"))
				{
					ServerMessage Message = new ServerMessage(327u);
					if (num2 == 1)
					{
						Message.AppendInt32(7);
						Message.AppendInt32(6);
						Message.AppendInt32(7);
						Message.AppendInt32(0);
						Message.AppendInt32(0);
						Item.int_0 = 1;
						Item.TimerRunning = true;
						Item.UpdateNeeded = true;
					}
					else
					{
						Message.AppendInt32(-1);
						Message.AppendInt32(-1);
						Message.AppendInt32(-1);
						Message.AppendInt32(-1);
						Message.AppendInt32(0);
						Item.int_0 = 0;
						Item.TimerRunning = false;
						Item.GetRoom().int_13 = 0;
					}
					Item.GetRoom().SendMessage(Message, null);
				}
				double double_ = Item.TotalHeight;
				Item.ExtraData = num2.ToString();
				Item.UpdateState();
				if (double_ != Item.TotalHeight)
				{
					Dictionary<int, AffectedTile> dictionary = Item.GetAffectedTiles;
					if (dictionary == null)
					{
						dictionary = new Dictionary<int, AffectedTile>();
					}
					Item.GetRoom().UpdateUserStatus(Item.GetRoom().GetUserForSquare(Item.GetX, Item.GetY), true, false);
					foreach (AffectedTile current in dictionary.Values)
					{
						Item.GetRoom().UpdateUserStatus(Item.GetRoom().GetUserForSquare(current.X, current.Y), true, false);
					}
				}
				if (Session != null)
				{
					RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
					Item.GetRoom().method_10(RoomUser_, Item);
				}
			}
		}