Page 1 of 1

resurection and improved fireball spells

Posted: Thu Jun 20, 2013 2:39 pm
by bongobeat
Hi guys!

1° I wanted to create a spell for my mod:

a ressurect spell, which act like the crystal, but cast by a magician.
I have found a spell that heal party (in the new spells topic)
please someone can help me to modify the actuel script into a resurect spell?

Code: Select all

-- Party Healing spell
defineSpell{
   name = "healing",
   uiName = "Healing",
   skill = "spellcraft",
   level = 20,
   runes = "BF",
   manaCost = 40,
   onCast = function(caster, x, y, direction, skill)
     local character_to_heal = 5
     local least_health = 10000
     local max_health = 10000
     local percentage_health = 100
     local champName = "No-one"
     if skill < 24
     then 
       local heal_amount = math.random(2,4)*skill
       for j=1,4 do
         if party:getChampion(j):getEnabled() and party:getChampion(j):isAlive()
         then
           if party:getChampion(j):getStat("health") / party:getChampion(j):getStatMax("health") * 100 < percentage_health
           then
             least_health = party:getChampion(j):getStat("health")
             max_health = party:getChampion(j):getStatMax("health")
             percentage_health = least_health / max_health * 100
             character_to_heal = j
           end
         end
       end
       if (character_to_heal < 5)
       then
         champName = party:getChampion(character_to_heal):getName()
         party:getChampion(character_to_heal):modifyStat("health", heal_amount)
       end
       -- hudPrint(champName .. " has " .. tostring(least_health) .. " of " .. tostring(max_health))
       hudPrint(champName .. " was healed by " .. caster:getName())
     else
       local heal_amount = math.random(6,8) /4 *skill
       for i=1,4 do
         party:getChampion(i):modifyStat("health", heal_amount)
       end
     hudPrint(caster:getName() .. " healed the party")
     end
     playSound("heal_party")
     party:playScreenEffect("frostburst")
   end,
}
2° I have copy/paste the existing fireball spell into a new one, called "meteor"
it's just an improved fireball.

but in the editor I can not use this spell (spell fizzles)
I have created a new object and use the correct rune but it simply dont work
did I something wrong?

here is the new spell:
into spells.lua

Code: Select all

defineSpell{
	name = "meteor",
	uiName = "Meteor",
	skill = "spellcraft",
	level = 25,
	runes = "ACFE",
	manaCost = 60,
	onCast = "meteor",
}
and the script into objects.lua

Code: Select all

defineObject{
	name = "meteor",
	class = "ProjectileSpell",
	particleSystem = "fireball_greater",
	hitParticleEffect = "fireball_hit_greater",
	lightColor = vec(1, 0.5, 0.25),
	lightBrightness = 15,
	lightRange = 8,
	lightHitBrightness = 40,
	lightHitRange = 10,
	castShadow = true,
	launchSound = "fireball_launch",
	projectileSound = "fireball",
	hitSound = "fireball_hit",
	screenEffect = "fireball_screen",
	projectileSpeed = 8.5,
	attackPower = 180,
	damageType = "fire",
	--cameraShake = true,
	tags = { "spell" },
}