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


C# GameClient.AddInventory方法代码示例

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


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

示例1: Process

        public CommandAction Process(GameClient Client, string[] Input)
        {
            string From = Input[0];
            string To = Input[1];
            string Message = Input[3];

            string[] Command = Message.Split(' ');

            CommandAction Action = CommandAction.None;
            if (Command[0].StartsWith("@"))
                Action = CommandAction.Processed;

            try
            {
                switch (Command[0])
                {
                    case "@quit":
                        {
                            Client.Disconnect();
                        } break;
                    case "@mm":
                        {
                            ushort MapID = ushort.Parse(Command[1]);
                            ushort X = ushort.Parse(Command[2]);
                            ushort Y = ushort.Parse(Command[3]);

                            Client.Teleport(MapID, X, Y);
                        } break;
                    case "@gold":
                        {

                            Client.Entity.Money = uint.Parse(Command[1]);
                        } break;
                    case "@item":
                        {
                            if (Command.Length > 2)
                            {
                                ConquerItem Item = new ConquerItem(Client, Database.GetItemDetail(Command[1], Command[2]));
                                Item.Position = ItemPosition.Inventory;
                                if (Command.Length > 3)
                                {
                                    Item.Plus = byte.Parse(Command[3]);
                                    if (Command.Length > 4)
                                    {
                                        Item.SocketOne = byte.Parse(Command[4]);
                                        if (Command.Length > 5)
                                        {
                                            Item.SocketTwo = byte.Parse(Command[5]);
                                        }
                                    }
                                }
                                Client.AddInventory(Item);
                            }
                        } break;
                    case "@prof":
                        {
                            LearnProfiency Profiency = LearnProfiency.Create();
                            Profiency.ID = uint.Parse(Command[1]);
                            Profiency.Level = uint.Parse(Command[2]);
                            Client.LearnProfiency(Profiency);
                        } break;
                    case "@spell":
                        {
                            LearnSpell Spell = LearnSpell.Create();
                            Spell.ID = ushort.Parse(Command[1]);
                            Spell.Level = ushort.Parse(Command[2]);
                            Client.LearnSpell(Spell);
                        } break;
                    case "@job":
                        {
                            Client.Entity.Class = byte.Parse(Command[1]);

                            Client.Entity.BeginStatusUpdates();
                            Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Job, Client.Entity.Class));
                            Client.Entity.EndStatusUpdates();
                        } break;
                    case "@str":
                        {
                            byte Strength = byte.Parse(Command[1]);
                            if (Strength <= Client.Entity.StatusPoints.Free)
                            {
                                Client.Entity.StatusPoints.Strength += Strength;
                                Client.Entity.StatusPoints.Free -= Strength;

                                Client.Entity.BeginStatusUpdates();
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.Strength, Client.Entity.StatusPoints.Strength));
                                Client.Entity.EndStatusUpdates();
                            }
                        } break;
                    case "@vit":
                        {
                            byte Vitality = byte.Parse(Command[1]);
                            if (Vitality <= Client.Entity.StatusPoints.Free)
                            {
                                Client.Entity.StatusPoints.Vitality += Vitality;
                                Client.Entity.StatusPoints.Free -= Vitality;

                                Client.Entity.BeginStatusUpdates();
                                Client.Entity.AddStatusUpdate(StatusUpdateEntry.Create(ConquerStatusIDs.StatPoints, Client.Entity.StatusPoints.Free));
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:conquerserver,代码行数:101,代码来源:CommandProcessor.cs


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