New Spells >> show them off here

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: New Spells >> show them off here

Post by LocalFire »

Since this thread seems to be active again and since I've taken quite a few spells for my dungeon I'll give back and post some of my spells

CHANCES SHIELD

Code: Select all

defineSpell{
   name = "Chance",
   uiName = "Chance's Shield",
   skill = "spellcraft",
   level = 15,
   runes = "ACGI",
   manaCost = 20,
   onCast = function(object)
		ChanceSpell.Chance(object.level, object.x, object.y)

	end,
}
Which calls on a SE called ChanceSpell containing

Code: Select all

function Chance()

local chanceRoll = math.random(1,4)
if chanceRoll == (1) then
     for i = 1,4 do
         party:getChampion(i):setCondition("fire_shield", 60) 
party:playScreenEffect("fireburst")
   end
   playSound("heal_party")
        return true
else
if chanceRoll == (2) then
     for i = 1,4 do
         party:getChampion(i):setCondition("shock_shield", 60)
party:playScreenEffect("shockburst") 
   end
   playSound("heal_party")
        return true
else
if chanceRoll == (3) then
     for i = 1,4 do
         party:getChampion(i):setCondition("frost_shield", 60) 
party:playScreenEffect("frostburst")
   end
   playSound("heal_party")
        return true
else
if chanceRoll == (4) then
     for i = 1,4 do
         party:getChampion(i):setCondition("poison_shield", 60)
party:playScreenEffect("poison_bolt_screen") 
   end
   playSound("heal_party")
        return true
end
end
end
end end
and the scroll

Code: Select all

defineObject{
   name = "scroll_chance",
   class = "Item",
   uiName = "Scroll of Chances Shield",
   model = "assets/models/items/scroll_spell.fbx",
   gfxIndex = 113,
   scroll = true,
   spell = "Chance",
   weight = 0.3,
   description="They say that luck is a part of skill, with this spell add a random shield effect to the caster, no longer do you need to focus on a single elemental school to gain its protection"
}
its a pretty basic idea rather than having to focus on a single magic type to get its shield spell you can cast this one and get a random shield type

CHANNEL MANA

Code: Select all

defineSpell{

name = "manacharge",
uiName = "Mana Channel",
skill = "spellcraft",
level = 15,
runes = "AEI",
manaCost = 10,
onCast = function(caster, x, y, direction, skill)
local heal_amount = math.random(100,150)/1+skill
hudPrint(caster:getName() .. " Converted 40 health to " .. heal_amount .. " Energy")
for i=1,4 do
party:playScreenEffect("hit_blood")
playSound("blob_hit")

party:getChampion(i):modifyStat("energy", heal_amount)
party:getChampion(i):modifyStat("health", -40)

end
function D(caster, x, y, direction, skill)
local dmg_amount = math.random(- 30)/1+skill
for i=1,4 do
party:getChampion(i):modifyStat("health", dmg_amount)

end
end
end
}

Code: Select all

defineObject{
   name = "scroll_Channel",
   class = "Item",
   uiName = "Scroll of Mana Channeling",
   model = "assets/models/items/scroll_spell.fbx",
   gfxIndex = 113,
   scroll = true,
   spell = "manacharge",
   weight = 0.3,
   description=" The vital forces of Life and mana are bound together. A master can transfer a portion between the two, losing life to gain mana"
}
This spell changes a portion of the parties health into energy, it can be a little OP if you include a healing spell, but the fact that any injured party member could be killed by this balances that I think. I was going to make this do damage based on skill but left it on a set amount, I've left in the bit for the damage but it would have to be changed to get it to work
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: New Spells >> show them off here

Post by akroma222 »

Thanks LocalFire!

The chance shield seems very interesting...

I have also included a spell that changes health into energy... but hits the surrounding monsters as well as every party member too.

I know what you mean about the OP if combined with a healing spell... but I think this is ok - as if you have 1 mage then it takes a lot of time to cast the
Channel Mana (or Transmute Soul in my mod).... then cast a healing spell after (all this time you could be casting damage spells at monsters....)
2 or more mages could work this much better (or 1 mage and 1 ranger).... plus, as you say, you can possibly kill off one of your champs doing this - all your champs will need
decent health to make this work.

Thanks for sharing!! :D

Akroma
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: New Spells >> show them off here

Post by Eleven Warrior »

Hi all..

I am trying to create a resurrect spell to resurrect Party member that is dead and only the dead party member. This is what I have ATM.. This works but does every champ not just the Dead champ.. Its crude yes I know right, can I get a little help on this please.. :) :)

defineSpell{
name = "resurect_spell",
uiName = "Holy Resurect Spell",
skill = "earth_magic",
level = 25,
runes = "ABCD",
manaCost = 150,

onCast = function(champion, x, y, direction, skill)
--hudPrint(champ:getName().." Pulls magic arcane forces to resurrect the dead.")--crashes the editor--
spawn("fx", party.level, party.x, party.y, party.facing, "fade")
fade:translate(0, 1.5, 0)
fade:setParticleSystem("fade_white_spell")
playSound("vocal_harmony")
party:heal()

end
}
-----------------------------------------------------------------------------------------------------------------
defineObject{
name = "resurect_spell",
class = "Item",
uiName = "Holy Resurection Spell",
model = "assets/models/items/scroll_spell.fbx",
gfxIndex = 113,
scroll = true,
spell = "resurect_spell",
description = "This ancient Spell will resurect the Dead. A very powerful spell indeed..",
weight = 0.3,
}
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: New Spells >> show them off here

Post by Isaac »

Eleven Warrior wrote:Hi all..

I am trying to create a resurrect spell to resurrect Party member that is dead and only the dead party member. This is what I have ATM.. This works but does every champ not just the Dead champ.. Its crude yes I know right, can I get a little help on this please.. :) :)
function(champion, x, y, direction, skill)
--hudPrint(champ:getName()

____

This is what I use for that:
party:getChampion(x):setStat("health", 1) or setStat("health", getStatMax())
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: New Spells >> show them off here

Post by Eleven Warrior »

Hi Issac..

Ok I tried this and I get a error in the editor:

defineSpell{
name = "resurect_spell",
uiName = "Holy Resurect Spell",
skill = "earth_magic",
level = 25,
runes = "ABCD",
manaCost = 150,

onCast = party:getChampion(x):setStat("health", 1) or setStat("health", getStatMax())
hudPrint(champion:getName().." Pulls magic arcane forces to resurrect the dead.")
spawn("fx", party.level, party.x, party.y, party.facing, "fade")
fade:translate(0, 1.5, 0)
fade:setParticleSystem("fade_white_spell")
playSound("vocal_harmony")
party:heal()

end

}

Did I do it wrong?? Thxs for the help
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: New Spells >> show them off here

Post by Dr.Disaster »

Eleven Warrior wrote:Did I do it wrong?? Thxs for the help
Well you missed why there is an "or" in the onCast statement. Use either "onCast = party:getChampion(x):setStat("health", 1)" or "onCast = party:getChampion(x):setStat("health", getStatMax())", not the whole line.
User avatar
Eleven Warrior
Posts: 746
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: New Spells >> show them off here

Post by Eleven Warrior »

Yes thank you for that.. :)
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: New Spells >> show them off here

Post by Isaac »

Eleven Warrior wrote:Hi Issac..
Did I do it wrong?? Thxs for the help
Dr.Disaster wrote:
Eleven Warrior wrote:Did I do it wrong?? Thxs for the help
Well you missed why there is an "or" in the onCast statement. Use either "onCast = party:getChampion(x):setStat("health", 1)" or "onCast = party:getChampion(x):setStat("health", getStatMax())", not the whole line.
Ha! That was partly my fault; I wasn't thinking about syntax when I added the last bit, as a useful variant; and didn't catch that the 'or' could be mistaken as a condition in the statement.
I could have made that mistake myself last year. ;)
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: New Spells >> show them off here

Post by LocalFire »

I just finished up a new spell and I'm quite happy with the result so I'll share

BOLT OF AGONY

I had wanted to do a spell that would modify its damage based on the amount of health the caster has but I couldn't get it to work, so as a workaround I made this, it's a projectile spell that has 200 attack power but can only be cast is the caster has under 10% health, a big gun to pull out when close to death.

object definition for the spell projectile: It uses a custom particle system

Code: Select all

defineObject{
	name = "Pain_Bolt",
	class = "ProjectileSpell",
	particleSystem = "energy_bolt",
	hitParticleEffect = "energy_bolt_hit",
	lightColor = vec(2, 1.5, 1.25),
	lightBrightness = 8,
	lightRange = 4,
	lightHitBrightness = 60,
	lightHitRange = 20,
	castShadow = true,
	launchSound = "fireball_launch",
	projectileSound = "fireball",
	hitSound = "fireball_hit",
	screenEffect = "energy_bolt_screen",
	projectileSpeed = 9.5,
	attackPower = 200,
	damageType = "physical",
	--cameraShake = true,
	tags = { "spell" },
}
the Particle definition: for this to work you need to put a texture called energy_particle in mod_assets/textures/particles

Code: Select all

defineParticleSystem{
	name = "energy_bolt",
	emitters = {
		-- ball
		{
			emissionRate = 400,
			emissionTime = 0,
			maxParticles = 1800,
			boxMin = { 0, 0, 0},
			boxMax = { 0, 0, 0},
			sprayAngle = {0,360},
			velocity = {0.1,0.2},
			objectSpace = false,
			texture = "mod_assets/textures/particles/energy_particle.tga",
			lifetime = {0.2,0.4},
			color0 = {0.58, 0.588, 0.6},
			opacity = 0.45,
			fadeIn = 0.01,
			fadeOut = 0.6,
			size = {0.28, 0.38},
			gravity = {0,0,0},
			airResistance = 0.1,
			rotationSpeed = 3,
			blendMode = "Translucent",
		},

		--pour
 {
			 emissionRate = 300,
			 emissionTime = 0,
			 spawnBurst = false,
			 maxParticles =3000,
			 boxMin = {-0.35,-1,-0.35},
			 boxMax = {0.35,0.5,0.35},
			 objectSpace = false,
			 sprayAngle = {0,120},
			 velocity = {0,0},
 			texture = "assets/textures/particles/glitter_silver.tga",
 			lifetime = {100, 100},
			 colorAnimation = false,
			 color0 = {0.5, 0.6, 1},
 			opacity = 0.65,
			 fadeIn = 1,
			 fadeOut = 2.5,
 			size = {0.05, 0.1},
			 gravity = {0,-3,0},
 			airResistance = 1,
 			rotationSpeed = 0.7,
			 blendMode = "Additive",
		},
--spray
		 {
			 emissionRate = 900,
			 emissionTime = 0,
			 spawnBurst = false,
			 maxParticles =1500,
			 boxMin = {-0.2,-1,-0.2},
			 boxMax = {0.2,0.2,0.2},
			 objectSpace = false,
			 sprayAngle = {0,120},
			 velocity = {-1,-1.5},
 			texture = "assets/textures/particles/glitter_silver.tga",
 			lifetime = {100, 100},
			 colorAnimation = false,
			 color0 = {0.5, 0.6, 1},
 			opacity = 0.65,
			 fadeIn = 1,
			 fadeOut = 2.5,
 			size = {0.06, 0.12},
			 gravity = {0,-2,0},
 			airResistance = 1,
 			rotationSpeed = 0.7,
			 blendMode = "Additive",
		},

		
	}
}

defineParticleSystem{
	name = "energy_bolt_hit",
	emitters = {
		-- splash
		{
			spawnBurst = true,
			maxParticles = 20,
			sprayAngle = {0,360},
			velocity = {0.2,0.9},
			objectSpace = true,
			texture = "mod_assets/textures/particles/energy_particle.tga",
			lifetime = {0.2,0.7},
			color0 = {0.49, 0.45, 0.6},
			opacity = 0.4,
			fadeIn = 0.05,
			fadeOut = 0.5,
			size = {0.6, 1.0},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 1,
			blendMode = "Translucent",
		},

--spray
		 {
			 emissionRate = 900,
			 emissionTime = 0,
			 spawnBurst = true,
			 maxParticles =1500,
			 boxMin = {-0.2,-1,-0.2},
			 boxMax = {0.2,0.2,0.2},
			 objectSpace = false,
			 sprayAngle = {0,120},
			 velocity = {-1,-1.5},
 			texture = "assets/textures/particles/glitter_silver.tga",
 			lifetime = {1.1, 1.7},
			 colorAnimation = false,
			 color0 = {0.5, 0.5, 1},
 			opacity = 0.65,
			 fadeIn = 1,
			 fadeOut = 2.7,
 			size = {0.06, 0.12},
			 gravity = {0,-2,0},
 			airResistance = 1,
 			rotationSpeed = 0.7,
			 blendMode = "Additive",
		},

		-- fog 2
		{
			spawnBurst = true,
			maxParticles = 20,
			sprayAngle = {0,360},
			velocity = {0.2,0.9},
			objectSpace = true,
			texture = "mod_assets/textures/particles/energy_particle.tga",
			lifetime = {0.2,0.7},
			color0 = {0.49, 0.45, 0.6},
			opacity = 0.4,
			fadeIn = 0.05,
			fadeOut = 0.3,
			size = {0.4, 0.6},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 2,
			blendMode = "Translucent",
		},

		-- 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.42, 0.42, 0.6},
			opacity = 0.2,
			fadeIn = 0.01,
			fadeOut = 0.5,
			size = {1, 1},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 2,
			blendMode = "Additive",
		}
	}
}

defineParticleSystem{
	name = "energy_bolt_screen",
	emitters = {
		{
			spawnBurst = true,
			maxParticles = 300,
			sprayAngle = {0,360},
			velocity = {0,0.3},
			boxMin = {-1.1,-0.9,1},
			boxMax = {1.1,0.9,1},
			objectSpace = true,
			texture = "assets/textures/particles/glow.tga",
			lifetime = {0.3, 0.5},
			color0 = {0.5, 0.6, 1},
			opacity = 0.38,
			fadeIn = 0.001,
			fadeOut = 1,
			size = {0.005, 0.3},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 6,
			blendMode = "Additive",
		},


		--spray
		 {
			 emissionRate = 900,
			 emissionTime = 0,
			 spawnBurst = true,
			 maxParticles =1500,
			 boxMin = {-0.2,-1,-0.2},
			 boxMax = {0.2,0.2,0.2},
			 objectSpace = false,
			 sprayAngle = {0,120},
			 velocity = {-1,-1.5},
 			texture = "assets/textures/particles/glitter_silver.tga",
 			lifetime = {100, 100},
			 colorAnimation = false,
			 color0 = {0.5, 0.6, 1},
 			opacity = 0.65,
			 fadeIn = 1,
			 fadeOut = 2.5,
 			size = {0.03, 0.06},
			 gravity = {0,-2,0},
 			airResistance = 1,
 			rotationSpeed = 0.7,
			 blendMode = "Additive",
		},	
		{
			spawnBurst = true,
			maxParticles = 1500,
			sprayAngle = {0,360},
			velocity = {0,0.3},
			boxMin = {-1.1,-0.9,1},
			boxMax = {1.1,0.9,1},
			objectSpace = true,
			texture = "mod_assets/textures/particles/energy_particle.tga",
			lifetime = {0.3, 0.5},
			color0 = {0.5, 0.6, 1},
			opacity = 0.35,
			fadeIn = 0.001,
			fadeOut = 1,
			size = {0.03, 0.6},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 1,
			blendMode = "Additive",
		},

		-- glow
		{
			spawnBurst = true,
			emissionRate = 1,
			emissionTime = 0,
			maxParticles = 1,
			boxMin = {0,0,1},
			boxMax = {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, 0.6, 1},
			opacity = 0.2,
			fadeIn = 0.001,
			fadeOut = 0.1,
			size = {3.2, 3.2},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 2,
			blendMode = "Additive",
			objectSpace = true,
		}
	}
}
and lastly the spell itself and the spell scroll

Code: Select all

defineSpell{
   name = "Pain",
   uiName = "Pain Sphere",
   skill = "spellcraft",
   level = 15,
   runes = "BEH",
   manaCost = 1,
onCast = function(caster, x, y, direction, skill)
	local percentage_health = caster:getStat("health") / caster:getStatMax("health") * 100

if percentage_health < 11 then
  	      
local dx,dy = getForward(party.facing)
        
local x,y = party.x + dx, party.y + dy
     
        
 spawn("Pain_Bolt", party.level, x, y, party.facing)
        


else
hudPrint ("My wounds are not bad enough to create a Pain sphere")
        
   
end
end,

}

defineObject{
  name = "scroll_pain",
  class = "Item",
  uiName = "Sphere of Agony",
  model = "assets/models/items/scroll_spell.fbx",
  gfxIndex = 113,
  scroll = true,
  spell = "Pain",
  description="As life fades from the mage, they may if skilled, pass their pain into another causing that creature to share in their misery. This spell can only be cast by a mage on the brink of death...",
  weight = 0.3,
}
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: New Spells >> show them off here

Post by LocalFire »

And another spell in the vein of the chances shield

FATES FOOL

this one gives one of 5 random effects, 3 bad and 2 good. it can paralyse, poison or wound for bad effects, or Fully restore health and energy or fill up the food gauge for good effects, given that the full restore is so powerful I made the negative effects more numerous, it may still seem a little imbalanced but its easy to add additional effects to the spell, and the chances of an effect can be increased by repeating the number of FateRolls for each effect (See the code to see what I mean by fateroll)


The spell and its scroll.

Code: Select all

defineSpell{
   name = "Fate",
   uiName = "Fate's Fool",
   skill = "spellcraft",
   level = 0,
   runes = "BDEFH",
   manaCost = 15,
   onCast = function(object)
		FateSpell.Fate(object.level, object.x, object.y)

	end,
}

defineObject{
  name = "scroll_fate",
  class = "Item",
  uiName = "Scroll of Fate's fool",
  model = "assets/models/items/scroll_spell.fbx",
  gfxIndex = 113,
  scroll = true,
  spell = "Fate",
  description="Call upon the fickle forces of fate, to deal one of five random effects on the party, for good or ill...",
  weight = 0.3,
}
calling on an SE called FateSpell containing:

Code: Select all

function Fate()

local fateRoll = math.random(1,5)

if fateRoll == (1) then
     for i = 1,4 do
         party:getChampion(i):setCondition("paralyzed", 10)
party:playScreenEffect("death_dust") 

   end
   playSound("party_move_overloaded")
      hudPrint("you feel your muscles lock")  
 
else

if fateRoll == (5) then
     for i = 1,4 do
         party:getChampion(i):setCondition("poison", 20)
party:playScreenEffect("hit_goo") 

   end
   playSound("party_move_overloaded")
      hudPrint("you feel your blood fill with toxin")  
 
else
if fateRoll == (2) then
     for i = 1,4 do
         party:getChampion(i):modifyStat("health", -10)
party:playScreenEffect("party_crush")

   end
   playSound("wall_tapestry_tear")
     hudPrint("You feel your wounds open")   
else

if fateRoll == (4) then
     for i = 1,4 do
         party:getChampion(i):modifyFood(100)
party:playScreenEffect("blob_hit")

   end
   playSound("consume_food")
   hudPrint("You feel your belly fill")     
else
if fateRoll == (3) then
for i = 1,4 do
    
          party:getChampion(i):modifyStat("health", 1000)
          party:getChampion(i):modifyStat("energy", 1000)
party:playScreenEffect("blob_hit")

   end
   playSound("heal_party")
       hudPrint("You feel refreshed") 

end end
end end
end end
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
Post Reply