Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2009, 08:57 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default Multiple Kills spawns boss

I want to do something similar to the Rathe thing in PoEarthB where after all of the councilmen are killed, it spawns the boss. I don't really know how to code this, so I just looked at the quest for that event.
Code:
sub EVENT_SPAWN { 
   quest::spawn_condition(poearthb,1,0); #Make sure we aren't up yet.
 if (defined $qglobals{poeb_rathe}){
   quest::settimer("rathe",1); #waiting for the global to expire to pop rathe
   }
 if (!defined $qglobals{poeb_rathe}) { 
   quest::spawn_condition($zonesn,1,1); #Rathe pop 
   quest::settimer("avatar",1); 
   } 
} 

sub EVENT_SIGNAL {
  quest::settimer("rathe",1);
}

sub EVENT_TIMER { 
  if ($timer eq "rathe" && !defined $qglobals{poeb_rathe}) {
      quest::stoptimer("rathe");
      quest::spawn_condition($zonesn,1,1); #Rathe pop 
      quest::settimer("avatar",1); #waiting for rathe to go down to pop avatar
  }
  if ($timer eq "avatar" && !defined $qglobals{poeb_rathe}) { 
      $boss = 0; 
      $check_boss = $entity_list->GetMobByNpcTypeID(222008); 
         if($check_boss) { 
            $boss = 1; 
         } 
      $check_boss = $entity_list->GetMobByNpcTypeID(222013); 
         if($check_boss) { 
            $boss = 1; 
         } 
      if($boss == 0) { 
         quest::stoptimer("avatar"); 
         quest::spawn_condition($zonesn,1,0); #Rathe depop 
         quest::spawn2(222014,0,0,2051.1,407.7,-219.2,0); #Avatar of Earth pop 
      } 
   } 
}
If I wanted to customize this for my own purposes, what would be the main things I would need to change?
Reply With Quote
  #2  
Old 05-12-2009, 09:46 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I posted a different way to handle that same event with a bit different results. This might be easier for you to figure out how to apply for your own setup:

http://www.eqemulator.net/forums/showthread.php?t=24869

At least you might be able to get some ideas from that. I am sure it could have been done better, but actually works pretty well as it is.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 05-13-2009, 11:46 AM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Also, see the azarack code and the key master in sky.
Reply With Quote
  #4  
Old 05-15-2009, 08:35 AM
BWStripes
Sarnak
 
Join Date: Jun 2007
Location: Finland
Posts: 65
Default

You can either "count" the mobs that die if you are sure they will not die simultaneously, or if you have a lot of mobs that might die at the same time, this method works better:

Code:
sub EVENT_SIGNAL {
    if ($signal == "blargdeath") { # Signalled when something dies. Diediediedie. Die.

        $mobcheck = $entity_list->GetMobByNpcTypeID(xxxxxx); # Mob id xxxxxx that must 'not' be up

        if(!defined($mobcheck)){ # You sank my battleship.
            quest::spawn2(xxxxxx,0,0,$x,$y,$z-10,69); # Spawn something else
        }
}
And in each of your mobs that is meant to die, the trigger code:
Code:
sub EVENT_DEATH {
	quest::signalwith(xxxxxx,"blargdeath",0); #Signal mob id xxxxxx that we died
}
Reply With Quote
  #5  
Old 05-15-2009, 08:49 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Damn do I love your comments. Keep up the great scripting =)
Reply With Quote
  #6  
Old 05-23-2009, 09:29 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Ok i tried to make my own thing like this, but it's not working. I have a quest that goes on the mobs that get killed, and then one on a trigger monster that will spawn the boss.

Code:
sub EVENT_DEATH {
quest::signalwith(1322,1,1);
}
thats for the monsters that are killed.

Code:
my $counter;
sub EVENT_SPAWN{
 $counter =0;
}
sub EVENT_SIGNAL{
 if($signal ==1){
  $counter+=1;
 if ($counter ==9);
 quest::spawn2(1323,0,0,251, -682.6, -27.2);
 }
}
I want it to spawn the boss after the 9 mobs are killed
Reply With Quote
  #7  
Old 05-23-2009, 09:48 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

spawn2 needs a heading
Reply With Quote
  #8  
Old 05-23-2009, 10:14 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

yeah I already changed that, it makes no difference
Reply With Quote
  #9  
Old 05-24-2009, 03:21 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Code:
 if ($counter ==9);
That should be:

Code:
 if ($counter == 9) {
And you will need another bracket to close that out after your spawn2.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #10  
Old 05-24-2009, 02:58 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Sweet, thank you! It's working now. Just one question though, why does $counter+=1; work? I was thinking it should be =+1, but I'm not going to mess with it if it already works
Reply With Quote
  #11  
Old 05-24-2009, 03:51 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

"$counter += 1" means the same as "$counter = $counter + 1".
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #12  
Old 05-24-2009, 04:12 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

The even shorter shortcut would be "$counter++;".
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:17 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3