public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { RoomUser User = null; if (Session != null) User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y)) { if (Item.ExtraData != "-1") { if (Request == -1) { Item.ExtraData = "0"; Item.UpdateState(); } else { Item.ExtraData = "-1"; Item.UpdateState(false, true); Item.RequestUpdate(3, true); } } } else { User.MoveTo(Item.SquareInFront); } }
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { if (!HasRights) { return; } int OldValue = 0; if (!int.TryParse(Item.ExtraData, out OldValue)) { } if (Request == 1) { OldValue++; } else if (Request == 2) { OldValue--; } else if (Request == 3) { OldValue = 0; } Item.ExtraData = OldValue.ToString(); Item.UpdateState(false, true); }
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { if (Session == null || Item == null) return; if (!HasRights) return; IWiredItem Box = null; if (!Item.GetRoom().GetWired().TryGet(Item.Id, out Box)) return; Item.ExtraData = "1"; Item.UpdateState(false, true); Item.RequestUpdate(2, true); if (Item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect) return; if (Item.GetRoom().GetWired().IsTrigger(Item)) { List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(Box, Item.GetRoom().GetWired().GetEffects(Box)); Session.SendMessage(new WiredTriggerConfigComposer(Box, BlockedItems)); } else if (Item.GetRoom().GetWired().IsEffect(Item)) { List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedTrigger(Box, Item.GetRoom().GetWired().GetTriggers(Box)); Session.SendMessage(new WiredEffectConfigComposer(Box, BlockedItems)); } else if (Item.GetRoom().GetWired().IsCondition(Item)) Session.SendMessage(new WiredConditionConfigComposer(Box)); }
public void OnPlace(GameClient Session, Item Item) { if (Item.team == TEAM.NONE) return; Item.ExtraData = Item.GetRoom().GetGameManager().Points[Convert.ToInt32( Item.team)].ToString(); Item.UpdateState(false, true); }
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { if (HasRights) { Item.GetRoom().GetGameManager().Points[Convert.ToInt32(Item.team)] = 0; Item.ExtraData = "0"; Item.UpdateState(); } }
public void OnWiredTrigger(Item Item) { if (Item == null) return; if (Item.ExtraData == "1") return; Item.ExtraData = "1"; Item.UpdateState(false, true); Item.RequestUpdate(2, true); }
public void OnWiredTrigger(Item Item) { int OldValue = 0; if (!int.TryParse(Item.ExtraData, out OldValue)) { } OldValue++; Item.ExtraData = OldValue.ToString(); Item.UpdateState(false, true); }
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { if (Session == null) return; RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (User == null) return; if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y)) { int Modes = Item.GetBaseItem().Modes - 1; if (Modes <= 0) return; PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH); int CurrentMode = 0; int NewMode = 0; if (!int.TryParse(Item.ExtraData, out CurrentMode)) { } if (CurrentMode <= 0) NewMode = 1; else if (CurrentMode >= Modes) NewMode = 0; else NewMode = CurrentMode + 1; Item.ExtraData = NewMode.ToString(); Item.UpdateState(); } else User.MoveTo(Item.SquareInFront); }
public void OnTrigger(GameClients.GameClient Session, Item Item, int Request, bool HasRights) { if (Session == null || Session.GetHabbo() == null || Item == null) return; Room Room = Session.GetHabbo().CurrentRoom; if(Room == null) return; RoomUser Actor = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id); if (Actor == null) return; if (Item.ExtraData == "1") return; if(Gamemap.TileDistance(Actor.X, Actor.Y, Item.GetX, Item.GetY) > 2) return; Item.ExtraData = "1"; Item.UpdateState(false, true); Item.RequestUpdate(2, true); }
public void OnWiredTrigger(Item Item) { if (Item.GetRoom().GetSoccer().GameIsStarted) Item.GetRoom().GetSoccer().StopGame(true); Item.pendingReset = true; Item.UpdateNeeded = true; Item.ExtraData = "30"; Item.UpdateState(); Item.GetRoom().GetSoccer().StartGame(); }
public void OnPlace(GameClient Session, Item Item) { Item.ExtraData = "30"; Item.UpdateState(); }
public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights) { if (!HasRights) { return; } int oldValue = 0; if (!int.TryParse(Item.ExtraData, out oldValue)) { Item.ExtraData = "30"; oldValue = 30; } if (Request == 0 && oldValue == 0) { oldValue = 30; } else if (Request == 2) { if (Item.GetRoom().GetSoccer().GameIsStarted && Item.pendingReset && oldValue > 0) { oldValue = 0; Item.pendingReset = false; } else { if (oldValue < 30) oldValue = 30; else if (oldValue == 30) oldValue = 60; else if (oldValue == 60) oldValue = 120; else if (oldValue == 120) oldValue = 180; else if (oldValue == 180) oldValue = 300; else if (oldValue == 300) oldValue = 600; else oldValue = 0; Item.UpdateNeeded = false; } } else if (Request == 1 || Request == 0) { if (Request == 1 && oldValue == 0) { Item.ExtraData = "30"; oldValue = 30; } if (!Item.GetRoom().GetSoccer().GameIsStarted) { Item.UpdateNeeded = !Item.UpdateNeeded; if (Item.UpdateNeeded) { Item.GetRoom().GetSoccer().StartGame(); } Item.pendingReset = true; } else { Item.UpdateNeeded = !Item.UpdateNeeded; if (Item.UpdateNeeded) { Item.GetRoom().GetSoccer().StopGame(true); } Item.pendingReset = true; } } Item.ExtraData = Convert.ToString(oldValue); Item.UpdateState(); }
private void SetState(Item Item, string Extradata) { if (Item.ExtraData == Extradata) return; if (Item.GetBaseItem().InteractionType == InteractionType.DICE) return; Item.ExtraData = Extradata; Item.UpdateState(false, true); }
private void SetRotation(Item Item, int Rotation) { if (Item.Rotation == Rotation) return; Item.Rotation = Rotation; Item.UpdateState(false, true); }
public void OnWiredTrigger(Item Item) { if (Item.GetRoom().GetBanzai().isBanzaiActive) Item.GetRoom().GetBanzai().BanzaiEnd(true); Item.pendingReset = true; Item.UpdateNeeded = true; Item.ExtraData = "30"; Item.UpdateState(); if (!Item.GetRoom().GetBanzai().isBanzaiActive) Item.GetRoom().GetBanzai().BanzaiStart(); }
public void OnWiredTrigger(Item Item) { Item.ExtraData = "-1"; Item.UpdateState(false, true); Item.RequestUpdate(4, true); }