*Some work on wintergrasp. Player can get ranks by killing other players and can build vehicles at workshop. Vehicles can be used to destroy buildings. Except these no other thing is done.
--HG-- branch : trunk
This commit is contained in:
@@ -293,6 +293,9 @@ SET(game_STAT_SRCS
|
||||
GroupReference.cpp
|
||||
GroupReference.h
|
||||
GroupRefManager.h
|
||||
OutdoorPvPImpl.h
|
||||
Wintergrasp.h
|
||||
Wintergrasp.cpp
|
||||
)
|
||||
|
||||
add_library(game STATIC ${game_STAT_SRCS})
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
@@ -776,3 +777,7 @@ bool OutdoorPvP::HandleAreaTrigger(Player *plr, uint32 trigger)
|
||||
return false;
|
||||
}
|
||||
|
||||
void OutdoorPvP::RegisterZone(uint32 zoneId)
|
||||
{
|
||||
sOutdoorPvPMgr.AddZone(zoneId, this);
|
||||
}
|
||||
|
||||
+10
-16
@@ -26,23 +26,15 @@
|
||||
|
||||
#define OPVP_TRIGGER_CREATURE_ENTRY 12999
|
||||
|
||||
enum ObjectiveStates{
|
||||
OBJECTIVESTATE_NEUTRAL = 0,
|
||||
OBJECTIVESTATE_ALLIANCE = 1,
|
||||
OBJECTIVESTATE_HORDE = 2,
|
||||
OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE = 3,
|
||||
OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE = 4,
|
||||
OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE = 5,
|
||||
OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE = 6
|
||||
};
|
||||
|
||||
enum OutdoorPvPTypes{
|
||||
enum OutdoorPvPTypes
|
||||
{
|
||||
OUTDOOR_PVP_HP = 1,
|
||||
OUTDOOR_PVP_NA = 2,
|
||||
OUTDOOR_PVP_TF = 3,
|
||||
OUTDOOR_PVP_ZM = 4,
|
||||
OUTDOOR_PVP_SI = 5,
|
||||
OUTDOOR_PVP_EP = 6
|
||||
OUTDOOR_PVP_NA,
|
||||
OUTDOOR_PVP_TF,
|
||||
OUTDOOR_PVP_ZM,
|
||||
OUTDOOR_PVP_SI,
|
||||
OUTDOOR_PVP_EP,
|
||||
OPVP_WINTERGRASP,
|
||||
};
|
||||
|
||||
// struct for go spawning
|
||||
@@ -220,6 +212,8 @@ protected:
|
||||
// players in the zones of this outdoorpvp, 0 - alliance, 1 - horde
|
||||
std::set<uint64> m_PlayerGuids[2];
|
||||
uint32 m_TypeId;
|
||||
|
||||
void RegisterZone(uint32 zoneid);
|
||||
};
|
||||
|
||||
#endif /*OUTDOOR_PVP_H_*/
|
||||
|
||||
@@ -789,7 +789,7 @@ OutdoorPvPEP::OutdoorPvPEP()
|
||||
bool OutdoorPvPEP::SetupOutdoorPvP()
|
||||
{
|
||||
for(int i = 0; i < EPBuffZonesNum; ++i)
|
||||
sOutdoorPvPMgr.AddZone(EPBuffZones[i],this);
|
||||
RegisterZone(EPBuffZones[i]);
|
||||
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveEP_EWT(this));
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveEP_PWT(this));
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef OUTDOOR_PVP_EP_
|
||||
#define OUTDOOR_PVP_EP_
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
|
||||
#include "DBCStructure.h"
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ bool OutdoorPvPHP::SetupOutdoorPvP()
|
||||
m_HordeTowersControlled = 0;
|
||||
// add the zones affected by the pvp buff
|
||||
for(int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
|
||||
sOutdoorPvPMgr.AddZone(OutdoorPvPHPBuffZones[i],this);
|
||||
RegisterZone(OutdoorPvPHPBuffZones[i]);
|
||||
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveHP(this,HP_TOWER_BROKEN_HILL));
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef OUTDOOR_PVP_HP_
|
||||
#define OUTDOOR_PVP_HP_
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
|
||||
#define OutdoorPvPHPBuffZonesNum 6
|
||||
// HP, citadel, ramparts, blood furnace, shattered halls, mag's lair
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef OUTDOORPVP_IMPL_H
|
||||
#define OUTDOORPVP_IMPL_H
|
||||
|
||||
#include "SharedDefines.h"
|
||||
#include "OutdoorPvP.h"
|
||||
#include "Player.h"
|
||||
|
||||
#define TEAM_ID(a) (a == ALLIANCE ? 0 : 1)
|
||||
|
||||
enum ObjectiveStates
|
||||
{
|
||||
OBJECTIVESTATE_NEUTRAL = 0,
|
||||
OBJECTIVESTATE_ALLIANCE,
|
||||
OBJECTIVESTATE_HORDE,
|
||||
OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE,
|
||||
OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE,
|
||||
OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE,
|
||||
OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "OutdoorPvPZM.h"
|
||||
#include "OutdoorPvPSI.h"
|
||||
#include "OutdoorPvPEP.h"
|
||||
#include "Wintergrasp.h"
|
||||
#include "Player.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
|
||||
@@ -125,6 +126,19 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
m_OutdoorPvPSet.push_back(pOP);
|
||||
sLog.outDebug("OutdoorPvP : EP successfully initiated.");
|
||||
}
|
||||
|
||||
pOP = new OPvPWintergrasp;
|
||||
// respawn, init variables
|
||||
if(!pOP->SetupOutdoorPvP())
|
||||
{
|
||||
sLog.outDebug("OutdoorPvP : Wintergrasp init failed.");
|
||||
delete pOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OutdoorPvPSet.push_back(pOP);
|
||||
sLog.outDebug("OutdoorPvP : Wintergrasp successfully initiated.");
|
||||
}
|
||||
}
|
||||
|
||||
void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP *handle)
|
||||
|
||||
@@ -256,7 +256,7 @@ 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
|
||||
sOutdoorPvPMgr.AddZone(NA_BUFF_ZONE,this);
|
||||
RegisterZone(NA_BUFF_ZONE);
|
||||
|
||||
// halaa
|
||||
m_obj = new OutdoorPvPObjectiveNA(this);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
// TODO: "sometimes" set to neutral
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
|
||||
// kill credit for pks
|
||||
const uint32 NA_CREDIT_MARKER = 24867;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "Player.h"
|
||||
#include "Unit.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
#include "World.h"
|
||||
|
||||
#define MAX_OUTDOOR_PVP_DISTANCE 200 // the max value in capture point type go data0 is 100 currently, so use twice that much to handle leaving as well
|
||||
|
||||
@@ -58,7 +58,7 @@ void OutdoorPvPSI::UpdateWorldState()
|
||||
bool OutdoorPvPSI::SetupOutdoorPvP()
|
||||
{
|
||||
for(int i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
|
||||
sOutdoorPvPMgr.AddZone(OutdoorPvPSIBuffZones[i],this);
|
||||
RegisterZone(OutdoorPvPSIBuffZones[i]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef OUTDOOR_PVP_SI_
|
||||
#define OUTDOOR_PVP_SI_
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
|
||||
const uint32 SI_SILITHYST_FLAG_GO_SPELL = 29518;
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ bool OutdoorPvPTF::SetupOutdoorPvP()
|
||||
|
||||
// add the zones affected by the pvp buff
|
||||
for(int i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
|
||||
sOutdoorPvPMgr.AddZone(OutdoorPvPTFBuffZones[i],this);
|
||||
RegisterZone(OutdoorPvPTFBuffZones[i]);
|
||||
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveTF(this,TF_TOWER_NW));
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveTF(this,TF_TOWER_N));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef OUTDOOR_PVP_TF_
|
||||
#define OUTDOOR_PVP_TF_
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
|
||||
const uint32 OutdoorPvPTFBuffZonesNum = 5;
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ bool OutdoorPvPZM::SetupOutdoorPvP()
|
||||
|
||||
// add the zones affected by the pvp buff
|
||||
for(int i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
|
||||
sOutdoorPvPMgr.AddZone(OutdoorPvPZMBuffZones[i],this);
|
||||
RegisterZone(OutdoorPvPZMBuffZones[i]);
|
||||
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveZM_Beacon(this,ZM_BEACON_WEST));
|
||||
m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveZM_Beacon(this,ZM_BEACON_EAST));
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef OUTDOOR_PVP_ZM_
|
||||
#define OUTDOOR_PVP_ZM_
|
||||
|
||||
#include "OutdoorPvP.h"
|
||||
#include "OutdoorPvPImpl.h"
|
||||
#include "Language.h"
|
||||
|
||||
const uint32 OutdoorPvPZMBuffZonesNum = 5;
|
||||
|
||||
@@ -45,10 +45,11 @@ void Vehicle::AddToWorld()
|
||||
AIM_Initialize();
|
||||
switch(GetEntry())
|
||||
{
|
||||
case 27850:InstallAccessory(27905,1);break;
|
||||
case 28312:InstallAccessory(28319,7);break;
|
||||
case 32627:InstallAccessory(32629,7);break;
|
||||
case 27850:InstallAccessory(27905,1);break;
|
||||
case 28312:InstallAccessory(28319,7);break;
|
||||
case 32627:InstallAccessory(32629,7);break;
|
||||
}
|
||||
//setPowerType(POWER_ENERGY);SetMaxPower(POWER_ENERGY, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +85,9 @@ void Vehicle::setDeathState(DeathState s) // overwrite vir
|
||||
void Vehicle::Update(uint32 diff)
|
||||
{
|
||||
Creature::Update(diff);
|
||||
//310
|
||||
//if(getPowerType() == POWER_ENERGY)
|
||||
// ModifyPower(POWER_ENERGY, 1);
|
||||
}
|
||||
|
||||
bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team)
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Wintergrasp.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
bool OPvPWintergrasp::SetupOutdoorPvP()
|
||||
{
|
||||
RegisterZone(ZONE_WINTERGRASP);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
||||
{
|
||||
if(!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
||||
&& !plr->HasAura(SPELL_LIEUTENANT))
|
||||
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
||||
OutdoorPvP::HandlePlayerEnterZone(plr, zone);
|
||||
}
|
||||
|
||||
void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||
{
|
||||
if(plr->m_Vehicle)
|
||||
plr->m_Vehicle->Dismiss();
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
}
|
||||
|
||||
void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
||||
{
|
||||
if(victim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// We handle promotion here because player should not get promotion if he has buff but do the kill outside the zone
|
||||
if(victim->getLevel() >= 70)
|
||||
{
|
||||
if(Aura *aur = killer->GetAura(SPELL_RECRUIT))
|
||||
{
|
||||
if(aur->GetStackAmount() >= 5)
|
||||
{
|
||||
killer->RemoveAura(SPELL_RECRUIT);
|
||||
killer->CastSpell(killer, SPELL_CORPORAL, true);
|
||||
}
|
||||
else
|
||||
killer->CastSpell(killer, SPELL_RECRUIT, true);
|
||||
}
|
||||
else if(Aura *aur = killer->GetAura(SPELL_CORPORAL))
|
||||
{
|
||||
if(aur->GetStackAmount() >= 5)
|
||||
{
|
||||
killer->RemoveAura(SPELL_CORPORAL);
|
||||
killer->CastSpell(killer, SPELL_LIEUTENANT, true);
|
||||
}
|
||||
else
|
||||
killer->CastSpell(killer, SPELL_CORPORAL, true);
|
||||
}
|
||||
else if(killer->HasAura(SPELL_LIEUTENANT))
|
||||
killer->CastSpell(killer, SPELL_LIEUTENANT, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef TRINITY_WINTERGRASP_H
|
||||
#define TRINITY_WINTERGRASP_H
|
||||
|
||||
#include "OutdoorPvPImpl.h"
|
||||
|
||||
#define ZONE_WINTERGRASP 4197
|
||||
|
||||
#define SPELL_RECRUIT 37795
|
||||
#define SPELL_CORPORAL 33280
|
||||
#define SPELL_LIEUTENANT 55629
|
||||
|
||||
#define SPELL_TENICITY 58549
|
||||
#define SPELL_TENICITY_VEHICLE 59911
|
||||
|
||||
class OPvPWintergrasp : public OutdoorPvP
|
||||
{
|
||||
public:
|
||||
bool SetupOutdoorPvP();
|
||||
void HandlePlayerEnterZone(Player *plr, uint32 zone);
|
||||
void HandlePlayerLeaveZone(Player *plr, uint32 zone);
|
||||
void HandleKill(Player *killer, Unit *victim);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user