Code: Select all
defineSpell{
name = "plasma_bolt",
uiName = "Plasma Bolt",
gesture = 0,
manaCost = 0,
icon = 72,
spellIcon = 13,
hidden = true,
description = "",
onCast = function(champion, x, y, direction, elevation, skillLevel)
projectileScripts.script.projectileSpell(champion, x, y, direction, elevation, skillLevel, "plasma_bolt", 25, 3, 0.5, "fireball_launch", 5)
end,
}
defineObject{
name = "plasma_bolt",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "plasma_bolt",
},
{
class = "Light",
color = vec(1, 1, 0.25),
brightness = 40,
range = 10,
castShadow = true,
},
{
class = "Script",
name = "data",
source = [[
data = {}
function get(self,name)
return self.data[name]
end
function set(self,name,value)
self.data[name] = value
end]],
},
{
class = "Projectile",
spawnOffsetY = 1.35,
velocity = 12,
radius = 0.1,
hitEffect = "plasma_blast",
onProjectileHit = function(self, what, entity)
print(self.go.name, what, entity.name)
end,
},
{
class = "Sound",
sound = "lightning_bolt",
pitch = 1.4,
},
{
class = "Sound",
name = "launchSound",
sound = "lightning_bolt_launch",
pitch = 2,
},
{
class = "Sound",
name = "launchSound2",
sound = "lightning_bolt_launch",
pitch = 1.5,
},
},
}
defineObject{
name = "plasma_blast",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "plasma_hit",
destroyObject = true,
rotation = vec(90,0,0),
},
{
class = "Light",
color = vec(1, 0.4, 0),
brightness = 96,
range = 16,
fadeOut = 3,
disableSelf = true,
},
{
class = "Sound",
sound = "magma_golem_meteor_fall",
soundType = "ambient",
pitch = 2,
},
{
class = "Sound",
sound = "gun_shot_cannon",
soundType = "ambient",
pitch = 1.5,
},
},
}
defineParticleSystem{
name = "plasma_bolt",
emitters = {
-- fog
{
emissionRate = 10,
emissionTime = 0,
maxParticles = 1000,
boxMin = {-0.05,-0.05,-0.05},
boxMax = { 0.05, 0.05, 0.05},
sprayAngle = {0,360},
velocity = {0.1,0.2},
objectSpace = true,
texture = "assets/textures/particles/fog.tga",
lifetime = {3,3},
color0 = {0.2, 0.2, 0},
opacity = 1,
fadeIn = 0.2,
fadeOut = 2.2,
size = {0.2, 0.4},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 3,
blendMode = "Additive",
},
-- stars
{
emissionRate = 512,
emissionTime = 0,
maxParticles = 1024,
boxMin = {-0.1, -0.1, -0.1},
boxMax = { 0.1, 0.1, 0.1},
sprayAngle = {0,360},
velocity = {0.01,0.2},
objectSpace = false,
texture = "assets/textures/particles/dust_particle_dif.tga",
lifetime = {0.4,1},
color0 = {1.0,1.0,0},
opacity = 1,
fadeIn = 0.001,
fadeOut = 0.4,
size = {0.05, 0.1},
gravity = {0,0,0},
airResistance = -2,
rotationSpeed = 7,
blendMode = "Additive",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,0},
boxMax = {0,0,0},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {1,1,0.25},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {1.0, 1.0},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
},
{
emissionRate = 128,
emissionTime = 0,
maxParticles = 128,
sprayAngle = {0,180},
velocity = {256, 256},
boxMin = {0,0,0},
boxMax = {0,0,0},
texture = "assets/textures/particles/lightning01.tga",
frameRate = 4,
frameSize = 256,
frameCount = 4,
lifetime = {0.2,0.4},
color0 = {6.5,2.5,0},
opacity = 1,
fadeIn = 0.001,
fadeOut = 0.3,
size = {0.3, 0.5},
gravity = {0,0,0},
airResistance = 1024,
rotationSpeed = 0,
blendMode = "Additive",
},
}
}
defineParticleSystem{
name = "plasma_hit",
emitters = {
-- sparks
{
spawnBurst = true,
maxParticles = 256,
boxMin = {-0.1, -0.1, -0.1},
boxMax = { 0.1, 0.1, 0.1},
sprayAngle = {0,360},
velocity = {8,12},
objectSpace = false,
texture = "assets/textures/particles/teleporter.tga",
lifetime = {0.2,1},
color0 = {1.0,2.0,4.0},
opacity = 1,
fadeIn = 0.001,
fadeOut = 1,
size = {0.05, 0.3},
gravity = {0,0,0},
airResistance = 8,
rotationSpeed = 2,
blendMode = "Additive",
},
-- fog
{
spawnBurst = true,
maxParticles = 50,
sprayAngle = {0,360},
velocity = {0,3},
objectSpace = true,
texture = "assets/textures/particles/fog.tga",
lifetime = {0.4,0.6},
color0 = {0.15, 0.35, 1},
opacity = 0.7,
fadeIn = 0.1,
fadeOut = 0.3,
size = {1, 2},
gravity = {0,0,0},
airResistance = 0.5,
rotationSpeed = 1,
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.5, 1, 2},
opacity = 1,
fadeIn = 0.01,
fadeOut = 0.5,
size = {1, 1},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
},
{
emissionRate = 512,
emissionTime = 2,
maxParticles = 1024,
boxMin = {-0.75,0,-1.5},
boxMax = {0.75,0,1.3},
sprayAngle = {0,10},
velocity = {0.1, 32},
texture = "assets/textures/particles/rock_shard.tga",
frameRate = 0,
frameSize = 64,
frameCount = 1,
lifetime = {1, 6},
color0 = {2, 0.2, 0},
opacity = 1,
fadeIn = 0.001,
fadeOut = 1,
size = {0.03, 0.1},
gravity = {0,-20,0},
airResistance = 2,
rotationSpeed = 0,
blendMode = "Translucent",
--depthBias = -0.002,
clampToGroundPlane = true,
},
{ -- flame clouds
emissionRate = 2048,
emissionTime = 0.5,
maxParticles = 1024,
boxMin = {-0.75,0,-1.5},
boxMax = {0.75,0,1.3},
sprayAngle = {0,10},
velocity = {0.1, 4},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 64,
frameCount = 16,
lifetime = {0.5, 1.25},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.001,
fadeOut = 1,
size = {0.2, 0.5},
gravity = {0,0.2,0},
airResistance = 0.2,
rotationSpeed = 1,
blendMode = "Additive",
--depthBias = -0.002,
},
{ -- floaty sparks
emissionRate = 1024,
emissionTime = 2,
maxParticles = 2048,
boxMin = {-0.75,0,-1.5},
boxMax = {0.75,0,1.3},
sprayAngle = {0,10},
velocity = {8, 24},
texture = "assets/textures/particles/fire_elemental_spark.tga",
lifetime = {1, 2.8},
colorAnimation = true,
color0 = {1, 1, 0.1},
color1 = {1, 0.5, 0.1},
color2 = {1, 0.3, 0.1},
color3 = {1.0, 0.2, 0.1},
opacity = 1,
fadeIn = 0.001,
fadeOut = 2,
size = {0.1, 0.3},
gravity = {0,0,0},
rotationSpeed = 5,
airResistance = 1,
blendMode = "Additive",
--depthBias = -0.002,
},
}
}