• 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 Project: Real Tibia Spell Formulas v1.0.0

As Cykotitan said in his first post, theese spells works ONLY in tfs 0.3 or if you compile functions to tfs 0.2.
 
Since TFS 0.3 beta2 doesn't support CONDITION_PACIFIED, here go the fixed files for it:
swift foot.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionFormula(condition, 0.8, -72, 0.8, -72)
setCombatCondition(combat, condition)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, exhaust)

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

protector.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 220)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, exhaust)

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

Also, TFS 0.2 doesn't support CONDITION_PARAM_<skill>PERCENT

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)

function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
    local attack = weaponAttack
    local skill = math.max(getPlayerSkill(cid, 1),getPlayerSkill(cid, 2),getPlayerSkill(cid, 3))
    local level = getPlayerLevel(cid)
    local min = -(skill+attack)*0.5-level/5-20
    local max = -(skill+attack)*1.5-level/5-20
    local avg = (max+min)/2

    return min, max, avg
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")



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

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
Its mine formula, but i dont know if returnvalule avg even works, just created it for fun. ;p

This doesn't hit very much either, hits like 150 - 250

As Cykotitan said in his first post, theese spells works ONLY in tfs 0.3 or if you compile functions to tfs 0.2.

I've tried compiling TFS 0.2 with the new functions, however they didn't work properly ;D

0o 1 post in a row ;/
 
Last edited:
Hehe, so, I need a list of all spell formulas which need to be fixed for patch 1.0.1
For instance;

Exori Gran
Exori
Exori Hur?<<
Exori con
Exori Mas? ;P
 
Lul :s
On my OT i hits from my character (GOD: 900 lvl + 100 mlvl) into monsters like:
50-200 from spells: exori hur, exori san, exevo mas san etc.
I think i should hits them with about 1200-1500 dmg on that lvl and mlvl ^.^ It's something wrong with your formulas ;d
And if i use exori hur its showing only the damage on monster, it's not showing the Efect o_O
 
Last edited:
@up
Try on normal players, not on GM's.

Yeah, that's what I wanted to say. Also, GM can always use exori hur, even if he hasn't got any weapon. So, that's why there was no distance effect (you weren't wearing any weapon, and thus also the damage was low).
 
ok i tasted the party buffs on my server TFS 0.3b2 and i get crash.

on console:|
Code:
./ots.sh: line 3:  9085 Segmentation fault      (core dumped) ./tfs
 
@UP
It crashes for me, too ;(
getPlayerParty or getPartyMembers, or whatever, just seem to can't work on TFS 0.2... but why :s
 
PHP:
--[[
@Obs: 
In spells damage, minB and maxB are used in the damage formula only for a better usage, but Tibia 8.0- don't use it since they have more accurate formula.
This script works interpreting this values as nil
Since 2007 summer update, this formula is inaccurate - now level is also counted in some way.
LEVEL, MAGIC and MIN, MAX are arrays with more then one values that can be:
	If 2 values:
		It will count between the given values (second must be higher then the first).
	If 4+ (pairs) values:
		It will count between two values as pairs, so if we have 1, 5, 10, 20 it will count 1 to 5, after 10 to 20.
In melee formulas, the damage you will do will be between 0 and the calculated number, please note that shielding and armor from the target will reduce player's damage.
Use the constant values refering to attack types as factors.
--]]

Damage = {}
Damage.__index = Damage
	
	-- Global consts
	LEVEL = {8, 100}
	MAGIC = {0, 60}
	MIN, MAX = {1, 2}, {1, 2}
	FULL_ATTACK  = 10
	BALANCED 	 = 7
	FULL_DEFENSE = 5

	-- Returns the minA, maxA and averange values for spells formulas
	function Damage:getSpellFormula(level, magLevel, min, max)                                                                   
		minA = max / ((level / 3) + (magLevel / 2)) 
		maxA = min / ((level / 3) + (magLevel / 2))
		avg = math.floor(minA + maxA / 2) 
		return minA, maxA, avg
	end

	-- Returns all the possible combinations between the desired level, magic level, min and max damages
	function Damage:getSpellCombinations(level, magic, min, max)
		for _,x in ipairs(LEVEL) do
			for _,y in ipairs(MAGIC) do
			    for _,z in ipairs(MIN) do
			        for _,w in ipairs(MAX) do
				        minA, maxA, avg = self:getSpellFormula(x, y, z, w)
				        print('Level: ' .. x .. ' | Magic: ' .. y .. ' | Min: ' .. z .. ' | Max: ' .. w .. ' | minA: ' .. minA .. ' | maxA: ' .. maxA .. ' | avg: ' .. avg)
			        end
		        end    
			end
		end
	end
	
	-- Returns the maximum melee damage giving the factor (full attack, balanced or full defense), player level, player skill and the attack of the weapon
	function Damage:getMelee(factor, playerLevel, playerSkill, weaponAttack)
		return (weaponAttack / 20 * playerSkill*2 + weaponAttack + playerLevel / 10) / 10 * factor
	end

Use mine Damage class to get more accurate values if needed.
 
PHP:
--[[
@Obs: 
In spells damage, minB and maxB are used in the damage formula only for a better usage, but Tibia 8.0- don't use it since they have more accurate formula.
This script works interpreting this values as nil
Since 2007 summer update, this formula is inaccurate - now level is also counted in some way.
LEVEL, MAGIC and MIN, MAX are arrays with more then one values that can be:
	If 2 values:
		It will count between the given values (second must be higher then the first).
	If 4+ (pairs) values:
		It will count between two values as pairs, so if we have 1, 5, 10, 20 it will count 1 to 5, after 10 to 20.
In melee formulas, the damage you will do will be between 0 and the calculated number, please note that shielding and armor from the target will reduce player's damage.
Use the constant values refering to attack types as factors.
--]]

Damage = {}
Damage.__index = Damage
	
	-- Global consts
	LEVEL = {8, 100}
	MAGIC = {0, 60}
	MIN, MAX = {1, 2}, {1, 2}
	FULL_ATTACK  = 10
	BALANCED 	 = 7
	FULL_DEFENSE = 5

	-- Returns the minA, maxA and averange values for spells formulas
	function Damage:getSpellFormula(level, magLevel, min, max)                                                                   
		minA = max / ((level / 3) + (magLevel / 2)) 
		maxA = min / ((level / 3) + (magLevel / 2))
		avg = math.floor(minA + maxA / 2) 
		return minA, maxA, avg
	end

	-- Returns all the possible combinations between the desired level, magic level, min and max damages
	function Damage:getSpellCombinations(level, magic, min, max)
		for _,x in ipairs(LEVEL) do
			for _,y in ipairs(MAGIC) do
			    for _,z in ipairs(MIN) do
			        for _,w in ipairs(MAX) do
				        minA, maxA, avg = self:getSpellFormula(x, y, z, w)
				        print('Level: ' .. x .. ' | Magic: ' .. y .. ' | Min: ' .. z .. ' | Max: ' .. w .. ' | minA: ' .. minA .. ' | maxA: ' .. maxA .. ' | avg: ' .. avg)
			        end
		        end    
			end
		end
	end
	
	-- Returns the maximum melee damage giving the factor (full attack, balanced or full defense), player level, player skill and the attack of the weapon
	function Damage:getMelee(factor, playerLevel, playerSkill, weaponAttack)
		return (weaponAttack / 20 * playerSkill*2 + weaponAttack + playerLevel / 10) / 10 * factor
	end

Use mine Damage class to get more accurate values if needed.

Thanks, but, sorry; I use Combat Formula Callback ;)
 
Are these forumla's the old ones where level was more key or are they the stupid nerffed damaged/healing that we have in tibia now adays?
 
Are these forumla's the old ones where level was more key or are they the stupid nerffed damaged/healing that we have in tibia now adays?

They're based on formulas as they were in Tibia 8.1x (and probabaly up>)
 
Back
Top