少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
using UnityEngine;
using System.Collections.Generic;
 
using vnxbqy.UI;
using UnityEngine.Events;
 
public class HeroBehaviour
{
    TreasureSkillModel treasureSkillModel = null;
 
    TreasureSkillModel tsModel
    {
        get
        {
            return treasureSkillModel ?? (treasureSkillModel = ModelCenter.Instance.GetModel<TreasureSkillModel>());
        }
    }
 
    /// <summary>
    /// 挂机开始
    /// </summary>
    public static event System.Action OnStopHandupAI;
    /// <summary>
    /// 挂机结束
    /// </summary>
    public static event System.Action OnStartHandupAI;
 
    public static event UnityAction<int> onCastSkill;
 
    /// <summary>
    /// 当用户点击了技能按钮, 并切技能可以释放的时候调用
    /// </summary>
    public static event UnityAction<int> OnUserClickSkill;
 
    public enum E_BehaviourState
    {
        None,
        KillUntilDie,
        Auto,
        FixedPosition,
    }
 
    private int curComAtkIndex;
    private float m_LastCommonAtkTime;
 
    private bool m_ClientFightEnable = false;
    private GA_Hero m_Hero;
    private int m_WillUsedSkillID;
 
    public HeroBehaviour(GA_Hero hero)
    {
        m_Hero = hero;
 
        FuncConfigConfig _func = FuncConfigConfig.Get("ClientFightEnable");
        int _enable = int.Parse(_func.Numerical1);
        m_ClientFightEnable = (_enable == 1);
 
    }
 
    private List<CB405_tagCMSuperAtk.tagSkillPosHurtObj> _serverHurtList = new List<CB405_tagCMSuperAtk.tagSkillPosHurtObj>();
 
    public void DoPrepareCast(int skillID)
    {
        Skill _skill = m_Hero.SkillMgr.Get(skillID);
 
        if (_skill.SkillPreparing == false)
        {
            return;
        }
        if (_skill.skillInfo.config.CastTime == 0)
        {
            return;
        }
 
        _skill.CSkillPrepareEnd = true;
    }
 
    public void StartKillUntilDieAI(int skillID = -1)
    {
        if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
        {
            Debug.LogWarning("登陆流程尚未完成");
            return;
        }
 
        MapTransferUtility.Instance.Clear();
 
        // 安全区直接退出
        if (MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.Safe)
         || MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.RebornSafe))
        {
            SysNotifyMgr.Instance.ShowTip("NoFighting");
            return;
        }
 
        if (m_Hero.IsPolyMorph)
        {
            return;
        }
 
        if (m_Hero.aiHandler.currentType == E_HeroAIType.KillUntilDie)
        {
            if (IsComAtk(skillID))
            {
                return;
            }
        }
 
        if (skillID < 0)
        {
            int _index = Mathf.Clamp(m_Hero.nextComAtkIndex, 0, m_Hero.JobSetup.ComAtkIdList.Length - 1);
            skillID = m_Hero.JobSetup.ComAtkIdList[_index];
            if(ArenaManager.IsArenaClientNotMirrorFight)
            {
                for(int j = 0; j < m_Hero.JobSetup.ComAtkIdList.Length;j++)
                {
                    _index = Mathf.Clamp(m_Hero.nextComAtkIndex, 0, m_Hero.JobSetup.ComAtkIdList.Length - 1);
                    skillID = m_Hero.JobSetup.ComAtkIdList[_index];
                    bool bWork = true;
                    for (int i = 0; i < GeneralDefine.WorkNotSkills.Length; i++)
                    {
                        skillID = m_Hero.JobSetup.ComAtkIdList[_index];
                        if (skillID != GeneralDefine.WorkNotSkills[i])
                            bWork = false;
                    }
                    if (bWork)
                        break;
                }
                
            }
        }
 
        Skill _skill = m_Hero.SkillMgr.Get(skillID);
 
        bool _forceCast = false;
        SkillHelper.EffectValue _effectValue;
        if (SkillHelper.Instance.TryGetExpertSkillEvByMainSkillID(_skill.id, 4093, out _effectValue))
        {
            _forceCast = true;
        }
 
        if ((!StatusMgr.Instance.CanAttack(m_Hero.ServerInstID, _skill.skillInfo.config) || m_Hero.IsStun()) && !_forceCast)
        {
            return;
        }
 
        if (_skill.IsValid() == false)
        {
            return;
        }
 
        m_WillUsedSkillID = skillID;
 
        if (_skill.skillInfo.config.CastTime > 0)
        {
            _skill.CSkillPrepareEnd = false;
        }
 
        GActorFight _fightTarget = m_Hero.LockTarget as GActorFight;
 
        if (_fightTarget != null && _fightTarget.CanAtked())
        {
            m_Hero.SelectTarget = _fightTarget;
        }
        else
        {
            _fightTarget = m_Hero.SelectTarget as GActorFight;
 
            if (_fightTarget == null || !_fightTarget.CanAtked())
            {
                float _range = m_Hero.JobSetup.SearchEnemyDist * Constants.F_DELTA;
                m_Hero.SelectTarget = GAMgr.Instance.FindAtkTarget(m_Hero.Pos, _range, 360);
                _fightTarget = m_Hero.SelectTarget as GActorFight;
            }
        }
 
        if (m_Hero.aiHandler.currentType == E_HeroAIType.None
         || m_Hero.aiHandler.currentType == E_HeroAIType.KillUntilDie)
        {
            byte _type = (byte)E_HeroAIType.KillUntilDie;
            KillUntilDieData _data = m_Hero.aiHandler.aiData[_type] as KillUntilDieData;
            if (_fightTarget != null)
            {
                _data.targetServerInstID = _fightTarget.ServerInstID;
            }
            _data.defaultSkillID = m_WillUsedSkillID;
            m_Hero.aiHandler.currentType = E_HeroAIType.KillUntilDie;
 
            if (OnUserClickSkill != null)
            {
                OnUserClickSkill(m_WillUsedSkillID);
            }
        }
        else
        {
            if (OnUserClickSkill != null)
            {
                OnUserClickSkill(m_WillUsedSkillID);
            }
        }
    }
 
    public void StopKillUntilDieAI()
    {
        if (m_Hero.aiHandler.currentType == E_HeroAIType.KillUntilDie)
        {
            m_Hero.aiHandler.currentType = E_HeroAIType.None;
        }
    }
 
    public void StartHandupAI()
    {
        if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
        {
            Debug.LogWarning("登陆流程尚未完成");
            return;
        }
 
        MapTransferUtility.Instance.Clear();
 
        // 安全区直接退出
        if (MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.Safe)
         || MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.RebornSafe))
        {
            SysNotifyMgr.Instance.ShowTip("NoFighting");
            // 
            return;
        }
 
        if (PreFightMission.Instance.IsFinished() == false)
        {
            return;
        }
 
        m_Hero.aiHandler.currentType = E_HeroAIType.NormalAuto;
 
        // 判断是什么副本类型
        DungeonModel _dgModel = ModelCenter.Instance.GetModel<DungeonModel>();
        int _dataMapID = _dgModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
        if (_dataMapID != 0)
        {
            int _configID = _dataMapID * 10 + _dgModel.mission.lineID;
            DungeonConfig _dgConfig = DungeonConfig.Get(_configID);
 
            if (_dgConfig != null && _dgConfig.AutomaticATK > 1)
            {
                m_Hero.aiHandler.currentType = (E_HeroAIType)_dgConfig.AutomaticATK;
            }
        }
        //#if UNITY_EDITOR
        //        Debug.LogFormat("AI类型: {0}", m_Hero.aiHandler.currentType.ToString());
        //#endif
        if (OnStartHandupAI != null)
        {
            OnStartHandupAI();
        }
    }
 
    public void StopHandupAI(bool force = false)
    {
        if (!force)
        {
            if (StageLoad.Instance.stageType == Stage.E_StageType.Dungeon)
            {
                if (DungeonStage.CurrentMapType != MapType.OpenCountry)
                {
                    return;
                }
            }
        }
 
        if (!PreFightMission.Instance.IsFinished())
        {
            return;
        }
 
        if (m_Hero.aiHandler.IsAuto())
        {
            m_Hero.aiHandler.Stop();
        }
 
        if (OnStopHandupAI != null)
        {
            OnStopHandupAI();
        }
 
        m_Hero.forceAutoFightTime = Time.realtimeSinceStartup;
    }
 
    public bool IsComAtk(int skillID)
    {
        for (int i = 0; i < m_Hero.JobSetup.ComAtkIdList.Length; ++i)
        {
            if (skillID == m_Hero.JobSetup.ComAtkIdList[i])
            {
                return true;
            }
        }
        return false;
    }
 
    public void ResetComAtkConnectTime()
    {
        m_LastCommonAtkTime = Time.realtimeSinceStartup;
    }
 
    public int DoCommonAttack()
    {
        if (Time.realtimeSinceStartup - m_LastCommonAtkTime > GeneralDefine.ResetComAtkTime)
        {
            m_Hero.nextComAtkIndex = 0;
        }
 
        if (m_Hero.State == E_ActorState.DaZuo
         || GA_Hero.s_MapSwitching
         || MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.Safe)
         || MapArea.IsInMapArea(m_Hero.CurMapArea, MapArea.E_Type.RebornSafe))
        {
            return -1;
        }
 
        int skillId = 0;
        Skill _skill = null;
 
        if (m_Hero.nextComAtkIndex >= 0 && m_Hero.nextComAtkIndex < m_Hero.JobSetup.ComAtkIdList.Length)
        {
            curComAtkIndex = m_Hero.nextComAtkIndex;
        }
        else
        {
            curComAtkIndex = 0;
        }
 
        skillId = m_Hero.GetCommonSkillID(curComAtkIndex);
        _skill = m_Hero.SkillMgr.Get(skillId);
 
        if (!StatusMgr.Instance.CanAttack(m_Hero.ServerInstID, _skill.skillInfo.config))
        {
            return -1;
        }
 
        if (_skill.IsValid() == false)
        {
            return -1;
        }
 
        int _chkIndex = curComAtkIndex == 0 ? m_Hero.JobSetup.ComAtkIdList.Length - 1 : curComAtkIndex - 1;
 
        skillId = m_Hero.GetCommonSkillID(_chkIndex);
        _skill = m_Hero.SkillMgr.Get(skillId);
        if (_skill != null)
        {
            //Debug.LogFormat("取得技能: {0} 是否完成: {1}", skillId, _skill.SkillCompelete);
            if (_skill.SkillCompelete)
            {
                skillId = m_Hero.GetCommonSkillID(curComAtkIndex);
                _skill = m_Hero.SkillMgr.Get(skillId);
                if (_skill != null)
                {
                    DoAttack(_skill);
                    m_Hero.nextComAtkIndex = curComAtkIndex + 1;
                }
            }
        }
 
        return skillId;
    }
 
    public void DoAttack(Skill skill)
    {
        if (PlayerDatas.Instance.extersion.Tick == 0 &&
            PlayerDatas.Instance.crossServerTick == 0)
        {
            return;
        }
 
        if (skill == null || GA_Hero.s_MapSwitching)
        {
            return;
        }
 
        if (m_Hero.ActorInfo.serverDie)
        {
            return;
        }
 
        // 可能有残留之前的伤害列表, 只在进入前端伤害的时候进行清除
        if (ClientSceneManager.Instance.IsClientFightMode)
        {
            skill.ClearServerHurtList();
        }
 
        skill.mainTarget = null;
        skill.targetPosition = Vector3.zero;
 
        skill.hitTargetList.Clear();
        skill.hitClientBattleTargetList.Clear();
 
        SoSkill _soSkill = ScriptableObjectLoader.LoadSoSkill(skill.skillInfo.config.SkillTypeID);
        if (_soSkill == null)
        {
            DebugEx.LogWarningFormat("技能: {0} 没有配置SoSkill文件, 将没有范围检测能力.", skill.id);
            return;
        }
 
        // 确定此次可检测的目标数量
        int _hitTestLimit = 1;
        SkillHelper.EffectValue _effectValue;
        if (skill.skillInfo.effectValue.TryGetValue(1200, out _effectValue))
        {
            _hitTestLimit = _effectValue.value1;
        }
        var _spSkillInfo = SkillHelper.Instance.GetSpSkill(skill.id);
        if (_spSkillInfo != null)
        {
            for (int i = 0; i < _spSkillInfo.Count; ++i)
            {
                if (_spSkillInfo[i].effectValue.TryGetValue(4036, out _effectValue))
                {
                    _hitTestLimit += _effectValue.value1;
#if UNITY_EDITOR
                    if (RuntimeLogUtility.s_SkillEffectLog)
                    {
                        Debug.LogFormat("技能 {0} 触发了效果 {1} , _hitTestLimit 增加了 {2}", _spSkillInfo[i].config.SkillID, 4036, _effectValue.value1);
                    }
#endif
                }
            }
        }
 
        if (PlayerDatas.Instance.baseData.AttackMode == (byte)E_AttackMode.Contest)
        {
            _hitTestLimit = 1;
        }
 
        E_SkillCastType _castType = (E_SkillCastType)(skill.skillInfo.config.Tag % 10);
        E_SkillCastTarget _targetType = (E_SkillCastTarget)(skill.skillInfo.config.Tag / 10);
 
        if (UserInputHandler.isTouched)
        {
            m_Hero.Forward = m_Hero.destForward;
        }
 
        Vector3 _sourcePosition = m_Hero.Pos;
        _sourcePosition.y = 0;
 
        Vector3 _realDir = m_Hero.Forward;
        if (skill.id == 190)
        {
            _realDir = m_Hero.destForward;
        }
 
        if (!UserInputHandler.isTouched)
        {
            if (m_Hero.aiHandler.IsAuto())
            {
                GActorFight _fight = m_Hero.LockTarget as GActorFight;
                if (_fight != null && _fight.CanAtked())
                {
                    _realDir = m_Hero.Forward = MathUtility.ForwardXZ(m_Hero.LockTarget.Pos, m_Hero.Pos);
                }
                else if (m_Hero.SelectTarget != null)
                {
                    _realDir = m_Hero.Forward = MathUtility.ForwardXZ(m_Hero.SelectTarget.Pos, m_Hero.Pos);
                }
            }
        }
 
        if (_realDir == Vector3.zero)
        {
            _realDir = m_Hero.Root.forward;
        }
 
        Vector3 _targetPosition = m_Hero.Pos + _realDir * (skill.skillInfo.config.AtkDist * .5f);
        _targetPosition.y = 0;
        UnityEngine.AI.NavMeshHit _navMeshHit;
        if (UnityEngine.AI.NavMesh.Raycast(_sourcePosition, _targetPosition, out _navMeshHit, LayerUtility.WalkbleMask))
        {
            _targetPosition = _navMeshHit.position;
        }
        _targetPosition.y = m_Hero.Pos.y;
        skill.targetPosition = _targetPosition;
 
        // 如果技能是对地的技能, 则基准点应该为目标
        // 没有目标则基准点为技能的施法距离
        if (_castType == E_SkillCastType.Ground)
        {
            if (skill.skillInfo.config.Skillactmark != GAStaticDefine.Act_Roll
                && skill.skillInfo.config.AtkType != (int)E_AtkType.FlashMove)
            {
                GActorFight _fight = m_Hero.LockTarget as GActorFight;
                if (_fight != null && _fight.CanAtked())
                {
                    skill.targetPosition = m_Hero.LockTarget.Pos;
                }
                else if (m_Hero.SelectTarget != null)
                {
                    skill.targetPosition = m_Hero.SelectTarget.Pos;
                }
            }
        }
        else if (_castType == E_SkillCastType.NeedTarget)
        {
            Vector3 _dir;
            float _radius = 0.5f;
            GActorFight _fight = m_Hero.LockTarget as GActorFight;
            if (_fight != null && _fight.CanAtked())
            {
                GActorNpcFight _npcFight = m_Hero.LockTarget as GActorNpcFight;
                if (_npcFight != null)
                {
                    _radius = _npcFight.NpcConfig.ModelRadius;
                }
                _dir = MathUtility.ForwardXZ(m_Hero.Pos, m_Hero.LockTarget.Pos);
                skill.targetPosition = m_Hero.LockTarget.Pos + _dir * _radius;
                skill.mainTarget = m_Hero.LockTarget as GActorFight;
            }
            else if (m_Hero.SelectTarget != null)
            {
                GActorNpcFight _npcFight = m_Hero.SelectTarget as GActorNpcFight;
                if (_npcFight != null && _npcFight.CanAtked())
                {
                    _radius = _npcFight.NpcConfig.ModelRadius;
                }
                _dir = MathUtility.ForwardXZ(m_Hero.Pos, m_Hero.SelectTarget.Pos);
                skill.targetPosition = m_Hero.SelectTarget.Pos + _dir * _radius;
                skill.mainTarget = m_Hero.SelectTarget as GActorFight;
            }
        }
        else
        {
            if (skill.id != 190)
            {
                GActorNpcFight _npcFight = m_Hero.SelectTarget as GActorNpcFight;
                if (m_Hero.SelectTarget != null
                 && (m_Hero.SelectTarget.ActorType != GameObjType.gotNPC
                 || (_npcFight != null && _npcFight.NpcConfig.IsBoss > 1)))
                {
                    float _distSqrt2 = MathUtility.DistanceSqrtXZ(m_Hero.SelectTarget.Pos, skill.targetPosition);
 
                    float _chkDist = m_Hero.JobSetup.MoveLimitDist * Constants.F_DELTA;
                    float _chkDistSqrt = Mathf.Pow(_chkDist, 2);
 
                    if (_distSqrt2 > _chkDistSqrt)
                    {
                        Vector3 _dir = MathUtility.ForwardXZ(m_Hero.SelectTarget.Pos, m_Hero.Pos);
                        if (_dir == Vector3.zero)
                        {
                            _dir = m_Hero.Root.forward;
                        }
                        skill.targetPosition = m_Hero.SelectTarget.Pos + _dir * _chkDist;
                    }
                }
            }
        }
 
        if (m_Hero.SelectTarget != null)
        {
            // 检测复活buff是否存在
            if (StatusMgr.Instance.IsInvincible(m_Hero.SelectTarget.ServerInstID))
            {
                SysNotifyMgr.Instance.ShowTip("PKFuHuo");
            }
        }
 
        if (skill.targetPosition != Vector3.zero)
        {
            Vector3 _adjustPos = PathFinder.AdjustPosition(skill.targetPosition);
            skill.targetPosition = new Vector3(_adjustPos.x, skill.targetPosition.y, _adjustPos.z);
        }
 
        if (!StatusMgr.Instance.CanMove(m_Hero.ServerInstID))
        {
            skill.targetPosition = m_Hero.Pos;
        }
 
        if (_targetType == E_SkillCastTarget.CanAttacked)
        {
            if (m_Hero.SelectTarget != null)
            {
                if (StatusMgr.Instance.IsInvincible(m_Hero.SelectTarget.ServerInstID))
                {
                    GAStaticDefine.PopHp(m_Hero, m_Hero.SelectTarget, (int)HurtAttackType.Immune, 0);
                }
            }
        }
 
        // 判断当前目标是否可以加入可攻击列表中
        if (m_Hero.SelectTarget is GA_NpcClientFightNorm)
        {
            if (CheckCanAttackTarget(m_Hero.SelectTarget as GActorFight, skill, _soSkill, skill.targetPosition))
            {
                if (PersonalEnemy.m_CBinSdDict.ContainsKey(m_Hero.SelectTarget.ServerInstID))
                {
                    //绑定木桩的算服务端
                    AddToHitTargetList(skill, m_Hero.SelectTarget);
                }
                else
                {
                    AddToHitClientBattleTargetList(skill, m_Hero.SelectTarget);
                }
            }
        }
        else
        {
            if (CheckCanAttackTarget(m_Hero.SelectTarget as GActorFight, skill, _soSkill, skill.targetPosition))
            {
                AddToHitTargetList(skill, m_Hero.SelectTarget);
            }
        }
 
        // 判断范围内的目标是否可以接入可攻击列表中
        List<GActor> _actorList = GAMgr.Instance.GetAll();
        _actorList.Sort((GActor a1, GActor a2) =>
                {
                    float _distA1 = MathUtility.DistanceSqrtXZ(a1.Pos, skill.targetPosition);
                    float _distA2 = MathUtility.DistanceSqrtXZ(a2.Pos, skill.targetPosition);
 
                    if (_distA1 < _distA2)
                    {
                        return -1;
                    }
                    else if (_distA1 > _distA2)
                    {
                        return 1;
                    }
                    return 0;
                });
 
        for (int i = 0; i < _actorList.Count && skill.hitTargetList.Count + skill.hitClientBattleTargetList.Count < _hitTestLimit; ++i)
        {
#if UNITY_EDITOR
            if (RuntimeLogUtility.s_ForceOneEnemy && i > 0)
            {
                continue;
            }
#endif
 
            if (_actorList[i] is GA_NpcClientFightNorm)
            {
                if (CheckCanAttackTarget(_actorList[i] as GActorFight, skill, _soSkill, skill.targetPosition))
                {
                    var _sid = _actorList[i].ServerInstID;
                    if (PersonalEnemy.GetPersionEnemySID(_sid) != 0)
                    {
                        AddToHitTargetList(skill, _actorList[i]);
                    }
                    else
                    {
                        AddToHitClientBattleTargetList(skill, _actorList[i]);
                    }
                }
            }
            else if (_actorList[i] is GA_NpcFightSgzcZZ)
            {
                if (CheckCanAttackTarget(_actorList[i] as GActorFight, skill, _soSkill, skill.targetPosition))
                {
                    AddToHitClientBattleTargetList(skill, _actorList[i]);
                }
            }
            else
            {
                if (CheckCanAttackTarget(_actorList[i] as GActorFight, skill, _soSkill, skill.targetPosition))
                {
                    AddToHitTargetList(skill, _actorList[i]);
                }
            }
        }
 
        if (skill.hitTargetList.Count == 0 && skill.hitClientBattleTargetList.Count == 0)
        {
            if (_castType == E_SkillCastType.NeedTarget)
            {
                SysNotifyMgr.Instance.ShowTip("SkillSelectedTarget");
                return;
            }
        }
 
        m_Hero.OnHorse(0);
        DTC0428_tagPlayerRideHorse.Send_tagPlayerRideHorse(false);
 
        // 处理吟唱和蓄力类技能
        if (skill.skillInfo.config.CastTime > 0)
        {
            if (m_Hero.SkillMgr.CurCastSkill != skill || m_Hero.SkillMgr.CurCastSkill.SkillCompelete)
            {
                // 带进度条技能只设置当前技能, 并不将其释放
                m_Hero.SkillMgr.CastSkill(m_Hero.ServerInstID, skill.id);
                skill.SkillPreparing = true;
                m_Hero.NextAction = 200;
                m_Hero.SkillMgr.DoingPrepareSkill = true;
            }
        }
        else
        {
            if (skill.id == 190)
            {
                m_Hero.StopPathFind();
                m_Hero.State = E_ActorState.Roll;
            }
 
            // 开始执行表现层技能逻辑
            m_Hero.SkillMgr.CastSkill(m_Hero.ServerInstID, skill.id);
 
            if (skill.skillInfo.config.Skillactmark > 0
             && skill.skillInfo.config.Skillactmark < 20)
            {
                switch (skill.skillInfo.config.Skillactmark)
                {
                    case 10:
                        m_Hero.Play(GAStaticDefine.State_Attack1Hash, 0);
                        break;
                    case 11:
                        m_Hero.Play(GAStaticDefine.State_Attack2Hash, 0);
                        break;
                    case 12:
                        m_Hero.Play(GAStaticDefine.State_Attack3Hash, 0);
                        break;
                    case 13:
                        m_Hero.Play(GAStaticDefine.State_Attack4Hash, 0);
                        break;
                }
 
                m_LastCommonAtkTime = Time.realtimeSinceStartup;
            }
            else
            {
                m_Hero.NextAction = skill.skillInfo.config.Skillactmark;
                switch (skill.skillInfo.config.Skillactmark)
                {
                    case 21:
                        m_Hero.Play(GAStaticDefine.State_Skill21, 0);
                        break;
                    case 22:
                        m_Hero.Play(GAStaticDefine.State_Skill22, 0);
                        break;
                    case 23:
                        m_Hero.Play(GAStaticDefine.State_Skill23, 0);
                        break;
                    case 24:
                        m_Hero.Play(GAStaticDefine.State_Skill24, 0);
                        break;
                    case 25:
                        m_Hero.Play(GAStaticDefine.State_Skill25, 0);
                        break;
                    case 26:
                        m_Hero.Play(GAStaticDefine.State_Skill26, 0);
                        break;
                    case 27:
                        m_Hero.Play(GAStaticDefine.State_Skill27, 0);
                        break;
                    case 28:
                        m_Hero.Play(GAStaticDefine.State_Skill28, 0);
                        break;
                    case 29:
                        m_Hero.Play(GAStaticDefine.State_Skill29, 0);
                        break;
                    case 99:
                        m_Hero.Play(GAStaticDefine.State_RollHash, 0);
                        break;
                }
            }
        }
 
        ulong _hurtValue = 0;
        byte _attackType = 0;
 
        if (PreFightMission.Instance.IsFinished())
        {
            if (_castType != E_SkillCastType.NeedTarget || skill.hitTargetList.Count > 0
             || skill.skillInfo.config.Skillactmark == GAStaticDefine.Act_Roll)
            {
                GActorFight _target = null;
 
                CB405_tagCMSuperAtk _b405 = null;
                if (!AdventureStage.Instance.IsInAdventureStage
#if UNITY_EDITOR
                 && !RuntimeLogUtility.TEST_CLIENT_PVP
#endif
                )
                {
                    // 创建发包协议
                    _b405 = new CB405_tagCMSuperAtk();
                    _b405.SkillID = (ushort)SkillHelper.Instance.GetSkillID(skill.skillInfo.config.SkillTypeID);
                    _b405.PosX = (ushort)(m_Hero.Pos.x * 2 + GA_Hero.MapOffset.x);
                    _b405.PosY = (ushort)(m_Hero.Pos.z * 2 + GA_Hero.MapOffset.z);
                    _b405.TagPosX = (ushort)(skill.targetPosition.x * 2 + GA_Hero.MapOffset.x);
                    _b405.TagPosY = (ushort)(skill.targetPosition.z * 2 + GA_Hero.MapOffset.z);
                    _b405.WorldTick = PlayerDatas.Instance.GetWorldTick();
                }
 
                _serverHurtList.Clear();
 
                if (ClientDungeonStageUtility.isClientDungeon)
                {
                    _b405.PosX = (ushort)(GA_Hero.recordServerPos.x + GA_Hero.MapOffset.x);
                    _b405.PosY = (ushort)(GA_Hero.recordServerPos.z + GA_Hero.MapOffset.z);
                    _b405.TagPosX = (ushort)(GA_Hero.recordServerPos.x + GA_Hero.MapOffset.x);
                    _b405.TagPosY = (ushort)(GA_Hero.recordServerPos.z + GA_Hero.MapOffset.z);
                }
 
                //        Debug.LogFormat("释放了技能: {0},当前位置: {1} 目标位置: {2}", _b405.SkillID, new Vector2(_b405.PosX, _b405.PosY), new Vector2(_b405.TagPosX, _b405.TagPosY));
                uint _bindID = 0;
                // 创建出攻击客户端攻击对象和服务端攻击对象
                for (int i = 0; i < skill.hitTargetList.Count; ++i)
                {
                    _target = GAMgr.Instance.GetByCID(skill.hitTargetList[i]) as GActorFight;
 
                    if (_target == null)
                    {
                        Debug.LogFormat("<color=red>找到的目标对象: C:{0} 为空....</color>", skill.hitTargetList[i]);
                        continue;
                    }
                    _bindID = 0;
 
                    ClientSceneManager.Instance.lastDeadPos = _target.Pos;
 
                    if (_target is GA_NpcClientFightNorm || _target is GA_PVPClientPlayer)
                    {
                        _bindID = PersonalEnemy.GetPersionEnemySID(_target.ServerInstID);
                    }
 
                    // 选中对象都要生成服务端对象
                    CB405_tagCMSuperAtk.tagSkillPosHurtObj _hurtObj = new CB405_tagCMSuperAtk.tagSkillPosHurtObj();
                    _hurtObj.ObjID = _bindID == 0 ? _target.ServerInstID : _bindID;
 
                    if (_target is GA_PlayerXMZZ
                     || _target is GA_PVPClientPlayer || _target is GA_ILClientPlayer)
                    {
                        _hurtObj.ObjType = (byte)GameObjType.gotNPC;
                    }
                    else
                    {
                        _hurtObj.ObjType = (byte)_target.ActorType;
                    }
 
                    _serverHurtList.Add(_hurtObj);
 
                    if (m_ClientFightEnable == false)
                    {
                        continue;
                    }
 
                    // 人物, 非小怪不计算伤害,不生成客户端数据
                    if (_target.ActorType == GameObjType.gotPlayer
                    && !(_target is GA_PVPClientPlayer || _target is GA_ILClientPlayer))
                    {
                        GA_Player _player = _target as GA_Player;
                        if (_player != null)
                        {
                            if (_player.MovingState == E_MovingState.Ride)
                            {
                                _player.SwitchHorse(0);
                            }
                        }
                        continue;
                    }
 
                    if (_target.ActorType == GameObjType.gotNPC
                        && !(_target is GA_NpcFightSgzcZZ))
                    {
                        GActorNpcFight _npc = _target as GActorNpcFight;
                        if (_npc.NpcConfig.IsBoss != (int)E_MonsterType.Normal)
                        {
                            continue;
                        }
                    }
 
                    if (_bindID != 0)
                    {
                        continue;
                    }
 
                    // 计算此次伤害
                    AttackHandler.CalculateDamage(m_Hero, _target, skill, i, ref _hurtValue, ref _attackType);
 
                    // 服务端伤害赋值
                    _hurtObj.HurtHP = (uint)(_hurtValue % Constants.ExpPointValue);
                    _hurtObj.HurtHPEx = (uint)(_hurtValue / Constants.ExpPointValue);
                    _hurtObj.AttackType = _attackType;
 
                    if (_target.ActorInfo.Hp < _hurtValue)
                    {
                        _target.ActorInfo.SyncServerHp = 0;
                    }
                    else
                    {
                        _target.ActorInfo.SyncServerHp = _target.ActorInfo.Hp - _hurtValue;
                    }
 
                    _serverHurtList[_serverHurtList.Count - 1] = _hurtObj;
 
                    AttackHandler.HurtObjs _hurtObject = new AttackHandler.HurtObjs
                    {
                        ObjID = _target.ServerInstID,
                        ObjType = (byte)_target.ActorType,
                        clientInstID = _target.ClientInstID
                    };
 
                    // 客户端表现用伤害赋值
                    _hurtObject.HurtHP = _hurtValue;
                    _hurtObject.RealHurtHP = _hurtValue;
                    _hurtObject.AttackType = _attackType;
 
                    skill.hurtClientList.Add(_hurtObject);
                }
 
                if (_b405 != null)
                {
                    _b405.HurtCount = (ushort)_serverHurtList.Count;
                    _b405.HurtList = new CB405_tagCMSuperAtk.tagSkillPosHurtObj[_b405.HurtCount];
                    for (int i = 0; i < _b405.HurtCount; ++i)
                    {
                        _b405.HurtList[i] = new CB405_tagCMSuperAtk.tagSkillPosHurtObj()
                        {
                            ObjType = _serverHurtList[i].ObjType,
                            ObjID = _serverHurtList[i].ObjID,
                            AttackType = _serverHurtList[i].AttackType,
                            HurtHP = _serverHurtList[i].HurtHP,
                            HurtHPEx = _serverHurtList[i].HurtHPEx
                        };
                    }
                    if (!ArenaManager.IsArenaClientNotMirrorFight)
                    {
                        if (!CrossServerUtility.IsCrossServer())
                        {
                            GameNetSystem.Instance.SendInfo(_b405);
                        }
                        else
                        {
                            GameNetSystem.Instance.SendToCrossServer(_b405);
                        }
                    }
                }
 
#if UNITY_EDITOR
                string _content = string.Format("# CB405_tagCMSuperAtk => {0} 使用技能 {1}",
                                m_Hero.ServerInstID,
                                skill.id);
                RuntimeLogUtility.AddLog_Blue(_content);
#endif
            }
        }
 
        if (skill.hitClientBattleTargetList.Count > 0)
        {
            GActorFight _target = null;
 
            for (int i = 0; i < skill.hitClientBattleTargetList.Count; ++i)
            {
                _target = GAMgr.Instance.GetByCID(skill.hitClientBattleTargetList[i]) as GActorFight;
 
                if (PersonalEnemy.m_CBinSdDict.ContainsKey(_target.ServerInstID))
                {
                    continue;
                }
 
                AttackHandler.HurtObjs _hurtObject = new AttackHandler.HurtObjs
                {
                    ObjID = (uint)_target.ServerInstID,
                    ObjType = (byte)_target.ActorType,
                    clientInstID = _target.ClientInstID
                };
 
                AttackHandler.CalculateDamage(m_Hero, _target, skill, i, ref _hurtValue, ref _attackType);
                
                _hurtObject.HurtHP = _hurtValue;
                if (_target.ActorInfo.RealHp < _hurtValue)
                {
                    _hurtObject.CurHP = 0;
                }
                else
                {
                    _hurtObject.CurHP = _target.ActorInfo.RealHp - _hurtValue;
                }
                _hurtObject.RealHurtHP = _hurtValue;
                _hurtObject.AttackType = _attackType;
                _target.ActorInfo.SyncServerHp = _hurtObject.CurHP;
 
                var _clientNpc = _target as GA_NpcClientFightNorm;
                if (_clientNpc != null)
                {
                    _clientNpc.BeAttacked();
                }
 
                HandleExpertSkill(skill.id, m_Hero.ServerInstID, _target.ServerInstID);
 
                skill.hurtClntFightNpcList.Add(_hurtObject);
 
                if (_target.ActorInfo.RealHp <= _hurtValue && (_clientNpc == null || _clientNpc.lockHp <= 0))
                {
                    if (_clientNpc != null && _clientNpc.NpcConfig.AIType != 198)
                    {
                        _target.KillerServerInstID = m_Hero.ServerInstID;
                        _target.ActorInfo.serverDie = true;
                        GAMgr.Instance.ServerDie(_target.ServerInstID);
                        GAMgr.Instance.DoDelayDie(_target);
 
                        if (m_Hero.LockTarget == _target)
                        {
                            m_Hero.LockTarget = null;
                        }
                        if (m_Hero.SelectTarget == _target)
                        {
                            m_Hero.SelectTarget = null;
                        }
 
                        if (_clientNpc != null
                         && _clientNpc.belongEventID != -1)
                        {
                            ClientSceneManager.Instance.NpcDead(_clientNpc.belongEventID, _clientNpc, _clientNpc.NpcConfig.NPCID);
                        }
 
                        ClientSceneManager.Instance.lastDeadPos = _clientNpc.Pos;
                    }
                    // 前期战斗只发送石头人的
                    //if (1000 == _target.NpcConfig.NPCID)
                    //{
                    //    CA225_tagCMClientTaskCount _a225 = new CA225_tagCMClientTaskCount
                    //    {
                    //        CountID = (uint)_target.NpcConfig.NPCID
                    //    };
                    //    GameNetSystem.Instance.SendInfo(_a225);
                    //}
                }
            }
        }
 
        if (onCastSkill != null)
        {
            onCastSkill(skill.id);
        }
    }
 
    private void AddToHitTargetList(Skill skill, GActor target)
    {
        if (skill.hitTargetList.Contains(target.ClientInstID))
        {
            return;
        }
        skill.hitTargetList.Add(target.ClientInstID);
    }
 
    private void AddToHitClientBattleTargetList(Skill skill, GActor target)
    {
        if (skill.hitClientBattleTargetList.Contains(target.ClientInstID))
        {
            return;
        }
        skill.hitClientBattleTargetList.Add(target.ClientInstID);
    }
 
    private bool CheckCanAttackTarget(GActorFight actor, Skill skill, SoSkill soSkill, Vector3 basePosition)
    {
        if (ArenaManager.IsArenaClientNotMirrorFight)
        {
            soSkill.chkDistance = ArenaManager.ArenaCheckDistance;
            soSkill.chkRange = ArenaManager.ArenaCheckAngle;
        }
            
 
        // 取得可攻击的目标类型
        E_SkillCastTarget _targetType = (E_SkillCastTarget)(skill.skillInfo.config.Tag / 10);
        E_SkillCastType _castType = (E_SkillCastType)(skill.skillInfo.config.Tag % 10);
 
        if (actor == null
         || actor.ActorInfo.serverDie)
        {
            return false;
        }
 
        if (actor.ServerInstID == m_Hero.ServerInstID)
        {
            return false;
        }
 
        GActorNpcFight _fightNpc = actor as GActorNpcFight;
        GA_NpcFightSgzcZZ _sgzcRobot = actor as GA_NpcFightSgzcZZ;
 
        if (_fightNpc != null)
        {
            if (_fightNpc.NpcConfig.NPCType != (int)E_NpcType.PersonalEnemy)
            {
                if (_fightNpc.Group != E_ActorGroup.Enemy
                 || _fightNpc.NpcConfig.Country == 1)
                {
                    return false;
                }
            }
        }
 
        //Debug.LogFormat(" |-- 只对: {0} 伤害的技能", _targetType);
        // 只对小怪进行伤害的类型
        if (_targetType == E_SkillCastTarget.Monster)
        {
            // 不是怪物类型无法伤害
            if (_fightNpc == null)
            {
                Debug.LogFormat("   |-- 目标: {0} 不是战斗npc,不能对其造成伤害");
                Debug.LogFormat("<color=red>|-- 对象类型不对</color>");
                return false;
            }
        }
        // 可攻击怪物
        else if (_targetType == E_SkillCastTarget.CanAttackedMonster)
        {
            if (_fightNpc == null)
            {
                Debug.LogFormat("<color=red>|-- 对象类型不对</color>");
                Debug.LogFormat("   |-- 目标: {0} 不是战斗npc,不能对其造成伤害");
                return false;
            }
 
            if (_fightNpc.ActorType != GameObjType.gotNPC)
            {
                Debug.LogFormat("<color=red>|-- 对象类型不对</color>");
                Debug.LogFormat("   |-- 目标: {0} 不是战斗npc,不能对其造成伤害");
                return false;
            }
 
        }
        // 可攻击对象类型
        else if (_targetType == E_SkillCastTarget.CanAttacked)
        {
            if (actor.ActorType == GameObjType.gotPlayer)
            {
                GA_Player _player = actor as GA_Player;
                if (_player != null)
                {
                    if (!_player.CanAtked())
                    {
                        return false;
                    }
                }
            }
            else
            {
                if (_fightNpc == null && _sgzcRobot == null)
                {
                    Debug.LogFormat("<color=red>|-- 对象类型不对</color>");
                    Debug.LogFormat("   |-- 目标: {0} 不是战斗npc,不能对其造成伤害");
                    return false;
                }
            }
        }
 
        // -----------------------
        // 这里检测是否在技能释放范围内
        if (soSkill != null)
        {
            if (soSkill.chkDistance == 0)
            {
                //Debug.LogFormat("<color=red>|-- 配置的检测范围为空: {0}</color>", skill.id);
                return false;
            }
 
            float _chkDistance = soSkill.chkDistance;
 
            if (!PreFightMission.Instance.IsFinished())
            {
                _chkDistance = GeneralDefine.PrefightAtkRange;
            }
 
            SkillHelper.EffectValue _effectValue;
            List<SkillHelper.SkillInfo> _spSkillInfo = SkillHelper.Instance.GetSpSkill(skill.id);
            if (_spSkillInfo != null)
            {
                for (int i = 0; i < _spSkillInfo.Count; ++i)
                {
                    if (_spSkillInfo[i].effectValue.TryGetValue(4045, out _effectValue))
                    {
                        _chkDistance += (_effectValue.value1 * .5f);
#if UNITY_EDITOR
                        if (RuntimeLogUtility.s_SkillEffectLog)
                        {
                            Debug.LogFormat("技能 {0} 触发了效果 {1} , 搜怪范围 增加了 {2}", _spSkillInfo[i].config.SkillID, 4045, (_effectValue.value1 * .5f));
                        }
#endif
                    }
                }
            }
 
            Vector3 _centerPos = m_Hero.Pos;
 
            if (soSkill.hitTestType == E_HitTestType.Sector
             && soSkill.chkRange == 0)
            {
                // 非自身的时候,执行目标点索引
                if (_castType != E_SkillCastType.None)
                {
                    _centerPos = skill.targetPosition;
                }
            }
 
            // 默认取1的范围内的怪, 没有的情况再判断范围
            float _defaultCircleDisSqrt = MathUtility.DistanceSqrtXZ(_centerPos, actor.Pos);
 
            if (_defaultCircleDisSqrt > 1)
            {
                //Debug.LogFormat(" |-- 检测方式为: {0}, center: {1}, range: {2}, distance: {3}",
                //                soSkill.hitTestType,
                //                m_Hero.Pos,
                //                soSkill.chkRange,
                //                soSkill.chkDistance);
 
                if (soSkill.hitTestType == E_HitTestType.Rect)
                {
                    if (!CollisionUtility.IsPointInRectangle(_centerPos, m_Hero.destForward,
                                                             soSkill.chkRange, soSkill.chkDistance,
                                                             actor.Pos))
                    {
                        //Debug.LogFormat("<color=red>|-- 对象不再范围内: {0}</color>", actor.ServerObjID);
                        //Debug.LogFormat("   |-- 目标: {0} 不在检测范围内", actor.ServerObjID);
                        return false;
                    }
                }
                else if (soSkill.hitTestType == E_HitTestType.Sector)
                {
                    int _chkAngle = soSkill.chkRange == 0 ? 360 : soSkill.chkRange;
                    if (!CollisionUtility.IsPointInSector2(_centerPos, m_Hero.destForward,
                                                           soSkill.chkDistance, _chkAngle,
                                                           actor.Pos))
                    {
                        //Debug.LogFormat("<color=red>|-- 对象不再范围内: {0}</color>", actor.ServerObjID);
                        //Debug.LogFormat("   |-- 目标: {0} 不在检测范围内", actor.ServerObjID);
                        return false;
                    }
                }
            }
        }
 
        return true;
    }
 
 
    private void HandleExpertSkill(int skillID, uint aSid, uint tSid)
    {
        // if (!ClientSceneManager.Instance.IsClientFightMode)
        // {
        //     return;
        // }
 
        // 增加一些buff效果
        int _expertSkillId = 0;
        if (tsModel.TryGetExpertSkill(skillID, out _expertSkillId))
        {
            var _skillInfo = SkillHelper.Instance.Get(_expertSkillId);
 
            SkillHelper.EffectValue _effectValue;
            // 不满足概率
            if (_skillInfo.effectValue.TryGetValue(4004, out _effectValue))
            {
                if (UnityEngine.Random.Range(0, 10000) > _effectValue.value1)
                {
                    return;
                }
            }
 
            if (_skillInfo.config.SkillType == (int)E_SkillType.PassiveSustainedReduction)
            {
                StatusMgr.Instance.AddClientBuff(tSid, _expertSkillId, aSid, 0, _skillInfo.config.LastTime6);
            }
        }
    }
}