function FCL.NewSkill(eventCode, Category, Type, MinXP, MaxXP, CurrentXP) local diff = 0 local inLevel = 0 local display = "" if (FCL.SkillsXP[Category][Type][3] >= CurrentXP) or (FCL.SkillsXP[Category][Type][3] == nil) then return end if (FCL.CText.Skills[Category][Type] == false) then return end diff = CurrentXP - FCL.SkillsXP[Category][Type][3] if FCL.SkillsXP[Category][Type][2] < CurrentXP then FCL.SkillsXP[Category][Type] = {GetSkillLineXPInfo(Category, Type)} else FCL.SkillsXP[Category][Type][3] = CurrentXP end inLevel = FCL.SkillsXP[Category][Type][2] - FCL.SkillsXP[Category][Type][1] percent = string.format( "%.2f" ,((CurrentXP - FCL.SkillsXP[Category][Type][1])/inLevel)*100) display = "|cc8ff3a+" .. diff .. " " .. FCL.SkillXPNames[Category][Type] .. " (" .. percent .. "%)" if (FCL.CText.Time == true) then table.insert(FCL.CText.You, 1, "[" ..GetTimeString() .. "]" .. display) else table.insert(FCL.CText.You, 1, display) end if FCL.CText.Chat == true then d(FCL.CText.You[1]) end if FCL.Hiden == "You" then FCL.FadeTime = GetGameTimeMilliseconds() for i = 1, FCL.CText.MaxLines do if FCL.CText.You[FCL.Value + i] ~= nil then _G["CombatLog_Textbox"..i]:SetText(FCL.CText.You[FCL.Value + i]) end end end end
percent = string.format( "%.2f" ,((CurrentXP - FCL.SkillsXP[Category][Type][1])/inLevel)*100)
inLevel = FCL.SkillsXP[Category][Type][2] - FCL.SkillsXP[Category][Type][1] percent = string.format( "%.2f" ,((CurrentXP - FCL.SkillsXP[Category][Type][1])/inLevel)*100) percentgain = string.format( "%.2f" ,(diff/inLevel)*100) display = "|cc8ff3a+" .. diff .. " " .. FCL.SkillXPNames[Category][Type] .. " (" .. percent .. "%) (" ..percentgain .. "%)"
function FCL.NewSkill(eventCode, Category, Type, MinXP, MaxXP, CurrentXP) local diff = 0 local skillXP, skillName local display = "" FCL.SkillsXP[Category] = FCL.SkillsXP[Category] or {} FCL.SkillXPNames[Category] = FCL.SkillXPNames[Category] or {} skillXP = FCL.SkillsXP[Category][Type] skillName = FCL.SkillXPNames[Category][Type] if skillXP == nil then FCL.SkillsXP[Category][Type] = {GetSkillLineXPInfo(Category, Type)} skillXP = FCL.SkillsXP[Category][Type] end if skillName == nil then FCL.SkillXPNames[Category][Type] = (GetSkillLineInfo(Category, Type)) skillName = FCL.SkillXPNames[Category][Type] end if (skillXP[3] >= CurrentXP) or (skillXP[3] == nil) then return end if FCL.CText.Skills[Category][Type] == false then return end diff = CurrentXP - skillXP[3] if skillXP[2] < CurrentXP then skillXP = {GetSkillLineXPInfo(Category, Type)} else skillXP[3] = CurrentXP end percent = ("%.2f"):format(((CurrentXP - skillXP[1])/(skillXP[2] - skillXP[1]))*100) display = zo_strformat("|cc8ff3a+<<1>> <<2>> (<<3>>%)|r", diff, skillName, percent) if (FCL.CText.Time == true) then table.insert(FCL.CText.You, 1, "[" ..GetTimeString() .. "]" .. display) else table.insert(FCL.CText.You, 1, display) end if FCL.CText.Chat == true then d(FCL.CText.You[1]) end if FCL.Hiden == "You" then FCL.FadeTime = GetGameTimeMilliseconds() for i = 1, FCL.CText.MaxLines do if FCL.CText.You[FCL.Value + i] ~= nil then _G["CombatLog_Textbox"..i]:SetText(FCL.CText.You[FCL.Value + i]) end end end end
function FCL.NewExp( eventCode, unitTag, currentExp, maxExp, reason ) local display = "" -- Bail if it's not earned by the player if ( unitTag ~= "player" ) then return end -- Don't display experience for veteran characters if ( eventCode == EVENT_EXPERIENCE_UPDATE and IsUnitVeteran('player') ) then return end -- Ignore finesse bonuses, they will get rolled into the next reward if ( reason == PROGRESS_REASON_FINESSE ) then return end -- Get the base experience local base = IsUnitVeteran('player') and FCL.VetXP or FCL.XP -- Calculate the difference local diff = currentExp - base -- Record Gains for current Game-play FCL.XPGain = FCL.XPGain + diff -- Ignore zero experience rewards if ( diff <= 0 ) then return end -- Only show if wanted if ( FCL.CText.XP == false ) then return end -- Update the base experience if ( IsUnitVeteran('player') ) then display = "|c75d3ff+" .. diff .. " Veteran Points" FCL.VetXP = currentExp else display = "|c75d3ff+" .. diff .. " Experience Points" FCL.XP = currentExp end -- Puts in time stamp from button if ( FCL.CText.Time == true ) then table.insert(FCL.CText.You, 1, "[" .. GetTimeString() .. "]" .. display) else table.insert(FCL.CText.You, 1, display) end if FCL.Hiden == "You" then for i = 1, FCL.CText.MaxLines do if FCL.CText.You[FCL.Value + i] ~= nil then _G["CombatLog_Textbox"..i]:SetText(FCL.CText.You[FCL.Value + i]) end end end end
function FCL.CharacterStats() FCL.CName = GetUnitName( 'player' ) FCL.XP = GetUnitXP('player') FCL.VetXP = GetUnitVeteranPoints('player') FCL.SkillsXP = {} FCL.SkillXPNames = {} for skillType = 1, GetNumSkillTypes() do FCL.SkillXPNames[skillType] = {} FCL.SkillsXP[skillType] = {} for skillLine = 1, GetNumSkillLines(skillType) do FCL.SkillXPNames[skillType][skillLine] = (GetSkillLineInfo(skillType, skillLine)) FCL.SkillsXP[skillType][skillLine] = {GetSkillLineXPInfo(skillType, skillLine)} end end end