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

Spo teh pro

New Member
Joined
Jan 3, 2008
Messages
319
Reaction score
1
does somebody know how i fix old dmg to the new clients?
like in old days when 100 sorc did 350~ with SD and 600~ with UE
Since the new scripts are based on magic level -_-
Would be really nice if someone could help me out of this

Code:
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)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.8, 0)

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

Can someone change this script, that the damage will be level * 2 and magic level * 3 and then the result *1.2 - 30 = minimum

and level * 2 + magic level * 3 & the result *1.6 = maximum?

Thanks guys <3
 
you can use some news spells, that ppl recalc all damages like the new damage system, that are ML and Skill basead,
or you can edit ur souce like i did, to remake the base calc
i use a formules like
Code:
			case FORMULA_LEVELMAGIC:
			{
					max = (int32_t)(((player->getLevel() / 5 ) + player->getMagicLevel() * 5) * mina + minb);
					min = (int32_t)(((player->getLevel() / 5 ) + player->getMagicLevel() * 5) * maxa + maxb);
				return true;
			}
			case FORMULA_SKILL:
			{
				min = (int32_t)minb;
				Item* tool = player->getWeapon();
				if(const Weapon* weapon = g_weapons->getWeapon(tool))
				{                
					min = (int32_t)(((player->getLevel() / 5 ) + ((abs(player->getWeaponSkill(tool)) + abs(weapon->getWeaponDamage(player, target, tool, true))/0.8) * mina) + minb))*-1;
					if (min >= minb)
					   {
                        min = (int32_t)minb;
                       }
                    max = (int32_t)(((player->getLevel() / 5 ) + (abs(player->getWeaponSkill(tool)) + abs(weapon->getWeaponDamage(player, target, tool, true))) * maxa + maxb))*-1;					
					if (max >= maxb)
					   {
                        max = (int32_t)maxb;
                       }					
                    if(params.useCharges && tool->hasCharges())
						g_game.transformItem(tool, tool->getID(), std::max((int32_t)0, ((int32_t)tool->getCharges()) - 1));
				}
				else
					max = (int32_t)maxb;

				return true;
			}

these codes are in COMBAT.CPP!
 
How to get there?O.o

Is it hard to do it and how long would it take me to change that?

Because I worked so hard for my server now and im not going to open the server with this shitty new pvp system ;<

Help me please!
 
is not hard, to made, but u will need to change some values in spell scripts, buy i think, that is batter u got some already made spells, with a calcule into script.
theres a progect that i downtload some times ago, colles XVX global project, i dont know from where for sure.
but i can try google, and get the spells from project.
 
is not hard, to made, but u will need to change some values in spell scripts, buy i think, that is batter u got some already made spells, with a calcule into script.
theres a progect that i downtload some times ago, colles XVX global project, i dont know from where for sure.
but i can try google, and get the spells from project.

Okay, I really thank you for trying to help me

And btw what is a callback?

Thanks everyone <3
 
Script located in: spells/scripts/healing/ultimate healing.lua
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 4) * 2.08
	max = (level * 1 + maglevel * 4) * 2.7
	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

See that function onGetFormulaValues ? It's a callback function, registered here:
LUA:
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

This means that the min and max value returned by that function will be the healing/damage. You get 3 parameters; cid, level and magic level. Modify that formula to fit your needs, maybe check an old ultimate healing script from 7.6 and take that formula they have there!
 
Script located in: spells/scripts/healing/ultimate healing.lua
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 4) * 2.08
	max = (level * 1 + maglevel * 4) * 2.7
	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

See that function onGetFormulaValues ? It's a callback function, registered here:
LUA:
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

This means that the min and max value returned by that function will be the healing/damage. You get 3 parameters; cid, level and magic level. Modify that formula to fit your needs, maybe check an old ultimate healing script from 7.6 and take that formula they have there!

Really thank you very much
:) I got it now ^^
 
I know this is an old thread, but I would like to have the good old 7.92 damage to my 8.54 server.. And I cant find a 7.92 forgotten server to download. Do anyone got a pack with working spells from 7.92 that works with TFS?
 
Back
Top