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

TFS 1.X+ Players recieve double damage from other players

Status
Not open for further replies.

venius

Active Member
Joined
Dec 27, 2010
Messages
150
Reaction score
36
I have a weird bug where players attacking other players deal double damage. This is only the case for actual health change and NOT for mana change. So if I player hits another player with utamo vita then the damage is calculated properly. Any ideas? I modified something in "game.cpp" a while ago, maybe I messed it up there?

(TFS 1.5, 8.6 downgraded by Nekiro)
 
Gyazo (https://gyazo.com/544996f51ffe30d85d125d461592f220)
I have one active onHealthChange script, I have tried disabling it which did nothing...
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)

    if primaryType == COMBAT_HEALING or secondaryType == COMBAT_HEALING then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end
 
    if creature and creature:isPlayer() then
            if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 56) then
                creature:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY)
                primaryDamage = 0
                secondaryDamage = 0
            end
    end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
I have an identical script for mana too.

Maybe I should restore my server to an older version to test if it works?
 
Ok I know the OP doesn't want a solution for this anymore, but I came to a conclusion about this problem.
there is a creaturescript onHealthChange that is modifying the secondaryType this was confirmed by the prints that @Roddet suggested.
if the type of damage is wrong, then the color will be TEXTCOLOR_NONE, therefore the animated text will not be sent, this makes it look like it is only doing half damage when in fact it is doing full damage as it appears in the message from the player's console.
1673417403805.png
 
Last edited:
Status
Not open for further replies.
Back
Top