Shield spell, Conditions and Hard-coding
Posted: Mon Feb 06, 2017 12:51 pm
Hello. Please note that I'm very new to this forum and Grimrock Modding in general, so forgive me if I ask something that has already been answered.
So. Is it possible to make custom spell, that gives caster +n protection for some duration? In other words, exactly like original Shield spell, except that +25 flat bonus is replaced with some other number?
I downloaded original game asset pack and it states:
but I can't find the "shield" function.
I downloaded Multiple magic schools spells pack and inside is a function called shield, which:
which, after following imaginary stack trace, leads to
I am reaching the conclusion that the +25 bonus is hard-coded. In other words I can fiddle around with duration, and which party members it affects, etc. but not with the actual +25 value.
To make the question more general, are all conditions hard-coded and if not, how to make custom conditions?
So. Is it possible to make custom spell, that gives caster +n protection for some duration? In other words, exactly like original Shield spell, except that +25 flat bonus is replaced with some other number?
I downloaded original game asset pack and it states:
Code: Select all
onCast = "shield",
I downloaded Multiple magic schools spells pack and inside is a function called shield, which:
Code: Select all
onCast = function(champion, x, y, direction, elevation, skillLevel)
...
spells_functions.script.addConditionValue("protective_shield", duration, not champion:hasTrait("aura") and champion:getOrdinal())
spells_functions.script.setConditionIcons("protective_shield", "shield")
end
Code: Select all
local c = party.party:getChampionByOrdinal(ordinal)
c:setConditionValue(condition, c:getConditionValue(condition)+duration)
To make the question more general, are all conditions hard-coded and if not, how to make custom conditions?