I've been doing some modification to the standard buff bot scripts Vicar_Qadar, Illusionist_Nomaad and Dieffer_Wolfhugger that came with Angelox's Classic database. Specifically, I've been modifying them to cast more spells. However, I've noticed a glitch and I'm not quite sure what I can do to resolve this. Maybe one of the more experienced PERL scripters can shed some light for me?
Here is one of the sample scripts
Code:
#zone:PoKnowledge
#Angelox
sub EVENT_SAY {
if(($text=~/hail/i)&&($ulevel<= 45)){
$npc->SetAppearance(0);
quest::say("Hello $name, For a donation of 5pp, I'll cast Spirit of the Wolf on you.");
}
elsif(($text=~/hail/i)&&($ulevel=>46)){
$npc->SetAppearance(0);
quest::say("Hello $name, For a donation of 15pp, I'll cast Spirit of Eagle on you.");
}
}
sub EVENT_SPAWN
{
$x = $npc->GetX();
$y = $npc->GetY();
quest::set_proximity($x - 90, $x + 90, $y - 90, $y + 90);
}
sub EVENT_ENTER
{
$npc->SetAppearance(1);
my $random_result = int(rand(100));
if ($random_result<=15){
quest::shout("Casting SoW and SoE for donations behind the main bank!");
}else{
#Do Nothing
}
}
sub EVENT_ITEM{
if (($platinum>=15)&&($ulevel=> 46)){
$npc->SetAppearance(0);
#quest::selfcast(2517);
$npc->CastSpell(2517,$userid);
quest::say("Casting Spirit of Eagle, Good hunting!");
}elsif(($platinum>=5)&&($ulevel<= 45)){
$npc->SetAppearance(0);
#quest::selfcast(278);
$npc->CastSpell(278,$userid);
quest::say("Casting Spirit of the Wolf, Good hunting!");
}else{
quest::say("Thank you for your donation $name, it wasn't enough though ...");
}
}
sub EVENT_SIGNAL {
quest::shout("Casting SoW and SoE for donations behind the main bank!");
}
As you can see, there are level prerequisit strings coded in to allow the variants of spells to be cast for the specific level range for the buffs. However, even though the text is properly displayed when the level range is met, the script will still allow the higher level spell to be cast on the lower level character regardless of the $ulevel statement. Is this a glitch in the PERL processor or EQEmu? The version of PERL I'm using is ActivePerl 5.8.7.813.