Forum > Miscellaneous

How to change 'fatigue' in ADT ?

(1/2) > >>

Magnus:
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: ---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
};
--- End code ---

Player.cpp

--- Code: ---    // 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

--- End code ---


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 ?

schlumpf:
http://pxr.dk/wowdev/wiki/index.php?tit ... inate_data

Where "indarkwater" exactly begins depends on the emulators extractor.

Magnus:
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 ?

schlumpf:
I don't know the extractor. Just look in there?

Magnus:
It's in the map extractor.

system.cpp

--- Code: ---                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;
                }

--- End code ---

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 ?

Navigation

[0] Message Index

[#] Next page

Go to full version