aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/CMakeLists.txt2
-rw-r--r--src/game/Language.h3
-rw-r--r--src/game/MovementHandler.cpp3
-rw-r--r--src/game/OutdoorPvP.h1
-rw-r--r--src/game/OutdoorPvPMgr.cpp14
-rw-r--r--src/game/OutdoorPvPNR.cpp49
-rw-r--r--src/game/OutdoorPvPNR.h37
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/Spell.cpp5
-rw-r--r--src/game/SpellAuras.cpp21
-rw-r--r--src/game/Wintergrasp.cpp9
-rw-r--r--src/game/Wintergrasp.h18
12 files changed, 154 insertions, 10 deletions
diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt
index f634c1c9f41..07f3d285b06 100644
--- a/src/game/CMakeLists.txt
+++ b/src/game/CMakeLists.txt
@@ -187,6 +187,8 @@ SET(game_STAT_SRCS
OutdoorPvPMgr.h
OutdoorPvPNA.cpp
OutdoorPvPNA.h
+ OutdoorPvPNR.cpp
+ OutdoorPvPNR.h
OutdoorPvPSI.cpp
OutdoorPvPSI.h
OutdoorPvPTF.cpp
diff --git a/src/game/Language.h b/src/game/Language.h
index 0a4b2b1f383..488b7a71c3b 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -734,7 +734,8 @@ enum TrinityStrings
LANG_GUILD_VETERAN = 813,
LANG_GUILD_MEMBER = 814,
LANG_GUILD_INITIATE = 815,
- // Room for in-game strings 816-999 not used
+ LANG_ZONE_NOFLYZONE = 816,
+ // Room for in-game strings 817-999 not used
// Level 4 (CLI only commands)
LANG_COMMAND_EXIT = 1000,
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp
index 02a41d43923..69583263015 100644
--- a/src/game/MovementHandler.cpp
+++ b/src/game/MovementHandler.cpp
@@ -307,7 +307,10 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight())
+ {
plMover->HandleFall(movementInfo);
+ _player->RemoveAurasByType(SPELL_AURA_FEATHER_FALL);
+ }
if (plMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plMover->IsInWater())
{
diff --git a/src/game/OutdoorPvP.h b/src/game/OutdoorPvP.h
index 0b9614144ae..99f97451728 100644
--- a/src/game/OutdoorPvP.h
+++ b/src/game/OutdoorPvP.h
@@ -34,6 +34,7 @@ enum OutdoorPvPTypes
OUTDOOR_PVP_SI,
OUTDOOR_PVP_EP,
OPVP_WINTERGRASP,
+ OUTDOOR_PVP_NR,
};
const uint8 CapturePointArtKit[3] = {2, 1, 21};
diff --git a/src/game/OutdoorPvPMgr.cpp b/src/game/OutdoorPvPMgr.cpp
index 4df07914b36..0145c0219e3 100644
--- a/src/game/OutdoorPvPMgr.cpp
+++ b/src/game/OutdoorPvPMgr.cpp
@@ -19,6 +19,7 @@
#include "OutdoorPvPMgr.h"
#include "OutdoorPvPHP.h"
#include "OutdoorPvPNA.h"
+#include "OutdoorPvPNR.h"
#include "OutdoorPvPTF.h"
#include "OutdoorPvPZM.h"
#include "OutdoorPvPSI.h"
@@ -137,6 +138,19 @@ 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)
diff --git a/src/game/OutdoorPvPNR.cpp b/src/game/OutdoorPvPNR.cpp
new file mode 100644
index 00000000000..4f16e407b29
--- /dev/null
+++ b/src/game/OutdoorPvPNR.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "OutdoorPvPNR.h"
+#include "Player.h"
+
+OutdoorPvPNR::OutdoorPvPNR()
+{
+ m_TypeId = OUTDOOR_PVP_NR;
+}
+
+bool OutdoorPvPNR::SetupOutdoorPvP()
+{
+ RegisterZone(4395);
+ return true;
+}
+
+void OutdoorPvPNR::HandlePlayerEnterZone(Player * plr, uint32 zone)
+{
+ if (!plr->HasAura(SPELL_NOFLYZONE) && !plr->HasAura(SPELL_PARACHUTE) &&
+ (plr->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || plr->HasAuraType(SPELL_AURA_FLY)))
+ {
+ plr->CastSpell(plr, SPELL_NOFLYZONE, true);
+ ChatHandler(plr).PSendSysMessage(LANG_ZONE_NOFLYZONE);
+ }
+ OutdoorPvP::HandlePlayerEnterZone(plr, zone);
+}
+
+void OutdoorPvPNR::HandlePlayerLeaveZone(Player *plr, uint32 zone)
+{
+ plr->RemoveAura(SPELL_NOFLYZONE);
+ OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
+}
+
diff --git a/src/game/OutdoorPvPNR.h b/src/game/OutdoorPvPNR.h
new file mode 100644
index 00000000000..fe56741b3cc
--- /dev/null
+++ b/src/game/OutdoorPvPNR.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef OUTDOOR_PVP_NR_
+#define OUTDOOR_PVP_NR_
+
+#include "OutdoorPvPImpl.h"
+#include "Chat.h"
+
+const uint32 SPELL_NOFLYZONE = 58600;
+const uint32 SPELL_PARACHUTE = 61243;
+
+class OutdoorPvPNR : public OutdoorPvP
+{
+public:
+ OutdoorPvPNR();
+ bool SetupOutdoorPvP();
+ void HandlePlayerEnterZone(Player *plr, uint32 zone);
+ void HandlePlayerLeaveZone(Player *plr, uint32 zone);
+};
+
+#endif
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index a1d82e22c8d..8f5ae3ac756 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -20972,7 +20972,7 @@ bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
{
// continent checked in SpellMgr::GetSpellAllowedInLocationError at cast and area update
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
- return v_map != 571 || HasSpell(54197) && zone != 4197 && zone != 4395; // Cold Weather Flying
+ return v_map != 571 || HasSpell(54197); // Cold Weather Flying
}
void Player::learnSpellHighRank(uint32 spellid)
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index adc84852de1..c9d84d2cb41 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -5184,7 +5184,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 (!((Player*)m_originalCaster)->IsKnowHowFlyIn(m_originalCaster->GetMapId(),m_originalCaster->GetZoneId()))
+ if (m_originalCaster->GetZoneId() == 4197 || m_originalCaster->GetZoneId() == 4395)
return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE;
}
break;
@@ -6796,4 +6797,4 @@ void Spell::FillRaidOrPartyHealthPriorityTargets( UnitList &TagUnitMap, Unit* ta
TagUnitMap.push_back(healthQueue.top().getUnit());
healthQueue.pop();
}
-} \ No newline at end of file
+}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index a7e1725216b..587dae3ed4c 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3334,7 +3334,28 @@ void AuraEffect::HandleAuraFeatherFall(bool apply, bool Real, bool /*changeAmoun
WorldPacket data;
if(apply)
+ {
+ Unit* caster = GetCaster();
+
+ 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->RemoveAurasByType(SPELL_AURA_FEATHER_FALL);
+ return;
+ }
+ }
data.Initialize(SMSG_MOVE_FEATHER_FALL, 8+4);
+ }
else
data.Initialize(SMSG_MOVE_NORMAL_FALL, 8+4);
data.append(m_target->GetPackGUID());
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 65fa5dccada..ec989a8123f 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -949,6 +949,14 @@ 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);
+ }
+
if (!isWarTime())
{
if (plr->GetTeamId() == getDefenderTeam())
@@ -1032,6 +1040,7 @@ void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
UpdateTenacityStack();
plr->RemoveAura(SPELL_ESSENCE_OF_WG);
+ plr->RemoveAura(SPELL_NOFLYZONE_WG);
}
void OPvPWintergrasp::PromotePlayer(Player *killer) const
diff --git a/src/game/Wintergrasp.h b/src/game/Wintergrasp.h
index 6a07bc48fb0..e15859f7c32 100644
--- a/src/game/Wintergrasp.h
+++ b/src/game/Wintergrasp.h
@@ -33,25 +33,31 @@ const uint32 ClockWorldState[5] = {3785,3784,3782,3976,3975};
enum WintergraspSpell
{
+ // Wartime auras
SPELL_RECRUIT = 37795,
SPELL_CORPORAL = 33280,
SPELL_LIEUTENANT = 55629,
-
SPELL_TENACITY = 58549,
SPELL_TENACITY_VEHICLE = 59911,
-
- SPELL_TELEPORT_DALARAN = 53360,
-
SPELL_TOWER_CONTROL = 62064,
- //SPELL_RULLERS_OF_WG = 52108,
+ SPELL_SPIRITUAL_IMMUNITY = 58729,
+
+ // Reward spells
SPELL_VICTORY_REWARD = 56902,
SPELL_DEFEAT_REWARD = 58494,
SPELL_DAMAGED_TOWER = 59135,
SPELL_DESTROYED_TOWER = 59136,
SPELL_DAMAGED_BUILDING = 59201,
SPELL_INTACT_BUILDING = 59203,
+
+ // No Wartime auras
SPELL_ESSENCE_OF_WG = 58045,
- SPELL_SPIRITUAL_IMMUNITY = 58729,
+
+ // other
+ SPELL_NOFLYZONE_WG = 58730,
+ SPELL_PARACHUTE_WG = 61243,
+
+// SPELL_TELEPORT_DALARAN = 53360,
// SPELL_VICTORY_AURA = 60044,
};