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

Combat Formula Dmg Problem [AGAIN, LUL]

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
993
Solutions
5
Reaction score
55
This is crazy how much problems i have with this Combat Formula :D
So now i tested all my weapons and i saw that they deal the same dmg it doesn't matter what atk source they have. Example i take 1atk weapon i deal 12k, i take 24atk weapon i deal 12k :D
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 33)
function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

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

Bump

Bump
 
Last edited by a moderator:
try changing local skillTotal to local skillTotal = 2 for example and check if it's working
 
Its error in your source. Not in the script. Looks like your weapons.cpp or whatever you have because you didnt post your tfs version is broken.
 
Its error in your source. Not in the script. Looks like your weapons.cpp or whatever you have because you didnt post your tfs version is broken.
Error with weapons.cpp? My garbage server don't even have weapons.cpp. I dont have tfs, i tried to find out what version do i have but that was just a big failure, no one can say what version i have. And i'm out of ideas how can i find out that version.

I did not understand your problem very well.
> that code seems correct, but I do not understand what you say is wrong.
All distance weapons deal same damage. If you have played tibia you know that weapons have attack points example "test sword (24, 4)" so 24 is attack, and 4 is def. So my problem is that my distance weapons deal same max hit. If you pick 1 attack dist weapon you'll de same dmg as weapon with 24attack. Do you get it now?

try changing local skillTotal to local skillTotal = 2 for example and check if it's working
Can you explain me why changing numbers should help? exactly this option.
 
Last edited by a moderator:
Change numbers to check if it actually works in-game. By doubling the value you can easily see if there's something you can influence
Well i can't see any change but with 0.5 i deal 10k with 2.0 i deal 11k. So i can say barely change
 
But it changed it?
Show me your current formula
No it doesn't still same problem
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 33)
function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 2.0 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
 
No it doesn't still same problem
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 33)
function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 2.0 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

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

Ok but I think you changed minimum damage there? Try changing to:

Code:
return -(skillTotal * 2.0 + levelTotal), -(skillTotal * 10.5 + levelTotal)
 
Tell me the skill of the player that u are using to test, and his level.
I think it's working, but the level is too high (or skill too high), so the weapon atk won't change almost anything the damage (in your formula)


also, only for test purposes, change this
Lua:
return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
to
Code:
return -10

If it's working, everyone should hit 10 (or less, depend on the monster defense, etc)
 
So that's mean i don't know what version i'm using. Because tfs doesn't exist in my server i said that earlier. I tried all ways to find out what version i'm using, but it doesn't went well.

I know this is not what you asked but maybe consider switching version of your server. It will make it a lot harder for you if you are using an outdated old bad version. Maybe you will lose some time initially but with new functions, better code and easier to ask for help I would think it is worth it
 
Tell me the skill of the player that u are using to test, and his level.
I think it's working, but the level is too high (or skill too high), so the weapon atk won't change almost anything the damage (in your formula)


also, only for test purposes, change this
Lua:
return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
to
Code:
return -10

If it's working, everyone should hit 10 (or less, depend on the monster defense, etc)
Yea i deal 10 or less.
Untitled.png


I know this is not what you asked but maybe consider switching version of your server. It will make it a lot harder for you if you are using an outdated old bad version. Maybe you will lose some time initially but with new functions, better code and easier to ask for help I would think it is worth it
Yea i was thinkin' about changing version but i couldn't find any tutorials how to change server version or something like this, so i throw away this idea.
 
Last edited by a moderator:
@drakylucas, He may be right.
It may also be that you can not differentiate between an impact of 1.000.000 to 1.000.500...
If your problem is true, then publish your weapon.cpp or your combat.cpp
Lul this is hilarious i don't even have weapon.cpp or combat.cpp. Files with .cpp format doesn't even exist in my server. This is so annoying.
 
Back
Top