local config = {
range_z = 1, -- 0 = same floor, 1 = +1 floor up or down, 2 et cetera
range_xy = 15, -- 0 = everyone on same tile, 1 = exori, 2 = 5 by 5, 3 = 7 by 7, et cetera
required_vocations = 4, -- 4 = yourself + 3 other vocations
experience_multiplier = 120000 -- multi * monster_exp
}
local function checkPartyRequirements(cid)
local count = 1
local vocations = {}
table.insert(vocations, getPlayerVocation(cid))
local party = getPlayerParty(cid)
local cid_position = getThingPosition(cid)
local cid_pos = {x = cid_position.x, y = cid_position.y, z = cid_position.z}
if party then
for _, pid in ipairs(getPartyMembers(party)) do
local pid_position = getThingPosition(pid)
local pid_pos = {x = pid_position.x, y = pid_position.y, z = pid_position.z}
local add = 1
for i = 1, #vocations do
if getPlayerVocation(pid) == vocations[i] then
add = 0
end
end
if pid_pos.z < (cid_pos.z - config.range_z) or pid_pos.z > (cid_pos.z + config.range_z) then
add = 0
end
if pid_pos.y < (cid_pos.y - config.range_xy) or pid_pos.y > (cid_pos.y + config.range_xy) then
add = 0
end
if pid_pos.x < (cid_pos.x - config.range_xy) or pid_pos.x > (cid_pos.x + config.range_xy) then
add = 0
end
if add == 1 then
table.insert(vocations, getPlayerVocation(pid))
count = count + 1
end
end
end
return count
end
function onKill(cid, target, damage, flags)
if not isMonster(target) then
return true
end
if not isPlayer(cid) then
return true
end
if checkPartyRequirements(cid) >= config.required_vocations then
local target_name = getCreatureName(target)
local experience_to_give = 120000 * getMonsterInfo(target_name).experience
doPlayerAddExperience(cid, experience_to_give)
end
return true
end