コード例 #1
0
ファイル: Mount.cs プロジェクト: tydeFriz/NexusForever
        protected override void OnPassengerRemove(Player player, VehicleSeatType seatType, byte seatPosition)
        {
            if (seatType != VehicleSeatType.Pilot)
            {
                return;
            }

            for (ItemSlot i = ItemSlot.MountFront; i <= ItemSlot.MountRight; i++)
            {
                var itemVisual = new ItemVisual
                {
                    Slot = i
                };

                // hoverboards have their flair visuals added to the player
                if (MountType == PetType.HoverBoard)
                {
                    player.SetAppearance(itemVisual);
                }
                else
                {
                    SetAppearance(itemVisual);
                }
            }

            if (PilotDisplayInfo != null)
            {
                player.SetAppearance(new ItemVisual
                {
                    Slot = ItemSlot.Mount
                });
            }

            UpdateVisuals(player);
        }
コード例 #2
0
ファイル: Mount.cs プロジェクト: tydeFriz/NexusForever
        protected override void OnPassengerAdd(Player player, VehicleSeatType seatType, byte seatPosition)
        {
            if (seatType != VehicleSeatType.Pilot)
            {
                return;
            }

            if (PilotDisplayInfo != null)
            {
                player.SetAppearance(new ItemVisual
                {
                    Slot      = ItemSlot.Mount,
                    DisplayId = (ushort)PilotDisplayInfo.Id
                });
            }

            PetCustomisation customisation = player.PetCustomisationManager.GetCustomisation(MountType, SpellEntry.Id);

            if (customisation != null)
            {
                ItemSlot slot = ItemSlot.MountFront;
                foreach (PetFlairEntry entry in customisation)
                {
                    if (entry != null)
                    {
                        var itemVisual = new ItemVisual
                        {
                            Slot      = slot,
                            DisplayId = (ushort)(slot != ItemSlot.MountRight
                                ? entry.ItemDisplayId[0]
                                : entry.ItemDisplayId[1])
                        };

                        // hoverboards have their flair visuals added to the player
                        if (MountType == PetType.HoverBoard)
                        {
                            player.SetAppearance(itemVisual);
                        }
                        else
                        {
                            SetAppearance(itemVisual);
                        }
                    }

                    slot++;
                }
            }

            UpdateVisuals(player);
        }
コード例 #3
0
ファイル: Inventory.cs プロジェクト: zadialtex/NexusForever
        /// <summary>
        /// Update visual for supplied <see cref="ItemSlot"/> and optional <see cref="Costume"/>.
        /// </summary>
        private ItemVisual VisualUpdate(ItemSlot slot, Costume costume)
        {
            ItemVisual visual = GetItemVisual(slot, costume);

            player?.SetAppearance(visual);
            return(visual);
        }