Jezika

Member
Ok, I have a script for a powerful boss type dragon. it is a variation of another script i found on the boards. its been tweaked and rearranged to suit the needs of my playerbase (ie. my family). I searched on Voxpires website to see how to do it but i am not exactly sure as to where i would place the new info and if it would be correct.

What I would like it to do is an area dmg effect like an aura or even when the dragon uses a magic attack it could trigger. on the H.S. exp, Charybdiss is being used to show how his special fx package can cause dmg using a water wave from how i am reading it, the wave is an attack. id like to do similar but have been unable to with my old set up (which is now long gone) but with fire, energy or poison. which are attacks on the special dragons.

I have attached a copy of 1 of the dragons, if you need the loot page or the other 2 dragons as well, i can provide them. again I am not the original scripter for the dragons but I have altered them to suit our needs.

Here is a copy of what Vorpsire stated on his forum which is making me think I should be able to create what i am looking to do. if not possible thats ok as well.

[quote author=Voxpire link=topic=35.msg83#msg83 date=1384758811]
No, he's part of High Seas, the video was taken on Pandora to demonstrate how the effects can be used, you can do it by using the WaterWaveEffect and giving it an EffectHandler that handles each point the effect processes, to find and damage mobiles, boats, etc.

Something like this, for example:
Code:
new WaterWaveEffect( source, map, direction, range,
  effectHandler: e =>
  {
  e.Source.GetMobilesInRange( e.Map, 0 ).ForEach( m => m.Damage( 100 ) );
  }
).Send();
[/quote]

I know the stats on the dragon. this is not for a normal dungeon and he waits in a guarded dungeon with ample warnings. btw, hes fun to kill :D
 

Attachments

  • Merceron.cs
    16.4 KB · Views: 34
Last edited:
This can be done very easily with XMLSpawner, but if you'd like to have it in the script consider this code that Peoharen wrote for The Six:
Code:
        public static void FlameWave(Mobile from)
        {
            if (!CanUse(from))
                return;

            from.Say("*Vas Grav Consume !*");

            new FlameWaveTimer(from).Start();
        }

        internal class FlameWaveTimer : Timer
        {
            private Mobile m_From;
            private Point3D m_StartingLocation;
            private Map m_Map;
            private int m_Count;
            private Point3D m_Point;

            public FlameWaveTimer(Mobile from)
                : base(TimeSpan.FromMilliseconds(300.0), TimeSpan.FromMilliseconds(300.0))
            {
                m_From = from;
                m_StartingLocation = from.Location;
                m_Map = from.Map;
                m_Count = 0;
                m_Point = new Point3D();
                SetupDamage(from);
            }

            protected override void OnTick()
            {
                if (m_From == null || m_From.Deleted)
                {
                    Stop();
                    return;
                }  

                double dist = 0.0;

                for (int i = -m_Count; i < m_Count + 1; i++)
                {
                    for (int j = -m_Count; j < m_Count + 1; j++)
                    {
                        m_Point.X = m_StartingLocation.X + i;
                        m_Point.Y = m_StartingLocation.Y + j;
                        m_Point.Z = m_Map.GetAverageZ(m_Point.X, m_Point.Y);
                        dist = GetDist(m_StartingLocation, m_Point);
                        if (dist < ((double)m_Count + 0.1) && dist > ((double)m_Count - 3.1))
                        {
                            Effects.SendLocationParticles(EffectItem.Create(m_Point, m_Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                        }
                    }
                }

                m_Count += 3;

                if (m_Count > 15)
                    Stop();
            }

            private void SetupDamage(Mobile from)
            {
                foreach (Mobile m in from.GetMobilesInRange(10))
                {
                    if (CanTarget(from, m, true, false, false))
                    {
                        Timer.DelayCall(TimeSpan.FromMilliseconds(300 * (GetDist(m_StartingLocation, m.Location) / 3)), new TimerStateCallback(Hurt), m);
                    }
                }
            }

            public void Hurt(object o)
            {
                Mobile m = o as Mobile;

                if (m_From == null || m == null || m.Deleted)
                    return;

                int damage = m_From.Hits / 4;

                if (damage > 200)
                    damage = 400;  

                AOS.Damage(m, m_From, damage, 0, 100, 0, 0, 0);
                m.SendMessage("You are being burnt alive by the seering heat!");
            }
            private double GetDist(Point3D start, Point3D end)
            {
                int xdiff = start.X - end.X;
                int ydiff = start.Y - end.Y;
                return Math.Sqrt((xdiff * xdiff) + (ydiff * ydiff));
            }
        }
That is the defined method for the effect with damage. Calling it is as easy as adding:
Code:
		public override void OnActionCombat()
		{
			if ( DateTime.Now > m_Delay )
			{
				if ( Utility.Random( 12 ) <= 8  )
				{
					Ability.FlameWave( this );
					m_Delay = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 30, 45 ) );
				}

			}			

			base.OnActionCombat();
		}
Add the above code to the main constructable for the mob and you're ready to go.
 
I used the above code in a script im working on for a spell but I cant seem to figure out how to change the hue of the flames. I tried this and it didn't seem to effect anything:

Effects.SendLocationParticles(EffectItem.Create(m_Point, m_Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052, 1154);

I also tried:

Effects.SendLocationParticles(EffectItem.Create(m_Point, m_Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 1154);

I know that the 0x3709 is the itemid for the effect it self, and im assuming the 10 is the duration, but what is the 30 and the 5052?
 
If I remember correctly your code is explained like this:
Effects.SendLocationParticles(EffectItem.Create(m_Point, m_Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052, 1154);

0x3709 (AnimID)
10 (Duration)
30(Tile Area around target)
5052 (SoundID)
1154 (Hue of the effect)

That's pretty close anyway. If you have the Ultimate Hider ball for staff, you can use that to see the effects, sounds and duration.
 
I had Ultimate hider at one time but I couldn't remember what it was called to find it again lol. Putting that 1154 on the end of the code like that didn't change the hue like I thought it would though.
 
I had Ultimate hider at one time but I couldn't remember what it was called to find it again lol. Putting that 1154 on the end of the code like that didn't change the hue like I thought it would though.

Yeah, you can't just stick it in anywhere. You have to look at how the effect you're using is defined and have each attribute in the right place. If you look in your Server folder, you'll find the Effects.cs. Open that file and look at how each SendParticles method is defined. Here's an example:
Code:
public static void SendLocationParticles( IEntity e, int itemID, int speed, int duration, int hue, int renderMode, int effect, int unknown )
Basically skip to the itemID, then Speed, Duration, Hue, renderMode, effect and unknown. What's important is to use the right SendParticles method for your effect. If you don't known what the unknown is, just use a 0. In most cases a 0 there is fine.
Code:
public static void SendLocationParticles( IEntity e, int itemID, int speed, int duration, int effect )
See this SendParticles doesn't have everything the one above it does. Since Hue isn't listed, you can't add it in any old spot. You have to pick one that lists hue and set it up exactly as the base method says.
 
lol this harder then I thought it would be for a simple hue change. I was looking at the sleep field spell how it changes the hue of the standard fire field, but that uses a internal item in a much different method then the flamewave.

By the way where is that flamewave scrpt located in the folders? I tried searching for flamewave.cs and couldnt find it.
 
lol this harder then I thought it would be for a simple hue change. I was looking at the sleep field spell how it changes the hue of the standard fire field, but that uses a internal item in a much different method then the flamewave.

By the way where is that flamewave scrpt located in the folders? I tried searching for flamewave.cs and couldnt find it.

The flamewave was part of the code Peoharen wrote for The Six and the Stygian Dragon. I believe in most current server releases its called "Ability The Six.cs". If you have Agent Ransack you can find it quickly.

Not all effect spells are written the same way. The ones that use an internal item are a pain to deal with. You're almost better off using someone else's custom sleep spell, like from Lucid Nagal's ACC spells, and changing that the way you want it. But even then, some spells just HAVE to use an internal item.
 
Ah that explains why I couldnt find it.

I actually have a good allspells system I been with that project from the beginning and actually created the ranger spells under my RunUO username MetallicSomber. There kinda primitive now looking back on them lol. Im out of practice now and get stumped with the simplest stupid things sometimes now. I just cant seem to find a good moving particles effect that can change hue colors.
 
Best way to do it is with the Ultimate Hider. I've no idea if this is even going to work with the current RunUO/ServUO releases, but here it is. I've no clue who originally scripted it, but I haven't made any changes to it.
 

Attachments

  • UltimateHider.cs
    12.4 KB · Views: 60
Hey that worked! (ultimate hider compiled too im in shock considering how old it is!) thanks on both accounts!

Effects.SendLocationParticles( EffectItem.Create( m_Point, m_Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 1154, 0, 0, 0 );
It ended up being dark green but thats cause of hue offset I take it easy fix.
 
Here is something you might find usefull..

This is a system that allows you to add a bunch of special features to mobiles without a great deal of work..

Drop basespecialcreature.cs into your custom files..

Then to add special abilities to mobiles you need to do a few minor edits to there scripts..

Code:
public class Dragon : [color=green]BaseSpecialCreature[/color]

Code:
[color=green]public override bool DoesMultiFirebreathing { get { return true; } }[/color]

Code:
[color=green]public override double MultiFirebreathingChance { get { return 0.4; } }[/color]

Code:
[color=green]public override int BreathDamagePercent { get { return 80; } }[/color]

Code:
[color=green]public override int BreathMaxTargets { get { return 5; } }[/color]

Code:
[color=green]public override int BreathMaxRange { get { return 5; } }[/color]

Example

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

Attachments

  • BaseSpecialCreature.cs
    18.9 KB · Views: 40
Omni this would be nice to have in Custom Releases also :) (UO Archive)
Edit: Scratch that I see you just posted this thanks!
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back