示例#1
0
 private static bool Load(Dictionary <int, TotemHonorTemplateInfo> TotemHonorTemplate)
 {
     using (PlayerBussiness playerBussiness = new PlayerBussiness())
     {
         TotemHonorTemplateInfo[] allTotemHonorTemplate = playerBussiness.GetAllTotemHonorTemplate();
         TotemHonorTemplateInfo[] array = allTotemHonorTemplate;
         for (int i = 0; i < array.Length; i++)
         {
             TotemHonorTemplateInfo totemHonorTemplateInfo = array[i];
             if (!TotemHonorTemplate.ContainsKey(totemHonorTemplateInfo.ID))
             {
                 TotemHonorTemplate.Add(totemHonorTemplateInfo.ID, totemHonorTemplateInfo);
             }
         }
     }
     return(true);
 }
示例#2
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            int  num  = (int)packet.ReadByte();
            bool flag = packet.ReadBoolean();

            if (client.Player.PlayerCharacter.HasBagPassword && client.Player.PlayerCharacter.IsLocked)
            {
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("Bag.Locked", new object[0]));
                return(0);
            }
            switch (num)
            {
            case 1:
                if (!flag && client.Player.PlayerCharacter.totemId > 0)
                {
                    client.Player.Out.SendPlayerRefreshTotem(client.Player.PlayerCharacter);
                }
                break;

            case 2:
            {
                int iD = client.Player.PlayerCharacter.MaxBuyHonor + 1;
                TotemHonorTemplateInfo totemHonorTemplateInfo = TotemHonorMgr.FindTotemHonorTemplateInfo(iD);
                if (totemHonorTemplateInfo == null)
                {
                    return(0);
                }
                int needMoney = totemHonorTemplateInfo.NeedMoney;
                int addHonor  = totemHonorTemplateInfo.AddHonor;
                if (client.Player.PlayerCharacter.Money >= needMoney)
                {
                    client.Player.AddHonor(addHonor);
                    client.Player.AddMaxHonor(1);
                    client.Player.AddExpVip(needMoney);
                    client.Player.RemoveMoney(needMoney);
                }
                break;
            }
            }
            client.Player.Out.SendUpdateUpCount(client.Player.PlayerCharacter);
            return(0);
        }