From 3ea77bcede501037ec86c8afd28268ee16a35437 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期五, 02 十一月 2018 09:46:37 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Pet/PetAttributeWin.cs                                                     |   16 ++
 Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta                           |    4 
 Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs                          |    2 
 System/Pet/AutoTrainTipsPWin.cs.meta                                              |   12 +
 System/Pet/PetAttributeMethods.cs                                                 |   84 +++++++++-
 System/Pet/PlayerPetDatas.cs                                                      |    4 
 System/Pet/AutoTrainTipsPWin.cs                                                   |  268 +++++++++++++++++++++++++++++++++
 Core/GameEngine/Model/Config/PetClassCostConfig.cs                                |   33 ++-
 Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs |    2 
 Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs    |    3 
 10 files changed, 397 insertions(+), 31 deletions(-)

diff --git a/Core/GameEngine/Model/Config/PetClassCostConfig.cs b/Core/GameEngine/Model/Config/PetClassCostConfig.cs
index b1ab846..890e9f8 100644
--- a/Core/GameEngine/Model/Config/PetClassCostConfig.cs
+++ b/Core/GameEngine/Model/Config/PetClassCostConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Saturday, January 06, 2018
+//    [  Date ]:		   Thursday, November 01, 2018
 //--------------------------------------------------------
 
 using UnityEngine;
@@ -11,11 +11,12 @@
     
 	public partial class PetClassCostConfig : ConfigBase {
 
-		public int ID { get ; private set ; }
-		public int PetID { get ; private set ; }
-		public int Rank { get ; private set ; }
-		public int UpNeedExp { get ; private set ; }
-		public int AtkAdd { get ; private set ; }
+		public int ID { get ; private set ; }
+		public int PetID { get ; private set ; }
+		public int Rank { get ; private set ; }
+		public int UpNeedExp { get ; private set ; }
+		public int AtkAdd { get ; private set ; }
+		public int NeedExpTotal { get ; private set ; }
 
 		public override string getKey()
         {
@@ -25,15 +26,17 @@
 		public override void Parse() {
 			try
             {
-                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; 
-			
-				PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; 
-			
-				Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; 
-			
-				UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; 
-			
-				AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; 
+                ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; 
+			
+				PetID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; 
+			
+				Rank=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; 
+			
+				UpNeedExp=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; 
+			
+				AtkAdd=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; 
+			
+				NeedExpTotal=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; 
             }
             catch (Exception ex)
             {
diff --git a/Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta b/Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta
index dcb0300..50242cf 100644
--- a/Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/PetClassCostConfig.cs.meta
@@ -1,7 +1,7 @@
 fileFormatVersion: 2
 guid: a58409c48a307e24eb39a8c2e933c8e8
-timeCreated: 1515213576
-licenseType: Pro
+timeCreated: 1541079969
+licenseType: Free
 MonoImporter:
   serializedVersion: 2
   defaultReferences: []
diff --git a/Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs b/Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs
index 615264f..fd6c409 100644
--- a/Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs
+++ b/Core/GameEngine/Model/TelPartialConfig/tagStoreConfig.cs
@@ -13,6 +13,8 @@
         private static Dictionary<int, List<StoreConfig>> storeConfigs = new Dictionary<int, List<StoreConfig>>();
         public void OnConfigParseCompleted()
         {
+            if (ShopType == 0) return;
+
             if (!s_storeModelDict.ContainsKey(ShopType))
             {
                 List<StoreConfig> modellist = new List<StoreConfig>();
diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs
index 18558a3..cf64bb3 100644
--- a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA7_Pet/CA704_tagCMPetClassUP.cs
@@ -6,6 +6,7 @@
 public class CA704_tagCMPetClassUP : GameNetPackBasic {

     public byte PetItemIndex;    //宠物数据背包索引

     public ushort UseItemCnt;    //消耗材料个数

+    public byte IsAutoBuy;    //是否自动购买

 

     public CA704_tagCMPetClassUP () {

         combineCmd = (ushort)0x03FE;

@@ -15,6 +16,7 @@
     public override void WriteToBytes () {

         WriteBytes (PetItemIndex, NetDataType.BYTE);

         WriteBytes (UseItemCnt, NetDataType.WORD);

+        WriteBytes (IsAutoBuy, NetDataType.BYTE);

     }

 

 }

diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs b/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
index f027ff2..b875cf77 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB401_tagMCSkillHurtList.cs
@@ -35,7 +35,8 @@
 
         if (vNetData.HurtCount > 0)
         {
-            if (_skill.id != _attacker.SkillMgr.CurCastSkill.id)
+            if (_attacker.SkillMgr.CurCastSkill != null
+             && _skill.id != _attacker.SkillMgr.CurCastSkill.id)
             {
                 _skill.ClearServerHurtList();
             }
diff --git a/System/Pet/AutoTrainTipsPWin.cs b/System/Pet/AutoTrainTipsPWin.cs
new file mode 100644
index 0000000..c960ccb
--- /dev/null
+++ b/System/Pet/AutoTrainTipsPWin.cs
@@ -0,0 +1,268 @@
+锘�//--------------------------------------------------------
+//    [Author]:           绗簩涓栫晫
+//    [  Date ]:           Thursday, November 01, 2018
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using TableConfig;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+    public class SkillClass
+    {
+        public int PetID;
+        public int SkillID;
+        public int Lv;
+
+    }
+
+    public class AutoTrainTipsPWin : Window
+    {
+
+        #region Built-in
+        [SerializeField] Button m_CloseBtn;//鍏抽棴
+        [SerializeField] Button m_CancelBtn;//鍙栨秷
+        [SerializeField] Button m_ConfirmBtn;//纭畾
+        [SerializeField] Button m_BtnReduce;//鍑�
+        [SerializeField] Button m_BtnPlus;//鍔�
+
+        [SerializeField] Button _DotText1Btn;//璁$畻鍣ㄦ寜閽�
+        [SerializeField] Button _NumKeyBoardBGM;//璁$畻鏈洪潰鏉挎寜閽�
+        [SerializeField] NumKeyBoard _NumKeyBoard;//璁$畻鏈�
+
+        [SerializeField] Text NextToLvText;//闇�瑕侀┋鍏荤瓑绾�
+        [SerializeField] Text NeedNumberText;//鎵�闇�璐拱鐨勯鏁�
+        [SerializeField] Text m_NowLevelTxt;//褰撳墠绛夌骇
+        private int PetID = 0;
+        public static int _Lvnumber = 0;//鏍囪闇�瑕佸崌鍒版墍闇�鐨勯樁鏁�
+        public static int DomesticateNumber = 0;//椹吇娆℃暟
+        private PetAttributeWin PetWin = new PetAttributeWin();
+        private bool isBool = true;
+        public static bool IsFairy = false;
+        List<SkillClass> PetSkills = new List<SkillClass>();
+        PlayerPetDatas m_petModel;
+        PlayerPetDatas PetModel { get { return m_petModel ?? (m_petModel = ModelCenter.Instance.GetModel<PlayerPetDatas>()); } }
+        protected override void BindController()
+        {
+            PetWin = WindowCenter.Instance.Get<PetAttributeWin>();
+        }
+
+        protected override void AddListeners()
+        {
+            m_CloseBtn.AddListener(OnClickCloseButton);
+            m_CancelBtn.AddListener(OnClickCancelButton);
+            m_ConfirmBtn.AddListener(OnClickConfirmButton);
+            m_BtnReduce.AddListener(OnClickReduceButton);
+            m_BtnPlus.AddListener(OnClickPlusButton);
+            _DotText1Btn.AddListener(OnClickDotText1);
+            _NumKeyBoardBGM.AddListener(OnClickNumKeyBoardBGM);
+            _NumKeyBoard.onValueChange.AddListener(OnClickNumKeyBoardValueChange);
+            _NumKeyBoard.onConfirm.AddListener(onConfirm);
+        }
+
+        protected override void OnPreOpen()
+        {
+            IsFairy = false;
+            _NumKeyBoardBGM.gameObject.SetActive(false);
+            isBool = true;
+            PetID = PetModel.SigPetId;
+            m_NowLevelTxt.text = string.Format(Language.Get("PetZ1031"), PetModel._DicPetBack[PetID].PetClass);
+            GetMountSkills(PetID);
+            PropertyEntries(PetID);//榛樿鑷姩閫夋嫨      
+            int GetLvNow = PetModel._DicPetBack[PetID].PetClass;
+            int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank;
+            _NumKeyBoard.min = (uint)(GetLvNow + 1);
+            _NumKeyBoard.max = (uint)MaxLv;
+        }
+
+        protected override void OnAfterOpen()
+        {
+        }
+
+        protected override void OnPreClose()
+        {
+        }
+
+        protected override void OnAfterClose()
+        {
+        }
+        private void GetMountSkills(int petId)//鑾峰彇鍧愰獞鐨勬妧鑳�
+        {
+            PetSkills.Clear();
+            var PetInfo = Config.Instance.Get<PetInfoConfig>(petId);
+            int[] SKillID = ConfigParse.GetMultipleStr<int>(PetInfo.SkillID);
+            int[] SkillUnLock = ConfigParse.GetMultipleStr<int>(PetInfo.SkillUnLock);
+            for (int i = 0; i < SKillID.Length; i++)
+            {
+                SkillClass skillClass = new SkillClass();
+                skillClass.PetID = petId;
+                skillClass.SkillID = SKillID[i];
+                skillClass.Lv = SkillUnLock[i];
+                PetSkills.Add(skillClass);
+            }
+        }
+        private void PropertyEntries(int _petID)//榛樿鑷姩閫夋嫨
+        {
+            int NextMountLv = 0;
+            int getLv = PetModel._DicPetBack[_petID].PetClass;
+            var PetInfo = Config.Instance.Get<PetInfoConfig>(_petID);
+            bool IsBool = true;
+            for (int i = 0; i < PetSkills.Count; i++)
+            {
+                if (PetSkills[i].Lv > getLv && IsBool)
+                {
+                    NextMountLv = PetSkills[i].Lv;
+                    IsBool = false;
+                }
+            }
+            if (IsBool)
+            {
+                NextMountLv = PetInfo.MaxRank;
+            }
+            _Lvnumber = NextMountLv;
+            int NowHorseExp = PetClassCostConfig.GetPetIdAndRank(_petID, getLv).NeedExpTotal + PetModel._DicPetBack[_petID].petExp;//褰撳墠绛夌骇鐨勭粡楠�    
+            int NeedNumber = Mathf.CeilToInt((float)(PetClassCostConfig.GetPetIdAndRank(_petID, NextMountLv).NeedExpTotal - NowHorseExp) / 100);//鎵�闇�瑕佺殑棰楁暟
+            DomesticateNumber = NeedNumber;
+            NeedNumberText.text = NeedNumber.ToString();
+            NextToLvText.text = NextMountLv + Language.Get("Z1041");
+        }
+        private void SetMountSelectionInformation(int _PetID, int LV)
+        {
+            int getLv = PetModel._DicPetBack[_PetID].PetClass;
+            int NowHorseExp = PetClassCostConfig.GetPetIdAndRank(_PetID, getLv).NeedExpTotal + PetModel._DicPetBack[_PetID].petExp;//褰撳墠绛夌骇鐨勭粡楠�
+
+            int NeedNumber = Mathf.CeilToInt((float)(PetClassCostConfig.GetPetIdAndRank(_PetID, LV).NeedExpTotal - NowHorseExp) / 100);//鎵�闇�瑕佺殑棰楁暟
+            DomesticateNumber = NeedNumber;
+            NextToLvText.text = LV + Language.Get("Z1041");
+            NeedNumberText.text = NeedNumber.ToString();
+        }
+
+        private void OnClickCloseButton()
+        {
+            Close();
+        }
+        private void OnClickCancelButton()
+        {
+            Close();
+        }
+        private void OnClickConfirmButton()//纭畾
+        {
+            int NeedFairyJade = DomesticateNumber * 10;
+
+            int gold = (int)UIHelper.GetMoneyCnt(1);
+            if (NeedFairyJade > 0 && gold >= NeedFairyJade)
+            {
+                IsFairy = true;
+                PetWin.FairyJadeDomesticate();
+                Close();
+            }
+            else
+            {
+                if (VersionConfig.Get().isBanShu)
+                {
+                    SysNotifyMgr.Instance.ShowTip("GoldErr");
+                    return;
+                }
+                WindowCenter.Instance.Open<RechargeTipWin>();
+            }
+
+        }
+        private void OnClickReduceButton()//鍑�
+        {
+            int getLvNow = PetModel._DicPetBack[PetID].PetClass;
+            if (_Lvnumber - 1 < getLvNow + 1)
+            {
+                ScrollTip.ShowTip(Language.Get("PetBelowCultureLevel_"));
+            }
+            else
+            {
+                _Lvnumber -= 1;
+                SetMountSelectionInformation(PetID, _Lvnumber);
+            }
+
+        }
+        private void OnClickPlusButton()//鍔�
+        {
+            int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank;
+            if (_Lvnumber + 1 <= MaxLv)
+            {
+                _Lvnumber += 1;
+                SetMountSelectionInformation(PetID, _Lvnumber);
+            }
+            else
+            {
+                ScrollTip.ShowTip(Language.Get("PetMoreThanDomestication_Z"));
+            }
+        }
+        private void OnClickDotText1()//涓棿鐐瑰嚮
+        {
+            if (!_NumKeyBoardBGM.gameObject.activeSelf)
+            {
+                _NumKeyBoardBGM.gameObject.SetActive(true);
+            }
+        }
+        private void OnClickNumKeyBoardBGM()//鍏抽棴闈㈡澘
+        {
+            if (_NumKeyBoardBGM.gameObject.activeSelf)
+            {
+                _NumKeyBoardBGM.gameObject.SetActive(false);
+            }
+        }
+
+        private void OnClickNumKeyBoardValueChange()
+        {
+            if (int.Parse(_NumKeyBoard.Value) > 999)
+            {
+                NextToLvText.text = 999 + Language.Get("Z1041");
+            }
+            else
+            {
+                NextToLvText.text = int.Parse(_NumKeyBoard.Value) + Language.Get("Z1041");
+            }
+
+
+        }
+        private void NumKeyBoardValueChange()
+        {
+            int GetLvNow = PetModel._DicPetBack[PetID].PetClass;
+            int MaxLv = Config.Instance.Get<PetInfoConfig>(PetID).MaxRank;
+            if (int.Parse(_NumKeyBoard.Value) < GetLvNow + 1)
+            {
+                _Lvnumber = GetLvNow + 1;
+                SetMountSelectionInformation(PetID, _Lvnumber);
+                ScrollTip.ShowTip(Language.Get("LessThanTheDomesticated_Z"));
+            }
+            else if (int.Parse(_NumKeyBoard.Value) > MaxLv)
+            {
+                _Lvnumber = MaxLv;
+                SetMountSelectionInformation(PetID, _Lvnumber);
+                ScrollTip.ShowTip(Language.Get("MoreThanDomestication_Z"));
+            }
+            else if (int.Parse(_NumKeyBoard.Value) >= GetLvNow + 1 && int.Parse(_NumKeyBoard.Value) <= MaxLv)
+            {
+                _Lvnumber = int.Parse(_NumKeyBoard.Value);
+                SetMountSelectionInformation(PetID, _Lvnumber);
+            }
+
+        }
+        private void onConfirm(bool _bool)
+        {
+            if (_bool)
+            {
+                NumKeyBoardValueChange();
+                _NumKeyBoardBGM.gameObject.SetActive(false);
+            }
+        }
+        #endregion
+
+    }
+
+}
+
+
+
+
diff --git a/System/Pet/AutoTrainTipsPWin.cs.meta b/System/Pet/AutoTrainTipsPWin.cs.meta
new file mode 100644
index 0000000..c45b817
--- /dev/null
+++ b/System/Pet/AutoTrainTipsPWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d659e84f62ab04c4280d8089523fde59
+timeCreated: 1541073534
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/Pet/PetAttributeMethods.cs b/System/Pet/PetAttributeMethods.cs
index 6484513..a6523e6 100644
--- a/System/Pet/PetAttributeMethods.cs
+++ b/System/Pet/PetAttributeMethods.cs
@@ -85,8 +85,10 @@
         PetInfoConfig petInfoConfig;
         bool isAutoTrain = false;
         List<GameObject> Skillimage = new List<GameObject>();
+        private bool IsZidong = false;
         private void OnEnable()
         {
+            IsZidong = false;
             timePlay = 0;
             Skillimage.Clear();
             Skillimage.Add(Skillimage1);
@@ -494,16 +496,13 @@
             {
                 if (petmodel._DicPetBack.ContainsKey(petInfoConfig.ID))
                 {
-                    petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1);
+                    petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, 1,0);
                 }
             }
             else
             {
                 ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
             }
-
-
-            // petTrainBtn.RemoveAllListeners();
         }
 
         private void ClickPetAutoTrainBtn()
@@ -511,7 +510,20 @@
             int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, petmodel.petUpgradeToolId);
             if (haveCnt < costNum)
             {
-                ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(petmodel.petUpgradeToolId);
+                if (!isAutoTrain)
+                {
+                    WindowCenter.Instance.Open<AutoTrainTipsPWin>();
+                }
+                else
+                {
+                    AutoTrainTipsPWin.IsFairy = false;
+                    isAutoTrain = false;
+                    IsZidong = false;
+                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
+                    StopCoroutine("FairyJadeD");
+
+                }
+               
                 return;
             }
             isAutoTrain = !isAutoTrain;
@@ -548,7 +560,7 @@
                         if (petmodel.Wait)
                         {
                             petmodel.Wait = false;
-                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum);
+                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, NeedNum,0);
                         }
                     }
                     else
@@ -556,7 +568,7 @@
                         if (petmodel.Wait)
                         {
                             petmodel.Wait = false;
-                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt);
+                            petmodel.SendPetTrainQuest(petmodel._DicPetBack[petInfoConfig.ID].ItemPlace, haveCnt,0);
                         }
                     }
 
@@ -565,9 +577,12 @@
             }
             else
             {
-                petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
-                isAutoTrain = false;
-
+                if (!IsZidong)
+                {
+                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
+                    isAutoTrain = false;
+                }
+               
             }
         }
         #endregion
@@ -644,8 +659,6 @@
                     ridingModel.property = PropertyTip.Pet;
                     ridingModel.RidingId = PetID;
                     WindowCenter.Instance.Open<TargetPetAttrWin>();
-                    //  WindowCenter.Instance.Get<TargetPetAttrWin>().PropertyMountAndPet(PropertyTip.Pet, PetID);
-
                 });
                 if (petmodel._DicPetBack[PetID].PetClass >= PetModel.MaxRank)//婊¢樁
                 {
@@ -697,6 +710,53 @@
             FragmentUnlockTip.SetActive(false);
             FullAttTip.SetActive(true);
         }
+
+        public void FairyJadeDomesticate()//浠欑帀椹吇
+        {
+            int NumberLv = AutoTrainTipsPWin._Lvnumber;//绛夌骇鎵�闇�鐨勭瓑绾�
+            if (NumberLv > petmodel._DicPetBack[typePetID].PetClass && !WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>() && AutoTrainTipsPWin.IsFairy)
+            {
+                isAutoTrain = true;
+                petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
+                IsZidong = true;
+                StartCoroutine("FairyJadeD");
+            }
+        }
+        IEnumerator FairyJadeD()//浠欑帀椹吇
+        {
+            int number = AutoTrainTipsPWin.DomesticateNumber;//鎵�闇�鐨勯鏁�
+            int NumberLv = AutoTrainTipsPWin._Lvnumber;//绛夌骇鎵�闇�鐨勭瓑绾�
+            while (NumberLv > petmodel._DicPetBack[typePetID].PetClass)
+            {
+                if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())
+                {
+                    isAutoTrain = false;
+                    IsZidong =false;
+                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");              
+                    StopCoroutine("FairyJadeD");
+                    yield break;
+                }
+                if (petmodel.Wait)
+                {
+                    petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_7");
+                    int exp = PetClassCostConfig.GetPetIdAndRank(typePetID, petmodel._DicPetBack[typePetID].PetClass).NeedExpTotal;
+                    int NeedNum = ridingModel.PetAndHorseNeedDanNum(exp);
+                    petmodel.SendPetTrainQuest(petmodel._DicPetBack[typePetID].ItemPlace, NeedNum, 1);//鍚戞湇鍔$鍙戝寘鍧愰獞缁忛獙鍗�
+                    petmodel.Wait = false;
+                }
+                yield return null;
+            }
+            if (isAutoTrain)
+            {
+                AutoTrainTipsPWin.IsFairy = false;
+                isAutoTrain = false;
+                IsZidong = false;
+                petAutoTrainText.text = Language.Get("PetWin_EvolveTrainBtn_6");
+                StopCoroutine("FairyJadeD");
+                yield break;
+            }
+            yield break;
+        }
     }
 }
 
diff --git a/System/Pet/PetAttributeWin.cs b/System/Pet/PetAttributeWin.cs
index d2f8d68..5984c53 100644
--- a/System/Pet/PetAttributeWin.cs
+++ b/System/Pet/PetAttributeWin.cs
@@ -224,7 +224,9 @@
                     return;
                 }
             }
+            petmodel.SigPetId = petId;
             TypePetID = petId;
+
             _PetAttributeMethods.ModelShow(petId);
 
         }
@@ -316,6 +318,7 @@
                     if (Pet != 0)
                     {
                         TypePetID = Pet;
+                        petmodel.SigPetId = Pet;
                         return;
                     }
                 }
@@ -331,6 +334,7 @@
                     if (Value.UnLockNeedItemID == ItemId)
                     {
                         TypePetID = Value.ID;
+                        petmodel.SigPetId = TypePetID;
                         return;
                     }
                 }
@@ -341,6 +345,7 @@
                 if (petmodel.DeblockingRedPoint[key].state == RedPointState.Simple)
                 {
                     TypePetID = key;
+                    petmodel.SigPetId = TypePetID;
                     return;
                 }
             }
@@ -350,16 +355,19 @@
                 if (petmodel.CultivateRedPoint[key].state == RedPointState.Simple)
                 {
                     TypePetID = key;
+                    petmodel.SigPetId = TypePetID;
                     return;
                 }
             }
             if (petmodel.PetNow != 0)
             {
                 TypePetID = petmodel.PetNow;
+                petmodel.SigPetId = TypePetID;
             }
             else
             {
                 TypePetID = sortlist[0].ID;
+                petmodel.SigPetId = TypePetID;
             }
         }
         private int JunpIndex()
@@ -389,6 +397,7 @@
                     if (value.ID == petID[0])
                     {
                         TypePetID = petID[0];
+                        petmodel.SigPetId = TypePetID;
                     }
                 }
                 //m_ScrollerController.m_Scorller.RefreshActiveCellViews();//鍒锋柊鍙
@@ -424,6 +433,13 @@
             }
             return Index;
         }
+
+
+        public void FairyJadeDomesticate()
+        {
+            _PetAttributeMethods.FairyJadeDomesticate();
+
+        }
     }
 }
 
diff --git a/System/Pet/PlayerPetDatas.cs b/System/Pet/PlayerPetDatas.cs
index cced869..a91edf8 100644
--- a/System/Pet/PlayerPetDatas.cs
+++ b/System/Pet/PlayerPetDatas.cs
@@ -48,6 +48,7 @@
 
     public bool IsOk = false;
     private int PetDanExp = 0;//鐏靛疇涓圭粡楠�
+    public int SigPetId = 0;//鐢ㄦ潵鏍囪褰撳墠閫変腑鐨勫潗楠慖D
     public List<int> ListEffectSkill = new List<int>();
     PlayerPackModel _playerPack;
     PlayerPackModel playerPack
@@ -174,11 +175,12 @@
         }
     }
 
-    public void SendPetTrainQuest(int petIndex, int number)
+    public void SendPetTrainQuest(int petIndex, int number,int _IsAutoBuy)
     {
         CA704_tagCMPetClassUP _tagCA704 = new CA704_tagCMPetClassUP();
         _tagCA704.PetItemIndex = (byte)petIndex;
         _tagCA704.UseItemCnt = (ushort)number;
+        _tagCA704.IsAutoBuy = (byte)_IsAutoBuy;
         GameNetSystem.Instance.SendInfo(_tagCA704);
     }
     #endregion

--
Gitblit v1.8.0