Log in

View Full Version : My Buff Bot, Works but needs a little help please.


Fuergrissa
03-02-2008, 07:24 AM
HI,
here is my modified buff bot 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

Knightly
03-02-2008, 07:47 AM
I didn't test it, but something like this would probably work:
if ($text=~/kei/i) {
if ($ulevel > 45) {
$npc->SetAppearance(0);
$npc->CastSpell(2570,$userid);
quest::say("Casting -< Koadic's Endless Intellect >- on $name, enjoy!");
}
else {
quest::say("Ahh, so young and trying for the hard stuff. You should probably just go get a breeze, come back when you're older.");
}
}

P.S. You might want to use elseif's in there for your words. Your NPC is going to spaz if someone says "I want kei, sow, dmf, etc"

leslamarch
03-02-2008, 07:58 AM
alo sometimes after the very first successful cast the buffer will cast kei on himself instead of me

use this quest::selfcast(2570); in place of this $npc->CastSpell(2570,$userid);

should work

Fuergrissa
03-02-2008, 08:30 AM
thank you both very much.

trevius
03-02-2008, 11:24 AM
P.S. You might want to use elseif's in there for your words. Your NPC is going to spaz if someone says "I want kei, sow, dmf, etc"

You don't need to use elseif's. You can just setup the input so it only accepts the exact phrase.

This is an explanation of what I mean from the Perl system guide:

$text =~/^me$/i - Would only match if me is the only text said. The "^" tells it it must be the first thing said and the "$" tells it it must be the last thing.

And here is an example of how you would use it in your code:


if ($text=~/^heal$/i) {
$npc->SetAppearance(0);
quest::selfcast(13);
quest::say("Healing $name, please be more careful in future!");
}

So, if someone says "heal me" or "heal kei sow", they will get no response. The only way to get the correct response and buffs would be to only say "Heal" or "heal" or any variation of the words with CAPs.

Fuergrissa
03-03-2008, 10:31 PM
Thank you, the buff bot works perfectly now thank you, very much, the trouble i have is its been so long since i played EQ i cant remember the good buffs people would want. I seem to remember:

Alacrity, Temp, DMF, Sow, Clarity for under 45
Virtue, Sow, Kei, DMF for 46

I am sure im missing tons, any input would be great.

AndMetal
03-04-2008, 09:28 AM
Harnessing of Spirit (http://lucy.allakhazam.com/spell.html?id=2525) (below 46) & Focus of Spirit (http://lucy.allakhazam.com/spell.html?id=1432)/Focus of Soul (http://lucy.allakhazam.com/spell.html?id=3235) (46+) were really nice Shaman buffs that stack with the Aego line of spells, and possibly with the Druid Protection of the Glades (http://lucy.allakhazam.com/spell.html?id=1442) line of spells (http://lucy.allakhazam.com/stacking.html?id=1442), which is also a good one for HP.

I know, at least until a certain point, that you could even stack HoS/FoS with regular STR/DEX buffs if the stat buffs were cast first, but I think that was removed on live at some point, especially since +130 str & +87 dex @ level 46 from 3 buffs, then +135 str & +120 dex @ level 60 with 3 buffs was a little unbalanced, especially since you could cast them on most noobs.

Fuergrissa
03-04-2008, 07:51 PM
thats the one i was thinking of , i can remember asking for a hos hehehe, thank you again very much