Code:
## I would have made a hash for the spells and their corresponding minimum levels but keeping it relatively like the old
## so too much isn't change all at once
%SpellsHash = (
"first" => [[1 .. 42] , [60, 61, 62, 63, 64, 3692, 3576, 4089]],
"second" => [[43 .. 44] , [60, 61, 62, 63, 64, 3692, 3576, 4090, 1548]],
"third" => [[45] , [60, 61, 62, 63, 64, 1447, 3576, 4090, 1548]],
"fourth" => [[46] , [60, 61, 62, 63, 64, 3467, 3472, 4091, 1548]],
"fifth" => [[47 .. 60] , [60, 61, 62, 63, 64, 3467, 3472, 4091, 3469]],
"sixth" => [[61 .. 90] , [60, 61, 62, 63, 64, 5257, 5258, 5261]],
)
sub EVENT_SAY {
my $castedspells = 0;
if($text=~/Hail/i) {
plugin::Whisper("Hello, $name. Do you need some [".quest::saylink("Buffs", 1)."? Or maybe you're in need of some [".quest::saylink("Healing", 1)."?'");
}
elsif($text=~/Healing/i) {
$npc->SpellFinished(13, $client);
plugin::Whisper ("You have been healed, $name");
}
elsif($text=~/Buffs/i) {
foreach my $key (keys %SpellsHash) {
if ($ulevel ~~ @{$SpellsHash{$key}[0]}) {
$castedspells = 1;
foreach my $spelltocast (@{$SpellsHash{$key}[1]}) {
$npc->SpellFinished ($spelltocast, $client);
}
$castedspells = 1;
$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
}
}
if (!$castedspells) { $client->Message(315, "I have no buffs to give to your gimpy ass!"); }
}
}
I didn't check this for syntax and haven't been Perl'ing for awhile and, not my day job so, it may barf, I dunno.