Пример #1
0
        public void Run(Client client, MessageEvent msgEvent)
        {
            Item       item = client.CurrentRoom.GetWallItems().Where(x => x.Definition.HandleType == AuroraEmu.Game.Items.Handlers.HandleType.DIMMER).ToList()[0];
            DimmerData data = Engine.Locator.ItemController.GetDimmerData(item.Id);

            if (data.Enabled)
            {
                data.Enabled = false;
            }
            else
            {
                data.Enabled = true;
            }
            item.Data = data.GenerateExtradata();
            client.CurrentRoom.SendComposer(new ItemUpdateMessageComposer(item));
            Engine.Locator.ItemController.Dao.UpdateItemData(item.Id, item.Data);
        }
        public void Run(Client client, MessageEvent msgEvent)
        {
            Item       item = client.CurrentRoom.GetWallItems().Where(x => x.Definition.HandleType == AuroraEmu.Game.Items.Handlers.HandleType.DIMMER).ToList()[0];
            DimmerData data = Engine.Locator.ItemController.GetDimmerData(item.Id);

            int    preset    = msgEvent.ReadVL64();
            int    bgMode    = msgEvent.ReadVL64();
            string colorCode = msgEvent.ReadString();
            int    intensity = msgEvent.ReadVL64();

            data.Enabled       = true;
            data.CurrentPreset = preset;
            DimmerPreset dimmerPreset = data.Presets[preset];

            dimmerPreset.BackgroundOnly = bgMode >= 2 ? true : false;
            dimmerPreset.ColorIntensity = intensity;
            dimmerPreset.ColorCode      = colorCode;
            item.Data = data.GenerateExtradata();
            client.SendComposer(new ItemUpdateMessageComposer(item));
            Engine.Locator.ItemController.Dao.UpdateDimmerPreset(data);
        }