Core/Maps
* Corrected liquid type extraction in maps - MCLQ chunk must be parsed together with MH2O (they stack) * Fixed liquid detection in WMO objects * Implemented LiquidType.dbc use, players will now get proper auras in special liquids * Turned off slime damage by default (Naxxramas uses periodic damage aura for this purpose) * Implemented liquid type overrides basing on area/zone * Renamed final temp_gameobject_models to GameObjectModels.dtree (the temporary one produced by vmap extractor remains unaffected) Note: Map and Vmap re-extraction is required
This commit is contained in:
@@ -724,6 +724,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
|
||||
for (uint8 i=0; i<MAX_TIMERS; i++)
|
||||
m_MirrorTimer[i] = DISABLED_MIRROR_TIMER;
|
||||
|
||||
_lastLiquid = NULL;
|
||||
m_MirrorTimerFlags = UNDERWATER_NONE;
|
||||
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
|
||||
m_isInWater = false;
|
||||
@@ -1416,14 +1417,14 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10);
|
||||
}
|
||||
|
||||
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA|UNDERWATER_INSLIME))
|
||||
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellId))
|
||||
{
|
||||
// Breath timer not activated - activate it
|
||||
if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER)
|
||||
m_MirrorTimer[FIRE_TIMER] = getMaxTimer(FIRE_TIMER);
|
||||
else
|
||||
{
|
||||
m_MirrorTimer[FIRE_TIMER]-=time_diff;
|
||||
m_MirrorTimer[FIRE_TIMER] -= time_diff;
|
||||
if (m_MirrorTimer[FIRE_TIMER] < 0)
|
||||
{
|
||||
m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILLISECONDS;
|
||||
@@ -1434,8 +1435,8 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
EnvironmentalDamage(DAMAGE_LAVA, damage);
|
||||
// need to skip Slime damage in Undercity,
|
||||
// maybe someone can find better way to handle environmental damage
|
||||
else if (m_zoneUpdateId != 1497)
|
||||
EnvironmentalDamage(DAMAGE_SLIME, damage);
|
||||
//else if (m_zoneUpdateId != 1497)
|
||||
// EnvironmentalDamage(DAMAGE_SLIME, damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23059,15 +23060,34 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
|
||||
ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status);
|
||||
if (!res)
|
||||
{
|
||||
m_MirrorTimerFlags &= ~(UNDERWATER_INWATER|UNDERWATER_INLAVA|UNDERWATER_INSLIME|UNDERWARER_INDARKWATER);
|
||||
// Small hack for enable breath in WMO
|
||||
/* if (IsInWater())
|
||||
m_MirrorTimerFlags|=UNDERWATER_INWATER; */
|
||||
m_MirrorTimerFlags &= ~(UNDERWATER_INWATER | UNDERWATER_INLAVA | UNDERWATER_INSLIME | UNDERWARER_INDARKWATER);
|
||||
if (_lastLiquid && _lastLiquid->SpellId)
|
||||
RemoveAurasDueToSpell(_lastLiquid->SpellId);
|
||||
|
||||
_lastLiquid = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if (uint32 liqEntry = liquid_status.entry)
|
||||
{
|
||||
LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry);
|
||||
if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry)
|
||||
RemoveAurasDueToSpell(_lastLiquid->SpellId);
|
||||
|
||||
if (liquid && liquid->SpellId)
|
||||
AddAura(liquid->SpellId, this);
|
||||
|
||||
_lastLiquid = liquid;
|
||||
}
|
||||
else if (_lastLiquid && _lastLiquid->SpellId)
|
||||
{
|
||||
RemoveAurasDueToSpell(_lastLiquid->SpellId);
|
||||
_lastLiquid = NULL;
|
||||
}
|
||||
|
||||
|
||||
// All liquids type - check under water position
|
||||
if (liquid_status.type&(MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN|MAP_LIQUID_TYPE_MAGMA|MAP_LIQUID_TYPE_SLIME))
|
||||
if (liquid_status.type_flags & (MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN | MAP_LIQUID_TYPE_MAGMA | MAP_LIQUID_TYPE_SLIME))
|
||||
{
|
||||
if (res & LIQUID_MAP_UNDER_WATER)
|
||||
m_MirrorTimerFlags |= UNDERWATER_INWATER;
|
||||
@@ -23076,23 +23096,23 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
|
||||
}
|
||||
|
||||
// Allow travel in dark water on taxi or transport
|
||||
if ((liquid_status.type & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport())
|
||||
if ((liquid_status.type_flags & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport())
|
||||
m_MirrorTimerFlags |= UNDERWARER_INDARKWATER;
|
||||
else
|
||||
m_MirrorTimerFlags &= ~UNDERWARER_INDARKWATER;
|
||||
|
||||
// in lava check, anywhere in lava level
|
||||
if (liquid_status.type&MAP_LIQUID_TYPE_MAGMA)
|
||||
if (liquid_status.type_flags & MAP_LIQUID_TYPE_MAGMA)
|
||||
{
|
||||
if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK))
|
||||
if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK))
|
||||
m_MirrorTimerFlags |= UNDERWATER_INLAVA;
|
||||
else
|
||||
m_MirrorTimerFlags &= ~UNDERWATER_INLAVA;
|
||||
}
|
||||
// in slime check, anywhere in slime level
|
||||
if (liquid_status.type&MAP_LIQUID_TYPE_SLIME)
|
||||
if (liquid_status.type_flags & MAP_LIQUID_TYPE_SLIME)
|
||||
{
|
||||
if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK))
|
||||
if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK))
|
||||
m_MirrorTimerFlags |= UNDERWATER_INSLIME;
|
||||
else
|
||||
m_MirrorTimerFlags &= ~UNDERWATER_INSLIME;
|
||||
|
||||
Reference in New Issue
Block a user