EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Spawning a mob on a player death & loc (https://www.eqemulator.org/forums/showthread.php?t=29635)

Dibalamin 09-22-2009 06:31 PM

Spawning a mob on a player death & loc
 
Been tinkering with this one for a bit, can't quite get it to work. What would it take to spawn a mob where a PC dies after an NPC dt's them?

So_1337 09-22-2009 06:57 PM

Is the DT simply in the NPC's spell list, or is it being trigger via a perl script?

Shin Noir 09-22-2009 07:08 PM

via quest script it'd be something like ...
use sub EVENT_SLAY - Triggers when the mob kills a client.
then figure out where the player is, hmm.. can't think of how to do that offhand. (how to get x/y/z of client), But once you get the player/client's coordinate, you spawn mob at it. I think you can typecast the client to a mob and use GetX(), something like... $client->CastToMob()->GetX() ? This is more or less a guess with zero testing. Trying to feed you some tinkering suggestions at least. :3

Oh, JUST when a mob DT's them? Not sure the spell that killed the player is tracked via quests... But anything is possible with a slight source mod worst case.

Dibalamin 09-22-2009 07:18 PM

I'm building it into the DT script.

Dibalamin 09-22-2009 07:36 PM

Code:

if($timer eq "DT") {       
                          quest::shout("Testing");
                  my $list_check = 0;
                  for ($list_check = 0; $list_check < 1500; $list_check++) {
          $client_search = $entity_list->GetClientByID($list_check);   
                        if ($client_search) {   
                        my $ClID = $client_search->GetID();
                        $npc->CastSpell(982,$ClID);
                        my $x;
                        my $y;
                        my $z;
                        my $h;
                        $spawner = $ClID->CastToMob();
                        $x = $spawner->GetX();
                        $y = $spawner->GetY();
                        $z = $spawner->GetZ();
                        $h = $spawner->GetHeading();                       
                        quest::spawn2(99999,0,0,$x,$y,$z,$h);
                        $counter = 0;
                        }
                  }
        }

here's what I've been testing with & doesn't work so the CastTo isn't taking I don't think.

Wesell 09-22-2009 11:08 PM

You probably want to try that on the client instead of the id.
Code:

$spawner = $client_search->CastToMob();


All times are GMT -4. The time now is 01:03 AM.

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