Addon Help: Checking Buffs on player
Moderator: Moderator
Addon Help: Checking Buffs on player
So, for the on_pre_use function that can be defined for a talent, it obviously returns a boolean But, I was wondering how do you check if the player has a certain buff/debuff on them? And a little bit more than that, how can you check how many stacks of that buff/debuff are on and then shove all that in the on_pre_use function? Thanks in advance.
A little bit of a starters guide written by yours truly here.
Re: Addon Help: Checking Buffs on player
Code: Select all
if self:hasEffect(self.EFF_FOO) then ...
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

-
- Spiderkin
- Posts: 543
- Joined: Sat Feb 11, 2012 1:12 am
Re: Addon Help: Checking Buffs on player
I like to add the following function to effects that are going to have their number of charges checked:
That way when I want to check if the effect is active and how many stacks are applied, I can just use
Code: Select all
getCharges = function(self, eff) return eff.cur_charges end,
Code: Select all
local charges = self:callEffect("EFF_EFFECT_NAME", "getCharges") or 0
Re: Addon Help: Checking Buffs on player
That's a fantastic bit of ToME shorthand, stinkstink!
Re: Addon Help: Checking Buffs on player
I concur, this is excellent!Nagyhal wrote:That's a fantastic bit of ToME shorthand, stinkstink!