Hello i got some script but i dont know what they really do . i found a description but didnt understand..
What does this script means?
and this?
PLease i need help with these both scripts
What does this script means?
PHP:
Level downgrade lock
By default the server stops players from getting below level 120, so that they are always ready to fight. This can be easily changed in the lowlevelock.lua creaturescript. (data/creaturescripts/scripts/lowlevellock.lua).
Extract:
..
function onLogin(cid)
if getPlayerLevel(cid) < 120 then
doPlayerAddExperience(cid, (getExperienceForLevel(120) - getPlayerExperience(cid)))
end
return TRUE
end
..
To change the lowest level possible, simply change the two '120' values in this script to your chosen low (or high) level.
and this?
PHP:
Level rebalance option
If you got your EXP rates or vocations drastically wrong or something went bad and players gained too high of a level too quickly, you can activate a script to downgrade their levels next time they log in to a more apropriate level. The script to do this is a creature script. (data/creaturescripts/script/levelrebalance.lua)
This script is slightly more complicated and shouldnt be edited by someone who does not know what they are doing. However the script is detailed below to help, if you should try anyway.
Extract:
..
local rebalanceStor = getPlayerStorageValue(cid, 37454) <-- change this, and the other storage values if you wish to use an alternate.
if rebalanceStor == -1 and getPlayerLevel(cid) >= 140 then <-- Says that if the player is higher than or equal to 140, do the following
doPlayerAddExperience(cid, (getExperienceForLevel(130) - getPlayerExperience(cid))) <-- defines the level to be reduced to.
setPlayerStorageValue(cid, 37454, 1)
elseif rebalanceStor == -1 and getPlayerLevel(cid) > 125 and getPlayerLevel(cid) < 130 then <-- Says that if the player is higher than 125 but lower than 130
doPlayerAddExperience(cid, (getExperienceForLevel(125) - getPlayerExperience(cid)))
setPlayerStorageValue(cid, 37454, 1)
elseif rebalanceStor == -1 and getPlayerLevel(cid) < 120 then <-- this defines the lowest level players can be.Anyone lower than 120 in this example will be given 120.
doPlayerAddExperience(cid, (getExperienceForLevel(120) - getPlayerExperience(cid)))
setPlayerStorageValue(cid, 37454, 1)
else setPlayerStorageValue(cid, 37454, 1)
..
To turn this script on you must 'uncomment' it from the creaturescripts.xml file. (data/creaturescripts/creaturescripts.xml)
Change
<!-- <event type="login" name="LevelRebalance" event="script" value="levelrebalance.lua"/> -->
to
<event type="login" name="LevelRebalance" event="script" value="levelrebalance.lua"/>