コード例 #1
0
ファイル: RuinedShipPlans.cs プロジェクト: Crome696/ServUO
        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;
        }
コード例 #2
0
ファイル: RuinedShipPlans.cs プロジェクト: ygtkms/ServUO
        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);
        }
コード例 #3
0
ファイル: RuinedShipPlans.cs プロジェクト: ygtkms/ServUO
 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.
     }
 }
コード例 #4
0
ファイル: RuinedShipPlans.cs プロジェクト: Crome696/ServUO
 public InternalTarget(RuinedShipPlans plans) : base(-1, false, TargetFlags.None)
 {
     m_Plans = plans;
 }
コード例 #5
0
ファイル: RuinedShipPlans.cs プロジェクト: ygtkms/ServUO
 public InternalTarget(RuinedShipPlans plans) : base(-1, false, TargetFlags.None)
 {
     m_Plans = plans;
 }