Implement No Fly Zone using Spell, by Spp. Needs db support. Closes #494
--HG-- branch : trunk
This commit is contained in:
@@ -187,8 +187,6 @@ SET(game_STAT_SRCS
|
||||
OutdoorPvPMgr.h
|
||||
OutdoorPvPNA.cpp
|
||||
OutdoorPvPNA.h
|
||||
OutdoorPvPNR.cpp
|
||||
OutdoorPvPNR.h
|
||||
OutdoorPvPSI.cpp
|
||||
OutdoorPvPSI.h
|
||||
OutdoorPvPTF.cpp
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "OutdoorPvPHP.h"
|
||||
#include "OutdoorPvPNA.h"
|
||||
#include "OutdoorPvPNR.h"
|
||||
#include "OutdoorPvPTF.h"
|
||||
#include "OutdoorPvPZM.h"
|
||||
#include "OutdoorPvPSI.h"
|
||||
@@ -138,19 +137,6 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
m_OutdoorPvPSet.push_back(pOP);
|
||||
sLog.outDebug("OutdoorPvP : Wintergrasp successfully initiated.");
|
||||
}
|
||||
|
||||
pOP = new OutdoorPvPNR;
|
||||
// respawn, init variables
|
||||
if(!pOP->SetupOutdoorPvP())
|
||||
{
|
||||
sLog.outDebug("OutdoorPvP : NR init failed.");
|
||||
delete pOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OutdoorPvPSet.push_back(pOP);
|
||||
sLog.outDebug("OutdoorPvP : NR successfully initiated.");
|
||||
}
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP *handle)
|
||||
|
||||
+2
-2
@@ -6762,7 +6762,7 @@ void Player::DuelComplete(DuelCompleteType type)
|
||||
duel->opponent->AttackStop();
|
||||
}
|
||||
break;
|
||||
case DUEL_WON:
|
||||
case DUEL_WON:
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
|
||||
if (duel->opponent)
|
||||
{
|
||||
@@ -21177,7 +21177,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*/ )
|
||||
|
||||
@@ -968,6 +968,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||
|
||||
bool IsInWater() const { return m_isInWater; }
|
||||
bool IsUnderWater() const;
|
||||
bool IsFalling() { return GetPositionZ() < m_lastFallZ; }
|
||||
|
||||
void SendInitialPacketsBeforeAddToMap();
|
||||
void SendInitialPacketsAfterAddToMap();
|
||||
|
||||
@@ -5094,6 +5094,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;
|
||||
}
|
||||
|
||||
+43
-33
@@ -3347,30 +3347,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());
|
||||
@@ -4633,6 +4610,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 (Player *plr = (Player*)m_target)
|
||||
plr->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::HandlePeriodicEnergize(bool apply, bool Real, bool changeAmount)
|
||||
@@ -4654,22 +4641,36 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
SpellEntry const*spell = GetSpellProto();
|
||||
switch( spell->SpellFamilyName)
|
||||
switch(spell->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_GENERIC:
|
||||
{
|
||||
if(spell->Id == 62399) // Overload Circuit
|
||||
switch(spell->Id)
|
||||
{
|
||||
if(m_target->GetMap()->IsDungeon())
|
||||
if(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);
|
||||
}
|
||||
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 (Player *plr = (Player*)m_target)
|
||||
if (apply)
|
||||
plr->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
||||
else
|
||||
{
|
||||
plr->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
plr->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
{
|
||||
switch (spell->Id)
|
||||
@@ -4682,11 +4683,12 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
|
||||
// to prevent remove GO added by new spell
|
||||
// old one is already removed
|
||||
if (GetParentAura()->GetRemoveMode()!=AURA_REMOVE_BY_STACK)
|
||||
m_target->RemoveGameObject(spell->Id,true);
|
||||
m_target->RemoveGameObject(spell->Id, true);
|
||||
m_target->RemoveAura(62388);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
{
|
||||
@@ -6538,6 +6540,14 @@ void AuraEffect::PeriodicDummyTick()
|
||||
// 7053 Forsaken Skill: Shadow
|
||||
return;
|
||||
}
|
||||
case 45472: // Parachute
|
||||
if (Player *plr = (Player*)m_target)
|
||||
if (plr->IsFalling())
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(45472);
|
||||
plr->CastSpell(plr, 44795, true);
|
||||
}
|
||||
break;
|
||||
case 58549: // Tenacity
|
||||
case 59911: // Tenacity (vehicle)
|
||||
GetParentAura()->RefreshAura();
|
||||
|
||||
@@ -1338,6 +1338,13 @@ void Spell::EffectDummy(uint32 i)
|
||||
case 58418: // Portal to Orgrimmar
|
||||
case 58420: // Portal to Stormwind
|
||||
return; // implemented in EffectScript[0]
|
||||
case 58601:
|
||||
if (Player *plr = (Player*)unitTarget)
|
||||
{
|
||||
plr->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
|
||||
plr->RemoveAurasByType(SPELL_AURA_FLY);
|
||||
}
|
||||
break;
|
||||
case 59640: // Underbelly Elixir
|
||||
{
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
|
||||
@@ -3045,6 +3045,12 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
||||
if (!player || player->GetTeamId() != sWorld.getState(WORLDSTATE_WINTERGRASP_CONTROLING_FACTION))
|
||||
return false;
|
||||
break;
|
||||
case 58600: // No fly Zone - Dalaran
|
||||
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;
|
||||
|
||||
@@ -1052,15 +1052,6 @@ void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
||||
if (!sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_ENABLED))
|
||||
return;
|
||||
|
||||
// No fly zone or parachute
|
||||
if (!plr->HasAura(SPELL_NOFLYZONE_WG) && !plr->HasAura(SPELL_PARACHUTE_WG) &&
|
||||
(plr->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || plr->HasAuraType(SPELL_AURA_FLY)))
|
||||
{
|
||||
plr->CastSpell(plr, SPELL_NOFLYZONE_WG, true);
|
||||
ChatHandler(plr).PSendSysMessage(LANG_ZONE_NOFLYZONE);
|
||||
plr->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
|
||||
}
|
||||
|
||||
if (isWarTime())
|
||||
{
|
||||
if (plr->getLevel() > 69)
|
||||
@@ -1139,7 +1130,6 @@ void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||
plr->RemoveAurasDueToSpell(SPELL_TENACITY);
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
UpdateTenacityStack();
|
||||
plr->RemoveAura(SPELL_NOFLYZONE_WG);
|
||||
}
|
||||
|
||||
void OPvPWintergrasp::PromotePlayer(Player *killer) const
|
||||
|
||||
@@ -50,10 +50,6 @@ enum WintergraspSpell
|
||||
SPELL_DAMAGED_BUILDING = 59201,
|
||||
SPELL_INTACT_BUILDING = 59203,
|
||||
|
||||
// other
|
||||
SPELL_NOFLYZONE_WG = 58730,
|
||||
SPELL_PARACHUTE_WG = 61243,
|
||||
|
||||
// SPELL_TELEPORT_DALARAN = 53360,
|
||||
// SPELL_VICTORY_AURA = 60044,
|
||||
};
|
||||
|
||||
@@ -1673,14 +1673,6 @@
|
||||
RelativePath="..\..\src\game\OutdoorPvPNA.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\OutdoorPvPNR.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\OutdoorPvPNR.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
|
||||
>
|
||||
|
||||
@@ -1674,14 +1674,6 @@
|
||||
RelativePath="..\..\src\game\OutdoorPvPNA.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\OutdoorPvPNR.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\OutdoorPvPNR.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\OutdoorPvPSI.cpp"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user