Download
(7 Kb)
Download
Updated: 10/05/15 12:24 AM
Pictures
File Info
Compatibility:
Update 7 (1.7.0)
Updated:10/05/15 12:24 AM
Created:04/20/14 05:45 PM
Monthly downloads:45
Total downloads:8,182
Favorites:28
MD5:
X4D XP  Popular! (More than 5000 hits)
Version: 1.12
by: wilson0x4d [More]
X4D XP

A LibStub-compatible XP Add-On.

Features
  • Outputs 'XP' Gains to Chat Window.
  • Includes reason for XP Gain (such as Boss, Kill, Quest, etc.)
  • Can be integrated with via LibStub, and a callback can be set via: X4D_XP:RegisterCallback(function(color, text) d(color .. text) end)
  • Integrated into X4D Chat Add-On which provides time-stamp support for all **X4D XP** output.

Planned Features
  • Display of Quest Name for Quest Progressions/Reward XP Gains. -- IMPLEMENTED! (v1.1)
  • Display of Zone/POI Name(s) for Discovery and POI Completion XP Gains. -- IMPLEMENTED! (v1.1)
  • Display of Skill-specific XP Gains (rather than Player XP, for example, XP/TNL for 2-Hand or Undaunted Skill Lines)

Installation

First, make sure you have the latest X4D Core installed.

As with most Addons, simply open the Archive and copy the contents into "%USERPROFILE%\Documents\Elder Scrolls Online\live\Addons\" folder.

If ESO is already running, execute /reloadui command.


Change Log

To see version history, including 'vNext' (soon to be published) changes, view the README on Github.
Optional Files (0)


Post A Reply Comment Options
Unread 06/29/14, 11:58 AM  
Garkin
 
Garkin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 832
File comments: 1097
Uploads: 33
Re: Re: vp for discovery has been nerfed

Originally Posted by Marcent
Can u please update this addon?
This addon doesn't have enabled option for uploading patches, so it has to be updated by original author.
However if you want, this is updated X4D_XP.lua that works with patch 1.2.3:
Lua Code:
  1. local X4D_XP = LibStub:NewLibrary('X4D_XP', 1005)
  2. if (not X4D_XP) then
  3.    return
  4. end
  5.  
  6. X4D_XP.NAME = 'X4D_XP'
  7. X4D_XP.VERSION = '1.5'
  8.  
  9. X4D_XP.Settings = {}
  10. X4D_XP.Settings.SavedVars = {}
  11. X4D_XP.Settings.Defaults = {
  12.    None = 'true',
  13. }
  14.  
  15. X4D_XP.Colors = {
  16.    XP = '|cAA33FF',
  17.    VP = '|cAA33FF',
  18.    Gray = '|cC5C5C5',
  19.    X4D = '|cFFAE19',
  20. }
  21.  
  22. local _progressReasons = {
  23.    [PROGRESS_REASON_ACHIEVEMENT] = 'Achievement',
  24.    [PROGRESS_REASON_ACTION] = 'Action',
  25.    [PROGRESS_REASON_ALLIANCE_POINTS] = 'AP',
  26.    [PROGRESS_REASON_AVA] = 'AvA',
  27.    [PROGRESS_REASON_BATTLEGROUND] = 'Battleground',
  28.    [PROGRESS_REASON_BOOK_COLLECTION_COMPLETE] = 'Collection',
  29.    [PROGRESS_REASON_BOSS_KILL] = 'Boss',
  30.    [PROGRESS_REASON_COLLECT_BOOK] = 'Book',
  31.    [PROGRESS_REASON_COMMAND] = 'Command',
  32.    [PROGRESS_REASON_DARK_ANCHOR_CLOSED] = 'Anchor',
  33.    [PROGRESS_REASON_DARK_FISSURE_CLOSED] = 'Fissure',
  34.    [PROGRESS_REASON_DUNGEON_CHALLENGE] = 'Challenge',
  35.    [PROGRESS_REASON_EVENT] = 'Event',
  36.    [PROGRESS_REASON_FINESSE] = 'Finesse',
  37.    [PROGRESS_REASON_GRANT_REPUTATION] = 'Reputation',
  38.    [PROGRESS_REASON_GUILD_REP] = 'Guild',
  39.    [PROGRESS_REASON_KEEP_REWARD] = 'Keep',
  40.    [PROGRESS_REASON_KILL] = 'Kill',
  41.    [PROGRESS_REASON_LOCK_PICK] = 'Lockpicking',
  42.    [PROGRESS_REASON_MEDAL] = 'Medal',
  43.    [PROGRESS_REASON_NONE] = 'None',
  44.    [PROGRESS_REASON_OTHER] = 'Other',
  45.    [PROGRESS_REASON_OVERLAND_BOSS_KILL] = 'Boss',
  46.    [PROGRESS_REASON_PVP_EMPEROR] = 'Emperor',
  47.    [PROGRESS_REASON_REWARD] = 'Reward',
  48.    [PROGRESS_REASON_SCRIPTED_EVENT] = 'Event',
  49.    [PROGRESS_REASON_SKILL_BOOK] = 'Book',
  50.    [PROGRESS_REASON_TRADESKILL] = 'Tradeskill',
  51.    [PROGRESS_REASON_TRADESKILL_ACHIEVEMENT] = 'Acheivement',
  52.    [PROGRESS_REASON_TRADESKILL_CONSUME] = 'Consumption',
  53.    [PROGRESS_REASON_TRADESKILL_HARVEST] = 'Harvest',
  54.    [PROGRESS_REASON_TRADESKILL_QUEST] = 'Quest',
  55.    [PROGRESS_REASON_TRADESKILL_RECIPE] = 'Recipe',
  56.    [PROGRESS_REASON_TRADESKILL_TRAIT] = 'Trait',
  57. }
  58.  
  59. local function GetReason(reasonIndex)
  60.    return _progressReasons[reasonIndex]
  61. end
  62.  
  63. local function DefaultCallback(color, text)
  64.    CHAT_SYSTEM:AddMessage(color .. text)
  65. end
  66.  
  67. X4D_XP.Callback = DefaultCallback
  68.  
  69. function X4D_XP.RegisterCallback(self, callback)
  70.    if (callback ~= nil) then
  71.       X4D_XP.Callback = callback
  72.    else
  73.       X4D_XP.Callback = DefaultCallback
  74.    end
  75. end
  76.  
  77. function X4D_XP.UnregisterCallback(self, callback)
  78.    if (X4D_XP.Callback == callback) then
  79.       self:RegisterCallback(nil)
  80.    end
  81. end
  82.  
  83. local function InvokeCallbackSafe(color, text)
  84.    local callback = X4D_XP.Callback
  85.    if (color == nil) then
  86.       color = '|cFF0000'
  87.    end
  88.    if (color:len() < 8) then
  89.       d('bad color color=' .. color:gsub('|', '!'))
  90.       color = '|cFF0000'
  91.    end
  92.    if (callback ~= nil) then
  93.       callback(color, text)
  94.    end
  95. end
  96.  
  97. local _pointType = 'XP'
  98.  
  99. local function GetAmountAndType(level, previousExperience, currentExperience, rank, previousPoints, currentPoints)
  100.    local rankSize
  101.    if rank then
  102.       rankSize = GetNumVeteranPointsInRank(rank)
  103.    end
  104.    if rankSize ~= nil and currentPoints > previousPoints then
  105.       return currentPoints - previousPoints, 'VP'
  106.    else
  107.       local levelSize
  108.       if level then
  109.          levelSize = GetNumExperiencePointsInLevel(level)
  110.       end
  111.       if levelSize ~= nil and currentExperience >  previousExperience then
  112.          return currentExperience - previousExperience, 'XP'
  113.       end
  114.    end
  115. end
  116.  
  117. local function OnQuestComplete(eventCode, questName, level, previousExperience, currentExperience, rank, previousPoints, currentPoints)
  118.    local amount, pointType = GetAmountAndType(level, previousExperience, currentExperience, rank, previousPoints, currentPoints)
  119.    InvokeCallbackSafe(X4D_XP.Colors[pointType], zo_strformat('<<1>> <<2>> for|r <<3>><<4>>|r', amount, pointType, X4D_XP.Colors.X4D, questName))
  120. end
  121.  
  122. local function OnDiscoveryExperience(eventCode, subzoneName, level, previousExperience, currentExperience)
  123.    if IsUnitVeteran('player') then return end
  124.    InvokeCallbackSafe(X4D_XP.Colors[_pointType], zo_strformat('<<1>> <<2>> for Discovery|r <<3>><<4>>|r', (currentExperience - previousExperience), _pointType, X4D_XP.Colors.X4D, subzoneName))
  125. end
  126.  
  127. local function OnObjectiveCompleted(eventCode, zoneIndex, poiIndex, level, previousExperience, currentExperience, rank, previousPoints, currentPoints)
  128.    local amount, pointType = GetAmountAndType(level, previousExperience, currentExperience, rank, previousPoints, currentPoints)
  129.    if amount then
  130.       local objectiveName = GetPOIInfo(zoneIndex, poiIndex)
  131.       if (objectiveName ~= nil and objectiveName ~= "") then
  132.          InvokeCallbackSafe(X4D_XP.Colors[pointType], zo_strformat('<<1>> <<2>> for|r <<3>><<4>>|r', amount, pointType, X4D_XP.Colors.X4D, objectiveName))
  133.       else
  134.          InvokeCallbackSafe(X4D_XP.Colors[pointType], zo_strformat('<<1>> <<2>> for POI|r', amount, pointType))
  135.       end
  136.    end
  137. end
  138.  
  139. local _currentExp = 0
  140.  
  141. local function OnExperienceUpdate(eventCode, unitTag, currentExp, maxExp, reasonIndex)
  142.    if (unitTag ~= 'player' or IsUnitVeteran('player')) then
  143.       return
  144.    end
  145.    local xpGained = currentExp - _currentExp
  146.    if (xpGained > 0) then
  147.       local reason = GetReason(reasonIndex)
  148.       if (reason ~= nil) then
  149.          InvokeCallbackSafe(X4D_XP.Colors.XP, zo_strformat('<<1>> XP for <<2>>', xpGained, reason))
  150.       end
  151.    end
  152.    _currentExp = currentExp
  153. end
  154.  
  155. local _currentVP = 0
  156.  
  157. local function OnVeteranPointsUpdate(eventCode, unitTag, currentVP, maxVP, reasonIndex)
  158.    if (unitTag ~= 'player') then
  159.       return
  160.    end
  161.    local vpGained = currentVP - _currentVP
  162.    if (vpGained > 0) then
  163.       local reason = GetReason(reasonIndex)
  164.       if (reason ~= nil) then
  165.          InvokeCallbackSafe(X4D_XP.Colors.VP, zo_strformat('<<1>> VP for <<2>>', vpGained, reason))
  166.       else
  167.          InvokeCallbackSafe(X4D_XP.Colors.VP, zo_strformat('<<1>> VP', vpGained))
  168.       end
  169.    end
  170.    _currentVP = currentVP
  171. end
  172.  
  173. function X4D_XP.OnAddOnLoaded(event, addonName)
  174.    if (addonName ~= X4D_XP.NAME) then
  175.       return
  176.    end
  177.    X4D_XP.Settings.SavedVars = ZO_SavedVars:NewAccountWide(X4D_XP.NAME .. '_SV', 1.0, nil, X4D_XP.Settings.Defaults)
  178.    X4D_XP.Register()
  179. end
  180.  
  181. function X4D_XP.Register()
  182.    EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_QUEST_COMPLETE, OnQuestComplete)
  183.    EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_DISCOVERY_EXPERIENCE, OnDiscoveryExperience)
  184.    EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_OBJECTIVE_COMPLETED, OnObjectiveCompleted)
  185.    EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_EXPERIENCE_UPDATE, OnExperienceUpdate)
  186.    EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_VETERAN_POINTS_UPDATE, OnVeteranPointsUpdate)
  187. end
  188.  
  189. function X4D_XP.Unregister()
  190. end
  191.  
  192. function X4D_XP.OnPlayerActivated()
  193.    _currentExp = GetUnitXP('player')
  194.    if (IsUnitVeteran('player')) then
  195.       _currentVP = GetUnitVeteranPoints('player')
  196.       _pointType = 'VP'
  197.    else
  198.       _pointType = 'XP'
  199.    end
  200. end
  201.  
  202. EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_ADD_ON_LOADED, X4D_XP.OnAddOnLoaded)
  203. EVENT_MANAGER:RegisterForEvent(X4D_XP.NAME, EVENT_PLAYER_ACTIVATED, X4D_XP.OnPlayerActivated)

EDIT:
Fixed XP issues for VR characters.
Last edited by Garkin : 07/07/14 at 06:51 AM.
Report comment to moderator  
Reply With Quote
Unread 04/16/15, 03:38 AM  
wilson0x4d
Premium Member
 
wilson0x4d's Avatar
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 180
Uploads: 10
Post v1.5 - API Updates and misc fixes

I've gone through comments and PMs for this addon and made all the changes I can verify. Unfortunately I'm still working on achieving veteran rank (writing clean code takes time) and haven't tested VP-specific features (the code looks proper, but I don't know without a Veteran toon to test with.)

Thanks!
Report comment to moderator  
Reply With Quote
Unread 04/19/15, 05:05 AM  
heruel

Forum posts: 0
File comments: 15
Uploads: 0
Re: v1.5 - API Updates and misc fixes

It seems that Alliance Point are not reported.
Killing guards in PVP with a v14 character I get a notify of experience but with a very high and wrong number. (it's ok to get XP gain as it will go for champion points but the number is completely wrong).

It would be nice to be able to put those notification in a different chat windows or to be able to define what XP gain you want to see (for example I'm most interested in AP).
Report comment to moderator  
Reply With Quote
Unread 04/19/15, 01:20 PM  
wilson0x4d
Premium Member
 
wilson0x4d's Avatar
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 180
Uploads: 10
Thumbs up Re: Re: v1.5 - API Updates and misc fixes

PLANNED- Support for Alliance Points (Loot)
PLANNED- Output to Specific Chat Tab (Chat)

Originally Posted by heruel
It seems that Alliance Point are not reported.
I'll work it in, but I think it belongs in the Loot mod (which, optionally, reports monetary changes.)

I'll review the Loot mod options and make sure everything is optional so users only interested in AP gains can use it just for the AP gains.

Originally Posted by heruel
Killing guards in PVP with a v14 character I get a notify of experience but with a very high and wrong number. (it's ok to get XP gain as it will go for champion points but the number is completely wrong).
The incorrect values are being addressed, I have a potential fix fix that will go out soon, I'm without a Vet ranked character to test this with.

Originally Posted by heruel
It would be nice to be able to put those notification in a different chat windows or to be able to define what XP gain you want to see (for example I'm most interested in AP).
I'll review the Chat Tabs API and code from ESO and see what I can do.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: