Cad

Member
Ultima Expansion
Renaissance
Hello,
Today I've been trying to create a new monster that has certain items equipped which I've done before, but for some reason, I keep getting errors...
I know this is a simple fix but I'm just not understanding why. I would also like to make the items equipped; only be equipped and not lootable. Below is the line of code.
Thank you in advance.

Error:
CS0246: Line 45: The type or namespace name 'Bandage' could not be found (are you missing a using directive or an assembly reference?)
CS0246: Line 47: The type or namespace name 'PlateGloves' could not be found (are you missing a using directive or an assembly reference?)
CS0246: Line 48: The type or namespace name 'LongSword' could not be found (are you missing a using directive or an assembly reference?)
CS0246: Line 49: The type or namespace name 'DeathShroud' could not be found (are you missing a using directive or an assembly reference?)


C#:
using System;
using System.Collections.Generic;
using Server.ContextMenus;

namespace Server.Mobiles
{
    [CorpseName("a ghostly corpse")]
    public class FallenRider : BaseCreature
    {
        [Constructable]
        public FallenRider()
            : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8)
        {
            this.Name = "fallen rider";
            this.Body = 0x190;
            this.Hue = 0x497;

            this.SetStr(986, 1185);
            this.SetDex(177, 255);
            this.SetInt(151, 250);

            this.SetHits(592, 711);

            this.SetDamage(22, 29);

            this.SetDamageType(ResistanceType.Physical, 100);

            this.SetResistance(ResistanceType.Physical, 50);
            this.SetResistance(ResistanceType.Fire, 25);
            this.SetResistance(ResistanceType.Cold, 50, 60);
            this.SetResistance(ResistanceType.Poison, 100);
            this.SetResistance(ResistanceType.Energy, 40, 50);

            this.SetSkill(SkillName.MagicResist, 100.5, 150.0);
            this.SetSkill(SkillName.Swords, 120.0);
            this.SetSkill(SkillName.Tactics, 120.0);
            this.SetSkill(SkillName.Anatomy, 120.0);
            this.SetSkill(SkillName.Lumberjacking, 120.0);

            this.Fame = 24000;
            this.Karma = -24000;

            this.VirtualArmor = 90;

            this.PackItem(new Bandage(Utility.RandomMinMax(1, 25)));

            this.AddItem(new PlateGloves());
            this.AddItem(new LongSword());
            this.AddItem(new DeathShroud());
 
Ah, add this to the top:
using Server.Items;

So it looks like this;
C#:
using System;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Items;

That should fix the problem.
Basically you are trying to add items, without telling the script where or what the items are. ;) :)
 
  • Like
Reactions: Cad
Thank you for the help on that issue, I do have another question lol. Is it possible to change the corpse ID whenever the monster dies ex: restless soul corpse; and how do I make what it's wearing not show up in its loot.
[CorpseName("a ghostly corpse")] <--- Just rename this to whatever you like "corpse of a ghost", "a non-corporeal body" ;)
If the items the mob is to be wearing are in the script, you can add them and prevent them from being loot like so:
C#:
this.AddItem(new LongSword());
LongSword.Movable = false;

That will prevent the LongSword from "falling" into the mob's corpse when they die. :)
 
  • Like
Reactions: Cad
Thanks, I actually just figured out the weapon part of it, but I can't seem to get the shroud to stay showing on the body (which I figured is because I'm using the hooded shroud of shadows, and it's blessed by default.) When I was using the body value of the restless soul, the nightmare it was riding wouldn't show, but the corpse was exactly how I wanted it to look.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back