*Give rewards (only to players with rank LIEUTENANT) when battle in wintergrasp ends.
--HG-- branch : trunk
This commit is contained in:
+55
-14
@@ -155,19 +155,6 @@ void OPvPWintergrasp::ProcessEvent(GameObject *obj, uint32 eventId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPvPWintergrasp::ChangeDefender()
|
|
||||||
{
|
|
||||||
m_defender = OTHER_TEAM(m_defender);
|
|
||||||
if(m_defender == TEAM_ALLIANCE)
|
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has taken over the fortress!");
|
|
||||||
else
|
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has taken over the fortress!");
|
|
||||||
UpdateAllWorldObject();
|
|
||||||
|
|
||||||
m_wartime = false;
|
|
||||||
m_timer = 600000; // for test, should be 2 hour 30 min
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, const CreatureData *data)
|
uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, const CreatureData *data)
|
||||||
{
|
{
|
||||||
if(m_defender == TEAM_ALLIANCE)
|
if(m_defender == TEAM_ALLIANCE)
|
||||||
@@ -307,7 +294,7 @@ bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go)
|
|||||||
|
|
||||||
void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
||||||
{
|
{
|
||||||
if(!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
if(m_wartime && !plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)
|
||||||
&& !plr->HasAura(SPELL_LIEUTENANT))
|
&& !plr->HasAura(SPELL_LIEUTENANT))
|
||||||
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
plr->CastSpell(plr, SPELL_RECRUIT, true);
|
||||||
|
|
||||||
@@ -412,6 +399,8 @@ bool OPvPWintergrasp::Update(uint32 diff)
|
|||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has successfully defended the fortress!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has successfully defended the fortress!");
|
||||||
else
|
else
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has successfully defended the fortress!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has successfully defended the fortress!");
|
||||||
|
GiveReward();
|
||||||
|
EndBattle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -419,7 +408,59 @@ bool OPvPWintergrasp::Update(uint32 diff)
|
|||||||
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILISECONDS;
|
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILISECONDS;
|
||||||
sWorld.SendZoneText(ZONE_WINTERGRASP, "Battle begins!");
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Battle begins!");
|
||||||
UpdateAllWorldObject();
|
UpdateAllWorldObject();
|
||||||
|
StartBattle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OPvPWintergrasp::ChangeDefender()
|
||||||
|
{
|
||||||
|
m_wartime = false;
|
||||||
|
m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL) * MINUTE * IN_MILISECONDS;
|
||||||
|
|
||||||
|
m_defender = OTHER_TEAM(m_defender);
|
||||||
|
if(m_defender == TEAM_ALLIANCE)
|
||||||
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Alliance has taken over the fortress!");
|
||||||
|
else
|
||||||
|
sWorld.SendZoneText(ZONE_WINTERGRASP, "Horde has taken over the fortress!");
|
||||||
|
UpdateAllWorldObject();
|
||||||
|
|
||||||
|
GiveReward();
|
||||||
|
EndBattle();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPvPWintergrasp::GiveReward()
|
||||||
|
{
|
||||||
|
for(uint32 team = 0; team < 2; ++team)
|
||||||
|
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
|
if((*itr)->HasAura(SPELL_LIEUTENANT))
|
||||||
|
(*itr)->CastSpell(*itr, team == m_defender ? SPELL_VICTORY_REWARD : SPELL_DEFEAT_REWARD, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPvPWintergrasp::StartBattle()
|
||||||
|
{
|
||||||
|
for(uint32 team = 0; team < 2; ++team)
|
||||||
|
{
|
||||||
|
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
|
{
|
||||||
|
(*itr)->RemoveAura(SPELL_RECRUIT);
|
||||||
|
(*itr)->RemoveAura(SPELL_CORPORAL);
|
||||||
|
(*itr)->RemoveAura(SPELL_LIEUTENANT);
|
||||||
|
(*itr)->CastSpell(*itr, SPELL_RECRUIT, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPvPWintergrasp::EndBattle()
|
||||||
|
{
|
||||||
|
for(uint32 team = 0; team < 2; ++team)
|
||||||
|
{
|
||||||
|
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||||
|
{
|
||||||
|
(*itr)->RemoveAura(SPELL_RECRUIT);
|
||||||
|
(*itr)->RemoveAura(SPELL_CORPORAL);
|
||||||
|
(*itr)->RemoveAura(SPELL_LIEUTENANT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,6 +35,38 @@ const uint32 WintergraspFaction[2] = {1732, 1735};
|
|||||||
#define SPELL_TENACITY 58549
|
#define SPELL_TENACITY 58549
|
||||||
#define SPELL_TENACITY_VEHICLE 59911
|
#define SPELL_TENACITY_VEHICLE 59911
|
||||||
|
|
||||||
|
#define SPELL_VICTORY_REWARD 56902
|
||||||
|
#define SPELL_DEFEAT_REWARD 58494
|
||||||
|
|
||||||
|
const uint32 WG_KEEP_CM = 0; //Need data
|
||||||
|
const uint32 WG_RULERS_BUFF = 52108;
|
||||||
|
//some cosmetics :D
|
||||||
|
const uint32 WG_VICTORY_AURA = 60044;
|
||||||
|
|
||||||
|
const uint32 WG_SHUTDOWN_CAST = 21247;
|
||||||
|
|
||||||
|
enum OutdoorPvP_WG_Sounds
|
||||||
|
{
|
||||||
|
/*TODO OutdoorPvP_WG_SOUND_KEEP_CLAIMED = 8192,
|
||||||
|
OutdoorPvP_WG_SOUND_KEEP_CAPTURED_ALLIANCE = 8173,
|
||||||
|
OutdoorPvP_WG_SOUND_KEEP_CAPTURED_HORDE = 8213,
|
||||||
|
OutdoorPvP_WG_SOUND_KEEP_ASSAULTED_ALLIANCE = 8212,
|
||||||
|
OutdoorPvP_WG_SOUND_KEEP_ASSAULTED_HORDE = 8174,
|
||||||
|
OutdoorPvP_WG_SOUND_NEAR_VICTORY = 8456
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
enum OutdoorPvP_WG_KeepStatus
|
||||||
|
{
|
||||||
|
OutdoorPvP_WG_KEEP_TYPE_NEUTRAL = 0,
|
||||||
|
OutdoorPvP_WG_KEEP_TYPE_CONTESTED = 1,
|
||||||
|
OutdoorPvP_WG_KEEP_STATUS_ALLY_CONTESTED = 1,
|
||||||
|
OutdoorPvP_WG_KEEP_STATUS_HORDE_CONTESTED = 2,
|
||||||
|
OutdoorPvP_WG_KEEP_TYPE_OCCUPIED = 3,
|
||||||
|
OutdoorPvP_WG_KEEP_STATUS_ALLY_OCCUPIED = 3,
|
||||||
|
OutdoorPvP_WG_KEEP_STATUS_HORDE_OCCUPIED = 4
|
||||||
|
};
|
||||||
|
|
||||||
enum DamageState
|
enum DamageState
|
||||||
{
|
{
|
||||||
DAMAGE_INTACT,
|
DAMAGE_INTACT,
|
||||||
@@ -117,6 +149,9 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
bool UpdateGameObjectInfo(GameObject *go);
|
bool UpdateGameObjectInfo(GameObject *go);
|
||||||
|
|
||||||
void RebuildAllBuildings();
|
void RebuildAllBuildings();
|
||||||
|
void StartBattle();
|
||||||
|
void EndBattle();
|
||||||
|
void GiveReward();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user