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

TFS3777:Change damage system

Pete Doherty

New Member
Joined
Sep 12, 2008
Messages
60
Reaction score
0
All night I've been trying, with little success, to change the damage system in TFS r3777 back to the old system (or atleast change the rates to simulate the old system). However, the newly implemented minl, maxl, minm, maxm variables really make this task difficult for me.

I would love if someone with this knowledge would share it, it's the last piece of my puzzle! :)

EDIT: The ultimate solution would be If someone knows how to accomplished this with only editing/replacing spells.xml and the .lua "scripts" files. But all solutions/suggestions are VERY appreciated!
 
Why do this work for Ultimate Healing:

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, -30, 2.5, 0)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 2 + maglevel * 3) * 2.2
	max = (level * 2 + maglevel * 3) * 3
	
	if min < 250 then
		min = 250
	end

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

When this does not for Sudden Death:

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.25, -30, -1.8, -30)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 2 + maglevel * 3) * 1.3
	max = (level * 2 + maglevel * 3) * 1.7
	
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Last edited:
You looking for formula from before the potion update?

This is a current sd rune but maybe the format will help you create the spells you need:

Lua:
 local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(cid, level, maglevel)
	local min = level / 5 + maglevel * 4.3 + 32
	local max = level / 5 + maglevel * 7.4 + 48
	return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Last edited:
Back
Top