UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[COMPLETE] Chaos Dragoon & Elite

Status
Not open for further replies.

psz

Administrator
[COMPLETE] Chaos Dragoon & Elite

Here are the Chaos Dragoon and Chaos Dragoon Elite scripts + Changes to bolas and dismount.


These are based off of an old RunUO submission, updated to work with the latest SVN + Fixed so that the mound does not disappear (UOGuide has this right, Stratics is wrong: Tested on OSI)

These should be as perfect as it gets.

ChaosDragoon.cs
Code:
using System;
using Server;
using Server.Misc;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a chaos dragoon corpse" )]
	public class ChaosDragoon : BaseCreature
	{

		public CraftResource res;

		[Constructable]
		public ChaosDragoon() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.15, 0.4 )
		{
			Name = "a chaos dragoon";
			Body = 0x190;
			Hue = Utility.RandomSkinHue();

			SetStr( 176, 225 );
			SetDex( 81, 95 );
			SetInt( 61, 85 );

			SetHits( 176, 225 );

			SetDamage( 24, 26 );

			SetDamageType( ResistanceType.Physical, 25 );
			SetDamageType( ResistanceType.Fire, 25 );
			SetDamageType( ResistanceType.Cold, 25 );
			SetDamageType( ResistanceType.Energy, 25 );

			/*SetResistance( ResistanceType.Physical, 45, 55 );
			SetResistance( ResistanceType.Fire, 15, 25 );
			SetResistance( ResistanceType.Cold, 50 );
			SetResistance( ResistanceType.Poison, 25, 35 );
			SetResistance( ResistanceType.Energy, 25, 35 );*/

			SetSkill( SkillName.Fencing, 77.6, 92.5 );
			SetSkill( SkillName.Healing, 60.3, 90.0 );
			SetSkill( SkillName.Macing, 77.6, 92.5 );
			SetSkill( SkillName.Anatomy, 77.6, 87.5 );
			SetSkill( SkillName.MagicResist, 77.6, 97.5 );
			SetSkill( SkillName.Swords, 77.6, 92.5 );
			SetSkill( SkillName.Tactics, 77.6, 87.5 );

			Fame = 5000;
			Karma = -5000;

			switch (Utility.Random( 6 ))
			{
				case 0: res = CraftResource.BlackScales; break;
				case 1: res = CraftResource.RedScales; break;
				case 2: res = CraftResource.BlueScales; break;
				case 3: res = CraftResource.YellowScales; break;
				case 4: res = CraftResource.GreenScales; break;
				case 5: res = CraftResource.WhiteScales; break;
			}

			BaseWeapon melee = new Kryss();

			switch (Utility.Random( 3 ))
			{
				case 0: melee = new Kryss(); break;
				case 1: melee = new Broadsword(); break;
			      	case 2: melee = new Katana(); break;

                  	}

			DragonHelm helm = new DragonHelm();
			helm.Resource = res;
			helm.Movable = false;
			AddItem( helm );

			DragonChest chest = new DragonChest();
			chest.Resource = res;
			chest.Movable = false;
			AddItem( chest );

			DragonArms arms = new DragonArms();
			arms.Resource = res;
			arms.Movable = false;
			AddItem( arms );

			DragonGloves gloves = new DragonGloves();
			gloves.Resource = res;
			gloves.Movable = false;
			AddItem( gloves );

			DragonLegs legs = new DragonLegs();
			legs.Resource = res;
			legs.Movable = false;
			AddItem( legs );

			melee.Movable = false;
			AddItem( melee );

			ChaosShield shield = new ChaosShield();
			shield.Movable = false;
			AddItem( shield );

			AddItem( new Shirt() );
			AddItem( new Boots() );

			int amount = Utility.RandomMinMax( 1, 3 );

			switch ( res )
			{
				case CraftResource.BlackScales: AddItem( new BlackScales( amount ) ); break;
				case CraftResource.RedScales: AddItem( new RedScales( amount ) ); break;
				case CraftResource.BlueScales: AddItem( new BlueScales( amount ) ); break;
				case CraftResource.YellowScales: AddItem( new YellowScales( amount ) ); break;
				case CraftResource.GreenScales: AddItem( new GreenScales( amount ) ); break;
				case CraftResource.WhiteScales: AddItem( new WhiteScales( amount ) ); break;
			}

			new SwampDragon().Rider = this;
		}

		public override int GetIdleSound()
		{
			return 0x2CE;
		}

		public override int GetDeathSound()
		{
			return 0x2CC;
		}

		public override int GetHurtSound()
		{
			return 0x2D1;
		}

		public override int GetAttackSound()
		{
			return 0x2C8;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.Rich );
		}

		public override bool HasBreath{ get{ return true; } }
		public override bool AutoDispel{ get{ return true; } }
		public override bool BardImmune{ get{ return !Core.AOS; } }
		public override bool CanRummageCorpses{ get{ return true; } }
		public override bool AlwaysMurderer{ get{ return true; } }
		public override bool ShowFameTitle{ get{ return false; } }

		public override bool OnBeforeDeath()
		{
			IMount mount = this.Mount;

			if ( mount != null )
				mount.Rider = null;

			return base.OnBeforeDeath();
		}

		public override void AlterMeleeDamageTo( Mobile to, ref int damage )
		{
			if ( to is Dragon || to is WhiteWyrm || to is SwampDragon || to is Drake || to is Nightmare || to is Hiryu || to is LesserHiryu || to is Daemon )
				damage *= 3;
		}

		public ChaosDragoon( 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();
		}
	}
}
 

psz

Administrator
Re: Chaos Dragoon & Elite (Needs minor code fix)

ChaosDragoonElite.cs

See Nikki's post. It fixes the OnDeath issue.
 

psz

Administrator
Re: Chaos Dragoon & Elite (Needs minor code fix)

Patch for Bola.cs (since Dragoons aren't bola-able)

Code:
Index: Bola.cs
===================================================================
--- Bola.cs	(revision 321)
+++ Bola.cs	(working copy)
@@ -83,14 +83,16 @@
 				new Bola().MoveToWorld( to.Location, to.Map );
 
 			to.Damage( 1, from );
+                  
+                  if ( to is ChaosDragoon || to is ChaosDragoonElite )
+				from.SendLocalizedMessage( 1042047 ); // You fail to knock the rider from its mount.
 
 			IMount mt = to.Mount;
-
-			if ( mt != null )
+			if ( mt != null && !( to is ChaosDragoon || to is ChaosDragoonElite ) )
 				mt.Rider = null;
+			
+                  to.SendLocalizedMessage( 1040023 ); // You have been knocked off of your mount!
 
-			to.SendLocalizedMessage( 1040023 ); // You have been knocked off of your mount!
-
 			BaseMount.SetMountPrevention( to, BlockMountType.Dazed, TimeSpan.FromSeconds( 3.0 ) );
 
 			Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( ReleaseBolaLock ), from );
@@ -179,6 +181,8 @@
 		{
 		}
 
+		
+
 		public override void Serialize( GenericWriter writer )
 		{
 			base.Serialize( writer );
 

psz

Administrator
Re: Chaos Dragoon & Elite (Needs minor code fix)

Patch for Dismount.cs (Since you cannot dismount Dragoons)
Code:
Index: Dismount.cs
===================================================================
--- Dismount.cs	(revision 321)
+++ Dismount.cs	(working copy)
@@ -39,7 +39,10 @@
 			if ( !Validate( attacker ) )
 				return;
 
-			if ( attacker.Mounted && !(defender.Weapon is Lance) ) // TODO: Should there be a message here?
+                  if (defender is ChaosDragoon || defender is ChaosDragoonElite ) return;
+
+                  
+                  if ( attacker.Mounted && !(defender.Weapon is Lance) ) // TODO: Should there be a message here?
 				return;
 
 			ClearCurrentAbility( attacker );
 

Nikki_Demise

Bug Hunter
Re: Chaos Dragoon & Elite (Needs minor code fix)

Still need to handle armor if it's dismounted but this works for when it dies.

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

namespace Server.Mobiles
{
    [CorpseName( "a chaos dragoon elite corpse" )]
    public class ChaosDragoonElite : BaseCreature
    {
        public CraftResource res;
        [Constructable]
        public ChaosDragoonElite() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.15, 0.4 )
        {
            Name = "a chaos dragoon elite";
            Body = 0x190;
            Hue = Utility.RandomSkinHue();
            
            SetStr( 276, 350 );
            SetDex( 66, 90 );
            SetInt( 126, 150 );

            SetHits( 276, 350 );

            SetDamage( 29, 34 );

            SetDamageType( ResistanceType.Physical, 100 );
            
            /*SetResistance( ResistanceType.Physical, 45, 55 );
            SetResistance( ResistanceType.Fire, 15, 25 );
            SetResistance( ResistanceType.Cold, 50 );
            SetResistance( ResistanceType.Poison, 25, 35 );
            SetResistance( ResistanceType.Energy, 25, 35 );*/


            SetSkill( SkillName.Tactics, 80.1, 100.0 );
            SetSkill( SkillName.MagicResist, 100.1, 110.0 );
            SetSkill( SkillName.Anatomy, 80.1, 100.0 );
            SetSkill( SkillName.Magery, 85.1, 100.0 );
            SetSkill( SkillName.EvalInt, 85.1, 100.0 );
            SetSkill( SkillName.Swords, 72.5, 95.0 );
            SetSkill( SkillName.Fencing, 85.1, 100 );
            SetSkill( SkillName.Macing, 85.1, 100 );

            Fame = 8000;
            Karma = -8000;

            switch ( Utility.Random( 6 ) )
            {
                case 0: res = CraftResource.BlackScales; break;
                case 1: res = CraftResource.RedScales; break;
                case 2: res = CraftResource.BlueScales; break;
                case 3: res = CraftResource.YellowScales; break;
                case 4: res = CraftResource.GreenScales; break;
                case 5: res = CraftResource.WhiteScales; break;
            }
                  
            BaseWeapon melee = new Kryss();

            switch (Utility.Random( 3 ))
            {
                case 0: melee = new Kryss(); break;
                case 1: melee = new Broadsword(); break;
                      case 2: melee = new Katana(); break;
            }

            DragonChest Tunic = new DragonChest();
            Tunic.Resource = res;
            Tunic.Movable = false;
            AddItem( Tunic );
            
            DragonLegs Legs = new DragonLegs();
            Legs.Resource = res;
            Legs.Movable = false;
            AddItem( Legs );
            
            DragonArms Arms = new DragonArms();
            Arms.Resource = res;
            Arms.Movable = false;
            AddItem( Arms );
            
            DragonGloves Gloves = new DragonGloves();
            Gloves.Resource = res;
            Gloves.Movable = false;
            AddItem( Gloves );
            
            DragonHelm Helm = new DragonHelm();
            Helm.Resource = res;
            Helm.Movable = false;
            AddItem( Helm );
                              
            melee.Movable = false;
            AddItem( melee );

            ChaosShield shield = new ChaosShield();
            shield.Movable = false;
            AddItem( shield );
            
            AddItem( new Boots( 0x455 ) );
            AddItem( new Shirt( Utility.RandomMetalHue() ) );
            
            int amount = Utility.RandomMinMax( 1, 3 );

            switch ( res )
            {
                case CraftResource.BlackScales: AddItem( new BlackScales( amount ) ); break;
                case CraftResource.RedScales: AddItem( new RedScales( amount ) ); break;
                case CraftResource.BlueScales: AddItem( new BlueScales( amount ) ); break;
                case CraftResource.YellowScales: AddItem( new YellowScales( amount ) ); break;
                case CraftResource.GreenScales: AddItem( new GreenScales( amount ) ); break;
                case CraftResource.WhiteScales: AddItem( new WhiteScales( amount ) ); break;
            }
            switch (Utility.Random( 9 ))
            {
                case 0: res = CraftResource.DullCopper; break;
                case 1: res = CraftResource.ShadowIron; break;
                case 2: res = CraftResource.Copper; break;
                case 3: res = CraftResource.Bronze; break;
                case 4: res = CraftResource.Gold; break;
                case 5: res = CraftResource.Agapite; break;
                case 6: res = CraftResource.Verite; break;
                case 7: res = CraftResource.Valorite; break;
                case 8: res = CraftResource.Iron; break;
            }

                    SwampDragon mt = new SwampDragon();
            mt.HasBarding = true;
            mt.BardingResource = res;
            mt.BardingHP = mt.BardingMaxHP;
            mt.Rider = this;

        }

        public override int GetIdleSound()
        {
            return 0x2CE;
        }

        public override int GetDeathSound()
        {
            return 0x2CC;
        }

        public override int GetHurtSound()
        {
            return 0x2D1;
        }

        public override int GetAttackSound()
        {
            return 0x2C8;
        }

        public override void GenerateLoot()
        {
            AddLoot( LootPack.Rich );
            AddLoot( LootPack.Gems );    
        }

        public override bool HasBreath{ get{ return true; } }
        public override bool AutoDispel{ get{ return true; } }
        public override bool BardImmune{ get{ return !Core.AOS; } }
        public override bool CanRummageCorpses{ get{ return true; } }
        public override bool AlwaysMurderer{ get{ return true; } }
        public override bool ShowFameTitle{ get{ return false; } }

        public override bool OnBeforeDeath()
        {
            IMount mount = this.Mount;

            if ( mount != null )
            {
                mount.Rider = null;
                if( mount is SwampDragon )
                    ((SwampDragon)mount).HasBarding = false;
            }

            return base.OnBeforeDeath();
        }

        public override void AlterMeleeDamageTo( Mobile to, ref int damage )
        {
            if ( to is Dragon || to is WhiteWyrm || to is SwampDragon || to is Drake || to is Nightmare || to is Hiryu || to is 

LesserHiryu || to is Daemon )
                damage *= 3;
        }

        public ChaosDragoonElite( 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();
        }
    }
}
 

psz

Administrator
Re: [Ready] Chaos Dragoon & Elite (Needs minor code fix)

Since it cannot be dismounted or bola'd, that's not an issue.


This is ready for implementation.
 

uome

Bug Hunter
Re: [Ready] Chaos Dragoon & Elite

i've just been trying these out and about 1 in 10 seem almost imune to physical damage. (can only hit for 1hp per hit.)
I placed a spawner to be sure and it still happened.

Very odd :confused:
 

psz

Administrator
Re: [Ready] Chaos Dragoon & Elite

Well that makes absolutely no sense. You can see in the scripts that the PhysResist is 45-55...
 

psz

Administrator
Re: [Ready] Chaos Dragoon & Elite

That's the only thing I can think of... now the question is, how does OSI handle it?

Are the resists listed on OSI listed AFTER the armor is taken into consideration?

Do the resists on OSI occasional get ridiculously high due to armor?

Will the sunrise in the west tomorow??
 

psz

Administrator
Re: [Almost Ready] Chaos Dragoon & Elite

Ok, the numbers are right. So now it's a matter of figuring them out to take the armor into consideration.

Think I got it.


Got it: Just remove the pre-set resists. Let the armor do all the work.

Tested on OSI and my personal server, and got nearly exact (IE: Off by 1-2 MAX comapred to OSI) damage consistently.
 
Status
Not open for further replies.
Top