Care with this,you need to add the "taming nerf" like using real animal taming skill,or you will tame creatures with savage attributes.
 
Thank you, I've done this command to try powers of some creature without setting manually each time the props.
I dodm't thought about it. Well I think you are talking about add the line if (t.Tamable) t.OnAfterTame(from); right?
Thank you

Code:
// created by emme

using System;
using Server.Items;
using Server.Targeting;
using Server.Mobiles;

namespace Server.Commands
{
	public class IstaTame
	{
		public static void Initialize()
		{
			CommandSystem.Register("IstaTame", AccessLevel.Administrator, new CommandEventHandler(IstaTame_OnCommand) );
		}

		[Usage("IstaTame")]
		[Description( "immediately control a mob" )]
		public static void IstaTame_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

            m.SendMessage("select a mobile you want to tame");
            m.Target = new FrozzaTarget(m);
        }
        public class FrozzaTarget : Target
        {
            private Mobile utilizzatore;

            public FrozzaTarget(Mobile m) : base(18, false, TargetFlags.None)
            {
                utilizzatore = m;
            }
            protected override void OnTarget(Mobile from, object target)
            {         
                if (target is BaseCreature)
                {
                    BaseCreature t = (BaseCreature)target;
                    t.Controlled = true;
                    t.ControlMaster = utilizzatore;
                    if (t.Tamable) t.OnAfterTame(from);
                    from.SendMessage(58, "the creature is now under your control");
                    if (!t.Tamable) from.SendMessage(1172, "usually this can't be tamed");
                }
               else
                {
                    from.SendMessage("this is not a valid target");
                }
            }
        }
    }
}
Care with this,you need to add the "taming nerf" like using real animal taming skill,or you will tame creatures with savage attributes.
you mean if (t.Tamable) t.OnAfterTame(from);
right?
 
Last edited:
Care with this,you need to add the "taming nerf" like using real animal taming skill,or you will tame creatures with savage attributes.
it's for admins only. i have something similar.
also the command doesn't check if a mob is tamable or not
 
I refer to scalar animal taming skill do when tame a creature,this is the code used on animaltaming.cs under publish 57:

C#:
if (m_Creature.Owners.Count == 0) // First tame
                            {
                                if (m_Creature is GreaterDragon)
                                {
                                    ScaleSkills(m_Creature, 0.72, 0.90, true); // 72% of original skills trainable to 90%
                                    m_Creature.Skills[SkillName.Magery].Base = m_Creature.Skills[SkillName.Magery].Cap;
                                    // Greater dragons have a 90% cap reduction and 90% skill reduction on magery
                                }
                                else if (m_Paralyzed)
                                {
                                    ScaleSkills(m_Creature, 0.86, true); // 86% of original skills if they were paralyzed during the taming
                                }
                                else
                                {
                                    ScaleSkills(m_Creature, 0.90, true); // 90% of original skills
                                }
                            }
                            else
                            {
                                ScaleSkills(m_Creature, 0.90, false); // 90% of original skills
                            }

                            if (alreadyOwned)
                            {
                                m_Tamer.SendLocalizedMessage(502797); // That wasn't even challenging.
                            }
                            else
                            {
                                m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502799, m_Tamer.NetState);
                                    // It seems to accept you as master.
                            }
 
I refer to scalar animal taming skill do when tame a creature,this is the code used on animaltaming.cs under publish 57:

C#:
if (m_Creature.Owners.Count == 0) // First tame
                            {
                                if (m_Creature is GreaterDragon)
                                {
                                    ScaleSkills(m_Creature, 0.72, 0.90, true); // 72% of original skills trainable to 90%
                                    m_Creature.Skills[SkillName.Magery].Base = m_Creature.Skills[SkillName.Magery].Cap;
                                    // Greater dragons have a 90% cap reduction and 90% skill reduction on magery
                                }
                                else if (m_Paralyzed)
                                {
                                    ScaleSkills(m_Creature, 0.86, true); // 86% of original skills if they were paralyzed during the taming
                                }
                                else
                                {
                                    ScaleSkills(m_Creature, 0.90, true); // 90% of original skills
                                }
                            }
                            else
                            {
                                ScaleSkills(m_Creature, 0.90, false); // 90% of original skills
                            }

                            if (alreadyOwned)
                            {
                                m_Tamer.SendLocalizedMessage(502797); // That wasn't even challenging.
                            }
                            else
                            {
                                m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502799, m_Tamer.NetState);
                                    // It seems to accept you as master.
                            }
that makes sense. this is useful if you plan to tame and give it to a player or for testing a mob if a player tames it.
 
Thank you, I've done this command to try powers of some creature without setting manually each time the props.
I dodm't thought about it. Well I think you are talking about add the line if (t.Tamable) t.OnAfterTame(from); right?
Thank you

Code:
// created by emme

using System;
using Server.Items;
using Server.Targeting;
using Server.Mobiles;

namespace Server.Commands
{
	public class IstaTame
	{
		public static void Initialize()
		{
			CommandSystem.Register("IstaTame", AccessLevel.Administrator, new CommandEventHandler(IstaTame_OnCommand) );
		}

		[Usage("IstaTame")]
		[Description( "immediately control a mob" )]
		public static void IstaTame_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

            m.SendMessage("select a mobile you want to tame");
            m.Target = new FrozzaTarget(m);
        }
        public class FrozzaTarget : Target
        {
            private Mobile utilizzatore;

            public FrozzaTarget(Mobile m) : base(18, false, TargetFlags.None)
            {
                utilizzatore = m;
            }
            protected override void OnTarget(Mobile from, object target)
            {         
                if (target is BaseCreature)
                {
                    BaseCreature t = (BaseCreature)target;
                    t.Controlled = true;
                    t.ControlMaster = utilizzatore;
                    if (t.Tamable) t.OnAfterTame(from);
                    from.SendMessage(58, "the creature is now under your control");
                    if (!t.Tamable) from.SendMessage(1172, "usually this can't be tamed");
                }
               else
                {
                    from.SendMessage("this is not a valid target");
                }
            }
        }
    }
}

you mean if (t.Tamable) t.OnAfterTame(from);
right?

yes. i confirm it. with this line the script go to read the onaftertame istance in basecreature and scale the stats.
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back