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 12-07-2010, 01:39 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default Level check on buff ?

I've been trying to get this buff bot script (idea from Trevius) to check
for level and not cast the spell if character is not meeting $ulevel.
The script works good, as long as the character is grouped, but if not,
(in the "else"), it doesn't check for level and casts the spell anyways.
My intentions (for example) is not letting the character get a buff like
KEI, when it is less than level 45.

sub EVENT_SAY {

if (($text =~/hail/i)&&{$ulevel=>45}) {
my $Group = $client->GetGroup();
if($Group) {
$Group->CastGroupSpell($npc, 2570)
}
else {
my $GetPlayerID = $client->GetID();
quest::selfcast(2570);
}
quest::say("Incoming KEI for $name");
}

}
Reply With Quote
  #2  
Old 12-07-2010, 04:56 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You had multiple syntax issues going on. This should work fine:

Code:
sub EVENT_SAY {

	if ($text =~/hail/i && $ulevel >= 45)
	{
		my $Group = $client->GetGroup();
		if($Group)
		{
			$Group->CastGroupSpell($npc, 2570);
		}
		else
		{
			my $GetPlayerID = $client->GetID();
			quest::selfcast(2570);
		}
		quest::say("Incoming KEI for $name");
	}

}
I suggest reviewing the changes I made so you can learn what you did wrong.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 12-07-2010, 05:05 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

Quote:
Originally Posted by trevius View Post
You had multiple syntax issues going on. This should work fine:

Code:
sub EVENT_SAY {

	if ($text =~/hail/i && $ulevel >= 45)
	{
		my $Group = $client->GetGroup();
		if($Group)
		{
			$Group->CastGroupSpell($npc, 2570);
		}
		else
		{
			my $GetPlayerID = $client->GetID();
			quest::selfcast(2570);
		}
		quest::say("Incoming KEI for $name");
	}

}
I suggest reviewing the changes I made so you can learn what you did wrong.
Ok, yes, several things different than what I was doing, but, as always, your
very good at what you do (smirk) THANK YOU, it works like I wanted it too now, lol
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 05:02 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3