A quick Progressbar for PWS tracking on yourself would be
Code:
dyeyjaGiP4sKeQrHuDkKYSa4wsPyxuvkddQYXqsldIYZKQ00uvPRbO2gvfFJKY4GO6CsvzDqKMhvLu3JIAFuvchKISqsQEOQkMijjxKQQnkvXhHiAKuvIojjPwjfMjGCtsc2PuYpLQQHcblfQQNcAQO4QqOTsvP6RQQ6Suvs2lXFLkdw5WaTysLhJstgkxwLntv(SQYOrIttLxdry2K42KYUr8BknCOYYr1ZH00LCDvz7Ke9DPunEPu68KQMpjHSFXcvHrGGcJucevGiZ3WZ38rGAcetGycJarpfpeSosjq17NHPFvai)9Wiq(95Seg94ob(XTpCcK80y4UVVJJkTOkqhMavhKlqfliMWiqUv5egbQ9ukNWiLusjWRT4ajyhMOUucKvyKwufgbYVpNLWOh3jW6ABjWI7((oUWiWspUtGSp0YQjWtLhPqficazYx5h)o)Ty8JVQBHKD)7hFGuLazFOLvRR0J7e4PYJucK9Hwwnb69iSLZsOtllgzzzz)n1bQd1Y1LzodVyCembY(qlRwhfh2jWYPDysjW2DyffPN(Wdp1O2hYqMAa)l1(O2RpIxB(f5c0HjW)MqVsGKNgd399DCuPfvbs5CFukPhFudyG7vnGrovKRwVa7dvFeV28BFcuXcIjmcKBvoHrGApLYjmsjLusjTqMWiq(95Seg94obwxBlbwC333Xfgbw6XDcK9HwwnbEQ8ifQa)PFvqDtmDa1ps253393IPdXw9OAGy8JVFvjq2hAz16k94obEQ8iLazFOLvtGEpcB5Se6Da6aaYwolbqhGoayhAbOdqhGoaDa6a0bOdakUtrPfO2rlgzzzzoVmSdTYmBodjVcrIRAbQD0BWPaQ)4n0YajyzO4ofLwGAxMzZzniyB)4z)TCmKMbP4ofSMSIYrIrwwwwwwwMZldKTCwsMzZznqe8deqDMqeFtDMqabGuTFv1Kz5zGSLZsYmBoRbIGFGaQZeI4BQdF)9GVFOVSjROCKyKLLLLLLLLLLL93uhOoulxxM5m0t5yl6ubgaIexP(ZZJEdofq9hVbqdc22pE2FlhdPzqkU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AOrlghblltGSuowKqGpCyG1jLavSGycJa5wLtyeO2tPCcJusjLajpngU7774OslQcKFFolHrpUtGGpoOoqUaXCO4ua1ZCTTW39rPeyMkgvGombYq5uhKlq0cKfjqfDsjLavP0I6VuXtkra
Step by Step to create would be:
To show a progressbar you have two different methods: timed and value-based. You want to track a "static" number: your PWS absorb amount. I did this with 3 weakaura elements.
First I made a variable to save the absorb amount I get when the shield is cast. Creating a Text-Trigger with Custom Settings:
Code:
Type: Custom
Event(s): PLAYER_ENTERING_WORLD
Custom Trigger:
function()
WA_absorb = 0
end
WA_absorb is a global variable, so you can access it everywhere in WA. Just give it a unique name, or you can damage other addons. This trigger fires everytime you enter the world, meaning: log-in, join a instance, etc. to initialize this variable.
Second is the trigger for checking if you got PWS buff:
Used a text-based trigger with following settings:
Code:
Type: Custom
Event Type: Event
Event(s): COMBAT_LOG_EVENT_UNFILTERED
Custom Trigger:
function(_,_,action,_,_,dest,_,_,_,_,_,_,_,spellName)
if dest == GetUnitName("player") and spellName == "Power Word: Shield" then
if action == "SPELL_AURA_APPLIED" or action == "SPELL_AURA_REFRESH" then
WA_absorb = select(15,UnitBuff("player","Power Word: Shield"))
end
if action == "SPELL_AURA_REMOVED" then
WA_absorb = 0
end
end
end
I am not going about all the lua functions and all (wowprogramming.com gives you the informations you need). All it does is:
- Getting PWS it sets the global variable to the initial absorb amount
- Removing PWS it sets the global variable to 0
The last is the Progressbar. Create it, go to triggers and set it to custom and set it to
Code:
Event Type: Status
Check On... Every Frame
The following textboxes are the needed informations for the bar:
Custom Trigger: When should the bar be shown
Custom Untrigger: When should it be hidden
Duration Info: Informations about the duration (time or value)
Name Info: If you want to use text Information (e.g. %n) you set the Name here
Icon Info: Which icon should be shown
Stack Info: Amount of stacks that can be shown (you can use %s to show them in the bar) (PWS stacks = absorb amount remaining)
The only important thing is the duration, where you have to return 3 parameters:
Code:
return duration, expirationTime, static
duration is the absorb amount you have right now
expirationTime is the max absorb you had
static needs to be set, to make the bar value based.
If you set duration = expirationTime your bar will never diminish.
---
Hope this helped somehwat. If more questions, just ask