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

solved

So if i going to understand right, those players have storage during the war? or just normal war?
 
Theoretically work well,
Players who are in a war, to kill his opponents during battles, receive experience for killing the enemy. It's like hardcore pvp server, except that it applies only in war mode. I had already seen on some servers, but do not know how it was done.
 
Not tested
LUA:
local shareExp = true

function onDeath(cid, corpse, deathList)
	if not isPlayer(cid) then return true end
	if not getPlayerGuildId(cid) or getPlayerGuildId(cid) < 1 then return true end
	if #deathList < 1 then return true end
	
	local killedGuild = getPlayerGuildId(cid)
	local query = db.getResult("select * from guild_wars where guild_id = " .. killedGuild .. " or enemy_id = " .. killedGuild .. ";")
	if query:getID() ~= -1 then
		local t = {}
		local guildEnemy = (query:getDataInt("enemy_id") == killedGuild and query:getDataInt("guild_id") or query:getDataInt("guild_id") == killedGuild and query:getDataInt("enemy_id") or 0)
		if guildEnemy < 1 then
			query:free()
			return true
		end
		for _, pid in ipairs(deathList) do
			if isPlayer(pid) and getPlayerGuildId(pid) and getPlayerGuildId(pid) == guildEnemy then
				table.insert(t, pid)
			end
		end
		
		if #t < 1 then
			query:free()
			return true
		end
		local totalExp = 200 * getPlayerLevel(cid) --200 * player level (E.j: If player lvl 150 then total exp = 30000)
		local expToGive = (shareExp and math.floor(totalExp / #t) or totalExp)
		for _, pid in ipairs(t) do
			doPlayerAddExperience(cid, expToGive)
		end
		query:free()
		return true
	end
	return true
end
 
Back
Top