Codex NG
Recurrent Flamer
- Joined
- Jul 24, 2015
- Messages
- 2,994
- Solutions
- 12
- Reaction score
- 1,657
Since I've decided to work on a Runescape based server, I don't think I will be needing this system anymore, so I will just provide this community with the incomplete version of the library I was building and then possibly one of you can expand upon the idea.
Had to remove most of the comments to post the code , I don't like using pastebin.
Magic Library, this can be placed in its own file and referenced via global.lua, it is used to assign, attributes, transformations and even spells to items when equipped
Had to remove most of the comments to post the code , I don't like using pastebin.
Magic Library, this can be placed in its own file and referenced via global.lua, it is used to assign, attributes, transformations and even spells to items when equipped
Code:
--[[
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
Code:
function generateConditions(c)
local condition = {}
condition[c.name] = {}
if c.attribute then
for i = 1, #c.tiers do
c.subIds[i] = c.basesubId + i
condition[c.name][c.tiers[i]] = Condition(c.attribute, c.subIds[i])
condition[c.name][c.tiers[i]]:setTicks(c.time_ or -1)
for x = 1, #c.parameters do
local increment = c.increments < 1 and 1 or c.increments
condition[c.name][c.tiers[i]]:setParameter(c.parameters[x].skill, c.parameters[x].baseValue + (i * increment) )
end
if c.buff then
condition[c.name][c.tiers[i]]:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
end
end
return condition, c.subIds
end
end
Last edited: