Пример #1
0
        private static void GivePlayerItemWithRune(Player player, int offset, GameModeStatics.GameModes mode,
                                                   out Item item, out Item rune)
        {
            item = new ItemBuilder()
                   .With(i => i.Id, 500 + offset)
                   .With(i => i.PvPEnabled, (int)mode)
                   .BuildAndSave();

            rune = new ItemBuilder()
                   .With(i => i.Id, 200 + offset)
                   .With(i => i.PvPEnabled, (int)mode)
                   .With(i => i.ItemSource, new ItemSourceBuilder()
                         .With(i => i.ItemType, PvPStatics.ItemType_Rune)
                         .BuildAndSave()
                         )
                   .BuildAndSave();

            item.AttachRune(rune);
            player.GiveItem(item);
        }
Пример #2
0
        private static void GivePlayerSoulboundItemWithRune(Player player, int offset, GameModeStatics.GameModes mode, out Item item, out Item rune)
        {
            var formerPlayer = new PlayerBuilder()
                               .With(p => p.User, new UserBuilder()
                                     .With(u => u.Id, "former")
                                     .BuildAndSave()
                                     )
                               .With(p => p.Id, 100 + offset)
                               .BuildAndSave();

            item = new ItemBuilder()
                   .With(i => i.Id, 500 + offset)
                   .With(i => i.FormerPlayer, formerPlayer)
                   .With(i => i.PvPEnabled, (int)mode)
                   .BuildAndSave();

            rune = new ItemBuilder()
                   .With(i => i.Id, 600 + offset)
                   .With(i => i.PvPEnabled, (int)mode)
                   .With(i => i.ItemSource, new ItemSourceBuilder()
                         .With(i => i.ItemType, PvPStatics.ItemType_Rune)
                         .BuildAndSave())
                   .BuildAndSave();

            item.SoulbindToPlayer(player);
            item.AttachRune(rune);
        }