Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 03-02-2008, 07:47 AM
Knightly
Accomplished Programmer
 
Join Date: Nov 2006
Location: Honolulu, HI
Posts: 91
Default

I didn't test it, but something like this would probably work:
Code:
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"
Reply With Quote
  #3  
Old 03-02-2008, 07:58 AM
leslamarch
Discordant
 
Join Date: Sep 2006
Location: Green Bay, WI
Posts: 436
Default

Quote:
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
Reply With Quote
  #4  
Old 03-02-2008, 08:30 AM
Fuergrissa
Fire Beetle
 
Join Date: Feb 2008
Posts: 12
Default

thank you both very much.
Reply With Quote
  #5  
Old 03-02-2008, 11:24 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by Knightly View Post
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:

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.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 03-03-2008, 10:31 PM
Fuergrissa
Fire Beetle
 
Join Date: Feb 2008
Posts: 12
Default

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.
Reply With Quote
  #7  
Old 03-04-2008, 09:28 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Harnessing of Spirit (below 46) & Focus of Spirit/Focus of Soul (46+) were really nice Shaman buffs that stack with the Aego line of spells, and possibly with the Druid Protection of the Glades line of spells, 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.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #8  
Old 03-04-2008, 07:51 PM
Fuergrissa
Fire Beetle
 
Join Date: Feb 2008
Posts: 12
Default

thats the one i was thinking of , i can remember asking for a hos hehehe, thank you again very much
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:54 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3