Spell making

Ok, in this walkthrough, I will teach you how to create your own spells…for my example, first I will show you how to edit an existing spell, then how to create a brand new spell.

Ok lets start with the UE spell, go to your instant spells folder, and open “exevo gran mas vis” using wordpad or notepad. Now, you should see a lot of coding that may seem confusing, but is really simple, it should appear like this…

Code:

area = { {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, }

attackType = ATTACK_PHYSICAL needDirection = false areaEffect = NM_ME_EXPLOSION_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 * 2 + maglv * 3) * 2.3 – 30 UltimateExplosionObject.maxDmg = (level * 2 + maglv * 3) * 3.0 end return doAreaMagic(cid, centerpos, needDirection, areaEffect, area, UltimateExplosionObject:ordered()) end

A LOT of text, I know, but lets focus on the parts you can change (This part applies to almost any attack spell)

Ok, the things you can change are as follows…
Quote:
• area = {—-Change the numbers in this to 0,1,2,3, or 4 depending on how you want the spell to attack based on the direction you face, 1=Noth 2=west 3=east 4= south

Quote:
• attackType = ATTACK_PHYSICAL—-This can be changed as follows…
ATTACK_ENERGY
ATTACK_PHYSICAL
ATTACK_FIRE
ATTACK_POISON
ATTACK_NONE (attack none is mostly for healing spells which are a little harder to change)
All of these ATTACKs are as they say (FIRE=fire damage, ENERGY=energy damage etc.)

Quote:
• needDirection—- There are only 2 choices for this one, true or false, if you select true, then it goes back to the area screen, you need to have the 1,2,3, and 4s on the map, for the direction the spell you go if you face that way, look above for more info on that, if you select false, all you do is put 1s wherever you want the spell to hit.

Quote:
• areaEffect = this is a sorta simple one, this is choosing the sprites you want to use in the spell, you can only choose 1 sprite per spell i think, but your options are…
NM_ME_EXPLOSION_AREA (Sprites used in Explosion)
NM_ME_POISEN_RINGS (Sprites used in Poisen Storm)
NM_ME_FIRE_AREA (Sprites used in the majority of fire spells)
NM_ME_ENERGY_DAMAGE (Sprites used in Great Energy Beam)
NM_ME_ENERGY_AREA (Sprites used in most energy spells)
NM_ME_LOOSE_ENERGY (Sprite used in Hydra Water Attacks)
NM_ME_MORT_AREA (Sprite used in Sudden Death)
NM_ME_HIT_AREA (Sprite used in Exori)
NM_ME_BLOCKHIT (Sprite that appears when a Melee hit is Blocked, not Puffed)
NM_ME_SOUND (Sprite used in the Banshee Sonar attack)

There are more, i just need to check them out to explain them more.
This FAQ will be finished soon, this is just the start of it all, but with the details given, you should be able to edit/create your own spells.

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: Making And Maintaining A Good OT
Next article: Raids