Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Miscellaneous => Topic started by: Magnus 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
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
// 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 ?
-
http://pxr.dk/wowdev/wiki/index.php?tit ... inate_data (http://pxr.dk/wowdev/wiki/index.php?title=ADT/v18#Case_1.2C_Height_and_Texture_Coordinate_data" onclick="window.open(this.href);return false;)
Where "indarkwater" exactly begins depends on the emulators extractor.
-
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 ?
-
I don't know the extractor. Just look in there?
-
It's in the map extractor.
system.cpp
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 ?
-
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 (https://github.com/TrinityCore/TrinityCore/blob/3bc3b67a8fae059e1019446b09882dfa7fcd11a0/src/tools/map_extractor/adt.h#L186" onclick="window.open(this.href);return false;)
so apparently if liquid_object == 1 or offset_vertex_data == 0