I have a throwing knife talent that uses stacks on a temporary effect to simulate ammo. To make it simple, I wanted it to restore knives while resting, via the following callback:
Code: Select all
callbackOnRest = function(self, t)
local reload = self:callTalent(self.T_THROWING_KNIVES, "getReload")
local max = self:callTalent(self.T_THROWING_KNIVES, "getNb")
self:setEffect(self.EFF_THROWING_KNIVES, 1, {stacks=reload, max_stacks=max })
end,
However, what instead happens is that when you hit the rest key, even if there are mobs nearby and you only rest for 0 turns it still restores your stacks to maximum. What am I doing wrong?