Skip to content

Commit

Permalink
[446] Patches for both servers were updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed Jan 7, 2011
1 parent 4e95dc4 commit 34fde80
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 89 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', 445);
define('ARMORY_REVISION', 446);
define('DB_VERSION', 'armory_r434');
define('CONFIG_VERSION', '2812201001');
?>
2 changes: 1 addition & 1 deletion tools/mangos/Revision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10439+
10981+
14 changes: 7 additions & 7 deletions tools/mangos/wowarmory_arena_chart.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 22476dd..f4308c8 100644
index 1b3cf08..1ee6327 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -723,6 +723,47 @@ void BattleGround::EndBattleGround(Team winner)
@@ -727,6 +727,47 @@ void BattleGround::EndBattleGround(Team winner)
DEBUG_LOG("--- Winner rating: %u, Loser rating: %u, Winner change: %i, Loser change: %i ---", winner_rating, loser_rating, winner_change, loser_change);
SetArenaTeamRatingChangeForTeam(winner, winner_change);
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
Expand Down Expand Up @@ -50,7 +50,7 @@ index 22476dd..f4308c8 100644
}
else
{
@@ -1379,6 +1420,14 @@ void BattleGround::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
@@ -1384,6 +1425,14 @@ void BattleGround::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
case SCORE_HEALING_DONE: // Healing Done
itr->second->HealingDone += value;
break;
Expand All @@ -66,7 +66,7 @@ index 22476dd..f4308c8 100644
sLog.outError("BattleGround: Unknown player score type %u", type);
break;
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index e4c9e1f..26eb3e2 100644
index 73c2093..8ea413e 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -191,7 +191,11 @@ enum ScoreType
Expand Down Expand Up @@ -94,10 +94,10 @@ index e4c9e1f..26eb3e2 100644

/*
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 74a1950..a386b4f 100644
index 4722069..674c986 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -656,6 +656,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
@@ -662,6 +662,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
{
// FIXME: kept by compatibility. don't know in BG if the restriction apply.
bg->UpdatePlayerScore(killer, SCORE_DAMAGE_DONE, damage);
Expand All @@ -108,7 +108,7 @@ index 74a1950..a386b4f 100644
}
}

@@ -6060,6 +6064,10 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro
@@ -6065,6 +6069,10 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro
{
((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain);
((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
Expand Down
43 changes: 21 additions & 22 deletions tools/mangos/wowarmory_patch.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index a70579d..004a609 100644
index a8d4155..6fc1f43 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -2075,6 +2075,9 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
@@ -2076,6 +2076,9 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end())
return;

Expand All @@ -13,13 +13,13 @@ index a70579d..004a609 100644
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
ca.date = time(NULL);
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 771aae9..700d3c0 100644
index b62eda2..e68332d 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -1025,6 +1025,15 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
@@ -1033,6 +1033,15 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
Item *pItem = NewItemOrBag( pProto );
if( pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) )
{
pItem->SetCount( count );
+ /** World of Warcraft Armory **/
+ if (pProto->Quality > 2 && pProto->Flags != 2048 && (pProto->Class == ITEM_CLASS_WEAPON || pProto->Class == ITEM_CLASS_ARMOR) && player)
+ {
Expand All @@ -29,17 +29,18 @@ index 771aae9..700d3c0 100644
+ CharacterDatabase.PExecute( ss.str().c_str() );
+ }
+ /** World of Warcraft Armory **/
pItem->SetCount( count );
return pItem;
}
else
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e844c87..72e43d3 100644
index 36018e8..ba57b98 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -16846,6 +16846,17 @@ void Player::SaveToDB()
@@ -16951,6 +16951,17 @@ void Player::SaveToDB()

DEBUG_FILTER_LOG(LOG_FILTER_PLAYER_STATS, "The value of player %s at save: ", m_name.c_str());
outDebugStatsValues();

+
+ /** World of Warcraft Armory **/
+ std::ostringstream ps;
+ ps << "REPLACE INTO armory_character_stats (guid,data) VALUES ('" << GetGUIDLow() << "', '";
Expand All @@ -50,11 +51,10 @@ index e844c87..72e43d3 100644
+ ps << "')";
+ CharacterDatabase.Execute( ps.str().c_str() );
+ /** World of Warcraft Armory **/
+
CharacterDatabase.BeginTransaction();

CharacterDatabase.PExecute("DELETE FROM characters WHERE guid = '%u'",GetGUIDLow());
@@ -22486,3 +22497,40 @@ void Player::SetRestType( RestType n_r_type, uint32 areaTriggerId /*= 0*/)
@@ -22550,3 +22561,40 @@ void Player::SetRestType( RestType n_r_type, uint32 areaTriggerId /*= 0*/)
SetFFAPvP(false);
}
}
Expand Down Expand Up @@ -97,35 +97,34 @@ index e844c87..72e43d3 100644
+/** World of Warcraft Armory **/
\ No newline at end of file
diff --git a/src/game/Player.h b/src/game/Player.h
index 61e47f5..973da88 100644
index ab43e7d..8625a18 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2286,6 +2286,10 @@ class MANGOS_DLL_SPEC Player : public Unit
@@ -2276,6 +2276,9 @@ class MANGOS_DLL_SPEC Player : public Unit
bool TeleportToHomebind(uint32 options = 0) { return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation(), options); }

Object* GetObjectByTypeMask(ObjectGuid guid, TypeMask typemask);

+ /** World of Warcraft Armory **/
+ void WriteWowArmoryDatabaseLog(uint32 type, uint32 data);
+ /** World of Warcraft Armory **/
+
// currently visible objects at player client
ObjectGuidSet m_clientGUIDs;

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index cf5b7a6..8a0d189 100644
index 4722069..7077964 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -855,7 +855,12 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
@@ -866,7 +866,13 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (m->IsRaidOrHeroicDungeon())
{
if(cVictim->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
+ {
((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer);
+ /** World of Warcraft Armory **/
+ ((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer);
+ /** World of Warcraft Armory **/
((InstanceMap *)m)->PermBindAllPlayers(creditedPlayer);
+ creditedPlayer->WriteWowArmoryDatabaseLog(3, cVictim->GetCreatureInfo()->Entry); // Difficulty will be defined in Player::WriteWowArmoryDatabaseLog();
+ /** World of Warcraft Armory **/
+ }
}
else
{
{
2 changes: 1 addition & 1 deletion tools/trinity_core/Revision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10829
50e4dd43dfc7abe4c0e9c1940fa7beb754f306bb
98 changes: 54 additions & 44 deletions tools/trinity_core/wowarmory_arena_chart.patch
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 581a119..bce2e1e 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -750,6 +750,47 @@
@@ -750,6 +750,47 @@ void Battleground::EndBattleground(uint32 winner)
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 result = CharacterDatabase.PQuery("SELECT MAX(gameid) FROM armory_game_chart");
+ if(!result)
+ maxChartID = 0;
+ else
+ {
+ maxChartID = (*result)[0].GetUInt32();
+ result.release();
+ }
+ uint32 gameID = maxChartID+1;
+ for(BattlegroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
+ {
+ Player *plr = sObjectMgr->GetPlayer(itr->first);
+ if (!plr)
+ continue;
+ uint32 plTeamID = plr->GetArenaTeamId(winner_arena_team->GetSlot());
+ int changeType;
+ uint32 resultRating;
+ uint32 resultTeamID;
+ int32 ratingChange;
+ if (plTeamID == winner_arena_team->GetId())
+ /** World of Warcraft Armory **/
+ uint32 maxChartID;
+ QueryResult result = CharacterDatabase.PQuery("SELECT MAX(gameid) FROM armory_game_chart");
+ if(!result)
+ maxChartID = 0;
+ else
+ {
+ changeType = 1; //win
+ resultRating = winner_team_rating;
+ resultTeamID = plTeamID;
+ ratingChange = winner_change;
+ maxChartID = (*result)[0].GetUInt32();
+ result.release();
+ }
+ else
+ uint32 gameID = maxChartID+1;
+ for(BattlegroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
+ {
+ changeType = 2; //lose
+ resultRating = loser_team_rating;
+ resultTeamID = loser_arena_team->GetId();
+ ratingChange = loser_change;
+ Player *plr = sObjectMgr->GetPlayer(itr->first);
+ if (!plr)
+ continue;
+ uint32 plTeamID = plr->GetArenaTeamId(winner_arena_team->GetSlot());
+ int changeType;
+ uint32 resultRating;
+ uint32 resultTeamID;
+ int32 ratingChange;
+ if (plTeamID == winner_arena_team->GetId())
+ {
+ changeType = 1; //win
+ resultRating = winner_team_rating;
+ resultTeamID = plTeamID;
+ ratingChange = winner_change;
+ }
+ else
+ {
+ changeType = 2; //lose
+ resultRating = loser_team_rating;
+ resultTeamID = loser_arena_team->GetId();
+ ratingChange = loser_change;
+ }
+ std::ostringstream sql_query;
+ // 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());
+ }
+ std::ostringstream sql_query;
+ // 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 **/
+ /** World of Warcraft Armory **/
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 @@
@@ -1364,6 +1405,14 @@ void Battleground::UpdatePlayerScore(Player *Source, uint32 type, uint32 value,
case SCORE_HEALING_DONE: // Healing Done
itr->second->HealingDone += value;
break;
Expand All @@ -65,9 +66,10 @@ diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Ba
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
index 4dba8a8..1e61acc 100755
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -208,7 +208,11 @@
@@ -208,7 +208,11 @@ enum ScoreType
SCORE_SECONDARY_OBJECTIVES = 17,
//SOTA
SCORE_DESTROYED_DEMOLISHER = 18,
Expand All @@ -80,7 +82,7 @@ diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Batt
};

enum ArenaType
@@ -300,6 +304,10 @@
@@ -300,6 +304,10 @@ class BattlegroundScore
uint32 BonusHonor;
uint32 DamageDone;
uint32 HealingDone;
Expand All @@ -92,20 +94,28 @@ diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Batt

enum BGHonorMode
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 81b0233..1a6ccfa 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -642,6 +642,10 @@
@@ -647,9 +647,16 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa

// in bg, count dmg if victim is also a player
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 **/

+ }
+ }
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, damage, 0, pVictim);
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT, damage);
@@ -10079,6 +10083,10 @@
}
@@ -9739,6 +9746,10 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth)
{
pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain);
pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
Expand Down
Loading

0 comments on commit 34fde80

Please sign in to comment.