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

Spell [TFS 1.2/1.3] Unnamed spell (looks cool tho)

make more spells like this?

  • yes

    Votes: 74 94.9%
  • no

    Votes: 4 5.1%

  • Total voters
    78
Do you have a list of them? I copied the effects straight from other spells that work.
 
I'm definitely missing this file. Thanks! I'll give it a shot.
 
My death and icespells work, but my brutal, flame, holy, energy, and earth spells don't.

--Great Death Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -78, max = -124},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_DEATHDAMAGE,
areaEffect = CONST_ME_MORTAREA,
distanceEffect = CONST_ANI_DEATH,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end

--Great Ice Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -91, max = -166},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_ICEDAMAGE,
areaEffect = CONST_ME_ICETORNADO,
distanceEffect = CONST_ANI_SMALLICE,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end

--Great Brutal Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -98, max = -219},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_PHYSICALDAMAGE,
areaEffect = CONST_ME_EXPLOSIONAREA,
distanceEffect = CONST_ANI_WHIRLWINDSWORD,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end

--Great Flame Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -136, max = -201},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_FIREDAMAGE,
areaEffect = CONST_ME_FIREATTACK,
distanceEffect = CONST_ANI_FIRE,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end

--Great Holy Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -70, max = -97},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_HOLYDAMAGE,
areaEffect = CONST_ME_HOLYAREA,
distanceEffect = CONST_ANI_SMALLHOLY,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end

--Great Energy Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -136, max = -201},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_ENERGYDAMAGE,
areaEffect = CONST_ME_BIGCLOUDS,
distanceEffect = CONST_ANI_ENERGY,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end

--Great Earth Strike--
Lua:
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
--// Incase the creature disappears within 120-250ms time window
local creature = Creature(cid)
if not creature then
return
end
doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end
local running = {}
local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
local player = Player(cid)
--// Player doesn't exist anymore
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
--// Maximum rounds complete
if i > j then
stopEvent(running[cid])
running[cid] = nil
return
end
local center = player:getPosition()
local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
--// Send effects and damage creatures within radius
local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
for i = 1, #specs do
if specs[i]:isMonster() then
local specPos = specs[i]:getPosition()
args[1] = specs[i]:getId()
args[4] = specPos
center:sendDistanceEffect(specPos, distanceEffect)
addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
end
end
addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end
local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}
local function sendEffects(cid, delay, areaEffect, distanceEffect)
local player = Player(cid)
if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
stopEvent(running[cid])
running[cid] = nil
return
end
local pos = player:getPosition()
--// Send distance effects (N/E/S/W) & area effect on player
for i = 1, #offsets do
local fromPos = pos:setDirectionOffset(offsets[i])
local fromPos = pos:setDirectionOffset(player:getPosition())
local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
fromPos:sendDistanceEffect(toPos, distanceEffect)
end
pos:sendMagicEffect(areaEffect)
running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
local config = {
damage = {min = -68, max = -136},
rounds = 30, -- number of times the spell loops (effects & damage)
delay = 320, -- ms
radius = {x = 5, y = 5}, -- sqm radius
damageType = COMBAT_EARTHDAMAGE,
areaEffect = CONST_ME_SMALLPLANTS,
distanceEffect = CONST_ANI_EARTH,
}
function onCastSpell(creature, variant)
local player = creature:getPlayer()
if not player then
return false
end
sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
return true
end
 
Oh, When the client crashes, the client error is "Spell < SPELL_BEYONDLAST" but I have no idea what that means.
 
i tested your spells and they worked just fine for me
are you using a different spellid or something in the xml?
 
Did you test them on regular characters or on your god char?
 
They work fine on my god character, but when I use them on a regular character I get the crash.
 
XML:
<instant group="attack" spellid="185" name="Great Energy Strike" words="exevo mas vis" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_energy_strike.lua">
 <vocation name="Sorcerer" />
 <vocation name="Master Sorcerer" />
 </instant>
 <instant group="attack" spellid="184" name="Great Brutal Strike" words="exori mas ico" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_brutal_strike.lua">
 <vocation name="Knight" />
 <vocation name="Elite Knight" />
 </instant>
 <instant group="attack" spellid="183" name="Great Holy Strike" words="exori mas san" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_holy_strike.lua">
 <vocation name="Paladin" />
 <vocation name="Royal Paladin" />
 </instant>
 <instant group="attack" spellid="182" name="Great Earth Strike" words="exevo mas tera" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_earth_strike.lua">
 <vocation name="Druid" />
 <vocation name="Elder Druid" />
 </instant>
 <instant group="attack" spellid="181" name="Great Flame Strike" words="exevo mas flam" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_flame_strike.lua">
 <vocation name="Sorcerer" />
 <vocation name="Master Sorcerer" />
 </instant>
 <instant group="attack" spellid="180" name="Great Frost Strike" words="exevo mas frigo" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_frost_strike.lua">
 <vocation name="Druid" />
 <vocation name="Elder Druid" />
 </instant>
 <instant group="attack" spellid="179" name="Great Death Strike" words="exevo mas mort" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_death_strike.lua">
 <vocation name="Sorcerer" />
 <vocation name="Master Sorcerer" />
 <vocation name="Druid" />
 <vocation name="Elder Druid" />
 </instant>
 
XML:
<instant group="attack" spellid="185" name="Great Energy Strike" words="exevo mas vis" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_energy_strike.lua">
 <vocation name="Sorcerer" />
 <vocation name="Master Sorcerer" />
 </instant>
 <instant group="attack" spellid="184" name="Great Brutal Strike" words="exori mas ico" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_brutal_strike.lua">
 <vocation name="Knight" />
 <vocation name="Elite Knight" />
 </instant>
 <instant group="attack" spellid="183" name="Great Holy Strike" words="exori mas san" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_holy_strike.lua">
 <vocation name="Paladin" />
 <vocation name="Royal Paladin" />
 </instant>
 <instant group="attack" spellid="182" name="Great Earth Strike" words="exevo mas tera" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_earth_strike.lua">
 <vocation name="Druid" />
 <vocation name="Elder Druid" />
 </instant>
 <instant group="attack" spellid="181" name="Great Flame Strike" words="exevo mas flam" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_flame_strike.lua">
 <vocation name="Sorcerer" />
 <vocation name="Master Sorcerer" />
 </instant>
 <instant group="attack" spellid="180" name="Great Frost Strike" words="exevo mas frigo" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_frost_strike.lua">
 <vocation name="Druid" />
 <vocation name="Elder Druid" />
 </instant>
 <instant group="attack" spellid="179" name="Great Death Strike" words="exevo mas mort" lvl="80" mana="200" prem="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="custom/great_death_strike.lua">
 <vocation name="Sorcerer" />
 <vocation name="Master Sorcerer" />
 <vocation name="Druid" />
 <vocation name="Elder Druid" />
 </instant>
both work just fine
this is a normal char
UaEYLuj.jpg

it's your spell ids that are fucked up
SpellId and there images
spell is for the icon that pops up above your chats
 
Well shit. I thought spell ID's were numbers you assigned like item ID's. Wow. Thanks.
 
All spells working correctly now.
 
@Static_ How i put exaust in hit? This spell hit so fast, and how put a limited monster attacker, If have 5 monsters attack me, when i use spell i hit only 3
 
if you want to hit more monsters make the range bigger
 
got bored and wanted to try to make my first non-utility spell
only works on monsters, fully configurable (config is at the bottom)
demonstration: http://xera.s-ul.eu/C95HkX4x
Lua:
--[[#######################################################################################]]--
function doAreaCombatDamage(cid, attacker, combatType, position, min, max, effect)
   --// Incase the creature disappears within 120-250ms time window
   local creature = Creature(cid)
   if not creature then
       return
   end
   doAreaCombatHealth(attacker, combatType, position, 0, min, max, effect)
end

local running = {}

local function runSpell(cid, i, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
   local player = Player(cid)
   --// Player doesn't exist anymore
   if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
       stopEvent(running[cid])
       running[cid] = nil
       return
   end
   --// Maximum rounds complete
   if i > j then
       stopEvent(running[cid])
       running[cid] = nil
       return
   end
   local center = player:getPosition()
   local specs = Game.getSpectators(center, false, false, radius.x, radius.x, radius.y, radius.y)
   --// Send effects and damage creatures within radius
   local args = {nil, cid, damageType, nil, damage.min, damage.max, areaEffect}
   for i = 1, #specs do
       if specs[i]:isMonster() then
           local specPos = specs[i]:getPosition()
           args[1] = specs[i]:getId()
           args[4] = specPos
           center:sendDistanceEffect(specPos, distanceEffect)
           addEvent(doAreaCombatDamage, 120 + (center:getDistance(specPos) * 7), unpack(args))
       end
   end
   addEvent(runSpell, delay, cid, i+1, j, delay, radius, damage, damageType, areaEffect, distanceEffect)
end

local offsets = {DIRECTION_WEST, DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH}

local function sendEffects(cid, delay, areaEffect, distanceEffect)
   local player = Player(cid)
   if not player or Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) and bit.band(player:getGroup():getFlags(), PlayerFlag_IgnoreProtectionZone) == 0 then
       stopEvent(running[cid])
       running[cid] = nil
       return
   end
   local pos = player:getPosition()
   --// Send distance effects (N/E/S/W) & area effect on player
   for i = 1, #offsets do
       local fromPos = pos:setDirectionOffset(offsets[i])
       local toPos = pos:setDirectionOffset(offsets[i+1] or offsets[1])
       fromPos:sendDistanceEffect(toPos, distanceEffect)
   end
   pos:sendMagicEffect(areaEffect)
   running[cid] = addEvent(sendEffects, delay, cid, delay, areaEffect, distanceEffect)
end
--[[#######################################################################################]]--
local config = {
   damage = {min = -10, max = -15},
   rounds = 80, -- number of times the spell loops (effects & damage)
   delay = 160, -- ms
   radius = {x = 3, y = 3}, -- sqm radius
   damageType = COMBAT_DEATHDAMAGE,
   areaEffect = CONST_ME_MORTAREA,
   distanceEffect = CONST_ANI_SUDDENDEATH,
}

function onCastSpell(creature, variant)
   local player = creature:getPlayer()
   if not player then
       return false
   end
   sendEffects(player:getId(), config.delay, config.areaEffect, config.distanceEffect)
   runSpell(player:getId(), 0, config.rounds, config.delay, config.radius, config.damage, config.damageType, config.areaEffect, config.distanceEffect)
   return true
end


first, this is a really great script and i like it, but a spell have to grow with the player
and I#m a noob in lua but i tried to make variable to min /max dmg

this is working too.
Lua:
   local a = 100
   local b = 200


--[[#######################################################################################]]--
local config = {
   damage = {min = -a, max = -b},
   rounds = 80, -- number of times the spell loops (effects & damage)
   delay = 160, -- ms
   radius = {x = 3, y = 3}, -- sqm radius
   damageType = COMBAT_DEATHDAMAGE,
   areaEffect = CONST_ME_MORTAREA,
   distanceEffect = CONST_ANI_SUDDENDEATH,
}

is it possible to make this? what did i need to add?
Lua:
   local a = (playerlevel / 5) + (skill * 0.75)  --??????????????
   local b = (playerlevel / 5) + (skill * 1) --??????????????????


--[[#######################################################################################]]--
local config = {
   damage = {min = -a, max = -b},
   rounds = 80, -- number of times the spell loops (effects & damage)
   delay = 160, -- ms
   radius = {x = 3, y = 3}, -- sqm radius
   damageType = COMBAT_DEATHDAMAGE,
   areaEffect = CONST_ME_MORTAREA,
   distanceEffect = CONST_ANI_SUDDENDEATH,
}
 
Back
Top