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) { 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 OnPlace(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) { 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 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; }
public override void OnRemove(GameClient Session, RoomItem Item) { Item.ExtraData = "0"; Item.UpdateState(true, true); }
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights) { RoomUser User = Item.method_8().GetRoomUserByHabbo((uint)Session.GetHabbo().Id); if (User == null) { return; } if (Request == 0 && Item.FireWorkCount > 0 && Item.ExtraData == "1") { Item.ExtraData = "2"; Item.UpdateState(false, true); if (Item.FireWorkCount > 0) { Task T = null; T = new Task(delegate() { Action(Item, T, "1"); }); T.Start(); } else { Task T = null; T = new Task(delegate() { Action(Item, T, "0"); }); T.Start(); } } else if (Request == 1) { ServerMessage PixelMessage = new ServerMessage(629); PixelMessage.AppendUInt(Item.uint_0); PixelMessage.AppendInt32(Item.FireWorkCount); PixelMessage.AppendBoolean(false); PixelMessage.AppendInt32(Pixels); // pixels :D PixelMessage.AppendBoolean(false); PixelMessage.AppendInt32(Fireworks); // 10 fireworks :D Session.SendMessage(PixelMessage); } else if (Request == 2 && Session.GetHabbo().ActivityPoints >= 20) { Item.FireWorkCount += Fireworks; Session.GetHabbo().FireworkPixelLoadedCount += Pixels; Session.GetHabbo().ActivityPoints -= 20; Session.GetHabbo().method_15(true); using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient()) { dbClient.AddParamWithValue("itemid", Item.uint_0); dbClient.AddParamWithValue("sessionid", Session.GetHabbo().Id); dbClient.ExecuteQuery("UPDATE items SET fw_count = fw_count + '" + Fireworks + "' WHERE id = @itemid LIMIT 1"); dbClient.ExecuteQuery("UPDATE user_stats SET fireworks = fireworks + '" + Pixels + "' WHERE id = @sessionid LIMIT 1"); } ServerMessage PixelMessage = new ServerMessage(629); PixelMessage.AppendUInt(Item.uint_0); PixelMessage.AppendInt32(Item.FireWorkCount); PixelMessage.AppendBoolean(false); PixelMessage.AppendInt32(Pixels); // pixels :D PixelMessage.AppendBoolean(false); PixelMessage.AppendInt32(Fireworks); // 10 fireworks :D Session.SendMessage(PixelMessage); if (Item.ExtraData == "0") { Item.ExtraData = "1"; Item.UpdateState(true, true); } Session.GetHabbo().CheckFireworkAchievements(); } }
public void method_91(RoomItem RoomItem_0, RoomUser RoomUser_1) { RoomItem_0.ExtraData = "1"; RoomItem_0.UpdateState(false, true); RoomItem_0.ReqUpdate(1); List<RoomItem> list = new List<RoomItem>(); RoomUser_1.method_3(true); foreach (RoomItem @class in this.Hashtable_0.Values) { if (@class != RoomItem_0 && !(@class.GetBaseItem().InteractionType.ToLower() != "bb_teleport")) { list.Add(@class); } } if (list.Count > 0) { Random random = new Random((int)GoldTree.GetUnixTimestamp() * (int)RoomUser_1.uint_0); int index = random.Next(0, list.Count); list[index].ExtraData = "1"; list[index].UpdateState(false, true); list[index].ReqUpdate(1); this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1; this.byte_0[list[index].Int32_0, list[index].Int32_1] = 1; RoomUser_1.method_7(list[index].Int32_0, list[index].Int32_1, list[index].Double_0); RoomUser_1.UpdateNeeded = true; } }
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.string_2.ToLower())) { flag = true; } break; case "wf_trg_enterroom": if (RoomItem_0.string_2 == "" || RoomItem_0.string_2 == RoomUser_1.GetClient().GetHabbo().Username) { flag = true; } break; case "wf_trg_furnistate": if (RoomItem_0.string_3.Length > 0) { string[] collection = RoomItem_0.string_3.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.string_3.Length > 0) { string[] collection = RoomItem_0.string_3.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.method_28(Convert.ToUInt32(string_10)); if (@class != null) { flag = true; } else { list2.Remove(current); } } } RoomItem_0.string_3 = string.Join(",", list2.ToArray()); } break; case "wf_trg_offfurni": if (RoomItem_0.string_3.Length > 0) { string[] collection = RoomItem_0.string_3.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.method_28(Convert.ToUInt32(string_10)); if (@class != null) { flag = true; } else { list2.Remove(current); } } } RoomItem_0.string_3 = 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.Int32_0, RoomItem_0.Int32_1); 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")) { if (text == "wf_cnd_time_more_than") { num++; current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); if (current2.WiredCounter >= double.Parse(current2.string_2, CultureInfo.InvariantCulture)) { num2++; break; } } else if (text == "wf_cnd_time_less_than") { num++; current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); if (current2.WiredCounter <= double.Parse(current2.string_2, CultureInfo.InvariantCulture)) { num2++; break; } } else continue; } num4 = num2; num++; current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); current2.method_10(); if (current2.string_3.Length <= 0) { continue; } collection = current2.string_3.Split(new char[] { ',' }); list = new List<string>(collection); list4 = new List<RoomItem>(); foreach (string current3 in list) { list4.Add(this.method_28(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.Dictionary_0; if (dictionary == null) { dictionary = new Dictionary<int, AffectedTile>(); } RoomItem TopItem = this.GetTopItem(current4.Int32_0, current4.Int32_1); if (TopItem != null && TopItem != current4 && TopItem.Double_0 >= current4.Double_0 && num4 + 1 != num2) { num2++; break; } foreach (AffectedTile current5 in dictionary.Values) { TopItem = this.GetTopItem(current5.Int32_0, current5.Int32_1); if (TopItem != null && TopItem != current4 && TopItem.Double_0 >= current4.Double_0 && num4 + 1 != num2) { num2++; break; } } } } continue; } } num++; current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); current2.method_10(); if (current2.string_3.Length <= 0) { continue; } collection = current2.string_3.Split(new char[] { ',' }); list = new List<string>(collection); list4 = new List<RoomItem>(); foreach (string current3 in list) { list4.Add(this.method_28(Convert.ToUInt32(current3))); } bool flag3 = true; foreach (RoomItem current4 in list4) { if (current4 != null) { bool flag4 = false; Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0; if (dictionary == null) { dictionary = new Dictionary<int, AffectedTile>(); } if (this.method_96(current4.Int32_0, current4.Int32_1)) { flag4 = true; } foreach (AffectedTile current5 in dictionary.Values) { if (this.method_96(current5.Int32_0, current5.Int32_1)) { 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.string_3.Length <= 0) { continue; } string[] collection = current2.string_3.Split(new char[] { ',' }); List<string> list = new List<string>(collection); List<RoomItem> list4 = new List<RoomItem>(); foreach (string current3 in list) { list4.Add(this.method_28(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.Dictionary_0; if (dictionary == null) { dictionary = new Dictionary<int, AffectedTile>(); } if (RoomUser_1.int_3 == current4.Int32_0 && RoomUser_1.int_4 == current4.Int32_1 && num4 + 1 != num2) { num2++; break; } foreach (AffectedTile current5 in dictionary.Values) { if (RoomUser_1.int_3 == current5.Int32_0 && RoomUser_1.int_4 == current5.Int32_1 && num4 + 1 != num2) { num2++; break; } } } } continue; } } } num4 = num2; num++; current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); if (current2.string_2.Length > 0) { string string_11 = current2.string_2.Split(new char[] { ':' })[0].ToLower(); string string_12 = current2.string_2.Split(new char[] { ':' })[1]; if (RoomUser_1 != null) { if (!RoomUser_1.IsBot && this.method_18(RoomUser_1, string_11, string_12)) { num2++; } } else { RoomUser[] array = this.RoomUser_0; for (int i = 0; i < array.Length; i++) { RoomUser class2 = array[i]; if (class2 != null && !class2.IsBot && this.method_18(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.Int32_0, RoomItem_0.Int32_1); 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.string_2.Length > 0) { string string_11 = current2.string_2.Split(new char[] { ':' })[0].ToLower(); string string_12 = current2.string_2.Split(new char[] { ':' })[1]; if (RoomUser_1 != null) { if (!RoomUser_1.IsBot) { this.method_19(RoomUser_1, string_11, string_12, current2.uint_0); } } else { RoomUser[] array = this.RoomUser_0; for (int i = 0; i < array.Length; i++) { RoomUser class2 = array[i]; if (class2 != null && !class2.IsBot) { this.method_19(class2, string_11, string_12, current2.uint_0); } } } flag2 = true; } break; case "wf_act_saymsg": current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); if (current2.string_2.Length > 0) { string text2 = current2.string_2; text2 = ChatCommandHandler.smethod_4(text2); if (text2.Length > 100) { text2 = text2.Substring(0, 100); } if (RoomUser_1 != null) { if (!RoomUser_1.IsBot) { RoomUser_1.GetClient().GetHabbo().method_28(text2); } } else { RoomUser[] array = this.RoomUser_0; for (int i = 0; i < array.Length; i++) { RoomUser class2 = array[i]; if (class2 != null && !class2.IsBot) { class2.GetClient().GetHabbo().method_28(text2); } } } flag2 = true; } break; case "wf_act_moveuser": current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); current2.method_10(); if (current2.string_3.Length > 0) { string[] collection = current2.string_3.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.method_28(Convert.ToUInt32(list[num5])); if (class3 != null) { if (RoomUser_1 != null) { this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1; this.byte_0[RoomUser_1.int_12, RoomUser_1.int_13] = 1; this.byte_0[class3.Int32_0, class3.Int32_1] = 1; RoomUser_1.bool_6 = false; RoomUser_1.int_12 = class3.Int32_0; RoomUser_1.int_13 = class3.Int32_1; RoomUser_1.double_1 = class3.Double_0; RoomUser_1.method_7(class3.Int32_0, class3.Int32_1, class3.Double_0); RoomUser_1.UpdateNeeded = true; if (!current2.dictionary_1.ContainsKey(RoomUser_1)) { current2.dictionary_1.Add(RoomUser_1, 10); } if (RoomUser_1.class34_1 != null) { RoomUser_1.class34_1.RoomUser_0 = null; RoomUser_1.RoomUser_0 = null; RoomUser_1.class34_1 = null; } this.method_87(RoomUser_1, true, false); } else { RoomUser[] array = this.RoomUser_0; for (int i = 0; i < array.Length; i++) { RoomUser class2 = array[i]; if (class2 != null) { this.byte_0[class2.int_3, class2.int_4] = 1; this.byte_0[class3.Int32_0, class3.Int32_1] = 1; class2.method_7(class3.Int32_0, class3.Int32_1, class3.Double_0); 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.string_3.Length > 0) { string[] collection = current2.string_3.Split(new char[] { ',' }); IEnumerable<string> enumerable = new List<string>(collection); List<string> list2 = enumerable.ToList<string>(); foreach (string current in enumerable) { RoomItem class3 = this.method_28(Convert.ToUInt32(current)); if (class3 != null) { class3.Class69_0.OnTrigger(null, class3, 0, true); } else { list2.Remove(current); } } flag2 = true; } break; case "wf_act_kick_user": current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); GameClient GetPlayerSession = GoldTree.GetGame().GetClientManager().GetClientByHabbo(RoomUser_1.GetClient().GetHabbo().Username); if (GetPlayerSession != null) { Room class2 = RoomUser_1.GetClient().GetHabbo().CurrentRoom; if (!(class2.Owner == GetPlayerSession.GetHabbo().Username && GetPlayerSession.GetHabbo().HasFuse("acc_unkickable"))) { class2.method_47(GetPlayerSession, true, false); if (current2.string_2.Length > 0) { GetPlayerSession.SendNotif(current2.string_2); } else { GetPlayerSession.SendNotif("Wired: Potki käyttäjä wired-tavara on potkinut sinut huoneesta!"); } } flag2 = true; } break; case "wf_act_reset_timers": current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); foreach (RoomItem current in this.list_14) { if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_attime") { current.WiredAtTimeNeedReset = false; current.WiredAtTimeTimer = 0; current.ReqUpdate(1); } flag2 = true; } foreach (RoomItem current in this.list_16) { if (current.GetBaseItem().InteractionType.ToLower() == "wf_cnd_time_more_than") { current.WiredCounter = 0; current.WiredNeedReset = false; current.ReqUpdate(1); } else if (current.GetBaseItem().InteractionType.ToLower() == "wf_cnd_time_less_than") { current.WiredCounter = 0; current.WiredNeedReset = false; current.ReqUpdate(1); } flag2 = true; } break; case "wf_act_givepoints": current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); if (RoomUser_1 != null && current2.string_2.Length > 0) { int team = 0; if (RoomUser_1.team == Team.Yellow) { team = 12; } else if (RoomUser_1.team == Team.Red) { team = 3; } else if (RoomUser_1.team == Team.Green) { team = 6; } else if (RoomUser_1.team == Team.Blue) { team = 9; } this.method_88(team, Convert.ToInt32(current2.string_2), current2); flag2 = true; } break; case "wf_act_moverotate": current2.ExtraData = "1"; current2.UpdateState(false, true); current2.ReqUpdate(1); current2.method_9(); if (current2.string_4.Length > 0) { string[] collection = current2.string_4.Split(new char[] { ',' }); IEnumerable<string> enumerable2 = new List<string>(collection); foreach (string current in enumerable2) { RoomItem class3 = this.method_28(Convert.ToUInt32(current)); if (class3 != null) { if (current2.string_2 != "0" && current2.string_2 != "") { ThreeDCoord gstruct1_ = class3.GStruct1_1; int num5 = 0; int num6 = 0; int num7 = 0; if (current2.string_2 == "1") { Random random3 = new Random(); num5 = random3.Next(1, 5); } else { if (current2.string_2 == "2") { Random random3 = new Random(); num6 = random3.Next(1, 3); } else { if (current2.string_2 == "3") { Random random3 = new Random(); num7 = random3.Next(1, 3); } } } if (current2.string_2 == "4" || num5 == 1 || num7 == 1) { gstruct1_ = class3.method_1(4); } else { if (current2.string_2 == "5" || num5 == 2 || num6 == 1) { gstruct1_ = class3.method_1(6); } else { if (current2.string_2 == "6" || num5 == 3 || num7 == 2) { gstruct1_ = class3.method_1(0); } else { if (current2.string_2 == "7" || num5 == 4 || num6 == 2) { gstruct1_ = class3.method_1(2); } } } } if (this.method_37(gstruct1_.x, gstruct1_.y, true, true, true, false, false, true, true) && class3.GetBaseItem().InteractionType != "wf_trg_timer") { this.method_41(class3, gstruct1_, current2.uint_0, this.GetTopItemHeight(gstruct1_.x, gstruct1_.y)); } } if (current2.string_3.Length > 0 && current2.string_3 != "0" && current2.string_3 != "") { int num5 = 0; if (current2.string_3 == "1") { num5 = class3.int_3 + 2; if (num5 > 6) { num5 = 0; } } else { if (current2.string_3 == "2") { num5 = class3.int_3 - 2; if (num5 < 0) { num5 = 6; } } else { if (current2.string_3 == "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.method_8().method_79(null, class3, class3.Int32_0, class3.Int32_1, num5, false, false, 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.string_4.Length > 0 && current2.string_2.Length > 0) { string[] collection = current2.string_4.Split(new char[] { ',' }); IEnumerable<string> enumerable = new List<string>(collection); string[] collection2 = current2.string_2.Split(new char[] { ';' }); List<string> list8 = new List<string>(collection2); int num8 = 0; foreach (string current in enumerable) { RoomItem class3 = this.method_28(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.string_3 != "" && class3 != null) { int int_ = class3.Int32_0; int int_2 = class3.Int32_1; if (current2.string_3.StartsWith("I")) { class3.ExtraData = list9[4]; flag7 = true; } if (current2.string_3.Substring(1, 1) == "I") { class3.int_3 = Convert.ToInt32(list9[3]); flag6 = true; } if (current2.string_3.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.uint_0, class3.Double_0); } if (flag7) { class3.UpdateState(false, true); } this.method_22(); } num8++; } } } flag2 = true; break; } } } result = flag2; } } catch { result = false; } return result; }
public override void OnPlace(GameClient Session, RoomItem RoomItem_0) { RoomItem_0.ExtraData = "0"; RoomItem_0.UpdateState(true, false); }
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 void SetRandomPowerUp(RoomItem item) { if (string.IsNullOrEmpty(item.ExtraData)) { switch (this.rnd.Next(1, 11)) { case 2: item.ExtraData = "2000"; item.freezePowerUp = FreezePowerUp.BlueArrow; break; case 3: item.ExtraData = "3000"; item.freezePowerUp = FreezePowerUp.Snowballs; break; case 4: item.ExtraData = "4000"; item.freezePowerUp = FreezePowerUp.GreenArrow; break; case 5: item.ExtraData = "5000"; item.freezePowerUp = FreezePowerUp.OrangeSnowball; break; case 6: item.ExtraData = "6000"; item.freezePowerUp = FreezePowerUp.Heart; break; case 7: item.ExtraData = "7000"; item.freezePowerUp = FreezePowerUp.Shield; break; default: item.ExtraData = "1000"; item.freezePowerUp = FreezePowerUp.None; break; } item.method_8().method_38(item.Int32_0, item.Int32_1); item.UpdateState(false, true); } }
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights) { if (UserHasRights) { int num = 0; if (Item.ExtraData.Length > 0) { num = int.Parse(Item.ExtraData); } if (Request == 0) { if (num <= -1) { num = 0; } else { if (num >= 0) { num = -1; } } } else { if (Request >= 1) { if (Request == 1) { if (!Item.method_8().frzTimer) { Item.method_8().frzTimer = true; Item.ReqUpdate(1); if (Session != null) { RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id); Item.method_8().method_14(RoomUser_); Item.method_8().GetFreeze().StartGame(); } } else { Item.method_8().frzTimer = false; Item.method_8().GetFreeze().StopGame(); } } else { if (Request == 2) { num += 60; if (num >= 600) { num = 0; } } } } } Item.ExtraData = num.ToString(); Item.UpdateState(true, true); } }
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) { if (!RoomItem_0.bool_0) { RoomItem_0.bool_0 = true; RoomItem_0.ReqUpdate(1); if (Session != null) { RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id); RoomItem_0.method_8().method_14(RoomUser_); foreach (RoomItem Item in RoomItem_0.method_8().Hashtable_0.Values) { if (Item.GetBaseItem().Name == "bb_apparatus") { Item.ExtraData = "1"; Item.UpdateState(false, true); Item.ReqUpdate(1); } } } } else { RoomItem_0.bool_0 = false; foreach (RoomItem Item in RoomItem_0.method_8().Hashtable_0.Values) { if (Item.GetBaseItem().Name == "bb_apparatus") { Item.ExtraData = "0"; Item.UpdateState(false, true); Item.ReqUpdate(1); } } } } else { if (int_0 == 2) { num += 60; if (num >= 600) { num = 0; } } } } } RoomItem_0.ExtraData = num.ToString(); RoomItem_0.UpdateState(true, true); } }