Before I had a bot enchanter I had something similar to this to work around the group buff issue.
Code:
sub EVENT_SAY {
if($text=~/hail/i) {
quest::say("Hail, $name.I can help you [clear] your mind.");
}
if($text=~/clear/i) {
my $Group = $client->GetGroup();
if($ulevel >= 46) {
if($Group) {
#Koadic's Endless Intellect 2570
$Group->CastGroupSpell($npc, 2570);
}
else {
#Clairvoyance 5513
$npc->CastSpell(5513, $userid);
}
quest::say("May your mind be clear, $name");
}
else {
if($Group) {
#Boon of the Clear Mind 1694
$Group->CastGroupSpell($npc, 1694);
}
else {
#Clarity 174
$npc->CastSpell(174, $userid);
}
quest::say("May your mind be clear, $name");
}
}
}
I think npcs should be able to cast any spells including group spells as they were intended, so I may make a personal edit on my server.