Quantcast
Download
(5 Kb)
Download
Updated: 04/18/19 01:36 PM
Compatibility:
Elsweyr (5.0.5)
Wrathstone (4.3)
Updated:04/18/19 01:36 PM
Created:04/18/19 01:36 PM
Monthly downloads:633
Total downloads:6,439
Favorites:3
MD5:
LibXPBonus  Popular! (More than 5000 hits)
Version: 0.0.1
by: Baertram [More]
LibXPBonus
A library to help with XP bonus buffs.
It contains a list of the XP bonus buffs (abilityId) and some API functions to check if you got a specific buff, or any buff, of these active.

[Planned features]
None

Where is the data?
Your instance of LibXPBonus contains 1 "local" internal table "XPBonusData" with the abilityId of teh XP Bonus buff as key.

API functions of the library:
[highlight="Lua"]
--Global variable of the library to access it:
LibXPBonus

Last scanned character buffs:
LibXPBonus.currentPlayerBuffs
Contains a table with this info:
Code:
currentPlayerBuffs[abilityId] = {
					["name"] 				= buffName,
					["startTime"] 			= startTimeInMilliseconds,
					["endTime"] 			= endTimeTimeInMilliseconds,
					["timeLeft"]			= timeLeftInMilliseconds,
					["startTimeFormatted"] 	= formattedStartTimeWithFormatFrom os.time,
					["endTimeFormatted"] 	= formattedEndTimeWithFormatFrom os.time,
					["timeLeftFormatted"]	= formattedTimeLeftWithFormatFrom os.time ,
					["buffSlot"] 			= buffSlot,
					["stackCount"] 			= stackCount,
					["iconFile"] 			= iconFile,
					["buffType"] 			= buffType,
					["effectType"] 			= effectType,
					["abilityType"] 		= abilityType,
					["statusEffectType"] 	= statusEffectType,
					["abilityId"]			= abilityId,
					["canClickOff"] 		= canClickOff,
				}
--> These values are determiend via this API function (except teh formatted time entries!):
Code:
        --** _Returns: _buffName_, _timeStarted_, _timeEnding_, _buffSlot_, _stackCount_, _iconFilename_, _buffType_, _effectType_, _abilityType_, _statusEffectType_, _abilityId_, _canClickOff_ = GetUnitBuffInfo("player", buffIndex)
The buffIndex starts at 1 and the maximum is given via API function:
Code:
GetNumBuffs("player")
API functions
Lua Code:
  1. --Returns true if the player got an XP bonus currently ative
  2. --> Returns:    boolean isXPBonusActive
  3. -->             NILABLE number abilityIdFound   (the abilityId of the XPBuff found)
  4. function LibXPBonus.IsAnyXPBonusActive()
  5.  
  6. --Returns true if the player got the XP bonus currently ative, provided with parameter abilityId
  7. --abilityId:            AbilityId of an ability e.g. the XP buff
  8. --> Returns:    boolean isXPBonusActive
  9. function LibXPBonus.IsXPBonusActive(abilityId)
  10.  
  11. --Returns a table containing the current player buffs, with the info determined via API function GetUnitBuffInfo()
  12. --> NILABLE Boolean formattedTime: Should the output table contain the entries for the formatted time?
  13. --> NILABLE String timeFormat:     Will only be used if parameter formattedTime == true. If timeFormat is left empty "", the standard format will be used.
  14. --->                               Else the function os.time will be used to use the given format string. Check the possible values for os.time in the lua docs please!
  15. --> Returns:    table currentPlayerBuffsInfo
  16. --[[
  17. currentPlayerBuffsInfo[abilityId] = {
  18.                 ["name"]                = buffName,
  19.                 ["startTime"]           = startTime,
  20.                 ["endTime"]             = endTime,
  21.                 ["startTimeFormatted"]  = startTimeFormattedWithParameter timeFormat (via os.time function)
  22.                 ["endTimeFormatted"]    = endTimeFormattedWithParameter timeFormat (via os.time function)
  23.                 ["timeLeftFormatted"]   = timeLeftFormattedWithParameter timeFormat (via os.time function)
  24.                 ["buffSlot"]            = buffSlot,
  25.                 ["stackCount"]          = stackCount,
  26.                 ["iconFile"]            = iconFile,
  27.                 ["buffType"]            = buffType,
  28.                 ["effectType"]          = effectType,
  29.                 ["abilityType"]         = abilityType,
  30.                 ["statusEffectType"]    = statusEffectType,
  31.                 ["abilityId"]           = abilityId,
  32.                 ["canClickOff"]         = canClickOff,
  33.             }
  34. ]]         
  35. function LibXPBonus.GetCurrentPlayerBuffs(formattedTime, timeFormat)
  36.  
  37. --Returns a table of the active XP bonus buffs, with the info determined via API function GetUnitBuffInfo()
  38. --> NILABLE Boolean formattedTime: Should the output table contain the entries for the formatted time?
  39. --> NILABLE String timeFormat:     Will only be used if parameter formattedTime == true. If timeFormat is left empty "", the standard format will be used.
  40. --->                               Else the function os.time will be used to use the given format string. Check the possible values for os.time in the lua docs please!
  41. --> Returns:    table currentPlayerBuffsXPBonusInfo
  42. --[[
  43. currentPlayerBuffsXPBonusInfo[abilityId] = {
  44.                 ["name"]                = buffName,
  45.                 ["startTime"]           = startTime,
  46.                 ["endTime"]             = endTime,
  47.                 ["startTimeFormatted"]  = startTimeFormattedWithParameter timeFormat (via os.time function)
  48.                 ["endTimeFormatted"]    = endTimeFormattedWithParameter timeFormat (via os.time function)
  49.                 ["timeLeftFormatted"]   = timeLeftFormattedWithParameter timeFormat (via os.time function)
  50.                 ["buffSlot"]            = buffSlot,
  51.                 ["stackCount"]          = stackCount,
  52.                 ["iconFile"]            = iconFile,
  53.                 ["buffType"]            = buffType,
  54.                 ["effectType"]          = effectType,
  55.                 ["abilityType"]         = abilityType,
  56.                 ["statusEffectType"]    = statusEffectType,
  57.                 ["abilityId"]           = abilityId,
  58.                 ["canClickOff"]         = canClickOff,
  59.             }
  60. ]]         
  61. function LibXPBonus.GetCurrentPlayerXPBonusBuffs(formattedTime, timeFormat)
GitHub - If you want to contribute
Currently not on GitHub
Optional Files (0)


There have been no comments posted to this file.
Be the first to add one.



Category Jump: