PDA

View Full Version : Spawning a mob on a player death & loc


Dibalamin
09-22-2009, 06:31 PM
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
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.
$spawner = $client_search->CastToMob();