ServUO Version
Publish 57
Ultima Expansion
Mondain's Legacy
Hey everyone, I’ve messing around with this for a while and I can’t get it working. I managed to get the spell to cast on the mob but he will cast on itself.

Any help much appreciated:

```
public override void OnGotMeleeAttack(Mobile m)
{
var chance = Utility.RandomDouble() * 1000;

if (chance <= 100) // 10%
{
Say("Pain Spike");

Timer.DelayCall(TimeSpan.FromSeconds(1), () => {
PainSpikeSpell spell = new PainSpikeSpell(this, null);
spell.Cast();
this.Target?.Invoke(this, m);
});
}
}
```
 
After digging into this for a while I found out that the issue was the AI of the mob. For casting spells it’ll need to be either Necro or Mage AI.

I wanted to force spell cast on a Melee AI mob with magic skills set to 100.0 but that won’t work.
 
Back