// 开启帮会任务 void OpenGuildMission() { // 没有帮会 PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool; if (MyPlayerData == null) { return; } if (MyPlayerData.GuildInfo == null) { return; } if (false == MyPlayerData.IsHaveGuild()) { return; } if (false == MyPlayerData.IsGuildChief()) { return; } Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0); if (guildMisGuild == null) { LogModule.ErrorLog("Can not find guidMissionGuid {0}", MyPlayerData.GuildInfo.GuildLevel); return; } string str = StrDictionary.GetClientDictionaryString("#{5432}", guildMisGuild.ConsumeWealth, guildMisGuild.CanAcceptTimesOnce); MessageBoxLogic.OpenOKCancelBox(str, null, OnOpenGuildMisMessageOK, OnCancelClick); }
public void UpdateGuildData(GC_RET_GUIDMISSION_DATA pak) { PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool; if (MyPlayerData == null) { return; } if (MyPlayerData.GuildInfo == null) { return; } if (false == MyPlayerData.IsHaveGuild()) { return; } // 帮主才能看见 if (true == MyPlayerData.IsGuildChief()) { m_OpenButton.isEnabled = true; } Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0); if (guildMisGuild == null) { LogModule.ErrorLog("Can not find guidMissionGuid {0}", MyPlayerData.GuildInfo.GuildLevel); return; } // 发布次数 if (m_GuildMisAssignTimesLabel && pak.HasAssignTimes) { m_GuildMisAssignTimesLabel.text = pak.AssignTimes + "/" + guildMisGuild.CanAssignTime; } // 可接次数 if (m_GuildMisCanAcptTimesLabel && pak.HasAcceptTimes) { m_GuildMisCanAcptTimesLabel.text = pak.AcceptTimes + "/" + guildMisGuild.CanAcceptTimesOnce;/*((guildMisGuild.CanAssignTime - pak.AssignTimes) * guildMisGuild.CanAcceptTimesOnce);*/ } // 帮会财富 if (m_GuildWealthLabel && pak.HasGuildWeath) { m_GuildWealthLabel.text = pak.GuildWeath.ToString(); } // 开启信息 if (m_OpenInfoLabel) { m_OpenInfoLabel.text = StrDictionary.GetClientDictionaryString("#{5421}", guildMisGuild.ConsumeWealth, guildMisGuild.CanAcceptTimesOnce); } }
// 参与帮会任务 void JoinGuildMission() { // 没有帮会 PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool; if (MyPlayerData == null) { return; } if (MyPlayerData.GuildInfo == null) { return; } if (false == MyPlayerData.IsHaveGuild()) { return; } Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (mainPlayer == null) { return; } // 接任务 判断次数 Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0); if (guildMisGuild == null) { LogModule.ErrorLog("Can not find guidMissionGuid {0}", MyPlayerData.GuildInfo.GuildLevel); return; } int nAcptedTimes = MisionData / 1000000; if (nAcptedTimes >= guildMisGuild.MemMaxTimesOneDay) { mainPlayer.SendNoticMsg(false, "#{5437}"); return; } CG_ASK_GUIDMISSION_ACCEPT askpak = (CG_ASK_GUIDMISSION_ACCEPT)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_GUIDMISSION_ACCEPT); askpak.NoParam = 0; askpak.SendPacket(); }
// 任务显示相关 void UpdateMissionInfo(int nData) { CleanMissionInfo(); int nMissionID = nData % 10000; int nRoundIndex = (nData / 10000) % 100; int nAcptedTimes = nData / 1000000; // 大于0 才是 帮会任务 // 没有帮会 也不显示 PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool; if (MyPlayerData == null) { return; } if (MyPlayerData.GuildInfo == null) { return; } if (false == MyPlayerData.IsHaveGuild()) { return; } Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0); if (guildMisGuild == null) { LogModule.ErrorLog("Can not find guildMisGuild {0}", MyPlayerData.GuildInfo.GuildLevel); return; } // 按钮显示否 if (nAcptedTimes <= guildMisGuild.MemMaxTimesOneDay) { if (nRoundIndex < guildMisGuild.MemMisRoundNumOnce) { // 还没任务呢 if (nMissionID <= 0) { if (m_JoinButton) { m_JoinButton.isEnabled = true; } } else { if (m_MissionOptButton) { m_MissionOptButton.isEnabled = true; } } } else { if (m_JoinButton && nAcptedTimes < guildMisGuild.MemMaxTimesOneDay) { m_JoinButton.isEnabled = true; } } } Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (mainPlayer == null) { return; } if (nMissionID > 0) { Tab_MissionBase misTab = TableManager.GetMissionBaseByID(nMissionID, 0); if (misTab == null) { LogModule.ErrorLog("Can not find missionBase {0}", nMissionID); return; } else if (misTab.MissionType != (int)MISSIONTYPE.MISSION_GUILD) { return; } Tab_MissionDictionary misDic = TableManager.GetMissionDictionaryByID(nMissionID, 0); if (misDic == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID); return; } Tab_GuildMission guildMis = TableManager.GetGuildMissionByID(misTab.GuildMissionTabID, 0); if (guildMis == null) { LogModule.ErrorLog("Can not find guidMission {0}", misTab.GuildMissionTabID); return; } if (m_MisNameLabel && m_MisInfoLabel) { m_MisNameLabel.text = string.Format(misDic.MissionName, "[ffffff]", "[ffffff]"); m_MisInfoLabel.text = misDic.MissionDesc; } // 金币 经验 Tab_GuildMissionAward awardTab = TableManager.GetGuildMissionAwardByID(mainPlayer.BaseAttr.Level, 0); if (awardTab == null) { LogModule.ErrorLog("Can not find guidMissionAward {0}", mainPlayer.BaseAttr.Level); return; } float fMisMoney = guildMis.AwardMoney * guildMisGuild.AwardFactor * awardTab.GetExpQualityFactorbyIndex((int)(MISSION_QUALITY.MISSION_QUALITY_PURPLE - 1)) * awardTab.MoneyFactor; float fMisExp = guildMis.AwardExp * guildMisGuild.AwardFactor * awardTab.GetExpQualityFactorbyIndex((int)(MISSION_QUALITY.MISSION_QUALITY_PURPLE - 1)) * awardTab.ExpFactor; if (m_MisMoneyLabel && m_MisExpLabel) { m_MisMoneyLabel.text = ((int)fMisMoney).ToString(); m_MisExpLabel.text = ((int)fMisExp).ToString(); } UpdateMissionState(nMissionID); // 任务环数 if (m_MisRoundInfoLabel && nRoundIndex >= 0) { m_MisRoundInfoLabel.text = nRoundIndex + "/" + guildMisGuild.MemMisRoundNumOnce; } } }