EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Multiple Kills spawns boss (https://www.eqemulator.org/forums/showthread.php?t=28192)

Randymarsh9 05-12-2009 08:57 PM

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?

trevius 05-12-2009 09:46 PM

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.

Dibalamin 05-13-2009 11:46 AM

Also, see the azarack code and the key master in sky.

BWStripes 05-15-2009 08:35 AM

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
}


So_1337 05-15-2009 08:49 AM

Damn do I love your comments. Keep up the great scripting =)

Randymarsh9 05-23-2009 09:29 PM

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

joligario 05-23-2009 09:48 PM

spawn2 needs a heading

Randymarsh9 05-23-2009 10:14 PM

yeah I already changed that, it makes no difference

trevius 05-24-2009 03:21 AM

Code:

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

Code:

if ($counter == 9) {
And you will need another bracket to close that out after your spawn2.

Randymarsh9 05-24-2009 02:58 PM

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

trevius 05-24-2009 03:51 PM

"$counter += 1" means the same as "$counter = $counter + 1".

Shendare 05-24-2009 04:12 PM

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


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

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