Exemple #1
0
        private void Events_OnItemEquipped(Player nativePlayer)
        {
            var player = GetUnturnedPlayer(nativePlayer) !;

            var page = nativePlayer.equipment.equippedPage;

            var index = nativePlayer.inventory.getIndex(page,
                                                        nativePlayer.equipment.equipped_x, nativePlayer.equipment.equipped_y);

            if (index == byte.MaxValue)
            {
                return;
            }

            var item = nativePlayer.inventory.getItem(page, index);

            if (item == null)
            {
                return;
            }

            var inventoryItem =
                new UnturnedInventoryItem(player !.Inventory, item);

            var @event = new UnturnedPlayerItemEquippedEvent(player, inventoryItem.Item);

            Emit(@event);
        }
Exemple #2
0
        private void Events_OnItemEquipped(Player nativePlayer)
        {
            var player = GetUnturnedPlayer(nativePlayer) !;

            var item = new Item(
                nativePlayer.equipment.itemID,
                1,
                nativePlayer.equipment.quality,
                nativePlayer.equipment.state);

            var @event = new UnturnedPlayerItemEquippedEvent(player, new UnturnedItem(item));

            Emit(@event);
        }