AdamD
Member
- ServUO Version
- Publish 58
- Ultima Expansion
- Endless Journey
Hi all,
Happy new year to you all.
Quick question on something that I've never been able to solve since I ran a shard over a decade ago.
I had rare pets on my shard that I wanted to add alternative spells to such as chain lightning and meteor swarm.
So I first tried a solution by copying the MageAI.cs file to a custom folder, renaming to MageAI2 and changing the two entries inside from MageAI to MageAI2.
I then changed the entries for flamestrike spell to meteorswarm or chain lightning, all compiled ok, but anytime I added that AI to a pet, they stop reacting to any command and won't move.
Not sure why, so I tried another method instead, I wanted the casting to be somewhat rare, so I added this section to one pet's file:
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
if (0.1 >= Utility.RandomDouble())
switch (Utility.Random(2))
{
case 0: new Server.Spells.Seventh.ChainLightningSpell(this, null).Cast(); break;
case 1: new Server.Spells.Seventh.MeteorSwarmSpell(this, null).Cast(); break;
}
}
Again, it compiles ok, the pet's magery is 120, but despite combating multiple foes, it never casts any spell.
I thought perhaps I should change the "this, null" to "defender, null", but that had no effect either.
I bumped it up to 90% chance, again, no effect.
Any suggestions would be greatly appreciated!
Happy new year to you all.
Quick question on something that I've never been able to solve since I ran a shard over a decade ago.
I had rare pets on my shard that I wanted to add alternative spells to such as chain lightning and meteor swarm.
So I first tried a solution by copying the MageAI.cs file to a custom folder, renaming to MageAI2 and changing the two entries inside from MageAI to MageAI2.
I then changed the entries for flamestrike spell to meteorswarm or chain lightning, all compiled ok, but anytime I added that AI to a pet, they stop reacting to any command and won't move.
Not sure why, so I tried another method instead, I wanted the casting to be somewhat rare, so I added this section to one pet's file:
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
if (0.1 >= Utility.RandomDouble())
switch (Utility.Random(2))
{
case 0: new Server.Spells.Seventh.ChainLightningSpell(this, null).Cast(); break;
case 1: new Server.Spells.Seventh.MeteorSwarmSpell(this, null).Cast(); break;
}
}
Again, it compiles ok, the pet's magery is 120, but despite combating multiple foes, it never casts any spell.
I thought perhaps I should change the "this, null" to "defender, null", but that had no effect either.
I bumped it up to 90% chance, again, no effect.
Any suggestions would be greatly appreciated!