This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: How to change 'fatigue' in ADT ?  (Read 1416 times)

Magnus

  • Moderators
  • Wiki Incarnate
  • *****
  • Posts: 147
    • View Profile
How to change 'fatigue' in ADT ?
« on: October 18, 2015, 01:00:52 pm »
I wanted to remove on some places the fatigue from the ocean. But I was not successful at all.

As I have seen in the Trinity core fatige is handled if a player is in dark water

Player.h
Code: [Select]
enum PlayerUnderwaterState
{
    UNDERWATER_NONE                     = 0x00,
    UNDERWATER_INWATER                  = 0x01,          // terrain type is water and player is afflicted by it
    UNDERWATER_INLAVA                   = 0x02,             // terrain type is lava and player is afflicted by it
    UNDERWATER_INSLIME                  = 0x04,             // terrain type is lava and player is afflicted by it
    UNDERWARER_INDARKWATER              = 0x08,     // terrain type is dark water and player is afflicted by it

    UNDERWATER_EXIST_TIMERS             = 0x10
};

Player.cpp
Code: [Select]
   // In dark water
    if (m_MirrorTimerFlags & UNDERWARER_INDARKWATER)
    {
        // Fatigue timer not activated - activate it
        if (m_MirrorTimer[FATIGUE_TIMER] == DISABLED_MIRROR_TIMER)
        {
            m_MirrorTimer[FATIGUE_TIMER] = getMaxTimer(FATIGUE_TIMER);
            SendMirrorTimer(FATIGUE_TIMER, m_MirrorTimer[FATIGUE_TIMER], m_MirrorTimer[FATIGUE_TIMER], -1);
        }
        else


But I couldn't find out how to set dark water.

Guess it's either something in MCNK chunk or in the MH2O chunk.

Any ideas ?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: How to change 'fatigue' in ADT ?
« Reply #1 on: October 18, 2015, 01:05:22 pm »
http://wowdev.wiki/index.php?tit ... inate_data

Where "indarkwater" exactly begins depends on the emulators extractor.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Magnus

  • Moderators
  • Wiki Incarnate
  • *****
  • Posts: 147
    • View Profile
Re: How to change 'fatigue' in ADT ?
« Reply #2 on: October 18, 2015, 03:05:03 pm »
Funny, that's exactly the place where I stucked with my own ADT program.

But for WotLK ... it's only the depth or what is the extractor looking for ?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: How to change 'fatigue' in ADT ?
« Reply #3 on: October 18, 2015, 04:29:56 pm »
I don't know the extractor. Just look in there?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Magnus

  • Moderators
  • Wiki Incarnate
  • *****
  • Posts: 147
    • View Profile
Re: How to change 'fatigue' in ADT ?
« Reply #4 on: October 19, 2015, 11:00:03 am »
It's in the map extractor.

system.cpp
Code: [Select]
               liquid_entry[i][j] = h->liquidType;
                switch (LiqType[h->liquidType])
                {
                    case LIQUID_TYPE_WATER: liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; break;
                    case LIQUID_TYPE_OCEAN: liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; break;
                    case LIQUID_TYPE_MAGMA: liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; break;
                    case LIQUID_TYPE_SLIME: liquid_flags[i][j] |= MAP_LIQUID_TYPE_SLIME; break;
                    default:
                        printf("nCan't find Liquid type %u for map %snchunk %d,%dn", h->liquidType, filename, i, j);
                        break;
                }
                // Dark water detect
                if (LiqType[h->liquidType] == LIQUID_TYPE_OCEAN)
                {
                    uint8 *lm = h2o->getLiquidLightMap(h);
                    if (!lm)
                        liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER;
                }

But I stuck in the analysis of the MH2O chunk. Mainly because there is not enough time to study it.
Header, attribute and instances are clear. But than follows some more (optional)  data.

The extractor is checking of the existence of LiquidLightMap. If exists, a Dark_water flag is added. But what is LiquidLightMap ?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: How to change 'fatigue' in ADT ?
« Reply #5 on: October 19, 2015, 11:33:53 am »
Have you tried just looking for that in the extractor source? it is probably a few lines above..

https://github.com/TrinityCore/TrinityC ... adt.h#L186

so apparently if liquid_object == 1 or offset_vertex_data == 0
« Last Edit: January 01, 1970, 01:00:00 am by Admin »