• 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

You should set this as the distance effect, if I guess what you want;

npChb.png


Those ones will aim to the area.
 
For me the distance effects arent working... :(

Are you using 8.6? If so, then that's probably the reason.
doSendDistanceShoot looks like a newer function released in the later versions of TFS.

Sometimes you just gotta say good-bye to 8.6 and move on.
 
Are you using 8.6? If so, then that's probably the reason.
doSendDistanceShoot looks like a newer function released in the later versions of TFS.

Sometimes you just gotta say good-bye to 8.6 and move on.

I'm very sure it's possible in older versions as well, however, I've based the script to work fully on 0.4, 9.41. If the function somehow errors I can make something for it.
 
Dude... got a 8.54 server -.- (tfs 3.0.6 pl1) and the distance effects arent working there :'( shiiiit :(
 
Yeah, you're right. I just checked an 8.6 server and it has the function.
Maxen, can you post the errors or explain what is not working?
 
It'd help if you start saying why they don't work in first place. Any error or something? Post the script as well.
 
I got no errors... just the distance effects dont display if i make the spell in my ot ;/ just makes area effects :(
 
Here is the script:

PHP:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_NewItem53365 = createCombatObject()
setCombatParam(combat0_NewItem53365, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_NewItem53365,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_NewItem53365(cid, level, maglevel)
	return (10)*-1,(20)*-1 
end
setCombatCallback(combat0_NewItem53365, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_NewItem53365")
local dfcombat0_NewItem53365 = {CONST_ANI_FIRE,5,0,-5,0,0,5,0,-5,5,-5,-5,-5,-5,5,5,5}

-- Areas/Combat for 200ms
local combat2_NewItem17667 = createCombatObject()
setCombatParam(combat2_NewItem17667, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat2_NewItem17667, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat2_NewItem17667,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_NewItem17667(cid, level, maglevel)
	return (10)*-1,(20)*-1 
end
setCombatCallback(combat2_NewItem17667, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_NewItem17667")

-- =============== 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_NewItem53365,cid,var,dfcombat0_NewItem53365,startPos)
	addEvent(RunPart,200,combat2_NewItem17667,cid,var)
	return true
end

and here 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 I dont get any errors in console... :p
 
Shouldn't be causing any problem, otherwise you'll see errors in the console anyway.

Are you sure you cast 'test' and the script is in spells/scripts/test.lua?
 
Yep...no errors in console...and i get the blue effects...you know what i mean? :p

But i dont get the fire distance effect :(

I will make a new spell and tell u if anything changed
 
can we expect features like a haste effect or a strike effect (like exori san,exori frigo,..) in the future?
 
Replace;
Code:
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
with
Code:
function RunPart(c,cid,var,dirList,dirEmitPos) -- Part 
print('RunPart')
    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]) 
print('Emit')
                i = i + 2 
            end         
        end 
    end 
end

and tell me what you see in the console.
 
Back
Top