EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Finding a mob's Spawn Group (https://www.eqemulator.org/forums/showthread.php?t=25108)

AndMetal 04-25-2008 06:39 PM

Finding a mob's Spawn Group
 
I'm trying to find a way to get the Spawn Group ID (or even better yet, a Spawn Point ID) for an NPC in a quest. This is what I have found so far:

Quote:

Originally Posted by gernblan (Post 136972)
c->Message(0,"Spawn Group: %i",c->GetTarget()->CastToNPC()->GetSp2());

Which is in the current source. This led me to using a quest object:
Code:

NPC
  .....
  GetSp2()
  .....

So, I used the following:
Code:

my $spawngroup = $npc->GetSp2();
sub EVENT_DEATH {
        quest::say("spawngroup = $spawngroup");
}

However, on death, the NPC says the following:
Quote:

Soandso says 'spawngroup = '
So that doesn't seem to work. Then I tried the following:
Code:

my $spawngroup = $mob->CastToNPC()->GetSp2();
sub EVENT_DEATH {
        quest::say("spawngroup = $spawngroup");
}

and I got the same thing. I also tried it without my & undefined it at the end of the script and still got the same issue:
Code:

$spawngroup = $npc->GetSp2();
sub EVENT_DEATH {
        quest::say("spawngroup = $spawngroup");
}
$spawngroup = undef;

Anyone have any ideas or thoughts?

Theeper 04-26-2008 12:24 AM

Put the variable inside the event and it will work.
Code:

sub EVENT_DEATH {
    my $spawngroup = $npc->GetSp2();
    quest::say("spawngroup = $spawngroup");
}


AndMetal 04-26-2008 04:04 AM

Thanks Thepeer, that did it :-)


All times are GMT -4. The time now is 11:46 AM.

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