public bool TryCombine(Mobile from, RuinedShipPlans plans) { if (m_Joined.Contains(plans.Type)) { from.SendLocalizedMessage(1116787); //This part is already attached. return false; } plans.Delete(); from.PlaySound(0x249); foreach (PlanType type in plans.Joined) { if(!m_Joined.Contains(type)) m_Joined.Add(type); } InvalidateProperties(); if (m_Joined.Count == 8) { from.AddToBackpack(new OrcishGalleonDeed()); from.SendLocalizedMessage(1116788); //You have completed a deed for an Orc Ship! this.Delete(); } else from.Target = new InternalTarget(this); return true; }
public bool TryCombine(Mobile from, RuinedShipPlans plans) { if (m_Joined.Contains(plans.Type)) { from.SendLocalizedMessage(1116787); //This part is already attached. return(false); } plans.Delete(); from.PlaySound(0x249); foreach (PlanType type in plans.Joined) { if (!m_Joined.Contains(type)) { m_Joined.Add(type); } } InvalidateProperties(); if (m_Joined.Count == 8) { from.AddToBackpack(new OrcishGalleonDeed()); from.SendLocalizedMessage(1116788); //You have completed a deed for an Orc Ship! Delete(); } else { from.Target = new InternalTarget(this); } return(true); }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is Item && !((Item)targeted).IsChildOf(from.Backpack)) { from.SendMessage("That must be in your pack to combine."); } else if (targeted is RuinedShipPlans) { RuinedShipPlans toAttach = (RuinedShipPlans)targeted; m_Plans.TryCombine(from, toAttach); } else { from.SendLocalizedMessage(1116786); //These do not fit together. } }
public InternalTarget(RuinedShipPlans plans) : base(-1, false, TargetFlags.None) { m_Plans = plans; }