• 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+ How can I increase ExpPvpenfo

abdala ragab

Veteran OT User
Joined
Aug 18, 2018
Messages
461
Solutions
11
Reaction score
340
Location
gamelaot.sytes.net
Lua:
function onPrepareDeath(cid, deathList)
        local tile = getTileInfo(getPlayerPosition(cid))
        if(tile.hardcore == false) then
                local pl_count = table.getn(deathList)
                local j = 0
                for _, pid in ipairs(deathList) do
                        if (isPlayer(cid) and isPlayer(pid) and getPlayerLevel(cid) > getPlayerLevel(pid)) then
                                local priorita = 1 - (j * 0.1)
                                local exp = 0
                                if (pl_count > 2) then
                                        exp = math.floor((((1 - (getPlayerLevel(pid) * 1.0) / getPlayerLevel(cid)) * 0.05 * getPlayerExperience(cid)) / pl_count) * priorita)
                                else
                                        exp = math.floor((((1 - (getPlayerLevel(pid) * 1.0) / getPlayerLevel(cid)) * 0.05 * getPlayerExperience(cid)) / (pl_count + 2)) * priorita)
                                end
                                doPlayerAddExp(pid, exp)
                                local pos = getPlayerPosition(pid)
                                doPlayerSendTextMessage(pid, MESSAGE_EXPERIENCE, "You gained " .. exp .. " experience for killing higher level than you.", exp, COLOR_WHITE, pos)
                                for _, spec in ipairs(getSpectators(pos, 7, 5, false)) do
                                        if (isPlayer(spec) and spec ~= pid) then
                                                doPlayerSendTextMessage(spec, MESSAGE_EXPERIENCE, getCreatureName(pid) .. " gained " .. exp .. " experience for killing " .. getCreatureName(cid) .. ".", exp, COLOR_WHITE, pos)
                                        end
                                end

                        end
                        j = j + 1
                end
        end
        return true
end

Tfs 1.2 I tried a lot to raise the level of the fight, but I didn't succeed. Please help
Post automatically merged:

up
Post automatically merged:

@M0ustafa Help Bro
 
Last edited:
Solution
B
If you just want a general increase for the total exp gained:

Lua:
local bonusPercentage = 7 -- % extra exp
function onPrepareDeath(cid, deathList)
        local tile = getTileInfo(getPlayerPosition(cid))
        if(tile.hardcore == false) then
                local pl_count = table.getn(deathList)
                local j = 0
                for _, pid in ipairs(deathList) do
                        if (isPlayer(cid) and isPlayer(pid) and getPlayerLevel(cid) > getPlayerLevel(pid)) then
                                local priorita = 1 - (j * 0.1)
                                local exp = 0
                                if (pl_count > 2) then
                                        exp = math.floor((((1 - (getPlayerLevel(pid) * 1.0)...
If you just want a general increase for the total exp gained:

Lua:
local bonusPercentage = 7 -- % extra exp
function onPrepareDeath(cid, deathList)
        local tile = getTileInfo(getPlayerPosition(cid))
        if(tile.hardcore == false) then
                local pl_count = table.getn(deathList)
                local j = 0
                for _, pid in ipairs(deathList) do
                        if (isPlayer(cid) and isPlayer(pid) and getPlayerLevel(cid) > getPlayerLevel(pid)) then
                                local priorita = 1 - (j * 0.1)
                                local exp = 0
                                if (pl_count > 2) then
                                        exp = math.floor((((1 - (getPlayerLevel(pid) * 1.0) / getPlayerLevel(cid)) * 0.05 * getPlayerExperience(cid)) / pl_count) * priorita)
                                else
                                        exp = math.floor((((1 - (getPlayerLevel(pid) * 1.0) / getPlayerLevel(cid)) * 0.05 * getPlayerExperience(cid)) / (pl_count + 2)) * priorita)
                                end
                                exp = math.floor(exp * (1 + (bonusPercentage / 100)))
                                doPlayerAddExp(pid, exp)
                                local pos = getPlayerPosition(pid)
                                doPlayerSendTextMessage(pid, MESSAGE_EXPERIENCE, "You gained " .. exp .. " experience for killing higher level than you.", exp, COLOR_WHITE, pos)
                                for _, spec in ipairs(getSpectators(pos, 7, 5, false)) do
                                        if (isPlayer(spec) and spec ~= pid) then
                                                doPlayerSendTextMessage(spec, MESSAGE_EXPERIENCE, getCreatureName(pid) .. " gained " .. exp .. " experience for killing " .. getCreatureName(cid) .. ".", exp, COLOR_WHITE, pos)
                                        end
                                end

                        end
                        j = j + 1
                end
        end
        return true
end
 
Solution
Back
Top