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

Spells tfs 2.10

Dexftw

Total Boss
Joined
Jan 30, 2011
Messages
317
Reaction score
8
Im using the newest version of Tfs and none of the custom spells are working, but I'm not getting errors on them either.. could I get some help
[30/01/2011 20:35:01] Lua Script Error: [Spell Interface]
[30/01/2011 20:35:01] data/spells/scripts/spells87/curse.lua:onCastSpell
[30/01/2011 20:35:01] data/spells/scripts/spells87/curse.lua:34: attempt to index global 'exhaustion' (a nil value)
[30/01/2011 20:35:01] stack traceback:
[30/01/2011 20:35:01] [C]: in function '__index'
[30/01/2011 20:35:01] data/spells/scripts/spells87/curse.lua:34: in function <data/spells/scripts/spells87/curse.lua:29>

[30/01/2011 20:35:10] Lua Script Error: [Spell Interface]
[30/01/2011 20:35:10] data/spells/scripts/spells87/ignite.lua:onCastSpell
[30/01/2011 20:35:11] data/spells/scripts/spells87/ignite.lua:16: attempt to index global 'exhaustion' (a nil value)
[30/01/2011 20:35:11] stack traceback:
[30/01/2011 20:35:11] [C]: in function '__index'
[30/01/2011 20:35:11] data/spells/scripts/spells87/ignite.lua:16: in function <data/spells/scripts/spells87/ignite.
 
Last edited:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)

local condition = createConditionObject(CONDITION_CURSED)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 3000, -45)
addDamageCondition(condition, 1, 3000, -40)
addDamageCondition(condition, 1, 3000, -36)
addDamageCondition(condition, 1, 3000, -35)
addDamageCondition(condition, 1, 3000, -34)
addDamageCondition(condition, 2, 3000, -33)
addDamageCondition(condition, 2, 3000, -32)
addDamageCondition(condition, 2, 3000, -31)
addDamageCondition(condition, 2, 3000, -30)
addDamageCondition(condition, 3, 3000, -29)
addDamageCondition(condition, 3, 3000, -25)
addDamageCondition(condition, 3, 3000, -24)
addDamageCondition(condition, 4, 3000, -23)
addDamageCondition(condition, 4, 3000, -20)
addDamageCondition(condition, 5, 3000, -19)
addDamageCondition(condition, 5, 3000, -15)
addDamageCondition(condition, 6, 3000, -10)
addDamageCondition(condition, 10, 3000, -5)
setCombatCondition(combat, condition)


function onCastSpell(cid, var)
local storage = 23005
local spellname = "Curse"
local time = 50

if exhaustion.check(cid, storage) == false then
exhaustion.set(cid, storage, time)
return doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "You are exhausted in " .. spellname .. " for: " ..exhaustion.get(cid, storage).." seconds.")
end
end
Curse

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 25, 3000, -45)
setCombatCondition(combat, condition)


function onCastSpell(cid, var)
local storage = 23010
local spellname = "Ignite"
local time = 30

if exhaustion.check(cid, storage) == false then
exhaustion.set(cid, storage, time)
return doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "You are exhausted in " .. spellname .. " for: " ..exhaustion.get(cid, storage).." seconds.")
end
end
ignite

When I'm in-game and I cast the spell this error pops up in the gui

[30/01/2011 22:43:04] Lua Script Error: [Spell Interface]
[30/01/2011 22:43:04] data/spells/scripts/spells87/curse.lua:onCastSpell
[30/01/2011 22:43:04] data/spells/scripts/spells87/curse.lua:34: attempt to index global 'exhaustion' (a nil value)
[30/01/2011 22:43:04] stack traceback:
[30/01/2011 22:43:04] [C]: in function '__index'
[30/01/2011 22:43:04] data/spells/scripts/spells87/curse.lua:34: in function <data/spells/scripts/spells87/curse.lua:29>
 
Last edited:
Code:
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

use this in the end of both files
and set the cooldowns correctly
 
Add this to a lib file
LUA:
exhaustion =
{
	check = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		return getPlayerStorageValue(cid, storage) >= os.time(t)
	end,

	get = function (cid, storage)
		if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
			return false
		end

		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return false
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return true
		end

		return false
	end
}
 
Back
Top