PDA

View Full Version : Signalling mobs


lanileb
08-10-2007, 06:29 AM
Hey guys, how would I write a script that would signal to spawn 1 mob after you kill 4 other mobs? I'm workin on writing a quest script that will require you to kill 4 mobs in each wing of PoT A and then once those 4 are down then in the middle of the zone a bigger guy will spawn. I know it involves quest::signal and quest::signalwith, but I'm not sure how you would make it require 4 signals from those 4 mobs to spawn the bigger guy.

I know to spawn a mob after 1 kill its

Killed mob.pl

sub EVENT_DEATH
{
quest::signalwith(npc_id, 1, 0)
}

signalled mob.pl

sub EVENT_SIGNAL
{
quest::say("Testing.");
}

But I'm not sure what would you write to require the signalled mob to need those 4 signals to spawn. Any ideas? Still kinda new at this quest scripting thing.

John Adams
08-10-2007, 07:39 AM
I'm sure you can use signalling (which I am not too familiar with - I refer to other signalling scripts like Schmendrick in lakerathe) - but I think you can also use the quest_global tables to achieve your goals as well. Set the NPCs to use qglobals, then make your script update (maybe a bitwise value?) and when you get to your 4-dead total, fire off the spawn of the 5th guy.

lanileb
08-10-2007, 11:24 AM
Ok, thanks. You got any advice on how to set globals then? Never used them before so like whats the proper syntax when using quest::global? I looked in the quest tutorial section and its got like the variable name and all that for the syntax but what does all of that mean and how would I Set a global for something like signalling mobs to spawn 1 big guy after those 4 are dead.

John Adams
08-10-2007, 02:07 PM
I guess this document is unavailable anymore, so here it is. Quest writers, rejoice!

http://eq.mmoemulators.com/files/EQEmuQuestLexicon.pdf

lanileb
08-10-2007, 02:09 PM
Wow...thanks for that John. Didnt find that yet, maybe I Just didn't search the wiki hard enough, I dunno, but yup that will definately help me with all my questing needs!

John Adams
08-10-2007, 02:18 PM
No I wasn't being sarcastic for once... I don't know who hosts that anymore. Maybe it's on the emu sourceforge. Anyway, it's a little old but a great document.

JrFaust
08-11-2007, 02:40 AM
I used that guide for a script almost exactly like you want. You can look this code over for examples.

# nadox
# a_Luggald_High_Priest.pl
# a_luggald_apprentice.pl
# respawn named mob on a #Garodizan_Razorfin (227113) death
# Enestox, Angelox
#
# The High Priest (227081) will spawn Innoruuk (186107) 30 seconds after
# all four luggald apprentices (227089) are dead if the ceremony doesn't end.
# The timer kills the ceremony at 10 minutes from the first kill.
# The 10 minute timer also is the repop time of the apprentices.
# JrFaust

sub EVENT_ATTACK {
quest::signalwith(227081,1,0);
}

sub EVENT_DEATH{
quest::signalwith(227081,2,30);
my $random_result = int(rand(100));
my $a = 227113;#Garodizan_Razorfin
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
if (($random_result<=5) && ($razo==2)){
quest::spawn2($a,1,0,$x,$y,$z,$h);
quest::delglobal("razo");
quest::setglobal("razo","3","3","F");
$razo=undef;
}else{
#do nothing
}
}

# EOF zone: nadox NPCs:#Garodizan_Razorfin (227113)

# respawn named mob on a #Garodizan_Razorfin (227113) death
# Enestox, Angelox
#
# The High Priest (227081) will spawn Innoruuk (186107) 30 seconds after
# all four luggald apprentices (227089) are dead if the ceremony doesn't end.
# The timer kills the ceremony at 10 minutes from the first kill.
# The 10 minute timer also is the repop time of the apprentices.
# JrFaust

my $counter;

sub EVENT_SPAWN {
$counter = 0;
}

sub EVENT_SIGNAL {
$counter += 1;
if ($signal == 1){
if ($counter == 1){
quest::say("And the ceremony begins.");
}
}
if ($signal == 2){
quest::settimer("ceremony",600);
if ($counter == 8){
quest::say("Innoruuk protect us!");
quest::settimer("inny",30);
quest::stoptimer("ceremony");
$counter = 0;
}
}
}

sub EVENT_TIMER{
if ($timername == "ceremony"){
quest::stoptimer("ceremony");
$counter = 0;
}
if ($timername == "inny"){
quest::stoptimer("inny");
quest::unique_spawn(186107,0,0,1714.00,669.00,-87.00);
}
}

sub EVENT_DEATH{
my $random_result = int(rand(100));
my $a = 227113;#Garodizan_Razorfin
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
if (($random_result<=5) && ($razo==2)){
quest::spawn2($a,1,0,$x,$y,$z,$h);
quest::delglobal("razo");
quest::setglobal("razo","3","3","F");
$razo=undef;
}else{
#do nothing
}
quest::stoptimer("ceremony");
}

# EOF zone: nadox NPCs:#Garodizan_Razorfin (227113)

BWStripes
08-11-2007, 02:46 AM
Good example there :) You can also check the Doomshade event in the umbral directory as well, it does a pretty good job.

You kill the 4 dark masters to trigger Doomshade, the trigger event is in the a_tortured_scream file, it seems very clean.

lanileb
08-11-2007, 07:57 AM
Ok thanks guys, I'll keep all that in mind. Gonna look at the quest in the umbral directory right now. I should have a script together in the next couple of days, making the other 3 encounters first, and if it doesn't seem to be working correctly then I'll post it here for some pointers. Thanks!