Thread Tools Display Modes
02/10/21, 07:30 PM   #1
Regretfulone
Join Date: Apr 2014
Posts: 6
How to get information about monsters?

Hi all,

I am working on an addon and I require information about units that you are in combat with (post combat). I have already added LibCombat to the addon and some information comes through, like a name or the unitId, but I would like to know more about these units.

The unitId is only applicable to that monster when it has spawned and therefore is not entirely helpful. I would like to be able to maybe take that unitId and get more info about the monster, like is it dead, what is its universal identifier (since some critters and enemies share the same name like scorpions or wasps).

I have tried looking through the Wiki at the ingame available functions as well but I am at a loss. Does anyone know if this is possible or where to maybe look deeper?

Thanks!
  Reply With Quote
02/11/21, 12:44 AM   #2
awfuldead
AddOn Author - Click to view addons
Join Date: Mar 2020
Posts: 17
You can see what commands are available to you in the API documentation, but I'll say right away that information about the monster outside the battle cannot be obtained. Even bosses don't have unique IDs

API
  Reply With Quote
02/11/21, 05:31 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
During fight the unitId should be unique and you are able to react on events like event_combat_event etc. to check what these unitIds did, if they are alive etc.
via GetUnit*(unitTag) API functions from the API file that was linked above.
Or from the event parameters.

After the fight you cannot do this as the units get destroyed afaik, even if you just left combat without fighting (by running away).
Not each critter or boss or player got a unique Id you are able to reuse later on, sorry.

And some information about enemies (NPCs or players) cannot be obtained at all (also not during fights, like what skills they use etc.).

Last edited by Baertram : 02/11/21 at 05:42 AM.
  Reply With Quote
02/11/21, 09:50 AM   #4
Regretfulone
Join Date: Apr 2014
Posts: 6
Thank you for the info! I was trying to make an addon that would track kill counts of mobs and their locations. It sort of works right now, but since it is based on the name of the unit that comes through, you definitely get some weird "kills" like the Ice Barrier spell.

I will have to take a look at the functions for getting unit information and see what I can grab from that. The current method I have in place records kills for every non-friendly unit in combat, even if you die and don't kill them all. That is why I was asking how to figure out if enemies are still alive or not.

Food for thought though. Thanks
  Reply With Quote
02/12/21, 11:52 AM   #5
awfuldead
AddOn Author - Click to view addons
Join Date: Mar 2020
Posts: 17
Originally Posted by Regretfulone View Post
The current method I have in place records kills for every non-friendly unit in combat, even if you die and don't kill them all. That is why I was asking how to figure out if enemies are still alive or not.
what about add a condition to check if the player is alive?
  Reply With Quote
02/12/21, 12:17 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
I think he wanted to know if the critter is alive, not the player.
As there is no uniqueId for the critter and nothing after fight you could just check during fight what unitTags exist and also check if a unitTag gets destroyed -> should be the case as it will be killed.
EVENT_UNIT_DESTROYED (*string* _unitTag_)
-> Maybe not working for NPCs and critters, just group members and bosses .

* IsUnitDead(*string* _unitTag_)
** _Returns:_ *bool* _isDead_
GetUnitPower(CombatMechanicType)
+ the other GetUnit* and IsUnit* functions from the API txt documentation.

Maybe these only work with the unitTags you get from events and/or the "reticleover" where you need to move the crosshair above an enemy.

If these unitTags are not working for critters you might only be able to use events where there are _sourceUnitId_and _targetUnitId_ to identify the involved combatants.
  Reply With Quote
02/12/21, 12:24 PM   #7
Regretfulone
Join Date: Apr 2014
Posts: 6
Originally Posted by awfuldead View Post
what about add a condition to check if the player is alive?
So with LibCombat, I am using the FightSummary to parse the information. The problem is that if you die, all the enemies from the fight still come through and you can't get information about whether they were actually killed. I think Baertram's reply below is in line with what I was thinking where with the fight summary, I may need to check if each unit exists or not.

Originally Posted by Baertram View Post
I think he wanted to know if the critter is alive, not the player.
As there is no uniqueId for the critter and nothing after fight you could just check during fight what unitTags exist and also check if a unitTag gets destroyed -> should be the case as it will be killed.
EVENT_UNIT_DESTROYED (*string* _unitTag_)
-> Maybe not working for NPCs and critters, just group members and bosses .

* IsUnitDead(*string* _unitTag_)
** _Returns:_ *bool* _isDead_
GetUnitPower(CombatMechanicType)
+ the other GetUnit* and IsUnit* functions from the API txt documentation.

Maybe these only work with the unitTags you get from events and/or the "reticleover" where you need to move the crosshair above an enemy.

If these unitTags are not working for critters you might only be able to use events where there are _sourceUnitId_and _targetUnitId_ to identify the involved combatants.
Thanks for the input Baetram! I am thinking about how I might still be able to pull off the addon and this is definitely helpful! I was also thinking that it is likely that I will need to give people an option to create a 'blacklist' or an 'ignore' list so that they can ignore kills for silly things like Ice Barrier spell, unless they want to track that.

The other issue I foresee is that when citizens or npcs in a city become hostile and you kill them, that is also tracked. That is why I was hoping ESO offered a way to identify creatures that you can fight (alit, durzog, etc.).
  Reply With Quote
02/12/21, 01:13 PM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
You could maybe use the EVENT_JUSTICE* events to check if you have attacked any NPC. If it fires during combat it most probabyl was not because of stealing goods
Most probably the infamythresholdtype should be one of the higher ones if you attack or even kill an NPC:

h5. InfamyThresholdsType
* INFAMY_THRESHOLD_DISREPUTABLE
* INFAMY_THRESHOLD_FUGITIVE
* INFAMY_THRESHOLD_NOTORIOUS
* INFAMY_THRESHOLD_UPSTANDING
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » How to get information about monsters?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off