コード例 #1
0
        public void HandlePacket(GameClient client, GSPacketIn packet)
        {
            ushort keepId      = packet.ReadShort();
            ushort wallId      = packet.ReadShort();
            int    hookpointID = packet.ReadShort();
            ushort itemslot    = packet.ReadShort();
            int    payType     = packet.ReadByte();     //gold RP BP contrat???
            int    unk2        = packet.ReadByte();
            int    unk3        = packet.ReadByte();
            int    unk4        = packet.ReadByte();
//			client.Player.Out.SendMessage("x="+unk2+"y="+unk3+"z="+unk4,eChatType.CT_Say,eChatLoc.CL_SystemWindow);
            AbstractGameKeep keep = GameServer.KeepManager.GetKeepByID(keepId);

            if (keep == null)
            {
                return;
            }
            GameKeepComponent component = keep.KeepComponents[wallId] as GameKeepComponent;

            if (component == null)
            {
                return;
            }

            /*GameKeepHookPoint hookpoint = component.HookPoints[hookpointID] as GameKeepHookPoint;
             * if (hookpoint == null) return 1;
             */
            HookPointInventory inventory = null;

            if (hookpointID > 0x80)
            {
                inventory = HookPointInventory.YellowHPInventory;                                //oil
            }
            else if (hookpointID > 0x60)
            {
                inventory = HookPointInventory.GreenHPInventory;                                    //big siege
            }
            else if (hookpointID > 0x40)
            {
                inventory = HookPointInventory.LightGreenHPInventory;                                     //small siege
            }
            else if (hookpointID > 0x20)
            {
                inventory = HookPointInventory.BlueHPInventory;                                     //npc
            }
            else
            {
                inventory = HookPointInventory.RedHPInventory;             //guard
            }
            if (inventory != null)
            {
                HookPointItem item = inventory.GetItem(itemslot);
                if (item != null)
                {
                    item.Invoke(client.Player, payType, component.KeepHookPoints[hookpointID] as GameKeepHookPoint, component);
                }
            }
        }
コード例 #2
0
        public void HandlePacket(GameClient client, GSPacketIn packet)
        {
            ushort keepId      = packet.ReadShort();
            ushort wallId      = packet.ReadShort();
            int    hookpointID = packet.ReadShort();
            ushort itemslot    = packet.ReadShort();
            int    payType     = packet.ReadByte();     //gold RP BP contrat???

            packet.ReadByte();
            packet.ReadByte();
            packet.ReadByte();


            AbstractGameKeep keep = GameServer.KeepManager.GetKeepByID(keepId);

            if (keep == null)
            {
                return;
            }
            GameKeepComponent component = keep.KeepComponents[wallId] as GameKeepComponent;

            if (component == null)
            {
                return;
            }

            HookPointInventory inventory = null;

            if (hookpointID > 0x80)
            {
                inventory = HookPointInventory.YellowHPInventory;                                 // oil
            }
            else if (hookpointID > 0x60)
            {
                inventory = HookPointInventory.GreenHPInventory;                                      // big siege
            }
            else if (hookpointID > 0x40)
            {
                inventory = HookPointInventory.LightGreenHPInventory;                                      // small siege
            }
            else if (hookpointID > 0x20)
            {
                inventory = HookPointInventory.BlueHPInventory;                                      // npc
            }
            else
            {
                inventory = HookPointInventory.RedHPInventory;              // guard
            }
            HookPointItem item = inventory?.GetItem(itemslot);

            item?.Invoke(client.Player, payType, component.HookPoints[hookpointID], component);
        }