View Single Post
  #1  
Old 03-02-2008, 07:24 AM
Fuergrissa
Fire Beetle
 
Join Date: Feb 2008
Posts: 12
Default My Buff Bot, Works but needs a little help please.

HI,
here is my modified buff bot code
Code:
#zone:PoKnowledge
#Original by Angelox. Modified by Fuergrissa

sub EVENT_SAY {
if ($text =~/Hail/i)
{ quest::say("Greetings $name. If you are interested in my buffs, please say so and I will give you my[list]. If you require me to [heal] you, please ask."); }
if ($text=~/list/i)
{ quest::say("I can cast the following spells : Spirit of Wolf [SOW]  -  Dead Man Floating [DMF]  -  Clarity II [C2]  -  Temperance [TEMP]  -  Virtue [VIRT]  &  KEI [KEI]");}
if ($text=~/heal/i) 	{
$npc->SetAppearance(0);
$npc->CastSpell(13,$userid);
quest::say("Healing $name, please be more careful in future!");
			}
if ($text=~/sow/i)  	{
$npc->SetAppearance(0);
$npc->CastSpell(278,$userid);
quest::say("Casting -< Spirit Of The Wolf >- on $name, enjoy!");
			}
if ($text=~/dmf/i)  	{
$npc->SetAppearance(0);
$npc->CastSpell(457,$userid);
quest::say("Casting -< Dead Man Floating >- on $name, enjoy!");
			}
if ($text=~/c2/i)  	{
$npc->SetAppearance(0);
$npc->CastSpell(1693,$userid);
quest::say("Casting -< Clarity II >- on $name, enjoy!");
			}
if ($text=~/temp/i)  	{
$npc->SetAppearance(0);
$npc->CastSpell(3692,$userid);
quest::say("Casting -< Temperance >- on $name, enjoy!");
			}
if ($text=~/virt/i)  	{
$npc->SetAppearance(0);
$npc->CastSpell(3467,$userid);
quest::say("Casting -< Virtue >- on $name, enjoy!");
			}
if ($text=~/kei/i)	{
$npc->SetAppearance(0);
$npc->CastSpell(2570,$userid);
quest::say("Casting -< Koadic's Endless Intellect >- on $name, enjoy!");
			}
}

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 Buff Spells behind the main bank!");
	}else{
	#Do Nothing
 	}
}
I am looking to convert the kei section to only cast kei if you are 46 or higher, i have tried "else" and "elseif" but cannot get it to work , i am sure its real easy, could anyone give me a few pointers please, alo sometimes after the very first successful cast the buffer will cast kei on himself instead of me ? any ideas please.
Also i am open to any constructive advice to shorten the code or make it more effective.
Thank you in advance for any and all help

Fuer
Reply With Quote