예제 #1
0
        private unsafe void HandleUnequip(GameClient Client, ItemUsage *Packet)
        {
            ItemPosition Position = (ItemPosition)Packet->Location;
            ConquerItem  Item;

            if (Client.TryGetEquipment(Position, out Item))
            {
                if (Client.AddInventory(Item))
                {
                    Client.Unequip(Item, Position);
                }
                else
                {
                    Client.Message("Inventory is full!", ChatType.Top, Color.Red);
                }
            }
        }
예제 #2
0
        private unsafe void HandleUnequip(GameClient Client, ItemUsage* Packet)
        {
            ItemPosition Position = (ItemPosition)Packet->Location;
            ConquerItem Item;

            if (Client.TryGetEquipment(Position, out Item))
            {
                if (Client.AddInventory(Item))
                {
                    Client.Unequip(Item, Position);
                }
                else
                {
                    Client.Message("Inventory is full!", ChatType.Top, Color.Red);
                }
            }
        }
예제 #3
0
        public override void Execute(GameClient Client, byte *pPacket)
        {
            Chat *Packet = (Chat *)pPacket;

            string[] Parameters = PacketHelper.ParseChat(Packet);

            CommandAction Action = CommandAction.None;

            if ((Action = CommandProcessor.Process(Client, Parameters)) != CommandAction.None)
            {
                if (Action == CommandAction.Processed)
                {
                }
                else if (Action == CommandAction.ClearNpcScripts)
                {
                    NpcScriptEngine.Clear();
                }
                return;
            }

            switch (Packet->ChatType)
            {
            case ChatType.Talk:
                Client.SendScreen(Packet, Packet->Size);
                break;

            case ChatType.Whisper:
                GameClient Receiver = EntityManager.FindByName(Parameters[1]);
                if (Receiver != null)
                {
                    Receiver.Send(Packet, Packet->Size);
                }
                else
                {
                    Client.Message("It appears that " + Parameters[1] + " is offline", ChatType.Top, Color.White);
                }
                break;
            }
        }
예제 #4
0
        public override void Execute(GameClient Client, byte* pPacket)
        {
            Chat* Packet = (Chat*)pPacket;
            string[] Parameters = PacketHelper.ParseChat(Packet);

            CommandAction Action = CommandAction.None;
            if ((Action = CommandProcessor.Process(Client, Parameters)) != CommandAction.None)
            {
                if (Action == CommandAction.Processed)
                {

                }
                else if (Action == CommandAction.ClearNpcScripts)
                {
                    NpcScriptEngine.Clear();
                }
                return;
            }

            switch (Packet->ChatType)
            {
                case ChatType.Talk:
                    Client.SendScreen(Packet, Packet->Size);
                    break;
                case ChatType.Whisper:
                    GameClient Receiver = EntityManager.FindByName(Parameters[1]);
                    if (Receiver != null)
                    {
                        Receiver.Send(Packet, Packet->Size);
                    }
                    else
                    {
                        Client.Message("It appears that " + Parameters[1] + " is offline", ChatType.Top, Color.White);
                    }
                    break;
            }
        }