EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Quest help... (https://www.eqemulator.org/forums/showthread.php?t=36869)

Maceblade 05-23-2013 04:33 PM

Quest help...
 
Why does this crash my zone? Only does it when the PC does NOT have the item.

Code:

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:
Code:

my $body_count = $client->GetCorpseCount();
Then the very last check starts with
Code:

#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.
Code:

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

Quote:

Originally Posted by Tabasco (Post 221093)
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:
Code:

my $body_count = $client->GetCorpseCount();
Then the very last check starts with
Code:

#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.


All times are GMT -4. The time now is 04:35 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.