• 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!

Lua set attribute rune tfs 1.3 8.6

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i need script for rune when i use on weapon then we got attribute +1% magiclevelpoints
 
thanks i will check it tommorow
Post automatically merged:


i try it and i have errors with player no value (158 line) but i try use updated version but it not working too, 0 errors but when i try add to item i got only [][][]:
Pj5ptjZ.png
 
Last edited:
thanks i will check it tommorow
Post automatically merged:



i try it and i have errors with player no value (158 line) but i try use updated version but it not working too, 0 errors but when i try add to item i got only [][][]:
Pj5ptjZ.png
Refresh
 
Okay, so in theory I know what to do, but I don't have the time to do it for you.


So in this code is the general idea.

You'd want to convert this into an onThink event or an onMove event, because it's impossible to register every item into movements.xml to check if it's being equipped or deEquipped. onMove would probably be the best way, altho onThink would be a lot easier to script.

But anyways, you'd check all the items on the character, and adjust / add / disable all the buffs.

--
For actually adding the information on the item, you'd want to use the following functions
Lua:
getCustomAttribute
setCustomAttribute
removeCustomAttribute

Setting the custom attribute, and then retrieving it should be simple enough.

onThink would be laughably easy, but resource intensive to reset the buff constantly.

onMove would be harder.. because of trying to script all of the edge cases. I'd probably just check if it moved into the item area, and then do an addEvent of 0 milliseconds, and do a full inventory scan to reset the buffs. Only downside is that there would be a tiny delay before the stats would apply, and that if it's a percentage magic level.. and the player leveled up, the buffs wouldn't update automatically.. so you'd have to think of edge cases like this, and have it trigger an update of the buff.. or just live with it, and get players to 'refresh the buff' on their own by relogging or requipping an item.

-- well anyway, hope that helps.


--- EDIT

lmao, looks like someone already created exactly my idea from above

This is what you're looking for, I guess

 
Okay, so in theory I know what to do, but I don't have the time to do it for you.


So in this code is the general idea.

You'd want to convert this into an onThink event or an onMove event, because it's impossible to register every item into movements.xml to check if it's being equipped or deEquipped. onMove would probably be the best way, altho onThink would be a lot easier to script.

But anyways, you'd check all the items on the character, and adjust / add / disable all the buffs.

--
For actually adding the information on the item, you'd want to use the following functions
Lua:
getCustomAttribute
setCustomAttribute
removeCustomAttribute

Setting the custom attribute, and then retrieving it should be simple enough.

onThink would be laughably easy, but resource intensive to reset the buff constantly.

onMove would be harder.. because of trying to script all of the edge cases. I'd probably just check if it moved into the item area, and then do an addEvent of 0 milliseconds, and do a full inventory scan to reset the buffs. Only downside is that there would be a tiny delay before the stats would apply, and that if it's a percentage magic level.. and the player leveled up, the buffs wouldn't update automatically.. so you'd have to think of edge cases like this, and have it trigger an update of the buff.. or just live with it, and get players to 'refresh the buff' on their own by relogging or requipping an item.

-- well anyway, hope that helps.


--- EDIT

lmao, looks like someone already created exactly my idea from above

This is what you're looking for, I guess


Bro, check my last refresh what i repley, i add this script by zbizu but when i try add some attributes to Item i got only "[]" you can saw it on screen in my post up
 
Back
Top