• 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!

OpenTibia SpellCreator: A graphical spell creation enviroment

I dont have the first lines which u posted :p

and i replaced it and still no errors and still no distance effects
 
If you did replace it and you do not see anything in the console, then I can't help you. Since you MUST see RunPart, otherwise your rev is just messed up.
 
Damn shit...could you make such a spell and release me the script? :p

Then im gonna try the spell...
 
Your spell does work. You just fail at setting it up it seems (/reload spells? restart server?), or your rev doesn't support distance effects, or something weird is going on =3.
 
-reloaded spells
-restarted server
-made new spells

--> Nothing worked -.- and still no errors...
how could I make that it works?! -.-
 
I made a direction spell but it didnt support the dist effect i added :/
 
I made a direction spell but it didnt support the dist effect i added :/

It is pointless to tell "it does not work". I really need more information to do anything, and in most cases you do something wrong yourself.

Distance effect = To-Target effect.
Targetted distance effect = Towards area from cast position.

If it fails, at least post the script AND the used XML.
In the end, tell me where I can download your rev and I'll test it there. (Unless your rev is ancient, then I don't care, sorry.)
 
This is my .lua:

PHP:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_NewItem90838 = createCombatObject()
setCombatParam(combat0_NewItem90838, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_NewItem90838,createCombatArea({{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}}))
function getDmg_NewItem90838(cid, level, maglevel)
	return (10)*-1,(20)*-1 
end
setCombatCallback(combat0_NewItem90838, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_NewItem90838")
local dfcombat0_NewItem90838 = {CONST_ANI_FIRE,5,5,-5,5,-5,0,5,0,5,-5,-5,-5,0,-5,0,5}

-- Areas/Combat for 200ms
local combat2_NewItem56461 = createCombatObject()
setCombatParam(combat2_NewItem56461, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat2_NewItem56461, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat2_NewItem56461,createCombatArea({{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}}))
function getDmg_NewItem56461(cid, level, maglevel)
	return (10)*-1,(20)*-1 
end
setCombatCallback(combat2_NewItem56461, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_NewItem56461")

-- =============== CORE FUNCTIONS ===============
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_NewItem90838,cid,var,dfcombat0_NewItem90838,startPos)
	addEvent(RunPart,200,combat2_NewItem56461,cid,var)
	return true
end

This is my spells.xml:

PHP:
<instant name="test" words="test" lvl="1" maglv="1" mana="25" exhaustion="1000" prem="0" needlearn="0" blockwalls="0" aggressive="1" event="script" value="test.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>


And here you can download exact the server which im using...(I just changed map and some items not more...)

PHP:
http://otland.net/f18/8-54-forgotten-server-0-3-6pl1-crying-damson-59924/
 
Released a fix for those where distance effects were failing (the RunPart function wasn't local, which caused the issue).
Either add local manually to all scripts, or re-generate ALL spells you've made.

New scripts will have local added automatically.
 
Now it works :) tested on tfs 0.3.6!

Thank you very much!
 
Sorry for double post:

Its only one thing left, when you shoot the direction spell with event and you move its like it follows you and its getting wierd.
 
Sorry for double post:

Its only one thing left, when you shoot the direction spell with event and you move its like it follows you and its getting wierd.

TFS spell system bug, I can't fix how area effects are being handled since the damage is being handled the same way.
 
I got this error on logut while shooting the spell :(
Code:
[14/06/2012 17:03:21] [Error - Spell Interface] 
[14/06/2012 17:03:21] data/spells/scripts/players/energy wave.lua:onCastSpell
[14/06/2012 17:03:21] Description: 
[14/06/2012 17:03:21] (luaAddEvent) Callback parameter should be a function.
 
When will you ever learn to post the script? I can not guess what your script is......
 
But it should be same error on all direction spells :O

Code:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Ball = createCombatObject()
setCombatParam(combat0_Ball, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Ball,createCombatArea({{2},
{1}}))
function getDmg_Ball(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat0_Ball, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Ball")
local dfcombat0_Ball = {CONST_ANI_ENERGYBALL,0,1}

-- Areas/Combat for 1400ms
local combat14_Energy = createCombatObject()
setCombatParam(combat14_Energy, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)
setCombatParam(combat14_Energy, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat14_Energy,createCombatArea({{0, 2, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Energy(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat14_Energy, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Energy")

-- Areas/Combat for 1200ms
local combat12_Ball = createCombatObject()
setCombatParam(combat12_Ball, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat12_Ball,createCombatArea({{0, 2, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Ball(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat12_Ball, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Ball")
local dfcombat12_Ball = {CONST_ANI_ENERGYBALL,1,5,0,5,-1,5}

-- Areas/Combat for 1100ms
local combat11_Energy = createCombatObject()
setCombatParam(combat11_Energy, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)
setCombatParam(combat11_Energy, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat11_Energy,createCombatArea({{0, 2, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Energy(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat11_Energy, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Energy")

-- Areas/Combat for 900ms
local combat9_Ball = createCombatObject()
setCombatParam(combat9_Ball, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat9_Ball,createCombatArea({{0, 2, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Ball(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat9_Ball, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Ball")
local dfcombat9_Ball = {CONST_ANI_ENERGYBALL,1,4,0,4,-1,4}

-- Areas/Combat for 800ms
local combat8_Energy = createCombatObject()
setCombatParam(combat8_Energy, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)
setCombatParam(combat8_Energy, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat8_Energy,createCombatArea({{0, 2, 0},
{0, 0, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Energy(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat8_Energy, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Energy")

-- Areas/Combat for 600ms
local combat6_Ball = createCombatObject()
setCombatParam(combat6_Ball, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat6_Ball,createCombatArea({{0, 2, 0},
{0, 0, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Ball(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat6_Ball, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Ball")
local dfcombat6_Ball = {CONST_ANI_ENERGYBALL,1,3,0,3,-1,3}

-- Areas/Combat for 500ms
local combat5_Energy = createCombatObject()
setCombatParam(combat5_Energy, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)
setCombatParam(combat5_Energy, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat5_Energy,createCombatArea({{0, 2, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Energy(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat5_Energy, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Energy")

-- Areas/Combat for 300ms
local combat3_Ball = createCombatObject()
setCombatParam(combat3_Ball, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat3_Ball,createCombatArea({{0, 2, 0},
{0, 0, 0},
{1, 1, 1}}))
function getDmg_Ball(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat3_Ball, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Ball")
local dfcombat3_Ball = {CONST_ANI_ENERGYBALL,1,2,-1,2,0,2}

-- Areas/Combat for 200ms
local combat2_Energy = createCombatObject()
setCombatParam(combat2_Energy, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)
setCombatParam(combat2_Energy, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat2_Energy,createCombatArea({{2},
{1}}))
function getDmg_Energy(cid, level, maglevel)
	return (100)*-1,(200)*-1 
end
setCombatCallback(combat2_Energy, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Energy")

-- =============== 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_Ball,cid,var,dfcombat0_Ball,startPos)
	addEvent(RunPart,1400,combat14_Energy,cid,var)
	addEvent(RunPart,1200,combat12_Ball,cid,var,dfcombat12_Ball,startPos)
	addEvent(RunPart,1100,combat11_Energy,cid,var)
	addEvent(RunPart,900,combat9_Ball,cid,var,dfcombat9_Ball,startPos)
	addEvent(RunPart,800,combat8_Energy,cid,var)
	addEvent(RunPart,600,combat6_Ball,cid,var,dfcombat6_Ball,startPos)
	addEvent(RunPart,500,combat5_Energy,cid,var)
	addEvent(RunPart,300,combat3_Ball,cid,var,dfcombat3_Ball,startPos)
	addEvent(RunPart,200,combat2_Energy,cid,var)
	return true
end
 
Back
Top