Question about built-in spells
Posted: Sun Feb 01, 2015 5:04 pm
I am looking at how onCast() works for in-game objects. I thought it specified an object defined to be the spell. But for quite a few spell definitions this is not the case. They may have defineObject defintions close to the value given in onCast or sometimes no object. Take fireball for example:
Here is its "defineSpell":
So its onCast is "fireball". That means there should be an object called fireball, right? There is not. There is a LUA file called fireball.lua. In it are three types of fireballs: small, medium, large:
So which one is used and when???
Note many others, like "heal", "openDoor", "causeFear", etc... don't define anything. I guess we have to experiment in-game to see what these do. Example, how much does "heal" heal? They must be completely hard-coded not even in the LUA files.
Here is its "defineSpell":
Code: Select all
defineSpell{
name = "fireball",
uiName = "Fireball",
gesture = 1236,
manaCost = 43,
onCast = "fireball",
skill = "fire_magic",
requirements = { "fire_magic", 3, "air_magic", 1 },
icon = 61,
spellIcon = 7,
description = "A flaming ball of fire shoots from your fingertips causing devastating damage to your foes.",
}
Code: Select all
defineObject{
name = "fireball_small",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "fireball_small",
},
{
class = "Light",
color = vec(1, 0.5, 0.25),
brightness = 10,
range = 5,
castShadow = true,
},
{
class = "Projectile",
spawnOffsetY = 1.35,
velocity = 10,
radius = 0.1,
hitEffect = "fireball_blast_small",
},
{
class = "Sound",
sound = "fireball",
},
{
class = "Sound",
name = "launchSound",
sound = "fireball_launch",
},
},
}
defineObject{
name = "fireball_medium",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "fireball_medium",
},
{
class = "Light",
color = vec(1, 0.5, 0.25),
brightness = 15,
range = 7,
castShadow = true,
},
{
class = "Projectile",
spawnOffsetY = 1.35,
velocity = 10,
radius = 0.1,
hitEffect = "fireball_blast_medium",
},
{
class = "Sound",
sound = "fireball",
},
{
class = "Sound",
name = "launchSound",
sound = "fireball_launch",
},
},
}
defineObject{
name = "fireball_large",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "fireball_large",
},
{
class = "Light",
color = vec(1, 0.5, 0.25),
brightness = 15,
range = 7,
castShadow = true,
},
{
class = "Projectile",
spawnOffsetY = 1.35,
velocity = 10,
radius = 0.1,
hitEffect = "fireball_blast_large",
},
{
class = "Sound",
sound = "fireball",
},
{
class = "Sound",
name = "launchSound",
sound = "fireball_launch",
},
},
}
Note many others, like "heal", "openDoor", "causeFear", etc... don't define anything. I guess we have to experiment in-game to see what these do. Example, how much does "heal" heal? They must be completely hard-coded not even in the LUA files.