Skip to content

Commit

Permalink
[427] TC patch for arena history feature
Browse files Browse the repository at this point in the history
  • Loading branch information
duergar85 authored and Shadez committed Dec 27, 2010
1 parent 52389f9 commit ffe2345
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion includes/revision_nr.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('ARMORY_REVISION', 426);
define('ARMORY_REVISION', 427);
define('DB_VERSION', 'armory_r416');
define('CONFIG_VERSION', '0708201001');
?>
40 changes: 20 additions & 20 deletions tools/trinity_core/wowarmory_arena_chart.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -738,6 +738,47 @@
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
SetArenaMatchmakerRating(winner, winner_matchmaker_rating);
SetArenaMatchmakerRating(GetOtherTeam(winner), loser_matchmaker_rating);
@@ -750,6 +750,47 @@
winner_matchmaker_rating, loser_matchmaker_rating, winner_change, loser_change);
SetArenaTeamRatingChangeForTeam(winner, winner_change);
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
+ /** World of Warcraft Armory **/
+ uint32 maxChartID;
+ QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT MAX(gameid) FROM armory_game_chart");
+ QueryResult result = CharacterDatabase.PQuery("SELECT MAX(gameid) FROM armory_game_chart");
+ if(!result)
+ maxChartID = 0;
+ else
Expand All @@ -18,7 +18,7 @@ diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Ba
+ uint32 gameID = maxChartID+1;
+ for(BattlegroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
+ {
+ Player *plr = sObjectMgr.GetPlayer(itr->first);
+ Player *plr = sObjectMgr->GetPlayer(itr->first);
+ if (!plr)
+ continue;
+ uint32 plTeamID = plr->GetArenaTeamId(winner_arena_team->GetSlot());
Expand All @@ -41,15 +41,15 @@ diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Ba
+ ratingChange = loser_change;
+ }
+ std::ostringstream sql_query;
+ // gameid, teamid, guid, changeType, ratingChange, teamRating, damageDone, deaths, healingDone, damageTaken, healingTaken, killingBlows, mapId, start, end
+ // gameid, teamid, guid, changeType, ratingChange, teamRating, damageDone, deaths, healingDone, damageTaken,, healingTaken, killingBlows, mapId, start, end
+ sql_query << "INSERT INTO armory_game_chart VALUES ('" << gameID << "', '" << resultTeamID << "', '" << plr->GetGUID() << "', '" << changeType << "', '" << ratingChange << "', '" << resultRating << "', '" << itr->second->DamageDone << "', '" << itr->second->Deaths << "', '" << itr->second->HealingDone << "', '" << itr->second->DamageTaken << "', '" << itr->second->HealingTaken << "', '" << itr->second->KillingBlows << "', '" << m_MapId << "', '" << m_StartTime << "', '" << m_EndTime << "')";
+ CharacterDatabase.Execute(sql_query.str().c_str());
+ }
+ /** World of Warcraft Armory **/
sLog.outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. RatingChange: %i.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change);
}
else
@@ -1344,6 +1385,14 @@
sLog->outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); itr++)
@@ -1364,6 +1405,14 @@
case SCORE_HEALING_DONE: // Healing Done
itr->second->HealingDone += value;
break;
Expand All @@ -62,12 +62,12 @@ diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Ba
+ break;
+ /** World of Warcraft Armory **/
default:
sLog.outError("Battleground: Unknown player score type %u", type);
sLog->outError("Battleground: Unknown player score type %u", type);
break;
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -210,7 +210,11 @@
@@ -208,7 +208,11 @@
SCORE_SECONDARY_OBJECTIVES = 17,
//SOTA
SCORE_DESTROYED_DEMOLISHER = 18,
Expand All @@ -80,7 +80,7 @@ diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Batt
};

enum ArenaType
@@ -302,6 +306,10 @@
@@ -300,6 +304,10 @@
uint32 BonusHonor;
uint32 DamageDone;
uint32 HealingDone;
Expand All @@ -94,18 +94,18 @@ diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Batt
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -700,6 +700,10 @@
{
// FIXME: kept by compatibility. don't know in BG if the restriction apply.
@@ -642,6 +642,10 @@
if (pVictim->GetTypeId() == TYPEID_PLAYER)
if (Battleground *bg = killer->GetBattleground())
bg->UpdatePlayerScore(killer, SCORE_DAMAGE_DONE, damage);
+ /** World of Warcraft Armory **/
+ if (Battleground *bgV = ((Player*)pVictim)->GetBattleground())
+ bgV->UpdatePlayerScore(((Player*)pVictim), SCORE_DAMAGE_TAKEN, damage);
+ /** World of Warcraft Armory **/
}
}

@@ -10001,6 +10005,10 @@
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, damage, 0, pVictim);
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT, damage);
@@ -10079,6 +10083,10 @@
{
pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain);
pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
Expand Down

0 comments on commit ffe2345

Please sign in to comment.