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

RevScripts Spells with warning and delay

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
552
Solutions
1
Reaction score
61
Location
Lo Mochis, Sinaloa
Could you help me with an example spell revscript, where the area is a small circle and it grows, but before that you will see tutorialsquares where the spells will hit.
 
Lua:
local area = createCombatArea(AREA_SQUARE1X1)

local effect = {
    CONST_ANI_METEORITE,
    CONST_ME_METEORITE
}

local config = {
    ['Demon'] = {200, 500},
    ['Motrehenesth'] = {1000, 2500},
    ['Arch Devil'] = {900, 1500},
    ['Spitfire'] = {300, 700},
    ['Nesh'] = {100, 350},
    ['Drekavac'] = {450, 900},
    ['Gashadokuro'] = {10, 20},
    ['Xuj\'Hozy'] = {700, 1200},
    ['Gashadokuro'] = {10, 80},
    ['Dungeon Keeper'] = {50, 80},
}

local function spawnFire(position, cid)
    if not isCreature(cid) then
        return true
    end
   
    doSendMagicEffect(position, CONST_ME_SQUARE, 0, 300)
    doSendMagicEffect(position, CONST_ME_EXCLAMATION, 0, 150)
   
    addEvent(function()
        if not isCreature(cid) then
            return true
        end
       
        doSendDistanceShoot({x = position.x - 5, y = position.y - 5, z = position.z}, position, effect[1])
        addEvent(function()
            if not isCreature(cid) then
                return true
            end
           
            local var = config[getCreatureName(cid)] or {80, 100}
            doCombatAreaHealth(cid, COMBAT_FIREDAMAGE, position, area, -var[1], -var[2], CONST_ME_NONE)
            doSendMagicEffect({x = position.x + 1, y = position.y + 1, z = position.z}, effect[2])
        end, 250)
    end, 2000)
end

local function spawnNewFire(cid, pos, count)
    local width, height = 12, 8
    for i = 1, count do
        local position = {x = pos.x + math.random(-width, width), y = pos.y + math.random(-height, height), z = pos.z}
        if isWalkable(position, false, true) then
            addEvent(spawnFire, i * 150, position, cid)
        end
    end
end

function onCastSpell(cid, var, iconId, spellLevel, direction, effectId)
    local pos = getThingPos(cid)x
    for i = 0, 5 do
        addEvent(spawnNewFire, 1000 * i, cid, pos, 15 - i)
    end
   
    return true
end
 
Lua:
local area = createCombatArea(AREA_SQUARE1X1)

local effect = {
    CONST_ANI_METEORITE,
    CONST_ME_METEORITE
}

local config = {
    ['Demon'] = {200, 500},
    ['Motrehenesth'] = {1000, 2500},
    ['Arch Devil'] = {900, 1500},
    ['Spitfire'] = {300, 700},
    ['Nesh'] = {100, 350},
    ['Drekavac'] = {450, 900},
    ['Gashadokuro'] = {10, 20},
    ['Xuj\'Hozy'] = {700, 1200},
    ['Gashadokuro'] = {10, 80},
    ['Dungeon Keeper'] = {50, 80},
}

local function spawnFire(position, cid)
    if not isCreature(cid) then
        return true
    end
  
    doSendMagicEffect(position, CONST_ME_SQUARE, 0, 300)
    doSendMagicEffect(position, CONST_ME_EXCLAMATION, 0, 150)
  
    addEvent(function()
        if not isCreature(cid) then
            return true
        end
      
        doSendDistanceShoot({x = position.x - 5, y = position.y - 5, z = position.z}, position, effect[1])
        addEvent(function()
            if not isCreature(cid) then
                return true
            end
          
            local var = config[getCreatureName(cid)] or {80, 100}
            doCombatAreaHealth(cid, COMBAT_FIREDAMAGE, position, area, -var[1], -var[2], CONST_ME_NONE)
            doSendMagicEffect({x = position.x + 1, y = position.y + 1, z = position.z}, effect[2])
        end, 250)
    end, 2000)
end

local function spawnNewFire(cid, pos, count)
    local width, height = 12, 8
    for i = 1, count do
        local position = {x = pos.x + math.random(-width, width), y = pos.y + math.random(-height, height), z = pos.z}
        if isWalkable(position, false, true) then
            addEvent(spawnFire, i * 150, position, cid)
        end
    end
end

function onCastSpell(cid, var, iconId, spellLevel, direction, effectId)
    local pos = getThingPos(cid)x
    for i = 0, 5 do
        addEvent(spawnNewFire, 1000 * i, cid, pos, 15 - i)
    end
  
    return true
end
Hi :)


i droped this script into revscripts, and it seems it does nothing, no errors and + nothing happening.

Any ideas ?
 
Hi :)


i droped this script into revscripts, and it seems it does nothing, no errors and + nothing happening.

Any ideas ?
Because that's not a revscript, its not even for tfs 1.x (where revscripts are implemented). That's a spell for tfs 0.x.
 
Back
Top