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-30-2007, 03:49 AM
Annihilator
Sarnak
 
Join Date: May 2007
Posts: 47
Default Level restricting quest variables

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.
Reply With Quote
  #2  
Old 12-30-2007, 04:20 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

try this one..


Code:
#zone:PoKnowledge
#Angelox
 
sub EVENT_SAY
{ 
	if(($text=~/hail/i) && ($ulevel <= 45))
	{
		$npc->SetAppearance(0);
	}
	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_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);
		$npc->CastSpell(2517,$userid);
		quest::say("Casting Spirit of Eagle, Good hunting!");
	}
	elsif(($platinum >= 5) && ($ulevel <= 45))
	{
		$npc->SetAppearance(0);
		$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!");
}
some of the =>/=< symbols were backwards.. (if that even matters)
made it look better nyways ;p
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com

Last edited by Cripp; 12-30-2007 at 12:29 PM..
Reply With Quote
  #3  
Old 12-30-2007, 06:57 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

yah cripp caught it.

remember:

=> is an assignment operator for hashes:

e.g.
%aHash = ( a => value_of_a );

using >= is much safer and removes ambiguity.


== sfisque
Reply With Quote
  #4  
Old 12-30-2007, 08:54 AM
Annihilator
Sarnak
 
Join Date: May 2007
Posts: 47
Default

Duh.. I didn't even catch that.. Thanks for the heads up -- I did not create this script though. It came out of Angelox's Classic database files. I was just trying to modify it and noticed it wasn't working quite right. Angelox, if you read this you might want to update your source file.
Reply With Quote
  #5  
Old 12-30-2007, 01:53 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

I don't recall doing any for druid buffs, I guess someone copy/pasted mine, included my name.
My original Qadar and Nomaad NPC scripts worked as they were, probably because of the order the lines were in. Who ever did the druid script shuffled things up so my symbol mistake stands out now.
I guess PEQ must have other buffer NPC's in POK nowadays.
Always good to put your name in there even if its an update I like this;
Code:
#zone:PoKnowledge
#Angelox
#Revised Annihilator
This way there's a history of how things went.
You're welcome to fix, and post anything I've done.
Reply With Quote
  #6  
Old 12-30-2007, 06:48 PM
Annihilator
Sarnak
 
Join Date: May 2007
Posts: 47
Default

My bad Angelox, I posted the wrong script. I meant to post the Illusionist_Nomaad script which is included in ax_classic. The Dieffer_Wolfhugger was an exact copy of it with the text and cast spells changed to suit the druid buff bot in PoKnowledge. My appologies, I hadn't intended to post the cut-and-paste version of the druid script that had your name in it but it was your script. I'm still learning PERL and was up all night trying to get the scripts debugged.

When a PC hails Illusionist_Nomaad and is less than level 45 the text displayed is "Hello $name, I can buff you with Clarity for a fee of 5pp, and my friend over there has cleric buffs.". If the PC is greater than level 46 the text displayed is "Hello $name, I can buff you with KEI for a fee of 15pp..." If a PC less than level 45 gives the NPC 15pp he gets KEI. The script error caught by Cripp fixed it right up. Thanks Cripp!
Reply With Quote
  #7  
Old 12-30-2007, 07:07 PM
Annihilator
Sarnak
 
Join Date: May 2007
Posts: 47
Default

Is there an easy way to increase the event signal shouts with these scripts?
Reply With Quote
  #8  
Old 12-31-2007, 03:41 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

Code:
sub EVENT_SAY
{
quest::signalwith("$npc->GetNPCTypeID(), 1, 0);

quest::signalwith("$npc->GetNPCTypeID(), 2, 0);
}

sub EVENT_SIGNAL
{
 if ($signal eq "1")
 {
   quest::shout("Casting SoW and SoE for donations behind the main bank!");
 }
 if ($signal eq "2")
 {
   quest::shout("Signal 2!");
 }
}
quick example of multiple signals with shouts..
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
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 09:05 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3