View Full Version : Thirst/Starvation Effects
chasem
07-18-2015, 09:46 AM
Wondering if anyone has found a way to implement thirst/starvation effects. I have been tinkering with having a persistent detrimental HP/Mana regen buff on all players that food and water negate.
Hoping there's a less cumbersome way that someone has come up with and is willing to share.
Thanks in advance!
rencro
07-18-2015, 10:48 AM
In zone client_process
void Client::DoHPRegen() {
if (Hungry())
return;
SetHP(GetHP() + CalcHPRegen() + RestRegenHP);
SendHPUpdate();
}
void Client::DoManaRegen() {
if (Thirsty())
return;
if (GetMana() >= max_mana && spellbonuses.ManaRegen >= 0)
return;
SetMana(GetMana() + CalcManaRegen() + RestRegenMana);
SendManaUpdatePacket();
}
Can also do this for Endurance. BTW dont you think its unfair that melees have a resource drained from them if they jump. Just venting (and I removed that silly penalty)
Maybe makes more sense to make all three (hp regen, mana regen, end regen) depend on both water and food.
Shendare
07-18-2015, 01:01 PM
Or even decrement by 1 each tick or something.
Go AFK for three in-game days? Die of thirst!
MWAhahahahahahaha!
chasem
07-18-2015, 02:05 PM
Awesomesauce! That's perfect. Thanks so much.
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.