Serverside code of the beer inventory item I scripted from 2006:
PHP Code:
function onActionServerSide(time) {
clientr.stat_ammo_beer--;
if (player.ap < 40 && level.isnopklevel)
return NULL;
if (time < 300) {
if (player.ap < 40)
player.heal2(1);
else if (time == 0)
player.fullHeal2();
else if (time <= 100)
player.heal2(2);
else player.heal2(1);
}
else {
player.injure(2);
if (clientr.hd_isdead)
player.deaths_beer++;
if (player.deaths_beer > serverr.drinking_deaths_leader[0])
serverr.drinking_deaths_leader = {player.deaths_beer,player.account};
}
}
Then again, players had more than 3 hearts to work with by decision of Master Storm. Biggest mistake in the script is that I set the time variable clientside. Better would have been to set a serverside timestamp on when to stop being drunk.
Explanation:
Drink one beer and you get drunk for 20 seconds (movement system randomizes at intervals what direction keys pertain to). Drink another beer and that adds another 20 seconds to that time.
Healing if you have over 40AP: The healing decreases with how much time you have on the drunk counter, and eventually leads to injuring yourself.
Healing if you have less than 40AP: You can't heal in levels where you can't PK (laming prevention), it does the minimum amount of healing in levels where you can PK, and the fact that you can drink so much it harms you is the same.
Meanwhile, being on the drunk movement system is not a great advantage in PKing, though being clientside could be hackable.
Last edited by deadowl; 03-19-2015 at 01:20 AM.
Reason: [code] tag didn't work, [pre] tag didn't work, and now further explanation