Log in

View Full Version : Finding a mob's Spawn Group


AndMetal
04-25-2008, 06:39 PM
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:

c->Message(0,"Spawn Group: %i",c->GetTarget()->CastToNPC()->GetSp2());
Which is in the current source (http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/Source/zone/command.cpp?view=markup#l_1685). This led me to using a quest object (http://www.eqemulator.net/wiki/wikka.php?wakka=QuestObjects):

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


So, I used the following:

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

However, on death, the NPC says the following:
Soandso says 'spawngroup = '
So that doesn't seem to work. Then I tried the following:

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:

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

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

AndMetal
04-26-2008, 04:04 AM
Thanks Thepeer, that did it :-)