luddex
New Member
- Joined
- Dec 18, 2012
- Messages
- 19
- Reaction score
- 1
I have a script thanks to @zbizu and @Azi that increases the items stats when using the upgrade item on it.
I have modified the code to destroy the item if the upgrade fails at a higher upgrade count and now want to add in to increase the magic level if it can.
My problem is I can't find a way to call the items attribute magic level. I've tried:
getmagicpoints
getmagic
getmagicpointslevel
getskill_magic
getmaglevel
and others..
I always receive an error that it is trying to call a nill value.
here is what I'm working with. In my data/actions/scripts/upgrade.lua I have this line:
and in my data/lib/item_attributes.lua I have this
All other parts work great. I just cannot get it to "get" the magic level of the item.
I have modified the code to destroy the item if the upgrade fails at a higher upgrade count and now want to add in to increase the magic level if it can.
My problem is I can't find a way to call the items attribute magic level. I've tried:
getmagicpoints
getmagic
getmagicpointslevel
getskill_magic
getmaglevel
and others..
I always receive an error that it is trying to call a nill value.
here is what I'm working with. In my data/actions/scripts/upgrade.lua I have this line:
Code:
magic = 1, -- magic level
doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_MAGICPOINTS, upgrading.upValue(it:getMagLevel(), nLevel, conf["upgrade"].magic))
Code:
[ITEM_ATTRIBUTE_MAGICPOINTS] = i:getMagLevel(),
["magic"] = i:getMagLevel(),
All other parts work great. I just cannot get it to "get" the magic level of the item.