LootaBox
March 2nd, 2014, 05:14
Hey everyone!
We have this homebrew little rule that allows players (and enemies) to deal some damage even if they would have normally missed. Currently we do it manually but it's a little tiresome. I know my way around LUA and started digging the ruleset files, looking for an automatic solution.
What I'm trying to do:
Make an attack roll that falls short of targets AC by X amount cause a "glancing blow."
Glancing blow would deal halved damage.
X would be affected by targets armor and natural AC.
I'm not at all familiar with the ruleset script structure, but I believe I can make the ruleset notice a glancing blow in the onAttack() function in manager_action_attack.lua, and the damage calculations are handled in modDamage() in manager_action_damage.lua..?
I can't figure out how to deliver the information from the attack function to the damage calculations, and how to use targets armor/natural AC value in the onAttack function. Am I even looking in the right places?
I know there's documentation, and that what I'm trying to do is probably not such a difficult thing to mod, but unfortunately I have an exam week coming up and we have a session planned on the following weekend. I really must (or at least should..) focus my studies on my actual studies.
I would appreciate any help very much.
We have this homebrew little rule that allows players (and enemies) to deal some damage even if they would have normally missed. Currently we do it manually but it's a little tiresome. I know my way around LUA and started digging the ruleset files, looking for an automatic solution.
What I'm trying to do:
Make an attack roll that falls short of targets AC by X amount cause a "glancing blow."
Glancing blow would deal halved damage.
X would be affected by targets armor and natural AC.
I'm not at all familiar with the ruleset script structure, but I believe I can make the ruleset notice a glancing blow in the onAttack() function in manager_action_attack.lua, and the damage calculations are handled in modDamage() in manager_action_damage.lua..?
I can't figure out how to deliver the information from the attack function to the damage calculations, and how to use targets armor/natural AC value in the onAttack function. Am I even looking in the right places?
I know there's documentation, and that what I'm trying to do is probably not such a difficult thing to mod, but unfortunately I have an exam week coming up and we have a session planned on the following weekend. I really must (or at least should..) focus my studies on my actual studies.
I would appreciate any help very much.