Massapequa

Member
Massapequa submitted a new resource:

Custom Abilities for your monsters - Make your monsters more deadly

This is an attempt to make fun and cool custom abilities that are (relatively) easy for others to implement into their server. There are 16 abilities in total and many of these abilities have modifiers that allow you to change how they look for each mob that uses it.
Abilities Like, Famestrike targeted, flamestrike aoe, firebolt and geyser have elemental customization oprions which are: Fire, Ice, Poison, Energy, Water, Steam, Necrotic, or Holy. Each option changes the color...

Read more about this resource...
 
Hello!These abilities looks amazing and customizables,just fix needed cause u forgot to add life drain and colossal blow in SpecialAbilitie,these attacks arent here.
 
Hello!These abilities looks amazing and customizables,just fix needed cause u forgot to add life drain and colossal blow in SpecialAbilitie,these attacks arent here.
Hey! So those two abilities are not mine.
Anything that's a 'Special Ability' is something that came with my version of the server. You must be using something different. The ones in this package are the 16 'Custom Abilities'. Just delete those two if your server didn't come with them.
 
bro if this works i will be hella excited to test it out. did you script this up yourself?

Doesn't compile in the latest servuo :/
 
Last edited:
bro if this works i will be hella excited to test it out. did you script this up yourself?

Doesn't compile in the latest servuo :/
Hey, yeah I made it myself. I wrote it using version 57.1. What errors are you getting? Maybe I can help get it working
 
Ok I'm going to post the errors... Just didn't wanna be a big nuisance in this thread.
C#:
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\OphidianFireMage.cs(92,25): error CS0246: The type or namespace name 'OppositionGroup' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\OphidianFireMage.cs(92,41): error CS0115: 'OphidianFireMage.OppositionGroup': no suitable method found to override [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\TerathanAmbusher.cs(69,25): error CS0246: The type or namespace name 'OppositionGroup' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\TerathanAmbusher.cs(69,41): error CS0115: 'TerathanAmbusher.OppositionGroup': no suitable method found to override [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
if i try to fix this i know i will be mad and it still wont work lol
 
Last edited:
Ok I'm going to post the errors... Just didn't wanna be a big nuisance in this thread.
C#:
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\OphidianFireMage.cs(92,25): error CS0246: The type or namespace name 'OppositionGroup' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\OphidianFireMage.cs(92,41): error CS0115: 'OphidianFireMage.OppositionGroup': no suitable method found to override [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\TerathanAmbusher.cs(69,25): error CS0246: The type or namespace name 'OppositionGroup' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\CUSTOM\Custom Abilities\Mobiles\TerathanAmbusher.cs(69,41): error CS0115: 'TerathanAmbusher.OppositionGroup': no suitable method found to override [C:\Users\Adam\Desktop\LATEST SERVUO\Scripts\Scripts.csproj]
if i try to fix this i know i will be mad and it still wont work lol
So it just looks like all the errors are related to opposition groups, which I guess isn't used by the newest version.
It should be fixed by just deleting the code in the files for those creatures
It should look like this:

Code:
        public override OppositionGroup OppositionGroup
        {
            get
            {
                return OppositionGroup.TerathansAndOphidians;
            }
        }
Just search for that and delete it.
opposition groups aren't super important to the code anyway.
 
Last edited:
Trying to get this to work on publish 54 and got these errors:
Errors:
+ Abilities/Custom Abilities/CustomAbility.cs:
CS0103: Line 334: The name 'AnimationType' does not exist in the current context
CS0103: Line 531: The name 'AnimationType' does not exist in the current context
CS0103: Line 658: The name 'AnimationType' does not exist in the current context
CS0103: Line 947: The name 'AnimationType' does not exist in the current context
CS0103: Line 1033: The name 'AnimationType' does not exist in the current context
CS0103: Line 1125: The name 'AnimationType' does not exist in the current context
CS0103: Line 1213: The name 'AnimationType' does not exist in the current context
CS0103: Line 1276: The name 'AnimationType' does not exist in the current context
CS1501: Line 1298: No overload for method 'SendBoltEffect' takes 4 arguments
CS0103: Line 1376: The name 'AnimationType' does not exist in the current context
CS0103: Line 1448: The name 'AnimationType' does not exist in the current context
CS0103: Line 1536: The name 'AnimationType' does not exist in the current context
CS0103: Line 1728: The name 'AnimationType' does not exist in the current context
CS0103: Line 1852: The name 'AnimationType' does not exist in the current context
CS0117: Line 1952: 'Server.Spells.SkillMasteries.ResilienceSpell' does not contain a definition for 'UnderEffects'
Scripts: One or more scripts failed to compile or no script files were found.
 
Trying to get this to work on publish 54 and got these errors:
Errors:
+ Abilities/Custom Abilities/CustomAbility.cs:
CS0103: Line 334: The name 'AnimationType' does not exist in the current context
CS0103: Line 531: The name 'AnimationType' does not exist in the current context
CS0103: Line 658: The name 'AnimationType' does not exist in the current context
CS0103: Line 947: The name 'AnimationType' does not exist in the current context
CS0103: Line 1033: The name 'AnimationType' does not exist in the current context
CS0103: Line 1125: The name 'AnimationType' does not exist in the current context
CS0103: Line 1213: The name 'AnimationType' does not exist in the current context
CS0103: Line 1276: The name 'AnimationType' does not exist in the current context
CS1501: Line 1298: No overload for method 'SendBoltEffect' takes 4 arguments
CS0103: Line 1376: The name 'AnimationType' does not exist in the current context
CS0103: Line 1448: The name 'AnimationType' does not exist in the current context
CS0103: Line 1536: The name 'AnimationType' does not exist in the current context
CS0103: Line 1728: The name 'AnimationType' does not exist in the current context
CS0103: Line 1852: The name 'AnimationType' does not exist in the current context
CS0117: Line 1952: 'Server.Spells.SkillMasteries.ResilienceSpell' does not contain a definition for 'UnderEffects'
Scripts: One or more scripts failed to compile or no script files were found.
Hey, I don't know how how much I can provide help with publish 54, but luckily, all errors involving AnimationType are purely aesthetic. i.e, falling down animation or casting animation when using abilities. This means that simply commenting those lines out won't effect the functionality of any abilities.
As for the bolt effect on line 1298, you can find the bolt effect used in your version of the lighting bolt spell and replace it with that.
Finally, for line 1952, change it to:
Code:
 m_MaxCount = 3;
This should work for you,
Hope this helps and happy holidays :)
 
Hi is there a way to change the FlameStrikeAoe skill to Targeting like FlameStrikeTargeted?

Hey, I noticed this was asked a little while ago; sorry for the delay.
So I'm assuming you mean you want the AOE to appear around the player/defending creature and not the caster?

find these lines in the FlameStrikeAoe section of the code:
Code:
        for (int i = 0; i < m_Range; i++)
        {
                    Misc.Geometry.Circle2D(creature.Location, creature.Map, i, (pnt, map) =>
                    {
                        Effects.SendLocationEffect(EffectItem.Create(pnt, map, EffectItem.DefaultDuration), creature.Map, 0x3709, 30, 10, hue, rm);
                    });
                }

                IPooledEnumerable eable = creature.GetMobilesInRange(m_Range);

and change them to:
Code:
        for (int i = 0; i < m_Range; i++)
        {
                    Misc.Geometry.Circle2D(defender.Location, defender.Map, i, (pnt, map) =>
                    {
                        Effects.SendLocationEffect(EffectItem.Create(pnt, map, EffectItem.DefaultDuration), defender.Map, 0x3709, 30, 10, hue, rm);
                    });
                }

                IPooledEnumerable eable = defender.GetMobilesInRange(m_Range);

That SHOULD change the function of the spell to what you're looking for.
Hope this helps
 
Hey, I noticed this was asked a little while ago; sorry for the delay.
So I'm assuming you mean you want the AOE to appear around the player/defending creature and not the caster?

find these lines in the FlameStrikeAoe section of the code:
Code:
        for (int i = 0; i < m_Range; i++)
        {
                    Misc.Geometry.Circle2D(creature.Location, creature.Map, i, (pnt, map) =>
                    {
                        Effects.SendLocationEffect(EffectItem.Create(pnt, map, EffectItem.DefaultDuration), creature.Map, 0x3709, 30, 10, hue, rm);
                    });
                }

                IPooledEnumerable eable = creature.GetMobilesInRange(m_Range);

and change them to:
Code:
        for (int i = 0; i < m_Range; i++)
        {
                    Misc.Geometry.Circle2D(defender.Location, defender.Map, i, (pnt, map) =>
                    {
                        Effects.SendLocationEffect(EffectItem.Create(pnt, map, EffectItem.DefaultDuration), defender.Map, 0x3709, 30, 10, hue, rm);
                    });
                }

                IPooledEnumerable eable = defender.GetMobilesInRange(m_Range);

That SHOULD change the function of the spell to what you're looking for.
Hope this helps
It didn't take long to wait
It works perfectly
Thank you so much for your answer Really!
 
Trying to get this to work on publish 54 and got these errors:
Errors:
+ Abilities/Custom Abilities/CustomAbility.cs:
CS0103: Line 334: The name 'AnimationType' does not exist in the current context
CS0103: Line 531: The name 'AnimationType' does not exist in the current context
CS0103: Line 658: The name 'AnimationType' does not exist in the current context
CS0103: Line 947: The name 'AnimationType' does not exist in the current context
CS0103: Line 1033: The name 'AnimationType' does not exist in the current context
CS0103: Line 1125: The name 'AnimationType' does not exist in the current context
CS0103: Line 1213: The name 'AnimationType' does not exist in the current context
CS0103: Line 1276: The name 'AnimationType' does not exist in the current context
CS1501: Line 1298: No overload for method 'SendBoltEffect' takes 4 arguments
CS0103: Line 1376: The name 'AnimationType' does not exist in the current context
CS0103: Line 1448: The name 'AnimationType' does not exist in the current context
CS0103: Line 1536: The name 'AnimationType' does not exist in the current context
CS0103: Line 1728: The name 'AnimationType' does not exist in the current context
CS0103: Line 1852: The name 'AnimationType' does not exist in the current context
CS0117: Line 1952: 'Server.Spells.SkillMasteries.ResilienceSpell' does not contain a definition for 'UnderEffects'
Scripts: One or more scripts failed to compile or no script files were found.
Have you managed to resolve the issue or did you choose to comment out the 'AnimationType' lines?
I'm using an older publish as well, I'm also using a 5.0.9.1 client.
 
Last edited:
Have you managed to resolve the issue or did you choose to comment out the 'AnimationType' lines?
I'm using an older publish as well, I'm also using a 5.0.9.1 client.
Commenting those animation type lines out would be your best option.
The only thing that code does is make creatures with a human body type use the spell casting animation when triggering those abilities. It's a small cosmetic aspect to the ability and doesn't effect the functionality at all.

I haven't used an older publish in so long and wouldn't know what your version would use in place of 'AnimationType'.
You can also find out how your version achieves the casting animation by searching in your spell.cs file.

edit: To fix the last line in your errors:
Code:
CS0117: Line 1952: 'Server.Spells.SkillMasteries.ResilienceSpell' does not contain a definition for 'UnderEffects'

change this line:
Code:
                    m_MaxCount = Spells.SkillMasteries.ResilienceSpell.UnderEffects(m) ? 3 : 5;

to:
Code:
                    m_MaxCount = 5;

Hope this helps
 
  • Like
Reactions: Cad
I included "AnimationType" in both Server/Mobile.cs and Server/Network/Packets.cs to address the errors I encountered since those didn't exist with the ServUO publish I'm currently using. When I tried commenting out those lines, I faced additional errors. However, the usage of AnimationType in the current publish only affects users utilizing Core.SA, so it should have no impact on my end, except for enabling the full functionality of these abilities. As I have limited knowledge of C# and I'm still learning, I would greatly appreciate any suggestions for a simpler solution to this issue.
 
I included "AnimationType" in both Server/Mobile.cs and Server/Network/Packets.cs to address the errors I encountered since those didn't exist with the ServUO publish I'm currently using. When I tried commenting out those lines, I faced additional errors. However, the usage of AnimationType in the current publish only affects users utilizing Core.SA, so it should have no impact on my end, except for enabling the full functionality of these abilities. As I have limited knowledge of C# and I'm still learning, I would greatly appreciate any suggestions for a simpler solution to this issue.
What additional errors are you getting?
 
I'm always using it thankfully But I am replying to you because I have more questions. For example, the default damage for the firebolt skill is set to Set Damage (25, 34). Can I set the magic damage to increase according to the Magery skill level? And I was wondering if I could get multiple Firebolt skills to write on one monster. For example, a monster named Zombie uses a firebolt, and I was wondering if you could use several types of firebolt, such as ice, water, energy, poison, and so on the firebolt magic type. Finally, I was wondering if it is possible to set the cool time for individual monsters instead of modifying this part of "public override TimeSpan CooldownDuration { get { returnTimeSpan.FromSeconds(5).} }". I'm sorry I have so many questions. I wanted to use this amazing script more efficiently, so I had a lot of questions. I need your help.
 
I'm always using it thankfully But I am replying to you because I have more questions. For example, the default damage for the firebolt skill is set to Set Damage (25, 34). Can I set the magic damage to increase according to the Magery skill level? And I was wondering if I could get multiple Firebolt skills to write on one monster. For example, a monster named Zombie uses a firebolt, and I was wondering if you could use several types of firebolt, such as ice, water, energy, poison, and so on the firebolt magic type. Finally, I was wondering if it is possible to set the cool time for individual monsters instead of modifying this part of "public override TimeSpan CooldownDuration { get { returnTimeSpan.FromSeconds(5).} }". I'm sorry I have so many questions. I wanted to use this amazing script more efficiently, so I had a lot of questions. I need your help.
Hey and thanks for the questions.
Yes, you can make the spell do damage based on a creature magery. in the creature's code do something like:
Code:
minDmg = SkillName.Magery / 10;
maxDmg = SkillName.Magery / 5;
fb.SetDamage(min, max);

Yes you can add multiple of the same skill to one monster. However, they'll share the same cooldown period.
to add multiple firebolts for example:
Code:
Firebolt fbOne = new Firebolt();
Firebolt fbTwo = new Firebolt();
Firebolt fbThree = new Firebolt();

Then you could give each firebolt a different damage or element
(ex:
Code:
fbOne.Type = Firebolt.BoltType.Ice;
fbTwo.Type = Firebolt.BoltType.Poison;
fbThree.Type = Firebolt.BoltType.Energy;
)

Changing the cooldown for each individual instance of the spell would take a bit of modification of the original script and I'll have to get back to you on an effecient way to do that.
Thanks again for the questions and I'm happy you're enjoying it!
 
Hey and thanks for the questions.
Yes, you can make the spell do damage based on a creature magery. in the creature's code do something like:
Code:
minDmg = SkillName.Magery / 10;
maxDmg = SkillName.Magery / 5;
fb.SetDamage(min, max);

Yes you can add multiple of the same skill to one monster. However, they'll share the same cooldown period.
to add multiple firebolts for example:
Code:
Firebolt fbOne = new Firebolt();
Firebolt fbTwo = new Firebolt();
Firebolt fbThree = new Firebolt();

Then you could give each firebolt a different damage or element
(ex:
Code:
fbOne.Type = Firebolt.BoltType.Ice;
fbTwo.Type = Firebolt.BoltType.Poison;
fbThree.Type = Firebolt.BoltType.Energy;
)

Changing the cooldown for each individual instance of the spell would take a bit of modification of the original script and I'll have to get back to you on an effecient way to do that.
Thanks again for the questions and I'm happy you're enjoying it!
Firebolt fb = new Firebolt();
CustomAbilityList list;

public override void OnThink()
{
base.OnThink();

if( list == null)
{
list = new CustomAbilityList();
minDmg = SkillName.Magery / 10;
maxDmg = SkillName.Magery / 5;
fb.SetDamage(min, max);
list.Add(fb);

}
else
list.CheckTrigger(this);

}
Thank you so much for taking the time to reply.I set it up and saved it like the script above, but I get the following error when compiling it.
CS0103: Line 78: The name 'minDmg' does not exist in the current context
CS0019: Line 78: Operator '/' cannot be applied to operands of type 'SkillName' and 'int'
CS0103: Line 79: The name 'maxDmg' does not exist in the current context
CS0019: Line 79: Operator '/' cannot be applied to operands of type 'SkillName' and 'int'
CS0103: Line 80: The name 'min' does not exist in the current context
CS0103: Line 80: The name 'max' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
I wonder if I set the command you told me in the wrong place. And I want to set all the magic in the CustomAbility.cs script, not individually, to include damage according to the Magery skill level. What command should I add? I'm sorry to bother you. I also want to know how to set the reuse waiting time individually as I told you last time. There are a lot of questions this time, too I'm sorry.
 
Thank you so much for taking the time to reply.I set it up and saved it like the script above, but I get the following error when compiling it.

I wonder if I set the command you told me in the wrong place. And I want to set all the magic in the CustomAbility.cs script, not individually, to include damage according to the Magery skill level. What command should I add? I'm sorry to bother you. I also want to know how to set the reuse waiting time individually as I told you last time. There are a lot of questions this time, too I'm sorry.
Hey,
alright so these errors are all related to syntax:
so for min damage and max damage you have to declare them first.
this means setting them as a type (int, double, etc. )
you could write it as:
Code:
int minDmg, maxDmg;
Then you can use them later in the code.
( you can also declare them on the same line but I'm breaking this up to make to easier to read. )
Next, the proper way to get the value of the creature's magery skill is Skills[SkillName.Magery].Value ( I missed this)
the (int) is converting the value of the skill, which is a double, to an int.
Code:
int magery = (int)Skills[SkillName.Magery].Value;
Now we can use those variables.
Code:
minDmg = magery / 10;
maxDmg = magery / 5;


That should make it all work out for you,
enjoy!
 
Hey,
alright so these errors are all related to syntax:
so for min damage and max damage you have to declare them first.
this means setting them as a type (int, double, etc. )
you could write it as:
Code:
int minDmg, maxDmg;
Then you can use them later in the code.
( you can also declare them on the same line but I'm breaking this up to make to easier to read. )
Next, the proper way to get the value of the creature's magery skill is Skills[SkillName.Magery].Value ( I missed this)
the (int) is converting the value of the skill, which is a double, to an int.
Code:
int magery = (int)Skills[SkillName.Magery].Value;
Now we can use those variables.
Code:
minDmg = magery / 10;
maxDmg = magery / 5;


That should make it all work out for you,
enjoy!
Thank you very much for your detailed reply. But my knowledge is lacking. Can you show me the example you applied to CustomAbillty.cs ? I'm sorry for the lack of knowledge. Could you help me a little more?
 
Thank you very much for your detailed reply. But my knowledge is lacking. Can you show me the example you applied to CustomAbillty.cs ? I'm sorry for the lack of knowledge. Could you help me a little more?
Hey, always happy to help! So, those edits I mentioned don't go in CustomAbility.cs, they would be applied to the individual creature that's using the custom abilities. Here's an example monster:
Code:
using Server.Items;
using System;

namespace Server.Mobiles
{

    [CorpseName("a maelstrom corpse")]
    public class Maelstrom : BaseCreature
    {

    Firebolt fb = new Firebolt();
    FlameStrikeAoe fsa = new FlameStrikeAoe();
    Geyser geyser = new Geyser();
    CustomAbilityList list;

    int minDmg, maxDmg;

        [Constructable]
        public Maelstrom()
            : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name = "a maelstrom";
            Body = 13;
        Hue = 1266;
            BaseSoundID = 278;

            SetStr(131, 145);
            SetDex(66, 85);
            SetInt(116, 130);

            SetHits(95, 115);

            SetDamage(9, 13);

            SetDamageType(ResistanceType.Physical, 80);
            SetDamageType(ResistanceType.Cold, 20);

            SetResistance(ResistanceType.Physical, 35, 45);
            SetResistance(ResistanceType.Fire, 10, 25);
            SetResistance(ResistanceType.Cold, 40, 60);
            SetResistance(ResistanceType.Poison, 100);
            SetResistance(ResistanceType.Energy, 15, 20);

            SetSkill(SkillName.EvalInt, 70.1, 85.0);
            SetSkill(SkillName.Magery, 90.1, 110.0);
            SetSkill(SkillName.MagicResist, 110.1, 120.0);
            SetSkill(SkillName.Tactics, 60.1, 80.0);
            SetSkill(SkillName.Wrestling, 70.1, 80.0);

            Fame = 4500;
            Karma = -4500;

            ControlSlots = 3;
            CanSwim = true;

            PackItem(new BlackPearl(3));

        }

        public Maelstrom(Serial serial)
            : base(serial)
        {
        }

        public override double DispelDifficulty => 117.5;
        public override double DispelFocus => 45.0;
        public override bool BleedImmune => true;
        public override int TreasureMapLevel => 2;

        public override void GenerateLoot()
        {
            AddLoot(LootPack.Average);
            AddLoot(LootPack.Rich);
            AddLoot(LootPack.Potions);
        }

        public override void OnThink()
        {
            base.OnThink();

        int magery = (int)Skills[SkillName.Magery].Value;
        minDmg = magery / 10;
        maxDmg = magery / 5;


        if( list == null)
        {
        list = new CustomAbilityList();
            fsa.Range = 3;

            fb.SetDamage(minDmg, maxDmg);
            geyser.SetDamage(minDmg, maxDmg);
        fsa.SetDamage(minDmg, maxDmg);
        fb.Type = Firebolt.BoltType.Water;
        fsa.Type = FlameStrikeAoe.StrikeType.Water;

            list.Add(fb);
            list.Add(fsa);
            list.Add(geyser);
        }
        else
            list.CheckTrigger(this);

        }

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

        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }
}
 
Hey, always happy to help! So, those edits I mentioned don't go in CustomAbility.cs, they would be applied to the individual creature that's using the custom abilities. Here's an example monster:
Code:
using Server.Items;
using System;

namespace Server.Mobiles
{

    [CorpseName("a maelstrom corpse")]
    public class Maelstrom : BaseCreature
    {

    Firebolt fb = new Firebolt();
    FlameStrikeAoe fsa = new FlameStrikeAoe();
    Geyser geyser = new Geyser();
    CustomAbilityList list;

    int minDmg, maxDmg;

        [Constructable]
        public Maelstrom()
            : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Name = "a maelstrom";
            Body = 13;
        Hue = 1266;
            BaseSoundID = 278;

            SetStr(131, 145);
            SetDex(66, 85);
            SetInt(116, 130);

            SetHits(95, 115);

            SetDamage(9, 13);

            SetDamageType(ResistanceType.Physical, 80);
            SetDamageType(ResistanceType.Cold, 20);

            SetResistance(ResistanceType.Physical, 35, 45);
            SetResistance(ResistanceType.Fire, 10, 25);
            SetResistance(ResistanceType.Cold, 40, 60);
            SetResistance(ResistanceType.Poison, 100);
            SetResistance(ResistanceType.Energy, 15, 20);

            SetSkill(SkillName.EvalInt, 70.1, 85.0);
            SetSkill(SkillName.Magery, 90.1, 110.0);
            SetSkill(SkillName.MagicResist, 110.1, 120.0);
            SetSkill(SkillName.Tactics, 60.1, 80.0);
            SetSkill(SkillName.Wrestling, 70.1, 80.0);

            Fame = 4500;
            Karma = -4500;

            ControlSlots = 3;
            CanSwim = true;

            PackItem(new BlackPearl(3));

        }

        public Maelstrom(Serial serial)
            : base(serial)
        {
        }

        public override double DispelDifficulty => 117.5;
        public override double DispelFocus => 45.0;
        public override bool BleedImmune => true;
        public override int TreasureMapLevel => 2;

        public override void GenerateLoot()
        {
            AddLoot(LootPack.Average);
            AddLoot(LootPack.Rich);
            AddLoot(LootPack.Potions);
        }

        public override void OnThink()
        {
            base.OnThink();

        int magery = (int)Skills[SkillName.Magery].Value;
        minDmg = magery / 10;
        maxDmg = magery / 5;


        if( list == null)
        {
        list = new CustomAbilityList();
            fsa.Range = 3;

            fb.SetDamage(minDmg, maxDmg);
            geyser.SetDamage(minDmg, maxDmg);
        fsa.SetDamage(minDmg, maxDmg);
        fb.Type = Firebolt.BoltType.Water;
        fsa.Type = FlameStrikeAoe.StrikeType.Water;

            list.Add(fb);
            list.Add(fsa);
            list.Add(geyser);
        }
        else
            list.CheckTrigger(this);

        }

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

        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }
}
Awesome! It works very well. Thank you from the bottom of my heart for your willingness to help. Lastly, can I ask you for an update that sets the cool time individually? It's not urgent. It's okay to update slowly and really slowly when you have time. Thank you so much for your precious time.
 
Last edited:
Massapequa updated Custom Abilities for your monsters with a new update entry:

More Custom Abilities for your monsters

Custom Abilities 2.0:

So I've updated my Custom Abilities for monsters by adding a bunch of cool new abilities for your creatures to use as well as doing some slight editing and fixing of old abilities.

New Abilities:
Flame Strike Line - Sends out cascading flames in a direct line toward the target. All enemies in the way get damaged.
Barrage Of Bolts - sends a flurry of firebolts at a target. Any enemy caught in the location gets damaged.
Flame Strike Cone - Creates a massive cone of...

Read the rest of this update entry...
 
Very interesting idea, which Ill be surprised if this doesn't get implemented in the the next ServUO compile. This could def add more giving the creatures more variety vs the same old firebolt and lightning attacks
 
PART ONE:

I'm hoping for some help on this one.

I found this very interesting submission from Massapequa. I would love to activate it on my shard but after three days tweaking the scripts for RunUO v2.1 I have hit the wall hard.

Yes, I did realize Massapequa had written and tested the scripts for/on ServUO but his concept was too tantalizing to be dismissed.

If anyone out there can help me on it, I would be deeply greatful.

Here are the Errors:
Code:
Errors:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbilitiesList.cs:
    CS1061: Line 29: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 45: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 48: 'System.Array' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 72: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 92: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbility.cs:
    CS0117: Line 2277: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2334: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2504: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2513: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'


Here is the script for CustomAbilitiesList.cs
Code:
using System;
using Server;
using System.Collections.Generic;
//using System.Linq;
using Server.Items;
using Server.Network;
using System.Collections;
using Server.Spells;

namespace Server.Mobiles
{
    public class CustomAbilityList
    {

        [CommandProperty(AccessLevel.GameMaster)]
        public CustomAbility[] CustomAbilities { get; private set; }

    public CustomAbilityList()
    {
    }


    public void Add(CustomAbility ability)
    {
        if(CustomAbilities == null)
        {
        CustomAbilities = new CustomAbility[] { ability };
        }
        else if(!CustomAbilities.Any( a=> a == ability))
        {
        var temp = CustomAbilities;

        CustomAbilities = new CustomAbility[temp.Length + 1];

        for(int i = 0; i < temp.Length; i++)
            CustomAbilities[i] = temp[i];

        CustomAbilities[temp.Length] = ability;
        }

    }

    public void Remove(CustomAbility ability)
    {
           if (CustomAbilities == null || !CustomAbilities.Any(a => a == ability))
                return;

            var list = CustomAbilities.ToList();

            list.Remove(ability);

            CustomAbilities = list.ToArray();

            //ColUtility.Free(list);
    }

        public IEnumerable<CustomAbility> EnumerateCustomAbilities()
        {
            if (CustomAbilities == null)
            {
                yield break;
            }

            foreach (var ability in CustomAbilities)
            {
                yield return ability;
            }
        }

        public CustomAbility[] GetCustomAbilities()
        {
            return EnumerateCustomAbilities().ToArray();
        }


    public void CheckTrigger(BaseCreature creature)
    {

        if (!(creature.Combatant is Mobile))
        return;

        Mobile combatant = creature.Combatant as Mobile;

        var defender = combatant;

        if(defender == null)
        return;

        if(defender is Mobile)
        {
        CustomAbility ability = null;
        CustomAbility[] abilties = EnumerateCustomAbilities().Where(m => !m.IsInCooldown(creature)).ToArray();

        if (abilties != null && abilties.Length > 0)
        {
                        ability = abilties[Utility.Random(abilties.Length)];
        }

        if (ability != null )
        {
                        
                        ability.Trigger(creature, defender, 0, 0);
        }
        }
    }

    public CustomAbilityList(GenericReader reader)
    {
            int version = reader.ReadInt();

            int count = reader.ReadInt();
            CustomAbilities = new CustomAbility[count];

            for (int i = 0; i < count; i++)
            {
                CustomAbilities[i] = CustomAbility.Abilities[reader.ReadInt()];
            }

    }

    public virtual void Serialize(GenericWriter writer)
    {
        writer.Write(1);

        writer.Write(CustomAbilities != null ? CustomAbilities.Length : 0);

        if(CustomAbilities != null)
        {
        foreach(var abil in CustomAbilities)
        {
            writer.Write(Array.IndexOf(CustomAbility.Abilities, abil));
        }
        }
    }
    }
}

I will try posting the script for CustomAbility.cs separately due to its size.
PART TWO:

Here again are the Errors for the second script (CustomAbility.cs)

Code:
    CS0117: Line 2277: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2334: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2504: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2513: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'

The script for CustomAbility.cs is too large to post in its entirety so . . here is the portion of CustomAbility.cs giving me these 'CheckField' errors
Code:
           if (SpellHelper.CheckField(p, creature.Map))
        {
            TargetLocationItem s_Item = new TargetLocationItem();
            s_Item.Location = p;
            s_Item.Map = creature.Map;
        }

                for (int i = 1; i <= MaxRange; ++i)
                {
                    Timer.DelayCall<int>(TimeSpan.FromMilliseconds(i * 200), index =>
                    {
                        //Point3D point = new Point3D(eastToWest ? pnt.X + index : pnt.X, eastToWest ? pnt.Y : pnt.Y + index, pnt.Z);
            Point3D point = new Point3D(p);

        creature.Direction = creature.GetDirectionTo(e_Item);
        if(creature.GetDirectionTo(e_Item) == Direction.North)
        {
            point.X = creature.X;
            point.Y = creature.Y - index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Right)
        {
            point.X = creature.X + index;
            point.Y = creature.Y - index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.East)
        {
            point.X = creature.X + index;
            point.Y = creature.Y;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Down)
        {
            point.X = creature.X + index;
            point.Y = creature.Y + index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.South)
        {
            point.X = creature.X;
            point.Y = creature.Y + index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Left)
        {
            point.X = creature.X - index;
            point.Y = creature.Y + index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.West)
        {
            point.X = creature.X - index;
            point.Y = creature.Y;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Up)
        {
            point.X = creature.X + index;
            point.Y = creature.Y + index;
        }
                        SpellHelper.AdjustField(ref point, creature.Map, 16, false);

                        if (SpellHelper.CheckField(point, creature.Map))
            {
                TargetLocationItem m_Item = new TargetLocationItem();
                m_Item.Location = point;
                m_Item.Map = creature.Map;
                Effects.SendLocationParticles(EffectItem.Create(point, creature.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, hue, rm, 5052, 0);
                    IPooledEnumerable eable = m_Item.GetMobilesInRange(1);

                    foreach (Mobile m in eable)
                    {
                    if ((m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).GetMaster() is PlayerMobile)) && creature.CanBeHarmful(m))
            {
                            Timer.DelayCall(TimeSpan.FromSeconds(0.75), () => 
                {
                    int d = Utility.RandomMinMax(min, max);

                            AOS.Damage(m, d, phy, fir, col, poi, ene);
                    });
            }
                    }

                    eable.Free();

            }

                    }, i);
                }
        }
    }

    public class BarrageOfBolts : CustomAbility
    {
        public override double TriggerChance { get { return 0.1; } }
            public override int MaxRange { get { return 12; } }
            public override TimeSpan CooldownDuration { get { return TimeSpan.FromSeconds(15); } }

        /* usage example:
        BarrageOfBolts bob = new BarrageOfBolts();

        public override void OnThink()
        {
            base.OnThink();

        if(bob.ItemID != 0x0F42)
        {
            bob.SetDamage(10, 15); // set custom damage
        bob.ItemID = 0x0F42; // arrow's ItemID
        bob.Sond = 0x234; // bow hit sound
        }
        CustomAbility.CheckTrigger(this, bob); //CustomAbility.CheckTrigger(caster, ability);

        }
        */

        private int m_ItemID = 0x36D4;
        private int m_Hue = 0;
        private int m_SoundID = 0x349;

        public int ItemID
        {
        get { return m_ItemID; }
        set { m_ItemID = value; }
        }

        public int Hue
        {
        get { return m_Hue; }
        set { m_Hue = value; }
        }

        public int Sound
        {
        get { return m_SoundID; }
        set { m_SoundID = value; }
        }    

        public BarrageOfBolts()
        {
        }

        //default damage
        private int m_Min = 12;
        private int m_Max = 18;

        public void SetDamage(int min, int max)
        {
        m_Min = min;
        m_Max = max;
        }

        public override void Trigger(BaseCreature creature, Mobile defender, int min, int max)
        {

        if(min == 0 && max == 0)
        {
            min = m_Min;
            max = m_Max;
        }

        if(creature.InRange(defender.Location, MaxRange) && TriggerChance >= Utility.RandomDouble() && !IsInCooldown(creature))
        {
            DoEffects(creature, defender, min, max);

                    AddToCooldown(creature);
        }
        }

        public override void DoEffects(BaseCreature creature, Mobile defender, int min, int max)
        {

                 if (defender == null || defender.Deleted || !defender.Alive || !creature.Alive || !creature.CanBeHarmful(defender))
                    return;

                defender.PlaySound(m_SoundID);

        Effects.PlaySound(creature.Location, creature.Map, m_SoundID);

        Point3D p = defender.Location;

        if((defender.X > creature.X) && (defender.X - creature.X <= 3))
            p.X = creature.X + 3;
        else if((defender.X < creature.X) && (creature.X -defender.X <= 3))
            p.X = creature.X - 3;
        
        if((defender.Y > creature.Y) && (defender.Y - creature.Y <= 3))
            p.Y = creature.Y + 3;
        else if((defender.Y < creature.Y) && (creature.Y -defender.Y <= 3))
            p.Y = creature.Y - 3;

                int dx = creature.Location.X - p.X;
                int dy = creature.Location.Y - p.Y;
                int rx = (dx - dy) * 44;
                int ry = (dx + dy) * 44;

                bool eastToWest;

                if (rx >= 0 && ry >= 0)
                {
                    eastToWest = false;
                }
                else if (rx >= 0)
                {
                    eastToWest = true;
                }
                else if (ry >= 0)
                {
                    eastToWest = true;
                }
                else
                {
                    eastToWest = false;
                }

                Point3D pnt = new Point3D(p);

        TargetLocationItem s_Item = new TargetLocationItem();
        s_Item.Location = pnt;
        s_Item.Map = creature.Map;
                creature.MovingEffect(s_Item, m_ItemID, 1, 0, false, false, m_Hue, 0);

        TimeSpan duration = TimeSpan.FromSeconds(6);

                for (int i = 1; i <= 2; ++i)
                {
                    Timer.DelayCall<int>(TimeSpan.FromMilliseconds(i * 300), index =>
                    {
                        Point3D point = new Point3D(eastToWest ? pnt.X + index : pnt.X, eastToWest ? pnt.Y : pnt.Y + index, pnt.Z);
                        SpellHelper.AdjustField(ref point, creature.Map, 16, false);
            

                        if (SpellHelper.CheckField(point, creature.Map))
            {
                            TargetLocationItem m_item = new TargetLocationItem( point, creature.Map, duration);
                            creature.MovingEffect(m_item, m_ItemID, 1, 0, false, false, m_Hue, 0);
            }

                        point = new Point3D(eastToWest ? pnt.X + -index : pnt.X, eastToWest ? pnt.Y : pnt.Y + -index, pnt.Z);
                        SpellHelper.AdjustField(ref point, creature.Map, 16, false);

                        if (SpellHelper.CheckField(point, creature.Map))
            {
                            TargetLocationItem n_item = new TargetLocationItem( point, creature.Map, duration);
                            creature.MovingEffect(n_item, m_ItemID, 1, 0, false, false, m_Hue, 0);
            }
                    }, i);
                }

Thank you all for looking at this and hopefully someone can dig me out.

Cheers
 
Last edited:
PART ONE:

I'm hoping for some help on this one.

I found this very interesting submission from Massapequa. I would love to activate it on my shard but after three days tweaking the scripts for RunUO v2.1 I have hit the wall hard.

Yes, I did realize Massapequa had written and tested the scripts for/on ServUO but his concept was too tantalizing to be dismissed.

If anyone out there can help me on it, I would be deeply greatful.

Here are the Errors:
Code:
Errors:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbilitiesList.cs:
    CS1061: Line 29: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 45: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 48: 'System.Array' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 72: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 92: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbility.cs:
    CS0117: Line 2277: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2334: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2504: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2513: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'


Here is the script for CustomAbilitiesList.cs
Code:
using System;
using Server;
using System.Collections.Generic;
//using System.Linq;
using Server.Items;
using Server.Network;
using System.Collections;
using Server.Spells;

namespace Server.Mobiles
{
    public class CustomAbilityList
    {

        [CommandProperty(AccessLevel.GameMaster)]
        public CustomAbility[] CustomAbilities { get; private set; }

    public CustomAbilityList()
    {
    }


    public void Add(CustomAbility ability)
    {
        if(CustomAbilities == null)
        {
        CustomAbilities = new CustomAbility[] { ability };
        }
        else if(!CustomAbilities.Any( a=> a == ability))
        {
        var temp = CustomAbilities;

        CustomAbilities = new CustomAbility[temp.Length + 1];

        for(int i = 0; i < temp.Length; i++)
            CustomAbilities[i] = temp[i];

        CustomAbilities[temp.Length] = ability;
        }

    }

    public void Remove(CustomAbility ability)
    {
           if (CustomAbilities == null || !CustomAbilities.Any(a => a == ability))
                return;

            var list = CustomAbilities.ToList();

            list.Remove(ability);

            CustomAbilities = list.ToArray();

            //ColUtility.Free(list);
    }

        public IEnumerable<CustomAbility> EnumerateCustomAbilities()
        {
            if (CustomAbilities == null)
            {
                yield break;
            }

            foreach (var ability in CustomAbilities)
            {
                yield return ability;
            }
        }

        public CustomAbility[] GetCustomAbilities()
        {
            return EnumerateCustomAbilities().ToArray();
        }


    public void CheckTrigger(BaseCreature creature)
    {

        if (!(creature.Combatant is Mobile))
        return;

        Mobile combatant = creature.Combatant as Mobile;

        var defender = combatant;

        if(defender == null)
        return;

        if(defender is Mobile)
        {
        CustomAbility ability = null;
        CustomAbility[] abilties = EnumerateCustomAbilities().Where(m => !m.IsInCooldown(creature)).ToArray();

        if (abilties != null && abilties.Length > 0)
        {
                        ability = abilties[Utility.Random(abilties.Length)];
        }

        if (ability != null )
        {
                      
                        ability.Trigger(creature, defender, 0, 0);
        }
        }
    }

    public CustomAbilityList(GenericReader reader)
    {
            int version = reader.ReadInt();

            int count = reader.ReadInt();
            CustomAbilities = new CustomAbility[count];

            for (int i = 0; i < count; i++)
            {
                CustomAbilities[i] = CustomAbility.Abilities[reader.ReadInt()];
            }

    }

    public virtual void Serialize(GenericWriter writer)
    {
        writer.Write(1);

        writer.Write(CustomAbilities != null ? CustomAbilities.Length : 0);

        if(CustomAbilities != null)
        {
        foreach(var abil in CustomAbilities)
        {
            writer.Write(Array.IndexOf(CustomAbility.Abilities, abil));
        }
        }
    }
    }
}

I will try posting the script for CustomAbility.cs separately due to its size.
PART TWO:

Here again are the Errors for the second script (CustomAbility.cs)

Code:
    CS0117: Line 2277: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2334: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2504: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'
    CS0117: Line 2513: 'Server.Spells.SpellHelper' does not contain a definition for 'CheckField'

The script for CustomAbility.cs is too large to post in its entirety so . . here is the portion of CustomAbility.cs giving me these 'CheckField' errors
Code:
           if (SpellHelper.CheckField(p, creature.Map))
        {
            TargetLocationItem s_Item = new TargetLocationItem();
            s_Item.Location = p;
            s_Item.Map = creature.Map;
        }

                for (int i = 1; i <= MaxRange; ++i)
                {
                    Timer.DelayCall<int>(TimeSpan.FromMilliseconds(i * 200), index =>
                    {
                        //Point3D point = new Point3D(eastToWest ? pnt.X + index : pnt.X, eastToWest ? pnt.Y : pnt.Y + index, pnt.Z);
            Point3D point = new Point3D(p);

        creature.Direction = creature.GetDirectionTo(e_Item);
        if(creature.GetDirectionTo(e_Item) == Direction.North)
        {
            point.X = creature.X;
            point.Y = creature.Y - index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Right)
        {
            point.X = creature.X + index;
            point.Y = creature.Y - index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.East)
        {
            point.X = creature.X + index;
            point.Y = creature.Y;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Down)
        {
            point.X = creature.X + index;
            point.Y = creature.Y + index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.South)
        {
            point.X = creature.X;
            point.Y = creature.Y + index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Left)
        {
            point.X = creature.X - index;
            point.Y = creature.Y + index;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.West)
        {
            point.X = creature.X - index;
            point.Y = creature.Y;
        }
        else if(creature.GetDirectionTo(e_Item) == Direction.Up)
        {
            point.X = creature.X + index;
            point.Y = creature.Y + index;
        }
                        SpellHelper.AdjustField(ref point, creature.Map, 16, false);

                        if (SpellHelper.CheckField(point, creature.Map))
            {
                TargetLocationItem m_Item = new TargetLocationItem();
                m_Item.Location = point;
                m_Item.Map = creature.Map;
                Effects.SendLocationParticles(EffectItem.Create(point, creature.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, hue, rm, 5052, 0);
                    IPooledEnumerable eable = m_Item.GetMobilesInRange(1);

                    foreach (Mobile m in eable)
                    {
                    if ((m is PlayerMobile || (m is BaseCreature && ((BaseCreature)m).GetMaster() is PlayerMobile)) && creature.CanBeHarmful(m))
            {
                            Timer.DelayCall(TimeSpan.FromSeconds(0.75), () =>
                {
                    int d = Utility.RandomMinMax(min, max);

                            AOS.Damage(m, d, phy, fir, col, poi, ene);
                    });
            }
                    }

                    eable.Free();

            }

                    }, i);
                }
        }
    }

    public class BarrageOfBolts : CustomAbility
    {
        public override double TriggerChance { get { return 0.1; } }
            public override int MaxRange { get { return 12; } }
            public override TimeSpan CooldownDuration { get { return TimeSpan.FromSeconds(15); } }

        /* usage example:
        BarrageOfBolts bob = new BarrageOfBolts();

        public override void OnThink()
        {
            base.OnThink();

        if(bob.ItemID != 0x0F42)
        {
            bob.SetDamage(10, 15); // set custom damage
        bob.ItemID = 0x0F42; // arrow's ItemID
        bob.Sond = 0x234; // bow hit sound
        }
        CustomAbility.CheckTrigger(this, bob); //CustomAbility.CheckTrigger(caster, ability);

        }
        */

        private int m_ItemID = 0x36D4;
        private int m_Hue = 0;
        private int m_SoundID = 0x349;

        public int ItemID
        {
        get { return m_ItemID; }
        set { m_ItemID = value; }
        }

        public int Hue
        {
        get { return m_Hue; }
        set { m_Hue = value; }
        }

        public int Sound
        {
        get { return m_SoundID; }
        set { m_SoundID = value; }
        }  

        public BarrageOfBolts()
        {
        }

        //default damage
        private int m_Min = 12;
        private int m_Max = 18;

        public void SetDamage(int min, int max)
        {
        m_Min = min;
        m_Max = max;
        }

        public override void Trigger(BaseCreature creature, Mobile defender, int min, int max)
        {

        if(min == 0 && max == 0)
        {
            min = m_Min;
            max = m_Max;
        }

        if(creature.InRange(defender.Location, MaxRange) && TriggerChance >= Utility.RandomDouble() && !IsInCooldown(creature))
        {
            DoEffects(creature, defender, min, max);

                    AddToCooldown(creature);
        }
        }

        public override void DoEffects(BaseCreature creature, Mobile defender, int min, int max)
        {

                 if (defender == null || defender.Deleted || !defender.Alive || !creature.Alive || !creature.CanBeHarmful(defender))
                    return;

                defender.PlaySound(m_SoundID);

        Effects.PlaySound(creature.Location, creature.Map, m_SoundID);

        Point3D p = defender.Location;

        if((defender.X > creature.X) && (defender.X - creature.X <= 3))
            p.X = creature.X + 3;
        else if((defender.X < creature.X) && (creature.X -defender.X <= 3))
            p.X = creature.X - 3;
      
        if((defender.Y > creature.Y) && (defender.Y - creature.Y <= 3))
            p.Y = creature.Y + 3;
        else if((defender.Y < creature.Y) && (creature.Y -defender.Y <= 3))
            p.Y = creature.Y - 3;

                int dx = creature.Location.X - p.X;
                int dy = creature.Location.Y - p.Y;
                int rx = (dx - dy) * 44;
                int ry = (dx + dy) * 44;

                bool eastToWest;

                if (rx >= 0 && ry >= 0)
                {
                    eastToWest = false;
                }
                else if (rx >= 0)
                {
                    eastToWest = true;
                }
                else if (ry >= 0)
                {
                    eastToWest = true;
                }
                else
                {
                    eastToWest = false;
                }

                Point3D pnt = new Point3D(p);

        TargetLocationItem s_Item = new TargetLocationItem();
        s_Item.Location = pnt;
        s_Item.Map = creature.Map;
                creature.MovingEffect(s_Item, m_ItemID, 1, 0, false, false, m_Hue, 0);

        TimeSpan duration = TimeSpan.FromSeconds(6);

                for (int i = 1; i <= 2; ++i)
                {
                    Timer.DelayCall<int>(TimeSpan.FromMilliseconds(i * 300), index =>
                    {
                        Point3D point = new Point3D(eastToWest ? pnt.X + index : pnt.X, eastToWest ? pnt.Y : pnt.Y + index, pnt.Z);
                        SpellHelper.AdjustField(ref point, creature.Map, 16, false);
          

                        if (SpellHelper.CheckField(point, creature.Map))
            {
                            TargetLocationItem m_item = new TargetLocationItem( point, creature.Map, duration);
                            creature.MovingEffect(m_item, m_ItemID, 1, 0, false, false, m_Hue, 0);
            }

                        point = new Point3D(eastToWest ? pnt.X + -index : pnt.X, eastToWest ? pnt.Y : pnt.Y + -index, pnt.Z);
                        SpellHelper.AdjustField(ref point, creature.Map, 16, false);

                        if (SpellHelper.CheckField(point, creature.Map))
            {
                            TargetLocationItem n_item = new TargetLocationItem( point, creature.Map, duration);
                            creature.MovingEffect(n_item, m_ItemID, 1, 0, false, false, m_Hue, 0);
            }
                    }, i);
                }

Thank you all for looking at this and hopefully someone can dig me out.

Cheers

Hey PigPen, thanks for sending your issue. I'm definitely willing to try and help make my script work for you.

I noticed in your version of CustomAbilityList you commented out 'using System.Linq;' is there a reason for this?
The definition for Array.Any seems to be in 'System.Linq'
Getting rid of the // in front of it should make it function.
But I'm thinking maybe you commented it out because it was causing other problems for you?



As for SpellHelper.CheckField,
Code:
        public static bool CheckField(Point3D p, Map map)
        {
            if (map == null)
                return false;

            IPooledEnumerable eable = map.GetItemsInRange(p, 0);

            foreach (Item item in eable)
            {
                Type t = item.GetType();

                if (t.IsDefined(typeof(DispellableFieldAttribute), false) || t.IsDefined(typeof(DispellableFieldAttribute), true))
                {
                    eable.Free();
                    return false;
                }
            }

            eable.Free();
            return true;
        }

This is what the method looks like in my version of SpellHelper. You could try to add this to your version of the SpellHelper file, or add it to the CustomAbility script itself as a method ( and just make sure whenever it's reference it says 'CheckField' instead of 'SpellHelper.CheckField' )
 
Hello and thank you for the fast reply. I appreciate the 'eyes of the make' looking at this for me. I am so excited to have this working for our group.

Regarding //using System.Linq; I tried to get that running with my server a couple years ago and it did not work so I stopped trying. I'm not sure if it is a simple .dll download to pop into the server root or what is to be done. Since that time I just commented it out without a problem until tis project.

So . . your help on 'CheckField' seems to have worked but as so often happens, sweep away one error and uncover a couple more.

Here is my new Errors with CustomAbility.cs
Code:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbility.cs:
    CS0246: Line 62: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
    CS0246: Line 1597: The type or namespace name 'Dictionary' could not be found (are you missing a using directive or an assembly reference?)
    CS0246: Line 1909: The type or namespace name 'Dictionary' could not be found (are you missing a using directive or an assembly reference?)

I wish I could attach the entire file (not sure if/how attachments work here) but in your case it is your file (with a few edits).

Cheers mate
 
Hello and thank you for the fast reply. I appreciate the 'eyes of the make' looking at this for me. I am so excited to have this working for our group.

Regarding //using System.Linq; I tried to get that running with my server a couple years ago and it did not work so I stopped trying. I'm not sure if it is a simple .dll download to pop into the server root or what is to be done. Since that time I just commented it out without a problem until tis project.

So . . your help on 'CheckField' seems to have worked but as so often happens, sweep away one error and uncover a couple more.

Here is my new Errors with CustomAbility.cs
Code:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbility.cs:
    CS0246: Line 62: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
    CS0246: Line 1597: The type or namespace name 'Dictionary' could not be found (are you missing a using directive or an assembly reference?)
    CS0246: Line 1909: The type or namespace name 'Dictionary' could not be found (are you missing a using directive or an assembly reference?)

I wish I could attach the entire file (not sure if/how attachments work here) but in your case it is your file (with a few edits).

Cheers mate


The namespaces for those can be found in System.Collections.Generic. Are you having problems with using that as well?
 
Thank you. That solved all the compiling problems with the CustomAbility.cs script.

So my final problems are with CustomAbilityList.cs and as you mentioned are most likely the result of my commenting out 'using System.Linq;'

When I reinstate 'using System.Linq;' I get this (which I have seem in the past trying to use Linq):
Code:
Errors:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbilitiesList.cs:
    CS0234: Line 4: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

When I try with 'using System.Linq;' commented out I get this:
Code:
Errors:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbilitiesList.cs:
    CS1061: Line 29: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 45: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 48: 'System.Array' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 72: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 92: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)

So . . I need to find a 'work around' to make this project work without Linq or I need to find out where to get and how to incorporate Linq into my system which currently runs NET Framework v4.8

My recent attempts to locate and install Linq have given me (at worst) empty or (at best) confusing results.

Sorry for my lack of experience and knowledge on this issue. Do you have any suggestions on:
1) how I can get the scripts working without using Linq . . or
2) how I can get Linq working with RunUO v2.1, Build 6905.732 Core: Running .NET Framework Version 4.0.30319

I really appreciate this. Your scripts are just what we need.

again . . Many Thanks
 
Thank you. That solved all the compiling problems with the CustomAbility.cs script.

So my final problems are with CustomAbilityList.cs and as you mentioned are most likely the result of my commenting out 'using System.Linq;'

When I reinstate 'using System.Linq;' I get this (which I have seem in the past trying to use Linq):
Code:
Errors:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbilitiesList.cs:
    CS0234: Line 4: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

When I try with 'using System.Linq;' commented out I get this:
Code:
Errors:
 + Customs/[A] Custom_Abilities_2.0/Custom Abilities/CustomAbilitiesList.cs:
    CS1061: Line 29: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 45: 'System.Array' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 48: 'System.Array' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 72: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)
    CS1061: Line 92: 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Server.Mobiles.CustomAbility>' could be found (are you missing a using directive or an assembly reference?)

So . . I need to find a 'work around' to make this project work without Linq or I need to find out where to get and how to incorporate Linq into my system which currently runs NET Framework v4.8

My recent attempts to locate and install Linq have given me (at worst) empty or (at best) confusing results.

Sorry for my lack of experience and knowledge on this issue. Do you have any suggestions on:
1) how I can get the scripts working without using Linq . . or
2) how I can get Linq working with RunUO v2.1, Build 6905.732 Core: Running .NET Framework Version 4.0.30319

I really appreciate this. Your scripts are just what we need.

again . . Many Thanks

TBH I wish I knew more on this subject too. This all seems very strange, you should be able to have access to those with your version. I'm guessing you've tried reinstalling your .Net Framework?

I'm gonna have to do a little more work to try and find a work around to those things...
 
Thanks Massapequa. I can't express how much this means to us.

I have not touched anything to do with .NET Framework in over 10 years so don't believe a reinstall of it would be the problem. I wish I know more about it. It seems like maybe it should be embedded (if that's the right terminology) in current versions of .NET Framework but I could be wrong on that.

As additional information . . I don't use Visual Studio so any tools included in it that might be useful . . I am not familiar with.

I will keep head scratching and hair pulling but if you come up with a solution I will erect a monument to you on our shard *smiles*

Again . . my thanks

*bows*
 
Okay Massapequa I finally got this project compiling.

So . . for anyone else having trouble getting Linq to work on their server . . I hope this helps.

I have a UO shard running with RunUO V2.2 and until now have been unable to compile and use scripts that need ' using System.Linq; '

I discovered that Ling is included (or supported) with the latest .NET Framework but in order for your UO scripts to be able to access it you need to check the contents of your "Assemblies.cfg" file which is usually found in the \Data folder. Find that file and make sure to add System.Core.dll

This is what my Assemblies.cfg" file now looks like:

System.dll
System.Web.dll
System.Xml.dll
System.Data.dll
System.Drawing.dll
System.Windows.Forms.dll
System.Core.dll
Ultima.dll

After adding 'System.Core.dll' to my "Assemblies.cfg" file, my compiling problem with files 'using System.Linq;' was solved. My server now compiles with no errors in-spite of some .cs files referring to Linq.

Cheers
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back