public static int HasFeat( PlayerMobile owner, BaseBreedableCreature creat ) { if( creat is Dog ) return owner.Feats.GetFeatLevel(FeatList.DogBreeding); if( creat is Wolf ) return owner.Feats.GetFeatLevel(FeatList.WolfBreeding); if( creat is Horse || creat is WorkHorse ) return owner.Feats.GetFeatLevel(FeatList.HorseBreeding); if( creat is IRacialMount && owner.Feats.GetFeatLevel(FeatList.RacialMounts) > 0 ) return owner.Feats.GetFeatLevel(FeatList.RacialMounts); if( creat is Serpent ) return owner.Feats.GetFeatLevel(FeatList.Snakecharmer); if (creat is Bear) return owner.Feats.GetFeatLevel(FeatList.Beartalker); if (creat is BirdOfPrey) return owner.Feats.GetFeatLevel(FeatList.AvianBreeding); return 0; }
public RetrainPetPrompt( Mobile from, BaseBreedableCreature creat, bool Remove ) { bbc = creat; Add = !Remove; if( Remove ) from.SendMessage( "Please type the code for the feat you wish to REMOVE from this pet." ); else from.SendMessage( "This pet has currently {0} unassigned feat points. Please type the code for the feat you wish to INCREASE by one.", bbc.TrainingPoints.ToString() ); from.SendMessage( 60, "Code - Feat Name - Feat Level" ); for( int i = 1; i < 16; i++ ) { if( (Remove && bbc.GetFeat(i) > 0) || (Add && bbc.GetFeat(i) < 3 ) ) from.SendMessage( 5 * i, "{0} - {1} - {2}", i.ToString(), Utilities.GetBBCFeatName(i), bbc.GetFeat(i) ); } }
public static void TryToMate( PlayerMobile owner, BaseBreedableCreature first, BaseBreedableCreature second ) { if( owner == null || owner.Deleted || first == null || first.Deleted || second == null || second.Deleted ) return; int featlevel = HasFeat( owner, first ); if( !first.CanBeHandledBy(owner) || !second.CanBeHandledBy(owner) ) owner.SendMessage( "You must either control or be a friend of the creatures." ); else if( first == second ) owner.SendMessage( "You need to target two different creatures of the same species and breed." ); else if( first.Breed != second.Breed ) owner.SendMessage( "Both creatures must be of the same breed." ); else if( (first.Female && second.Female) || (!first.Female && !second.Female) ) owner.SendMessage( "The creatures must be of different genders." ); else if( !ValidPosition( owner, first ) || !ValidPosition( owner, second ) || !ValidPosition( first, second ) ) owner.SendMessage( "You and the creatures must be close to each other." ); else if( first.Pregnant || second.Pregnant ) owner.SendMessage( "The female is already pregnant." ); else if( (!first.Female && first.Gelt) || (!second.Female && second.Gelt) ) owner.SendMessage( "The male animal cannot be gelt." ); else if( featlevel > 0 ) { if( RaciallyCompatible( owner, first ) ) { owner.SendMessage( "The creatures have mated sucessfully." ); LevelSystem.AwardCraftXP( owner, true ); if( first.Female ) first.Impregnate( second, owner, featlevel ); else second.Impregnate( first, owner, featlevel ); } } else owner.SendMessage( "You lack the appropriate feat." ); }
public MateTarget( BaseBreedableCreature bbc ) : base(-1, false, TargetFlags.None) { creat = bbc; }
public virtual void SetTraits( BaseBreedableCreature mother ) { this.Lives += mother.CubsExtraLives; this.ExtraLives = mother.CubsExtraLives; this.XPScale = mother.MatesXPScale; this.StatScale = mother.MatesStatScale; this.SkillScale = mother.MatesSkillScale; //One scale from the mother, the other two from the father. switch( Utility.RandomMinMax( 1, 3 ) ) { case 1: this.XPScale = mother.XPScale; break; case 2: this.StatScale = mother.StatScale; break; case 3: this.SkillScale = mother.SkillScale; break; } if (this is Serpent) { this.SetBreedsTraits(this.Breed, -1); } else { if (mother.HueGroup == mother.MatesHueGroup) this.HueGroup = mother.HueGroup; else if (Utility.RandomBool()) this.HueGroup = mother.MatesHueGroup; else this.HueGroup = mother.HueGroup; } //Chance to change scales for better or for worse based on the father's level. this.XPScale = Utilities.NewScale( this.XPScale, mother.MatesLevel ); this.StatScale = Utilities.NewScale( this.StatScale, mother.MatesLevel ); this.SkillScale = Utilities.NewScale( this.SkillScale, mother.MatesLevel ); this.BirthFeats( mother ); this.PetEvolution = 3 * mother.Feats.GetFeatLevel(FeatList.PetEvolution); this.MarkedForTermination = true; this.ReleaseTime = DateTime.Now; }
public virtual void Impregnate( BaseBreedableCreature male, PlayerMobile owner, int featlevel ) { this.CubsExtraLives = (featlevel - 1) * 3; this.Pregnant = true; this.Conception = DateTime.Now; this.MatesXPScale = male.XPScale; this.MatesStatScale = male.StatScale; this.MatesSkillScale = male.SkillScale; this.MatesHueGroup = male.HueGroup; this.MatesLevel = male.Level; this.Feats.SetFeatLevel(FeatList.PetFeats, owner.Feats.GetFeatLevel(FeatList.PetFeats)); this.Feats.SetFeatLevel(FeatList.RetrainPet, owner.Feats.GetFeatLevel(FeatList.RetrainPet)); this.Feats.SetFeatLevel(FeatList.ExtraPetFeats, owner.Feats.GetFeatLevel(FeatList.ExtraPetFeats)); this.Feats.SetFeatLevel(FeatList.PetEvolution, owner.Feats.GetFeatLevel(FeatList.PetEvolution)); this.MatesFeats = male.ListFeats(); this.InvalidateProperties(); }
public virtual void GiveBirth( BaseBreedableCreature bbc ) { bool validLocation = false; Point3D loc = this.Location; for ( int j = 0; !validLocation && j < 10; ++j ) { int x = X + Utility.Random( 3 ) - 1; int y = Y + Utility.Random( 3 ) - 1; int z = this.Map.GetAverageZ( x, y ); if ( validLocation = this.Map.CanFit( x, y, this.Z, 16, false, false ) ) loc = new Point3D( x, y, Z ); else if ( validLocation = this.Map.CanFit( x, y, z, 16, false, false ) ) loc = new Point3D( x, y, z ); } bbc.FixScales(); bbc.MoveToWorld( loc, this.Map ); bbc.SetTraits(this); }
public void BirthFeats( BaseBreedableCreature mother ) { this.TrainingRemaining = mother.Feats.GetFeatLevel(FeatList.RetrainPet); this.InitialFeats = (mother.Feats.GetFeatLevel(FeatList.PetFeats) + Utility.RandomMinMax( 0, mother.Feats.GetFeatLevel(FeatList.ExtraPetFeats) )) * 3; AddFeats( mother.MatesFeats ); }