miens
Combos and Freedom
- Joined
- Nov 6, 2016
- Messages
- 61
- Reaction score
- 8
Hey
I had a spell modifying item attribute in tfs 1.2 and everything worked fine. I had to switch to older version and now when I call the same method (setAttribute) its not changing anything and even returns null. I tried debugging it for hours with no effect. Any ideas what might be wrong here?
I had a spell modifying item attribute in tfs 1.2 and everything worked fine. I had to switch to older version and now when I call the same method (setAttribute) its not changing anything and even returns null. I tried debugging it for hours with no effect. Any ideas what might be wrong here?
Code:
function onCastSpell(creature, variant)
local player = Player(creature)
local wpn = player:getSlotItem(CONST_SLOT_LEFT)
local atk = getAttackValue(wpn)
if atk >0 then
local parameters = {weapon = wpn, attack = atk, pl = player}
--addEvent(UndoStatMod,15000,parameters)
player:setStorageValue(1690, wpn:getUniqueId()+1)
--print(wpn.uid)
player:setStorageValue(1691, atk)
print(wpn:setAttribute(ITEM_ATTRIBUTE_ATTACK, atk+50))
--print(wpn.uid)
player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
return true;
else
player:sendCancelMessage('You must be holding a weapon.')
return false
end
end