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

Windows How to do Spells-Easy

Lucaking

Member
Joined
Jun 27, 2011
Messages
248
Reaction score
9
Hello,
As the Title says, I wanna show you How to do Spells,
Very easy !

At the First, Here is a Video, Made by me if you don't want to Look at The pictures.
How to do Spell for Tibia ( BEST TUTORIAL EVER ) - YouTube
Look at the Description, to Download the Spell Maker.


Let begin :

When u open the Spell Maker,
There will Open this Window at the First :

Phases.PNG
There u can Change the Phases of the Spell, Like how much Phases there will be.
Like : The First are a Big fire Area like Exevo gran mas Flam, and 1 Second later will be A Small ice area.

When u Choosed the Phases,
There will Open this Window :
Menu.jpg

There can u Put the Name of The spell,
How words to Be Cast,
How much Mana to Use,
And much more!

At the next you Have to Change the Area :
Areas.jpg

When you making a Directional Spell,
Forward is Pointing north of The Center.


At the next we will Make to how the Spell Looks like,
Like if it is Ice, Fire area, Terra, And much more like This :
Combat properties.jpg
Just put what u want to look like and What/How much it Damage.

Now we come to a Easy Step,
Only put the Time into it and Press enter.
1000 = 1 Second !!
timer.PNG

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
 
Now you only Have to add The vocations :
Vocations.jpg

And now Click on Make Spell ! And save it into your Server Folder/Data/Spells/Scripts.
Open the Spell File and u See much Words of Course and more,
But you really have to write this into it : (Write original -> return TRUE <-)
file.jpg

When u done it, Go into your Spells.Xml :
If it a Attack Spell go into the <!-- Attack Spells -->
and write your Spell into it, Like it is the name : Triple g, you have to write this :
</instant>
<instant name="Triple G" words="Triple G" lvl="Put the Level here" mana="Write the mana here" prem="if you need Premium to use this spell (1=yes, 0=no)" range="The range to Attack the Target" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="If you need to Learn it or Not (1=yes, 0=No)" event="script" value="Triple G.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"/>

Now start your Server and you can use The spell :) !

It takes me some Time to do that all so it were be nice if you Rep+ :)

Your Luca :)
 
Maybe because they don't learn how to script themselves but only how to use a spell maker?
If you looked at mine tutorial you learn it how to write and what all those things means..

However i haven't written (yet) how to make a animated spell..
 
Maybe because they don't learn how to script themselves but only how to use a spell maker?
If you looked at mine tutorial you learn it how to write and what all those things means..

However i haven't written (yet) how to make a animated spell..

I dont care, I only want to know how to do Nice Spells, Who player cares about how you done the Spell ?
He only Like it how it looks and how much its hit.
 
@lucaking
Ofcourse players doesn't care how it's made, but this way the owners won't learn the basics and the meaning of spells neither will they get any good experiencing in scripting spells
 
@lucaking
Ofcourse players doesn't care how it's made, but this way the owners won't learn the basics and the meaning of spells neither will they get any good experiencing in scripting spells

Ye but look,
You can say : I got much Experience in Scripting Spells !!!
And i will say :I dont got it, But i dont care, Because i can do The same Nice spells like you !

:)
 
Well scripting experience is important because you need to know what everything means and such, also you can't make same things like i can.

Your spell maker can do it, but it isn't that advanced like your own selfmade script, spells isn't just animated effects with damage and 1 thing is also hard wich you couldn't and that is having the same formula.
 
You want to know what a spell is?

A spell is a way to preform combat in OpenTibia. If you want to make a decent spell you need to make a balance between damage and visuals.

I prefer to use instant spells and send effects separately from functions to avoid bugs.
I also prefer to use a formula callback to ensure a good damage..
You can't make a animated spell good since you have to think of the areas it hits so it wont hit twice.. unless its the deal with the spell.

Like this for example:

These are "allowed" animated spells,they send a combat for each sequence

newsupport.jpg


We see here that the sequence changes without any combat overlapping each other, To allow this to be bug free the "selfcast="1" and "direction="1"" in spells.xml must be removed, to not make the areas follow you..
If there were and occurance of two or more combats in the same area it can be exploited as a bug. and that would make the whole server unbalanced.


This is how it should be:

stuns.png


It may seem that it is a animated spell. but infact it is a instant combat with no effects called i nthe combat.
only a "onTargetTile" function that sends effects delayed with a random time.

Here is the code... but its quite messy since i made a function that makes everything fast to make.

Lua:
--Mindrage, hope it doesnt rip your mind ;D
 
--Mindrage, hope it doesnt rip your mind ;D
 
 
local function doCreateSpell(dmgtype, effect, distanceeffect, aggressive, dispel, blockarmor, blockshield, formula, funcformula, ontargettile, ontargetcreature)
	local combat = createCombatObject()
	if dmgtype then setCombatParam(combat, COMBAT_PARAM_TYPE, dmgtype) else return false end
	if effect then setCombatParam(combat, COMBAT_PARAM_EFFECT, effect) else setCombatParam(combat, COMBAT_PARAM_EFFECT, 255) end
	if distanceeffect then setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, distanceeffect) else setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 255) end
	if aggressive then setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, true) else setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) end
	if dispel then setCombatParam(combat, COMBAT_PARAM_DISPEL, dispel) end
	if blockarmor then setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true) end
	if blockshield then setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, true) end
	if not (formula == COMBAT_FORMULA_SKILL or formula == COMBAT_FORMULA_LEVELMAGIC) then return false end
	if type(funcformula) == "function" then
		if formula == COMBAT_FORMULA_SKILL then
			_G["dmgformula"..combat] = funcformula
			setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "dmgformula"..combat)
		elseif formula == COMBAT_FORMULA_LEVELMAGIC then
			_G["dmgformula"..combat] = funcformula
			setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "dmgformula"..combat)
		end
	end
	if type(ontargettile) == "function" then
	_G["targettile"..combat] = ontargettile
	setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "targettile"..combat)
	end
	if type(ontargetcreature) == "function" then
	_G["ontargetcreature"..combat] = ontargetcreature
	setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "ontargetcreature"..combat)
	end
	return combat
end
 
local combat = doCreateSpell(
--[[DamageType = ]]		COMBAT_ENERGYDAMAGE, 
--[[MagicEffect = ]]	255, 
--[[DistanceEffect = ]]	255, 
--[[Aggressive = ]]		true, 
--[[RemoveCondition = ]]false, 
--[[BlockByArmor = ]]	true, 
--[[BlockByShield = ]]	false, 
--[[FormulaType = ]]	COMBAT_FORMULA_LEVELMAGIC,
--[[FormulaFunction = ]]function(cid, level, magic)
							return -((((level/3) + magic) * 1.45) + 32), -((((level/3) + magic) * 1.54) + 32)
						end,
--[[OnTargetTile = ]]	function(cid, pos)
							addEvent(
							function(pos)
									doSendDistanceShoot({x = pos.x - 5, y = pos.y - 5, z = pos.z}, pos, 35)
									addEvent(doSendMagicEffect, 250, pos, 30)
									addEvent(doSendMagicEffect, 250, pos, 34)
								end, 
								math.random(150,850), 
								pos)
						end,
--[[OnTargetMonster = ]]function(cid, target)
							for i = 1, 8 do
								addEvent(
								function(target)
									if isCreature(target) then doCreatureSetLookDirection(target, (getCreatureLookDirection(target) + 1) % 4) end
								end,
								250 * i,
								target)
							end
						end)
 
--[[CombatArea = ]]		setCombatArea(combat, createCombatArea(AREA_CIRCLE3X3))
 
	function onCastSpell(cid, var)
		return doCombat(cid, combat, var)
	end

Anyways, You can see that its way more complex to make a decent spell than by my really old editor.. Currently im making a universal tool for OpenTibia Servers.
 
Last edited:
Back
Top