PDA

View Full Version : can anyone help me get this quest working


daryl
03-12-2006, 07:00 AM
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);
}
}
}

TheClaus
03-12-2006, 09:53 AM
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.


sub EVENT_SAY
{
if($text=~/hail/i)
{
if($class eq "Bard")
{
if($ulevel <= 5)
{


Try this

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.

daryl
03-12-2006, 10:00 AM
thanx for the help man but i got it sorted now :)
cya and goodluck :)

Cisyouc
03-13-2006, 11:00 AM
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. :)

TheClaus
03-13-2006, 11:17 AM
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.