darkmu
Well-Known Member
Can anyone identify where I'm going wrong? Because it is not triggering the conditions as I select the example addon.
TFS 1.3
TFS 1.3
Lua:
conditions = {
[128] = {
[1] = {
[1] = {
condition = CONDITION_ATTRIBUTES,
params = {
{CONDITION_PARAM_TICKS, -1}, -- 1 minute
{CONDITION_PARAM_SKILL_DISTANCE, 50},
}
},
},
[2] = {
[1] = {
condition = CONDITION_REGENERATION,
params = {
{CONDITION_PARAM_TICKS, -1}, -- 1 minute
{CONDITION_PARAM_STAT_MAXHITPOINTS, 500}, -- gain 500 to max hp
}
},
},
},
}
temp = {}
function getBonusOutfit(outfit, addons)
local outfitTable = conditions[outfit]
if not outfitTable then return false end
for k, v in ipairs(outfitTable[addons]) do
local condition = Condition(v.condition)
for _, param in pairs(v.params) do
condition:setParameter(param[1], param[2])
end
table.insert(temp, condition)
end
return temp
end
Lua:
function Creature:onChangeOutfit(outfit)
if not self:isPlayer() then
return true
end
print(outfit.lookType)
local newBonusCondition = getBonusOutfit(outfit.lookType, 1)
if newBonusCondition then
self:addCondition(newBonusCondition)
end
return true
end