*Wintergrasp: Tenacity applied when player resurrects. By Spp
*OutdoorPvP: Implementation of HandlePlayerResurrects. By Spp *Wintergrasp: Fix to honor rewards (DestroyedTower never applied). By Spp *Wintergrasp: Fix to Spirit Healers (werent visible during wartime). By Spp --HG-- branch : trunk
This commit is contained in:
@@ -251,6 +251,10 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
|||||||
sLog.outDebug("Player %s left an outdoorpvp zone", plr->GetName());
|
sLog.outDebug("Player %s left an outdoorpvp zone", plr->GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OutdoorPvP::HandlePlayerResurrects(Player * plr, uint32 zone)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool OutdoorPvP::Update(uint32 diff)
|
bool OutdoorPvP::Update(uint32 diff)
|
||||||
{
|
{
|
||||||
bool objective_changed = false;
|
bool objective_changed = false;
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ protected:
|
|||||||
|
|
||||||
virtual void HandlePlayerEnterZone(Player * plr, uint32 zone);
|
virtual void HandlePlayerEnterZone(Player * plr, uint32 zone);
|
||||||
virtual void HandlePlayerLeaveZone(Player * plr, uint32 zone);
|
virtual void HandlePlayerLeaveZone(Player * plr, uint32 zone);
|
||||||
|
virtual void HandlePlayerResurrects(Player * plr, uint32 zone);
|
||||||
|
|
||||||
void AddCapturePoint(OPvPCapturePoint* cp)
|
void AddCapturePoint(OPvPCapturePoint* cp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -249,3 +249,13 @@ void OutdoorPvPMgr::HandleDropFlag(Player *plr, uint32 spellId)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OutdoorPvPMgr::HandlePlayerResurrects(Player *plr, uint32 zoneid)
|
||||||
|
{
|
||||||
|
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
|
||||||
|
if(itr == m_OutdoorPvPMap.end())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(itr->second->HasPlayer(plr))
|
||||||
|
itr->second->HandlePlayerResurrects(plr, zoneid);
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public:
|
|||||||
void HandlePlayerEnterZone(Player * plr, uint32 areaflag);
|
void HandlePlayerEnterZone(Player * plr, uint32 areaflag);
|
||||||
// called when player leaves an outdoor pvp area
|
// called when player leaves an outdoor pvp area
|
||||||
void HandlePlayerLeaveZone(Player * plr, uint32 areaflag);
|
void HandlePlayerLeaveZone(Player * plr, uint32 areaflag);
|
||||||
|
// called when player resurrects
|
||||||
|
void HandlePlayerResurrects(Player * plr, uint32 areaflag);
|
||||||
// return assigned outdoor pvp
|
// return assigned outdoor pvp
|
||||||
OutdoorPvP * GetOutdoorPvPToZoneId(uint32 zoneid);
|
OutdoorPvP * GetOutdoorPvPToZoneId(uint32 zoneid);
|
||||||
// handle custom (non-exist in dbc) spell if registered
|
// handle custom (non-exist in dbc) spell if registered
|
||||||
|
|||||||
@@ -4411,6 +4411,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
|||||||
uint32 newzone, newarea;
|
uint32 newzone, newarea;
|
||||||
GetZoneAndAreaId(newzone,newarea);
|
GetZoneAndAreaId(newzone,newarea);
|
||||||
UpdateZone(newzone,newarea);
|
UpdateZone(newzone,newarea);
|
||||||
|
sOutdoorPvPMgr.HandlePlayerResurrects(this, newzone);
|
||||||
|
|
||||||
// update visibility
|
// update visibility
|
||||||
//ObjectAccessor::UpdateVisibilityForPlayer(this);
|
//ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||||
|
|||||||
@@ -33,14 +33,15 @@ enum WintergraspQuest
|
|||||||
NO_MERCY_MERCILESS_1 = 13179, //Alliance Quest
|
NO_MERCY_MERCILESS_1 = 13179, //Alliance Quest
|
||||||
|
|
||||||
A_VICTORY_IN_WG = 13181,
|
A_VICTORY_IN_WG = 13181,
|
||||||
H_VICTORY_IN_WG = 13183
|
H_VICTORY_IN_WG = 13183,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CreatureEntry
|
enum CreatureEntry
|
||||||
{
|
{
|
||||||
CRE_ENG_A = 30499,
|
CRE_ENG_A = 30499,
|
||||||
CRE_ENG_H = 30400,
|
CRE_ENG_H = 30400,
|
||||||
CRE_PVP_KILL = 31086 //Quest Objective
|
CRE_PVP_KILL = 31086, //Quest Objective
|
||||||
|
SPIRIT_HEALER = 6491,
|
||||||
};
|
};
|
||||||
|
|
||||||
const TeamPair CreatureEntryPair[] =
|
const TeamPair CreatureEntryPair[] =
|
||||||
@@ -86,6 +87,11 @@ void LoadTeamPair(TeamPairMap &pairMap, const TeamPair *pair)
|
|||||||
|
|
||||||
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
typedef std::list<const AreaPOIEntry *> AreaPOIList;
|
||||||
|
|
||||||
|
OPvPWintergrasp::OPvPWintergrasp()
|
||||||
|
{
|
||||||
|
m_TypeId = OPVP_WINTERGRASP;
|
||||||
|
}
|
||||||
|
|
||||||
bool OPvPWintergrasp::SetupOutdoorPvP()
|
bool OPvPWintergrasp::SetupOutdoorPvP()
|
||||||
{
|
{
|
||||||
if(!sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_ENABLED))
|
if(!sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_ENABLED))
|
||||||
@@ -95,6 +101,8 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
|
|||||||
m_changeDefender = false;
|
m_changeDefender = false;
|
||||||
m_workshopCount[TEAM_ALLIANCE] = 0;
|
m_workshopCount[TEAM_ALLIANCE] = 0;
|
||||||
m_workshopCount[TEAM_HORDE] = 0;
|
m_workshopCount[TEAM_HORDE] = 0;
|
||||||
|
m_tenacityStack = 0;
|
||||||
|
m_gate = NULL;
|
||||||
|
|
||||||
// Select POI
|
// Select POI
|
||||||
AreaPOIList areaPOIs;
|
AreaPOIList areaPOIs;
|
||||||
@@ -433,6 +441,7 @@ WintergraspCreType OPvPWintergrasp::GetCreatureType(uint32 entry) const
|
|||||||
case 32296:case 32294: // Quartermaster
|
case 32296:case 32294: // Quartermaster
|
||||||
case 30870:case 30869: // Flight Masters
|
case 30870:case 30869: // Flight Masters
|
||||||
case 31841:case 31842: // Spirit Guides
|
case 31841:case 31842: // Spirit Guides
|
||||||
|
case SPIRIT_HEALER: // Spirit Healers
|
||||||
return CREATURE_SPECIAL;
|
return CREATURE_SPECIAL;
|
||||||
default:
|
default:
|
||||||
return CREATURE_OTHER; // Revenants, Elementals, etc
|
return CREATURE_OTHER; // Revenants, Elementals, etc
|
||||||
@@ -753,6 +762,19 @@ void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
|||||||
UpdateTenacityStack();
|
UpdateTenacityStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reapply Tenacity if needed
|
||||||
|
void OPvPWintergrasp::HandlePlayerResurrects(Player * plr, uint32 zone)
|
||||||
|
{
|
||||||
|
if (isWarTime() && m_tenacityStack && !plr->HasAura(SPELL_TENACITY) && plr->getLevel() > 69)
|
||||||
|
{
|
||||||
|
int32 newStack = m_tenacityStack < 0 ? -m_tenacityStack : m_tenacityStack;
|
||||||
|
if (newStack > 20)
|
||||||
|
newStack = 20;
|
||||||
|
CastTenacity(plr, newStack);
|
||||||
|
}
|
||||||
|
OutdoorPvP::HandlePlayerResurrects(plr, zone);
|
||||||
|
}
|
||||||
|
|
||||||
void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||||
{
|
{
|
||||||
if (!plr->GetSession()->PlayerLogout())
|
if (!plr->GetSession()->PlayerLogout())
|
||||||
@@ -852,10 +874,18 @@ void OPvPWintergrasp::UpdateTenacityStack()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TeamId team = TEAM_NEUTRAL;
|
TeamId team = TEAM_NEUTRAL;
|
||||||
uint32 allianceNum = m_players[TEAM_ALLIANCE].size();;
|
uint32 allianceNum = 0;
|
||||||
uint32 hordeNum = m_players[TEAM_HORDE].size();;
|
uint32 hordeNum = 0;
|
||||||
int32 newStack = 0;
|
int32 newStack = 0;
|
||||||
|
|
||||||
|
for (PlayerSet::iterator itr = m_players[TEAM_ALLIANCE].begin(); itr != m_players[TEAM_ALLIANCE].end(); ++itr)
|
||||||
|
if ((*itr)->getLevel() > 69)
|
||||||
|
++allianceNum;
|
||||||
|
|
||||||
|
for (PlayerSet::iterator itr = m_players[TEAM_HORDE].begin(); itr != m_players[TEAM_HORDE].end(); ++itr)
|
||||||
|
if ((*itr)->getLevel() > 69)
|
||||||
|
++hordeNum;
|
||||||
|
|
||||||
if (allianceNum && hordeNum)
|
if (allianceNum && hordeNum)
|
||||||
{
|
{
|
||||||
if (allianceNum < hordeNum)
|
if (allianceNum < hordeNum)
|
||||||
@@ -1049,7 +1079,7 @@ void OPvPWintergrasp::EndBattle()
|
|||||||
|
|
||||||
baseHonor = m_customHonorReward[(team == getDefenderTeam()) ? WIN_BATTLE : LOSE_BATTLE];
|
baseHonor = m_customHonorReward[(team == getDefenderTeam()) ? WIN_BATTLE : LOSE_BATTLE];
|
||||||
baseHonor += (m_customHonorReward[DAMAGED_TOWER] * m_towerCount[OTHER_TEAM(team)][DAMAGED_TOWER]);
|
baseHonor += (m_customHonorReward[DAMAGED_TOWER] * m_towerCount[OTHER_TEAM(team)][DAMAGED_TOWER]);
|
||||||
baseHonor += (m_customHonorReward[DESTROYED_TOWER] * m_towerCount[OTHER_TEAM(team)][DAMAGED_TOWER]);
|
baseHonor += (m_customHonorReward[DESTROYED_TOWER] * m_towerCount[OTHER_TEAM(team)][DESTROYED_TOWER]);
|
||||||
baseHonor += (m_customHonorReward[INTACT_BUILDING] * intactNum);
|
baseHonor += (m_customHonorReward[INTACT_BUILDING] * intactNum);
|
||||||
baseHonor += (m_customHonorReward[DAMAGED_BUILDING] * damagedNum);
|
baseHonor += (m_customHonorReward[DAMAGED_BUILDING] * damagedNum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
typedef std::set<Creature*> CreatureSet;
|
typedef std::set<Creature*> CreatureSet;
|
||||||
typedef std::set<GameObject*> GameObjectSet;
|
typedef std::set<GameObject*> GameObjectSet;
|
||||||
public:
|
public:
|
||||||
explicit OPvPWintergrasp() : m_tenacityStack(0), m_gate(NULL) {}
|
OPvPWintergrasp();
|
||||||
bool SetupOutdoorPvP();
|
bool SetupOutdoorPvP();
|
||||||
|
|
||||||
uint32 GetCreatureEntry(uint32 guidlow, const CreatureData *data);
|
uint32 GetCreatureEntry(uint32 guidlow, const CreatureData *data);
|
||||||
@@ -184,6 +184,7 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
|
|
||||||
void HandlePlayerEnterZone(Player *plr, uint32 zone);
|
void HandlePlayerEnterZone(Player *plr, uint32 zone);
|
||||||
void HandlePlayerLeaveZone(Player *plr, uint32 zone);
|
void HandlePlayerLeaveZone(Player *plr, uint32 zone);
|
||||||
|
void HandlePlayerResurrects(Player * plr, uint32 zone);
|
||||||
void HandleKill(Player *killer, Unit *victim);
|
void HandleKill(Player *killer, Unit *victim);
|
||||||
|
|
||||||
bool Update(uint32 diff);
|
bool Update(uint32 diff);
|
||||||
|
|||||||
Reference in New Issue
Block a user