Exemplo n.º 1
0
        public static void GuildWarRewards(int rankID, string guildID, GuildFightInfo fightInfo)
        {
            int itemID = 0;
            string mailContent = string.Empty;
            var memberArray = new ShareCacheStruct<GuildMember>().FindAll(m => m.GuildID == guildID);
            if (rankID == 1)
            {
                AwardWinner(guildID, fightInfo);
                itemID = fightInfo.FirstPackID;
                mailContent = LanguageManager.GetLang().St6404_GuildWarFirstPackID;
            }
            else if (rankID == 2)
            {
                itemID = fightInfo.SecondPackID;
                mailContent = LanguageManager.GetLang().St6404_GuildWarSecondPackID;
            }
            else if (rankID == 3)
            {
                itemID = fightInfo.ThirdPackID;
                mailContent = LanguageManager.GetLang().St6404_GuildWarThirdPackID;
            }
            else
            {
                itemID = fightInfo.ParticipateID;
                mailContent = LanguageManager.GetLang().St6404_GuildWarParticipateID;
            }
            ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(itemID);
            if (itemInfo != null)
            {
                mailContent = string.Format(mailContent, itemInfo.ItemName);
            }

            foreach (var member in memberArray)
            {
                AddPrize(member.UserID, itemID, mailContent);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///  公会城市争斗战冠军奖励
 /// </summary>
 /// <param name="guildID"></param>
 /// <param name="fightInfo"></param>
 public static void AwardWinner(string guildID, GuildFightInfo fightInfo)
 {
     CityInfo cityInfo = new ConfigCacheSet<CityInfo>().FindKey(fightInfo.CityID);
     if (cityInfo == null)
     {
         return;
     }
     var memberArray = new ShareCacheStruct<GuildMember>().FindAll(s => s.GuildID == guildID);
     foreach (var guildMember in memberArray)
     {
         var user = UserCacheGlobal.CheckLoadUser(guildMember.UserID);
         if (user == null)
         {
             continue;
         }
         var cachePrize = new ShareCacheStruct<UserTakePrize>();
         var takePrize = GetUserTake(fightInfo.Coefficient, user.UserID, user.UserLv, cityInfo.CityName);
         cachePrize.Add(takePrize, GameEnvironment.CacheGlobalPeriod);
     }
 }