public async void OnItemDropped(ItemDroppedEventArgs ev)
 {
     if (Instance.Config.EventsToLog.PlayerItemDropped && (!ev.Player.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack))
     {
         await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(Language.HasDropped, ev.Player.Nickname, Instance.Config.ShouldLogUserIds ? ev.Player.UserId : Language.Redacted, ev.Player.Role, ev.Pickup.ItemId))).ConfigureAwait(false);
     }
 }
Esempio n. 2
0
 // Token: 0x0600000B RID: 11 RVA: 0x000025A0 File Offset: 0x000007A0
 private static void HandleDroppedItem(ItemDroppedEventArgs ev)
 {
     /*if (SameThings.ItemAutoCleanup <= 0 || SameThings.ItemCleanupIgnore.Contains((int)ev.Pickup.ItemId))
      * {
      *      return;
      * }
      * State.Pickups.Add(ev.Pickup, State.CleanupTime + SameThings.ItemAutoCleanup);*/
 }
Esempio n. 3
0
        private static void HandleDroppedItem(ItemDroppedEventArgs ev)
        {
            if (Plugin.Config.ItemAutoCleanup == 0 ||
                Plugin.Config.ItemCleanupIgnore.Contains(ev.Pickup.ItemId))
            {
                return;
            }

            State.Pickups.Enqueue(ev.Pickup);
        }
 public void OnDropItem(ItemDroppedEventArgs ev)
 {
     try
     {
         ResetAFKTime(ev.Player);
     }
     catch (Exception e)
     {
         Log.Error($"ERROR In OnDropItem(): {e}");
     }
 }
        public void RunWhenPlayerDropsItem(ItemDroppedEventArgs ev)
        {
            if (ev.Player != _ply)
            {
                return;
            }

            if (ev.Pickup.ItemId.IsWeapon())
            {
                Destroy(ev.Pickup.gameObject);
            }
        }
        public void RunWhenPlayerDropsItem(ItemDroppedEventArgs d)
        {
            if (d.Player != Hub)
            {
                return;
            }

            if (d.Pickup.ItemId.IsGun())
            {
                UnityEngine.Object.Destroy(d.Pickup.gameObject);
            }
        }
Esempio n. 7
0
 protected void PlayerAbsence(DOLEvent e, object sender, EventArgs args)
 {
     Realm = 0;
     if (e == PlayerInventoryEvent.ItemDropped)
     {
         ItemDroppedEventArgs idArgs = args as ItemDroppedEventArgs;
         if (idArgs.SourceItem.Name != m_item.Name)
         {
             return;
         }
         idArgs.GroundItem.RemoveFromWorld();
         PlayerLoosesRelic(false);
         return;
     }
     PlayerLoosesRelic(true);
 }
Esempio n. 8
0
        private static bool Prefix(Inventory __instance, int itemInventoryIndex)
        {
            try
            {
                if (!__instance._iawRateLimit.CanExecute(true) || itemInventoryIndex < 0 ||
                    itemInventoryIndex >= __instance.items.Count)
                {
                    return(false);
                }

                Inventory.SyncItemInfo syncItemInfo = __instance.items[itemInventoryIndex];

                if (__instance.items[itemInventoryIndex].id != syncItemInfo.id)
                {
                    return(false);
                }

                var droppingItemEventArgs =
                    new DroppingItemEventArgs(API.Features.Player.Get(__instance.gameObject), syncItemInfo);

                Player.OnDroppingItem(droppingItemEventArgs);

                syncItemInfo = droppingItemEventArgs.Item;

                if (!droppingItemEventArgs.IsAllowed)
                {
                    return(false);
                }

                Pickup droppedPickup = __instance.SetPickup(syncItemInfo.id, syncItemInfo.durability, __instance.transform.position, __instance.camera.transform.rotation, syncItemInfo.modSight, syncItemInfo.modBarrel, syncItemInfo.modOther);

                __instance.items.RemoveAt(itemInventoryIndex);

                var itemDroppedEventArgs = new ItemDroppedEventArgs(API.Features.Player.Get(__instance.gameObject), droppedPickup);

                Player.OnItemDropped(itemDroppedEventArgs);

                return(false);
            }
            catch (Exception e)
            {
                API.Features.Log.Error($"Exiled.Events.Patches.Events.Player.ItemDrop: {e}\n{e.StackTrace}");

                return(true);
            }
        }
Esempio n. 9
0
        private static void Mobile_ItemDropped(Mobile m, ItemDroppedEventArgs args)
        {
            var item    = args.Item;
            var bounced = args.Bounced;

            if (bounced)
            {
                return;
            }

            var map  = m.Map;
            var root = item.RootParent;

            if (map != null && (root == null || root is Item))
            {
                Packet p = null;

                foreach (var ns in map.GetClientsInRange(m.Location))
                {
                    if (ns.Mobile != m && ns.Mobile.CanSee(m))
                    {
                        if (p == null)
                        {
                            IEntity trg;

                            if (root == null)
                            {
                                trg = new DummyEntity(Serial.Zero, item.Location, map);
                            }
                            else
                            {
                                trg = new DummyEntity(((Item)root).Serial, ((Item)root).Location, map);
                            }

                            p = Packet.Acquire(new DragEffect(m, trg, item.ItemID, item.Hue, item.Amount));
                        }

                        ns.Send(p);
                    }
                }

                Packet.Release(p);
            }
        }
Esempio n. 10
0
 private void ultraExplorerBar1_ItemDropped(object sender, ItemDroppedEventArgs e)
 {
     // Iterate through Groups
     foreach (UltraExplorerBarGroup aGroup in ultraExplorerBar1.Groups)
     {
         mGroupItemTag agtag       = (mGroupItemTag)aGroup.Tag;
         int           itemrankcnt = 0;
         // Reorder Items in the Group
         foreach (UltraExplorerBarItem anItem in aGroup.Items)
         {
             mGroupItemTag atag = (mGroupItemTag)anItem.Tag;
             atag.Rank = itemrankcnt++;
             string sql = "UPDATE TaskItems SET Rank =" + atag.Rank.ToString()
                          + ", ParentID = " + agtag.ID + " WHERE ID=" + atag.ID + ";";
             VWA4Common.DB.Update(sql);
         }
     }
     /// Update the Taskbar
     // UCTaskList is listening to week start event, so cause it to fire & reload
     trackerDetector.FireWeekStart();
 }
Esempio n. 11
0
        /// <summary>
        /// Called when an object is dropped onto this control
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDragDrop(DragEventArgs e)
        {
            // is there a current drop-target node?
            if (_dropTargetNode != null)
            {
                try
                {
                    object dragDropData = GetDragDropData(e);

                    // ask the node to accept the drop
                    DragDropKind result = _dropTargetNode.AcceptDrop(dragDropData, GetDragDropKind(e.Effect), _dropPosition);

                    // be sure to set the resulting effect in the event args, so that it gets communicated
                    // back to the initiator of the drag drop operation
                    e.Effect = GetDragDropEffect(result);

                    // Fire the item dropped event
                    if (e.Effect != DragDropEffects.None)
                    {
                        ItemDroppedEventArgs args = new ItemDroppedEventArgs(dragDropData, result);
                        EventsHelper.Fire(_itemDropped, this, args);
                    }
                }
                catch (Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex);
                }

                // remove highlighting from drop target node
                HighlightNode(_dropTargetNode, false);
                SetInsertMark(_dropTargetNode, DragDropPosition.Default);
            }

            // clear the drop target node
            _dropTargetNode = null;
            _dropEffect     = DragDropEffects.None;
            _dropPosition   = DragDropPosition.Default;

            base.OnDragDrop(e);
        }
Esempio n. 12
0
        public void OnItemDropped(ItemDroppedEventArgs e)
        {
            e.Player.ShowHint("Wypadło ci coś dzbanie");
            ItemType typ = e.Pickup.ItemId;

            if (typ == ItemType.MicroHID)
            {
                e.Pickup.durability = 0f;
                e.Player.ShowHint("Rozładował ci się HID dzbanie");
            }
            else if (typ == ItemType.Coin)
            {
                e.Player.IsBypassModeEnabled = true;
                e.Player.ShowHint("Magiczna moneta otwiera każde drzwi na twej drodze");
                e.Pickup.Delete();
            }
            else if (typ == ItemType.Adrenaline)
            {
                e.Pickup.SetIDFull(ItemType.SCP500);
                e.Player.ShowHint("Ale heca SCP-500");
            }
        }
Esempio n. 13
0
 /// <summary>
 /// Invoked after an item has been dropped.
 /// </summary>
 /// <param name="ev">The <see cref="ItemDroppedEventArgs"/> instance.</param>
 public static void OnItemDropped(ItemDroppedEventArgs ev) => ItemDropped.InvokeSafely(ev);
Esempio n. 14
0
 /// <summary>
 /// Drop an item onto the Explorer Bar - items can only be UserDataFields
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void userDataExplorerBar_ItemDropped(object sender, ItemDroppedEventArgs e)
 {
 }
Esempio n. 15
0
        /// <summary>
        /// Called when an object is dropped onto this control
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDragDrop(DragEventArgs e)
        {
            // is there a current drop-target node?
            if (_dropTargetNode != null)
            {
                try
                {
					object dragDropData = GetDragDropData(e);
					
					// ask the node to accept the drop
					DragDropKind result = _dropTargetNode.AcceptDrop(dragDropData, GetDragDropKind(e.Effect), _dropPosition);

                    // be sure to set the resulting effect in the event args, so that it gets communicated
                    // back to the initiator of the drag drop operation
                    e.Effect = GetDragDropEffect(result);

					// Fire the item dropped event
					if (e.Effect != DragDropEffects.None)
					{
						ItemDroppedEventArgs args = new ItemDroppedEventArgs(dragDropData, result);
						EventsHelper.Fire(_itemDropped, this, args);
					}
				}
                catch (Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex);
                }

                // remove highlighting from drop target node
                HighlightNode(_dropTargetNode, false);
            	SetInsertMark(_dropTargetNode, DragDropPosition.Default);
            }

            // clear the drop target node
            _dropTargetNode = null;
            _dropEffect = DragDropEffects.None;
        	_dropPosition = DragDropPosition.Default;

            base.OnDragDrop(e);
        }
Esempio n. 16
0
 private void MyItemDroppedHandler(ItemDroppedEventArgs <Draggable> e)
 {
     Debug.Log($"{e.ContainedItem.name} was dropped into {name}");
 }
Esempio n. 17
0
 public void OnItemDropped(ItemDroppedEventArgs ev)
 {
     AmmoDropped(ev.Pickup);
 }
        public void OnPlayerDroppedItem(PlayerDroppedItemEvent e)
        {
            var @event = new ItemDroppedEventArgs(Player.Get(e.Player.gameObject), e.Pickup);

            Handlers.Player.OnItemDropped(@event);
        }