public override bool OnUse(GameClient session, string[] args) { if (args.Length >= 2) { GameClient target = Skylight.GetGame().GetGameClientManager().GetGameClientByUsername(args[1]); if (target != null) { RoomUnit me = session.GetHabbo().GetRoomSession().GetRoomUser(); RoomUnitUser other = target.GetHabbo().GetRoomSession().GetRoomUser(); if (target.GetHabbo().GetRoomSession().IsInRoom&& target.GetHabbo().GetRoomSession().CurrentRoomID == session.GetHabbo().GetRoomSession().CurrentRoomID) { bool doit = true; if ((me.X + 1 != other.X || me.Y != other.Y) && (me.X - 1 != other.X || me.Y != other.Y) && (me.Y + 1 != other.Y || me.X != other.X)) { bool skip = false; if (me.X - 1 == other.X) { if (me.Y == other.Y) { skip = true; } } if (!skip) { doit = me.X == other.X || me.Y == other.Y; } } if (doit) { me.Speak("*RKO'S " + other.Session.GetHabbo().Username + " OUT OF NO WHERE*", true); other.Speak("Ouch", true); if (!other.HasStatus("lay") && !other.HasStatus("sit")) { if (other.BodyRotation == 0 || other.BodyRotation == 2 || other.BodyRotation == 4 || other.BodyRotation == 6) { other.AddStatus("sit", TextUtilies.DoubleWithDotDecimal((other.Z + 1) / 2 - other.Z * 0.5)); } } } return(true); } } } return(false); }
public void Handle(GameClient session, ClientMessage message) { if (session != null && session.GetHabbo() != null && session.GetHabbo().GetRoomSession() != null) { Room room = Skylight.GetGame().GetRoomManager().TryGetRoom(session.GetHabbo().GetRoomSession().CurrentRoomID); if (room != null) { RoomUnitUser user = session.GetHabbo().GetRoomSession().CurrentRoomRoomUser; if (user != null) { user.Unidle(); user.AddStatus("wave", "", 5); room.SendToAll(new MultiRevisionServerMessage(OutgoingPacketsEnum.Wave, new ValueHolder("VirtualID", user.VirtualID))); } } } }
public void Handle(GameClient session, ClientMessage message) { uint userId = message.PopWiredUInt(); Room room = session.GetHabbo().GetRoomSession().GetRoom(); if (room != null && room.HaveOwnerRights(session)) { RoomUnitUser user = room.RoomUserManager.GetUserByID(userId); if (user != null && !room.UsersWithRights.Contains(userId)) { room.UsersWithRights.Add(userId); using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient()) { dbClient.AddParamWithValue("roomId", room.ID); dbClient.AddParamWithValue("userId", userId); dbClient.ExecuteQuery("INSERT INTO room_rights(room_id, user_id) VALUES(@roomId, @userId)"); } ServerMessage message_ = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108); message_.Init(r63aOutgoing.GotRights); message_.AppendUInt(room.ID); message_.AppendUInt(user.UserID); message_.AppendString(user.Session.GetHabbo().Username); room.SendToAllWhoHaveOwnerRights(message_); user.AddStatus("flatctrl", ""); ServerMessage roomRights = BasicUtilies.GetRevisionServerMessage(Revision.RELEASE63_35255_34886_201108111108); roomRights.Init(r63aOutgoing.GiveRoomRights); user.Session.SendMessage(roomRights); } } }