• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Not working spell.

Moj mistrz

Monster Creator
Joined
Feb 1, 2008
Messages
932
Solutions
10
Reaction score
308
Location
Poland
Hello, my spell is not working, I mean it says the message but nothing else happens. Dunno what's wrong.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

    arr1 = {
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {3}
    }

    arr2 = {
    {3, 1, 1, 1, 1, 1, 1, 1, 1, 1}
    }

    arr3 = {
    {3},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1}
    }

    arr4 = {
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 3}
    }


if getPlayerLookDir(cid) == 0 then
local area1 = createCombatArea(arr1)
    setCombatArea(combat, area1)
elseif getPlayerLookDir(cid) == 1 then
local area2 = createCombatArea(arr2)
    setCombatArea(combat, area2)
elseif getPlayerLookDir(cid) == 2 then
local area3 = createCombatArea(arr3)
    setCombatArea(combat, area3)
elseif getPlayerLookDir(cid) == 3 then
local area4 = createCombatArea(arr4)
    setCombatArea(combat, area4)
end
local function delayedCastSpell(cid, var)
    if isCreature(cid) == true then
        doCombat(cid, combat, numberToVariant(cid))
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid, var)
    return true
end
 
Corrected

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

 arr1 = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
   
local area1 = createCombatArea(arr1)
setCombatArea(combat, area1)

local function delayedCastSpell(cid, var)
    if isCreature(cid) == true then
        doCombat(cid, combat, var)
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid, var) 
    return true
end
 
Corrected

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

arr1 = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

local area1 = createCombatArea(arr1)
setCombatArea(combat, area1)

local function delayedCastSpell(cid, var)
    if isCreature(cid) == true then
        doCombat(cid, combat, var)
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid, var)
    return true
end

works ty, but it doesn't follow its caster. ;/
Would be also good if creature cast this spell and its not executed(not passed 4 secs) and it cast again this spell the first one should be replaced by second one and not executed. Hope you get what I mean.
PS. This spell does not make any damage.
 
Last edited:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")

 arr1 = {
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 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},
}
   
local area1 = createCombatArea(arr1)
setCombatArea(combat, area1)

-----------------------------------------------------------------------------

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage2(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage2")

 arr2 = {
{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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2},
{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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
   
local area2 = createCombatArea(arr2)
setCombatArea(combat2, area2)

--------------------------------------------------------------------------

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage3(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat3, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage3")

 arr3 = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
   
local area3 = createCombatArea(arr3)
setCombatArea(combat3, area3)

--------------------------------------------------------------------------

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage4(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat4, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage4")

 arr4 = {
{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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{2, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
   
local area4 = createCombatArea(arr4)
setCombatArea(combat4, area4)

--------------------------------------------------------------

local function delayedCastSpell(cid, var)
    if isCreature(cid) == true then
        if getCreatureLookDirection(cid) == 0 then  
            doCombat(cid, combat, var)
        elseif getCreatureLookDirection(cid) == 1 then  
            doCombat(cid, combat2, var)
        elseif getCreatureLookDirection(cid) == 2 then  
            doCombat(cid, combat3, var)
        elseif getCreatureLookDirection(cid) == 3 then  
            doCombat(cid, combat4, var)
        end
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid, var) 
    return true
end

Code:
<instant name="NAME_OF_YOUR_SPELL" words="NAME_OF_YOUR_SPELL" lvl="1" mana="50" aggressive="0" direction="1" needtarget="0" selftarget="1" exhaustion="4000"  event="script" value="DIRECTORY_OF_YOUR_SPELL"></instant>

Added some damage, you can edit it to your preferences. It will now "follow" player, so when he moves while using it will cast properly. You can set exhaust to more than 4 seconds and last problem solved.
 
You did something wrong then, becasue I tested it and it all works. What TFS are you using? Did you copied mine script AND line into spells.xml?
 
You did something wrong then, becasue I tested it and it all works. What TFS are you using? Did you copied mine script AND line into spells.xml?
Sorry, forgot about SELFTARGET="1" thingy, my bad. lol
I'm using theforgottenserver-v0.2.15-win32gui and had to change
getCreatureLookDirection(cid) to getPlayerLookDir(cid) and by now monsters do not cast this spell properly. ;/ Anyways if it will work for TFS 1.0 it's okay since this monster is designed for this server. :P
 
I'm using 0.3.6, but I belive that on 1.0 its almost the same, easy to modify for someone that know 1.0.
If directions still dont work 0.2.15 must have diffrent getPlayerLookDir function, can't do much about it unless you will somehow merge this function from 0.3.6 or 1.0
 
In spells.xml set direction="1" and remove selftarget and neetarget. That's all. Simple spell.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

arr = createCombatArea({
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {1},
    {3}
}
setCombatArea(combat, arr)

local function delayedCastSpell(cid, var)
    if isCreature(cid) == true then
        doCombat(cid, combat, numberToVariant(cid))
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
    return true
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid, numberToVariant(cid))
    return true
end
 
No matter which direction I choose it will always cast that spell to the south.
Image:
EwN-VH.png

Code:
    <instant name="omrafir beam" words="332" direction="1" aggressive="1" blockwalls="1" needlearn="1" script="monster/omrafir beam.lua"/>
PS. That was the reason why I tried to use getPlayerLookDir(cid) in spell script.
 
Are you talking to me or only to Andu? Becasue mine script works 100% for players. On 0.2.15 you need to only change name of one function to what you have there (getPlayerLookDir(cid) I belive).
 
Both spells works prefectly. Your is just a noob coded @Syryniss. I think he is using a bugged ver 0.4 or 1.0.

There is also another way to do this spell. Without using combat. But you have to set selftarget="1" and remove direction and needtarget from spells.xml.
Code:
Code:
local function delayedCastSpell(cid)
    local min, max = -50, -100
    if isCreature(cid) == true then
        local dir = getCreatureLookDirection(cid)
        for i = 0, 7 do
            local pos = getPosByDir(getCreaturePosition(cid), dir, i)
            doSendMagicEffect(pos, CONST_ME_FIREAREA)
            local target = getThingFromPos(pos)
            if target ~= nil then
                doTargetCombatHealth(cid, target, COMBAT_FIREDAMAGE, min, max, CONST_ME_NONE)
            end
        end
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
    return true
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid)
    return true
end
 
Last edited:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")

arr1 = {
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 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},
}
  
local area1 = createCombatArea(arr1)
setCombatArea(combat, area1)

-----------------------------------------------------------------------------

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage2(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage2")

arr2 = {
{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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2},
{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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
  
local area2 = createCombatArea(arr2)
setCombatArea(combat2, area2)

--------------------------------------------------------------------------

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage3(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat3, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage3")

arr3 = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
  
local area3 = createCombatArea(arr3)
setCombatArea(combat3, area3)

--------------------------------------------------------------------------

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)

function getSpellDamage4(cid, skill, att, attackStrength)
    local lvl = getPlayerLevel(cid)
    local skill2 = getPlayerMagLevel(cid)

    local min = -(((lvl*0.8 + skill2*8)*1) )
    local max = -(((lvl*0.8 + skill2*8)*1) )

    return min, max
end

setCombatCallback(combat4, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage4")

arr4 = {
{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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{2, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
  
local area4 = createCombatArea(arr4)
setCombatArea(combat4, area4)

--------------------------------------------------------------

local function delayedCastSpell(cid, var)
    local creature = Creature(cid)
    if isCreature(cid) == true then
        if creature:getDirection() == 0 then 
            doCombat(cid, combat, positionToVariant(getCreaturePosition(cid)))
        elseif creature:getDirection() == 1 then 
            doCombat(cid, combat2, positionToVariant(getCreaturePosition(cid)))
        elseif creature:getDirection() == 2 then 
            doCombat(cid, combat3, positionToVariant(getCreaturePosition(cid)))
        elseif creature:getDirection() == 3 then 
            doCombat(cid, combat4, positionToVariant(getCreaturePosition(cid)))
        end
        doCreatureSay(cid, "OMRAFIR BREATHES INFERNAL FIRE", TALKTYPE_ORANGE_2)
    end
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "OMRAFIR INHALES DEEPLY!", TALKTYPE_ORANGE_2)
    addEvent(delayedCastSpell, 4000, cid, var)
    return true
end

Does only damage when my target is north from me, other directions are 0 dmg. Any help is appreciated.
 
Back
Top