View Single Post
  #20  
Old 10-22-2014, 04:35 PM
Secrets Secrets is offline
VIP / Contributor

Secrets's Avatar

Join Date: Oct 2009
Posts: 1,354
Default

Looks like I answered some of my own questions by digging into EQMac:

- Fatigue is determined by the client and is set in a function listed as:
EQ_PC::SetFatigue(DWORD this, signed int val)

- Fatigue can be a number between 0 and 100 (100 being 'bar depleted'), but never exceeding 100. See the following pseudocode generated from IDA below:

Code:
void __cdecl EQ_PC::SetFatigue(int a1, signed int a2)
{
  char v2; // al@3

  if ( a2 <= 100 )
  {
    v2 = 0;
    if ( a2 >= 0 )
      v2 = a2;
    *(_BYTE *)(a1 + 4958) = v2;
  }
  else
  {
    *(_BYTE *)(a1 + 4958) = 100;
  }
}
- In EQPlayer::DoAttack, below the check to see if the target is visible on the client end of things, you have this section of pseudocode before the packet is sent for activating an attack due to combat processing:

Code:
              if ( pInstLocalPC && CombatEQ != pInstLocalPC && (v64 = ((_BYTE *)pInstLocalPC + 174), v64 > 25u) )// pInstLocalPC + 174 = STR? i think
              {
                v65 = 1;
                if ( v64 > 50u )
                {
                  if ( v64 <= 100u )
                    EQ_PC::SetFatigue(v120, *(_BYTE *)(v120 + 4958) + 1);
                  else
                    EQ_PC::SetFatigue(v120, *(_BYTE *)(v120 + 4958) + 2);
-This states that if your melee attack goes off - and your STR (I think +174 is str?) is between 50 and 100 - your melee attack will cost 1 fatigue, if not, it costs 2.

-There's also a random factor associated with swinging a weapon - 50% of the time you will additionally drain another 1 stamina on a weapon hit.

-Each hand has its own stamina penalty from swinging it. Item Slots 13 and 14 (pri/sec) both drain stamina.
*This also reassures that Rogean was right years ago when someone claimed weapons didn't swing independently - each hand has a separate chance to drain stamina when it 'triggers'

-Also, to answer the question above I had, double attack does not count for draining stamina - only dual wield can drain stamina and only the first hit in an attack can drain stamina in case of rampage/flurry. NPCs do not have their own fatigue bar.

-Swimming only drains fatigue when detected as being in water, and drains 10 stamina every 6 seconds. While under the influence of water, you cannot gain stamina. Swimming in lava or other WLD hazards such as PvP Arenas does not drain fatigue, there's a specific case in client code to handle this.

-Stamina is drained in reverse and is called 'fatigue' internally. It starts at 0, and when it is depleted, it goes up to 100. Any fatigue past 100 is reset to 100.

-Jumping drains 10 fatigue flat. If you do not have 10 fatigue left out of 100, the client will not let you jump

-Fatigue is regained with food at a rate of 10 fatigue per tick. Without food, it does not regenerate. The server determines how much fatigue you regen per tick.

-If you have less than 100 STA, this starts to negatively affect strength, dexterity, and agility by giving a penalty of (Fatigue - STA). This penalty, at the very least, will always remove 10 of a stat.
So if you have 57 STA somehow (debuffs maybe?), and 130 STR/DEX/AGI, and your stamina bar is depleted to 15% remaining, you will end up with a 27 stat
penalty to your STR/DEX/AGI stats, leaving you with 102 STR/DEX/AGI.

-Endurance and other Post-GoD systems are completely different than the fatigue system - endurance has values that exceed 100 and then some. They are not even remotely close, and weapons do not drain endurance.

- Fun tidbit - Back in the day, stamina was actually calculated by the client AND the server - the server even would trust the client's stamina if the client told the server it was different in a save request. That's obviously not the case with the endurance revamp, but still, lol!
__________________
Engineer of Things and Stuff, Wearer of Many Hats

“Knowing yourself is the beginning of all wisdom.” — Aristotle
Reply With Quote