• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.1 Upgrading weapon magic level

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:
Code:
magic = 1, -- magic level

doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_MAGICPOINTS,  upgrading.upValue(it:getMagLevel(), nLevel, conf["upgrade"].magic))
and in my data/lib/item_attributes.lua I have this
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.
 
BUMP!
and thanks for attempting.
I thought about using something like that to maybe "dump" a list of all attributes and grabbing the name from that, but I am not sure how to do that without an input into everything
 
this doesn't exist in attributes, it's defined as an ability which are static and can't be changed through lua
you have to use conditions and use a movement script to replicate this
i've made a system for 1.2+ to resolve this issue, but since you're using 1.1 i don't know if you'll want to implement it or even try
here it is anyways: Lua Function - [TFS 1.3] Item abilities via Lua
 
Back
Top