当前位置: 首页>>代码示例>>C#>>正文


C# RoomUser.CarryItem方法代码示例

本文整理汇总了C#中RoomUser.CarryItem方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.CarryItem方法的具体用法?C# RoomUser.CarryItem怎么用?C# RoomUser.CarryItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoomUser的用法示例。


在下文中一共展示了RoomUser.CarryItem方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnUserSay

		public override void OnUserSay(RoomUser RoomUser_0, string string_0)
		{
            if (base.GetRoom().method_100(base.GetRoomUser().X, base.GetRoomUser().Y, RoomUser_0.X, RoomUser_0.Y) <= 8)
			{
                BotResponse @class = base.GetRoomBot().GetResponse(string_0);
				if (@class != null)
				{
                    string text = base.GetRoom().method_20(RoomUser_0, @class.Response);
					string text2 = @class.ResponseType.ToLower();
					if (text2 != null)
					{
						if (!(text2 == "say"))
						{
							if (!(text2 == "shout"))
							{
								if (text2 == "whisper")
								{
                                    ServerMessage Message = new ServerMessage(Outgoing.Whisp); // Updated
									Message.AppendInt32(base.GetRoomUser().VirtualId);
									Message.AppendStringWithBreak(text);
                                    Message.AppendInt32(0);
                                    Message.AppendInt32(0);
                                    Message.AppendInt32(-1);
									RoomUser_0.GetClient().SendMessage(Message);
								}
							}
							else
							{
								base.GetRoomUser().HandleSpeech(null, text, true);
							}
						}
						else
						{
							base.GetRoomUser().HandleSpeech(null, text, false);
						}
					}
					if (@class.ServeId >= 1)
					{
						RoomUser_0.CarryItem(@class.ServeId);
					}
				}
			}
		}
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:43,代码来源:GenericBot.cs

示例2: UserCycleOnRoom

        /// <summary>
        ///     Turns the user thread
        /// </summary>
        /// <param name="roomUsers"></param>
        internal void UserCycleOnRoom(RoomUser roomUsers)
        {
            // Region Check User Elegibility
            if (!IsValid(roomUsers))
            {
                if (roomUsers.GetClient() != null)
                    RemoveUserFromRoom(roomUsers.GetClient(), false, false);
                else
                    RemoveRoomUser(roomUsers);
            }

            // Region Check User Remove Unlocking
            lock (_removeUsers)
            {
                if (roomUsers.NeedsAutokick && !_removeUsers.Contains(roomUsers))
                {
                    _removeUsers.Add(roomUsers);
                    return;
                }
            }

            // Region Idle and Room Tiem Check
            roomUsers.IdleTime++;

            // Region User Achievement of Room
            UserRoomTimeCycles(roomUsers);

            // Carry Item Hand Checking
            if (roomUsers.CarryItemId > 0)
            {
                roomUsers.CarryTimer--;

                // If The Carry Timer is 0.. Remove CarryItem.
                if (roomUsers.CarryTimer <= 0)
                    roomUsers.CarryItem(0);
            }

            // Region Check User Got Freezed
            if (_userRoom.GotFreeze())
                Freeze.CycleUser(roomUsers);

            // Region Variable Registering
            bool invalidStep = false;
            // Region Check User Tile Selection
            if (roomUsers.SetStep)
            {
                // Check if User is Going to the Door.
                lock (_removeUsers)
                {
                    if ((roomUsers.SetX == _userRoom.GetGameMap().Model.DoorX) && (roomUsers.SetY == _userRoom.GetGameMap().Model.DoorY) && !_removeUsers.Contains(roomUsers) && !roomUsers.IsBot && !roomUsers.IsPet)
                    {
                        _removeUsers.Add(roomUsers);
                        return;
                    }
                }

                // Check Elegibility of Walk In Tile
                invalidStep = UserCanWalkInTile(roomUsers);

                // User isn't Anymore Set a Tile to Walk
                roomUsers.SetStep = false;
            }

            // Pet Must Stop Too!
            if ((roomUsers.GoalX == roomUsers.X) && (roomUsers.GoalY == roomUsers.Y) && roomUsers.RidingHorse && !roomUsers.IsPet)
            {
                RoomUser horseStopWalkRidingPet = GetRoomUserByVirtualId(Convert.ToInt32(roomUsers.HorseId));

                if (horseStopWalkRidingPet != null)
                {
                    ServerMessage horseStopWalkRidingPetMessage =
                        new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserStatusMessageComposer"));
                    horseStopWalkRidingPetMessage.AppendInteger(1);
                    horseStopWalkRidingPet.SerializeStatus(horseStopWalkRidingPetMessage, "");
                    _userRoom.SendMessage(horseStopWalkRidingPetMessage);

                    horseStopWalkRidingPet.IsWalking = false;
                    horseStopWalkRidingPet.ClearMovement();
                }
            }

            // User Reached Goal Need Stop.
            if (((roomUsers.GoalX == roomUsers.X) && (roomUsers.GoalY == roomUsers.Y)) || roomUsers.Freezed)
            {
                roomUsers.IsWalking = false;
                roomUsers.ClearMovement();
                roomUsers.SetStep = false;
                UpdateUserStatus(roomUsers, false);
            }

            // Check if Proably the Pathfinder is with Some Errors..
            if (roomUsers.PathRecalcNeeded)
            {
                roomUsers.Path.Clear();
                roomUsers.Path = PathFinder.FindPath(roomUsers, _userRoom.GetGameMap().DiagonalEnabled,
                    _userRoom.GetGameMap(), new Vector2D(roomUsers.X, roomUsers.Y),
//.........这里部分代码省略.........
开发者ID:bblackv,项目名称:Yupi,代码行数:101,代码来源:RoomUserManager.cs

示例3: OnUserSay

        public override void OnUserSay(RoomUser RoomUser_0, string string_0)
        {
            try
            {
                foreach (BotResponse br in botResponse)
                {
                    if (br.ContainsWord(string_0))
                    {
                        if (RoomUser_0 != null && RoomUser_0.GetClient() != null && br.ContainsWord(string_0) && this.uBot.BotType != "spybot" && this.uBot.BotType != "drinkbot")
                        {
                            if (RoomUser_0 != null && RoomUser_0.GetClient() != null && RoomUser_0.GetClient().GetHabbo() != null)
                                base.GetRoomUser().HandleSpeech(null, br.Response.Replace("%username%", RoomUser_0.GetClient().GetHabbo().Username), br.Shout);
                        }
                        else if (RoomUser_0 != null && RoomUser_0.GetClient() != null && br.ContainsWord(string_0) && this.uBot.BotType == "spybot" && RoomUser_0.GetClient().GetHabbo().Username == this.GetRoomUser().GetRoom().Owner)
                        {
                            using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                            {
                                string text = "";
                                string username;
                                foreach (DataRow dr in dbClient.ReadDataTable("SELECT user_id FROM user_roomvisits WHERE room_id=" + base.GetRoomUser().GetRoom().Id + " ORDER BY exit_timestamp DESC LIMIT 10").Rows)
                                {
                                    username = dbClient.ReadString("SELECT username FROM users WHERE id=" + dr["user_id"].ToString());
                                    if (text == "")
                                        text = username;
                                    else
                                        text = text + ", " + username;
                                }
                                base.GetRoomUser().HandleSpeech(null, "Die letzen 10 Habbos in deinem Raum waren:", false);
                                base.GetRoomUser().HandleSpeech(null, text, false);

                            }
                        }
                        else if (RoomUser_0 != null && RoomUser_0.GetClient() != null && br.ContainsWord(string_0) && this.uBot.BotType == "drinkbot")
                        {
                            if (br.ServeId > 0)
                            {
                                base.GetRoomUser().CarryItem(br.ServeId);
                                base.GetRoomUser().HandleSpeech(null, br.Response.Replace("%username%", RoomUser_0.GetClient().GetHabbo().Username), br.Shout);
                                base.GetRoomUser().CarryItem(0);
                                RoomUser_0.CarryItem(br.ServeId);
                            }
                        }
                    }
                }
            }
            catch { }
        }
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:47,代码来源:UserBotInt.cs

示例4: method_21


//.........这里部分代码省略.........
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    if (this.RoomData.GuildId != 0 && !RoomUser_1.GetClient().GetHabbo().InGuild(this.RoomData.GuildId) && (current2.string_2 == "" || current2.string_2.ToLower().Equals(RoomUser_1.GetClient().GetHabbo().Username.ToLower())))
                                                        num2++;
                                                    continue;
                                                }
                                                else if (text == "wf_cnd_user_count_in")
                                                {
                                                    num++;
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    if (this.UserCount >= int.Parse(current2.string_2.Split(';')[0]) && this.UserCount <= int.Parse(current2.string_2.Split(';')[1]))
                                                        num2++;
                                                    continue;
                                                }
                                                else if (text == "wf_cnd_not_user_count")
                                                {
                                                    num++;
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    if (!(this.UserCount >= int.Parse(current2.string_2.Split(';')[0])) || !(this.UserCount <= int.Parse(current2.string_2.Split(';')[1])))
                                                        num2++;
                                                    continue;
                                                }
                                                else if (text == "wf_cnd_has_handitem")
                                                {
                                                    num++;
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    if ((current2.string_2 != "" || current2.string_2 != "0") && RoomUser_1.CarryItemID == int.Parse(current2.string_2))
                                                        num2++;
                                                    continue;
                                                }
                                                else if (text == "wf_cnd_actor_in_team")
                                                {
                                                    num++;
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    if ((GetTeam(current2.string_2) != Team.None) && GetTeam(current2.string_2) == RoomUser_1.team)
                                                        num2++;
                                                    continue;
                                                }
                                                else if (text == "wf_cnd_not_in_team")
                                                {
                                                    num++;
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    if ((GetTeam(current2.string_2) != Team.None) && RoomUser_1.team != Team.None && GetTeam(current2.string_2) != RoomUser_1.team)
                                                        num2++;
                                                    continue;
                                                }
                                                else if (text == "wf_cnd_not_furni_on")
                                                {
                                                    RoomItem ri;
                                                    current2.ExtraData = "1";
                                                    current2.UpdateState(false, true);
                                                    current2.ReqUpdate(1);
                                                    foreach (string s in current2.string_3.Split(','))
                                                    {
                                                        num++;
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:67,代码来源:Room.cs

示例5: OnUserSay

        internal override void OnUserSay(RoomUser User, string Message)
        {
           // if (Gamemap.TileDistance(base.GetRoomUser().X, base.GetRoomUser().Y, User.X, User.Y) > 16)
        //    {
         //       return;
        //    }
            if (this.IsBartender)
            {
                Random random = new Random();
                try
                {
                    Message = Message.Substring(1);
                }
                catch
                {
                    Message = "";
                }
                string key;
                switch (key = Message.ToLower())
                {
                    case "ven":
                    case "comehere":
                    case "come here":
                    case "ven aquí":
                    case "come":
                        base.GetRoomUser().Chat(null, "¡Voy!", false, 0, 0);
                        base.GetRoomUser().MoveTo(User.SquareInFront);
                        return;
                    case "sirve":
                    case "serve":
                        if (base.GetRoom().CheckRights(User.GetClient()))
                        {
                            foreach (RoomUser current in base.GetRoom().GetRoomUserManager().GetRoomUsers())
                            {
                                current.CarryItem(random.Next(1, 38));
                            }
                            base.GetRoomUser().Chat(null, "Vale. Ya teneis todos algo para zampar.", false, 0, 0);
                            return;
                        }
                        return;
                    case "agua":
                    case "té":
                    case "te":
                    case "tea":
                    case "juice":
                    case "water":
                    case "zumo":
                        base.GetRoomUser().Chat(null, "Aquí tienes.", false, 0, 0);
                        User.CarryItem(random.Next(1, 3));
                        return;
                    case "helado":
                    case "icecream":
                    case "ice cream":
                        base.GetRoomUser().Chat(null, "Aquí tienes. ¡Que no se te quede pegada la lengua, je je!", false, 0, 0);
                        User.CarryItem(4);
                        return;
                    case "rose":
                    case "rosa":
                        base.GetRoomUser().Chat(null, "Aquí tienes... que te vaya bien en tu cita.", false, 0, 0);
                        User.CarryItem(random.Next(1000, 1002));
                        return;
                    case "girasol":
                    case "sunflower":
                        base.GetRoomUser().Chat(null, "Aquí tienes algo muy bonito de la naturaleza.", false, 0, 0);
                        User.CarryItem(1002);
                        return;
                    case "flor":
                    case "flower":
                        base.GetRoomUser().Chat(null, "Aquí tienes algo muy bonito de la naturaleza.", false, 0, 0);
                        if (random.Next(1, 3) == 2)
                        {
                            User.CarryItem(random.Next(1019, 1024));
                            return;
                        }
                        User.CarryItem(random.Next(1006, 1010));
                        return;
                    case "zanahoria":
                    case "zana":
                    case "carrot":
                        base.GetRoomUser().Chat(null, "Aquí tienes una buena verdura. ¡Provecho!", false, 0, 0);
                        User.CarryItem(3);
                        return;
                    case "café":
                    case "cafe":
                    case "capuccino":
                    case "coffee":
                    case "latte":
                    case "mocha":
                    case "espresso":
                    case "expreso":
                        base.GetRoomUser().Chat(null, "Aquí tienes tu café. ¡Está espumoso!", false, 0, 0);
                        User.CarryItem(random.Next(11, 18));
                        return;
                    case "fruta":
                    case "fruit":
                        base.GetRoomUser().Chat(null, "Aquí tienes algo sano, fresco y natural. ¡Que lo disfrutes!", false, 0, 0);
                        User.CarryItem(random.Next(36, 40));
                        return;
                    case "naranja":
                    case "orange":
//.........这里部分代码省略.........
开发者ID:BjkGkh,项目名称:Mercury,代码行数:101,代码来源:GenericBot.cs

示例6: OnUserSay

        /// <summary>
        ///     Called when [user say].
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="message">The message.</param>
        internal override void OnUserSay(RoomUser user, string message)
        {
            if (Gamemap.TileDistance(GetRoomUser().X, GetRoomUser().Y, user.X, user.Y) > 16) return;

            if (!_isBartender) return;

            try
            {
                message = message.Substring(1);
            }
            catch
            {
                return;
            }
            switch (message.ToLower())
            {
                case "ven":
                case "comehere":
                case "come here":
                case "ven aquí":
                case "come":
                case "vem aqui":
                case "venha":
                case "venha aqui":
                case "vem aquí":
                    GetRoomUser().Chat(null, "Estou Indo!", false, 0);
                    GetRoomUser().MoveTo(user.SquareInFront);
                    return;

                case "sirve":
                case "serve":
                case "sirva":
                    if (GetRoom().CheckRights(user.GetClient()))
                    {
                        foreach (var current in GetRoom().GetRoomUserManager().GetRoomUsers())
                            current.CarryItem(Random.Next(1, 38));
                        GetRoomUser().Chat(null, "Worth. Agora você tem algo para devorar todos.", false, 0);
                        return;
                    }
                    return;

                case "agua":
                case "água":
                case "té":
                case "te":
                case "tea":
                case "juice":
                case "water":
                case "zumo":
                    GetRoomUser().Chat(null, "Aqui você vai.", false, 0);
                    user.CarryItem(Random.Next(1, 3));
                    return;

                case "helado":
                case "icecream":
                case "sorvete":
                case "ice cream":
                    GetRoomUser()
                        .Chat(null, "Aqui você vai. Isso não é o idioma que se encaixam perto, hehe!", false, 0);
                    user.CarryItem(4);
                    return;

                case "rose":
                case "rosa":
                    GetRoomUser().Chat(null, "Aqui você vai ... você faz bem em sua nomeação.", false, 0);
                    user.CarryItem(Random.Next(1000, 1002));
                    return;

                case "girasol":
                case "girassol":
                case "sunflower":
                    GetRoomUser().Chat(null, "Aqui estão algumas muito agradável natureza.", false, 0);
                    user.CarryItem(1002);
                    return;

                case "flor":
                case "flower":
                    GetRoomUser().Chat(null, "Aqui estão algumas muito agradável da natureza.", false, 0);
                    if (Random.Next(1, 3) == 2)
                    {
                        user.CarryItem(Random.Next(1019, 1024));
                        return;
                    }
                    user.CarryItem(Random.Next(1006, 1010));
                    return;

                case "zanahoria":
                case "zana":
                case "carrot":
                case "cenoura":
                    GetRoomUser().Chat(null, "Aqui está um bom vegetal. Divirta-se!", false, 0);
                    user.CarryItem(3);
                    return;

                case "café":
//.........这里部分代码省略.........
开发者ID:kessiler,项目名称:azureEmulator,代码行数:101,代码来源:GenericBot.cs

示例7: OnUserShout

        public override void OnUserShout(RoomUser User, string Message)
        {
            if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null)
                return;

            if (Gamemap.TileDistance(GetRoomUser().X, GetRoomUser().Y, User.X, User.Y) > 8)
                return;

            BotResponse Response = PlusEnvironment.GetGame().GetBotManager().GetResponse(GetBotData().AiType, Message);
            if (Response == null)
                return;

            switch (Response.ResponseType.ToLower())
            {
                case "say":
                    GetRoomUser().Chat(Response.ResponseText.Replace("{username}", User.GetClient().GetHabbo().Username), false);
                    break;

                case "shout":
                    GetRoomUser().Chat(Response.ResponseText.Replace("{username}", User.GetClient().GetHabbo().Username), true);
                    break;

                case "whisper":
                    User.GetClient().SendMessage(new WhisperComposer(GetRoomUser().VirtualId, Response.ResponseText.Replace("{username}", User.GetClient().GetHabbo().Username), 0, 0));
                    break;
            }

            if (Response.BeverageIds.Count > 0)
            {
                User.CarryItem(Response.BeverageIds[RandomNumber.GenerateRandom(0, (Response.BeverageIds.Count - 1))]);
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:32,代码来源:BartenderBot.cs


注:本文中的RoomUser.CarryItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。