Пример #1
0
        public Pet(RealmManager manager, ushort objType) : base(manager, objType)
        {
            var gameData = manager.Resources.GameData;
            var petDesc  = gameData.Pets[objType];
            var petSkin  = gameData.PetSkins[gameData.IdToObjectType[petDesc.DefaultSkin]];

            Family = petDesc.Family;
            Rarity = petDesc.Rarity;
            SkinId = petSkin.ObjectType;
            Skin   = petSkin.DisplayId;
            SetDefaultSize(petDesc.MinSize);

            MaxLevel = 30;
            Ability  = new PetAbility[DbPet.NumAbilities];
            for (var i = 0; i < Ability.Length; i++)
            {
                Ability[i] = new PetAbility(this, i);
            }
        }
Пример #2
0
        public Pet(RealmManager manager, Player playerOwner, DbPet pet) : base(manager, pet.ObjectType)
        {
            PlayerOwner = playerOwner;
            _dbPet      = pet;

            var gameData = manager.Resources.GameData;
            var petDesc  = gameData.Pets[(pet.ObjectType == 0) ? (ushort)0x7f05 : pet.ObjectType];
            var petSkin  = gameData.PetSkins[gameData.IdToObjectType[petDesc.DefaultSkin]];

            Family = petDesc.Family;
            SkinId = petSkin.ObjectType;
            Skin   = petSkin.DisplayId;
            SetDefaultSize(petDesc.MinSize);

            PetId    = pet.PetId;
            Rarity   = pet.Rarity;
            MaxLevel = pet.MaxLevel;
            Ability  = new PetAbility[DbPet.NumAbilities];
            for (var i = 0; i < Ability.Length; i++)
            {
                Ability[i] = new PetAbility(this, pet, i);
            }
        }