• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS 1.X+ How can I increase ExpPvpenfo

abdala ragab

Banned User
Joined
Aug 18, 2018
Messages
306
Solutions
10
Reaction score
272
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
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)...

Boy67

Veteran OT User
Joined
Jul 4, 2007
Messages
468
Solutions
26
Reaction score
371
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
Top