Beispiel #1
0
        protected override void OnTarget(Mobile from, object target)
        {
            int SlayType = m_Deed.SlayerType;

            if (target is BaseWeapon)
            {
                BaseWeapon item = (BaseWeapon)target;

                SlayerName slaying = SlayerDeed.GetDeedSlayer(SlayType);

                if (item.RootParent != from)
                {
                    from.SendMessage("The weapon must be in your pack.");
                }
                else if (item.Slayer != SlayerName.None && item.Slayer2 != SlayerName.None)
                {
                    from.SendMessage("The weapon is already a slayer.");
                }
                else if (item.Slayer == slaying || item.Slayer2 == slaying)
                {
                    from.SendMessage("The weapon already slays these creatures.");
                }
                else
                {
                    if (item.Slayer == SlayerName.None)
                    {
                        item.Slayer = slaying;
                        from.SendMessage("The weapon now slays these creatures.");
                        m_Deed.Delete();
                    }
                    else if (item.Slayer2 == SlayerName.None)
                    {
                        item.Slayer2 = slaying;
                        from.SendMessage("You weapon now slays these creatures.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is BaseInstrument)
            {
                BaseInstrument item = (BaseInstrument)target;

                SlayerName slaying = SlayerDeed.GetDeedSlayer(SlayType);

                if (item.RootParent != from)
                {
                    from.SendMessage("The instrument must be in your pack.");
                }
                else if (item.Slayer != SlayerName.None && item.Slayer2 != SlayerName.None)
                {
                    from.SendMessage("The instrument is already a slayer.");
                }
                else if (item.Slayer == slaying || item.Slayer2 == slaying)
                {
                    from.SendMessage("The instrument already slays these creatures.");
                }
                else
                {
                    if (item.Slayer == SlayerName.None)
                    {
                        item.Slayer = slaying;
                        from.SendMessage("The instrument now slays these creatures.");
                        m_Deed.Delete();
                    }
                    else if (item.Slayer2 == SlayerName.None)
                    {
                        item.Slayer2 = slaying;
                        from.SendMessage("You instrument now slays these creatures.");
                        m_Deed.Delete();
                    }
                }
            }
            else if (target is Spellbook && !(target is HolyManSpellbook))
            {
                Spellbook item = (Spellbook)target;

                SlayerName slaying = SlayerDeed.GetDeedSlayer(SlayType);

                if (item.RootParent != from)
                {
                    from.SendMessage("The book must be in your pack.");
                }
                else if (item.Slayer != SlayerName.None && item.Slayer2 != SlayerName.None)
                {
                    from.SendMessage("The book is already a slayer.");
                }
                else if (item.Slayer == slaying || item.Slayer2 == slaying)
                {
                    from.SendMessage("The book already slays these creatures.");
                }
                else
                {
                    if (item.Slayer == SlayerName.None)
                    {
                        item.Slayer = slaying;
                        from.SendMessage("The book now slays these creatures.");
                        m_Deed.Delete();
                    }
                    else if (item.Slayer2 == SlayerName.None)
                    {
                        item.Slayer2 = slaying;
                        from.SendMessage("You book now slays these creatures.");
                        m_Deed.Delete();
                    }
                }
            }
        }
Beispiel #2
0
 public SlayerTarget(SlayerDeed deed) : base(1, false, TargetFlags.None)
 {
     m_Deed = deed;
 }