Okay, so in theory I know what to do, but I don't have the time to do it for you.
Please request actions / creatureevents / globalevents / npcs / movements / talkactions Do not request spells / weapons / monsters / source editing / database queries My goal of this thread is to learn TFS 1.3 scripting. ------------------------------------ Support If you have an issue with...
otland.net
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
this but updated (no backwards compability) example set generated by player:generateSetTest(): example use: local it = player:addItem(2125, 1) it:setMaxSockets(3) it:addStat("HP", "+2%") it:addStat("Sword", "+2") it:removeStat(2) -- removes sword buff changelog: compatibility with tfs...
otland.net