mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/CFBG): Added support module mod-cfbg (#2064)
https://github.com/Winfidonarleyan/mod-cfbg - Original module https://github.com/azerothcore/mod-cfbg - the fork in AC
This commit is contained in:
@@ -1379,7 +1379,6 @@ bool ScriptMgr::OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target, u
|
||||
}
|
||||
|
||||
// Player
|
||||
|
||||
void ScriptMgr::OnPlayerCompleteQuest(Player* player, Quest const* quest)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnPlayerCompleteQuest(player, quest);
|
||||
@@ -1511,6 +1510,11 @@ void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::stri
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeSendChatMessage(Player* player, uint32& type, uint32& lang, std::string& msg)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnBeforeSendChatMessage(player, type, lang, msg);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Player* receiver)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, receiver);
|
||||
@@ -1729,6 +1733,17 @@ void ScriptMgr::OnFirstLogin(Player* player)
|
||||
FOREACH_SCRIPT(PlayerScript)->OnFirstLogin(player);
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
FOR_SCRIPTS_RET(PlayerScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanJoinInBattlegroundQueue(player, BattlemasterGuid, BGTypeID, joinAsGroup, err))
|
||||
ret = false; // we change ret value only when scripts return false
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Account
|
||||
void ScriptMgr::OnAccountLogin(uint32 accountId)
|
||||
{
|
||||
@@ -2003,7 +2018,6 @@ void ScriptMgr::OnAfterStoreOrEquipNewItem(Player* player, uint32 vendorslot, ui
|
||||
FOREACH_SCRIPT(PlayerScript)->OnAfterStoreOrEquipNewItem(player, vendorslot, item, count, bag, slot, pProto, pVendor, crItem, bStore);
|
||||
}
|
||||
|
||||
|
||||
void ScriptMgr::OnAfterUpdateMaxPower(Player* player, Powers& power, float& value)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnAfterUpdateMaxPower(player, power, value);
|
||||
@@ -2065,6 +2079,50 @@ void ScriptMgr::OnBattlegroundRemovePlayerAtLeave(Battleground* bg, Player* play
|
||||
FOREACH_SCRIPT(BGScript)->OnBattlegroundRemovePlayerAtLeave(bg, player);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnAddGroup(BattlegroundQueue* queue, GroupQueueInfo* ginfo, uint32& index, Player* leader, Group* grp, PvPDifficultyEntry const* bracketEntry, bool isPremade)
|
||||
{
|
||||
FOREACH_SCRIPT(BGScript)->OnAddGroup(queue, ginfo, index, leader, grp, bracketEntry, isPremade);
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanFillPlayersToBG(BattlegroundQueue* queue, Battleground* bg, const int32 aliFree, const int32 hordeFree, BattlegroundBracketId bracket_id)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
FOR_SCRIPTS_RET(BGScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanFillPlayersToBG(queue, bg, aliFree, hordeFree, bracket_id))
|
||||
ret = false; // we change ret value only when scripts return false
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanFillPlayersToBGWithSpecific(BattlegroundQueue* queue, Battleground* bg, const int32 aliFree, const int32 hordeFree,
|
||||
BattlegroundBracketId thisBracketId, BattlegroundQueue* specificQueue, BattlegroundBracketId specificBracketId)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
FOR_SCRIPTS_RET(BGScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanFillPlayersToBGWithSpecific(queue, bg, aliFree, hordeFree, thisBracketId, specificQueue, specificBracketId))
|
||||
ret = false; // we change ret value only when scripts return false
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ScriptMgr::OnCheckNormalMatch(BattlegroundQueue* queue, uint32& Coef, Battleground* bgTemplate, BattlegroundBracketId bracket_id, uint32& minPlayers, uint32& maxPlayers)
|
||||
{
|
||||
FOREACH_SCRIPT(BGScript)->OnCheckNormalMatch(queue, Coef, bgTemplate, bracket_id, minPlayers, maxPlayers);
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanSendMessageQueue(BattlegroundQueue* queue, Player* leader, Battleground* bg, PvPDifficultyEntry const* bracketEntry)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
FOR_SCRIPTS_RET(BGScript, itr, end, ret) // return true by default if not scripts
|
||||
if (!itr->second->CanSendMessageQueue(queue, leader, bg, bracketEntry))
|
||||
ret = false; // we change ret value only when scripts return false
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// SpellSC
|
||||
void ScriptMgr::OnCalcMaxDuration(Aura const* aura, int32& maxDuration)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ class AuctionHouseObject;
|
||||
class AuraScript;
|
||||
class Battleground;
|
||||
class BattlegroundMap;
|
||||
class BattlegroundQueue;
|
||||
class Channel;
|
||||
class ChatCommand;
|
||||
class Creature;
|
||||
@@ -62,10 +63,10 @@ struct ConditionSourceInfo;
|
||||
struct Condition;
|
||||
struct ItemTemplate;
|
||||
struct OutdoorPvPData;
|
||||
struct GroupQueueInfo;
|
||||
|
||||
#define VISIBLE_RANGE 166.0f //MAX visible range (size of grid)
|
||||
|
||||
|
||||
/*
|
||||
TODO: Add more script type classes.
|
||||
|
||||
@@ -836,6 +837,8 @@ class PlayerScript : public ScriptObject
|
||||
// The following methods are called when a player sends a chat message.
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/) { }
|
||||
|
||||
virtual void OnBeforeSendChatMessage(Player* /*player*/, uint32& /*type*/, uint32& /*lang*/, std::string& /*msg*/) { }
|
||||
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Player* /*receiver*/) { }
|
||||
|
||||
virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string& /*msg*/, Group* /*group*/) { }
|
||||
@@ -958,6 +961,8 @@ class PlayerScript : public ScriptObject
|
||||
virtual void OnBeforeInitTalentForLevel(Player* /*player*/, uint8& /*level*/, uint32& /*talentPointsForLevel*/) { }
|
||||
|
||||
virtual void OnFirstLogin(Player* /*player*/) { }
|
||||
|
||||
virtual bool CanJoinInBattlegroundQueue(Player* /*player*/, uint64 /*BattlemasterGuid*/, BattlegroundTypeId /*BGTypeID*/, uint8 /*joinAsGroup*/, GroupJoinBattlegroundResult& /*err*/) { return true; }
|
||||
};
|
||||
|
||||
class AccountScript : public ScriptObject
|
||||
@@ -1116,6 +1121,17 @@ public:
|
||||
|
||||
// Remove player at leave BG
|
||||
virtual void OnBattlegroundRemovePlayerAtLeave(Battleground* /*bg*/, Player* /*player*/) { }
|
||||
|
||||
virtual void OnAddGroup(BattlegroundQueue* /*queue*/, GroupQueueInfo* /*ginfo*/, uint32& /*index*/, Player* /*leader*/, Group* /*grp*/, PvPDifficultyEntry const* /*bracketEntry*/, bool /*isPremade*/) { }
|
||||
|
||||
virtual bool CanFillPlayersToBG(BattlegroundQueue* /*queue*/, Battleground* /*bg*/, const int32 /*aliFree*/, const int32 /*hordeFree*/, BattlegroundBracketId /*bracket_id*/) { return true; }
|
||||
|
||||
virtual bool CanFillPlayersToBGWithSpecific(BattlegroundQueue* /*queue*/, Battleground* /*bg*/, const int32 /*aliFree*/, const int32 /*hordeFree*/,
|
||||
BattlegroundBracketId /*thisBracketId*/, BattlegroundQueue* /*specificQueue*/, BattlegroundBracketId /*specificBracketId*/) { return true; }
|
||||
|
||||
virtual void OnCheckNormalMatch(BattlegroundQueue* /*queue*/, uint32& /*Coef*/, Battleground* /*bgTemplate*/, BattlegroundBracketId /*bracket_id*/, uint32& /*minPlayers*/, uint32& /*maxPlayers*/) { }
|
||||
|
||||
virtual bool CanSendMessageQueue(BattlegroundQueue* /*queue*/, Player* /*leader*/, Battleground* /*bg*/, PvPDifficultyEntry const* /*bracketEntry*/) { return true; }
|
||||
};
|
||||
|
||||
class SpellSC : public ScriptObject
|
||||
@@ -1335,7 +1351,6 @@ class ScriptMgr
|
||||
|
||||
public: /* PlayerScript */
|
||||
|
||||
|
||||
void OnBeforePlayerUpdate(Player* player, uint32 p_time);
|
||||
void OnPlayerReleasedGhost(Player* player);
|
||||
void OnPVPKill(Player* killer, Player* killed);
|
||||
@@ -1355,6 +1370,7 @@ class ScriptMgr
|
||||
void OnPlayerDuelStart(Player* player1, Player* player2);
|
||||
void OnPlayerDuelEnd(Player* winner, Player* loser, DuelCompleteType type);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg);
|
||||
void OnBeforeSendChatMessage(Player* player, uint32& type, uint32& lang, std::string& msg);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Player* receiver);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group);
|
||||
void OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild);
|
||||
@@ -1400,6 +1416,7 @@ class ScriptMgr
|
||||
void OnBeforeInitTalentForLevel(Player* player, uint8& level, uint32& talentPointsForLevel);
|
||||
void OnFirstLogin(Player* player);
|
||||
void OnPlayerCompleteQuest(Player* player, Quest const* quest);
|
||||
bool CanJoinInBattlegroundQueue(Player* player, uint64 BattlemasterGuid, BattlegroundTypeId BGTypeID, uint8 joinAsGroup, GroupJoinBattlegroundResult& err);
|
||||
|
||||
public: /* AccountScript */
|
||||
|
||||
@@ -1488,8 +1505,14 @@ class ScriptMgr
|
||||
void OnBattlegroundAddPlayer(Battleground* bg, Player* player);
|
||||
void OnBattlegroundBeforeAddPlayer(Battleground* bg, Player* player);
|
||||
void OnBattlegroundRemovePlayerAtLeave(Battleground* bg, Player* player);
|
||||
void OnAddGroup(BattlegroundQueue* queue, GroupQueueInfo* ginfo, uint32& index, Player* leader, Group* grp, PvPDifficultyEntry const* bracketEntry, bool isPremade);
|
||||
bool CanFillPlayersToBG(BattlegroundQueue* queue, Battleground* bg, const int32 aliFree, const int32 hordeFree, BattlegroundBracketId bracket_id);
|
||||
bool CanFillPlayersToBGWithSpecific(BattlegroundQueue* queue, Battleground* bg, const int32 aliFree, const int32 hordeFree,
|
||||
BattlegroundBracketId thisBracketId, BattlegroundQueue* specificQueue, BattlegroundBracketId specificBracketId);
|
||||
void OnCheckNormalMatch(BattlegroundQueue* queue, uint32& Coef, Battleground* bgTemplate, BattlegroundBracketId bracket_id, uint32& minPlayers, uint32& maxPlayers);
|
||||
bool CanSendMessageQueue(BattlegroundQueue* queue, Player* leader, Battleground* bg, PvPDifficultyEntry const* bracketEntry);
|
||||
|
||||
public: /* SpellSC */
|
||||
public: /* SpellSC */
|
||||
|
||||
void OnCalcMaxDuration(Aura const* aura, int32& maxDuration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user