BugbyJones
New Member
- Joined
- Jun 25, 2023
- Messages
- 4
- Reaction score
- 1
Hi,
My Undead Legion spell only creates one skeleton and only if you're standing directly on the corpse. It should resurrect all corpses to skeletons over a certain area.
Here is the line in Spells.XML:
And here is the script for the spell .lua:
I will continue trying to fix it myself for now and will send the solution if I manage to.
Thanks.
Edit to add- you can't actually cast the spell at all unless standing on a corpse.
It says "sorry not possible" instead of casting the spell and showing the AoE animation etc.
My Undead Legion spell only creates one skeleton and only if you're standing directly on the corpse. It should resurrect all corpses to skeletons over a certain area.
Here is the line in Spells.XML:
Lua:
<instant name="Undead Legion" words="exana mas mort" lvl="30" mana="500" aggressive="1" needlearn="1" script="spells/undead legion.lua">
<vocation name="Druid" />
<vocation name="Elder Druid" />
</instant>
And here is the script for the spell .lua:
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))
local humanBodies = {
4240, 4241, 4247, 4248
}
function onCastSpell(creature, variant)
local position = Variant.getPosition(variant)
local tile = Tile(position)
if tile then
local corpse = tile:getTopDownItem()
if corpse then
local itemType = corpse:getType()
if not table.contains(humanBodies, itemType:getId()) then
if itemType:isCorpse() and itemType:isMovable() then
local monster = Game.createMonster("Skeleton", position)
if monster then
corpse:remove()
monster:setMaster(creature)
position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end
end
end
end
end
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
creature:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return false
end
I will continue trying to fix it myself for now and will send the solution if I manage to.
Thanks.
Post automatically merged:
Edit to add- you can't actually cast the spell at all unless standing on a corpse.
It says "sorry not possible" instead of casting the spell and showing the AoE animation etc.
Last edited: