Paine
04-30-2006, 03:50 AM
Hiho, I have got some issue with a quest that is supposed to make alot of mobs sit (mobs with the same name)
Since EVENT_SPAWN didnt do the trick for sitting (just froze ne NPCs) I decided to do a timed event for that.
My file looks like this:
sub EVENT_SPAWN
{
quest::starttimer(1,5);
}
sub EVENT_TIMER
{
$npc->SetAppearance(2);
quest::shout("TIMEREVENT TRIGGERED FOR NPC: $mname, $mobid");
}
sub EVENT_SAY
{
$npc->SetAppearance(2);
quest::shout("SAYEVENT TRIGGERED FOR NPC: $mname, $mobid");
}
This works all fine as long as I have a single mob spawned with that name.
However I have a bunch of mobs and for some odd reason it doesnt work in that case. The sayevent gets triggered properly tho.
What I expected (since I am a bit unsure about how EQemu handles these scripts) that only one mob was going to trigger that, but no mob at all triggered the timer event.
I thought it might be an issue with the timerid and changed the ID to $mname and $mobid, however both didnt work either. The only time I had the timerevent fire at all (at least the only time I had a shout) was when I did a random(50) for the timerid. For some odd reason, in some instances after repopping I had a single npc fire the timerevent constantly every 5 seconds.
Any ideas?
Since EVENT_SPAWN didnt do the trick for sitting (just froze ne NPCs) I decided to do a timed event for that.
My file looks like this:
sub EVENT_SPAWN
{
quest::starttimer(1,5);
}
sub EVENT_TIMER
{
$npc->SetAppearance(2);
quest::shout("TIMEREVENT TRIGGERED FOR NPC: $mname, $mobid");
}
sub EVENT_SAY
{
$npc->SetAppearance(2);
quest::shout("SAYEVENT TRIGGERED FOR NPC: $mname, $mobid");
}
This works all fine as long as I have a single mob spawned with that name.
However I have a bunch of mobs and for some odd reason it doesnt work in that case. The sayevent gets triggered properly tho.
What I expected (since I am a bit unsure about how EQemu handles these scripts) that only one mob was going to trigger that, but no mob at all triggered the timer event.
I thought it might be an issue with the timerid and changed the ID to $mname and $mobid, however both didnt work either. The only time I had the timerevent fire at all (at least the only time I had a shout) was when I did a random(50) for the timerid. For some odd reason, in some instances after repopping I had a single npc fire the timerevent constantly every 5 seconds.
Any ideas?