Re: New Spells >> show them off here
Posted: Thu Nov 22, 2012 4:33 am
Nice work flatline... a neat idea and some interesting spells... I especially like the idea of Detect Monster
Official Legend of Grimrock Forums
http://grimrock.net/forum/
Code: Select all
defineSpell{
name = "dark_missile",
uiName = "Dark Missile",
skill = "spellcraft",
level = 0,
runes = "BCDF",
manaCost = 10,
onCast = function(caster, x, y, direction, skill)
mymod_spells.castDarkMissile(caster,x,y,direction,skill)
end
}
Code: Select all
defineObject{
name = "dark_missile",
class = "Item",
uiName = "Dark Missile",
model = "mod_assets/models/spell_projectile2.fbx",
gfxIndex = 109,
attackPower = 60,
impactSound = "lightning_bolt_hit",
particleEffect = "dark_missile",
stackable = false,
sharpProjectile = false,
projectileRotationY = 0,
weight = 0,
}
defineObject{
name = "dark_missile_greater",
class = "Item",
uiName = "Dark Missile",
model = "mod_assets/models/spell_projectile2.fbx",
gfxIndex = 109,
attackPower = 60,
impactSound = "lightning_bolt_hit",
particleEffect = "dark_missile_greater",
stackable = false,
sharpProjectile = false,
projectileRotationY = 0,
weight = 0,
}
Code: Select all
defineParticleSystem{
name = "dark_missile",
emitters = {
-- sparks
{
emissionRate = 50,
emissionTime = 0,
maxParticles = 100,
boxMin = {-0.015, 0.02, 0.015},
boxMax = { 0.015, 0.1, -0.015},
sprayAngle = {0,180},
velocity = {0.1, 2.4},
texture = "assets/textures/particles/glow.tga",
lifetime = {0.25, 0.85},
colorAnimation = false,
color0 = {1.5, 1.5, 1.5},
opacity = 0.8,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.01, 0.05},
gravity = {0,0,0},
airResistance = 1.0,
rotationSpeed = 1,
blendMode = "Additive",
depthBias = -0.0005,
objectSpace = true,
},
--dust
{
emissionRate = 100,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.0, 0.0,-1.0},
boxMax = { 1.0, 0.0, 1.0},
sprayAngle = {0,50},
velocity = {0.1,1},
texture = "assets/textures/particles/fog.tga",
lifetime = {2,5.5},
color0 = {0.05, 0.05, 0.05},
opacity = 0.8,
fadeIn = .15,
fadeOut = .75,
size = {0.4, 0.7},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 1,
blendMode = "Translucent",
},
--glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.5, 0.5, 1.5},
opacity = 0.5,
fadeIn = 0.1,
fadeOut = 0.1,
size = {1.8, 2.2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
},
-- lightning core
{
emissionRate = 20,
emissionTime = 0,
maxParticles = 3,
boxMin = { 0,0,0 },
boxMax = { 0,0,0 },
sprayAngle = {0,360},
velocity = {0,0},
texture = "mod_assets/textures/lightning_ball.tga",
lifetime = {0.4,0.5},
colorAnimation = false,
color0 = {0.5, 0.5, 1.2},
opacity = 0.5,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.7, 0.75},
gravity = {0,0,0},
airResistance = 5,
rotationSpeed = -2,
blendMode = "Translucent",
objectSpace = true,
},
}
}
defineParticleSystem{
name = "dark_missile_greater",
emitters = {
-- sparks
{
emissionRate = 100,
emissionTime = 0,
maxParticles = 100,
boxMin = {-0.015, 0.02, 0.015},
boxMax = { 0.015, 0.1, -0.015},
sprayAngle = {0,280},
velocity = {0.1, 2.4},
texture = "assets/textures/particles/glow.tga",
lifetime = {0.25, 0.85},
colorAnimation = false,
color0 = {1.5, 1.5, 1.5},
opacity = 0.8,
fadeIn = 0.15,
fadeOut = 0.5,
size = {0.01, 0.05},
gravity = {0,0,0},
airResistance = 1.0,
rotationSpeed = 1,
blendMode = "Additive",
depthBias = -0.0005,
objectSpace = true,
},
--dust
{
emissionRate = 100,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.0, 0.0,-1.0},
boxMax = { 1.0, 0.0, 1.0},
sprayAngle = {0,50},
velocity = {0.1,1},
texture = "assets/textures/particles/fog.tga",
lifetime = {2,5.5},
color0 = {0.05, 0.05, 0.05},
opacity = 0.8,
fadeIn = .15,
fadeOut = .75,
size = {0.4, 0.7},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 1,
blendMode = "Translucent",
},
--glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,-0.1},
boxMax = {0,0,-0.1},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.3, 0.3, 0.8},
opacity = 0.5,
fadeIn = 0.1,
fadeOut = 0.1,
size = {2.3, 2.7},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
},
-- lightning core
{
emissionRate = 20,
emissionTime = 0,
maxParticles = 3,
boxMin = { 0,0,0 },
boxMax = { 0,0,0 },
sprayAngle = {0,360},
velocity = {0,0},
texture = "mod_assets/textures/lightning_ball.tga",
lifetime = {0.4,0.5},
colorAnimation = false,
color0 = {0.7, 0.3, 1.2},
opacity = 0.5,
fadeIn = 0.1,
fadeOut = 0.3,
size = {1.2, 1.5},
gravity = {0,0,0},
airResistance = 5,
rotationSpeed = -2,
blendMode = "Translucent",
objectSpace = true,
},
-- stars
{
emissionRate = 200,
emissionTime = 4,
maxParticles = 1000,
boxMin = {-0.6, -1,-0.6},
boxMax = { 0.6, 1, 0.6},
sprayAngle = {0,360},
velocity = {0.2,0.2},
objectSpace = true,
texture = "assets/textures/particles/teleporter.tga",
lifetime = {0.5,1},
color0 = {1.0,3.0,3.0},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.4,
size = {0.1, 0.15},
gravity = {0,0,0},
airResistance = 0.1,
blendMode = "Additive",
},
-- flames
{
emissionRate = 100,
emissionTime = 0,
maxParticles = 100,
boxMin = {-0.03, -0.03, 0.03},
boxMax = { 0.03, 0.03, -0.03},
sprayAngle = {0,360},
velocity = {0.5, 0.7},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 64,
frameCount = 16,
lifetime = {0.8, 0.8},
colorAnimation = true,
color0 = {1, 1, 1},
color1 = {0.7, 0.2, 0.9},
color2 = {0.8, 0.4, 0.15},
color3 = {0.6, 0.6, 0.9},
opacity = 0.5,
fadeIn = 0.15,
fadeOut = 0.4,
size = {0.45, 0.55},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 1,
blendMode = "Translucent",
objectSpace = true,
}
}
}
Code: Select all
----------------------Dark Missile---------------------------------------
function castDarkMissile(caster,x,y,direction,skill)
playSound("generic_spell", party.level, x, y)
playSound("fireball_launch", party.level, x, y)
local dx,dy = getForward(party.facing)
local e = caster:getStat("health")
if skill >= 42 then
shootProjectile("dark_missile_greater", party.level, x,y, direction, 20, 0, 0, 0, 0, 0, e * 10, party, true)
else
shootProjectile("dark_missile", party.level, x,y, direction, 20, 0, 0, 0, 0, 0, 60, party, true)
end
caster:damage(30, "physical")
caster:modifyFood(-300)
spellCaster = caster:getOrdinal()
end
------------------------------------------------------------------------
function customSpellOnProjectileHitHook(monster,projectile)
if projectile.name == 'dark_missile' or 'dark_missile_greater' then
local originator = 2 ^ (spellCaster+1) -- calculate the originator of the spell
local damage = math.random(60,90) --
damageTile(monster.level,monster.x,monster.y,(monster.facing + 2)%4,originator+1, 'physical',damage)
playSoundAt("shockburst",monster.level,monster.x,monster.y)
return false
end
Code: Select all
cloneObject{
name = "snail",
baseObject = "snail",
onProjectileHit = function(monster,projectile)
return mymod_spells.customSpellOnProjectileHitHook(monster,projectile)
end
}
1. Ooops, here it is: (it's really just the teleport effect added to the party for the spells duration)akroma222 wrote:Really exciting stuff Flatline!!
1. I think you may have forgotten the manashield particle effect? and possibly the item scripts for wand of light and dark? (I just cloned whitewood wand with their names - but were there special item scripts you had made?)
2. I might try to play around with the teleport spell sound effects, it gets kinda cut off which does not sound that cool... BUT! I love the spell!! Definitely using that one
3. Was there a projectile dark spell you were working on?? I have created one which I was about to post - and I would be very happy for you to alter it to require the wand of darkness (anyways, I will post it below - you are welcome to it, as all are )
4. I am also very keen for a missile/projectile shield spell - I am working on it atm, will post when I have something decent...
Code: Select all
defineParticleSystem{
name = "manashielded",
emitters = {
-- fog
{
emissionRate = 10,
emissionTime = 40,
maxParticles = 1000,
boxMin = {-0.5, 0.0,-0.5},
boxMax = { 0.5, 2.5, 0.5},
sprayAngle = {0,360},
velocity = {0.1,0.2},
objectSpace = true,
texture = "assets/textures/particles/fog.tga",
lifetime = {3,3},
color0 = {0.152941, 0.352941, 0.803922},
opacity = 0.5,
fadeIn = 2.2,
fadeOut = 2.2,
size = {1.5, 1.5},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Additive",
},
-- stars
{
emissionRate = 200,
emissionTime = 40,
maxParticles = 1000,
boxMin = {-0.6, 0.3,-0.6},
boxMax = { 0.6, 2.5, 0.6},
sprayAngle = {0,360},
velocity = {0.2,0.2},
objectSpace = true,
texture = "assets/textures/particles/teleporter.tga",
lifetime = {3,3},
color0 = {3.0,3.0,3.0},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.05, 0.13},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Additive",
}
}
}
There is no such arrowshield spell yet, but I'll make one. Brb.akroma222 wrote:Flatline-
Thanks for the particle system!
Letting monsters through the portal could indeed be chaotic! Very interesting hehe
Do you know which thread deals with the cheap arrowshield onProjectileHit spell?? I have not found it yet in my searches....
The cheap version is all I am after really... but you do make a good point, not being able to fire off your own arrows would be much better
Grimwold-
I have got the Leech spell working well! Great stuff
I have tried the freeze monster spell - pasting all of those scripts into both spells and objects.lua but on casting it keeps crashing the editor....
Any idea on that one? (or is it just me?? hehehe)
Code: Select all
function arrowtest()
if findEntity("arrowshieldobj") == nil then
return true
else
hudPrint("Projectile deflected")
return false
end
end
Code: Select all
function arrowtest()
if findEntity("arrowshieldobj") == nil then
return true
else
hudPrint("Projectile deflected")
return false
end
end
Code: Select all
defineSpell{
name = "RROWTest",
uiName = "Arrow Shield",
skill = "spellcraft",
level = 1,
runes = "EFGH",
manaCost = 1,
onCast = function(champ, skill)
spawn("timer", party.level, party.x, party.y, party.facing, "arrowshieldobj")
:addConnector("activate", "randomscript", "reset")
:setTimerInterval(30)
:activate()
end,
}
Consider that these considerations apply to how the main game is balanced; if your mod drastically changes the effect of conditions or resting, of course they don't apply anymore!'d like to have special spell like : cure disease, cure poison but, I don't want these spells to be "too easy" to use.
So, I had an idea : The spell caster need 1 item in a hand to make the spell work.
I honestly don't know why it's not working... I created a blank dungeon just now... pasted in only those two scripts, directly from the post here, to objects.lua and spells.lua and it worked fine. Is it possible something in your dungeon already is interfering with the it? I'd certainly be interested to know the cause, but unfortunately I am unable to duplicate the problem.akroma222 wrote:Grimwold-
I have got the Leech spell working well! Great stuff
I have tried the freeze monster spell - pasting all of those scripts into both spells and objects.lua but on casting it keeps crashing the editor....
Any idea on that one? (or is it just me?? hehehe)
Code: Select all
if champ:getItem(7) ~= nil and champ:getItem(7).name == "wand_of_darkness" or champ:getItem(8) ~= nil and champ:getItem(8).name == "wand_of_darkness" then
DO THE SPELL
else
hudPrint("You are not Schooled")
end
Code: Select all
defineSpell{
name = "curse",
uiName = "Caliginous Curse",
skill = "staves",
level = 16,
runes = "DEH",
manaCost = 10,
onCast = function(champ, x, y, direction, skill)
return flatline_spells.caliginousCurse(champ,x,y,direction,skill)
end,
}
defineSpell{
name = "cursedark",
uiName = "Summon Darkness",
skill = "spellcraft",
level = 20,
runes = "CDEH",
manaCost = 10,
onCast = function(champ, x, y, direction, skill)
return flatline_spells.curseDark(champ,x,y,direction,skill)
end,
}
defineSpell{
name = "curserage",
uiName = "Vengeful Curse",
skill = "staves",
level = 8,
runes = "AEH",
manaCost = 10,
onCast = function(champ, x, y, direction, skill)
return flatline_spells.vengefulCurse(champ,x,y,direction,skill)
end,
}
defineSpell{
name = "holyvigor",
uiName = "Holy Vigor",
skill = "staves",
level = 12,
runes = "BCE",
manaCost = 10,
onCast = function(champ, x, y, direction, skill)
return flatline_spells.holyVigor(champ,x,y,direction,skill)
end
}
Code: Select all
function caliginousCurse(champ,x,y,direction,skill)
if champ:getItem(7) ~= nil and champ:getItem(7).name == "wand_of_darkness" or champ:getItem(8) ~= nil and champ:getItem(8).name == "wand_of_darkness" then
hudPrint(champ:getName().." pulls life force to strengthen the spell")
damageTile(party.level, party.x, party.y, party.facing, 1, "physical", (5+(skill/2)))
spawn("curseburst", party.level, party.x, party.y-1, party.facing)
spawn("curseburst", party.level, party.x+1, party.y, party.facing)
spawn("curseburst", party.level, party.x, party.y+1, party.facing)
spawn("curseburst", party.level, party.x-1, party.y, party.facing)
damageTile(party.level, party.x, party.y-1, party.facing, 101111, "physical", math.random(1,10)*(skill*2))
damageTile(party.level, party.x-1, party.y, party.facing, 101111, "physical", math.random(1,10)*(skill*2))
damageTile(party.level, party.x, party.y+1, party.facing, 101111, "physical", math.random(1,10)*(skill*2))
damageTile(party.level, party.x+1, party.y, party.facing, 101111, "physical", math.random(1,10)*(skill*2))
party:playScreenEffect("party_crush")
else
hudPrint("You are not schooled in the Dark Arts")
end
end
function curseDark(champ,x,y,direction,skill)
if champ:getItem(7) ~= nil and champ:getItem(7).name == "wand_of_darkness" or champ:getItem(8) ~= nil and champ:getItem(8).name == "wand_of_darkness" then
spawn("darkburst", party.level, party.x, party.y, party.facing)
damageTile(party.level, party.x, party.y, party.facing, 1, "physical", (5+(skill/2)))
for slot=1,4 do
if party:getChampion(slot) ~= nil then
party:getChampion(slot):setCondition("invisibility", skill);
end
end
else
hudPrint("You are not schooled in the Dark Arts")
end
end
function vengefulCurse(champ,x,y,direction,skill)
if champ:getItem(7) ~= nil and champ:getItem(7).name == "wand_of_darkness" or champ:getItem(8) ~= nil and champ:getItem(8).name == "wand_of_darkness" then
spawn("curseburst", party.level, party.x, party.y, party.facing)
damageTile(party.level, party.x, party.y, party.facing, 1, "physical", (5+(skill/2)))
for slot=1,4 do
if party:getChampion(slot) ~= nil then
party:getChampion(slot):setCondition("rage", skill);
end
end
else
hudPrint("You are not schooled in the Dark Arts")
end
end
function holyVigor(champ,x,y,direction,skill)
if champ:getItem(7) ~= nil and champ:getItem(7).name == "wand_of_light" or champ:getItem(8) ~= nil and champ:getItem(8).name == "wand_of_light" then
local cenergy = champ:getStat("energy")
champ:modifyStat("energy", -200)
for slot=1,4 do
if party:getChampion(slot) ~= nil then
party:getChampion(slot):setCondition("haste", cenergy);
end
end
else hudPrint("You are not a true follower of the Light")
end
end