Animera
* * * * *
Simple spell script by Animera.
Since the most people nowdays can't even script the most simple things i was searching for my friend a spell tutorial however they are all outdated so i decided to make my own tutorial. Today we are just going to edit a very simple script. But you will at least learn the basics.
Recommended:
Notepad++ (Link)
First open a spell you want to edit: I am going to edit the eternal winter.
data/spells/attack/eternal winter.lua
Now we got something like this
Nothing special but this is required if you want your spells get some extra things.
See it like a map, local combat~ is the map and it contain files it contains X and X and X etc. What those X are you will find it now out.
This is one of the so called "file", but how can i see what it does?, i marked it with the 3 ***, as you saw on the last word it contained type, wich means what kind of damage it deals, I want it deals ice damage so i won't edit that but there are several kind of damages you want to choose.
Instead of filling combat_deathdamage or something you could also use these numbers, but i recommend for people who are new with this to use the combat~ so you can easy read back what damage it deals.
This is another of the so called "file" but this one shows the effect, This time i am going to edit it in an other effect. so i use the "CONST_ME_ICETORNADO" to
Here is the list of options:
There are a lot of ways to find out how to know what does what..
1. use the /z (effectnumber) command ingame
2. check your other script files
3. or check this link: Lua - Spells Effects
Like i said before instead writing CONST_ME~ you can also using numbers like:
So we got now the damage type and the effect now the formula,
This is the formula, but i don't know how this new formula system works, i use another one i will explain in the next post. IF you just wanna use this system then experiment it with it. there are more formula's like
But now after all these things how does the SERVER know that the so called files belogns to that map?
As you see on 1 it says local "combat"
and on the second you see between the *** as kind of proof that they fit together.
Now we fixed the first part.
I will write now the second.
Since the most people nowdays can't even script the most simple things i was searching for my friend a spell tutorial however they are all outdated so i decided to make my own tutorial. Today we are just going to edit a very simple script. But you will at least learn the basics.
Recommended:
Notepad++ (Link)
First open a spell you want to edit: I am going to edit the eternal winter.
data/spells/attack/eternal winter.lua
Now we got something like this
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2, 4, 3, 10)
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Code:
local combat = createCombatObject()
See it like a map, local combat~ is the map and it contain files it contains X and X and X etc. What those X are you will find it now out.
Code:
setCombatParam(combat, ***COMBAT_PARAM_TYPE***, COMBAT_ICEDAMAGE
Code:
COMBAT_NONE = 0
COMBAT_PHYSICALDAMAGE = 1
COMBAT_ENERGYDAMAGE = 2
COMBAT_EARTHDAMAGE = 4
COMBAT_POISONDAMAGE = 4
COMBAT_FIREDAMAGE = 8
COMBAT_UNDEFINEDDAMAGE = 16
COMBAT_LIFEDRAIN = 32
COMBAT_MANADRAIN = 64
COMBAT_HEALING = 128
COMBAT_DROWNDAMAGE = 256
COMBAT_ICEDAMAGE = 512
COMBAT_HOLYDAMAGE = 1024
COMBAT_DEATHDAMAGE = 2048
Code:
setCombatParam(combat, ***COMBAT_PARAM_EFFECT***, CONST_ME_ICETORNADO)
Code:
setCombatParam(combat, ***COMBAT_PARAM_EFFECT***, CONST_ME_ICEATTACK)
Code:
CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_SMOKE = 67
CONST_ME_INSECTS = 68
CONST_ME_NONE = 255
CONST_ME_LAST = CONST_ME_INSECTS
1. use the /z (effectnumber) command ingame
2. check your other script files
3. or check this link: Lua - Spells Effects
Like i said before instead writing CONST_ME~ you can also using numbers like:
Code:
setCombatParam(combat, ***COMBAT_PARAM_EFFECT***, 43)
Code:
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2, 4, 3, 10)
Code:
COMBAT_FORMULA_UNDEFINED = 0
COMBAT_FORMULA_LEVELMAGIC = 1
COMBAT_FORMULA_SKILL = 2
COMBAT_FORMULA_DAMAGE = 3
Code:
1. local combat = createCombatObject()
2. setCombatParam(***combat***, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
and on the second you see between the *** as kind of proof that they fit together.
Now we fixed the first part.
I will write now the second.
Last edited: