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-12-2006, 07:00 AM
daryl
Fire Beetle
 
Join Date: Jun 2005
Posts: 24
Default can anyone help me get this quest working

sub EVENT_SAY
{
if($text=~/hail/i)
{
if($class eq "Bard")
{
if($ulevel <= 5)
{
quest::say(" I can [teach] you the magic of your class for free at this time.");
}
elsif($ulevel > 5)
{
$platinum = ($ulevel - 4);
quest::say("In order to teach you the magic of your class, I require a donation of $platinum platinum.");
}
}
else
{
if($ulevel == 1)
{
quest::say(" I am [teach] you the magic of your class for free at this time.");
}
elsif($ulevel > 1)
{
$platinum = ($ulevel);
quest::say("in order to teach you the magic of your class, I require a donation of $platinum platinum.");
}
}
}
elsif($text=~/teach/i)
{
if($class eq "Bard")
{
if($ulevel <= 5)
{
quest::scribespells($ulevel);
}
elsif($ulevel > 5)
{
quest::say("You are far too high for me to teach you such knowledge for free.");
}

}
else
{
if($ulevel == 1)
{
quest::scribespells($ulevel);
}
elsif($ulevel > 1)
{
quest::say("You are far too high for me to teach you such knowledge for free.");
}
}
}
}
sub EVENT_ITEM
{
if($class eq "Bard")
{
if($ulevel > 5)
{
$platinum = ($ulevel - 4);
if(($platinum==$payment) || ($itemcount{65000} == 1))
{
quest::say("I knew you could afford it. Here are your songs.");
quest::scribespells($ulevel);
}
}
}
else
{
$payment = $ulevel;
if(($platinum==$payment) || ($itemcount{65000} == 1))
{
quest::say("I knew you could afford it. Here are your spells.");
quest::scribespells($ulevel);
}
}
}
Reply With Quote
  #2  
Old 03-12-2006, 09:53 AM
TheClaus
Discordant
 
Join Date: Jan 2002
Location: Manteca, CA
Posts: 352
Default

Just glancing at it I see the logic is very wrong. I am not sure if questing has BOOLEAN but I am going off of Perl which does.

Instead of this.

Quote:
sub EVENT_SAY
{
if($text=~/hail/i)
{
if($class eq "Bard")
{
if($ulevel <= 5)
{
Try this
Quote:
sub EVENT_SAY
{
if($text=~/hail/i || $class eq "Bard" || $ulevel <=5);
{
That might work. I don't have an emulator to test but I would say that having multiple ifs just won't work.
Reply With Quote
  #3  
Old 03-12-2006, 10:00 AM
daryl
Fire Beetle
 
Join Date: Jun 2005
Posts: 24
Thumbs down sorted

thanx for the help man but i got it sorted now
cya and goodluck
Reply With Quote
  #4  
Old 03-13-2006, 11:00 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by TheClaus
Just glancing at it I see the logic is very wrong. I am not sure if questing has BOOLEAN but I am going off of Perl which does.

Instead of this.



Try this


That might work. I don't have an emulator to test but I would say that having multiple ifs just won't work.
No, those two things are saying different statements.

if(something || somethingelse || somethingelse) checks to make sure at least one of those are true.

if(something)
{
if(somethingelse)
{
if(evenmoreelse)
{
do something;
}
}
}

something else must have something to run, and evenmore else must have both somethingelse and something to run.

Completely different statements.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #5  
Old 03-13-2006, 11:17 AM
TheClaus
Discordant
 
Join Date: Jan 2002
Location: Manteca, CA
Posts: 352
Default

DOH!

I meant to put && instead of ||.

By putting && it would give the correct logic of wanting a Bard that was level 5 or lower. Though he figured it out so all is good.

Thanks for pointing out my error though.
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:23 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