PDA

View Full Version : How to Kill a players pet and mercenary


vkrr
03-28-2013, 02:56 PM
I'm looking for a way to kill a player's pet and mercenary by means of a quest without killing the player.


any suggestions?

vkrr
03-28-2013, 05:03 PM
I can do this to 'kill' pets, but im not sure about mercs.

quest::selfcast(1285);
quest::selfcast(331);

Zamthos
03-28-2013, 05:19 PM
May I ask the functionality of this? Could they not just re-spawn the pet? And I don't believe there are any mercenary-related questmgr.cpp options, unless they've been recently added, so, as of my knowledge, there is no way to kill mercenaries using a Perl script.

sorvani
03-28-2013, 08:09 PM
And I don't believe there are any mercenary-related questmgr.cpp options, unless they've been recently added, so, as of my knowledge, there is no way to kill mercenaries using a Perl script.

A merc is an NPC and will be available in the entity list. So you can find it like that and then kill it or depop it or whatever.

Zamthos
03-28-2013, 09:42 PM
True, but would that not depop all the mercenaries with the same ID? Or kill them all? I don't quite understand this, it's like sending a signal to increase it's damage 200x to a certain NPC ID and having multiple of it and making things unintentionally stronger, it'd be better if you could pinpoint a specific mercenary rather than send the signal or choose it from a entity list using an ID because it's very broad and will affect any of the NPCs with an equivalent ID. Supposed I was to send a signal to NPC ID 1, a hypothetical orc, and I only wanted it to do it to a specific one, there's no way I could make it specifically just that one, it would effect everything in that zone that has the NPC ID '1', so it would be very inefficient and more than likely, make players angry if their mercenary dies even if they're across the zone.

vkrr
03-28-2013, 10:18 PM
there shouldnt be more than 1 merc per ID, unless something is horribly, horribly wrong.

thanks for the input guys.

Zamthos
03-28-2013, 10:19 PM
It's the same NPC ID, named differently, just like pets. There are only 40 IDs for them.

1 1 1 1 Apprentice Tank - Tier I
2 1 2 1 Apprentice Tank - Tier II
3 1 3 1 Apprentice Tank - Tier III
4 1 4 1 Apprentice Tank - Tier IV
5 1 5 1 Apprentice Tank - Tier V
6 2 1 1 Journeyman Tank - Tier I
7 2 2 1 Journeyman Tank - Tier II
8 2 3 1 Journeyman Tank - Tier III
9 2 4 1 Journeyman Tank - Tier IV
10 2 5 1 Journeyman Tank - Tier V
11 1 1 2 Apprentice Healer - Tier I
12 1 2 2 Apprentice Healer - Tier II
13 1 3 2 Apprentice Healer - Tier III
14 1 4 2 Apprentice Healer - Tier IV
15 1 5 2 Apprentice Healer - Tier V
16 2 1 2 Journeyman Healer - Tier I
17 2 2 2 Journeyman Healer - Tier II
18 2 3 2 Journeyman Healer - Tier III
19 2 4 2 Journeyman Healer - Tier IV
20 2 5 2 Journeyman Healer - Tier V
21 1 1 9 Apprentice Melee DPS - Tier I
22 1 2 9 Apprentice Melee DPS - Tier II
23 1 3 9 Apprentice Melee DPS - Tier III
24 1 4 9 Apprentice Melee DPS - Tier IV
25 1 5 9 Apprentice Melee DPS - Tier V
26 2 1 9 Journeyman Melee DPS - Tier I
27 2 2 9 Journeyman Melee DPS - Tier II
28 2 3 9 Journeyman Melee DPS - Tier III
29 2 4 9 Journeyman Melee DPS - Tier IV
30 2 5 9 Journeyman Melee DPS - Tier V
31 1 1 12 Apprentice Caster DPS - Tier I
32 1 2 12 Apprentice Caster DPS - Tier II
33 1 3 12 Apprentice Caster DPS - Tier III
34 1 4 12 Apprentice Caster DPS - Tier IV
35 1 5 12 Apprentice Caster DPS - Tier V
36 2 1 12 Journeyman Caster DPS - Tier I
37 2 2 12 Journeyman Caster DPS - Tier II
38 2 3 12 Journeyman Caster DPS - Tier III
39 2 4 12 Journeyman Caster DPS - Tier IV
40 2 5 12 Journeyman Caster DPS - Tier V

trevius
03-28-2013, 10:46 PM
They are referring to Entity ID, which will always be unique.

As mentioned, I don't think there are any merc specific functions exported to perl yet. So, it might be hard to associate a merc with its owner. Though, something as simple as GetOwner() might work. I don't recall offhand if that applies properly to mercs from the class Mob version or if it only works from the merc specific override of GetOwner().

Zamthos
03-28-2013, 11:16 PM
May I ask how exactly you could pull the exact Entity ID every time for every pet and mercenary?

lerxst2112
03-28-2013, 11:25 PM
http://www.eqemulator.net/wiki/wikka.php?wakka=ListIterations

Zamthos
03-28-2013, 11:29 PM
A foreach to check a certain NPC type and use every entity ID from it? Not exactly what I meant.

This would pull all entity IDs for the one NPC and perform the action for all of them, not a singular Entity, I know this is possible, however I want to see how you can logistically work it out in the least problematic manner.
if($text=~/npc/i)
{
my @npclist = $entity_list->GetNPCList();
foreach $ent (@npclist)
{
$ent->Shout("I'm a npc!");
}
}

lerxst2112
03-29-2013, 01:22 AM
Loop through the list and check each one to decide if it belongs to player X or not. If it does, do the thing you want to do, otherwise, skip it.

The debate is if there is a way currently exposed to Perl that allows you to tie a merc to a player. As Trevius said above, GetOwner() might work. I haven't messed with Mercs on the emu yet, but if they are named like they are on live then it might be possible to get at the <Soandso's mercenary> string and match them that way.

sorvani
03-29-2013, 01:14 PM
Loop through the list and check each one to decide if it belongs to player X or not. If it does, do the thing you want to do, otherwise, skip it.

The debate is if there is a way currently exposed to Perl that allows you to tie a merc to a player. As Trevius said above, GetOwner() might work. I haven't messed with Mercs on the emu yet, but if they are named like they are on live then it might be possible to get at the <Soandso's mercenary> string and match them that way.

They are so that could work if the title is available.

vkrr
04-01-2013, 11:17 AM
for what it's worth, I was using this as part of a comprehensive 'rebirth' package on my server. A player reaches max level and then has a chance to be born again as a different class.
Once any pets are dead and buffs are stripped, the class change is forced which disconnects the player, when they log back in the mercenary is back to level 1 with them so problem solved =)