ServUO Version
Publish 57
Ultima Expansion
Endless Journey
I want to have an NPC appear as a dead player and communicate the phrase "Help Me". Players without Spiritspeak will see the normal oooOOOOoo but players with Spiritspeak will see the actual phrase.

I used ChatGPT and tried a number of different way to get it to create the script, but it keeps failing. I think this version is the closest yet, but it will not compile.

Spritspeaking NPC:
using System;
using Server;
using Server.Mobiles;
using Server.Spells.Necromancy;

namespace Server.Mobiles
{
    public class SpiritSpeakHumanNPC : BaseCreature
    {
        [Constructable]
        public SpiritSpeakHumanNPC() : base(AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4)
        {
            Name = "Spirit Speaker";
            Body = 0x190; // Human Male body
            Hue = Utility.RandomSkinHue();

            // Set basic attributes
            SetStr(100);
            SetDex(100);
            SetInt(100);

            SetHits(200);

            VirtualArmor = 10;

            // Timer to speak
            Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(30.0), SpeakSpirit);
        }

        // Method to make the NPC say "Help me" in Spirit Speak
        private void SpeakSpirit()
        {
            // Use the Spirit Speak conversion method
            Say(NecroSpeech("Help me"));
        }

        // NecroSpeech method to convert normal speech to Spirit Speak
        private string NecroSpeech(string message)
        {
            return NecromancyTransformationSpell.SpiritsSpeak(message);
        }

        // Default loot generator
        public override void GenerateLoot()
        {
            AddLoot(LootPack.Poor);
        }

        // Serialization and deserialization
        public SpiritSpeakHumanNPC(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }
}
 
Errors:
+ Custom/Wraith.cs:
CS0103: Line 40: The name 'NecromancyTransformationSpell' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
 
Back