RunUO 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!

Help with a new mobile please.

bazspeed

Sorceror
I am not sure if my last post was removed or I just didnt complete the post.

If it was removed, can you let me know why please. I do not wish to break any forum rules.

Ok, heres the problem.

I am creating a new dragon. I am after the dragon to spawn skeletons during the fight and then a massive spawn on death.

Below is the script for the spawn while fighting. I used the Bog Thing script for boglings and removed the part where it eats them.
Code:
public void SpawnDragonsTeethArmy( Mobile m )
        {
            Map map = this.Map;
 
            if ( map == null )
                return;
 
            DragonsTeethArmy spawned = new DragonsTeethArmy();
 
            spawned.Team = this.Team;
 
            bool validLocation = false;
            Point3D loc = this.Location;
 
            for ( int j = 0; !validLocation && j < 20; ++j )
            {
                int x = X + Utility.Random( 3 ) - 1;
                int y = Y + Utility.Random( 3 ) - 1;
                int z = map.GetAverageZ( x, y );
 
                if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
                    loc = new Point3D( x, y, Z );
                else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                    loc = new Point3D( x, y, z );
            }
 
            spawned.MoveToWorld( loc, map );
            spawned.Combatant = m;
        }
 
        public void EatDragonsTeethArmys()
        {
            ArrayList toEat = new ArrayList();
 
            foreach ( Mobile m in this.GetMobilesInRange( 2 ) )
            {
                if ( m is DragonsTeethArmy )
                    toEat.Add( m );
            }
 
            if ( toEat.Count > 0 )
            {
                PlaySound( Utility.Random( 0x3B, 2 ) ); // Eat sound
 
                foreach ( Mobile m in toEat )
                {
                    Hits += (m.Hits / 2);
                    m.Delete();
                }
            }
        }
 
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
 
if ( this.Hits > (this.HitsMax / 4) )
{
if ( 0.25 >= Utility.RandomDouble() )
SpawnDragonsTeethArmy( attacker );
}
else if ( 0.25 >= Utility.RandomDouble() )
{
//EatDragonsTeethArmys();
}
}

I would like a faster spawn if possible.

Next I have the OnDeath spawn. Thnx to Hammerhead he helped with creating a single creature on death. I would like a massive death spawn of around 20.

Code:
public override bool OnBeforeDeath()
        {
            this.Say("The Dragons Teeth fall to the floor and spawns an army");
            DragonsTeethArmy rm = new DragonsTeethArmy();
           
            rm.Team = this.Team;
            rm.Combatant = this.Combatant;
            rm.NoKillAwards = true;
 
            if (rm.Backpack == null)
            {
                Backpack pack = new Backpack();
                pack.Movable = false;
                rm.AddItem(pack);
            }
 
            for (int i = 0; i < 2; i++)
            {
                LootPack.FilthyRich.Generate(this, rm.Backpack, true, LootPack.GetLuckChanceForKiller(this));
                LootPack.FilthyRich.Generate(this, rm.Backpack, false, LootPack.GetLuckChanceForKiller(this));
            }
 
            Effects.PlaySound(this, Map, GetDeathSound());
            Effects.SendLocationEffect(Location, Map, 0x3709, 30, 10, 0x835, 0);
            rm.MoveToWorld(Location, Map);
           
            return base.OnBeforeDeath();
        }

So... if anyone can help out with this I would be very much appreciated and you will get thnked in the script when completed.
 

john burns

Sorceror
This sounds very interesting to me, I will be watching the results.

Sorry that I can't help, as coding still eludes me beyond setting hue, itemid, and movable.
 
Top