魔兽怀旧WOTLK巫妖王的跨阵营战场系统代码!希望大家喜欢!
1、支持TrinityCore的335版本最新!目前最新吧
2、就是跨阵营的战场系统!可以互跨阵营来战场战斗!
3、喜欢的怀旧WOTLK的朋友可以试试这个代码!
部分代码看看!!
-void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
+void Battleground::RewardReputationToTeam(uint32 a_faction_id, uint32 h_faction_id, uint32 Reputation, uint32 teamId)
{
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id))
- for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
- if (Player* player = _GetPlayerForTeam(TeamID, itr, "RewardReputationToTeam"))
- player->GetReputationMgr().ModifyReputation(factionEntry, Reputation);
+ FactionEntry const* a_factionEntry = sFactionStore.LookupEntry(a_faction_id);
+ FactionEntry const* h_factionEntry = sFactionStore.LookupEntry(h_faction_id);
+
+ if (!a_factionEntry || !h_factionEntry)
+ return;
+
+ for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ {
+ if (itr->second.OfflineRemoveTime)
+ continue;
+
+ Player* plr = ObjectAccessor::FindPlayer(itr->first);
+
+ if (!plr)
+ {
+ TC_LOG_ERROR("bg.battleground", "BattleGround:RewardReputationToTeam: %u not found!", itr->first);
+ continue;
+ }
+
+ uint32 team = plr->GetTeam();
+
+ if (team == teamId)
+ plr->GetReputationMgr().ModifyReputation(plr->GetOTeam() == ALLIANCE ? a_factionEntry : h_factionEntry, Reputation);
+ }
}
完整代码下载
|