• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved i can not add a custom spell

Tyhawks

New Member
Joined
Jan 3, 2015
Messages
37
Reaction score
0
hey guys I have created a custom spell through "spell Maker", when finished I get the xml and script I put both scripts in the right place. I then get onto my server and reset, after reset I still can not use my spell. please commenting telling me on how to do it. Thanks
 
This is the Script
Code:
-- SpellCreator generated.
-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{2},
{1},
{1},
{1}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 300ms
local combat3_Brush = createCombatObject()
setCombatParam(combat3_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat3_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat3_Brush,createCombatArea({{2, 1, 1},
{0, 1, 1},
{0, 1, 1},
{0, 1, 1}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat3_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 700ms
local combat7_Brush = createCombatObject()
setCombatParam(combat7_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat7_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat7_Brush,createCombatArea({{1, 1, 1, 1},
{1, 2, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat7_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 1100ms
local combat11_Brush = createCombatObject()
setCombatParam(combat11_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat11_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat11_Brush,createCombatArea({{0, 1, 1, 1, 1},
{0, 3, 1, 1, 1},
{0, 1, 1, 1, 1},
{0, 0, 1, 1, 1},
{1, 1, 1, 1, 1}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat11_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 1200ms
local combat12_Brush = createCombatObject()
setCombatParam(combat12_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat12_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat12_Brush,createCombatArea({{1, 1, 1, 1, 0},
{1, 3, 1, 1, 1},
{1, 1, 1, 0, 0},
{1, 1, 1, 0, 0},
{1, 1, 0, 0, 0}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat12_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- =============== 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,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,cid,var)
addEvent(RunPart,300,combat3_Brush,cid,var)
addEvent(RunPart,700,combat7_Brush,cid,var)
addEvent(RunPart,1100,combat11_Brush,cid,var)
addEvent(RunPart,1200,combat12_Brush,cid,var)
return true
end

this is the XML
Code:
<instant name="Death " words="Death Flam" lvl="100" maglv="5" mana="500" exhaustion="500" prem="0" needlearn="0" blockwalls="0" aggressive="1" event="script" value="Death .lua">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="3"/>
<vocation id="4"/>
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
</instant>
 
Last edited by a moderator:
Use code tags, else the script gets bugged (it's already bugged atm since it was posted without tags, so you can edit your post and add it again).

Also post which server you use and the errors.
 
Do you get errors? What happens when you cast the spell?

Can you post the script in code tags? I changed it in your post but the script is still missing parts because it was posted without script tags.
 
do I put all the script in the spells.lua or a section ?

not sure that's how it was

nothing happens when I do the spell it just does it as I am talking :/

I have too the space out between the Death.lua and still nothing just text
 
Last edited by a moderator:
yea my mate tried having a look and now its saying "
loading customspells.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/customspells.xml
[04/01/2015 17:40:15] Line: 20, Info: Opening and ending tag mismatch: mod line 2 and instant
 
Line: 16, Info: Extra content at the end of the document | this is also showing and line 16 is <instant name="Death" words="Death Flam" lvl="100" manapercent="5" prem="1" aggressive="1" selftarget="0" exhaustion="500" needlearn="0" event="script" value="customspell/Death.lua"/>
 
Post the whole part in spells.xml, with the spell above and the spell under it, also use code tags.
[ code]
script here...
[/code]
Without space.
Code:
script here...
 
I have done what you say and it says
[Warning - BaseEvents::loadFromXml] Cannot open spells.xml file.
[04/01/2015 18:01:01] Line: 661, Info: Premature end of data in tag spells line 2

[04/01/2015 18:01:01] [Error - Game::reloadInfo] Failed to reload spells.
Nothing is on line 661
 
ive got Team Viewer 10 please can u show me on how to do it because im getting really stressed out :/

can some one do It with pictures ? I understand it more than

[ code ]
-- SpellCreator generated.
-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{1, 2},
{1, 0},
{1, 0}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 300ms
local combat3_Brush = createCombatObject()
setCombatParam(combat3_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat3_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat3_Brush,createCombatArea({{1, 1},
{3, 1},
{1, 1},
{1, 1}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat3_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 700ms
local combat7_Brush = createCombatObject()
setCombatParam(combat7_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat7_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat7_Brush,createCombatArea({{1, 1, 1, 1},
{1, 0, 0, 0},
{1, 1, 2, 0},
{1, 1, 0, 0},
{1, 1, 0, 0}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat7_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 1100ms
local combat11_Brush = createCombatObject()
setCombatParam(combat11_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat11_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat11_Brush,createCombatArea({{0, 1, 1, 1, 1},
{0, 1, 1, 1, 1},
{0, 1, 3, 1, 1},
{0, 0, 1, 1, 1},
{1, 1, 1, 1, 1}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat11_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- Areas/Combat for 1200ms
local combat12_Brush = createCombatObject()
setCombatParam(combat12_Brush, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
setCombatParam(combat12_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat12_Brush,createCombatArea({{1, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 3, 0, 0},
{1, 1, 1, 0, 0},
{1, 1, 0, 0, 0}}))
function getDmg_Brush(cid, level, maglevel)
return (250)*-1,(750)*-1
end
setCombatCallback(combat12_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- =============== 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,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,cid,var)
addEvent(RunPart,300,combat3_Brush,cid,var)
addEvent(RunPart,700,combat7_Brush,cid,var)
addEvent(RunPart,1100,combat11_Brush,cid,var)
addEvent(RunPart,1200,combat12_Brush,cid,var)
return true
end


Still have notgot this sorted if some one can please tell me how to do it more clearly it would be helpful thanks :D
 
Last edited by a moderator:
I have done what you say and it says
[Warning - BaseEvents::loadFromXml] Cannot open spells.xml file.
[04/01/2015 18:01:01] Line: 661, Info: Premature end of data in tag spells line 2

[04/01/2015 18:01:01] [Error - Game::reloadInfo] Failed to reload spells.
Nothing is on line 661
Post the part you edited in code tags.
So the part in spells.xml, and use code tags.
 
hey guys so so sorry I have messed around a little and got it to work I dunno what happened but yea I have made 3 spell now and there amazing :D
 

Similar threads

Back
Top