How to Kill a players pet and mercenary
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? |
I can do this to 'kill' pets, but im not sure about mercs.
Code:
quest::selfcast(1285); |
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.
|
Quote:
|
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.
|
there shouldnt be more than 1 merc per ID, unless something is horribly, horribly wrong.
thanks for the input guys. |
It's the same NPC ID, named differently, just like pets. There are only 40 IDs for them.
Code:
1 1 1 1 Apprentice Tank - Tier I |
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(). |
May I ask how exactly you could pull the exact Entity ID every time for every pet and mercenary?
|
|
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. Code:
if($text=~/npc/i) |
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. |
Quote:
|
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 =) |
All times are GMT -4. The time now is 11:09 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.