Resource icon

Special Abilities 2014-06-13

Author
Omni
Downloads
72
Views
1,802
First release
Last update
Rating
0.00 star(s) 0 ratings
No permission to download Join the discussion

More resources from Omni

Ok, examples...

So... you want dragons in your shard to do five firebreaths at once ocasionally.

Code:
Code (text):
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
    [CorpseName( "a dragon corpse" )]
    public class Dragon : BaseCreature
    {
        [Constructable]
        public Dragon () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            Name = "a dragon";
            Body = Utility.RandomList( 12, 59 );
            BaseSoundID = 362;

            SetStr( 796, 825 );
            SetDex( 86, 105 );
            SetInt( 436, 475 );

            SetHits( 478, 495 );

            SetDamage( 16, 22 );

            SetDamageType( ResistanceType.Physical, 100 );

            SetResistance( ResistanceType.Physical, 55, 65 );
            SetResistance( ResistanceType.Fire, 60, 70 );
            SetResistance( ResistanceType.Cold, 30, 40 );
            SetResistance( ResistanceType.Poison, 25, 35 );
            SetResistance( ResistanceType.Energy, 35, 45 );

            SetSkill( SkillName.EvalInt, 30.1, 40.0 );
            SetSkill( SkillName.Magery, 30.1, 40.0 );
            SetSkill( SkillName.MagicResist, 99.1, 100.0 );
            SetSkill( SkillName.Tactics, 97.6, 100.0 );
            SetSkill( SkillName.Wrestling, 90.1, 92.5 );

            Fame = 15000;
            Karma = -15000;

            VirtualArmor = 60;

            Tamable = true;
            ControlSlots = 3;
            MinTameSkill = 93.9;
        }

        public override void GenerateLoot()
        {
            AddLoot( LootPack.FilthyRich, 2 );
            AddLoot( LootPack.Gems, 8 );
        }

        public override bool ReacquireOnMovement{ get{ return !Controlled; } }
        public override bool HasBreath{ get{ return true; } } // fire breath enabled
        public override bool AutoDispel{ get{ return !Controlled; } }
        public override int TreasureMapLevel{ get{ return 4; } }
        public override int Meat{ get{ return 19; } }
        public override int Hides{ get{ return 20; } }
        public override HideType HideType{ get{ return HideType.Barbed; } }
        public override int Scales{ get{ return 7; } }
        public override ScaleType ScaleType{ get{ return ( Body == 12 ? ScaleType.Yellow : ScaleType.Red ); } }
        public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
        public override bool CanAngerOnTame { get { return true; } }

        public Dragon( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}
That is the distro code for a Dragon.

Code:
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
    [CorpseName( "a dragon corpse" )]
    public class Dragon : [color=green]BaseSpecialCreature[/color]
    {[color=green]
            public override bool DoesMultiFirebreathing { get { return true; } }
            public override double MultiFirebreathingChance { get { return 0.4; } }
            public override int BreathDamagePercent { get { return 80; } }
            public override int BreathMaxTargets { get { return 5; } }
            public override int BreathMaxRange { get { return 5; } }
[/color]
        [Constructable]
        public Dragon () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            Name = "a dragon";
            Body = Utility.RandomList( 12, 59 );
            BaseSoundID = 362;

            SetStr( 796, 825 );
            SetDex( 86, 105 );
            SetInt( 436, 475 );

            SetHits( 478, 495 );

            SetDamage( 16, 22 );

            SetDamageType( ResistanceType.Physical, 100 );

            SetResistance( ResistanceType.Physical, 55, 65 );
            SetResistance( ResistanceType.Fire, 60, 70 );
            SetResistance( ResistanceType.Cold, 30, 40 );
            SetResistance( ResistanceType.Poison, 25, 35 );
            SetResistance( ResistanceType.Energy, 35, 45 );

            SetSkill( SkillName.EvalInt, 30.1, 40.0 );
            SetSkill( SkillName.Magery, 30.1, 40.0 );
            SetSkill( SkillName.MagicResist, 99.1, 100.0 );
            SetSkill( SkillName.Tactics, 97.6, 100.0 );
            SetSkill( SkillName.Wrestling, 90.1, 92.5 );

            Fame = 15000;
            Karma = -15000;

            VirtualArmor = 60;

            Tamable = true;
            ControlSlots = 3;
            MinTameSkill = 93.9;
        }

        public override void GenerateLoot()
        {
            AddLoot( LootPack.FilthyRich, 2 );
            AddLoot( LootPack.Gems, 8 );
        }

        public override bool ReacquireOnMovement{ get{ return !Controlled; } }
        [color=green]//[/color]public override bool HasBreath{ get{ return true; } } // fire breath enabled
        public override bool AutoDispel{ get{ return !Controlled; } }
        public override int TreasureMapLevel{ get{ return 4; } }
        public override int Meat{ get{ return 19; } }
        public override int Hides{ get{ return 20; } }
        public override HideType HideType{ get{ return HideType.Barbed; } }
        public override int Scales{ get{ return 7; } }
        public override ScaleType ScaleType{ get{ return ( Body == 12 ? ScaleType.Yellow : ScaleType.Red ); } }
        public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
        public override bool CanAngerOnTame { get { return true; } }

        public Dragon( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}
This is after configuring it for multiple firebreathing.
What does each thing mean?
Code:
public class Dragon : [color=green]BaseSpecialCreature[/color]
This will allow you to use the special abilities I've developed, and packed them into a single class, you will still be able to use BaseCreature (90% of NPC Mobiles inherit from this class) as normal, because BaseSpecialCreature inherits from it.

public override bool DoesMultiFirebreathing { get { return true; } }
This will enable the multiple firebreathing ability.

public override double MultiFirebreathingChance { get { return 0.4; } }
This will set a chance of 40% to use multiple firebreaths (if the chance is not hit, then the normal firebreathing style will be used).

public override int BreathDamagePercent { get { return 80; } }
This basically works as a scalar. The more you reduce it, the less damage a firebreath does, I added this considering that multiple firebreaths will be thougher

public override int BreathMaxTargets { get { return 5; } }
This will determine how many targets we will hit with our multiple firebreath

public override int BreathMaxRange { get { return 5; } }
This will determine the max tile range to check for hitting with firebreaths.

//public override bool HasBreath{ get{ return true; } } // fire breath enabled
Actually you could just leave this on, but I wanted to add that if you don't have it, it will work anyways, because baseclass defaults HasBreath to 'DoesMultiFirebreathing'.

Note that firebreaths won't hit a single target twice.

This was a old script that was given to me i don't take credit for this..

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back