Code: Select all
function resolvers.calc.staff_element(t, e)
local command_flavor, command_lement = nil, nil
if not e.flavor_name then
if not e.flavors then -- standard
local staff_type = rng.table{2, 2, 2, 2, 3, 3, 3, 4, 4, 4}
command_flavor = e["flavor_names"][staff_type]
else
command_flavor = rng.tableIndex(e.flavors)
end
end
if not e.combat.element then
command_element = rng.table(e:getStaffFlavor(e.flavor_name or command_flavor))
end
e.combat.damtype = e.combat.damtype or engine.DamageType.PHYSICAL
if not e.no_command then
e.wielder = e.wielder or {}
e.wielder.learn_talent = e.wielder.learn_talent or {}
e.wielder.learn_talent[Talents.T_COMMAND_STAFF] = 1
end
if command_flavor or command_element then e:commandStaff(command_element, command_flavor) end
-- hee hee
if not e.unique then
local chance = math.max((e.material_level or 1) - 3, 0)
if rng.percent(chance) then
e.combat.sentient = rng.table{"default", "aggressive", "fawning"}
end
end
end
I don't see where this is causing any errors, but it's wrong and I thought I would point it out.