Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2013, 10:35 AM
Lighted Shadows
Fire Beetle
 
Join Date: Nov 2013
Posts: 12
Default Character:RestRegenTimeToActivate not working

I been trying to get Character:RestRegenTimeToActivate to work

I set
Character:RestRegenPercent 10
Character:RestRegenTimeToActivate=30

When a player sits they do regen 10% every tick but no matter what I set Character:RestRegenTimeToActivate to they start to regen as soon as they sit down.

Now I did test this out of combat by casting a few spells on myself and then sitting down. I noticed a hate check in the code. Is this a case that regen time does not work unless the player is on a hate list?
Reply With Quote
  #2  
Old 11-09-2013, 12:29 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Here's the code for the regen in the source. Rest Regen occurs when they're out of combat for XX seconds, the Regen Percent occurs when they sit down. This is in client_process.cpp.

Code:
void Client::CalcRestState() {

        // This method calculates rest state HP and mana regeneration.
        // The client must have been out of combat for RuleI(Character, RestRegenTimeToActivate) seconds,
        // must be sitting down, and must not have any detrimental spells affecting them.
        //
        if(!RuleI(Character, RestRegenPercent))
                return;

        RestRegenHP = RestRegenMana = RestRegenEndurance = 0;

        if(AggroCount || !IsSitting())
                return;

        if(!rest_timer.Check(false))
                return;

        uint32 buff_count = GetMaxTotalSlots();
        for (unsigned int j = 0; j < buff_count; j++) {
                if(buffs[j].spellid != SPELL_UNKNOWN) {
                        if(IsDetrimentalSpell(buffs[j].spellid) && (buffs[j].ticsremaining > 0))
                                if(!DetrimentalSpellAllowsRest(buffs[j].spellid))
                                        return;
                }
        }

        RestRegenHP = (GetMaxHP() * RuleI(Character, RestRegenPercent) / 100);

        RestRegenMana = (GetMaxMana() * RuleI(Character, RestRegenPercent) / 100);

        if(RuleB(Character, RestRegenEndurance))
                RestRegenEndurance = (GetMaxEndurance() * RuleI(Character, RestRegenPercent) / 100);
}
Reply With Quote
  #3  
Old 11-09-2013, 03:26 PM
Lighted Shadows
Fire Beetle
 
Join Date: Nov 2013
Posts: 12
Default

So
// The client must have been out of combat for RuleI(Character, RestRegenTimeToActivate) seconds,

I am OK with that I understand now. I was testing it by casting speels on myself sitting in a safe spot and then sitting down. Seams to work as coded when in combat.

I am not too concerned about it kicking in if the player has been out of combat for some time. I was just concerned about players sitting in the middle of a fight to get mana regen when OOM. Seams to work fine when in combat.

Off now to try and correct the jumping Mana/HP bar that goes up 23,24,25,26
then down back to 24 and starting to regen again. Been reading about it here and there just have not found a fix really that is not dateed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:06 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3