I know how to clone and define new spells, but I want to create a custom spell that uses the lightning bolt spell as its base, but doesn't have as many damage points (sort of a mini lightning bolt with a third of the damage). I've checked everywhere in the assets scripts (items, spells etc.) but no-where does it tell you what damage this spell (or any other for that matter) actually does. How can I clone the spell (or define a new one) and then change its damage value? Is it possible? If not, how is the damage calculated?
Thanks
George
Help needed with custom spells
Re: Help needed with custom spells
Here is a custom mini-lightning spell. This is not a perfect copy of the real lightning spell; it might have unintended issues that I haven't foreseen.
Noteably, it does not simulate the dynamic lighting effect of a normal lightning spell; but it works well enough.

https://www.dropbox.com/s/a8rjxtxjex091 ... 1.avi?dl=0
Place this model in your models folder. [I wish there was a blank model in the default game files, but I don't know of one.]
https://www.dropbox.com/s/bkjqeibv5hgwo ... model?dl=0
Place this code in your spells.lua script.
Noteably, it does not simulate the dynamic lighting effect of a normal lightning spell; but it works well enough.

https://www.dropbox.com/s/a8rjxtxjex091 ... 1.avi?dl=0
Place this model in your models folder. [I wish there was a blank model in the default game files, but I don't know of one.]
https://www.dropbox.com/s/bkjqeibv5hgwo ... model?dl=0
Place this code in your spells.lua script.
Code: Select all
defineSpell{
name = "mini-lightning_bolt",
uiName = "Mini-Lightning Bolt",
skill = "air_magic",
level = 10,
runes = "CDE",
manaCost = 20,
onCast = function(champion)
local dx,dy = getForward(party.facing)
--~ local damage = 10
local Xoffset = -0.5
local Yoffset = 0.5
if champion:getOrdinal() == party:getChampion(2):getOrdinal() or champion:getOrdinal() == party:getChampion(4):getOrdinal() then
Yoffset = -0.5
end
if champion:getOrdinal() == party:getChampion(3):getOrdinal() or champion:getOrdinal() == party:getChampion(1):getOrdinal() then
Xoffset = 0.5
end
playSoundAt("lightning_bolt_launch", party.level, party.x, party.y)
shootProjectile("mini-lightning_bolt", party.level, party.x+dx, party.y+dy, party.facing, 9, 0, 0, Xoffset, 0.2, Yoffset, 0, nil, true, champion:getOrdinal())
end,
}
cloneObject{
name = "mini-lightning_bolt",
baseObject = "shock_bomb",
uiName = "na",
impactSound = "lightning_bolt_hit",
stackable = false,
bombPower = 25,
model = "mod_assets/models/Isaac_empty_space.fbx",
glitterEffect = "mini-lightning_bolt",
}
defineParticleSystem{
name = "mini-lightning_bolt",
emitters = {
{
emissionRate = 15,
emissionTime = 10,
maxParticles = 1000,
boxMin = { 0,0,0 },
boxMax = { 0,0,0 },
sprayAngle = {0,360},
velocity = {0,0},
objectSpace = true,
texture = "assets/textures/particles/lightning01.tga",
frameRate = 4,
frameSize = 256,
frameCount = 4,
lifetime = {20.1,20.3},
color0 = {1.5,1.5,1.5},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.075, 0.5},
gravity = {0,0,0},
airResistance = 5,
rotationSpeed = 1,
blendMode = "Additive",
},
-- glow
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,0.0},
boxMax = {0,0,0.0},
sprayAngle = {0,30},
velocity = {0,0},
texture = "assets/textures/particles/glow.tga",
lifetime = {1000000, 1000000},
colorAnimation = false,
color0 = {0.25,0.32,0.5},
opacity = 0.3,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.075, 0.5},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 2,
blendMode = "Additive",
objectSpace = true,
}
}
}
-
trancelistic
- Posts: 275
- Joined: Sat Jun 16, 2012 5:32 am
Re: Help needed with custom spells
Nice, I have a question. How to prevent casting spells if you didn't found the scrol yet with the spell described on it?
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Help needed with custom spells
This was talked about some time ago, this thread will give you some ideas and scripts to use, I haven't tried this myself but this will get you in the right direction I think.trancelistic wrote:Nice, I have a question. How to prevent casting spells if you didn't found the scrol yet with the spell described on it?
viewtopic.php?f=14&t=4629&hilit=learning+spells
-
trancelistic
- Posts: 275
- Joined: Sat Jun 16, 2012 5:32 am
Re: Help needed with custom spells
THanks alot. THat was indeed what I was looking for, sadly I didn't get it to work so far:(