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

Lua Spell converting from Mystic Spirit to TFS 1.0

Moj mistrz

Monster Creator
Joined
Feb 1, 2008
Messages
932
Solutions
10
Reaction score
296
Location
Poland
Hello there, I've got problem with one spell. So I've changed my distro from older to newest and one of my spells is not working properly.
Here's the script:
Code:
local voc = {3, 7}

    arr = {
    {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
    {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
    {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
    {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
    {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1},
    {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
    {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
    {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
    {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
    }

local area = createCombatArea(arr)

local combat = createCombatObject()
setCombatArea(combat, area)

function onTargetTile(cid, pos)
    local creatureTable = {}
    local n, i = getTileInfo({x=pos.x, y=pos.y, z=pos.z}).creatures, 1
    if n ~= 0 then
        local v = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i}).uid
        while v ~= 0 do
            if isCreature(v) == true then
                table.insert(creatureTable, v)
                if n == #creatureTable then
                    break
                end
            end
            i = i + 1
            v = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i}).uid
        end
    end
    if #creatureTable ~= nil and #creatureTable > 0 then
        for r = 1, #creatureTable do
            if creatureTable[r] ~= cid then
                local min = 3000
                local max = 6000
                if isPlayer(creatureTable[r]) == true and isInArray(voc, getPlayerVocation(creatureTable[r])) == true then
                    doTargetCombatHealth(cid, creatureTable[r], COMBAT_ENERGYDAMAGE, -min, -max, CONST_ME_NONE)
                elseif isMonster(creatureTable[r]) == true then
                    doTargetCombatHealth(cid, creatureTable[r], COMBAT_ENERGYDAMAGE, -min, -max, CONST_ME_NONE)
                end
            end
        end
    end
    doSendMagicEffect(pos, CONST_ME_ENERGYHIT)
    return true
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

local function delayedCastSpell(cid, var)
    if isCreature(cid) == true then
        doCombat(cid, combat, numberToVariant(cid))
    doCreatureSay(cid, "DIE!", TALKTYPE_ORANGE_1)
    end
end

function onCastSpell(cid, var)
    doCreatureSay(cid, "All PALADINS must DIE!", TALKTYPE_ORANGE_1)
    addEvent(delayedCastSpell, 4000, cid, var)
    return true
end
How it works?
After casting this spell message appears and you have 4 seconds to leave area(if you are paladin ofc) before monster cast the spell with energy effect which deals energy damage from 3-6k.

What don't work?
Basically only messages appears, but no effect area or damage are shown.
Thanks for anyone who help me. :)
 
Spells don't change too much, also TFS 1.0 is based on mystic spirit, i think that you won't have any problem, what error do you have?, nothing on console or something?
 
Back
Top