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 first Custom Monster

peepeetree

Sorceror
Hey Everyone,
I am trying to create my first custom monster, I wanted to start with something simple so I grabbed the dragon.cs script and decided to simply edit the dragon into a customer monster. The problem I am having is when I change only the name of the thing I am getting error messages and I can't figure out what I am doing wrong. I realize it is probably a stupid mistake that I don't understand because I am very new at creating my own monsters but if you could provide me with some guidance I would really appreciate it!

Error Message
Code:
RunUO - [www.runuo.com] Version 2.1, Build 4272.35047
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 6 64-bit processors
Scripts: Compiling C# scripts...ScriptCompiler: CS1525: Invalid expression term
'else'
ScriptCompiler: CS1002: ; expected
done (0 errors, 0 warnings)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Edited Dragon
Code:
using System;
using Server;
using Server.Items;
 
namespace Server.Mobiles
{
    [CorpseName( "an Acrid Dragon corpse" )]
    public class AcridDragon : BaseCreature
    {
        [Constructable]
        public AcridDragon() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            Name = "Acrid 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 AcridDragon(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();
        }
    }
}
 

peepeetree

Sorceror
This just randomly started working today, I loaded up my server, was showing it off to some friends and started throwing down new monsters I have included. I realized my dragon was in there and was working just fine, so no clue. Only problem now is the damn thing hits for 470 damage with its breath, not quite sure how to modify the dragons breath damage.
 

Soteric

Knight
It seems breath damage depends on creature hit points. BaseCreature:
Code:
public virtual int BreathComputeDamage()
{
	int damage = (int)(Hits * BreathDamageScalar);
This method is virtual so you can override it in your custom dragon class and provide your custom function to compute breath damage. Or you can override BreathDamageScalar property. Currently it is
Code:
// Base damage given is: CurrentHitPoints * BreathDamageScalar
public virtual double BreathDamageScalar{ get{ return (Core.AOS ? 0.16 : 0.05); } }
 
Top