Big re-organization of repository [W.I.P]

This commit is contained in:
Yehonal
2016-08-11 20:25:27 +02:00
parent c62a72c0a8
commit 0f85ce1c54
3016 changed files with 1271 additions and 1 deletions

View File

@@ -1,31 +0,0 @@
# Copyright (C)
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
OutdoorPvP/OutdoorPvPTF.cpp
OutdoorPvP/OutdoorPvPSI.cpp
OutdoorPvP/OutdoorPvPSI.h
OutdoorPvP/OutdoorPvPZM.cpp
OutdoorPvP/OutdoorPvPNA.cpp
OutdoorPvP/OutdoorPvPHP.cpp
OutdoorPvP/OutdoorPvPTF.h
OutdoorPvP/OutdoorPvPEP.h
OutdoorPvP/OutdoorPvPEP.cpp
OutdoorPvP/OutdoorPvPHP.h
OutdoorPvP/OutdoorPvPZM.h
OutdoorPvP/OutdoorPvPNA.h
OutdoorPvP/OutdoorPvPGH.cpp
OutdoorPvP/OutdoorPvPGH.h
)
AC_ADD_SCRIPT_LOADER("OutdoorPvP" "ScriptLoader.h")
message(" -> Prepared: Outdoor PVP Zones")

View File

@@ -1,785 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPEP.h"
#include "WorldPacket.h"
#include "Player.h"
#include "GameObject.h"
#include "ObjectMgr.h"
#include "ObjectAccessor.h"
#include "OutdoorPvPMgr.h"
#include "Creature.h"
#include "Language.h"
#include "World.h"
#include "GossipDef.h"
OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSideId(TEAM_NEUTRAL)
{
SetCapturePointData(EPCapturePoints[EP_EWT].entry, EPCapturePoints[EP_EWT].map, EPCapturePoints[EP_EWT].x, EPCapturePoints[EP_EWT].y, EPCapturePoints[EP_EWT].z, EPCapturePoints[EP_EWT].o, EPCapturePoints[EP_EWT].rot0, EPCapturePoints[EP_EWT].rot1, EPCapturePoints[EP_EWT].rot2, EPCapturePoints[EP_EWT].rot3);
AddObject(EP_EWT_FLAGS, EPTowerFlags[EP_EWT].entry, EPTowerFlags[EP_EWT].map, EPTowerFlags[EP_EWT].x, EPTowerFlags[EP_EWT].y, EPTowerFlags[EP_EWT].z, EPTowerFlags[EP_EWT].o, EPTowerFlags[EP_EWT].rot0, EPTowerFlags[EP_EWT].rot1, EPTowerFlags[EP_EWT].rot2, EPTowerFlags[EP_EWT].rot3);
}
void OPvPCapturePointEP_EWT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, TEAM_NEUTRAL);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, TEAM_NEUTRAL);
}
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
m_TowerState = EP_TS_A;
artkit = 2;
SummonSupportUnitAtNorthpassTower(TEAM_ALLIANCE);
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, TEAM_ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
artkit = 1;
SummonSupportUnitAtNorthpassTower(TEAM_HORDE);
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, TEAM_HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
m_TowerState = EP_TS_N;
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_TowerState = EP_TS_N_A;
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
m_TowerState = EP_TS_N_H;
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_EWT_FLAGS]);
if (flag)
{
flag->SetGoArtKit(artkit);
}
if (flag2)
{
flag2->SetGoArtKit(artkit);
}
UpdateTowerState();
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_EWT_CM, 0);
}
void OPvPCapturePointEP_EWT::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
// send this too, sometimes it resets :S
SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
}
void OPvPCapturePointEP_EWT::FillInitialWorldStates(WorldPacket &data)
{
data << EP_EWT_A << uint32(bool(m_TowerState & EP_TS_A));
data << EP_EWT_H << uint32(bool(m_TowerState & EP_TS_H));
data << EP_EWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
data << EP_EWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
data << EP_EWT_N << uint32(bool(m_TowerState & EP_TS_N));
}
void OPvPCapturePointEP_EWT::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(EP_EWT_A, bool(m_TowerState & EP_TS_A));
m_PvP->SendUpdateWorldState(EP_EWT_H, bool(m_TowerState & EP_TS_H));
m_PvP->SendUpdateWorldState(EP_EWT_N_A, bool(m_TowerState & EP_TS_N_A));
m_PvP->SendUpdateWorldState(EP_EWT_N_H, bool(m_TowerState & EP_TS_N_H));
m_PvP->SendUpdateWorldState(EP_EWT_N, bool(m_TowerState & EP_TS_N));
}
bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointEP_EWT::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OPvPCapturePointEP_EWT::SummonSupportUnitAtNorthpassTower(TeamId teamId)
{
if (m_UnitsSummonedSideId != teamId)
{
m_UnitsSummonedSideId = teamId;
const creature_type * ct = NULL;
if (teamId == TEAM_ALLIANCE)
ct=EP_EWT_Summons_A;
else
ct=EP_EWT_Summons_H;
for (uint8 i = 0; i < EP_EWT_NUM_CREATURES; ++i)
{
DelCreature(i);
AddCreature(i, ct[i].entry, ct[i].map, ct[i].x, ct[i].y, ct[i].z, ct[i].o, 1000000);
}
}
}
// NPT
OPvPCapturePointEP_NPT::OPvPCapturePointEP_NPT(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_SummonedGOSideId(TEAM_NEUTRAL)
{
SetCapturePointData(EPCapturePoints[EP_NPT].entry, EPCapturePoints[EP_NPT].map, EPCapturePoints[EP_NPT].x, EPCapturePoints[EP_NPT].y, EPCapturePoints[EP_NPT].z, EPCapturePoints[EP_NPT].o, EPCapturePoints[EP_NPT].rot0, EPCapturePoints[EP_NPT].rot1, EPCapturePoints[EP_NPT].rot2, EPCapturePoints[EP_NPT].rot3);
AddObject(EP_NPT_FLAGS, EPTowerFlags[EP_NPT].entry, EPTowerFlags[EP_NPT].map, EPTowerFlags[EP_NPT].x, EPTowerFlags[EP_NPT].y, EPTowerFlags[EP_NPT].z, EPTowerFlags[EP_NPT].o, EPTowerFlags[EP_NPT].rot0, EPTowerFlags[EP_NPT].rot1, EPTowerFlags[EP_NPT].rot2, EPTowerFlags[EP_NPT].rot3);
}
void OPvPCapturePointEP_NPT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, TEAM_NEUTRAL);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, TEAM_NEUTRAL);
}
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
m_TowerState = EP_TS_A;
artkit = 2;
SummonGO(TEAM_ALLIANCE);
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, TEAM_ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
artkit = 1;
SummonGO(TEAM_HORDE);
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, TEAM_HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
m_TowerState = EP_TS_N;
m_SummonedGOSideId = TEAM_NEUTRAL;
DelObject(EP_NPT_BUFF);
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
m_TowerState = EP_TS_N_A;
break;
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_TowerState = EP_TS_N_A;
m_SummonedGOSideId = TEAM_NEUTRAL;
DelObject(EP_NPT_BUFF);
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
m_TowerState = EP_TS_N_H;
break;
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
m_TowerState = EP_TS_N_H;
m_SummonedGOSideId = TEAM_NEUTRAL;
DelObject(EP_NPT_BUFF);
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_FLAGS]);
if (flag)
{
flag->SetGoArtKit(artkit);
}
if (flag2)
{
flag2->SetGoArtKit(artkit);
}
UpdateTowerState();
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_NPT_CM, 0);
}
void OPvPCapturePointEP_NPT::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
// send this too, sometimes it resets :S
SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
}
void OPvPCapturePointEP_NPT::FillInitialWorldStates(WorldPacket &data)
{
data << EP_NPT_A << uint32(bool(m_TowerState & EP_TS_A));
data << EP_NPT_H << uint32(bool(m_TowerState & EP_TS_H));
data << EP_NPT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
data << EP_NPT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
data << EP_NPT_N << uint32(bool(m_TowerState & EP_TS_N));
}
void OPvPCapturePointEP_NPT::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(EP_NPT_A, bool(m_TowerState & EP_TS_A));
m_PvP->SendUpdateWorldState(EP_NPT_H, bool(m_TowerState & EP_TS_H));
m_PvP->SendUpdateWorldState(EP_NPT_N_A, bool(m_TowerState & EP_TS_N_A));
m_PvP->SendUpdateWorldState(EP_NPT_N_H, bool(m_TowerState & EP_TS_N_H));
m_PvP->SendUpdateWorldState(EP_NPT_N, bool(m_TowerState & EP_TS_N));
}
bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointEP_NPT::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OPvPCapturePointEP_NPT::SummonGO(TeamId teamId)
{
if (m_SummonedGOSideId != teamId)
{
m_SummonedGOSideId = teamId;
DelObject(EP_NPT_BUFF);
AddObject(EP_NPT_BUFF, EP_NPT_LordaeronShrine.entry, EP_NPT_LordaeronShrine.map, EP_NPT_LordaeronShrine.x, EP_NPT_LordaeronShrine.y, EP_NPT_LordaeronShrine.z, EP_NPT_LordaeronShrine.o, EP_NPT_LordaeronShrine.rot0, EP_NPT_LordaeronShrine.rot1, EP_NPT_LordaeronShrine.rot2, EP_NPT_LordaeronShrine.rot3);
GameObject* go = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_BUFF]);
if (go)
go->SetUInt32Value(GAMEOBJECT_FACTION, (teamId == TEAM_ALLIANCE ? 84 : 83));
}
}
// CGT
OPvPCapturePointEP_CGT::OPvPCapturePointEP_CGT(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_GraveyardSide(TEAM_NEUTRAL)
{
SetCapturePointData(EPCapturePoints[EP_CGT].entry, EPCapturePoints[EP_CGT].map, EPCapturePoints[EP_CGT].x, EPCapturePoints[EP_CGT].y, EPCapturePoints[EP_CGT].z, EPCapturePoints[EP_CGT].o, EPCapturePoints[EP_CGT].rot0, EPCapturePoints[EP_CGT].rot1, EPCapturePoints[EP_CGT].rot2, EPCapturePoints[EP_CGT].rot3);
AddObject(EP_CGT_FLAGS, EPTowerFlags[EP_CGT].entry, EPTowerFlags[EP_CGT].map, EPTowerFlags[EP_CGT].x, EPTowerFlags[EP_CGT].y, EPTowerFlags[EP_CGT].z, EPTowerFlags[EP_CGT].o, EPTowerFlags[EP_CGT].rot0, EPTowerFlags[EP_CGT].rot1, EPTowerFlags[EP_CGT].rot2, EPTowerFlags[EP_CGT].rot3);
}
void OPvPCapturePointEP_CGT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, TEAM_NEUTRAL);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, TEAM_NEUTRAL);
}
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
m_TowerState = EP_TS_A;
artkit = 2;
LinkGraveyard(TEAM_ALLIANCE);
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, TEAM_ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
artkit = 1;
LinkGraveyard(TEAM_HORDE);
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, TEAM_HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
m_TowerState = EP_TS_N;
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_TowerState = EP_TS_N_A;
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
m_TowerState = EP_TS_N_H;
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_CGT_FLAGS]);
if (flag)
{
flag->SetGoArtKit(artkit);
}
if (flag2)
{
flag2->SetGoArtKit(artkit);
}
UpdateTowerState();
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_CGT_CM, 0);
}
void OPvPCapturePointEP_CGT::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
// send this too, sometimes it resets :S
SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
}
void OPvPCapturePointEP_CGT::FillInitialWorldStates(WorldPacket &data)
{
data << EP_CGT_A << uint32(bool(m_TowerState & EP_TS_A));
data << EP_CGT_H << uint32(bool(m_TowerState & EP_TS_H));
data << EP_CGT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
data << EP_CGT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
data << EP_CGT_N << uint32(bool(m_TowerState & EP_TS_N));
}
void OPvPCapturePointEP_CGT::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(EP_CGT_A, bool(m_TowerState & EP_TS_A));
m_PvP->SendUpdateWorldState(EP_CGT_H, bool(m_TowerState & EP_TS_H));
m_PvP->SendUpdateWorldState(EP_CGT_N_A, bool(m_TowerState & EP_TS_N_A));
m_PvP->SendUpdateWorldState(EP_CGT_N_H, bool(m_TowerState & EP_TS_N_H));
m_PvP->SendUpdateWorldState(EP_CGT_N, bool(m_TowerState & EP_TS_N));
}
bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointEP_CGT::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OPvPCapturePointEP_CGT::LinkGraveyard(TeamId teamId)
{
if (m_GraveyardSide != teamId)
{
sObjectMgr->RemoveGraveyardLink(EP_GraveYardId, EP_GraveYardZone, m_GraveyardSide, false);
sObjectMgr->AddGraveyardLink(EP_GraveYardId, EP_GraveYardZone, teamId, false);
m_GraveyardSide = teamId;
}
}
// PWT
OPvPCapturePointEP_PWT::OPvPCapturePointEP_PWT(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp), m_FlightMasterSpawnedId(TEAM_NEUTRAL), m_TowerState(EP_TS_N)
{
SetCapturePointData(EPCapturePoints[EP_PWT].entry, EPCapturePoints[EP_PWT].map, EPCapturePoints[EP_PWT].x, EPCapturePoints[EP_PWT].y, EPCapturePoints[EP_PWT].z, EPCapturePoints[EP_PWT].o, EPCapturePoints[EP_PWT].rot0, EPCapturePoints[EP_PWT].rot1, EPCapturePoints[EP_PWT].rot2, EPCapturePoints[EP_PWT].rot3);
AddObject(EP_PWT_FLAGS, EPTowerFlags[EP_PWT].entry, EPTowerFlags[EP_PWT].map, EPTowerFlags[EP_PWT].x, EPTowerFlags[EP_PWT].y, EPTowerFlags[EP_PWT].z, EPTowerFlags[EP_PWT].o, EPTowerFlags[EP_PWT].rot0, EPTowerFlags[EP_PWT].rot1, EPTowerFlags[EP_PWT].rot2, EPTowerFlags[EP_PWT].rot3);
}
void OPvPCapturePointEP_PWT::ChangeState()
{
// if changing from controlling alliance to horde or vice versa
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, TEAM_NEUTRAL);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H));
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, TEAM_NEUTRAL);
}
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
m_TowerState = EP_TS_A;
SummonFlightMaster(TEAM_ALLIANCE);
artkit = 2;
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, TEAM_ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
SummonFlightMaster(TEAM_HORDE);
artkit = 1;
((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, TEAM_HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
m_TowerState = EP_TS_N;
DelCreature(EP_PWT_FLIGHTMASTER);
m_FlightMasterSpawnedId = TEAM_NEUTRAL;
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
m_TowerState = EP_TS_N_A;
break;
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_TowerState = EP_TS_N_A;
DelCreature(EP_PWT_FLIGHTMASTER);
m_FlightMasterSpawnedId = TEAM_NEUTRAL;
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
m_TowerState = EP_TS_N_H;
break;
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
m_TowerState = EP_TS_N_H;
DelCreature(EP_PWT_FLIGHTMASTER);
m_FlightMasterSpawnedId = TEAM_NEUTRAL;
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_PWT_FLAGS]);
if (flag)
{
flag->SetGoArtKit(artkit);
}
if (flag2)
{
flag2->SetGoArtKit(artkit);
}
UpdateTowerState();
// complete quest objective
if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
SendObjectiveComplete(EP_PWT_CM, 0);
}
void OPvPCapturePointEP_PWT::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
// send this too, sometimes it resets :S
SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
}
void OPvPCapturePointEP_PWT::FillInitialWorldStates(WorldPacket &data)
{
data << EP_PWT_A << uint32(bool(m_TowerState & EP_TS_A));
data << EP_PWT_H << uint32(bool(m_TowerState & EP_TS_H));
data << EP_PWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
data << EP_PWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
data << EP_PWT_N << uint32(bool(m_TowerState & EP_TS_N));
}
void OPvPCapturePointEP_PWT::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(EP_PWT_A, bool(m_TowerState & EP_TS_A));
m_PvP->SendUpdateWorldState(EP_PWT_H, bool(m_TowerState & EP_TS_H));
m_PvP->SendUpdateWorldState(EP_PWT_N_A, bool(m_TowerState & EP_TS_N_A));
m_PvP->SendUpdateWorldState(EP_PWT_N_H, bool(m_TowerState & EP_TS_N_H));
m_PvP->SendUpdateWorldState(EP_PWT_N, bool(m_TowerState & EP_TS_N));
}
bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OPvPCapturePointEP_PWT::SummonFlightMaster(TeamId teamId)
{
if (m_FlightMasterSpawnedId != teamId)
{
m_FlightMasterSpawnedId = teamId;
DelCreature(EP_PWT_FLIGHTMASTER);
AddCreature(EP_PWT_FLIGHTMASTER, EP_PWT_FlightMaster.entry, EP_PWT_FlightMaster.map, EP_PWT_FlightMaster.x, EP_PWT_FlightMaster.y, EP_PWT_FlightMaster.z, EP_PWT_FlightMaster.o);
/*
// sky - we need update gso code
Creature* c = HashMapHolder<Creature>::Find(m_Creatures[EP_PWT_FLIGHTMASTER]);
//Spawn flight master as friendly to capturing team
c->SetUInt32Value(GAMEOBJECT_FACTION, (teamId == TEAM_ALLIANCE ? 55 : 68));
if (c)
{
GossipOption gso;
gso.Action = GOSSIP_OPTION_OUTDOORPVP;
gso.GossipId = 0;
gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT));
gso.Id = 50;
gso.Icon = 0;
gso.NpcFlag = 0;
gso.BoxMoney = 0;
gso.Coded = false;
c->addGossipOption(gso);
gso.Action = GOSSIP_OPTION_OUTDOORPVP;
gso.GossipId = 0;
gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT));
gso.Id = 50;
gso.Icon = 0;
gso.NpcFlag = 0;
gso.BoxMoney = 0;
gso.Coded = false;
c->addGossipOption(gso);
gso.Action = GOSSIP_OPTION_OUTDOORPVP;
gso.GossipId = 0;
gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT));
gso.Id = 50;
gso.Icon = 0;
gso.NpcFlag = 0;
gso.BoxMoney = 0;
gso.Coded = false;
c->addGossipOption(gso);
}
*/
}
}
// ep
OutdoorPvPEP::OutdoorPvPEP()
{
m_TypeId = OUTDOOR_PVP_EP;
memset(EP_ControlsId, TEAM_NEUTRAL, sizeof(EP_ControlsId));
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
}
bool OutdoorPvPEP::SetupOutdoorPvP()
{
for (uint8 i = 0; i < EPBuffZonesNum; ++i)
RegisterZone(EPBuffZones[i]);
AddCapturePoint(new OPvPCapturePointEP_EWT(this));
AddCapturePoint(new OPvPCapturePointEP_PWT(this));
AddCapturePoint(new OPvPCapturePointEP_CGT(this));
AddCapturePoint(new OPvPCapturePointEP_NPT(this));
return true;
}
bool OutdoorPvPEP::Update(uint32 diff)
{
if (OutdoorPvP::Update(diff))
{
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
for (int i = 0; i < EP_TOWER_NUM; ++i)
{
if (EP_ControlsId[i] == TEAM_ALLIANCE)
++m_AllianceTowersControlled;
else if (EP_ControlsId[i] == TEAM_HORDE)
++m_HordeTowersControlled;
SendUpdateWorldState(EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
SendUpdateWorldState(EP_UI_TOWER_COUNT_H, m_HordeTowersControlled);
BuffTeams();
}
return true;
}
return false;
}
void OutdoorPvPEP::HandlePlayerEnterZone(Player* player, uint32 zone)
{
// add buffs
if (player->GetTeamId() == TEAM_ALLIANCE)
{
if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
}
else
{
if (m_HordeTowersControlled && m_HordeTowersControlled < 5)
player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true);
}
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
void OutdoorPvPEP::HandlePlayerLeaveZone(Player* player, uint32 zone)
{
// remove buffs
if (player->GetTeamId() == TEAM_ALLIANCE)
{
for (int i = 0; i < 4; ++i)
player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
}
else
{
for (int i = 0; i < 4; ++i)
player->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
}
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
void OutdoorPvPEP::BuffTeams()
{
for (PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(*itr))
{
for (int i = 0; i < 4; ++i)
player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
}
}
for (PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(*itr))
{
for (int i = 0; i < 4; ++i)
player->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
if (m_HordeTowersControlled && m_HordeTowersControlled < 5)
player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true);
}
}
}
void OutdoorPvPEP::SetControlledState(uint32 index, TeamId teamId)
{
EP_ControlsId[index] = teamId;
}
void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data)
{
data << EP_UI_TOWER_COUNT_A << m_AllianceTowersControlled;
data << EP_UI_TOWER_COUNT_H << m_HordeTowersControlled;
data << EP_UI_TOWER_SLIDER_DISPLAY << uint32(0);
data << EP_UI_TOWER_SLIDER_POS << uint32(50);
data << EP_UI_TOWER_SLIDER_N << uint32(100);
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
{
itr->second->FillInitialWorldStates(data);
}
}
void OutdoorPvPEP::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(EP_UI_TOWER_COUNT_A, 0);
player->SendUpdateWorldState(EP_UI_TOWER_COUNT_H, 0);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, 0);
player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, 0);
player->SendUpdateWorldState(EP_EWT_A, 0);
player->SendUpdateWorldState(EP_EWT_H, 0);
player->SendUpdateWorldState(EP_EWT_N, 0);
player->SendUpdateWorldState(EP_EWT_N_A, 0);
player->SendUpdateWorldState(EP_EWT_N_H, 0);
player->SendUpdateWorldState(EP_PWT_A, 0);
player->SendUpdateWorldState(EP_PWT_H, 0);
player->SendUpdateWorldState(EP_PWT_N, 0);
player->SendUpdateWorldState(EP_PWT_N_A, 0);
player->SendUpdateWorldState(EP_PWT_N_H, 0);
player->SendUpdateWorldState(EP_NPT_A, 0);
player->SendUpdateWorldState(EP_NPT_H, 0);
player->SendUpdateWorldState(EP_NPT_N, 0);
player->SendUpdateWorldState(EP_NPT_N_A, 0);
player->SendUpdateWorldState(EP_NPT_N_H, 0);
player->SendUpdateWorldState(EP_CGT_A, 0);
player->SendUpdateWorldState(EP_CGT_H, 0);
player->SendUpdateWorldState(EP_CGT_N, 0);
player->SendUpdateWorldState(EP_CGT_N_A, 0);
player->SendUpdateWorldState(EP_CGT_N_H, 0);
}
class OutdoorPvP_eastern_plaguelands : public OutdoorPvPScript
{
public:
OutdoorPvP_eastern_plaguelands()
: OutdoorPvPScript("outdoorpvp_ep")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPEP();
}
};
void AddSC_outdoorpvp_ep()
{
new OutdoorPvP_eastern_plaguelands();
}

View File

@@ -1,331 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_EP_
#define OUTDOOR_PVP_EP_
#include "DBCStructure.h"
#include "OutdoorPvP.h"
const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386};
const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520};
const uint32 EP_GraveYardZone = 139;
const uint32 EP_GraveYardId = 927;
const uint8 EPBuffZonesNum = 3;
const uint32 EP_EWT_CM = 17690;
const uint32 EP_CGT_CM = 17689;
const uint32 EP_NPT_CM = 17696;
const uint32 EP_PWT_CM = 17698;
const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057};
enum EP_TaxiNodes
{
EP_CGT_Taxi = 87,
EP_EWT_Taxi = 86,
EP_NPT_Taxi = 85,
EP_PWT_Taxi = 84
};
enum EP_EastwallTowerWorldStates
{
EP_EWT_A = 2354,
EP_EWT_H = 2356,
EP_EWT_N_A = 2359, // ally conquested
EP_EWT_N_H = 2360,
EP_EWT_N = 2361
};
enum EP_NorthpassTowerWorldStates
{
EP_NPT_N = 2352,
EP_NPT_N_A = 2362,
EP_NPT_N_H = 2363,
EP_NPT_A = 2372,
EP_NPT_H = 2373
};
enum EP_PlagewoodTowerWorldStates
{
EP_PWT_N_A = 2366,
EP_PWT_N_H = 2353, //2367 not present! use neutral!
EP_PWT_A = 2370,
EP_PWT_H = 2371,
EP_PWT_N = 2353
};
enum EP_CrownGuardTowerWorldStates
{
EP_CGT_N_A = 2374,
EP_CGT_N_H = 2375,
EP_CGT_A = 2378,
EP_CGT_H = 2379,
EP_CGT_N = 2355
};
enum EP_WorldStates
{
EP_UI_TOWER_SLIDER_DISPLAY = 2426,
EP_UI_TOWER_SLIDER_POS = 2427,
EP_UI_TOWER_SLIDER_N = 2428,
EP_UI_TOWER_COUNT_A = 2327,
EP_UI_TOWER_COUNT_H = 2328
};
enum EP_Summons
{
EP_EWT_COMMANDER = 0,
EP_EWT_SOLDIER1,
EP_EWT_SOLDIER2,
EP_EWT_SOLDIER3,
EP_EWT_SOLDIER4,
EP_PWT_FLIGHTMASTER,
};
enum EP_GoSummons
{
EP_NPT_BUFF = 0,
EP_NPT_FLAGS,
EP_EWT_FLAGS,
EP_CGT_FLAGS,
EP_PWT_FLAGS
};
enum EP_Towers
{
EP_EWT = 0, // plaguelands 03
EP_NPT, // plaguelands 01
EP_PWT, // plaguelands 04
EP_CGT, // plaguelands 02
EP_TOWER_NUM
};
const go_type EPCapturePoints[EP_TOWER_NUM] =
{
{182097, 0, 2574.51f, -4794.89f, 144.704f, -1.45003f, -0.097056f, 0.095578f, -0.656229f, 0.742165f},
{181899, 0, 3181.08f, -4379.36f, 174.123f, -2.03472f, -0.065392f, 0.119494f, -0.842275f, 0.521553f},
{182098, 0, 2962.71f, -3042.31f, 154.789f, 2.08426f, -0.074807f, -0.113837f, 0.855928f, 0.49883f},
{182096, 0, 1860.85f, -3731.23f, 196.716f, -2.53214f, 0.033967f, -0.131914f, 0.944741f, -0.298177f}
};
const go_type EPTowerFlags[EP_TOWER_NUM] =
{
{182106, 0, 2569.60f, -4772.93f, 115.399f, 2.72271f, 0.0f, 0.0f, 0.978148f, 0.207912f},
{182106, 0, 3148.17f, -4365.51f, 145.029f, 1.53589f, 0.0f, 0.0f, 0.694658f, 0.71934f},
{182106, 0, 2992.63f, -3022.95f, 125.593f, 3.03687f, 0.0f, 0.0f, 0.99863f, 0.052336f},
{182106, 0, 1838.42f, -3703.56f, 167.713f, 0.890118f, 0.0f, 0.0f, 0.430511f, 0.902585f}
};
const uint32 EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691, 10699, 10701, 10705};
const uint32 EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692, 10698, 10700, 10704};
const uint8 EP_NUM_CREATURES = 6;
const uint8 EP_EWT_NUM_CREATURES = 5;
// one lordaeron commander, 4 soldiers
// should be spawned at EWT and follow a path, but trans-grid pathing isn't safe, so summon them directly at NPT
const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] =
{
{17635, 0, 3167.61f, -4352.09f, 138.20f, 4.5811f},
{17647, 0, 3172.74f, -4352.99f, 139.14f, 4.9873f},
{17647, 0, 3165.89f, -4354.46f, 138.67f, 3.7244f},
{17647, 0, 3164.65f, -4350.26f, 138.22f, 2.4794f},
{17647, 0, 3169.91f, -4349.68f, 138.37f, 0.7444f}
};
const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] =
{
{17995, 0, 3167.61f, -4352.09f, 138.20f, 4.5811f},
{17996, 0, 3172.74f, -4352.99f, 139.14f, 4.9873f},
{17996, 0, 3165.89f, -4354.46f, 138.67f, 3.7244f},
{17996, 0, 3164.65f, -4350.26f, 138.22f, 2.4794f},
{17996, 0, 3169.91f, -4349.68f, 138.37f, 0.7444f}
};
enum EP_TowerStates
{
EP_TS_N = 1,
EP_TS_N_A = 2,
EP_TS_N_H = 4,
EP_TS_A_P = 8,
EP_TS_H_P = 16,
EP_TS_A = 32,
EP_TS_H = 64
};
// when spawning, pay attention at setting the faction manually!
const creature_type EP_PWT_FlightMaster = {17209, 0, 2987.5f, -3049.11f, 120.126f, 5.75959f};
// after spawning, modify the faction so that only the controller will be able to use it with SetUInt32Value(GAMEOBJECT_FACTION, faction_id);
const go_type EP_NPT_LordaeronShrine = {181682, 0, 3167.72f, -4355.91f, 138.785f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f};
class OutdoorPvPEP;
class OPvPCapturePointEP_EWT : public OPvPCapturePoint
{
public:
OPvPCapturePointEP_EWT(OutdoorPvP* pvp);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
protected:
void SummonSupportUnitAtNorthpassTower(TeamId teamId);
void UpdateTowerState();
protected:
uint32 m_TowerState;
TeamId m_UnitsSummonedSideId;
};
class OPvPCapturePointEP_NPT : public OPvPCapturePoint
{
public:
OPvPCapturePointEP_NPT(OutdoorPvP* pvp);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
protected:
void SummonGO(TeamId teamId);
void UpdateTowerState();
protected:
uint32 m_TowerState;
TeamId m_SummonedGOSideId;
};
class OPvPCapturePointEP_CGT : public OPvPCapturePoint
{
public:
OPvPCapturePointEP_CGT(OutdoorPvP* pvp);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
protected:
void LinkGraveyard(TeamId teamId);
void UpdateTowerState();
protected:
uint32 m_TowerState;
TeamId m_GraveyardSide;
};
class OPvPCapturePointEP_PWT : public OPvPCapturePoint
{
public:
OPvPCapturePointEP_PWT(OutdoorPvP* pvp);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
protected:
void SummonFlightMaster(TeamId teamId);
void UpdateTowerState();
protected:
TeamId m_FlightMasterSpawnedId;
uint32 m_TowerState;
};
class OutdoorPvPEP : public OutdoorPvP
{
public:
OutdoorPvPEP();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
void BuffTeams();
void SetControlledState(uint32 index, TeamId teamId);
private:
// how many towers are controlled
TeamId EP_ControlsId[EP_TOWER_NUM];
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
};
#endif

View File

@@ -1,133 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPGH.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "WorldPacket.h"
#include "Language.h"
#include "World.h"
#include "GameEventMgr.h"
OutdoorPvPGH::OutdoorPvPGH()
{
m_TypeId = OUTDOOR_PVP_GH;
}
bool OutdoorPvPGH::SetupOutdoorPvP()
{
RegisterZone(GH_ZONE);
if (m_obj = new OPvPCapturePointGH(this))
{
AddCapturePoint(m_obj);
return true;
}
return false;
}
void OutdoorPvPGH::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 0);
player->SendUpdateWorldState(GH_UI_SLIDER_POS, 0);
player->SendUpdateWorldState(GH_UI_SLIDER_N, 0);
}
OPvPCapturePointGH::OPvPCapturePointGH(OutdoorPvP* pvp) : OPvPCapturePoint(pvp)
{
SetCapturePointData(189310, 571, 2483.68f, -1873.6f, 10.6877f, -0.104719f, 0.0f, 0.0f, 0.0f, 1.0f);
}
void OPvPCapturePointGH::FillInitialWorldStates(WorldPacket &data)
{
data << GH_UI_SLIDER_DISPLAY << uint32(0);
data << GH_UI_SLIDER_POS << uint32(50);
data << GH_UI_SLIDER_N << uint32(20);
}
void OPvPCapturePointGH::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(GH_UI_SLIDER_POS, phase);
SendUpdateWorldState(GH_UI_SLIDER_N, m_neutralValuePct);
}
bool OPvPCapturePointGH::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(GH_UI_SLIDER_POS, phase);
player->SendUpdateWorldState(GH_UI_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointGH::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(GH_UI_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OPvPCapturePointGH::ChangeState()
{
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
sGameEventMgr->StopEvent(GH_ALLIANCE_DEFENSE_EVENT);
sGameEventMgr->StopEvent(GH_HORDE_DEFENSE_EVENT);
sGameEventMgr->StartEvent(GH_ALLIANCE_DEFENSE_EVENT);
artkit = 2;
break;
case OBJECTIVESTATE_HORDE:
sGameEventMgr->StopEvent(GH_ALLIANCE_DEFENSE_EVENT);
sGameEventMgr->StopEvent(GH_HORDE_DEFENSE_EVENT);
sGameEventMgr->StartEvent(GH_HORDE_DEFENSE_EVENT);
artkit = 1;
break;
}
if (GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID))
flag->SetGoArtKit(artkit);
}
class OutdoorPvP_grizzly_hills : public OutdoorPvPScript
{
public:
OutdoorPvP_grizzly_hills()
: OutdoorPvPScript("outdoorpvp_gh")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPGH();
}
};
void AddSC_outdoorpvp_gh()
{
new OutdoorPvP_grizzly_hills();
}

View File

@@ -1,64 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_GH_
#define OUTDOOR_PVP_GH_
#include "OutdoorPvP.h"
enum OutdoorPvPGHenum
{
GH_ALLIANCE_DEFENSE_EVENT = 65,
GH_HORDE_DEFENSE_EVENT = 66,
GH_ZONE = 394,
GH_UI_SLIDER_DISPLAY = 3466,
GH_UI_SLIDER_POS = 3467,
GH_UI_SLIDER_N = 3468,
};
class Unit;
class Creature;
class OPvPCapturePointGH;
class OutdoorPvPGH : public OutdoorPvP
{
public:
OutdoorPvPGH();
bool SetupOutdoorPvP();
void SendRemoveWorldStates(Player* player);
private:
OPvPCapturePointGH* m_obj;
};
class OPvPCapturePointGH : public OPvPCapturePoint
{
public:
OPvPCapturePointGH(OutdoorPvP* pvp);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
};
#endif

View File

@@ -1,380 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPHP.h"
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
#include "Player.h"
#include "WorldPacket.h"
#include "World.h"
#include "ObjectMgr.h"
#include "Language.h"
const uint32 HP_LANG_LOSE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_LOSE_BROKENHILL_A, LANG_OPVP_HP_LOSE_OVERLOOK_A, LANG_OPVP_HP_LOSE_STADIUM_A};
const uint32 HP_LANG_LOSE_H[HP_TOWER_NUM] = {LANG_OPVP_HP_LOSE_BROKENHILL_H, LANG_OPVP_HP_LOSE_OVERLOOK_H, LANG_OPVP_HP_LOSE_STADIUM_H};
const uint32 HP_LANG_CAPTURE_A[HP_TOWER_NUM] = {LANG_OPVP_HP_CAPTURE_BROKENHILL_A, LANG_OPVP_HP_CAPTURE_OVERLOOK_A, LANG_OPVP_HP_CAPTURE_STADIUM_A};
const uint32 HP_LANG_CAPTURE_H[HP_TOWER_NUM] = {LANG_OPVP_HP_CAPTURE_BROKENHILL_H, LANG_OPVP_HP_CAPTURE_OVERLOOK_H, LANG_OPVP_HP_CAPTURE_STADIUM_H};
OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type)
: OPvPCapturePoint(pvp), m_TowerType(type)
{
SetCapturePointData(HPCapturePoints[type].entry,
HPCapturePoints[type].map,
HPCapturePoints[type].x,
HPCapturePoints[type].y,
HPCapturePoints[type].z,
HPCapturePoints[type].o,
HPCapturePoints[type].rot0,
HPCapturePoints[type].rot1,
HPCapturePoints[type].rot2,
HPCapturePoints[type].rot3);
AddObject(type,
HPTowerFlags[type].entry,
HPTowerFlags[type].map,
HPTowerFlags[type].x,
HPTowerFlags[type].y,
HPTowerFlags[type].z,
HPTowerFlags[type].o,
HPTowerFlags[type].rot0,
HPTowerFlags[type].rot1,
HPTowerFlags[type].rot2,
HPTowerFlags[type].rot3);
}
OutdoorPvPHP::OutdoorPvPHP()
{
m_TypeId = OUTDOOR_PVP_HP;
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
}
bool OutdoorPvPHP::SetupOutdoorPvP()
{
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
// add the zones affected by the pvp buff
for (int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
RegisterZone(OutdoorPvPHPBuffZones[i]);
AddCapturePoint(new OPvPCapturePointHP(this, HP_TOWER_BROKEN_HILL));
AddCapturePoint(new OPvPCapturePointHP(this, HP_TOWER_OVERLOOK));
AddCapturePoint(new OPvPCapturePointHP(this, HP_TOWER_STADIUM));
return true;
}
void OutdoorPvPHP::HandlePlayerEnterZone(Player* player, uint32 zone)
{
// add buffs
if (player->GetTeamId() == TEAM_ALLIANCE)
{
if (m_AllianceTowersControlled >=3)
player->CastSpell(player, AllianceBuff, true);
}
else
{
if (m_HordeTowersControlled >=3)
player->CastSpell(player, HordeBuff, true);
}
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
void OutdoorPvPHP::HandlePlayerLeaveZone(Player* player, uint32 zone)
{
// remove buffs
if (player->GetTeamId() == TEAM_ALLIANCE)
{
player->RemoveAurasDueToSpell(AllianceBuff);
}
else
{
player->RemoveAurasDueToSpell(HordeBuff);
}
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
bool OutdoorPvPHP::Update(uint32 diff)
{
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == 3)
TeamApplyBuff(TEAM_ALLIANCE, AllianceBuff, HordeBuff);
else if (m_HordeTowersControlled == 3)
TeamApplyBuff(TEAM_HORDE, HordeBuff, AllianceBuff);
else
{
TeamCastSpell(TEAM_ALLIANCE, -AllianceBuff);
TeamCastSpell(TEAM_HORDE, -HordeBuff);
}
SendUpdateWorldState(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
SendUpdateWorldState(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled);
}
return changed;
}
void OutdoorPvPHP::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_A, 0);
player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_H, 0);
player->SendUpdateWorldState(HP_UI_TOWER_COUNT_H, 0);
player->SendUpdateWorldState(HP_UI_TOWER_COUNT_A, 0);
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, 0);
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, 0);
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
for (int i = 0; i < HP_TOWER_NUM; ++i)
{
player->SendUpdateWorldState(HP_MAP_N[i], 0);
player->SendUpdateWorldState(HP_MAP_A[i], 0);
player->SendUpdateWorldState(HP_MAP_H[i], 0);
}
}
void OutdoorPvPHP::FillInitialWorldStates(WorldPacket &data)
{
data << uint32(HP_UI_TOWER_DISPLAY_A) << uint32(1);
data << uint32(HP_UI_TOWER_DISPLAY_H) << uint32(1);
data << uint32(HP_UI_TOWER_COUNT_A) << uint32(m_AllianceTowersControlled);
data << uint32(HP_UI_TOWER_COUNT_H) << uint32(m_HordeTowersControlled);
data << uint32(HP_UI_TOWER_SLIDER_DISPLAY) << uint32(0);
data << uint32(HP_UI_TOWER_SLIDER_POS) << uint32(50);
data << uint32(HP_UI_TOWER_SLIDER_N) << uint32(100);
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
{
itr->second->FillInitialWorldStates(data);
}
}
void OPvPCapturePointHP::ChangeState()
{
uint32 field = 0;
switch (m_OldState)
{
case OBJECTIVESTATE_NEUTRAL:
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_ALLIANCE:
field = HP_MAP_A[m_TowerType];
if (uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled())
((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType]));
break;
case OBJECTIVESTATE_HORDE:
field = HP_MAP_H[m_TowerType];
if (uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled())
((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(--horde_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType]));
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
field = HP_MAP_A[m_TowerType];
break;
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
field = HP_MAP_H[m_TowerType];
break;
}
// send world state update
if (field)
{
m_PvP->SendUpdateWorldState(field, 0);
field = 0;
}
uint32 artkit = 21;
uint32 artkit2 = HP_TowerArtKit_N[m_TowerType];
switch (m_State)
{
case OBJECTIVESTATE_NEUTRAL:
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_ALLIANCE:
{
field = HP_MAP_A[m_TowerType];
artkit = 2;
artkit2 = HP_TowerArtKit_A[m_TowerType];
uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled();
if (alliance_towers < 3)
((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType]));
break;
}
case OBJECTIVESTATE_HORDE:
{
field = HP_MAP_H[m_TowerType];
artkit = 1;
artkit2 = HP_TowerArtKit_H[m_TowerType];
uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled();
if (horde_towers < 3)
((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(++horde_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType]));
break;
}
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
field = HP_MAP_A[m_TowerType];
artkit = 2;
artkit2 = HP_TowerArtKit_A[m_TowerType];
break;
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
field = HP_MAP_H[m_TowerType];
artkit = 1;
artkit2 = HP_TowerArtKit_H[m_TowerType];
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[m_TowerType]);
if (flag)
{
flag->SetGoArtKit(artkit);
}
if (flag2)
{
flag2->SetGoArtKit(artkit2);
}
// send world state update
if (field)
m_PvP->SendUpdateWorldState(field, 1);
// complete quest objective
if (m_State == OBJECTIVESTATE_ALLIANCE || m_State == OBJECTIVESTATE_HORDE)
SendObjectiveComplete(HP_CREDITMARKER[m_TowerType], 0);
}
void OPvPCapturePointHP::SendChangePhase()
{
SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, m_neutralValuePct);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase);
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1);
}
void OPvPCapturePointHP::FillInitialWorldStates(WorldPacket &data)
{
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
data << uint32(HP_MAP_N[m_TowerType]) << uint32(0);
data << uint32(HP_MAP_A[m_TowerType]) << uint32(1);
data << uint32(HP_MAP_H[m_TowerType]) << uint32(0);
break;
case OBJECTIVESTATE_HORDE:
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
data << uint32(HP_MAP_N[m_TowerType]) << uint32(0);
data << uint32(HP_MAP_A[m_TowerType]) << uint32(0);
data << uint32(HP_MAP_H[m_TowerType]) << uint32(1);
break;
case OBJECTIVESTATE_NEUTRAL:
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
default:
data << uint32(HP_MAP_N[m_TowerType]) << uint32(1);
data << uint32(HP_MAP_A[m_TowerType]) << uint32(0);
data << uint32(HP_MAP_H[m_TowerType]) << uint32(0);
break;
}
}
bool OPvPCapturePointHP::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointHP::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OutdoorPvPHP::HandleKillImpl(Player* player, Unit* killed)
{
if (killed->GetTypeId() != TYPEID_PLAYER)
return;
if (player->GetTeamId() == TEAM_ALLIANCE && killed->ToPlayer()->GetTeamId() != TEAM_ALLIANCE)
player->CastSpell(player, AlliancePlayerKillReward, true);
else if (player->GetTeamId() == TEAM_HORDE && killed->ToPlayer()->GetTeamId() != TEAM_HORDE)
player->CastSpell(player, HordePlayerKillReward, true);
}
uint32 OutdoorPvPHP::GetAllianceTowersControlled() const
{
return m_AllianceTowersControlled;
}
void OutdoorPvPHP::SetAllianceTowersControlled(uint32 count)
{
m_AllianceTowersControlled = count;
}
uint32 OutdoorPvPHP::GetHordeTowersControlled() const
{
return m_HordeTowersControlled;
}
void OutdoorPvPHP::SetHordeTowersControlled(uint32 count)
{
m_HordeTowersControlled = count;
}
class OutdoorPvP_hellfire_peninsula : public OutdoorPvPScript
{
public:
OutdoorPvP_hellfire_peninsula()
: OutdoorPvPScript("outdoorpvp_hp")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPHP();
}
};
void AddSC_outdoorpvp_hp()
{
new OutdoorPvP_hellfire_peninsula();
}

View File

@@ -1,141 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_HP_
#define OUTDOOR_PVP_HP_
#include "OutdoorPvP.h"
#define OutdoorPvPHPBuffZonesNum 6
// HP, citadel, ramparts, blood furnace, shattered halls, mag's lair
const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 };
enum OutdoorPvPHPSpells
{
AlliancePlayerKillReward = 32155,
HordePlayerKillReward = 32158,
AllianceBuff = 32071,
HordeBuff = 32049
};
enum OutdoorPvPHPTowerType
{
HP_TOWER_BROKEN_HILL = 0,
HP_TOWER_OVERLOOK = 1,
HP_TOWER_STADIUM = 2,
HP_TOWER_NUM = 3
};
const uint32 HP_CREDITMARKER[HP_TOWER_NUM] = {19032, 19028, 19029};
const uint32 HP_CapturePointEvent_Enter[HP_TOWER_NUM] = {11404, 11396, 11388};
const uint32 HP_CapturePointEvent_Leave[HP_TOWER_NUM] = {11403, 11395, 11387};
enum OutdoorPvPHPWorldStates
{
HP_UI_TOWER_DISPLAY_A = 0x9ba,
HP_UI_TOWER_DISPLAY_H = 0x9b9,
HP_UI_TOWER_COUNT_H = 0x9ae,
HP_UI_TOWER_COUNT_A = 0x9ac,
HP_UI_TOWER_SLIDER_N = 2475,
HP_UI_TOWER_SLIDER_POS = 2474,
HP_UI_TOWER_SLIDER_DISPLAY = 2473
};
const uint32 HP_MAP_N[HP_TOWER_NUM] = {0x9b5, 0x9b2, 0x9a8};
const uint32 HP_MAP_A[HP_TOWER_NUM] = {0x9b3, 0x9b0, 0x9a7};
const uint32 HP_MAP_H[HP_TOWER_NUM] = {0x9b4, 0x9b1, 0x9a6};
const uint32 HP_TowerArtKit_A[HP_TOWER_NUM] = {65, 62, 67};
const uint32 HP_TowerArtKit_H[HP_TOWER_NUM] = {64, 61, 68};
const uint32 HP_TowerArtKit_N[HP_TOWER_NUM] = {66, 63, 69};
const go_type HPCapturePoints[HP_TOWER_NUM] =
{
{182175, 530, -471.462f, 3451.09f, 34.6432f, 0.174533f, 0.0f, 0.0f, 0.087156f, 0.996195f}, // 0 - Broken Hill
{182174, 530, -184.889f, 3476.93f, 38.205f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f}, // 1 - Overlook
{182173, 530, -290.016f, 3702.42f, 56.6729f, 0.034907f, 0.0f, 0.0f, 0.017452f, 0.999848f} // 2 - Stadium
};
const go_type HPTowerFlags[HP_TOWER_NUM] =
{
{183514, 530, -467.078f, 3528.17f, 64.7121f, 3.14159f, 0.0f, 0.0f, 1.0f, 0.0f}, // 0 broken hill
{182525, 530, -187.887f, 3459.38f, 60.0403f, -3.12414f, 0.0f, 0.0f, 0.999962f, -0.008727f}, // 1 overlook
{183515, 530, -289.610f, 3696.83f, 75.9447f, 3.12414f, 0.0f, 0.0f, 0.999962f, 0.008727f} // 2 stadium
};
class OPvPCapturePointHP : public OPvPCapturePoint
{
public:
OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
private:
OutdoorPvPHPTowerType m_TowerType;
};
class OutdoorPvPHP : public OutdoorPvP
{
public:
OutdoorPvPHP();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
void HandleKillImpl(Player* player, Unit* killed);
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
uint32 GetHordeTowersControlled() const;
void SetHordeTowersControlled(uint32 count);
private:
// how many towers are controlled
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
};
#endif

View File

@@ -1,676 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPNA.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "WorldPacket.h"
#include "Language.h"
#include "World.h"
OutdoorPvPNA::OutdoorPvPNA()
{
m_TypeId = OUTDOOR_PVP_NA;
m_obj = NULL;
}
void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
{
if (killed->GetTypeId() == TYPEID_PLAYER && player->GetTeamId() != killed->ToPlayer()->GetTeamId())
{
player->KilledMonsterCredit(NA_CREDIT_MARKER, 0); // 0 guid, btw it isn't even used in killedmonster function :S
player->CastSpell(player, player->GetTeamId() == TEAM_ALLIANCE ? NA_KILL_TOKEN_ALLIANCE : NA_KILL_TOKEN_HORDE, true);
}
}
uint32 OPvPCapturePointNA::GetAliveGuardsCount()
{
uint32 cnt = 0;
for (std::map<uint32, uint64>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
{
switch (itr->first)
{
case NA_NPC_GUARD_01:
case NA_NPC_GUARD_02:
case NA_NPC_GUARD_03:
case NA_NPC_GUARD_04:
case NA_NPC_GUARD_05:
case NA_NPC_GUARD_06:
case NA_NPC_GUARD_07:
case NA_NPC_GUARD_08:
case NA_NPC_GUARD_09:
case NA_NPC_GUARD_10:
case NA_NPC_GUARD_11:
case NA_NPC_GUARD_12:
case NA_NPC_GUARD_13:
case NA_NPC_GUARD_14:
case NA_NPC_GUARD_15:
if (Creature const* const cr = HashMapHolder<Creature>::Find(itr->second))
if (cr->IsAlive())
++cnt;
break;
default:
break;
}
}
return cnt;
}
TeamId OPvPCapturePointNA::GetControllingFaction() const
{
return m_ControllingFaction;
}
void OPvPCapturePointNA::SpawnNPCsForTeam(TeamId teamId)
{
const creature_type * creatures = NULL;
if (teamId == TEAM_ALLIANCE)
creatures=AllianceControlNPCs;
else if (teamId == TEAM_HORDE)
creatures=HordeControlNPCs;
else
return;
for (int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
AddCreature(i, creatures[i].entry, creatures[i].map, creatures[i].x, creatures[i].y, creatures[i].z, creatures[i].o, 1000000);
}
void OPvPCapturePointNA::DeSpawnNPCs()
{
for (int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
DelCreature(i);
}
void OPvPCapturePointNA::SpawnGOsForTeam(TeamId teamId)
{
const go_type * gos = NULL;
if (teamId == TEAM_ALLIANCE)
gos=AllianceControlGOs;
else if (teamId == TEAM_HORDE)
gos=HordeControlGOs;
else
return;
for (int i = 0; i < NA_CONTROL_GO_NUM; ++i)
{
if (i == NA_ROOST_S ||
i == NA_ROOST_W ||
i == NA_ROOST_N ||
i == NA_ROOST_E ||
i == NA_BOMB_WAGON_S ||
i == NA_BOMB_WAGON_W ||
i == NA_BOMB_WAGON_N ||
i == NA_BOMB_WAGON_E)
continue; // roosts and bomb wagons are spawned when someone uses the matching destroyed roost
AddObject(i, gos[i].entry, gos[i].map, gos[i].x, gos[i].y, gos[i].z, gos[i].o, gos[i].rot0, gos[i].rot1, gos[i].rot2, gos[i].rot3);
}
}
void OPvPCapturePointNA::DeSpawnGOs()
{
for (int i = 0; i < NA_CONTROL_GO_NUM; ++i)
{
DelObject(i);
}
}
void OPvPCapturePointNA::FactionTakeOver(TeamId teamId)
{
if (m_ControllingFaction != TEAM_NEUTRAL)
sObjectMgr->RemoveGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
if (m_ControllingFaction == TEAM_ALLIANCE)
sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A));
else if (m_ControllingFaction == TEAM_HORDE)
sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_H));
m_ControllingFaction = teamId;
if (m_ControllingFaction != TEAM_NEUTRAL)
sObjectMgr->AddGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
DeSpawnGOs();
DeSpawnNPCs();
SpawnGOsForTeam(teamId);
SpawnNPCsForTeam(teamId);
m_GuardsAlive = NA_GUARDS_MAX;
m_capturable = false;
this->UpdateHalaaWorldState();
if (teamId == TEAM_ALLIANCE)
{
m_WyvernStateSouth = WYVERN_NEU_HORDE;
m_WyvernStateNorth = WYVERN_NEU_HORDE;
m_WyvernStateEast = WYVERN_NEU_HORDE;
m_WyvernStateWest = WYVERN_NEU_HORDE;
m_PvP->TeamApplyBuff(TEAM_ALLIANCE, NA_CAPTURE_BUFF);
m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0);
m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 1);
m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive);
sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A));
}
else
{
m_WyvernStateSouth = WYVERN_NEU_ALLIANCE;
m_WyvernStateNorth = WYVERN_NEU_ALLIANCE;
m_WyvernStateEast = WYVERN_NEU_ALLIANCE;
m_WyvernStateWest = WYVERN_NEU_ALLIANCE;
m_PvP->TeamApplyBuff(TEAM_HORDE, NA_CAPTURE_BUFF);
m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 1);
m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0);
m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive);
sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H));
}
UpdateWyvernRoostWorldState(NA_ROOST_S);
UpdateWyvernRoostWorldState(NA_ROOST_N);
UpdateWyvernRoostWorldState(NA_ROOST_W);
UpdateWyvernRoostWorldState(NA_ROOST_E);
}
bool OPvPCapturePointNA::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointNA::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) :
OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(TEAM_NEUTRAL),
m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0), m_WyvernStateWest(0),
m_HalaaState(HALAA_N), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME)
{
SetCapturePointData(182210, 530, -1572.57f, 7945.3f, -22.475f, 2.05949f, 0.0f, 0.0f, 0.857167f, 0.515038f);
}
bool OutdoorPvPNA::SetupOutdoorPvP()
{
// m_TypeId = OUTDOOR_PVP_NA; _MUST_ be set in ctor, because of spawns cleanup
// add the zones affected by the pvp buff
RegisterZone(NA_BUFF_ZONE);
// halaa
m_obj = new OPvPCapturePointNA(this);
if (!m_obj)
return false;
AddCapturePoint(m_obj);
return true;
}
void OutdoorPvPNA::HandlePlayerEnterZone(Player* player, uint32 zone)
{
// add buffs
if (player->GetTeamId() == m_obj->GetControllingFaction())
player->CastSpell(player, NA_CAPTURE_BUFF, true);
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
void OutdoorPvPNA::HandlePlayerLeaveZone(Player* player, uint32 zone)
{
// remove buffs
player->RemoveAurasDueToSpell(NA_CAPTURE_BUFF);
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
void OutdoorPvPNA::FillInitialWorldStates(WorldPacket &data)
{
m_obj->FillInitialWorldStates(data);
}
void OPvPCapturePointNA::FillInitialWorldStates(WorldPacket &data)
{
if (m_ControllingFaction == TEAM_ALLIANCE)
{
data << NA_UI_HORDE_GUARDS_SHOW << uint32(0);
data << NA_UI_ALLIANCE_GUARDS_SHOW << uint32(1);
}
else if (m_ControllingFaction == TEAM_HORDE)
{
data << NA_UI_HORDE_GUARDS_SHOW << uint32(1);
data << NA_UI_ALLIANCE_GUARDS_SHOW << uint32(0);
}
else
{
data << NA_UI_HORDE_GUARDS_SHOW << uint32(0);
data << NA_UI_ALLIANCE_GUARDS_SHOW << uint32(0);
}
data << NA_UI_GUARDS_MAX << NA_GUARDS_MAX;
data << NA_UI_GUARDS_LEFT << uint32(m_GuardsAlive);
data << NA_UI_TOWER_SLIDER_DISPLAY << uint32(0);
data << NA_UI_TOWER_SLIDER_POS << uint32(50);
data << NA_UI_TOWER_SLIDER_N << uint32(100);
data << NA_MAP_WYVERN_NORTH_NEU_H << uint32(bool(m_WyvernStateNorth & WYVERN_NEU_HORDE));
data << NA_MAP_WYVERN_NORTH_NEU_A << uint32(bool(m_WyvernStateNorth & WYVERN_NEU_ALLIANCE));
data << NA_MAP_WYVERN_NORTH_H << uint32(bool(m_WyvernStateNorth & WYVERN_HORDE));
data << NA_MAP_WYVERN_NORTH_A << uint32(bool(m_WyvernStateNorth & WYVERN_ALLIANCE));
data << NA_MAP_WYVERN_SOUTH_NEU_H << uint32(bool(m_WyvernStateSouth & WYVERN_NEU_HORDE));
data << NA_MAP_WYVERN_SOUTH_NEU_A << uint32(bool(m_WyvernStateSouth & WYVERN_NEU_ALLIANCE));
data << NA_MAP_WYVERN_SOUTH_H << uint32(bool(m_WyvernStateSouth & WYVERN_HORDE));
data << NA_MAP_WYVERN_SOUTH_A << uint32(bool(m_WyvernStateSouth & WYVERN_ALLIANCE));
data << NA_MAP_WYVERN_WEST_NEU_H << uint32(bool(m_WyvernStateWest & WYVERN_NEU_HORDE));
data << NA_MAP_WYVERN_WEST_NEU_A << uint32(bool(m_WyvernStateWest & WYVERN_NEU_ALLIANCE));
data << NA_MAP_WYVERN_WEST_H << uint32(bool(m_WyvernStateWest & WYVERN_HORDE));
data << NA_MAP_WYVERN_WEST_A << uint32(bool(m_WyvernStateWest & WYVERN_ALLIANCE));
data << NA_MAP_WYVERN_EAST_NEU_H << uint32(bool(m_WyvernStateEast & WYVERN_NEU_HORDE));
data << NA_MAP_WYVERN_EAST_NEU_A << uint32(bool(m_WyvernStateEast & WYVERN_NEU_ALLIANCE));
data << NA_MAP_WYVERN_EAST_H << uint32(bool(m_WyvernStateEast & WYVERN_HORDE));
data << NA_MAP_WYVERN_EAST_A << uint32(bool(m_WyvernStateEast & WYVERN_ALLIANCE));
data << NA_MAP_HALAA_NEUTRAL << uint32(bool(m_HalaaState & HALAA_N));
data << NA_MAP_HALAA_NEU_A << uint32(bool(m_HalaaState & HALAA_N_A));
data << NA_MAP_HALAA_NEU_H << uint32(bool(m_HalaaState & HALAA_N_H));
data << NA_MAP_HALAA_HORDE << uint32(bool(m_HalaaState & HALAA_H));
data << NA_MAP_HALAA_ALLIANCE << uint32(bool(m_HalaaState & HALAA_A));
}
void OutdoorPvPNA::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0);
player->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0);
player->SendUpdateWorldState(NA_UI_GUARDS_MAX, 0);
player->SendUpdateWorldState(NA_UI_GUARDS_LEFT, 0);
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 0);
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, 0);
player->SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H, 0);
player->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A, 0);
player->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL, 0);
player->SendUpdateWorldState(NA_MAP_HALAA_NEU_A, 0);
player->SendUpdateWorldState(NA_MAP_HALAA_NEU_H, 0);
player->SendUpdateWorldState(NA_MAP_HALAA_HORDE, 0);
player->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE, 0);
}
bool OutdoorPvPNA::Update(uint32 diff)
{
return m_obj->Update(diff);
}
bool OPvPCapturePointNA::HandleCustomSpell(Player* player, uint32 spellId, GameObject* /*go*/)
{
std::vector<uint32> nodes;
nodes.resize(2);
bool retval = false;
switch (spellId)
{
case NA_SPELL_FLY_NORTH:
nodes[0] = FlightPathStartNodes[NA_ROOST_N];
nodes[1] = FlightPathEndNodes[NA_ROOST_N];
player->ActivateTaxiPathTo(nodes);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
player->UpdatePvP(true, true);
retval = true;
break;
case NA_SPELL_FLY_SOUTH:
nodes[0] = FlightPathStartNodes[NA_ROOST_S];
nodes[1] = FlightPathEndNodes[NA_ROOST_S];
player->ActivateTaxiPathTo(nodes);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
player->UpdatePvP(true, true);
retval = true;
break;
case NA_SPELL_FLY_WEST:
nodes[0] = FlightPathStartNodes[NA_ROOST_W];
nodes[1] = FlightPathEndNodes[NA_ROOST_W];
player->ActivateTaxiPathTo(nodes);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
player->UpdatePvP(true, true);
retval = true;
break;
case NA_SPELL_FLY_EAST:
nodes[0] = FlightPathStartNodes[NA_ROOST_E];
nodes[1] = FlightPathEndNodes[NA_ROOST_E];
player->ActivateTaxiPathTo(nodes);
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
player->UpdatePvP(true, true);
retval = true;
break;
default:
break;
}
if (retval)
{
//Adding items
uint32 noSpaceForCount = 0;
// check space and find places
ItemPosCountVec dest;
int32 count = 10;
uint32 itemid = 24538;
// bomb id count
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount);
if (msg != EQUIP_ERR_OK) // convert to possible store amount
count -= noSpaceForCount;
if (count == 0 || dest.empty()) // can't add any
{
return true;
}
Item* item = player->StoreNewItem(dest, itemid, true);
if (count > 0 && item)
{
player->SendNewItem(item, count, true, false);
}
return true;
}
return false;
}
int32 OPvPCapturePointNA::HandleOpenGo(Player* player, uint64 guid)
{
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
if (retval >= 0)
{
const go_type * gos = NULL;
if (m_ControllingFaction == TEAM_ALLIANCE)
gos=AllianceControlGOs;
else if (m_ControllingFaction == TEAM_HORDE)
gos=HordeControlGOs;
else
return -1;
int32 del = -1;
int32 del2 = -1;
int32 add = -1;
int32 add2 = -1;
switch (retval)
{
case NA_DESTROYED_ROOST_S:
del = NA_DESTROYED_ROOST_S;
add = NA_ROOST_S;
add2 = NA_BOMB_WAGON_S;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateSouth = WYVERN_ALLIANCE;
else
m_WyvernStateSouth = WYVERN_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_S);
break;
case NA_DESTROYED_ROOST_N:
del = NA_DESTROYED_ROOST_N;
add = NA_ROOST_N;
add2 = NA_BOMB_WAGON_N;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateNorth = WYVERN_ALLIANCE;
else
m_WyvernStateNorth = WYVERN_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_N);
break;
case NA_DESTROYED_ROOST_W:
del = NA_DESTROYED_ROOST_W;
add = NA_ROOST_W;
add2 = NA_BOMB_WAGON_W;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateWest = WYVERN_ALLIANCE;
else
m_WyvernStateWest = WYVERN_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_W);
break;
case NA_DESTROYED_ROOST_E:
del = NA_DESTROYED_ROOST_E;
add = NA_ROOST_E;
add2 = NA_BOMB_WAGON_E;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateEast = WYVERN_ALLIANCE;
else
m_WyvernStateEast = WYVERN_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_E);
break;
case NA_BOMB_WAGON_S:
del = NA_BOMB_WAGON_S;
del2 = NA_ROOST_S;
add = NA_DESTROYED_ROOST_S;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateSouth = WYVERN_NEU_ALLIANCE;
else
m_WyvernStateSouth = WYVERN_NEU_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_S);
break;
case NA_BOMB_WAGON_N:
del = NA_BOMB_WAGON_N;
del2 = NA_ROOST_N;
add = NA_DESTROYED_ROOST_N;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateNorth = WYVERN_NEU_ALLIANCE;
else
m_WyvernStateNorth = WYVERN_NEU_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_N);
break;
case NA_BOMB_WAGON_W:
del = NA_BOMB_WAGON_W;
del2 = NA_ROOST_W;
add = NA_DESTROYED_ROOST_W;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateWest = WYVERN_NEU_ALLIANCE;
else
m_WyvernStateWest = WYVERN_NEU_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_W);
break;
case NA_BOMB_WAGON_E:
del = NA_BOMB_WAGON_E;
del2 = NA_ROOST_E;
add = NA_DESTROYED_ROOST_E;
if (m_ControllingFaction == TEAM_HORDE)
m_WyvernStateEast = WYVERN_NEU_ALLIANCE;
else
m_WyvernStateEast = WYVERN_NEU_HORDE;
UpdateWyvernRoostWorldState(NA_ROOST_E);
break;
default:
return -1;
break;
}
if (del>-1)
DelObject(del);
if (del2>-1)
DelObject(del2);
if (add>-1)
AddObject(add, gos[add].entry, gos[add].map, gos[add].x, gos[add].y, gos[add].z, gos[add].o, gos[add].rot0, gos[add].rot1, gos[add].rot2, gos[add].rot3);
if (add2>-1)
AddObject(add2, gos[add2].entry, gos[add2].map, gos[add2].x, gos[add2].y, gos[add2].z, gos[add2].o, gos[add2].rot0, gos[add2].rot1, gos[add2].rot2, gos[add2].rot3);
return retval;
}
return -1;
}
bool OPvPCapturePointNA::Update(uint32 diff)
{
// let the controlling faction advance in phase
bool capturable = false;
if (m_ControllingFaction == TEAM_ALLIANCE && m_activePlayers[0].size() > m_activePlayers[1].size())
capturable = true;
else if (m_ControllingFaction == TEAM_HORDE && m_activePlayers[0].size() < m_activePlayers[1].size())
capturable = true;
if (m_GuardCheckTimer < diff)
{
m_GuardCheckTimer = NA_GUARD_CHECK_TIME;
uint32 cnt = GetAliveGuardsCount();
if (cnt != m_GuardsAlive)
{
m_GuardsAlive = cnt;
if (m_GuardsAlive == 0)
m_capturable = true;
// update the guard count for the players in zone
m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive);
}
} else m_GuardCheckTimer -= diff;
if (m_capturable || capturable)
{
if (m_RespawnTimer < diff)
{
// if the guards have been killed, then the challenger has one hour to take over halaa.
// in case they fail to do it, the guards are respawned, and they have to start again.
if (m_ControllingFaction)
FactionTakeOver(m_ControllingFaction);
m_RespawnTimer = NA_RESPAWN_TIME;
} else m_RespawnTimer -= diff;
}
return OPvPCapturePoint::Update(diff);
}
void OPvPCapturePointNA::ChangeState()
{
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_NEUTRAL:
m_HalaaState = HALAA_N;
break;
case OBJECTIVESTATE_ALLIANCE:
m_HalaaState = HALAA_A;
FactionTakeOver(TEAM_ALLIANCE);
artkit = 2;
break;
case OBJECTIVESTATE_HORDE:
m_HalaaState = HALAA_H;
FactionTakeOver(TEAM_HORDE);
artkit = 1;
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
m_HalaaState = HALAA_N_A;
break;
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
m_HalaaState = HALAA_N_H;
break;
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
m_HalaaState = HALAA_N_A;
artkit = 2;
break;
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_HalaaState = HALAA_N_H;
artkit = 1;
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
if (flag)
{
flag->SetGoArtKit(artkit);
}
UpdateHalaaWorldState();
}
void OPvPCapturePointNA::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(NA_UI_TOWER_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(NA_UI_TOWER_SLIDER_POS, phase);
SendUpdateWorldState(NA_UI_TOWER_SLIDER_N, m_neutralValuePct);
}
void OPvPCapturePointNA::UpdateHalaaWorldState()
{
m_PvP->SendUpdateWorldState(NA_MAP_HALAA_NEUTRAL, uint32(bool(m_HalaaState & HALAA_N)));
m_PvP->SendUpdateWorldState(NA_MAP_HALAA_NEU_A, uint32(bool(m_HalaaState & HALAA_N_A)));
m_PvP->SendUpdateWorldState(NA_MAP_HALAA_NEU_H, uint32(bool(m_HalaaState & HALAA_N_H)));
m_PvP->SendUpdateWorldState(NA_MAP_HALAA_HORDE, uint32(bool(m_HalaaState & HALAA_H)));
m_PvP->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE, uint32(bool(m_HalaaState & HALAA_A)));
}
void OPvPCapturePointNA::UpdateWyvernRoostWorldState(uint32 roost)
{
switch (roost)
{
case NA_ROOST_S:
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_H, uint32(bool(m_WyvernStateSouth & WYVERN_NEU_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_NEU_A, uint32(bool(m_WyvernStateSouth & WYVERN_NEU_ALLIANCE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_H, uint32(bool(m_WyvernStateSouth & WYVERN_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_SOUTH_A, uint32(bool(m_WyvernStateSouth & WYVERN_ALLIANCE)));
break;
case NA_ROOST_N:
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_H, uint32(bool(m_WyvernStateNorth & WYVERN_NEU_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_NEU_A, uint32(bool(m_WyvernStateNorth & WYVERN_NEU_ALLIANCE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_H, uint32(bool(m_WyvernStateNorth & WYVERN_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_NORTH_A, uint32(bool(m_WyvernStateNorth & WYVERN_ALLIANCE)));
break;
case NA_ROOST_W:
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_H, uint32(bool(m_WyvernStateWest & WYVERN_NEU_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_NEU_A, uint32(bool(m_WyvernStateWest & WYVERN_NEU_ALLIANCE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_H, uint32(bool(m_WyvernStateWest & WYVERN_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_WEST_A, uint32(bool(m_WyvernStateWest & WYVERN_ALLIANCE)));
break;
case NA_ROOST_E:
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_H, uint32(bool(m_WyvernStateEast & WYVERN_NEU_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_NEU_A, uint32(bool(m_WyvernStateEast & WYVERN_NEU_ALLIANCE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_H, uint32(bool(m_WyvernStateEast & WYVERN_HORDE)));
m_PvP->SendUpdateWorldState(NA_MAP_WYVERN_EAST_A, uint32(bool(m_WyvernStateEast & WYVERN_ALLIANCE)));
break;
}
}
class OutdoorPvP_nagrand : public OutdoorPvPScript
{
public:
OutdoorPvP_nagrand()
: OutdoorPvPScript("outdoorpvp_na")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPNA();
}
};
void AddSC_outdoorpvp_na()
{
new OutdoorPvP_nagrand();
}

View File

@@ -1,336 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_NA_
#define OUTDOOR_PVP_NA_
#include "OutdoorPvP.h"
// TODO: "sometimes" set to neutral
enum OutdoorPvPNASpells
{
NA_KILL_TOKEN_ALLIANCE = 33005,
NA_KILL_TOKEN_HORDE = 33004,
NA_CAPTURE_BUFF = 33795 // strength of the halaani
};
// kill credit for pks
const uint32 NA_CREDIT_MARKER = 24867;
const uint32 NA_GUARDS_MAX = 15;
const uint32 NA_BUFF_ZONE = 3518;
const uint32 NA_HALAA_GRAVEYARD = 993;
const uint32 NA_HALAA_GRAVEYARD_ZONE = 3518; // need to add zone id, not area id
const uint32 NA_RESPAWN_TIME = 3600000; // one hour to capture after defeating all guards
const uint32 NA_GUARD_CHECK_TIME = 500; // every half second
enum OutdoorPvPNAWorldStates
{
NA_UI_HORDE_GUARDS_SHOW = 2503,
NA_UI_ALLIANCE_GUARDS_SHOW = 2502,
NA_UI_GUARDS_MAX = 2493,
NA_UI_GUARDS_LEFT = 2491,
NA_UI_TOWER_SLIDER_DISPLAY = 2495,
NA_UI_TOWER_SLIDER_POS = 2494,
NA_UI_TOWER_SLIDER_N = 2497,
NA_MAP_WYVERN_NORTH_NEU_H = 2762,
NA_MAP_WYVERN_NORTH_NEU_A = 2662,
NA_MAP_WYVERN_NORTH_H = 2663,
NA_MAP_WYVERN_NORTH_A = 2664,
NA_MAP_WYVERN_SOUTH_NEU_H = 2760,
NA_MAP_WYVERN_SOUTH_NEU_A = 2670,
NA_MAP_WYVERN_SOUTH_H = 2668,
NA_MAP_WYVERN_SOUTH_A = 2669,
NA_MAP_WYVERN_WEST_NEU_H = 2761,
NA_MAP_WYVERN_WEST_NEU_A = 2667,
NA_MAP_WYVERN_WEST_H = 2665,
NA_MAP_WYVERN_WEST_A = 2666,
NA_MAP_WYVERN_EAST_NEU_H = 2763,
NA_MAP_WYVERN_EAST_NEU_A = 2659,
NA_MAP_WYVERN_EAST_H = 2660,
NA_MAP_WYVERN_EAST_A = 2661,
NA_MAP_HALAA_NEUTRAL = 2671,
NA_MAP_HALAA_NEU_A = 2676,
NA_MAP_HALAA_NEU_H = 2677,
NA_MAP_HALAA_HORDE = 2672,
NA_MAP_HALAA_ALLIANCE = 2673
};
const uint32 FLIGHT_NODES_NUM = 4;
// used to access the elements of Horde/AllyControlGOs
enum ControlGOTypes
{
NA_ROOST_S = 0,
NA_ROOST_W = 1,
NA_ROOST_N = 2,
NA_ROOST_E = 3,
NA_BOMB_WAGON_S = 4,
NA_BOMB_WAGON_W = 5,
NA_BOMB_WAGON_N = 6,
NA_BOMB_WAGON_E = 7,
NA_DESTROYED_ROOST_S = 8,
NA_DESTROYED_ROOST_W = 9,
NA_DESTROYED_ROOST_N = 10,
NA_DESTROYED_ROOST_E = 11,
NA_CONTROL_GO_NUM = 12
};
const uint32 FlightPathStartNodes[FLIGHT_NODES_NUM] = {103, 105, 107, 109};
const uint32 FlightPathEndNodes[FLIGHT_NODES_NUM] = {104, 106, 108, 110};
enum FlightSpellsNA
{
NA_SPELL_FLY_SOUTH = 32059,
NA_SPELL_FLY_WEST = 32068,
NA_SPELL_FLY_NORTH = 32075,
NA_SPELL_FLY_EAST = 32081
};
// spawned when the alliance is attacking, horde is in control
const go_type HordeControlGOs[NA_CONTROL_GO_NUM] =
{
{182267, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //ALLY_ROOST_SOUTH
{182280, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //ALLY_ROOST_WEST
{182281, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //ALLY_ROOST_NORTH
{182282, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //ALLY_ROOST_EAST
{182222, 530, -1825.4022f, 8039.2602f, -26.08f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //HORDE_BOMB_WAGON_SOUTH
{182272, 530, -1515.37f, 8136.91f, -20.42f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //HORDE_BOMB_WAGON_WEST
{182273, 530, -1377.95f, 7773.44f, -10.31f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //HORDE_BOMB_WAGON_NORTH
{182274, 530, -1659.87f, 7733.15f, -15.75f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //HORDE_BOMB_WAGON_EAST
{182266, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //DESTROYED_ALLY_ROOST_SOUTH
{182275, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //DESTROYED_ALLY_ROOST_WEST
{182276, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //DESTROYED_ALLY_ROOST_NORTH
{182277, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f} //DESTROYED_ALLY_ROOST_EAST
};
// spawned when the horde is attacking, alliance is in control
const go_type AllianceControlGOs[NA_CONTROL_GO_NUM] =
{
{182301, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //HORDE_ROOST_SOUTH
{182302, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //HORDE_ROOST_WEST
{182303, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //HORDE_ROOST_NORTH
{182304, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //HORDE_ROOST_EAST
{182305, 530, -1825.4022f, 8039.2602f, -26.08f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //ALLY_BOMB_WAGON_SOUTH
{182306, 530, -1515.37f, 8136.91f, -20.42f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //ALLY_BOMB_WAGON_WEST
{182307, 530, -1377.95f, 7773.44f, -10.31f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //ALLY_BOMB_WAGON_NORTH
{182308, 530, -1659.87f, 7733.15f, -15.75f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //ALLY_BOMB_WAGON_EAST
{182297, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //DESTROYED_HORDE_ROOST_SOUTH
{182298, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //DESTROYED_HORDE_ROOST_WEST
{182299, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //DESTROYED_HORDE_ROOST_NORTH
{182300, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f} //DESTROYED_HORDE_ROOST_EAST
};
enum ControlNPCTypes
{
NA_NPC_RESEARCHER = 0,
NA_NPC_QUARTERMASTER,
NA_NPC_BLADE_MERCHANT,
NA_NPC_FOOD_MERCHANT,
NA_NPC_AMMO,
NA_NPC_GUARD_01,
NA_NPC_GUARD_02,
NA_NPC_GUARD_03,
NA_NPC_GUARD_04,
NA_NPC_GUARD_05,
NA_NPC_GUARD_06,
NA_NPC_GUARD_07,
NA_NPC_GUARD_08,
NA_NPC_GUARD_09,
NA_NPC_GUARD_10,
NA_NPC_GUARD_11,
NA_NPC_GUARD_12,
NA_NPC_GUARD_13,
NA_NPC_GUARD_14,
NA_NPC_GUARD_15,
NA_CONTROL_NPC_NUM
};
const creature_type HordeControlNPCs[NA_CONTROL_NPC_NUM] =
{
{18816, 530, -1523.92f, 7951.76f, -17.6942f, 3.51172f},
{18821, 530, -1527.75f, 7952.46f, -17.6948f, 3.99317f},
{21474, 530, -1520.14f, 7927.11f, -20.2527f, 3.39389f},
{21484, 530, -1524.84f, 7930.34f, -20.182f, 3.6405f},
{21483, 530, -1570.01f, 7993.8f, -22.4505f, 5.02655f},
{18192, 530, -1654.06f, 8000.46f, -26.59f, 3.37f},
{18192, 530, -1487.18f, 7899.1f, -19.53f, 0.954f},
{18192, 530, -1480.88f, 7908.79f, -19.19f, 4.485f},
{18192, 530, -1540.56f, 7995.44f, -20.45f, 0.947f},
{18192, 530, -1546.95f, 8000.85f, -20.72f, 6.035f},
{18192, 530, -1595.31f, 7860.53f, -21.51f, 3.747f},
{18192, 530, -1642.31f, 7995.59f, -25.8f, 3.317f},
{18192, 530, -1545.46f, 7995.35f, -20.63f, 1.094f},
{18192, 530, -1487.58f, 7907.99f, -19.27f, 5.567f},
{18192, 530, -1651.54f, 7988.56f, -26.5289f, 2.98451f},
{18192, 530, -1602.46f, 7866.43f, -22.1177f, 4.74729f},
{18192, 530, -1591.22f, 7875.29f, -22.3536f, 4.34587f},
{18192, 530, -1550.6f, 7944.45f, -21.63f, 3.559f},
{18192, 530, -1545.57f, 7935.83f, -21.13f, 3.448f},
{18192, 530, -1550.86f, 7937.56f, -21.7f, 3.801f}
};
const creature_type AllianceControlNPCs[NA_CONTROL_NPC_NUM] =
{
{18817, 530, -1591.18f, 8020.39f, -22.2042f, 4.59022f},
{18822, 530, -1588.0f, 8019.0f, -22.2042f, 4.06662f},
{21485, 530, -1521.93f, 7927.37f, -20.2299f, 3.24631f},
{21487, 530, -1540.33f, 7971.95f, -20.7186f, 3.07178f},
{21488, 530, -1570.01f, 7993.8f, -22.4505f, 5.02655f},
{18256, 530, -1654.06f, 8000.46f, -26.59f, 3.37f},
{18256, 530, -1487.18f, 7899.1f, -19.53f, 0.954f},
{18256, 530, -1480.88f, 7908.79f, -19.19f, 4.485f},
{18256, 530, -1540.56f, 7995.44f, -20.45f, 0.947f},
{18256, 530, -1546.95f, 8000.85f, -20.72f, 6.035f},
{18256, 530, -1595.31f, 7860.53f, -21.51f, 3.747f},
{18256, 530, -1642.31f, 7995.59f, -25.8f, 3.317f},
{18256, 530, -1545.46f, 7995.35f, -20.63f, 1.094f},
{18256, 530, -1487.58f, 7907.99f, -19.27f, 5.567f},
{18256, 530, -1651.54f, 7988.56f, -26.5289f, 2.98451f},
{18256, 530, -1602.46f, 7866.43f, -22.1177f, 4.74729f},
{18256, 530, -1591.22f, 7875.29f, -22.3536f, 4.34587f},
{18256, 530, -1603.75f, 8000.36f, -24.18f, 4.516f},
{18256, 530, -1585.73f, 7994.68f, -23.29f, 4.439f},
{18256, 530, -1595.5f, 7991.27f, -23.53f, 4.738f}
};
enum WyvernStates
{
WYVERN_NEU_HORDE = 1,
WYVERN_NEU_ALLIANCE = 2,
WYVERN_HORDE = 4,
WYVERN_ALLIANCE = 8
};
enum HalaaStates
{
HALAA_N = 1,
HALAA_N_A = 2,
HALAA_A = 4,
HALAA_N_H = 8,
HALAA_H = 16
};
class Unit;
class Creature;
class OutdoorPvPNA;
class OPvPCapturePointNA : public OPvPCapturePoint
{
public:
OPvPCapturePointNA(OutdoorPvP* pvp);
bool Update(uint32 diff);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
int32 HandleOpenGo(Player* player, uint64 guid);
uint32 GetAliveGuardsCount();
TeamId GetControllingFaction() const;
protected:
// called when a faction takes control
void FactionTakeOver(TeamId teamId);
void DeSpawnNPCs();
void DeSpawnGOs();
void SpawnNPCsForTeam(TeamId teamId);
void SpawnGOsForTeam(TeamId teamId);
void UpdateWyvernRoostWorldState(uint32 roost);
void UpdateHalaaWorldState();
private:
bool m_capturable;
uint32 m_GuardsAlive;
TeamId m_ControllingFaction;
uint32 m_WyvernStateNorth;
uint32 m_WyvernStateSouth;
uint32 m_WyvernStateEast;
uint32 m_WyvernStateWest;
uint32 m_HalaaState;
uint32 m_RespawnTimer;
uint32 m_GuardCheckTimer;
};
class OutdoorPvPNA : public OutdoorPvP
{
public:
OutdoorPvPNA();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
void HandleKillImpl(Player* player, Unit* killed);
private:
OPvPCapturePointNA * m_obj;
};
#endif

View File

@@ -1,261 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPSI.h"
#include "WorldPacket.h"
#include "Player.h"
#include "GameObject.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "ReputationMgr.h"
#include "Language.h"
#include "World.h"
#include "Transport.h"
OutdoorPvPSI::OutdoorPvPSI()
{
m_TypeId = OUTDOOR_PVP_SI;
m_Gathered_A = 0;
m_Gathered_H = 0;
m_LastController = TEAM_NEUTRAL;
}
void OutdoorPvPSI::FillInitialWorldStates(WorldPacket &data)
{
data << SI_GATHERED_A << m_Gathered_A;
data << SI_GATHERED_H << m_Gathered_H;
data << SI_SILITHYST_MAX << SI_MAX_RESOURCES;
}
void OutdoorPvPSI::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(SI_GATHERED_A, 0);
player->SendUpdateWorldState(SI_GATHERED_H, 0);
player->SendUpdateWorldState(SI_SILITHYST_MAX, 0);
}
void OutdoorPvPSI::UpdateWorldState()
{
SendUpdateWorldState(SI_GATHERED_A, m_Gathered_A);
SendUpdateWorldState(SI_GATHERED_H, m_Gathered_H);
SendUpdateWorldState(SI_SILITHYST_MAX, SI_MAX_RESOURCES);
}
bool OutdoorPvPSI::SetupOutdoorPvP()
{
for (uint8 i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
RegisterZone(OutdoorPvPSIBuffZones[i]);
return true;
}
bool OutdoorPvPSI::Update(uint32 /*diff*/)
{
return false;
}
void OutdoorPvPSI::HandlePlayerEnterZone(Player* player, uint32 zone)
{
if (player->GetTeamId() == m_LastController)
player->CastSpell(player, SI_CENARION_FAVOR, true);
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
void OutdoorPvPSI::HandlePlayerLeaveZone(Player* player, uint32 zone)
{
// remove buffs
player->RemoveAurasDueToSpell(SI_CENARION_FAVOR);
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger)
{
TRINITY_GUARD(ACE_Thread_Mutex, sOutdoorPvPMgr->_lock);
switch (trigger)
{
case SI_AREATRIGGER_A:
if (player->GetTeamId() == TEAM_ALLIANCE && player->HasAura(SI_SILITHYST_FLAG))
{
// remove aura
player->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
++ m_Gathered_A;
if (m_Gathered_A >= SI_MAX_RESOURCES)
{
TeamApplyBuff(TEAM_ALLIANCE, SI_CENARION_FAVOR, 0, player);
sWorld->SendZoneText(OutdoorPvPSIBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A));
m_LastController = TEAM_ALLIANCE;
m_Gathered_A = 0;
m_Gathered_H = 0;
}
UpdateWorldState();
// reward player, xinef: has no effect on characters above level 70
if (player->getLevel() < 70)
player->CastSpell(player, SI_TRACES_OF_SILITHYST, true);
// add 19 honor
player->RewardHonor(NULL, 1, 19);
// add 20 cenarion circle repu
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
// complete quest
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A, 0);
}
return true;
case SI_AREATRIGGER_H:
if (player->GetTeamId() == TEAM_HORDE && player->HasAura(SI_SILITHYST_FLAG))
{
// remove aura
player->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
++ m_Gathered_H;
if (m_Gathered_H >= SI_MAX_RESOURCES)
{
TeamApplyBuff(TEAM_HORDE, SI_CENARION_FAVOR, 0, player);
sWorld->SendZoneText(OutdoorPvPSIBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H));
m_LastController = TEAM_HORDE;
m_Gathered_A = 0;
m_Gathered_H = 0;
}
UpdateWorldState();
// reward player, xinef: has no effect on characters above level 70
if (player->getLevel() < 70)
player->CastSpell(player, SI_TRACES_OF_SILITHYST, true);
// add 19 honor
player->RewardHonor(NULL, 1, 19);
// add 20 cenarion circle repu
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
// complete quest
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H, 0);
}
return true;
}
return false;
}
bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
{
if (spellId == SI_SILITHYST_FLAG)
{
// if it was dropped away from the player's turn-in point, then create a silithyst mound, if it was dropped near the areatrigger, then it was dispelled by the outdoorpvp, so do nothing
switch (player->GetTeamId())
{
case TEAM_ALLIANCE:
{
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(SI_AREATRIGGER_A);
if (atEntry)
{
// 5.0f is safe-distance
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
{
// he dropped it further, summon mound
GameObject* go = sObjectMgr->IsGameObjectStaticTransport(SI_SILITHYST_MOUND) ? new StaticTransport() : new GameObject();
Map* map = player->GetMap();
if (!map)
{
delete go;
return true;
}
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
{
delete go;
return true;
}
go->SetRespawnTime(0);
if (!map->AddToMap(go))
{
delete go;
return true;
}
}
}
}
break;
case TEAM_HORDE:
{
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(SI_AREATRIGGER_H);
if (atEntry)
{
// 5.0f is safe-distance
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
{
// he dropped it further, summon mound
GameObject* go = sObjectMgr->IsGameObjectStaticTransport(SI_SILITHYST_MOUND) ? new StaticTransport() : new GameObject();
Map* map = player->GetMap();
if (!map)
{
delete go;
return true;
}
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), SI_SILITHYST_MOUND, map, player->GetPhaseMask(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
{
delete go;
return true;
}
go->SetRespawnTime(0);
if (!map->AddToMap(go))
{
delete go;
return true;
}
}
}
}
break;
}
return true;
}
return false;
}
bool OutdoorPvPSI::HandleCustomSpell(Player* player, uint32 spellId, GameObject* go)
{
if (!go || spellId != SI_SILITHYST_FLAG_GO_SPELL)
return false;
player->CastSpell(player, SI_SILITHYST_FLAG, true);
if (go->GetGOInfo()->entry == SI_SILITHYST_MOUND)
{
// despawn go
go->SetRespawnTime(0);
go->Delete();
}
return true;
}
class OutdoorPvP_silithus : public OutdoorPvPScript
{
public:
OutdoorPvP_silithus()
: OutdoorPvPScript("outdoorpvp_si")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPSI();
}
};
void AddSC_outdoorpvp_si()
{
new OutdoorPvP_silithus();
}

View File

@@ -1,87 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_SI_
#define OUTDOOR_PVP_SI_
#include "OutdoorPvP.h"
enum OutdoorPvPSISpells
{
SI_SILITHYST_FLAG_GO_SPELL = 29518,
SI_SILITHYST_FLAG = 29519,
SI_TRACES_OF_SILITHYST = 29534,
SI_CENARION_FAVOR = 30754
};
const uint32 SI_MAX_RESOURCES = 200;
const uint8 OutdoorPvPSIBuffZonesNum = 3;
const uint32 OutdoorPvPSIBuffZones[OutdoorPvPSIBuffZonesNum] = { 1377, 3428, 3429 };
const uint32 SI_AREATRIGGER_H = 4168;
const uint32 SI_AREATRIGGER_A = 4162;
const uint32 SI_TURNIN_QUEST_CM_A = 17090;
const uint32 SI_TURNIN_QUEST_CM_H = 18199;
const uint32 SI_SILITHYST_MOUND = 181597;
enum SI_WorldStates
{
SI_GATHERED_A = 2313,
SI_GATHERED_H = 2314,
SI_SILITHYST_MAX = 2317
};
class OutdoorPvPSI : public OutdoorPvP
{
public:
OutdoorPvPSI();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
bool HandleAreaTrigger(Player* player, uint32 trigger);
bool HandleDropFlag(Player* player, uint32 spellId);
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go);
void UpdateWorldState();
private:
uint32 m_Gathered_A;
uint32 m_Gathered_H;
TeamId m_LastController;
};
#endif

View File

@@ -1,378 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPTF.h"
#include "OutdoorPvPMgr.h"
#include "OutdoorPvP.h"
#include "WorldPacket.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "Language.h"
#include "World.h"
OutdoorPvPTF::OutdoorPvPTF()
{
m_TypeId = OUTDOOR_PVP_TF;
m_IsLocked = false;
m_LockTimer = TF_LOCK_TIME;
m_LockTimerUpdate = 0;
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
hours_left = 6;
second_digit = 0;
first_digit = 0;
}
OPvPCapturePointTF::OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type)
: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(TF_TOWERSTATE_N)
{
SetCapturePointData(TFCapturePoints[type].entry, TFCapturePoints[type].map, TFCapturePoints[type].x, TFCapturePoints[type].y, TFCapturePoints[type].z, TFCapturePoints[type].o, TFCapturePoints[type].rot0, TFCapturePoints[type].rot1, TFCapturePoints[type].rot2, TFCapturePoints[type].rot3);
}
void OPvPCapturePointTF::FillInitialWorldStates(WorldPacket &data)
{
data << uint32(TFTowerWorldStates[m_TowerType].n) << uint32(bool(m_TowerState & TF_TOWERSTATE_N));
data << uint32(TFTowerWorldStates[m_TowerType].h) << uint32(bool(m_TowerState & TF_TOWERSTATE_H));
data << uint32(TFTowerWorldStates[m_TowerType].a) << uint32(bool(m_TowerState & TF_TOWERSTATE_A));
}
void OutdoorPvPTF::FillInitialWorldStates(WorldPacket &data)
{
data << TF_UI_TOWER_SLIDER_POS << uint32(50);
data << TF_UI_TOWER_SLIDER_N << uint32(100);
data << TF_UI_TOWER_SLIDER_DISPLAY << uint32(0);
data << TF_UI_TOWER_COUNT_H << m_HordeTowersControlled;
data << TF_UI_TOWER_COUNT_A << m_AllianceTowersControlled;
data << TF_UI_TOWERS_CONTROLLED_DISPLAY << uint32(!m_IsLocked);
data << TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT << first_digit;
data << TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT << second_digit;
data << TF_UI_LOCKED_TIME_HOURS << hours_left;
data << TF_UI_LOCKED_DISPLAY_NEUTRAL << uint32(m_IsLocked && !m_HordeTowersControlled && !m_AllianceTowersControlled);
data << TF_UI_LOCKED_DISPLAY_HORDE << uint32(m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled));
data << TF_UI_LOCKED_DISPLAY_ALLIANCE << uint32(m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled));
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
{
itr->second->FillInitialWorldStates(data);
}
}
void OutdoorPvPTF::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, uint32(0));
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, uint32(0));
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, uint32(0));
player->SendUpdateWorldState(TF_UI_TOWER_COUNT_H, uint32(0));
player->SendUpdateWorldState(TF_UI_TOWER_COUNT_A, uint32(0));
player->SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, uint32(0));
player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, uint32(0));
player->SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, uint32(0));
player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0));
player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0));
for (int i = 0; i < TF_TOWER_NUM; ++i)
{
player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].n), uint32(0));
player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].h), uint32(0));
player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].a), uint32(0));
}
}
void OPvPCapturePointTF::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].n), uint32(bool(m_TowerState & TF_TOWERSTATE_N)));
m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].h), uint32(bool(m_TowerState & TF_TOWERSTATE_H)));
m_PvP->SendUpdateWorldState(uint32(TFTowerWorldStates[m_TowerType].a), uint32(bool(m_TowerState & TF_TOWERSTATE_A)));
}
bool OPvPCapturePointTF::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase);
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointTF::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
bool OutdoorPvPTF::Update(uint32 diff)
{
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == TF_TOWER_NUM)
{
TeamApplyBuff(TEAM_ALLIANCE, TF_CAPTURE_BUFF);
m_IsLocked = true;
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(1));
SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
}
else if (m_HordeTowersControlled == TF_TOWER_NUM)
{
TeamApplyBuff(TEAM_HORDE, TF_CAPTURE_BUFF);
m_IsLocked = true;
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(1));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0));
SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
}
else
{
TeamCastSpell(TEAM_ALLIANCE, -TF_CAPTURE_BUFF);
TeamCastSpell(TEAM_HORDE, -TF_CAPTURE_BUFF);
}
SendUpdateWorldState(TF_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
SendUpdateWorldState(TF_UI_TOWER_COUNT_H, m_HordeTowersControlled);
}
if (m_IsLocked)
{
// lock timer is down, release lock
if (m_LockTimer < diff)
{
m_LockTimer = TF_LOCK_TIME;
m_LockTimerUpdate = 0;
m_IsLocked = false;
SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(1));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0));
SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0));
}
else
{
// worldstateui update timer is down, update ui with new time data
if (m_LockTimerUpdate < diff)
{
m_LockTimerUpdate = TF_LOCK_TIME_UPDATE;
uint32 minutes_left = m_LockTimer / 60000;
hours_left = minutes_left / 60;
minutes_left -= hours_left * 60;
second_digit = minutes_left % 10;
first_digit = minutes_left / 10;
SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, first_digit);
SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, second_digit);
SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, hours_left);
} else m_LockTimerUpdate -= diff;
m_LockTimer -= diff;
}
}
return changed;
}
void OutdoorPvPTF::HandlePlayerEnterZone(Player* player, uint32 zone)
{
if (player->GetTeamId() == TEAM_ALLIANCE)
{
if (m_AllianceTowersControlled >= TF_TOWER_NUM)
player->CastSpell(player, TF_CAPTURE_BUFF, true);
}
else
{
if (m_HordeTowersControlled >= TF_TOWER_NUM)
player->CastSpell(player, TF_CAPTURE_BUFF, true);
}
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
void OutdoorPvPTF::HandlePlayerLeaveZone(Player* player, uint32 zone)
{
// remove buffs
player->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
uint32 OutdoorPvPTF::GetAllianceTowersControlled() const
{
return m_AllianceTowersControlled;
}
void OutdoorPvPTF::SetAllianceTowersControlled(uint32 count)
{
m_AllianceTowersControlled = count;
}
uint32 OutdoorPvPTF::GetHordeTowersControlled() const
{
return m_HordeTowersControlled;
}
void OutdoorPvPTF::SetHordeTowersControlled(uint32 count)
{
m_HordeTowersControlled = count;
}
bool OutdoorPvPTF::IsLocked() const
{
return m_IsLocked;
}
bool OutdoorPvPTF::SetupOutdoorPvP()
{
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
m_IsLocked = false;
m_LockTimer = TF_LOCK_TIME;
m_LockTimerUpdate = 0;
hours_left = 6;
second_digit = 0;
first_digit = 0;
// add the zones affected by the pvp buff
for (uint8 i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
RegisterZone(OutdoorPvPTFBuffZones[i]);
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_NW));
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_N));
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_NE));
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_SE));
AddCapturePoint(new OPvPCapturePointTF(this, TF_TOWER_S));
return true;
}
bool OPvPCapturePointTF::Update(uint32 diff)
{
// can update even in locked state if gathers the controlling faction
bool canupdate = ((((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled() > 0) && m_activePlayers[0].size() > m_activePlayers[1].size()) ||
((((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled() > 0) && m_activePlayers[0].size() < m_activePlayers[1].size());
// if gathers the other faction, then only update if the pvp is unlocked
canupdate = canupdate || !((OutdoorPvPTF*)m_PvP)->IsLocked();
return canupdate && OPvPCapturePoint::Update(diff);
}
void OPvPCapturePointTF::ChangeState()
{
// if changing from controlling alliance to horde
if (m_OldState == OBJECTIVESTATE_ALLIANCE)
{
if (uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled())
((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A));
}
// if changing from controlling horde to alliance
else if (m_OldState == OBJECTIVESTATE_HORDE)
{
if (uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled())
((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(--horde_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H));
}
uint32 artkit = 21;
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
{
m_TowerState = TF_TOWERSTATE_A;
artkit = 2;
uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled();
if (alliance_towers < TF_TOWER_NUM)
((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A));
for (PlayerSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->AreaExploredOrEventHappens(TF_ALLY_QUEST);
break;
}
case OBJECTIVESTATE_HORDE:
{
m_TowerState = TF_TOWERSTATE_H;
artkit = 1;
uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled();
if (horde_towers < TF_TOWER_NUM)
((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(++horde_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H));
for (PlayerSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->AreaExploredOrEventHappens(TF_HORDE_QUEST);
break;
}
case OBJECTIVESTATE_NEUTRAL:
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_TowerState = TF_TOWERSTATE_N;
break;
}
GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
if (flag)
flag->SetGoArtKit(artkit);
UpdateTowerState();
}
void OPvPCapturePointTF::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(TF_UI_TOWER_SLIDER_DISPLAY, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(TF_UI_TOWER_SLIDER_POS, phase);
// send this too, sometimes it resets :S
SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_neutralValuePct);
}
class OutdoorPvP_terokkar_forest : public OutdoorPvPScript
{
public:
OutdoorPvP_terokkar_forest()
: OutdoorPvPScript("outdoorpvp_tf")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPTF();
}
};
void AddSC_outdoorpvp_tf()
{
new OutdoorPvP_terokkar_forest();
}

View File

@@ -1,188 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_TF_
#define OUTDOOR_PVP_TF_
#include "OutdoorPvP.h"
const uint8 OutdoorPvPTFBuffZonesNum = 5;
const uint32 OutdoorPvPTFBuffZones[OutdoorPvPTFBuffZonesNum] =
{
3519 /*Terokkar Forest*/,
3791 /*Sethekk Halls*/,
3789 /*Shadow Labyrinth*/,
3792 /*Mana-Tombs*/,
3790 /*Auchenai Crypts*/
};
// locked for 6 hours after capture
const uint32 TF_LOCK_TIME = 3600 * 6 * 1000;
// update lock timer every 1/4 minute (overkill, but this way it's sure the timer won't "jump" 2 minutes at once.)
const uint32 TF_LOCK_TIME_UPDATE = 15000;
// blessing of auchindoun
#define TF_CAPTURE_BUFF 33377
const uint32 TF_ALLY_QUEST = 11505;
const uint32 TF_HORDE_QUEST = 11506;
enum OutdoorPvPTF_TowerType
{
TF_TOWER_NW = 0,
TF_TOWER_N,
TF_TOWER_NE,
TF_TOWER_SE,
TF_TOWER_S,
TF_TOWER_NUM
};
const go_type TFCapturePoints[TF_TOWER_NUM] =
{
{183104, 530, -3081.65f, 5335.03f, 17.1853f, -2.14675f, 0.0f, 0.0f, 0.878817f, -0.477159f},
{183411, 530, -2939.9f, 4788.73f, 18.987f, 2.77507f, 0.0f, 0.0f, 0.983255f, 0.182236f},
{183412, 530, -3174.94f, 4440.97f, 16.2281f, 1.86750f, 0.0f, 0.0f, 0.803857f, 0.594823f},
{183413, 530, -3603.31f, 4529.15f, 20.9077f, 0.994838f, 0.0f, 0.0f, 0.477159f, 0.878817f},
{183414, 530, -3812.37f, 4899.3f, 17.7249f, 0.087266f, 0.0f, 0.0f, 0.043619f, 0.999048f}
};
struct tf_tower_world_state
{
uint32 n;
uint32 h;
uint32 a;
};
const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM] =
{
{0xa79, 0xa7a, 0xa7b},
{0xa7e, 0xa7d, 0xa7c},
{0xa82, 0xa81, 0xa80},
{0xa88, 0xa87, 0xa86},
{0xa85, 0xa84, 0xa83}
};
const uint32 TFTowerPlayerEnterEvents[TF_TOWER_NUM] =
{
12226,
12497,
12486,
12499,
12501
};
const uint32 TFTowerPlayerLeaveEvents[TF_TOWER_NUM] =
{
12225,
12496,
12487,
12498,
12500
};
enum TFWorldStates
{
TF_UI_TOWER_SLIDER_POS = 0xa41,
TF_UI_TOWER_SLIDER_N = 0xa40,
TF_UI_TOWER_SLIDER_DISPLAY = 0xa3f,
TF_UI_TOWER_COUNT_H = 0xa3e,
TF_UI_TOWER_COUNT_A = 0xa3d,
TF_UI_TOWERS_CONTROLLED_DISPLAY = 0xa3c,
TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 0x9d0,
TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 0x9ce,
TF_UI_LOCKED_TIME_HOURS = 0x9cd,
TF_UI_LOCKED_DISPLAY_NEUTRAL = 0x9cc,
TF_UI_LOCKED_DISPLAY_HORDE = 0xad0,
TF_UI_LOCKED_DISPLAY_ALLIANCE = 0xacf
};
enum TFTowerStates
{
TF_TOWERSTATE_N = 1,
TF_TOWERSTATE_H = 2,
TF_TOWERSTATE_A = 4
};
class OPvPCapturePointTF : public OPvPCapturePoint
{
public:
OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type);
bool Update(uint32 diff);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
void UpdateTowerState();
protected:
OutdoorPvPTF_TowerType m_TowerType;
uint32 m_TowerState;
};
class OutdoorPvPTF : public OutdoorPvP
{
public:
OutdoorPvPTF();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
uint32 GetHordeTowersControlled() const;
void SetHordeTowersControlled(uint32 count);
bool IsLocked() const;
private:
bool m_IsLocked;
uint32 m_LockTimer;
uint32 m_LockTimerUpdate;
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
uint32 hours_left, second_digit, first_digit;
};
#endif

View File

@@ -1,472 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "OutdoorPvPZM.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "Player.h"
#include "Creature.h"
#include "ObjectAccessor.h"
#include "WorldPacket.h"
#include "GossipDef.h"
#include "World.h"
OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type)
: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N)
{
SetCapturePointData(ZMCapturePoints[type].entry, ZMCapturePoints[type].map, ZMCapturePoints[type].x, ZMCapturePoints[type].y, ZMCapturePoints[type].z, ZMCapturePoints[type].o, ZMCapturePoints[type].rot0, ZMCapturePoints[type].rot1, ZMCapturePoints[type].rot2, ZMCapturePoints[type].rot3);
}
void OPvPCapturePointZM_Beacon::FillInitialWorldStates(WorldPacket &data)
{
data << uint32(ZMBeaconInfo[m_TowerType].ui_tower_n) << uint32(bool(m_TowerState & ZM_TOWERSTATE_N));
data << uint32(ZMBeaconInfo[m_TowerType].map_tower_n) << uint32(bool(m_TowerState & ZM_TOWERSTATE_N));
data << uint32(ZMBeaconInfo[m_TowerType].ui_tower_a) << uint32(bool(m_TowerState & ZM_TOWERSTATE_A));
data << uint32(ZMBeaconInfo[m_TowerType].map_tower_a) << uint32(bool(m_TowerState & ZM_TOWERSTATE_A));
data << uint32(ZMBeaconInfo[m_TowerType].ui_tower_h) << uint32(bool(m_TowerState & ZM_TOWERSTATE_H));
data << uint32(ZMBeaconInfo[m_TowerType].map_tower_h) << uint32(bool(m_TowerState & ZM_TOWERSTATE_H));
}
void OPvPCapturePointZM_Beacon::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].ui_tower_n), uint32(bool(m_TowerState & ZM_TOWERSTATE_N)));
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_n), uint32(bool(m_TowerState & ZM_TOWERSTATE_N)));
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].ui_tower_a), uint32(bool(m_TowerState & ZM_TOWERSTATE_A)));
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_a), uint32(bool(m_TowerState & ZM_TOWERSTATE_A)));
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].ui_tower_h), uint32(bool(m_TowerState & ZM_TOWERSTATE_H)));
m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_h), uint32(bool(m_TowerState & ZM_TOWERSTATE_H)));
}
bool OPvPCapturePointZM_Beacon::HandlePlayerEnter(Player* player)
{
if (OPvPCapturePoint::HandlePlayerEnter(player))
{
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 1);
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_pos, phase);
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_n, m_neutralValuePct);
return true;
}
return false;
}
void OPvPCapturePointZM_Beacon::HandlePlayerLeave(Player* player)
{
player->SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 0);
OPvPCapturePoint::HandlePlayerLeave(player);
}
void OPvPCapturePointZM_Beacon::ChangeState()
{
// if changing from controlling alliance to horde
if (m_OldState == OBJECTIVESTATE_ALLIANCE)
{
if (uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled())
((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType]));
}
// if changing from controlling horde to alliance
else if (m_OldState == OBJECTIVESTATE_HORDE)
{
if (uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled())
((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(--horde_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType]));
}
switch (m_State)
{
case OBJECTIVESTATE_ALLIANCE:
{
m_TowerState = ZM_TOWERSTATE_A;
uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled();
if (alliance_towers < ZM_NUM_BEACONS)
((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType]));
break;
}
case OBJECTIVESTATE_HORDE:
{
m_TowerState = ZM_TOWERSTATE_H;
uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled();
if (horde_towers < ZM_NUM_BEACONS)
((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(++horde_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType]));
break;
}
case OBJECTIVESTATE_NEUTRAL:
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
m_TowerState = ZM_TOWERSTATE_N;
break;
}
UpdateTowerState();
}
void OPvPCapturePointZM_Beacon::SendChangePhase()
{
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_disp, 1);
// send these updates to only the ones in this objective
uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_pos, phase);
SendUpdateWorldState(ZMBeaconInfo[m_TowerType].slider_n, m_neutralValuePct);
}
bool OutdoorPvPZM::Update(uint32 diff)
{
bool changed = OutdoorPvP::Update(diff);
if (changed)
{
if (m_AllianceTowersControlled == ZM_NUM_BEACONS)
m_GraveYard->SetBeaconState(TEAM_ALLIANCE);
else if (m_HordeTowersControlled == ZM_NUM_BEACONS)
m_GraveYard->SetBeaconState(TEAM_HORDE);
else
m_GraveYard->SetBeaconState(TEAM_NEUTRAL);
}
return changed;
}
void OutdoorPvPZM::HandlePlayerEnterZone(Player* player, uint32 zone)
{
if (player->GetTeamId() == TEAM_ALLIANCE)
{
if (m_GraveYard->GetGraveYardState() & ZM_GRAVEYARD_A)
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
}
else
{
if (m_GraveYard->GetGraveYardState() & ZM_GRAVEYARD_H)
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
}
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
void OutdoorPvPZM::HandlePlayerLeaveZone(Player* player, uint32 zone)
{
// remove buffs
player->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
// remove flag
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
OutdoorPvPZM::OutdoorPvPZM()
{
m_TypeId = OUTDOOR_PVP_ZM;
m_GraveYard = NULL;
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
}
bool OutdoorPvPZM::SetupOutdoorPvP()
{
m_AllianceTowersControlled = 0;
m_HordeTowersControlled = 0;
// add the zones affected by the pvp buff
for (uint8 i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
RegisterZone(OutdoorPvPZMBuffZones[i]);
AddCapturePoint(new OPvPCapturePointZM_Beacon(this, ZM_BEACON_WEST));
AddCapturePoint(new OPvPCapturePointZM_Beacon(this, ZM_BEACON_EAST));
m_GraveYard = new OPvPCapturePointZM_GraveYard(this);
AddCapturePoint(m_GraveYard); // though the update function isn't used, the handleusego is!
return true;
}
void OutdoorPvPZM::HandleKillImpl(Player* player, Unit* killed)
{
if (killed->GetTypeId() != TYPEID_PLAYER)
return;
if (player->GetTeamId() == TEAM_ALLIANCE && killed->ToPlayer()->GetTeamId() != TEAM_ALLIANCE)
player->CastSpell(player, ZM_AlliancePlayerKillReward, true);
else if (player->GetTeamId() == TEAM_HORDE && killed->ToPlayer()->GetTeamId() != TEAM_HORDE)
player->CastSpell(player, ZM_HordePlayerKillReward, true);
}
bool OPvPCapturePointZM_GraveYard::Update(uint32 /*diff*/)
{
bool retval = m_State != m_OldState;
m_State = m_OldState;
return retval;
}
int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
{
int32 retval = OPvPCapturePoint::HandleOpenGo(player, guid);
if (retval >= 0)
{
if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A)
{
if (m_GraveYardState == ZM_GRAVEYARD_H)
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H));
m_GraveYardState = ZM_GRAVEYARD_A;
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
AddObject(0, ZM_Banner_A.entry, ZM_Banner_A.map, ZM_Banner_A.x, ZM_Banner_A.y, ZM_Banner_A.z, ZM_Banner_A.o, ZM_Banner_A.rot0, ZM_Banner_A.rot1, ZM_Banner_A.rot2, ZM_Banner_A.rot3);
sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE); // rem gy
sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE, false); // add gy
m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF, 0, player);
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A));
}
else if (player->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H)
{
if (m_GraveYardState == ZM_GRAVEYARD_A)
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A));
m_GraveYardState = ZM_GRAVEYARD_H;
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
AddObject(0, ZM_Banner_H.entry, ZM_Banner_H.map, ZM_Banner_H.x, ZM_Banner_H.y, ZM_Banner_H.z, ZM_Banner_H.o, ZM_Banner_H.rot0, ZM_Banner_H.rot1, ZM_Banner_H.rot2, ZM_Banner_H.rot3);
sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE); // rem gy
sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE, false); // add gy
m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF, 0, player);
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H));
}
UpdateTowerState();
}
return retval;
}
OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp)
: OPvPCapturePoint(pvp)
{
m_BothControllingFactionId = TEAM_NEUTRAL;
m_GraveYardState = ZM_GRAVEYARD_N;
m_FlagCarrierGUID = 0;
// add field scouts here
AddCreature(ZM_ALLIANCE_FIELD_SCOUT, ZM_AllianceFieldScout.entry, ZM_AllianceFieldScout.map, ZM_AllianceFieldScout.x, ZM_AllianceFieldScout.y, ZM_AllianceFieldScout.z, ZM_AllianceFieldScout.o);
AddCreature(ZM_HORDE_FIELD_SCOUT, ZM_HordeFieldScout.entry, ZM_HordeFieldScout.map, ZM_HordeFieldScout.x, ZM_HordeFieldScout.y, ZM_HordeFieldScout.z, ZM_HordeFieldScout.o);
// add neutral banner
AddObject(0, ZM_Banner_N.entry, ZM_Banner_N.map, ZM_Banner_N.x, ZM_Banner_N.y, ZM_Banner_N.z, ZM_Banner_N.o, ZM_Banner_N.rot0, ZM_Banner_N.rot1, ZM_Banner_N.rot2, ZM_Banner_N.rot3);
}
void OPvPCapturePointZM_GraveYard::UpdateTowerState()
{
m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, uint32(bool(m_GraveYardState & ZM_GRAVEYARD_N)));
m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, uint32(bool(m_GraveYardState & ZM_GRAVEYARD_H)));
m_PvP->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, uint32(bool(m_GraveYardState & ZM_GRAVEYARD_A)));
m_PvP->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, uint32(m_BothControllingFactionId == TEAM_ALLIANCE));
m_PvP->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, uint32(m_BothControllingFactionId != TEAM_ALLIANCE));
m_PvP->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, uint32(m_BothControllingFactionId == TEAM_HORDE));
m_PvP->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, uint32(m_BothControllingFactionId != TEAM_HORDE));
}
void OPvPCapturePointZM_GraveYard::FillInitialWorldStates(WorldPacket &data)
{
data << ZM_MAP_GRAVEYARD_N << uint32(bool(m_GraveYardState & ZM_GRAVEYARD_N));
data << ZM_MAP_GRAVEYARD_H << uint32(bool(m_GraveYardState & ZM_GRAVEYARD_H));
data << ZM_MAP_GRAVEYARD_A << uint32(bool(m_GraveYardState & ZM_GRAVEYARD_A));
data << ZM_MAP_ALLIANCE_FLAG_READY << uint32(m_BothControllingFactionId == TEAM_ALLIANCE);
data << ZM_MAP_ALLIANCE_FLAG_NOT_READY << uint32(m_BothControllingFactionId != TEAM_ALLIANCE);
data << ZM_MAP_HORDE_FLAG_READY << uint32(m_BothControllingFactionId == TEAM_HORDE);
data << ZM_MAP_HORDE_FLAG_NOT_READY << uint32(m_BothControllingFactionId != TEAM_HORDE);
}
void OPvPCapturePointZM_GraveYard::SetBeaconState(TeamId controlling_factionId)
{
// nothing to do here
if (m_BothControllingFactionId == controlling_factionId)
return;
m_BothControllingFactionId = controlling_factionId;
switch (controlling_factionId)
{
case TEAM_ALLIANCE:
// if ally already controls the gy and taken back both beacons, return, nothing to do for us
if (m_GraveYardState & ZM_GRAVEYARD_A)
return;
// ally doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
break;
case TEAM_HORDE:
// if horde already controls the gy and taken back both beacons, return, nothing to do for us
if (m_GraveYardState & ZM_GRAVEYARD_H)
return;
// horde doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
break;
default:
// if the graveyard is not neutral, then leave it that way
// if the graveyard is neutral, then we have to dispel the buff from the flag carrier
if (m_GraveYardState & ZM_GRAVEYARD_N)
{
// gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy
if (m_FlagCarrierGUID)
{
// remove flag from carrier, reset flag carrier guid
Player* p = ObjectAccessor::FindPlayer(m_FlagCarrierGUID);
if (p)
{
p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
}
m_FlagCarrierGUID = 0;
}
}
break;
}
// send worldstateupdate
UpdateTowerState();
}
bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, GossipMenuItems const& /*gso*/)
{
uint64 guid = c->GetGUID();
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
if (itr != m_CreatureTypes.end())
{
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && player->GetTeamId() == TEAM_ALLIANCE && m_BothControllingFactionId == TEAM_ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
return true;
else if (itr->second == ZM_HORDE_FIELD_SCOUT && player->GetTeamId() == TEAM_HORDE && m_BothControllingFactionId == TEAM_HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H)
return true;
}
return false;
}
bool OPvPCapturePointZM_GraveYard::HandleGossipOption(Player* player, uint64 guid, uint32 /*gossipid*/)
{
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
if (itr != m_CreatureTypes.end())
{
Creature* cr = HashMapHolder<Creature>::Find(guid);
if (!cr)
return true;
// if the flag is already taken, then return
if (m_FlagCarrierGUID)
return true;
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT)
{
cr->CastSpell(player, ZM_BATTLE_STANDARD_A, true);
m_FlagCarrierGUID = player->GetGUID();
}
else if (itr->second == ZM_HORDE_FIELD_SCOUT)
{
cr->CastSpell(player, ZM_BATTLE_STANDARD_H, true);
m_FlagCarrierGUID = player->GetGUID();
}
UpdateTowerState();
player->PlayerTalkClass->SendCloseGossip();
return true;
}
return false;
}
bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spellId)
{
switch (spellId)
{
case ZM_BATTLE_STANDARD_A:
m_FlagCarrierGUID = 0;
return true;
case ZM_BATTLE_STANDARD_H:
m_FlagCarrierGUID = 0;
return true;
}
return false;
}
uint32 OPvPCapturePointZM_GraveYard::GetGraveYardState() const
{
return m_GraveYardState;
}
uint32 OutdoorPvPZM::GetAllianceTowersControlled() const
{
return m_AllianceTowersControlled;
}
void OutdoorPvPZM::SetAllianceTowersControlled(uint32 count)
{
m_AllianceTowersControlled = count;
}
uint32 OutdoorPvPZM::GetHordeTowersControlled() const
{
return m_HordeTowersControlled;
}
void OutdoorPvPZM::SetHordeTowersControlled(uint32 count)
{
m_HordeTowersControlled = count;
}
void OutdoorPvPZM::FillInitialWorldStates(WorldPacket &data)
{
data << ZM_WORLDSTATE_UNK_1 << uint32(1);
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
{
itr->second->FillInitialWorldStates(data);
}
}
void OutdoorPvPZM::SendRemoveWorldStates(Player* player)
{
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_W, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_W, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_W, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_N_E, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_POS_E, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_SLIDER_DISPLAY_E, 0);
player->SendUpdateWorldState(ZM_WORLDSTATE_UNK_1, 1);
player->SendUpdateWorldState(ZM_UI_TOWER_EAST_N, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_EAST_H, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_EAST_A, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_WEST_N, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_WEST_H, 0);
player->SendUpdateWorldState(ZM_UI_TOWER_WEST_A, 0);
player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_N, 0);
player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_H, 0);
player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_A, 0);
player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, 0);
player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, 0);
player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, 0);
player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_N, 0);
player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_H, 0);
player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_A, 0);
player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, 0);
player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, 0);
player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, 0);
player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, 0);
}
class OutdoorPvP_zangarmarsh : public OutdoorPvPScript
{
public:
OutdoorPvP_zangarmarsh()
: OutdoorPvPScript("outdoorpvp_zm")
{
}
OutdoorPvP* GetOutdoorPvP() const
{
return new OutdoorPvPZM();
}
};
void AddSC_outdoorpvp_zm()
{
new OutdoorPvP_zangarmarsh();
}

View File

@@ -1,270 +0,0 @@
/*
* Copyright (C)
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_ZM_
#define OUTDOOR_PVP_ZM_
#include "Language.h"
#include "OutdoorPvP.h"
const uint8 OutdoorPvPZMBuffZonesNum = 5;
// the buff is cast in these zones
const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum] = {3521, 3607, 3717, 3715, 3716};
// linked when the central tower is controlled
const uint32 ZM_GRAVEYARD_ZONE = 3521;
// linked when the central tower is controlled
const uint32 ZM_GRAVEYARD_ID = 969;
enum OutdoorPvPZMSpells
{
// cast on the players of the controlling faction
ZM_CAPTURE_BUFF = 33779, // twin spire blessing
// spell that the field scout casts on the player to carry the flag
ZM_BATTLE_STANDARD_A = 32430,
// spell that the field scout casts on the player to carry the flag
ZM_BATTLE_STANDARD_H = 32431,
// token create spell
ZM_AlliancePlayerKillReward = 32155,
// token create spell
ZM_HordePlayerKillReward = 32158
};
// banners 182527, 182528, 182529, gotta check them ingame
const go_type ZM_Banner_A = { 182527, 530, 253.54f, 7083.81f, 36.7728f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f };
const go_type ZM_Banner_H = { 182528, 530, 253.54f, 7083.81f, 36.7728f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f };
const go_type ZM_Banner_N = { 182529, 530, 253.54f, 7083.81f, 36.7728f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f };
// horde field scout spawn data
const creature_type ZM_HordeFieldScout = {18564, 530, 296.625f, 7818.4f, 42.6294f, 5.18363f};
// alliance field scout spawn data
const creature_type ZM_AllianceFieldScout = {18581, 530, 374.395f, 6230.08f, 22.8351f, 0.593412f};
enum ZMCreatureTypes
{
ZM_ALLIANCE_FIELD_SCOUT = 0,
ZM_HORDE_FIELD_SCOUT,
ZM_CREATURE_NUM
};
struct zm_beacon
{
uint32 slider_disp;
uint32 slider_n;
uint32 slider_pos;
uint32 ui_tower_n;
uint32 ui_tower_h;
uint32 ui_tower_a;
uint32 map_tower_n;
uint32 map_tower_h;
uint32 map_tower_a;
uint32 event_enter;
uint32 event_leave;
};
enum ZM_BeaconType
{
ZM_BEACON_EAST = 0,
ZM_BEACON_WEST,
ZM_NUM_BEACONS
};
const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS] =
{
{2533, 2535, 2534, 2560, 2559, 2558, 2652, 2651, 2650, 11807, 11806},
{2527, 2529, 2528, 2557, 2556, 2555, 2646, 2645, 2644, 11805, 11804}
};
const uint32 ZMBeaconCaptureA[ZM_NUM_BEACONS] =
{
LANG_OPVP_ZM_CAPTURE_EAST_A,
LANG_OPVP_ZM_CAPTURE_WEST_A
};
const uint32 ZMBeaconCaptureH[ZM_NUM_BEACONS] =
{
LANG_OPVP_ZM_CAPTURE_EAST_H,
LANG_OPVP_ZM_CAPTURE_WEST_H
};
const uint32 ZMBeaconLoseA[ZM_NUM_BEACONS] =
{
LANG_OPVP_ZM_LOSE_EAST_A,
LANG_OPVP_ZM_LOSE_WEST_A
};
const uint32 ZMBeaconLoseH[ZM_NUM_BEACONS] =
{
LANG_OPVP_ZM_LOSE_EAST_H,
LANG_OPVP_ZM_LOSE_WEST_H
};
const go_type ZMCapturePoints[ZM_NUM_BEACONS] =
{
{182523, 530, 303.243f, 6841.36f, 40.1245f, -1.58825f, 0.0f, 0.0f, 0.71325f, -0.700909f},
{182522, 530, 336.466f, 7340.26f, 41.4984f, -1.58825f, 0.0f, 0.0f, 0.71325f, -0.700909f}
};
enum OutdoorPvPZMWorldStates
{
ZM_UI_TOWER_SLIDER_N_W = 2529,
ZM_UI_TOWER_SLIDER_POS_W = 2528,
ZM_UI_TOWER_SLIDER_DISPLAY_W = 2527,
ZM_UI_TOWER_SLIDER_N_E = 2535,
ZM_UI_TOWER_SLIDER_POS_E = 2534,
ZM_UI_TOWER_SLIDER_DISPLAY_E = 2533,
ZM_WORLDSTATE_UNK_1 = 2653,
ZM_UI_TOWER_EAST_N = 2560,
ZM_UI_TOWER_EAST_H = 2559,
ZM_UI_TOWER_EAST_A = 2558,
ZM_UI_TOWER_WEST_N = 2557,
ZM_UI_TOWER_WEST_H = 2556,
ZM_UI_TOWER_WEST_A = 2555,
ZM_MAP_TOWER_EAST_N = 2652,
ZM_MAP_TOWER_EAST_H = 2651,
ZM_MAP_TOWER_EAST_A = 2650,
ZM_MAP_GRAVEYARD_H = 2649,
ZM_MAP_GRAVEYARD_A = 2648,
ZM_MAP_GRAVEYARD_N = 2647,
ZM_MAP_TOWER_WEST_N = 2646,
ZM_MAP_TOWER_WEST_H = 2645,
ZM_MAP_TOWER_WEST_A = 2644,
ZM_MAP_HORDE_FLAG_READY = 2658,
ZM_MAP_HORDE_FLAG_NOT_READY = 2657,
ZM_MAP_ALLIANCE_FLAG_NOT_READY = 2656,
ZM_MAP_ALLIANCE_FLAG_READY = 2655
};
enum ZM_TowerStateMask
{
ZM_TOWERSTATE_N = 1,
ZM_TOWERSTATE_A = 2,
ZM_TOWERSTATE_H = 4
};
class OutdoorPvPZM;
class OPvPCapturePointZM_Beacon : public OPvPCapturePoint
{
public:
OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
void UpdateTowerState();
protected:
ZM_BeaconType m_TowerType;
uint32 m_TowerState;
};
enum ZM_GraveYardState
{
ZM_GRAVEYARD_N = 1,
ZM_GRAVEYARD_A = 2,
ZM_GRAVEYARD_H = 4
};
class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
{
public:
OPvPCapturePointZM_GraveYard(OutdoorPvP* pvp);
bool Update(uint32 diff);
void ChangeState() {}
void FillInitialWorldStates(WorldPacket & data);
void UpdateTowerState();
int32 HandleOpenGo(Player* player, uint64 guid);
void SetBeaconState(TeamId controlling_teamId); // not good atm
bool HandleGossipOption(Player* player, uint64 guid, uint32 gossipid);
bool HandleDropFlag(Player* player, uint32 spellId);
bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso);
uint32 GetGraveYardState() const;
private:
uint32 m_GraveYardState;
protected:
TeamId m_BothControllingFactionId;
uint64 m_FlagCarrierGUID;
};
class OutdoorPvPZM : public OutdoorPvP
{
public:
OutdoorPvPZM();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
void HandleKillImpl(Player* player, Unit* killed);
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
uint32 GetHordeTowersControlled() const;
void SetHordeTowersControlled(uint32 count);
private:
OPvPCapturePointZM_GraveYard * m_GraveYard;
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
};
// todo: flag carrier death/leave/mount/activitychange should give back the gossip options
#endif