Page 1 of 2
mana spells
Posted: Thu Sep 05, 2013 12:47 pm
by bongobeat
Hi everyone,
does anyone knows how to script a spells who gives energy to one character or the party?
Re: mana spells
Posted: Thu Sep 05, 2013 2:33 pm
by Ryeath_Greystalk
You can use the modifyStat function to do that
party:getChampion(1):modifyStat("energy", 20) would add 20 energy to the character in slot 1.
I used this feature quite a bit in my mod as part of the setting and reviving from the unconscious stat but with the health stat. I would use the getStatMax for health, calculate a percentage of that, set the characters health to that amount using the modifyStat and then disable the character to make them unconscious and when I enabled them again they had the exact percentage of health I wanted them to revive with.
-- edit: Just re read your post and you said spell, not script. Ignore all that stuff I said.
Re: mana spells
Posted: Thu Sep 05, 2013 3:43 pm
by Dr.Disaster
Ryeath_Greystalk wrote:-- edit: Just re read your post and you said spell, not script. Ignore all that stuff I said.
With spell being basically defined by scripts you have been on the right track. Komag has something similar in Master Quest (a spell to cast healing on all characters) so it should be pretty similar.
Re: mana spells
Posted: Thu Sep 05, 2013 5:50 pm
by LordGarth
This spell will give energy to the party
defineSpell{
name = "manacharge",
uiName = "Mana Charge",
skill = "spellcraft",
level = 16,
runes = "ACGI",
manaCost = 90,
onCast = function(caster, x, y, direction, skill)
local heal_amount = math.random(300,350)/1+skill
for i=1,4 do
party:getChampion(i):modifyStat("energy", heal_amount)
end
playSound("energy")
party:playScreenEffect("teleport_screen")
hudPrint(caster:getName() .. " Charged the party by " .. heal_amount .. " points")
end,
}
You can change the skill and level and manacost also the playsound to what you need it to be.
LordGarth
Re: mana spells
Posted: Thu Sep 05, 2013 6:38 pm
by bongobeat
thanks all for the reply
I have already a healing spells, but I didnt know the command lines for energy to modify it.
me <- trying the spells
Re: mana spells
Posted: Thu Sep 05, 2013 6:57 pm
by bongobeat
works great, thanks!
is is possible that the caster didnt gain energy?
actually that looks like a unlimited amount of energy, as the caster is "charged" too
Re: mana spells
Posted: Fri Sep 06, 2013 5:19 pm
by LordGarth
You can vary the mana cost and the energy gained. The 300 and 350 is what can be altered to change the amount of energy gained.
LordGarth
Re: mana spells
Posted: Fri Sep 06, 2013 7:59 pm
by bongobeat
I think it will be ok
I have try it at low level character, and all energy of the party was restored, but a a higher level it is not the same.
or maybe I will do what you do, lower the total amount of energy.
thanks for the help!
Re: mana spells
Posted: Fri Sep 06, 2013 9:26 pm
by JohnWordsworth
I think for this kind of spell to work game-mechanics wise, you should aim to have the caster expend 30 Mana and then the other 3 party members each gain 10 Mana. Ie. It's "Mana Neutral". Maybe you could go a little higher (Cost 30, gives back 15 to the other party members), but if it's too high - then it's easy for a couple of mages just to keep casting the spell to have infinite mana.
Re: mana spells
Posted: Sat Sep 07, 2013 5:36 pm
by LordGarth
In my game it is needed because the spells cost so much and there is alot of hard combat. Especially in my sequel the monsters are very difficult and there is alot of them.
Lots of scary new ones.
LordGarth