mana spells

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

mana spells

Post by bongobeat »

Hi everyone,

does anyone knows how to script a spells who gives energy to one character or the party?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Ryeath_Greystalk
Posts: 366
Joined: Tue Jan 15, 2013 3:26 am
Location: Oregon

Re: mana spells

Post 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.
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: mana spells

Post 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.
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: mana spells

Post 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
Dungeon Master and DOOM will live forever.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: mana spells

Post 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
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: mana spells

Post by bongobeat »

works great, thanks! :D
is is possible that the caster didnt gain energy?
actually that looks like a unlimited amount of energy, as the caster is "charged" too
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: mana spells

Post 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
Dungeon Master and DOOM will live forever.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: mana spells

Post 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!
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: mana spells

Post 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.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: mana spells

Post 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
Dungeon Master and DOOM will live forever.
Post Reply