View Single Post
05/08/24, 04:30 PM   #2
Toirealach
AddOn Author - Click to view addons
Join Date: Sep 2020
Posts: 30
This is from VampRemind.lua which is one of the files in my Reminderz addon:

Code:
-- VampireStageType
NOT_A_VAMPIRE = 0
VAMPIRE_STAGE_1 = 135397
VAMPIRE_STAGE_2 = 135399
VAMPIRE_STAGE_3 = 135400
VAMPIRE_STAGE_4 = 135402

-- * IsVampire()
-- ** *bool* _isVampire_
function IsVampire()
	return (GetVampireStage() ~= NOT_A_VAMPIRE)
end

-- * GetVampireStage()
-- ** _Returns:_ *VampireStageType* _vampireStage_, *number:nilable* _timeEnding_, *string:nilable* _vampireStageName_, *string:nilable* _iconFileName_
function GetVampireStage()

	for n = 0, GetNumBuffs("player") do
		local buffName, timeStarted, timeEnding, _, _, iconFilename, _, _, abilityType, _, abilityId, _, _ = GetUnitBuffInfo("player", n)
		if (abilityId == VAMPIRE_STAGE_1) or (abilityId == VAMPIRE_STAGE_2) or (abilityId == VAMPIRE_STAGE_3) or (abilityId == VAMPIRE_STAGE_4) then
			return abilityId, timeEnding, buffName, iconFilename 
		end
	end

	return NOT_A_VAMPIRE, nil, nil, nil, nil 
end
  Reply With Quote