Tailean

Member
[RUNUO 2.6] So I downloaded this Paragon Deed from Servuo that if used on a base creature turns it into a paragon. My question is about the following code:
Code:
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseCreature)
            {
                BaseCreature p = (BaseCreature)target;

                if (p.ControlMaster != null)
                {
                    from.SendMessage("That is a pet belonging to someone else!");
                }
                else if (p.Tamable == false)
                {
                    from.SendMessage("That creature cannot turn into a paragon!");
                }
                else
                {
                    p.IsParagon = true;
                    from.SendMessage("Your target has evolved into a paragon version of itself.");

                    if (m_Deed != null)
                    {
                        m_Deed.Delete(); // Delete the deed
                    }
                    if (IsParagon == true)
                    {
                        // To Do - Refresh HP/Stam/Mana
                    }
                }

            }
            else
            {
                from.SendMessage("That is not a valid target.");
            }
        }

What I want to do is make it so you can use this deed just on some creatures so can I take this part of the code:
Code:
 if (target is BaseCreature)
            {
                BaseCreature p = (BaseCreature)target;

and do this:
Code:
 if (target is BaseCreature)
            {
                BaseCreature p = (Dragon, Slim, Rat)target;

and so on..will this work? Or am I missing something.
 
Last edited:
Well yea that wouldnt work, since you can not put more casts into one bracket.

Also I think the deed didnt actually work since it checked if the pet was belongong to somone, including the player and blocked it.
I also added the refresh part in.

So yea the pets there are just an example, you can add all creatures you want to it.
 

Attachments

  • ParagonDeed.cs
    3.3 KB · Views: 9
So, Will this make only the [typeof(Dog), typeof(Dragon), typeof(Drake), typeof(Slime), typeof(Rat)] paragons? I dont want anything thats not listed to be able to turn paragon.
 
yea that was the goal and thats how it works yes. You can add or remove how many creatures you want though
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back