Code: Select all
if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end
Code: Select all
if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam.dam) end
Code: Select all
if type(dam) == "number" then
if dam > 0 then
dr = math.min(dam, fa)
print("[ATTACK]\ttarget on_melee_hit:", dam, typ, "vs", fa)
dam = dam - dr
if dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end
if dr > 0 and pct > 0 then
dr = math.floor(dr*pct/100)
if dr > 0 then
print("[ATTACK]\ttarget on_melee_hit", dr, typ, "reflected")
DT.projector(self, target.x, target.y, typ, dr)
end
end
end
elseif dam.dam and dam.dam > 0 then
dr = math.min(dam.dam, fa)
print("[ATTACK]\ttarget on_melee_hit:", dam.dam, typ, "vs", fa)
if dr > 0 then dam = table.clone(dam); dam.dam = dam.dam - dr end
if dam.dam > 0 then DT.projector(target, self.x, self.y, typ, dam) end
if dr > 0 and pct > 0 then
dr = math.floor(dr*pct/100)
if dr > 0 then
print("[ATTACK]\ttarget on_melee_hit", dr, typ, "reflected")
dam.dam = dr -- only change dam
DT.projector(self, target.x, target.y, typ, dam)
end
end
end
I picked this up working on my addon Verbose.