PDA

View Full Version : Quest help...


Maceblade
05-23-2013, 04:33 PM
Why does this crash my zone? Only does it when the PC does NOT have the item.


sub EVENT_SAY {



if ($text =~/Hail/i)
{
if (plugin::check_hasitem($client, 1445)){
quest::say("The King awaits.");
quest::spawn2(999296,0,0,-118,2439,-262,128);

}
}
}

Tabasco
05-23-2013, 05:22 PM
Quite a while back I had an issue with it crashing when it tried to scan corpses. There might be a fix in the latest quest repository, but I just commented out the corpse check in plugins/check_hasitem.pl.

At the top of the function there's this line:

my $body_count = $client->GetCorpseCount();


Then the very last check starts with

#Check corpses
if ($body_count > 0) {


I just commented that all out until the function returned.

--- Edit ---

Another way would be to use plugin::check_hasitem_inv()

Zamthos
05-23-2013, 06:19 PM
Could it be because it's constantly checking for the item and not stopping so it spawns infinite NPCs and crashes the zone? You could do this, maybe? Just threw it together really fast.
sub EVENT_SAY
{
$check = 0;
if ($text =~/Hail/i)
{
if(plugin::check_hasitem($client, 1445) && $check == 0)
{
quest::say("The King awaits.");
quest::spawn2(999296,0,0,-118,2439,-262,128);
$check = 1;
}
else
{
}
}
}

Tabasco
05-23-2013, 10:35 PM
He's using if blocks so hasitem is checked once per hail. There is no loop.

Dunge0nMastr
05-24-2013, 01:39 AM
Quite a while back I had an issue with it crashing when it tried to scan corpses. There might be a fix in the latest quest repository, but I just commented out the corpse check in plugins/check_hasitem.pl.

At the top of the function there's this line:

my $body_count = $client->GetCorpseCount();


Then the very last check starts with

#Check corpses
if ($body_count > 0) {



I just commented that all out until the function returned.

--- Edit ---

Another way would be to use plugin::check_hasitem_inv()

We had the same issue on NL with doors with keys causing crashes. Did this fix and we haven't had the same issue since.

Leetsauce
08-19-2014, 02:36 PM
Hate to necro an old thread, but I just ran into this issue. Tobasco's suggestion of commenting out the corpse checking (for servers where corpses serve no purpose or simply do not exist) from checkhasitem.pl seems to address the issue.