Improved MageAI
Hello,
I decided to reprogram the MageAI, as the default mages were behaving pretty stupid. The new mage now has the following features:
- Improved pathfinding (keeps distance to enemy, tries to return to home zone)
- Improved spells (casts higher level spells, more intelligent casting)
- Intelligent self medication (curing and healing)
My main goal was to improve the mage's walking and pathfinding during combat, so it doesn't stand next to the enemy and gets beaten up. I took out the teleporting and the custom Flee procedure. When I find out how it works, I may add a Flee procedure that actually makes the mage run one screen away when health is low, before he starts healing back up.
I tested the script thoroughly and let the mage fight against all kinds and numbers of creatures. Seems to work pretty well.
As this is my first RunUO project, please feel free to post improvements of the code. I'd be happy to receive some hints from more experienced people.
To install and use the script, do the following:
Hello,
I decided to reprogram the MageAI, as the default mages were behaving pretty stupid. The new mage now has the following features:
- Improved pathfinding (keeps distance to enemy, tries to return to home zone)
- Improved spells (casts higher level spells, more intelligent casting)
- Intelligent self medication (curing and healing)
My main goal was to improve the mage's walking and pathfinding during combat, so it doesn't stand next to the enemy and gets beaten up. I took out the teleporting and the custom Flee procedure. When I find out how it works, I may add a Flee procedure that actually makes the mage run one screen away when health is low, before he starts healing back up.
I tested the script thoroughly and let the mage fight against all kinds and numbers of creatures. Seems to work pretty well.
As this is my first RunUO project, please feel free to post improvements of the code. I'd be happy to receive some hints from more experienced people.
To install and use the script, do the following:
- Add the new AIType to the list in ChangeAIType( AIType NewAI ) in BaseCreature.cs
- Add the new AIType to the namespace Server.Mobiles in BaseAI.cs
- Assign the AIType to the class of the creature (e.g. public OrcishMage() : base(AIType.AI_Mage, ...)
- Enter into the Spawner, for example, "OrcishMage/ai/AI_Mage2"
- Have fun!