Custome Spells made but no xp given to party
Posted: Thu Nov 24, 2016 5:21 pm
Here is some code for an Immolation spell and chain lightning.
Invisibility spell has been removed to make room for the gesture for the chain lightning spell.
firering texture will have to be make for the immolation spell and immosound made and put into the sound folder of your dungeon
wav file 16 bit.
both spells work but no exp awarded to party which i am working on.
I have been trying to put an onDie hook in monster code to give exp on death but it does not work.
defineObject{
name = "immolate",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "immo",
offset = vec(0, 1.5, 0),
},
{
class = "Light",
offset = vec(1.5, 1.0, 0),
color = vec(0.5, 0.5, 0.25),
brightness = 7,
range = 5,
fadeOut = 13,
disableSelf = true,
},
{
class = "CloudSpell",
attackPower = 35,
damageInterval = 0.5,
damageType = "fire",
duration = 8,
sound = "immosound",
},
},
}
defineSpell{
name = "immolate",
uiName = "Immolate",
gesture = 1458,
manaCost = 45,
requirements = { "fire_magic", 3 },
skill = "fire_magic",
icon = 60,
spellIcon = 1,
description = "Conjures a blast of fire that deals fire damage over time.",
onCast = function(champ)
if party.facing == 0 then
spawn("immolate", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("immolate", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("immolate", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("immolate", party.level, party.x-1, party.y, party.facing)
end
end
}
defineParticleSystem{
name = "immo",
emitters = {
-- blast
{
spawnBurst = true,
maxParticles = 10,
boxMin = {-0.5, -0.4,-0.5},
boxMax = { 0.5, 0.2, 0.5},
sprayAngle = {0,360},
velocity = {0.1,0.7},
objectSpace = true,
texture = "mod_assets/textures/firering.tga",
lifetime = {0.4,0.8},
color0 = {0.5, 0.5, 0.5},
opacity = 1,
fadeIn = 0.1,
fadeOut = 1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.5,
blendMode = "Additive",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -1.0*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.7*0.3},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {2,2},
color0 = {0.29, 0.29, 0.145},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.5, 1.75*0.5},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Translucent",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -0.5*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.3},
objectSpace = true,
texture = "mod_assets/textures/firering.tga",
lifetime = {2,2},
color0 = {1,1,1},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.75, 1.75*0.75},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Additive",
},
-- pollen
{
emissionRate = 30,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1*0.5,-1.3*0.5,-1*0.5},
boxMax = { 1*0.5, 0.8*0.5, 1*0.5},
sprayAngle = {0,30},
velocity = {0.5,1.0},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1},
color0 = {1.5,1.5,0.5},
opacity = 0.15,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.03, 0.05},
gravity = {0,-1.2,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Additive",
},
-- 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 = {0.5, 0.5},
colorAnimation = false,
color0 = {0.1, 0.12, 0.1},
opacity = 1,
fadeIn = 0.01,
fadeOut = 0.5,
size = {2, 2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
}
}
}
defineSound{
name = "immosound",
filename = "mod_assets/sounds/immosound.wav",
loop = false,
volume = 1,
minDistance = 2,
maxDistance = 10,
}
defineSpell{
name = "invisibility",
uiName = "Invisibility",
gesture = 0,
manaCost = 45,
onCast = "invisibility",
skill = "air_magic",
requirements = { "air_magic", 3, "concentration", 2 },
icon = 74,
spellIcon = 15,
description = "Turns yourself and your friends invisible.",
}
defineObject{
name = "chainlightning",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "chainlightning",
offset = vec(0, 1.5, 0),
},
{
class = "Light",
offset = vec(1.5, 1.0, 0),
color = vec(0.5, 0.5, 0.25),
brightness = 7,
range = 5,
fadeOut = 13,
disableSelf = true,
},
{
class = "CloudSpell",
attackPower = 35,
damageInterval = 0.5,
damageType = "shock",
duration = 8,
sound = "shockburst",
},
},
}
defineSpell{
name = "chainlightning",
uiName = "Chain Lightning",
gesture = 3658,
manaCost = 45,
requirements = { "air_magic", 3 },
skill = "air_magic",
icon = 64,
spellIcon = 6,
description = "Conjures a bolts of lightning that deals fire damage over time.",
onCast = function(champ)
if party.facing == 0 then
spawn("chainlightning", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("chainlightning", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("chainlightning", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("chainlightning", party.level, party.x-1, party.y, party.facing)
end
end
}
defineParticleSystem{
name = "chainlightning",
emitters = {
-- blast
{
spawnBurst = true,
maxParticles = 10,
boxMin = {-0.5, -0.4,-0.5},
boxMax = { 0.5, 0.2, 0.5},
sprayAngle = {0,360},
velocity = {0.1,0.7},
objectSpace = true,
texture = "assets/textures/particles/lightning01.tga",
lifetime = {0.4,0.8},
color0 = {0.5, 0.5, 0.5},
opacity = 1,
fadeIn = 0.1,
fadeOut = 1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.5,
blendMode = "Additive",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -1.0*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.7*0.3},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {2,2},
color0 = {0.29, 0.29, 0.145},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.5, 1.75*0.5},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Translucent",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -0.5*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.3},
objectSpace = true,
texture = "assets/textures/particles/lightning01.tga",
lifetime = {2,2},
color0 = {1,1,1},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.75, 1.75*0.75},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Additive",
},
-- pollen
{
emissionRate = 30,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1*0.5,-1.3*0.5,-1*0.5},
boxMax = { 1*0.5, 0.8*0.5, 1*0.5},
sprayAngle = {0,30},
velocity = {0.5,1.0},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1},
color0 = {1.5,1.5,0.5},
opacity = 0.15,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.03, 0.05},
gravity = {0,-1.2,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Additive",
},
-- 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 = {0.5, 0.5},
colorAnimation = false,
color0 = {0.1, 0.12, 0.1},
opacity = 1,
fadeIn = 0.01,
fadeOut = 0.5,
size = {2, 2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
}
}
}
Invisibility spell has been removed to make room for the gesture for the chain lightning spell.
firering texture will have to be make for the immolation spell and immosound made and put into the sound folder of your dungeon
wav file 16 bit.
both spells work but no exp awarded to party which i am working on.
I have been trying to put an onDie hook in monster code to give exp on death but it does not work.
defineObject{
name = "immolate",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "immo",
offset = vec(0, 1.5, 0),
},
{
class = "Light",
offset = vec(1.5, 1.0, 0),
color = vec(0.5, 0.5, 0.25),
brightness = 7,
range = 5,
fadeOut = 13,
disableSelf = true,
},
{
class = "CloudSpell",
attackPower = 35,
damageInterval = 0.5,
damageType = "fire",
duration = 8,
sound = "immosound",
},
},
}
defineSpell{
name = "immolate",
uiName = "Immolate",
gesture = 1458,
manaCost = 45,
requirements = { "fire_magic", 3 },
skill = "fire_magic",
icon = 60,
spellIcon = 1,
description = "Conjures a blast of fire that deals fire damage over time.",
onCast = function(champ)
if party.facing == 0 then
spawn("immolate", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("immolate", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("immolate", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("immolate", party.level, party.x-1, party.y, party.facing)
end
end
}
defineParticleSystem{
name = "immo",
emitters = {
-- blast
{
spawnBurst = true,
maxParticles = 10,
boxMin = {-0.5, -0.4,-0.5},
boxMax = { 0.5, 0.2, 0.5},
sprayAngle = {0,360},
velocity = {0.1,0.7},
objectSpace = true,
texture = "mod_assets/textures/firering.tga",
lifetime = {0.4,0.8},
color0 = {0.5, 0.5, 0.5},
opacity = 1,
fadeIn = 0.1,
fadeOut = 1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.5,
blendMode = "Additive",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -1.0*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.7*0.3},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {2,2},
color0 = {0.29, 0.29, 0.145},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.5, 1.75*0.5},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Translucent",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -0.5*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.3},
objectSpace = true,
texture = "mod_assets/textures/firering.tga",
lifetime = {2,2},
color0 = {1,1,1},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.75, 1.75*0.75},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Additive",
},
-- pollen
{
emissionRate = 30,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1*0.5,-1.3*0.5,-1*0.5},
boxMax = { 1*0.5, 0.8*0.5, 1*0.5},
sprayAngle = {0,30},
velocity = {0.5,1.0},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1},
color0 = {1.5,1.5,0.5},
opacity = 0.15,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.03, 0.05},
gravity = {0,-1.2,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Additive",
},
-- 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 = {0.5, 0.5},
colorAnimation = false,
color0 = {0.1, 0.12, 0.1},
opacity = 1,
fadeIn = 0.01,
fadeOut = 0.5,
size = {2, 2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
}
}
}
defineSound{
name = "immosound",
filename = "mod_assets/sounds/immosound.wav",
loop = false,
volume = 1,
minDistance = 2,
maxDistance = 10,
}
defineSpell{
name = "invisibility",
uiName = "Invisibility",
gesture = 0,
manaCost = 45,
onCast = "invisibility",
skill = "air_magic",
requirements = { "air_magic", 3, "concentration", 2 },
icon = 74,
spellIcon = 15,
description = "Turns yourself and your friends invisible.",
}
defineObject{
name = "chainlightning",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "chainlightning",
offset = vec(0, 1.5, 0),
},
{
class = "Light",
offset = vec(1.5, 1.0, 0),
color = vec(0.5, 0.5, 0.25),
brightness = 7,
range = 5,
fadeOut = 13,
disableSelf = true,
},
{
class = "CloudSpell",
attackPower = 35,
damageInterval = 0.5,
damageType = "shock",
duration = 8,
sound = "shockburst",
},
},
}
defineSpell{
name = "chainlightning",
uiName = "Chain Lightning",
gesture = 3658,
manaCost = 45,
requirements = { "air_magic", 3 },
skill = "air_magic",
icon = 64,
spellIcon = 6,
description = "Conjures a bolts of lightning that deals fire damage over time.",
onCast = function(champ)
if party.facing == 0 then
spawn("chainlightning", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("chainlightning", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("chainlightning", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("chainlightning", party.level, party.x-1, party.y, party.facing)
end
end
}
defineParticleSystem{
name = "chainlightning",
emitters = {
-- blast
{
spawnBurst = true,
maxParticles = 10,
boxMin = {-0.5, -0.4,-0.5},
boxMax = { 0.5, 0.2, 0.5},
sprayAngle = {0,360},
velocity = {0.1,0.7},
objectSpace = true,
texture = "assets/textures/particles/lightning01.tga",
lifetime = {0.4,0.8},
color0 = {0.5, 0.5, 0.5},
opacity = 1,
fadeIn = 0.1,
fadeOut = 1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.5,
blendMode = "Additive",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -1.0*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.7*0.3},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {2,2},
color0 = {0.29, 0.29, 0.145},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.5, 1.75*0.5},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Translucent",
},
-- fog
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1.2*0.3, -0.5*0.3,-1.2*0.3},
boxMax = { 1.2*0.3, 0.5*0.3, 1.2*0.3},
sprayAngle = {0,360},
velocity = {0.1,0.3},
objectSpace = true,
texture = "assets/textures/particles/lightning01.tga",
lifetime = {2,2},
color0 = {1,1,1},
opacity = 0.8,
fadeIn = 1,
fadeOut = 1,
size = {1.4*0.75, 1.75*0.75},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.1,
blendMode = "Additive",
},
-- pollen
{
emissionRate = 30,
emissionTime = 0,
maxParticles = 100,
boxMin = {-1*0.5,-1.3*0.5,-1*0.5},
boxMax = { 1*0.5, 0.8*0.5, 1*0.5},
sprayAngle = {0,30},
velocity = {0.5,1.0},
objectSpace = true,
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1},
color0 = {1.5,1.5,0.5},
opacity = 0.15,
fadeIn = 0.1,
fadeOut = 0.3,
size = {0.03, 0.05},
gravity = {0,-1.2,0},
airResistance = 0.1,
rotationSpeed = 2,
blendMode = "Additive",
},
-- 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 = {0.5, 0.5},
colorAnimation = false,
color0 = {0.1, 0.12, 0.1},
opacity = 1,
fadeIn = 0.01,
fadeOut = 0.5,
size = {2, 2},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
}
}
}