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! |
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 |
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.). |
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 :) |
Quote:
|
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. |
Quote:
Quote:
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.). |
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 :p
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 |
All times are GMT -6. The time now is 09:02 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI