示例#1
0
        public override bool OnUse(GameClient session, string[] args)
        {
            if (session.GetHabbo().GetRoomSession().GetRoom().RoomData.ExtraData.RoleplayEnabled)
            {
                if (args.Length >= 2)
                {
                    GameClient target = Skylight.GetGame().GetGameClientManager().GetGameClientByUsername(args[1]);
                    if (target != null)
                    {
                        RoomUnitUser 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)
                            {
                                int damage = RandomUtilies.GetRandom(5, 12);
                                other.Health -= damage;
                                if (other.Health - damage < 0)
                                {
                                    me.Speak("*Hits " + target.GetHabbo().Username + ", and kills them!*", false);
                                    other.Speak("*dies*", false);
                                    session.GetHabbo().GetRoomSession().GetRoom().RoomUserManager.KickUser(target, true);
                                }
                                else
                                {
                                    me.Speak("*Hits " + target.GetHabbo().Username + ", causing " + damage + " damage *", false);
                                    other.Speak("*Suffers " + damage + " damage from " + me.Session.GetHabbo().Username + ", leaving me with " + other.Health + " health*", false);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                session.SendNotif("RP is disabled on this room!");
            }

            return(true);
        }
示例#2
0
        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);
        }
示例#3
0
        public override bool OnUse(GameClient session, string[] args)
        {
            if (args.Length >= 2)
            {
                GameClient target = Skylight.GetGame().GetGameClientManager().GetGameClientByUsername(args[1]);
                if (target != null)
                {
                    RoomUnitUser 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("*Kisses " + target.GetHabbo().Username + " on the cheek!*", false);
                            other.Speak("*Blushes*", false);
                            me.ApplyEffect(9, 6);
                            other.ApplyEffect(9, 6);
                        }

                        return(true);
                    }
                }
            }

            return(false);
        }