Doitforthegains
Well-Known Member
- Joined
- Aug 30, 2014
- Messages
- 231
- Reaction score
- 74
So spellcreator is outdated and wont support TFS 1.1 which is what I use; all the spell tutorials I've read are just about how to change effects/animations/etc so they aren't relevant for me. I was wondering if I posted the spell I made on spellcreator, could someone with knowledge of TFS 1.1 edit the script so that it will be compatable?
This is the error I'm currently getting:
I'm hoping that if someone will edit this for me that it will give me a reliable source to look at to understand how to write the script myself for future references. Thanks in advance!
Code:
local combat0_Brush_2 = createCombatObject()
setCombatParam(combat0_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(combat0_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat0_Brush_2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
function getDmg_Brush_2(cid, level, maglevel)
return (10)*-1,(20)*-1
end
setCombatCallback(combat0_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")
local dfcombat0_Brush_2 = {CONST_ANI_ENERGYBALL,0,1}
-- Areas/Combat for 100ms
local combat1_Brush = createCombatObject()
setCombatParam(combat1_Brush, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat1_Brush, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1_Brush, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
function getDmg_Brush(cid, level, maglevel)
return (10)*-1,(20)*-1
end
setCombatCallback(combat1_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
local dfcombat1_Brush = {CONST_ANI_FIRE,0,1}
-- Areas/Combat for 200ms
local combat2_Brush_3 = createCombatObject()
setCombatParam(combat2_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatParam(combat2_Brush_3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2_Brush_3, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
function getDmg_Brush_3(cid, level, maglevel)
return (10)*-1,(20)*-1
end
setCombatCallback(combat2_Brush_3, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_3")
local dfcombat2_Brush_3 = {CONST_ANI_ICE,0,1}
-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
if (isCreature(cid)) then
doCombat(cid, c, var)
if (dirList ~= nil) then -- Emit distance effects
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
function onCastSpell(cid, var)
local startPos = getCreaturePosition(cid)
RunPart(combat0_Brush_2,cid,var,dfcombat0_Brush_2,startPos)
addEvent(RunPart,100,combat1_Brush,cid,var,dfcombat1_Brush,startPos)
addEvent(RunPart,200,combat2_Brush_3,cid,var,dfcombat2_Brush_3,startPos)
return true
end
This is the error I'm currently getting:
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/custom/elemental strike.lua:onCastSpell
data/spells/scripts/custom/elemental strike.lua:52: attempt to call global 'getC
reaturePosition' (a nil value)
stack traceback:
[C]: in function 'getCreaturePosition'
data/spells/scripts/custom/elemental strike.lua:52: in function <data/sp
ells/scripts/custom/elemental strike.lua:51>
I'm hoping that if someone will edit this for me that it will give me a reliable source to look at to understand how to write the script myself for future references. Thanks in advance!
Last edited: