Restore patch: No Fly Zone using Spell
--HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -21831,7 +21831,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.z, height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
}
|
||||
}
|
||||
RemoveAura(61243); // No fly zone - Parachute
|
||||
RemoveAura(44795); // No fly zone - Parachute
|
||||
}
|
||||
|
||||
void Player::UpdateAchievementCriteria( AchievementCriteriaTypes type, uint32 miscvalue1/*=0*/, uint32 miscvalue2/*=0*/, Unit *unit/*=NULL*/, uint32 time/*=0*/ )
|
||||
|
||||
@@ -1007,6 +1007,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
|
||||
bool IsInWater() const { return m_isInWater; }
|
||||
bool IsUnderWater() const;
|
||||
bool IsFalling() { return GetPositionZ() < m_lastFallZ; }
|
||||
|
||||
void SendInitialPacketsBeforeAddToMap();
|
||||
void SendInitialPacketsAfterAddToMap();
|
||||
|
||||
+11
-2
@@ -5142,6 +5142,15 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
break;
|
||||
}
|
||||
case 44795: // Parachute
|
||||
{
|
||||
float x, y, z;
|
||||
m_caster->GetPosition(x, y, z);
|
||||
float ground_Z = m_caster->GetMap()->GetVmapHeight(x, y, z, true);
|
||||
if (fabs(ground_Z - z) < 0.1f)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -5231,8 +5240,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
// allow always ghost flight spells
|
||||
if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive())
|
||||
{
|
||||
//if (!((Player*)m_originalCaster)->IsKnowHowFlyIn(m_originalCaster->GetMapId(),m_originalCaster->GetZoneId()))
|
||||
if (m_originalCaster->GetZoneId() == 4197 || m_originalCaster->GetZoneId() == 4395)
|
||||
// 4197 = Wintergrasp || 4395 = Dalaran && 4564 = Krasus Landing
|
||||
if (m_originalCaster->GetZoneId() == 4197 || m_originalCaster->GetZoneId() == 4395 && m_originalCaster->GetAreaId() != 4564)
|
||||
return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE;
|
||||
}
|
||||
break;
|
||||
|
||||
+38
-26
@@ -3522,30 +3522,7 @@ void AuraEffect::HandleAuraFeatherFall(bool apply, bool Real, bool /*changeAmoun
|
||||
|
||||
WorldPacket data;
|
||||
if (apply)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (caster->GetGUID() == m_target->GetGUID())
|
||||
{
|
||||
m_target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
m_target->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
}
|
||||
|
||||
if (GetId() == 61243) // No fly zone - Parachute
|
||||
{
|
||||
float x, y, z;
|
||||
caster->GetPosition(x, y, z);
|
||||
float ground_Z = caster->GetMap()->GetVmapHeight(x, y, z, true);
|
||||
if (fabs(ground_Z - z) < 0.1f)
|
||||
{
|
||||
m_target->RemoveAura(GetId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
data.Initialize(SMSG_MOVE_FEATHER_FALL, 8+4);
|
||||
}
|
||||
else
|
||||
data.Initialize(SMSG_MOVE_NORMAL_FALL, 8+4);
|
||||
data.append(m_target->GetPackGUID());
|
||||
@@ -4777,6 +4754,16 @@ void AuraEffect::HandlePeriodicTriggerSpell(bool apply, bool Real, bool /*change
|
||||
void AuraEffect::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real, bool /*changeAmount*/)
|
||||
{
|
||||
m_isPeriodic = apply;
|
||||
|
||||
SpellEntry const* spell = GetSpellProto();
|
||||
switch (spell->Id)
|
||||
{
|
||||
case 58730: // No fly zone - Wintergrasp (3.1.3 only 3.2.2 Does not call this aura)
|
||||
if (apply)
|
||||
if (m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player *)m_target)->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePeriodicEnergize(bool apply, bool Real, bool changeAmount)
|
||||
@@ -4802,15 +4789,22 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
{
|
||||
if(spell->Id == 62399) // Overload Circuit
|
||||
switch(spell->Id)
|
||||
{
|
||||
if(m_target->GetMap()->IsDungeon())
|
||||
if(m_target->GetAuras().count(62399) >= (((InstanceMap*)m_target->GetMap())->GetDifficulty() == REGULAR_DIFFICULTY ? 2 : 4))
|
||||
case 62399: // Overload Circuit
|
||||
if(m_target->GetMap()->IsDungeon() && m_target->GetAuras().count(62399) >= (m_target->GetMap()->IsHeroic() ? 4 : 2))
|
||||
{
|
||||
m_target->CastSpell(m_target, 62475, true); // System Shutdown
|
||||
if(Unit *veh = m_target->GetVehicleBase())
|
||||
veh->CastSpell(m_target, 62475, true);
|
||||
}
|
||||
break;
|
||||
case 58600: // No fly zone - Dalaran
|
||||
if (apply && m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player *)m_target)->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -6695,6 +6689,24 @@ void AuraEffect::PeriodicDummyTick()
|
||||
// 7053 Forsaken Skill: Shadow
|
||||
return;
|
||||
}
|
||||
case 45472: // Parachute
|
||||
if (m_target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player *plr = (Player*)m_target;
|
||||
if (plr->IsFalling())
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(45472);
|
||||
plr->CastSpell(plr, 44795, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 58600: // No fly Zone - Dalaran
|
||||
if (10 == m_tickNumber)
|
||||
{
|
||||
m_target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
m_target->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
}
|
||||
break;
|
||||
case 58549: // Tenacity
|
||||
case 59911: // Tenacity (vehicle)
|
||||
GetParentAura()->RefreshAura();
|
||||
|
||||
@@ -3044,6 +3044,21 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
return !player->HasAura(-auraSpell);
|
||||
}
|
||||
|
||||
// Extra conditions
|
||||
switch(spellId)
|
||||
{
|
||||
case 58600: // No fly Zone - Dalaran (Krasus Landing exception)
|
||||
if (!player || player->GetAreaId() == 4564 || !player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY)
|
||||
|| player->HasAura(44795))
|
||||
return false;
|
||||
break;
|
||||
case 58730: // No fly Zone - Wintergrasp
|
||||
if (!player || !player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY)
|
||||
|| player->HasAura(45472) || player->HasAura(44795))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user