This is the script I have on my buff bot. It checks for a group and levels, then
cast the appropriate spells.(setting NPC level to 70 helps with buff timer).
Code:
sub EVENT_SAY {
if (($text=~/hail/i) && ($ulevel<46)) {
quest::say("Hello $name, If you or your group need [Temp] or [Spirit] to run with, please gather near. I can also give you [Clarity] to help you on your journeys as well. When you reach 46 I can give you KEI and at 47 Virtue");
}
if (($text=~/hail/i) && ($ulevel>46)) {
quest::say("Hello $name, If you or your group need [Virtue] or [KEI] or [Spirit] to run with, please gather near.");
}
if (($text=~/hail/i) && ($ulevel==46)) {
quest::say("Hello $name, If you or your group need [Temp] or [KEI] or [Spirit] to run with, please gather near.");
}
elsif (($text=~/temp/i) && ($ulevel<47)) {
my $Group = $client->GetGroup();
if ($Group) {
my $Valid = 1;
for ($count = 0; $count < $Group->GroupCount(); $count++) {
if ($Group->GetMember($count)->GetLevel() < 1) {
$Valid = 0;
}
}
if ($Valid == 1) {
quest::say("Incoming Group Temp for $name.");
$Group->CastGroupSpell($npc, 4053);
}
else {
quest::say("Sorry $name. You are not at the appropriate level for that.");
}
}
else {
quest::say("Incoming Temp for $name");
my $GetPlayerID = $client->GetID();
$npc->CastSpell(3692, $GetPlayerID );
}
}
elsif (($text=~/virtue/i) && ($ulevel>46)) {
my $Group = $client->GetGroup();
if ($Group) {
my $Valid = 1;
for ($count = 0; $count < $Group->GroupCount(); $count++) {
if ($Group->GetMember($count)->GetLevel() > 65) {
$Valid = 0;
}
}
if ($Valid == 1) {
quest::say("Incoming Group Virtue for $name.");
$Group->CastGroupSpell($npc, 3479);
}
else {
quest::say("Sorry $name. You are not at the appropriate level for that.");
}
}
else {
quest::say("Incoming Virtue for $name");
my $GetPlayerID = $client->GetID();
$npc->CastSpell(3467, $GetPlayerID );
}
}
elsif (($text=~/clarity/i) && ($ulevel<66)) {
quest::say("Incoming Clarity for $name");
my $GetPlayerID = $client->GetID();
$npc->CastSpell(174, $GetPlayerID );
}
elsif (($text=~/kei/i) && ($ulevel>45)) {
quest::say("Incoming KEI for $name");
my $GetPlayerID = $client->GetID();
quest::selfcast(2570);
}
elsif (($text=~/spirit/i) && ($ulevel<66)) {
my $Group = $client->GetGroup();
if ($Group) {
my $Valid = 1;
for ($count = 0; $count < $Group->GroupCount(); $count++) {
if ($Group->GetMember($count)->GetLevel() > 65) {
$Valid = 0;
}
}
if ($Valid == 1) {
quest::say("Incoming Spirit of Bih'Li for $name.");
$Group->CastGroupSpell($npc, 2524);
}
else {
quest::say("Sorry $name. You are not at the appropriate level for that.");
}
}
else {
quest::say("Incoming SoW for $name");
my $GetPlayerID = $client->GetID();
$npc->CastSpell(278, $GetPlayerID );
}
}
}