Apollos
Dude who does stuff
Made for TFS 1.1
One of my first spells, so I'm sure it's not perfect. If you have advice on how to make it better please let me know. Thought it was pretty cool and didn't see a spell like it anywhere so here you go!
It's a directional spell that summons the tree, heals in intervals, then disappears.
data/spells/spells.xml
data/spells/scripts/healing/tree of life.lua
EDIT: Shortened code.
One of my first spells, so I'm sure it's not perfect. If you have advice on how to make it better please let me know. Thought it was pretty cool and didn't see a spell like it anywhere so here you go!
It's a directional spell that summons the tree, heals in intervals, then disappears.
data/spells/spells.xml
XML:
<instant group="healing" spellid="159" name="Tree of Life" words="exura con" lvl="36" mana="150" prem="1" aggressive="0" casterTargetOrDirection="1" blockwalls="1" exhaustion="60000" groupcooldown="2000" needlearn="0" script="healing/tree of life.lua">
<vocation name="Elder Druid"/>
</instant>
data/spells/scripts/healing/tree of life.lua
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatArea(combat,createCombatArea({{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 3, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}}))
function getWaveDmg(cid, level, maglevel)
min = ((level / 5) + (maglevel * 1.4) + 8)
max = ((level / 5) + (maglevel * 1.8) + 11)
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getWaveDmg")
local combatsummon = createCombatObject()
setCombatParam(combatsummon,COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
setCombatParam(combatsummon,COMBAT_PARAM_CREATEITEM, 2699)
local combatpoff = createCombatObject()
setCombatParam(combatpoff, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatParam(combatpoff, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatArea(combatpoff,createCombatArea({{3}}))
function getDmg_Brush(cid, level, maglevel)
return (10)*-1,(20)*-1
end
setCombatCallback(combatpoff, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
local function RunPart(c,cid,var,dirList,dirEmitPos)
if (isCreature(cid)) then
doCombat(cid, c, var)
if (dirList ~= nil) then
local i = 2;
while (i < #dirList) do
doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
i = i + 2
end
end
end
end
local function doRemove(pos, itemId)
local tree = Tile(pos):getItemById(2699)
if tree then
tree:remove()
end
end
function onCastSpell(cid, var)
local pos = var:getPosition()
local startPos = getCreaturePosition(cid)
RunPart(combat,cid,var)
addEvent(RunPart,1,combatsummon,cid.uid,var)
addEvent(RunPart,3000,combat,cid.uid,var)
addEvent(RunPart,6000,combat,cid.uid,var)
addEvent(RunPart,9000,combat,cid.uid,var)
addEvent(RunPart,11000,combatpoff,cid.uid,var)
addEvent(doRemove, 11000, pos, 2699)
return true
end
EDIT: Shortened code.
Last edited: