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

Need a help in PvP-Enfo system.

Sane Mei

New Member
Joined
Feb 21, 2010
Messages
56
Reaction score
0
Well guys I've got a problem, I am trying to make something like this, for example:
If player with level 80 kills player level like 50 he should get some expierence, not that much as 50 kills 80, but always some and I have no clue how to do, I mean i am trying some combinations in config at those lines:

minLevelThresholdForKilledPlayer = 0.9
maxLevelThresholdForKilledPlayer = 1.1

Tried a lot of combinations but still nothing and it just works when 40 level kills higher, but if higher level wants to kill lower level he doesn't get any expierence.

My idea is if it doesn't work in config. so maybe we can do it somehow by scripting it in lua? I mean something like this ( but still this code is probably wrong because it doesnt work )

Code:
function onKill(cid, target)
local template = 0
local tlvl, plvl = 0, 0
	if(isPlayer(target) == true) then
		tlvl = getPlayerLevel(target)
		plvl = getPlayerLevel(cid)
		if(tlvl < p lvl) then	
			template = ((tlvl / plvl) * 10000)
			doPlayerAddExperience(cid, template)
		end
	end
return true
end

If there isn't any solution in config.lua ( but I really would be happy if there is any ) to set it, then someone could make or tell me how to make a script that give you EVERYTIME on a playerkill like 2k expierence? I mean it doesn't not matter what level do you kill, even if 8 lvl kills 100 level then he gets 2k expierence, and on other hand as well.

If there isn't any solution in config.lua ( but I really would be happy if there is any ) to set it, then someone could make or tell me how to make a script that give you EVERYTIME on a playerkill like 2k expierence? I mean it doesn't not matter what level do you kill, even if 8 lvl kills 100 level then he gets 2k expierence, and on other hand as well.

+ It would be nice if someone could add things like this as well:
* If player kills a player 10 levels higher than his lvl then he gets 10k expierence ( for example ), if player kills a player 20 lvls higher than his lvl then he gets 20k expierence, etc, etc.

But if player kills another players which is 10 lower than his, then he gets 20k expierence, if 20 lvls lower then 10k expierence, etc, etc.

What you guys think? Is it possible to write in .lua or something if we can't set it config.lua?
Does somebody got expierence to write something like this ?

// Thanks a lot.
 
Last edited:
I haven't tested this but it might work - the numbers represent the level differences.

Lua:
local config = {
	[{1,19}] = 1000,
	[{20,29}] = 10000,
	[{30,39}] = 100000,
	[{40,49}] = 1000000,
	[{50,100}] = 10000000
}

local x, y
function onKill(cid, target)
	for i, v in pairs(config) do
		if isPlayer(cid) and isPlayer(target) then
			x = (getPlayerLevel(cid) - getPlayerLevel(target))
			y = (getPlayerLevel(target) - getPlayerLevel(cid))
			if isInArray({i[1], i[2]}, x or y) then
				doPlayerAddExperience(cid, v)
			end
			
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
		end
	end
	
	return true
end

If I am one to nineteen levels away, I will only get 1,000 experience. That's the idea.
 
Last edited:
Back
Top