Fatigue for ArcEmu menu

User Tag List

Results 1 to 5 of 5
  1. #1
    pcrew's Avatar Member
    Reputation
    54
    Join Date
    Jun 2008
    Posts
    88
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fatigue for ArcEmu

    Fatigue For ArcEmu

    This is my way of implementing fatigue on ArcEmu
    It is not perfect and I still haven't figured out how to do it using water type information but this works 95% as it should.

    Implementation
    Check water height and if it is 0 (Errorous map) start fatigue mirror timer

    What is fatigue?
    That orange bar you get when you swim too far away from the land on the retail.


    Note : Comment out or change
    CastSpell(this,35341,0); to remove/replace the spell which is casted on you once the fatigue bar gets full if you want to (I set it to Explosion Visual by default)

    Installation

    MovementHandler.cpp

    Find :
    Code:
    void _HandleBreathing(MovementInfo &movement_info, Player * _player, WorldSession * pSession)
    {


    Add after :
    Code:
    float px = _player->GetPositionX();
        float py = _player->GetPositionY();
        float pz = _player->GetPositionZ();
        float orient = _player->GetOrientation();
            
        float posx = px;// = px + r * co;
        float posy = py;// = py + r * si;
    
        uint32 mapid = _player->GetMapId();
        
        if(mapid == 0 || mapid == 1)
        {
            float mgr_t = _player->GetMapMgr()->GetLandHeight(posx,posy);
            uint8 mgr_wt = _player->GetMapMgr()->GetWaterType(posx,posy);
            float mgr_wh = _player->GetMapMgr()->GetWaterHeight(posx,posy);
    
            if(mgr_wh == 0.0f)
            {
                _player->m_FatigueState = 1;
               
            }
            else
            {
                _player->m_FatigueState = 0;
            }
        }


    Player.cpp

    Find
    Code:
    m_SwimmingTime(0),
    m_BreathDamageTimer(0),

    Add after

    Code:
    //Fatigue
    m_FatigueState(0),
    m_FatigueTime(0),
    m_FatigueMaxTime(10000),
    Find
    Code:
        else
        {
            // check if we're not on a full breath timer
            if(m_UnderwaterTime < m_UnderwaterMaxTime)
            {
                // regenning
                m_UnderwaterTime += (p_time * 10);
    
                if(m_UnderwaterTime >= m_UnderwaterMaxTime)
                {
                    m_UnderwaterTime = m_UnderwaterMaxTime;
                    StopMirrorTimer(1);
                }
            }
        }
    Add after
    Code:
    // Fatigue
        if( m_FatigueState == 1 )
        {
            //BroadcastMessage("Fatigue ON");
            // keep subtracting timer
            if( m_FatigueTime < m_FatigueMaxTime )
            {
                m_FatigueTime += (p_time * 2);
            }
            
            WorldPacket data(SMSG_START_MIRROR_TIMER, 20);
            data << uint32( 0 ) << m_FatigueTime << m_FatigueMaxTime << int32(0) << uint32(0);
            GetSession()->SendPacket(&data);
            
            if( m_FatigueTime >= m_FatigueMaxTime )
            {
                // check last damage dealt timestamp, and if enough time has elapsed deal damage
                //if( mstime >= m_FatigueLastDmg )
                //{
                    //BroadcastMessage("Timer damage");
                    uint32 damage = m_uint32Values[UNIT_FIELD_MAXHEALTH] / 10;
                    DealDamage(this, damage, 0, 0, 0);
                    CastSpell(this,35341,0);
                //}
            }
        }
        else
        {    
            //BroadcastMessage("Fatigue OFF");
            //Full fatigue bar?
            if(m_FatigueTime <= 0)
            {
                StopMirrorTimer(0);
                m_FatigueTime = 0;
                
            }
            else 
            {
                //BroadcastMessage("Regen Fatigue : %i" , m_FatigueTime);
                //Restoring
                m_FatigueTime -= (p_time * 2);
                
                WorldPacket data(SMSG_START_MIRROR_TIMER, 20);
                data << uint32( 0 ) << m_FatigueTime << m_FatigueMaxTime << int32(0) << uint32(0);
                GetSession()->SendPacket(&data);
                
                if(m_FatigueTime <= 0)
                {
                    StopMirrorTimer(0);
                    m_FatigueTime = 0;
                }
                
                if(m_FatigueTime * -1 >= 0)
                {
                    StopMirrorTimer(0);
                    m_FatigueTime = 0;
                }
            }
    
        }
    Last edited by pcrew; 11-21-2009 at 06:15 PM.

    Fatigue for ArcEmu
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,503
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, Ill test this out.

  3. #3
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GJ. Fatigues gay though lol. +rep.

    I live in a shoe

  4. #4
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why not post this on the emulators site?
    If you need me you have my skype, if you don't have my skype then you don't need me.

  5. #5
    sasoritail's Avatar Contributor
    Reputation
    161
    Join Date
    Sep 2008
    Posts
    655
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Win :P
    +Rep
    It's been a while

Similar Threads

  1. Flexible Database Editor for Arcemu
    By latruwski in forum WoW EMU Programs
    Replies: 366
    Last Post: 10-05-2009, 02:43 PM
  2. [Macro] Blizzlike GM macro for ArcEmu
    By EmiloZ in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 08-24-2008, 10:11 AM
  3. Illidan script for Arcemu 2.4.3
    By apollo16 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 08-13-2008, 02:15 PM
  4. [Request] Need vendors updated for arcemu rev 677
    By Mr.Jebus Christ in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-09-2008, 04:55 AM
  5. PvPToken Script for ArcEmu
    By flop159 in forum World of Warcraft Emulator Servers
    Replies: 11
    Last Post: 07-16-2008, 01:24 AM
All times are GMT -5. The time now is 04:05 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search