I didn't test it, but something like this would probably work:
Code:
if ($text=~/kei/i) {
if ($ulevel > 45) {
$npc->SetAppearance(0);
$npc->CastSpell(2570,$userid);
quest::say("Casting -< Koadic's Endless Intellect >- on $name, enjoy!");
}
else {
quest::say("Ahh, so young and trying for the hard stuff. You should probably just go get a breeze, come back when you're older.");
}
}
P.S. You might want to use elseif's in there for your words. Your NPC is going to spaz if someone says "I want kei, sow, dmf, etc"