Ha! I never thought about that. Will test it to see what happens and maybe adjust the monster list.Merethif wrote:Amazing. I love your spells.Grimwold wrote: Push Monster
I'm not sure if above spell should work on Tentacles though?
Ha! I never thought about that. Will test it to see what happens and maybe adjust the monster list.Merethif wrote:Amazing. I love your spells.Grimwold wrote: Push Monster
I'm not sure if above spell should work on Tentacles though?
Code: Select all
-- Create Food spell
defineSpell{
name = "create_food_spell",
uiName = "Create Food",
skill = "spellcraft",
level = 14,
runes = "EF",
manaCost = 20,
onCast = function(caster, x, y, direction, skill)
if getMouseItem() == nil then
local rand = math.random(5)
local obj
if rand == 1 then obj = "ice_lizard_steak"
elseif rand == 2 then obj = "baked_maggot"
elseif rand == 3 then obj = "boiled_beetle"
elseif rand == 4 then obj = "rat_shank"
else obj = "pitroot_bread"
end
setMouseItem(spawn(obj))
end
end
}
Code: Select all
defineSpell{
name = "create_food_spell",
uiName = "Create Food",
skill = "spellcraft",
level = 14,
runes = "EF",
manaCost = 20,
onCast = function(caster, x, y, direction, skill)
local foodList = {"ice_lizard_steak", "baked_maggot", "boiled_beetle", "rat_shank", "pitroot_bread"}
if getMouseItem() == nil then
local obj = foodList[math.random(1,#foodList)]
setMouseItem(spawn(obj))
end
end,
}
The spells that creates food in mage's hand, rather then on the floor, is a way more spiffy IMOXanathar wrote:Thanks!
Didn't know of the wiki (and neither that there were alread create food spells there).
Code: Select all
defineSpell{
name = "enchant_arrow",
uiName = "Enchant Arrow",
skill = "spellcraft",
level = 5,
runes = "AF",
manaCost = 20,
onCast = function(caster, x, y, direction, skill)
local arrowList = {"cold", "fire", "poison", "shock"}
local rnd = math.random(1,#arrowList)
local arrowType = arrowList[rnd].."_arrow"
if getMouseItem().name ~= "arrow" then
hudPrint("You have to cast this spell while holding an arrow in your hand (cursor)")
else
local size = getMouseItem():getStackSize()
setMouseItem(spawn(arrowType):setStackSize(size))
playSound("generic_spell")
if size > 1 then
hudPrint(caster:getName().." enchanted "..size.." arrows into "..arrowList[rnd].." arrows")
else
hudPrint(caster:getName().." enchanted arrow into "..arrowList[rnd].." arrow")
end
end
end,
}
Does the game crash out completely, or are you returned to the editor screen? If the second, are there any messages in the script?Merethif wrote:Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
Ok, I know what I was doing wrong. I forgot to rename script entity from script_entity_3 to pushback_spell_script (facepalm).Grimwold wrote:Does the game crash out completely, or are you returned to the editor screen? If the second, are there any messages in the script?Merethif wrote:Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
Did you add the teleport_probe monster to your monsters.lua file?
I actually re-created the spell on my home PC using only what I posted here and got it to work ok. (Since I forgot to copy my original files from my office PC to my googleDrive!!)
Great. That was the other thing I was going to suggest.Merethif wrote:Ok, I know what I was doing wrong. I forgot to rename script entity from script_entity_3 to pushback_spell_script (facepalm).Grimwold wrote:Does the game crash out completely, or are you returned to the editor screen? If the second, are there any messages in the script?Merethif wrote:Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
Did you add the teleport_probe monster to your monsters.lua file?
I actually re-created the spell on my home PC using only what I posted here and got it to work ok. (Since I forgot to copy my original files from my office PC to my googleDrive!!)
Now it works like a charm.