Making spells on OTS

this walkthrough is to help u people make more and better spells ill take it step by step to get your man made spells working.

1. open your instant folder and copy and past one that u want it to be like
(u want something like ue copy ue u want something like fire wave copy fire wave).
2. rename it with the words u have to say to use it.
3. edit it so a window opens u will see something like this.

area = {
{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, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 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},
}

attackType = ATTACK_PHYSICAL
needDirection = false
areaEffect = NM_ME_HIT_AREA
animationEffect = NM_ANI_NONE

hitEffect = NM_ME_EXPLOSION_DAMAGE
damageEffect = NM_ME_DRAW_BLOOD
animationColor = RED
offensive = true
drawblood = true

UltimateExplosionObject = MagicDamageObject(attackType, animationEffect, hitEffect, damageEffect, animationColor, offensive, drawblood, 0, 0)

function onCast(cid, creaturePos, level, maglv, var)
centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z}
n = tonumber(var)—try to convert it to a number
if n ~= nil then—bugged—ultimateExplosionObject.minDmg = var+0—UltimateExplosionObject.maxDmg = var+0

UltimateExplosionObject.minDmg = 0
UltimateExplosionObject.maxDmg = 0
else
UltimateExplosionObject.minDmg = (level * 4 + maglv * 6) * 4.6 – 60
UltimateExplosionObject.maxDmg = (level * 4 + maglv * 6) * 6.0
end

return doAreaMagic(cid, centerpos, needDirection, areaEffect, area, UltimateExplosionObject:ordered())
end

now to explane how to edit it to make it yours.

1. area = { you want to edit this this will be the area it hits
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 1= faceing north
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 2= faceing west
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 3= faceing east
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, 4= faceing south
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, if u want a ue tipe thing then its all 1
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 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},
}

2. attackType = ATTACK_PHYSICAL – what kind of atk it is

needDirection = false – tells you if u need to be faceing a
serten way
areaEffect = NM_ME_HIT_AREA – what it looks like

animationEffect = NM_ANI_NONE – haven’t figerd this out yet i think its what it looks like when it hits u

hitEffect = NM_ME_EXPLOSION_DAMAGE – i think this is also what it looks like not 100% sure
damageEffect = NM_ME_DRAW_BLOOD – what it looks like when it hits u

animationColor = RED – i been told this changes the color of it but i haven’t got it to work yet

you see this now if u open your spells folder and go to the lib folder you will see a spells thing in there that has all the dif atks and thing ill post it at the end if u dont got it.

3. UltimateExplosionObject = MagicDamageObject(attackType, animationEffect, hitEffect, damageEffect, animationColor, offensive, drawblood, 0, 0)

function onCast(cid, creaturePos, level, maglv, var)
centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z}
n = tonumber(var)—try to convert it to a number
if n ~= nil then

i haven’t messed with this yet but if u copy what u want your spell to be like when u started it should be fine.

4.—bugged—ultimateExplosionObject.minDmg = var+0—UltimateExplosionObject.maxDmg = var+0

UltimateExplosionObject.minDmg = 0
UltimateExplosionObject.maxDmg = 0
else
UltimateExplosionObject.minDmg = (level * 4 + maglv * 6) * 4.6 – 60
UltimateExplosionObject.maxDmg = (level * 4 + maglv * 6) * 6.0
end

if u got more then one like in mine all u need to do is edit the last one.
the first one
UltimateExplosionObject.minDmg = (level * 4 + maglv * 6) * 4.6 – 60
this is the lowest it will hit to help u out ill do some math. so say u got a lvl 100 ml 120.
100*4+120*6=1120 then u * that by 4.6 = 5152 then u – 60 = 5092
then u got the sec one.
UltimateExplosionObject.maxDmg = (level * 4 + maglv * 6) * 6.0
this is the highest it will hit useing the same things ill do the math.
100*4+120*6=1120 then * 6 = 6720
so the person would hit 5092 – 6720 every time.

NOW U R DONE WITH THAT

now to move on puting it in your server.

1. go back to your spells folder and open spells.xlm.
2. as u go throw u will see that there is a spot for runes and instent seems how this is a walkthrough for instent u want instent.
3. copy and past one if the INSTENT in to the INSTENT spot so u got this.

<spell name=”Greater Light” words=”utevo gran lux” maglv=”3” mana=”60” enabled=”1”><vocation id=”1” /><vocation id=”2” /><vocation id=”3” /><vocation id=”4” /></spell>

now to edit this.
4. <spell name=”Greater Light”
this is what u want the spell called like ue or fire wave its NOT what u have to said to use it.
5. words=”utevo gran lux”
this is what u have to say to use it so use the words u put in when u renamed the spell.
6. maglv=”3” mana=”60”
maglv is what ml u need to use it, mana is how much mana u use when useing it.
7. enabled=”1”><vocation id=”1” /><vocation id=”2” /><vocation id=”3” /><vocation id=”4” /></spell>
this is what voc can use this it depends on how u edit your config if u changed some of them around but if u didn’t then this is how it gose.
<vocation id=”1” /> this is a sorc
<vocation id=”2” /> this is a druid
<vocation id=”3” /> this is a pally
<vocation id=”4” /> this is a knight
8. save everything and u should be done.

for the ones earlyer that didn’t have that atk list here it is—————————————-
function MagicDamageObject(iattackType, ianimationEffect, ihitEffect, idamageEffect, ianimationColor, ioffensive, idrawblood, iminDmg, imaxDmg)
local self = {
attackType = iattackType,
animationEffect = ianimationEffect,
hitEffect = ihitEffect,
damageEffect = idamageEffect,
animationColor = ianimationColor,
offensive = ioffensive,
drawblood = idrawblood,
minDmg = iminDmg,
maxDmg = imaxDmg}

function self:ordered()—print(‘ordered()’)
return {self.attackType, self.animationEffect, self.hitEffect, self.damageEffect, self.animationColor, self.offensive, self.drawblood, self.minDmg, self.maxDmg}
end

return self
end

NM_ME_DRAW_BLOOD = 0
NM_ME_LOOSE_ENERGY = 1
NM_ME_PUFF = 2
NM_ME_BLOCKHIT = 3
NM_ME_EXPLOSION_AREA = 4
NM_ME_EXPLOSION_DAMAGE = 5
NM_ME_FIRE_AREA = 6
NM_ME_YELLOW_RINGS = 7
NM_ME_POISEN_RINGS = 8
NM_ME_HIT_AREA = 9
NM_ME_ENERGY_AREA = 10
NM_ME_ENERGY_DAMAGE = 11
—only for internal use, dont send to client
NM_ME_NONE = 255

NM_ME_MAGIC_ENERGIE = 12
NM_ME_MAGIC_BLOOD = 13
NM_ME_MAGIC_POISEN = 14
NM_ME_HITBY_FIRE = 15
NM_ME_POISEN = 16
NM_ME_MORT_AREA = 17
NM_ME_SOUND = 18
NM_ANI_BOLT = 1
NM_ANI_ARROW = 2
NM_ANI_FIRE = 3
NM_ANI_ENERGY = 4
NM_ANI_POISONARROW = 5
NM_ANI_BURSTARROW = 6
NM_ANI_THROWINGSTAR = 7
NM_ANI_THROWINGKNIFE = 8
NM_ANI_SMALLSTONE = 9
NM_ANI_SUDDENDEATH = 10
NM_ANI_LARGEROCK = 11
NM_ANI_SNOWBALL = 12
NM_ANI_POWERBOLT = 13
—only for internal use, dont send to client
NM_ANI_NONE = 0

GREEN = 19
RED = 180
DARK_BLUE = 2
ORANGE = 193
BLACK_WHITE = 86
YELLOW = 210
LIGHT_BLUE = 71

ATTACK_NONE = 0
ATTACK_ENERGY = 1
ATTACK_BURST = 2
ATTACK_FIRE = 3
ATTACK_PHYSICAL = 4
ATTACK_POISON = 5
ATTACK_PARALYZE = 6
ATTACK_DRUNKNESS = 7

Related Articles
Action scripts tutorial
Open Tibia Server - creation
Open Tibia Server for absolute beginners
Ots map quests - otserv
Otserver - ot server general
Basic Tibia ots tutorials
Simple tutorials for Tibia 7.6
Making items on GM
Easy way to make a restarter
Raids


Previous article: Easy Way To Put Custom Monsters On Your Editor
Next article: Creating houses on OTS - YurOTS 9.3