mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
hook OnAfterArenaRatingCalculation
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "BattlegroundRL.h"
|
#include "BattlegroundRL.h"
|
||||||
#include "BattlegroundRV.h"
|
#include "BattlegroundRV.h"
|
||||||
#include "Transport.h"
|
#include "Transport.h"
|
||||||
|
#include "ScriptMgr.h"
|
||||||
|
|
||||||
namespace Trinity
|
namespace Trinity
|
||||||
{
|
{
|
||||||
@@ -790,6 +791,8 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
|||||||
winnerMatchmakerChange = bValidArena ? winnerArenaTeam->WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, winnerChange, GetBgMap()) : 0;
|
winnerMatchmakerChange = bValidArena ? winnerArenaTeam->WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, winnerChange, GetBgMap()) : 0;
|
||||||
loserMatchmakerChange = loserArenaTeam->LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, loserChange, GetBgMap());
|
loserMatchmakerChange = loserArenaTeam->LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, loserChange, GetBgMap());
|
||||||
|
|
||||||
|
sScriptMgr->OnAfterArenaRatingCalculation(this, winnerMatchmakerChange, loserMatchmakerChange);
|
||||||
|
|
||||||
SetArenaMatchmakerRating(winnerTeamId, winnerMatchmakerRating + winnerMatchmakerChange);
|
SetArenaMatchmakerRating(winnerTeamId, winnerMatchmakerRating + winnerMatchmakerChange);
|
||||||
SetArenaMatchmakerRating(GetOtherTeamId(winnerTeamId), loserMatchmakerRating + loserMatchmakerChange);
|
SetArenaMatchmakerRating(GetOtherTeamId(winnerTeamId), loserMatchmakerRating + loserMatchmakerChange);
|
||||||
SetArenaTeamRatingChangeForTeam(winnerTeamId, winnerChange);
|
SetArenaTeamRatingChangeForTeam(winnerTeamId, winnerChange);
|
||||||
|
|||||||
@@ -1545,6 +1545,7 @@ void ScriptMgr::OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, ui
|
|||||||
FOREACH_SCRIPT(PlayerScript)->OnAfterStoreOrEquipNewItem(player, vendorslot, item, count, bag, slot, pProto, pVendor, crItem, bStore);
|
FOREACH_SCRIPT(PlayerScript)->OnAfterStoreOrEquipNewItem(player, vendorslot, item, count, bag, slot, pProto, pVendor, crItem, bStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScriptMgr::OnAfterUpdateMaxPower(Player* player, Powers& power, float& value)
|
void ScriptMgr::OnAfterUpdateMaxPower(Player* player, Powers& power, float& value)
|
||||||
{
|
{
|
||||||
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxPower(player, power, value);
|
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxPower(player, power, value);
|
||||||
@@ -1565,6 +1566,16 @@ void ScriptMgr::OnAfterUpdateAttackPowerAndDamage(Player* player, float& level,
|
|||||||
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateAttackPowerAndDamage(player, level, base_attPower, attPowerMod, attPowerMultiplier, ranged);
|
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateAttackPowerAndDamage(player, level, base_attPower, attPowerMod, attPowerMultiplier, ranged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptMgr::OnBeforeInitTalentForLevel(Player* player, uint8& level, uint32& talentPointsForLevel)
|
||||||
|
{
|
||||||
|
FOREACH_SCRIPT(PlayerScript)->OnBeforeInitTalentForLevel(player, level, talentPointsForLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScriptMgr::OnAfterArenaRatingCalculation(Battleground *const bg, int32 &winnerMatchmakerChange, int32 &loserMatchmakerChange)
|
||||||
|
{
|
||||||
|
FOREACH_SCRIPT(BattlegroundScript)->OnAfterArenaRatingCalculation(bg, winnerMatchmakerChange, loserMatchmakerChange);
|
||||||
|
}
|
||||||
|
|
||||||
AllMapScript::AllMapScript(const char* name)
|
AllMapScript::AllMapScript(const char* name)
|
||||||
: ScriptObject(name)
|
: ScriptObject(name)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -598,6 +598,8 @@ class BattlegroundScript : public ScriptObject
|
|||||||
|
|
||||||
// Should return a fully valid Battleground object for the type ID.
|
// Should return a fully valid Battleground object for the type ID.
|
||||||
virtual Battleground* GetBattleground() const = 0;
|
virtual Battleground* GetBattleground() const = 0;
|
||||||
|
|
||||||
|
virtual void OnAfterArenaRatingCalculation(Battleground *const bg, int32 &winnerMatchmakerChange, int32 &loserMatchmakerChange) { };
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutdoorPvPScript : public ScriptObject
|
class OutdoorPvPScript : public ScriptObject
|
||||||
@@ -1111,6 +1113,8 @@ class ScriptMgr
|
|||||||
|
|
||||||
Battleground* CreateBattleground(BattlegroundTypeId typeId);
|
Battleground* CreateBattleground(BattlegroundTypeId typeId);
|
||||||
|
|
||||||
|
void OnAfterArenaRatingCalculation(Battleground *const bg, int32 &winnerMatchmakerChange, int32 &loserMatchmakerChange);
|
||||||
|
|
||||||
public: /* OutdoorPvPScript */
|
public: /* OutdoorPvPScript */
|
||||||
|
|
||||||
OutdoorPvP* CreateOutdoorPvP(OutdoorPvPData const* data);
|
OutdoorPvP* CreateOutdoorPvP(OutdoorPvPData const* data);
|
||||||
|
|||||||
Reference in New Issue
Block a user