Thread Tools Display Modes
02/18/20, 10:31 AM   #1
Grumble-Bee
Join Date: Feb 2020
Posts: 2
Dungeon Completion Counter?

I'm just starting to learn how to make addons and was thinking about making a counter for how many times each character has finished a dungeon. Would this be possible to do at all?
  Reply With Quote
02/19/20, 02:50 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,903
Should be possible, yes.
If you find the information what tells you you have "finished" the dungeon -> Killed last boss?
Then it would be an event you are able use some combat events to track if the name of the last boss (or maybe they got unique IDs meanwhile to identify them but I doubt this ) and it's health.
Maybe EVENT_TARGET_CHANGED (number eventCode, string unitTag) and EVENT_UNIT_DESTROYED (number eventCode, string unitTag) may help here.
If it was a raid you could use
EVENT_RAID_TRIAL_COMPLETE (number eventCode, string trialName, number score, number totalTime)

And you could use EVENT_ZONE_CHANGED for the zoneId to check what dungeon you are currently in.
Together with maybe LibZone.
Or other libraries that assist here.

In addition there are API functions (See a list of API versions and their API TXT Documentation here: https://wiki.esoui.com/APIVersion)
e.g. for API100029 Dragonhold: https://www.esoui.com/forums/attachm...9&d=1571694949

Example API functions maybe usefull:
GetUnitName -> Name of the unit
IsUnitInDungeon -> Is the unit in a dungeon true/false
GetUnitPower -> Provide a powertype (CombatMechanicType) and check the value. Maybe not needed if the EVENT_UNIT_DESTROYED fires for boss unitTags if they die.

A unit could be the unitTag from the events above or "player" for yoruself.

Last edited by Baertram : 02/19/20 at 02:53 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Dungeon Completion Counter?

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