PDA

View Full Version : quest::tarvariable problems!


Aydun
07-07-2005, 03:44 PM
Greetings,

Been doing some reading, and trying to look at the multitude of other's code posts, and not really seen any in reference to my specific problem, though many are similar.
Made a test script to get the hang of using global variables to give different responses, or the set markers for quest completion.

Here's what I've got !
This is the first NPC

#!/usr/local/bin/perl

#GLOBAL VARIABLE TESTING

sub EVENT_SAY
{
if($text=~ /hail/i)
{
quest::say("Hello there $name I'm glad you've talked to me I'm going
to let my friend know!");
quest::targlobal("friendstatus", "1", "M30", 189033, $charid, 22);
}
if($text=~ /hail/i && $friendstatus == "1")
{
quest::say("Glad to see you again!");
}
if($text=~ /hail/i && $friendstatus == "2")
{
quest::say("Wasn't my friend cool!");
}
}

NPC numero dos

#!/usr/local/bin/perl

#PAL END OF THE GLOBAL VARIABLE TEST

sub EVENT_SAY
{
if ($text=~ /hail/i)
{
quest::say("Umm I don't talk to n e one unless my friend says so");
}
if ($text=~ /hail/i && $friendstatus == "1")
{
quest::say("Hi how is harry?");
quest::targlobal("friendstatus", "2", "M30", 189032, $charid, 22);
}
}


What's happening is in my .bat file for this zone i'm getting a readout saying
"targlobal error inserting friendstatus : DBcore :: runquery: No Result"

The global variable is still showing up in the Database so i suppose it's fine, however even with friendstatus set to 1 (as it is in the database) neither NPC responds differently than their original "hail" message!

Any insight would be greatly appreciated

Kindest Regards,