예제 #1
0
        public override bool OnUse(GameClient session, string[] args)
        {
            RoomUnitUser me = session.GetHabbo().GetRoomSession().GetRoomUser();

            if (me.Riding is RoomPet pet)
            {
                pet.Rider = null;

                me.Riding = null;
                me.StopMoving();
                me.UpdateState();
                me.ApplyEffect(0);
                me.Session.GetHabbo().GetUserStats().Equestrian = 0;
            }

            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)
                {
                    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);
        }
예제 #3
0
        public override bool OnUse(GameClient session, string[] args)
        {
            if (args.Length >= 2)
            {
                RoomPet pet = session.GetHabbo().GetRoomSession().GetRoom().RoomUserManager.GetPetByName(args[1]);
                if (pet != null)
                {
                    if (pet.Rider == null)
                    {
                        if (pet.PetData.Type == 13)
                        {
                            RoomUnitUser me   = session.GetHabbo().GetRoomSession().GetRoomUser();
                            bool         doit = true;
                            if ((me.X + 1 != pet.X || me.Y != pet.Y) && (me.X - 1 != pet.X || me.Y != pet.Y) && (me.Y + 1 != pet.Y || me.X != pet.X))
                            {
                                bool skip = false;
                                if (me.X - 1 == pet.X)
                                {
                                    if (me.Y == pet.Y)
                                    {
                                        skip = true;
                                    }
                                }

                                if (!skip)
                                {
                                    doit = me.X == pet.X || me.Y == pet.Y;
                                }
                            }

                            if (doit)
                            {
                                pet.Rider = me;

                                me.Riding = pet;
                                me.StopMoving();
                                me.SetLocation(pet.X, pet.Y, pet.Z + 1);
                                me.ApplyEffect(77);

                                session.SendNotif("If you want get off use command :getoff");

                                GameClient owner = Skylight.GetGame().GetGameClientManager().GetGameClientById(pet.PetData.OwnerID);
                                if (owner != null)
                                {
                                    owner.GetHabbo().GetUserStats().StableOwner++;
                                    owner.GetHabbo().GetUserAchievements().CheckAchievement("StableOwner");
                                }
                                else
                                {
                                    using (DatabaseClient dbClient = Skylight.GetDatabaseManager().GetClient())
                                    {
                                        dbClient.AddParamWithValue("ownerId", pet.PetData.OwnerID);
                                        dbClient.ExecuteQuery("UPDATE user_stats SET stable_owner = stable_owner + 1 WHERE user-id = @ownerId LIMIT 1");
                                    }
                                }

                                me.Session.GetHabbo().GetUserStats().Equestrian = 0;
                            }
                            else
                            {
                                session.SendNotif("Ah.. you try to access the horse from long range");
                            }
                        }
                        else
                        {
                            session.SendNotif("You blind or something m8? You can clearly see that pet is not a horse!");
                        }
                    }
                    else
                    {
                        session.SendNotif("I think someone is riding that horse already...");
                    }

                    return(true);
                }
            }

            return(false);
        }