View Single Post
02/25/17, 01:09 AM   #5
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Originally Posted by decay2 View Post
As written in the chat maybe we should make a lib for this and other "lookup" things related to buffs / procs
Sure, that would be cool. Here is a simple function I was using to mine all the Major and Minor effect ability ID's for inclusion in the database:

Code:
local function FindByName(text)
	local matchedIDs = {}
	local compareName
	local auraName = text
	for id = 1, 100000 do -- scan all abilityIDs looking for this auraName
		if (DoesAbilityExist(id) and (GetAbilityDuration(id) > 0 or not IsAbilityPassive(id))) then
			compareName = zo_strformat("<<t:1>>",GetAbilityName(id)) -- strip out any control characters from the ability name
			if (compareName == auraName) then -- matching ability with a duration (no toggles or passives in prominence)
				table.insert(matchedIDs, id)
			end
		end
	end

	if (#matchedIDs > 0) then -- matches were found
		d("-- "..text)
		for _, id in ipairs(matchedIDs) do
			d("["..id.."] = ,")
		end
	end
end

Example use:

FindByName('Minor Force')
...and here's the current Major/Minor db from Srendarr:

Warning: Spoiler
  Reply With Quote