示例#1
0
        public static void initTalentEffectProp(GameClient client)
        {
            TalentData myTalentData = TalentManager.GetTalentData(client);

            if (myTalentData != null && myTalentData.IsOpen)
            {
                TalentPropData myPropData = client.ClientData.MyTalentPropData;
                myPropData.ResetProps();
                foreach (TalentEffectItem item in myTalentData.EffectList)
                {
                    TalentInfo talentInfo = TalentManager.GetTalentInfoByID(client.ClientData.Occupation, item.ID);
                    if (talentInfo.LevelMax >= item.Level)
                    {
                        item.ItemEffectList = talentInfo.EffectList[item.Level];
                        foreach (TalentEffectInfo info in item.ItemEffectList)
                        {
                            switch (info.EffectType)
                            {
                            case 1:
                                myPropData.PropItem.BaseProps[info.EffectID] += (double)((int)info.EffectValue);
                                break;

                            case 2:
                                myPropData.PropItem.ExtProps[info.EffectID] += info.EffectValue;
                                break;

                            case 3:
                                if (myPropData.SkillOneValue.ContainsKey(info.EffectID))
                                {
                                    Dictionary <int, int> skillOneValue;
                                    int effectID;
                                    (skillOneValue = myPropData.SkillOneValue)[effectID = info.EffectID] = skillOneValue[effectID] + (int)info.EffectValue;
                                }
                                else
                                {
                                    myPropData.SkillOneValue.Add(info.EffectID, (int)info.EffectValue);
                                }
                                break;

                            case 4:
                                myPropData.SkillAllValue += (int)info.EffectValue;
                                break;
                            }
                        }
                    }
                }
                TalentManager.InitSpecialProp(client);
                client.ClientData.MyTalentData.SkillOneValue = client.ClientData.MyTalentPropData.SkillOneValue;
                client.ClientData.MyTalentData.SkillAllValue = client.ClientData.MyTalentPropData.SkillAllValue;
                TalentManager.SetTalentProp(client, TalentEffectType.PropBasic, myPropData.PropItem);
                TalentManager.SetTalentProp(client, TalentEffectType.PropExt, myPropData.PropItem);
            }
        }
示例#2
0
 public bool ProcessCmdTalentGetData(GameClient client, int nID, byte[] bytes, string[] cmdParams)
 {
     try
     {
         if (!CheckHelper.CheckCmdLengthAndRole(client, nID, cmdParams, 1))
         {
             return(false);
         }
         TalentData talentData = TalentManager.GetTalentData(client);
         client.sendCmd <TalentData>(1000, talentData, false);
         return(true);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false, false);
     }
     return(false);
 }
示例#3
0
 public bool ProcessCmdTalentWash(GameClient client, int nID, byte[] bytes, string[] cmdParams)
 {
     try
     {
         if (!CheckHelper.CheckCmdLengthAndRole(client, nID, cmdParams, 2))
         {
             return(false);
         }
         int        washType   = int.Parse(cmdParams[1]);
         int        state      = TalentManager.TalentWash(client, washType);
         TalentData talentData = TalentManager.GetTalentData(client);
         talentData.State = state;
         client.sendCmd <TalentData>(1002, talentData, false);
         return(true);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false, false);
     }
     return(false);
 }
示例#4
0
 public bool ProcessCmdTalentOther(GameClient client, int nID, byte[] bytes, string[] cmdParams)
 {
     try
     {
         if (!CheckHelper.CheckCmdLength(client, nID, cmdParams, 1))
         {
             return(false);
         }
         int        roleID      = Convert.ToInt32(cmdParams[0]);
         TalentData talentData  = null;
         GameClient otherClient = GameManager.ClientMgr.FindClient(roleID);
         if (otherClient != null)
         {
             talentData = TalentManager.GetTalentData(otherClient);
         }
         client.sendCmd <TalentData>(999, talentData, false);
         return(true);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false, false);
     }
     return(false);
 }