Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- managers.money:_add_to_total(672500)
- function SkillTreeManager:unlock(tree, skill_id)
- if not self._global.trees[tree].unlocked then
- Application:error("Cannot unlock skill", skill_id, "in tree", tree, ". Tree is locked")
- return
- end
- if self._global.skills[skill_id].unlocked >= self._global.skills[skill_id].total then
- Application:error("No more steps to unlock in skill", skill_id)
- return
- end
- local talent = tweak_data.skilltree.skills[skill_id]
- local prerequisites = talent.prerequisites or {}
- for _, prerequisite in ipairs(prerequisites) do
- local unlocked = managers.skilltree:skill_step(prerequisite)
- if unlocked and unlocked == 0 then
- return
- end
- end
- local to_unlock = managers.skilltree:next_skill_step(skill_id)
- local skill = talent[to_unlock]
- local total_points, points = managers.skilltree:get_skill_points(skill_id, to_unlock)
- self._global.skills[skill_id].unlocked = to_unlock
- local tier
- for i, tier_skills in ipairs(tweak_data.skilltree.trees[tree].tiers) do
- if table.contains(tier_skills, skill_id) then
- tier = i
- else
- end
- end
- self:_spend_points(tree, tier, total_points, points)
- self:_on_skill_unlocked(tree, skill_id)
- if SystemInfo:platform() == Idstring("WIN32") then
- managers.statistics:publish_skills_to_steam()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement