最新的T端335魔兽世界跨阵营战场系统代码!
2014-05-15 11:43:32 作者:www.10cpop.com 来源: 浏览次数:0

魔兽怀旧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);
+    }
 }


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 游戏下载 | 魔兽图片 | 魔兽单机 | 视频攻略 | 最新更新

 
Copyright © 2014 - 2016 10CPOP Corporation, All Rights Reserved


十城魔兽世界私服