[MOD] Respec your character/redistribute skill pts

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

[MOD] Respec your character/redistribute skill pts

Post by Jgwman »

Hey, guys, this is the first mod I'm posting here.

So, I was inspired to do this by the One Room Round Robin 2 Mod. I just started it a couple days ago, it's pretty awesome! But at one particular point, I looted a really nice bow, and decided I no longer wanted my rogue to be an assassin :D

So, when I couldn't find any mod for respeccing my party, I decided to make one, activated by a champion using a 'Tome of Memories'. This simply allows the champion that used the tome to respec his/her skill points (not the base attributes chosen in the character creator, the ones gained upon level up). PLEASE NOTE: The tome's script in its current state will reset your champion's EXP progress to the next level, because I could not find a function to get player exp in the Grimrock Lua docs. If I missed that, please let me know and I will fix this.

Unless I am incorrect, there is no such thing as a "light mod" which can be used with the original map, or with mod maps without the tome being added to the items/lua.

Therefore, this mod comes in two flavors:

1. Temple of Anamnesis
Very small dungeon I threw together. It has a respawning Tome of Memories so that you can respec characters galore. Main problem is that this must be done between dungeons - import your party into this temple, respec, save, and import into a new dungeon. Get this on The Steam Workshop. I may host it on the Nexus if anyone wants it who doesn't use Steam.

2. Script
I am providing the cloneObject from my mod's items.lua. I know I'm pretty late on the modding for the first LoG game, but if anyone wants to add this to their mod, that would be awesome.

The script is right here - keep in mind it's using a custom sound effect and message which relate to the small temple described above, and these should be changed in your mod.
SpoilerShow
cloneObject{
name = "tome_memories",
baseObject = "tome_wisdom",
uiName = "Tome of Memories",
gameEffect = "Respec skill points",
description = "You feel as if the thick volume is drawing you in...perhaps to relieve your mind of its heavy burdens?",
onUseItem = function(self,champion)

local skillPts = 0
local champLvL = champion:getLevel()
local champHP = champion:getStat("health")
local champEnergy = champion:getStat("energy")

if champion:getClass() == "Fighter" then
skillPts = skillPts + champion:getSkillLevel("armors")
skillPts = skillPts + champion:getSkillLevel("athletics")
skillPts = skillPts + champion:getSkillLevel("axes")
skillPts = skillPts + champion:getSkillLevel("maces")
skillPts = skillPts + champion:getSkillLevel("swords")
skillPts = skillPts + champion:getSkillLevel("unarmed_combat")
elseif champion:getClass() == "Rogue" then
skillPts = skillPts + champion:getSkillLevel("assassination")
skillPts = skillPts + champion:getSkillLevel("daggers")
skillPts = skillPts + champion:getSkillLevel("dodge")
skillPts = skillPts + champion:getSkillLevel("missile_weapons")
skillPts = skillPts + champion:getSkillLevel("throwing_weapons")
skillPts = skillPts + champion:getSkillLevel("unarmed_combat")
elseif champion:getClass() == "Mage" then
skillPts = skillPts + champion:getSkillLevel("air_magic")
skillPts = skillPts + champion:getSkillLevel("earth_magic")
skillPts = skillPts + champion:getSkillLevel("fire_magic")
skillPts = skillPts + champion:getSkillLevel("ice_magic")
skillPts = skillPts + champion:getSkillLevel("spellcraft")
skillPts = skillPts + champion:getSkillLevel("staves")
elseif champion:getClass() == "Ranger" then
skillPts = skillPts + champion:getSkillLevel("axes")
skillPts = skillPts + champion:getSkillLevel("swords")
skillPts = skillPts + champion:getSkillLevel("armors")
skillPts = skillPts + champion:getSkillLevel("spellcraft")
skillPts = skillPts + champion:getSkillLevel("fire_magic")
skillPts = skillPts + champion:getSkillLevel("earth_magic")
end

champion:setClass(champion:getClass())

for i = champLvL, 2, -1 do
champion:levelUp()
hudPrint(" ")
hudPrint(" ")
hudPrint(" ")
hudPrint(" ")
skillPts = skillPts - 4
end
champion:addSkillPoints(skillPts)
champion:setStat("health", champHP)
champion:setStat("energy", champEnergy)
champion:setStatMax("health", champHP)
champion:setStatMax("energy", champEnergy)

--Custom sound packaged with my sample dungeon
playSound("heavy_wind")

--This message is most likely mod specific
hudPrint("A more persistent wind blows through the chamber, tugging at your garments. You feel fresh and strong anew.")
return true
end
}
Hopefully I posted this in the correct forum and all, my navigation skills are close to non-existant. Lemme know what you think if you try it, I'm open to feedback for the script as it's certainly a bit hacked together ;)
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: [MOD] Respec your character/redistribute skill pts

Post by bongobeat »

Hello,

very interesting script!
thanks for that! :)
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: [MOD] Respec your character/redistribute skill pts

Post by Isaac »

It looks neat! 8-)
Post Reply