I have this MOB who is suppose to be an evil spell caster. The problem is when the players enter the room he starts fighting with weapons instead of casting spells at them. First thing I did was remove the weapons. I figured no weapons - no weapon attacks Right? WRONG! With no weapons the MOB started punching and still not casting spells. I'm not sure why so naturally I come to you folks here to seek the answers to -
How do you assign mana to a MOB?
How do you assign spells to a MOB
How do you get the MOB to cast spells instead of fighting?
No offense here, but you could have at least looked at some of the overly obvious things being employed by the myriad of spell casting mobs in stock SMAUG/FUSS/etc. I hate to sound like an elitist or something, but I honestly think that if you had done that you'd have figured all or most of this out. Alas, I digress:
I don't even think MOBs need mana to cast spells, but I could be wrong. You can, of course, give them as much as you want. It's just another field you can set using Area Editor or whatever.
If you want the MOB to cast spells, there are spec_funcs for these sort of things. I think there are at least three different 'classes' of spells you can have the mob set to cast. If you're using Nick's Area Editor there's a drop down for this. You can also add some things like fireballs, flamestrike, etc. using the "attacks" field, and also remove the "kick/punch/bash/stun/trip" items if you don't want them using those.
If you want to use specific spells that are not pre-set in the spec_funcs or available under "attacks" then you have to write a mprog for your beastie. Easiest way to do this is some kind of random "fight" prog, set to whatever frequency you feel is appropriate. Therein you can simply add lines like,
c 'whatever spell you want'
Actually you can have it cast several in a row if you want, or maybe randomize which spells it casts, like this:
if rand(50)
c 'spell number 1'
else
c 'spell number 2'
endif
I'm sure you get the idea. Hope that helps somehow.
Be aware though, even with all the mprogs and spec functions you can give a mob, they WILL attack with whatever weapons are available to them - be they actual weapons or claws and teeth. It's pretty well impossible (without HUGE code revisions) to stop a caster mob from engaging in melee. Besides, even if you did, you only give the big dumb warriors a rather substantial edge in fights with casters, something I'm sure your caster classes will really appreciate in pk.
In a nutshell, mobs dont cast spells INSTEAD of fighting, they cast IN ADDITION to fighting, something sure to frustrate your players if handled properly.