Пример #1
0
        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            bool flag = Session == null || Item == null;

            if (!flag)
            {
                bool flag2 = !HasRights;
                if (!flag2)
                {
                    IWiredItem wiredItem = null;
                    bool       flag3     = !Item.GetRoom().GetWired().TryGet(Item.Id, out wiredItem);
                    if (!flag3)
                    {
                        Item.ExtraData = "1";
                        Item.UpdateState(false, true);
                        Item.RequestUpdate(2, true);
                        bool flag4 = Item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect;
                        if (!flag4)
                        {
                            bool flag5 = Item.GetRoom().GetWired().IsTrigger(Item);
                            if (flag5)
                            {
                                List <int> blockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(wiredItem, Item.GetRoom().GetWired().GetEffects(wiredItem));
                                Session.SendMessage(new WiredTriggerConfigComposer(wiredItem, blockedItems));
                            }
                            else
                            {
                                bool flag6 = Item.GetRoom().GetWired().IsEffect(Item);
                                if (flag6)
                                {
                                    List <int> blockedItems2 = WiredBoxTypeUtility.ContainsBlockedTrigger(wiredItem, Item.GetRoom().GetWired().GetTriggers(wiredItem));
                                    Session.SendMessage(new WiredEffectConfigComposer(wiredItem, blockedItems2));
                                }
                                else
                                {
                                    bool flag7 = Item.GetRoom().GetWired().IsCondition(Item);
                                    if (flag7)
                                    {
                                        Session.SendMessage(new WiredConditionConfigComposer(wiredItem));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        public void OnTrigger(Player Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null || Item == null)
            {
                return;
            }

            if (!HasRights)
            {
                return;
            }

            IWiredItem Box = null;

            if (!Item.GetRoom().GetWired().TryGet(Item.Id, out Box))
            {
                return;
            }

            Item.ExtraData = "1";
            Item.UpdateState(false, true);
            Item.RequestUpdate(2, true);

            if (Item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect)
            {
                return;
            }

            if (Item.GetRoom().GetWired().IsTrigger(Item))
            {
                var BlockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(Box, Item.GetRoom().GetWired().GetEffects(Box));
                Session.SendPacket(new WiredTriggeRconfigComposer(Box, BlockedItems));
            }
            else if (Item.GetRoom().GetWired().IsEffect(Item))
            {
                var BlockedItems = WiredBoxTypeUtility.ContainsBlockedTrigger(Box, Item.GetRoom().GetWired().GetTriggers(Box));
                Session.SendPacket(new WiredEffectConfigComposer(Box, BlockedItems));
            }
            else if (Item.GetRoom().GetWired().IsCondition(Item))
            {
                Session.SendPacket(new WiredConditionConfigComposer(Box));
            }
        }
Пример #3
0
        public void OnTrigger(GameClient session, Item item, int request, bool hasRights)
        {
            if (session == null || item == null)
            {
                return;
            }
            if (!hasRights)
            {
                return;
            }

            IWiredItem box = null;

            if (!item.GetRoom().GetWired().TryGet(item.Id, out box))
            {
                return;
            }

            item.ExtraData = "1";
            item.UpdateState(false, true);
            item.RequestUpdate(2, true);
            if (item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect)
            {
                return;
            }

            if (item.GetRoom().GetWired().IsTrigger(item))
            {
                var blockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(box, item.GetRoom().GetWired().GetEffects(box));
                session.SendPacket(new WiredTriggerConfigComposer(box, blockedItems));
            }
            else if (item.GetRoom().GetWired().IsEffect(item))
            {
                var blockedItems = WiredBoxTypeUtility.ContainsBlockedTrigger(box, item.GetRoom().GetWired().GetTriggers(box));
                session.SendPacket(new WiredEffectConfigComposer(box, blockedItems));
            }
            else if (item.GetRoom().GetWired().IsCondition(item))
            {
                session.SendPacket(new WiredConditionConfigComposer(box));
            }
        }