• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell SWAMP GAS, LIGHTNING STORM (working but has issues)

Frillinde

Founder: Another Realm
Joined
Jan 16, 2012
Messages
148
Reaction score
3
Location
his computer
0.3.6pl1
OK.I really like the apocalypse spell and wanted to try to make a different spell out of it. I figured to try energy fields and poison fields instead of the fire fields.When I went to the apocalypse lua, I only saw the 3 combat effects needed to be changed(or so I thought).
Now when I edited these apocalypse worked fine but now the spell lightning storm works fine but swamp gas and apocalypse when cast instead cast lightning storm not their own spells.
I hope somone can help me fix this,thanks in advance
SWAMP GAS:
local combat = createCombatObject()

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

local area = createCombatArea(arr)
setCombatArea(combat, area)

function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_HITBYPOISON)
doAreaCombatHealth(param.cid, COMBAT_EARTHDAMAGE, param.pos, 0, -100, -100, CONST_ME_POISONCLOUD)
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 4000), param)
end
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

LIGHTNING STORM:
local combat = createCombatObject()

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

local area = createCombatArea(arr)
setCombatArea(combat, area)

function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_ENERGYHIT)
doAreaCombatHealth(param.cid, COMBAT_ENERGYDAMAGE, param.pos, 0, -100, -100, CONST_ME_ENERGYAREA)
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 4000), param)
end
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

The original APOCALYPSE:
local combat = createCombatObject()

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

local area = createCombatArea(arr)
setCombatArea(combat, area)

function spellCallback(param)
if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_HITBYFIRE)
doAreaCombatHealth(param.cid, COMBAT_FIREDAMAGE, param.pos, 0, -100, -100, CONST_ME_EXPLOSIONHIT)
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 4000), param)
end
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

SPELLS XML:
<instant name="Lightning Storm" words="arcanus vis" lvl="65" mana="1500" prem="1" exhaustion="3500" needlearn="0" event="script" value="customspells/lightning storm.lua"> <vocation id="5"/> </instant> <instant name="Apocalypse" words="arcanus flam" lvl="65" mana="1500" prem="1" exhaustion="3500" needlearn="0" event="script" value="customspells/apocalypse.lua">
<vocation id="5"/> </instant><instant name="Swamp Gas" words="arcanus pox" lvl="65" mana="1500" prem="1" exhaustion="3500" needlearn="0" event="script" value="customspells/swamp gas.lua"> <vocation id="6"/> </instant>
 
If you're still have problems though, please write a detailed post about whats going on, and I will try to help out!


also-- i highly recommend using notepad++ , it will color code all your text making it much easier to see
 
Last edited:
Here is my problem.When I cast apocalypse or swamp gas using the words for those spells, it casts the lightning storm spell. In other words all 3 spells have different words but they all only cast the lightning storm spell when used . I cant figure it out,thought it might have been wrong lua folder but they are correct for each spell.I got no ideas so any help would be great.
:)
 
Back
Top