protectionLevel =
Server\data\XML
<?xml version="1.0" encoding="UTF-8"?>
<stages>
<config enabled="1"/>
<stage minlevel="1" maxlevel="100" multiplier="150"/>
<stage minlevel="101" maxlevel="125" multiplier="75"/>
<stage minlevel="126" maxlevel="200" multiplier="25"/>
<stage minlevel="201" maxlevel="250" multiplier="15"/>
<stage minlevel="250" maxlevel="300" multiplier="5"/>
<stage minlevel="300" multiplier="3"/>
</stages>
<event type="combat" name="PVPstages" event="script" value="pvpstages.lua"/>
registerCreatureEvent(cid, "PVPstages")
local pvpstage = 1.5 -- difference between levels, for example 100 x 1.5 = 150, so lower than level 100 and higher than level 150 can't attack eachother.
function onCombat(cid, target)
if(not isPlayer(target)) then
return true
end
if(getPlayerLevel(cid) > (getPlayerLevel(target) * pvpstage) or (getPlayerLevel(cid) * pvpstage) < getPlayerLevel(target)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You can not attack players with a to high level difference.")
return false
end
return true
end
local pvplevels = 50 -- level difference with amount of levels, so you can't attack someone with more then 50 levels higher or lower then you.
function onCombat(cid, target)
if(not isPlayer(target)) then
return true
end
if(getPlayerLevel(cid) > (getPlayerLevel(target) + pvplevels) or (getPlayerLevel(cid) + pvplevels) < getPlayerLevel(target)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You can not attack players with a to high level difference.")
return false
end
return true
end