It also seems like a lot of the mezzing spells are hardcoded, I assume the same for Enduring Breath spells, etc.
Take this example code for mezzing an NPC:
Code:
bool Bot::MesmerizeTarget(Mob* target) {
bool Result = false;
if(target) {
int mezid = 0;
int mezlevel = GetLevel();
if(mezlevel >= 69) {
mezid = 5520;
}
else if(mezlevel == 68) {
mezid = 8035;
}
else if(mezlevel == 67) {
mezid = 5503;
}
else if(mezlevel >= 64) {
mezid = 3358;
}
else if(mezlevel == 63) {
mezid = 3354;
}
else if(mezlevel >= 61) {
mezid = 3341;
}
else if(mezlevel == 60) {
mezid = 2120;
}
else if(mezlevel == 59) {
mezid = 1692;
}
else if(mezlevel >= 54) {
mezid = 1691;
}
else if(mezlevel >= 47) {
mezid = 190;
}
else if(mezlevel >= 30) {
mezid = 188;
}
else if(mezlevel >= 13) {
mezid = 187;
}
else if(mezlevel >= 2) {
mezid = 292;
}
if(mezid > 0) {
int32 DontRootMeBeforeTime = 0;
CastSpell(mezid, target->GetID(), 1, -1, -1, &DontRootMeBeforeTime);
target->SetDontRootMeBefore(DontRootMeBeforeTime);
Result = true;
}
}
return Result;
}
So yeah, it is level-dependant and somewhat hardcoded as I thought. The spell lists only apply to the AI logic, not a bot command.
What it seems like is that you are going to have to either: Check the spell array on zone bootup, load the bots' spells into memory that is the best spell for them for each level, then just reference the memory every time you cast a spell.
Or: Change the hardcoded spells. Not as flexible but it works.