PDA

View Full Version : Quest Problem


Sarepean
10-24-2004, 11:09 PM
Hey! I'm having some trouble with a Perl command in a quest file. This is for the Oracle of K'arnon. I've made an NPC called "The Fabled Ancient Cyclops" and I'm trying to make the Oracle spawn him in the sub_EVENT: Here's the code.


sub EVENT_SAY {
if($text=~/Hail/i){quest::say("Hail! You are brave coming out onto this island. Is there something I can [help with]?");}
if($text=~/help with/i){
quest::me("The guard nearby reaches for his sword, ready to kill you should you try for the Oracle Robe.");
quest::say("Who sent you, $name?");}
if($text=~/Hasten Bootstrutter/i){quest::say("Oh, well that is a different story, then. You must be here about the [Fabled Ring]. I saw it in my vision.");}
if($text=~/Fabled Ring/i){quest::say("You are here for the Fabled Ring of the Ancients... hmm... I'm going to need a [Ring of the Ancients] and 200 Platinum.");}
if($text=~/Ring of the Ancients/i){quest::say("There is one that walks the sands that carries this band on his hands. You should know where to find him by now.");}
}
sub EVENT_ITEM
{
if($itemcount{12268} == 1 && $platinum == 200)
{
quest::spawn(121094,0,0,1431,-7904,152);
quest::say("I have called to another plane and the creature you seek is just across the ocean.");
quest::exp(100);
quest::summonitem(12268);
}
}




Pretty simple and definitely cheesy. Heres my error:

EDIT:

Unknown Perl Function used:
Unknown Perl Function used:
Unknown Perl Function used:



If I put quest::spawn at the bottom, everything works except spawn. Did I forget to put something into the database or what???

-Sarepean

Cisyouc
10-25-2004, 07:09 AM
Ugh!! Suggestion, space out your code its alot easier to read and debug!!

sub EVENT_SAY
{
if($text=~/Hail/i)
{
quest::say("Hail! You are brave coming out onto this island. Is there something I can [help with]?");
}

if($text=~/help with/i)
{
quest::me("The guard nearby reaches for his sword, ready to kill you should you try for the Oracle Robe.");
quest::say("Who sent you, $name?");
}

if($text=~/Hasten Bootstrutter/i)
{
quest::say("Oh, well that is a different story, then. You must be here about the [Fabled Ring]. I saw it in my vision.");
}

if($text=~/Fabled Ring/i)
{
quest::say("You are here for the Fabled Ring of the Ancients... hmm... I'm going to need a [Ring of the Ancients] and 200 Platinum.");
}

if($text=~/Ring of the Ancients/i)
{
quest::say("There is one that walks the sands that carries this band on his hands. You should know where to find him by now.");
}

}
sub EVENT_ITEM
{
if($itemcount{12268} == 1 && $platinum == 200)
{
quest::spawn(121094,0,0,1431,-7904,152);
quest::say("I have called to another plane and the creature you seek is just across the ocean.");
quest::exp(100);
quest::summonitem(12268);
}
}

Sarepean
10-25-2004, 11:54 AM
Sorry about that. I'll try to remember next time. I was tired after about 12 hours of frustration trying to get that to work and just didn't even think about spacing it out.

So is that the "fixed" code?

-Sarepean

ajb20
10-25-2004, 01:03 PM
Change

sub EVENT_ITEM
{
if($itemcount{12268} == 1 && $platinum == 200)
{
quest::spawn(121094,0,0,1431,-7904,152);
quest::say("I have called to another plane and the creature you seek is just across the ocean.");
quest::exp(100);
quest::summonitem(12268);
}
}

To
sub EVENT_ITEM
{
if($itemcount{12268} == 1 && $platinum == 200)
{
quest::say("I have called to another plane and the creature you seek is just across the ocean.");
quest::exp(100);
quest::summonitem(12268);
quest::spawn(121094,0,0,1431,-7904,152);
}
}

Unless it was fixed there is a bug with quest::spawn(); that stops every command in the same block that is inserted AFTER the spawn command, so try to put the spawn command last.

Sarepean
10-26-2004, 10:08 AM
Well, originally, it was spawn(x,x,x,x,x,x) last, but when the spawn command did nothing at all, I moved it to the top thinking that it would allow me to see where the stuff was bugging out at (also why there's a summonitem in there). See, everytime I do a turn in, I lose a ring of the ancients and 200pp. I have tons of platinum, but the summonitem(12268) *ring of the ancients* saved me some time--- unfortunately, the code stopped at spawn each time, but doesn't spawn anything!!!

Yes, I've tried other NPC ID's. =( I just can't get this code to work.

-Sarepean

m0oni9
10-27-2004, 03:48 AM
Unless it was fixed there is a bug with quest::spawn(); that stops every command in the same block that is inserted AFTER the spawn command, so try to put the spawn command last.
Last I heard, fathernitwit merged in a fix.