Core/Battlefield: Cleaned up all incrementquest functions as this is a hacky way to do it
This commit is contained in:
@@ -668,45 +668,6 @@ void Battlefield::SendAreaSpiritHealerQueryOpcode(Player *pl, const uint64 &guid
|
|||||||
pl->GetSession()->SendPacket(&data);
|
pl->GetSession()->SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Battlefield::IncrementQuest(Player *player, uint32 quest, bool complete)
|
|
||||||
{
|
|
||||||
if (!player)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest);
|
|
||||||
if (!pQuest || player->GetQuestStatus(quest) == QUEST_STATUS_NONE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (complete)
|
|
||||||
{
|
|
||||||
player->CompleteQuest(quest);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
|
||||||
{
|
|
||||||
int32 creature = pQuest->RequiredNpcOrGo[i];
|
|
||||||
if (uint32 spell_id = pQuest->RequiredSpellCast[i])
|
|
||||||
{
|
|
||||||
player->CastedCreatureOrGO(creature, 0, spell_id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (creature > 0)
|
|
||||||
{
|
|
||||||
player->KilledMonsterCredit(creature, 0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (creature < 0)
|
|
||||||
{
|
|
||||||
player->CastedCreatureOrGO(creature, 0, 0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------
|
//--------------------
|
||||||
//-BfGraveYard Method-
|
//-BfGraveYard Method-
|
||||||
//--------------------
|
//--------------------
|
||||||
|
|||||||
@@ -314,7 +314,6 @@ class Battlefield:public ZoneScript
|
|||||||
|
|
||||||
/// Return if we can use mount in battlefield
|
/// Return if we can use mount in battlefield
|
||||||
bool CanFlyIn() { return !m_BattlefieldActive; } // Used for check if we can use flying mount or not
|
bool CanFlyIn() { return !m_BattlefieldActive; } // Used for check if we can use flying mount or not
|
||||||
bool IncrementQuest(Player * player, uint32 quest, bool complete = false);
|
|
||||||
void SendAreaSpiritHealerQueryOpcode(Player * pl, const uint64 & guid);
|
void SendAreaSpiritHealerQueryOpcode(Player * pl, const uint64 & guid);
|
||||||
|
|
||||||
void StartBattle();
|
void StartBattle();
|
||||||
|
|||||||
@@ -410,7 +410,6 @@ void BattlefieldWG::OnBattleEnd(bool endbytimer)
|
|||||||
player->RewardHonor(NULL, 1, WinHonor);
|
player->RewardHonor(NULL, 1, WinHonor);
|
||||||
RewardMarkOfHonor(player, 2);
|
RewardMarkOfHonor(player, 2);
|
||||||
}
|
}
|
||||||
IncrementQuest(player, WGQuest[player->GetTeamId()][1], true);
|
|
||||||
// Send Wintergrasp victory achievement
|
// Send Wintergrasp victory achievement
|
||||||
DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WIN_WG, player);
|
DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WIN_WG, player);
|
||||||
// Award achievement for succeeding in Wintergrasp in 10 minutes or less
|
// Award achievement for succeeding in Wintergrasp in 10 minutes or less
|
||||||
@@ -719,8 +718,6 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
|
|||||||
bool again = false;
|
bool again = false;
|
||||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
IncrementQuest(killer, WGQuest[killer->GetTeamId()][4]);
|
|
||||||
IncrementQuest(killer, WGQuest[killer->GetTeamId()][5]);
|
|
||||||
for (GuidSet::const_iterator itr = m_PlayersInWar[killer->GetTeamId()].begin(); itr != m_PlayersInWar[killer->GetTeamId()].end(); ++itr)
|
for (GuidSet::const_iterator itr = m_PlayersInWar[killer->GetTeamId()].begin(); itr != m_PlayersInWar[killer->GetTeamId()].end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Player* player = sObjectAccessor->FindPlayer(*itr))
|
if (Player* player = sObjectAccessor->FindPlayer(*itr))
|
||||||
@@ -739,12 +736,6 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
|
|||||||
if (victim->GetEntry() == creature->GetEntry() && !again)
|
if (victim->GetEntry() == creature->GetEntry() && !again)
|
||||||
{
|
{
|
||||||
again = true;
|
again = true;
|
||||||
for (GuidSet::const_iterator iter = m_PlayersInWar[killer->GetTeamId()].begin(); iter != m_PlayersInWar[killer->GetTeamId()].end(); ++iter)
|
|
||||||
{
|
|
||||||
if (Player* player = sObjectAccessor->FindPlayer(*iter))
|
|
||||||
if (player->GetDistance2d(killer) < 40)
|
|
||||||
IncrementQuest(player, WGQuest[player->GetTeamId()][0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -759,8 +750,6 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
|
|||||||
if (victim->GetEntry() == creature->GetEntry() && !again)
|
if (victim->GetEntry() == creature->GetEntry() && !again)
|
||||||
{
|
{
|
||||||
again = true;
|
again = true;
|
||||||
IncrementQuest(killer, WGQuest[killer->GetTeamId()][4]);
|
|
||||||
IncrementQuest(killer, WGQuest[killer->GetTeamId()][5]);
|
|
||||||
for (GuidSet::const_iterator iter = m_PlayersInWar[killer->GetTeamId()].begin(); iter != m_PlayersInWar[killer->GetTeamId()].end(); ++iter)
|
for (GuidSet::const_iterator iter = m_PlayersInWar[killer->GetTeamId()].begin(); iter != m_PlayersInWar[killer->GetTeamId()].end(); ++iter)
|
||||||
{
|
{
|
||||||
if (Player* player = sObjectAccessor->FindPlayer(*iter))
|
if (Player* player = sObjectAccessor->FindPlayer(*iter))
|
||||||
@@ -960,14 +949,15 @@ void BattlefieldWG::SendInitWorldStatesToAll()
|
|||||||
|
|
||||||
void BattlefieldWG::BrokenWallOrTower(TeamId team)
|
void BattlefieldWG::BrokenWallOrTower(TeamId team)
|
||||||
{
|
{
|
||||||
if (team == GetDefenderTeam())
|
// might be some use for this in the future. old code commented out below. KL
|
||||||
|
/* if (team == GetDefenderTeam())
|
||||||
{
|
{
|
||||||
for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
|
for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Player* player = sObjectAccessor->FindPlayer(*itr))
|
if (Player* player = sObjectAccessor->FindPlayer(*itr))
|
||||||
IncrementQuest(player, WGQuest[player->GetTeamId()][2], true);
|
IncrementQuest(player, WGQuest[player->GetTeamId()][2], true);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
// Called when a tower is broke
|
// Called when a tower is broke
|
||||||
void BattlefieldWG::AddBrokenTower(TeamId team)
|
void BattlefieldWG::AddBrokenTower(TeamId team)
|
||||||
@@ -989,7 +979,6 @@ void BattlefieldWG::AddBrokenTower(TeamId team)
|
|||||||
if (Player* player = sObjectAccessor->FindPlayer(*itr))
|
if (Player* player = sObjectAccessor->FindPlayer(*itr))
|
||||||
{
|
{
|
||||||
player->CastSpell(player, SPELL_TOWER_CONTROL, true);
|
player->CastSpell(player, SPELL_TOWER_CONTROL, true);
|
||||||
IncrementQuest(player, WGQuest[player->GetTeamId()][3], true);
|
|
||||||
DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WG_TOWER_DESTROY, player);
|
DoCompleteOrIncrementAchievement(ACHIEVEMENTS_WG_TOWER_DESTROY, player);
|
||||||
}
|
}
|
||||||
// If the threw south tower is destroy
|
// If the threw south tower is destroy
|
||||||
|
|||||||
Reference in New Issue
Block a user