Commit b248ed769bfe8aadc896e190b780e5fd3a6e199c

Authored by dg
1 parent 43d43217

Fixed talent level restriction for rares (it was not working at all sorry for th…

…ose fearscaping levle 2 trolls)
Talent level checks for rares is doubled, that is to be able to use a talent requiring level 12 a rare would have to be level 23 (because of rounding)

git-svn-id: http://svn.net-core.org/repos/t-engine4@5159 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -1115,6 +1115,7 @@ function _M:entityFilterPost(zone, level, type, e, filter)
1115 1115 no_loot_randart = true,
1116 1116 resources_boost = 1.5,
1117 1117 class_filter = function(c)
  1118 + if c.name=="Corruptor" then return true else return false end
1118 1119 if e.power_source then
1119 1120 for ps, _ in pairs(e.power_source) do if c.power_source and c.power_source[ps] then return true end end
1120 1121 return false
... ... @@ -1642,10 +1643,12 @@ function _M:createRandomBoss(base, data)
1642 1643 for _, t in pairs(b.talents_def) do
1643 1644 if b.talents_types[t.type[1]] and not t.no_npc_use then
1644 1645 local ok = true
1645   - if data.check_talents_level then
1646   - local req = util.getval(rawget(t, 'require'), b, t)
1647   - if req and req.level and util.getval(req.level, 1) > data.level then
  1646 + if data.check_talents_level and rawget(t, 'require') then
  1647 + local req = t.require
  1648 + if type(req) == "function" then req = req(b, t) end
  1649 + if req and req.level and util.getval(req.level, 1) > math.ceil(data.level/2) then
1648 1650 print("Random boss forbade talent because of level", t.name, data.level)
  1651 + ok = false
1649 1652 end
1650 1653 end
1651 1654
... ...