public override void OnClick() { if (m_From is PlayerMobile) { BaseCreature bc = (BaseCreature)m_Cancel.Pet; PlayerMobile pm = (PlayerMobile)m_From; bc.IsStabled = true; pm.Stabled.Add(m_Cancel.Pet); m_From.SendMessage("You have canceled breeding, Your pet has been returned to the stable, You may claim it their."); m_Cancel.Delete(); } }
private void DoClaim(Mobile from, BaseCreature pet, PetClaimTicket petClaimTicket) { pet.SetControlMaster(from); pet.ControlTarget = from; pet.ControlOrder = OrderType.Follow; pet.MoveToWorld(from.Location, from.Map); pet.IsStabled = false; pet.StabledBy = null; petClaimTicket.Stabled = null; petClaimTicket.Delete(); pet.CheckControlChance(from); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is PetClaimTicket) { PetClaimTicket pct = (PetClaimTicket)dropped; if (pct.Time <= DateTime.UtcNow) { if (pct.Pet == null) { from.SendMessage("Error! Contact Gamemaster"); return(false); } else if (from.Followers == 0) { Type pettype = pct.Pet.GetType(); BaseCreature bc = (BaseCreature)pct.Pet; bc.IsStabled = true; from.Stabled.Add(bc); this.SayTo(from, "I have put your pet that was mating in the stable under you name."); BaseCreature baby = null; if (pettype != null) { object o = Activator.CreateInstance(pettype); baby = o as BaseCreature; } if (baby == null) { from.SendMessage(38, "There was an internal error and breeding has failed due to lack of type, Please contact a member of the staff."); return(false); } else { if (from == pct.Owner) { if (Banker.Withdraw(from, pct.Price)) { from.SendLocalizedMessage(1060398, pct.Price.ToString()); from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString()); baby.Str = pct.Str; baby.Dex = pct.Dex; baby.Int = pct.Int; baby.HitsMaxSeed = pct.Hits; baby.StamMaxSeed = pct.Stam; baby.ManaMaxSeed = pct.Mana; baby.PhysicalResistanceSeed = pct.Phys; baby.FireResistSeed = pct.Fire; baby.ColdResistSeed = pct.Cold; baby.EnergyResistSeed = pct.Nrgy; baby.PoisonResistSeed = pct.Pois; baby.DamageMin = pct.Dmin; baby.DamageMax = pct.Dmax; baby.MaxLevel = pct.Mlev; baby.Generation = pct.Gen + 1; baby.Controlled = true; baby.ControlMaster = from; baby.Location = from.Location; baby.ControlTarget = from; baby.Map = from.Map; baby.Name = baby.Name + " baby"; if (pct.AI == 1) { baby.AI = AIType.AI_Mage; } else if (pct.AI == 2) { baby.AI = AIType.AI_Melee; } baby.MoveToWorld(from.Location, from.Map); baby.ControlOrder = OrderType.Follow; pct.Delete(); return(true); } else { this.SayTo(from, "Hey! you tring to cheat me! This anit for free buddy."); from.SendMessage("You lack the gold in your banking account to do this."); return(false); } } else { this.SayTo(from, "You are not the owner of this deed."); return(false); } } } else { this.SayTo(from, "Please stable or shrink all your pets before we go on."); return(false); } } else { if (pct.Pet != null) { this.SayTo(from, "Your pet {0} is not done mating yet, Please check back later.", pct.Pet.Name); return(false); } else { from.SendMessage("Error in your (Pet Claim Ticket) please contact the staff."); return(false); } } } else { return(false); } }