• 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 0.X How to change hit color from Physicaldamage

jondropss

New Member
Joined
Jul 19, 2020
Messages
41
Reaction score
2
hi, i have this script for my wand, and i was trying to change the hit color from physical damg, how i can do this?



Lua:
local min, max = 1700,1900 --Ataque mínino e ataque máximo

local w = {
    [1] = {ef = 173, sh = 41, dmg = COMBAT_FIREDAMAGE, posx = 1, posy = 0}, -- Isto seria a aplicação dentro da tabela, bastaria replicar em cada linha adicionada.
    [2] = {ef = 117, sh = 101, dmg = COMBAT_ICEDAMAGE, posx = 1, posy = 1},
    [3] = {ef = 422, sh = 106, dmg = COMBAT_DEATHDAMAGE, posx = 1, posy = 1},
    [4] = {ef = 214, sh = 48, dmg = COMBAT_PHYSICALDAMAGE, posx = 1, posy = 1},
    [5] = {ef = 81, sh = 105, dmg = COMBAT_HOLYDAMAGE, posx = 1, posy = 1}
}

function onUseWeapon(cid, var)
        local effect = getPlayerStorageValue(cid, 4561)
        local target = getCreatureTarget(cid)

        if target ~= 0 then
                local wx = w[effect] or w[math.random(#w)]
                doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
                local pos = {x = getThingPos(target).x + (wx.posx), y = getThingPos(target).y + (wx.posy), z = getThingPos(target).z} -- Aqui vai trabalhar em cima das posições definidas la na tabela.
                doSendMagicEffect(pos, wx.ef)
                doTargetCombatHealth(cid, target, wx.dmg, -min,-max, 4)
        end
        return true
end
 
Solution
You need to edit your sources in order to change hit colors, but honestly afaik I don't think you can change this on a single weapon. game.cpp

C++:
}
        case COMBAT_LIFEDRAIN: {
            color = TEXTCOLOR_RED;
            effect = CONST_ME_MAGIC_RED;
            break;
        }
You need to edit your sources in order to change hit colors, but honestly afaik I don't think you can change this on a single weapon. game.cpp

C++:
}
        case COMBAT_LIFEDRAIN: {
            color = TEXTCOLOR_RED;
            effect = CONST_ME_MAGIC_RED;
            break;
        }
 
Solution
Back
Top