o
asmrobot
2019-10-27 c4bd9d8c587bd1401f0fb2f60c34a4964d7afe20
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
using RichCreator.Utility;
using RichCreator.Utility.Captures;
using RichCreator.Utility.CV;
using RichCreator.Utility.InputControl;
using RichCreator.Utility.Structs;
using RichCreator.Utility.Utilitys;
using Emgu.CV;
using Emgu.CV.Structure;
using RichCreator.Jobs;
using RichCreator.Jobs.StateMachines;
using System;
using System.Collections.Generic;
using System.Threading;
 
namespace RichCreator.Maps
{
    /// <summary>
    /// 凛冬地图
    /// </summary>
    public class SkillMap : MapInfo
    {
        /// <summary>
        /// 游戏区域
        /// </summary>
        public ZTRectangle GameRect { get; set; }
 
        
 
        public CancellationToken cancellationToken { get; set; }
 
        /// <summary>
        /// 标题文字
        /// </summary>
        private ZTRectangle titleRect = ZTRectangle.Empty;
        /// <summary>
        /// lv字样
        /// </summary>
        private ZTRectangle lvRect = ZTRectangle.Empty;
        /// <summary>
        /// 向上滚动按钮
        /// </summary>
        private ZTRectangle upKeyRect = ZTRectangle.Empty;
 
        /// <summary>
        /// 向下滚动按钮
        /// </summary>
        private ZTRectangle downKeyRect = ZTRectangle.Empty;
 
 
 
        public override ZTResult Start(ZTRectangle gameRect, CancellationToken cancelToken, Int32 runningStep)
        {
            this.GameRect = gameRect;
            this.cancellationToken = cancelToken;
 
            WindowUtils.SetDnfToTop();
 
            
 
            if (!OpenSkillWindow())
            {
                G.Instance.InfoWriter("打开技能窗口失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("技能窗口已打开");
 
            //初始化
            if (!InitSkills())
            {
                G.Instance.InfoWriter("初始化技能失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("技能已初始化");
 
 
            //点顶端的技能
            if (!SettingTopSkills())
            {
                G.Instance.InfoWriter("通用技能设置失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("通用技能已设置");
 
            //点sp技能
            if (!SettingSPSkills())
            {
                G.Instance.InfoWriter("SP技能设置失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("SP技能已设置");
 
            //点tp技能
            if (!SettingTPSkills())
            {
                G.Instance.InfoWriter("TP技能设置失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("TP技能已设置");
 
            //点学习
            if (!Studay())
            {
                G.Instance.InfoWriter("技能学习失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("技能已学习");
 
            //技能摆放
            if (!FormatSkillColumn())
            {
                G.Instance.InfoWriter("技能摆放失败");
                return ZTResult.Failed;
            }
            G.Instance.InfoWriter("技能摆放成功");
 
 
            CloseAllAlertWindow(this.cancellationToken, this.GameRect);
            return ZTResult.Success;
        }
 
        /// <summary>
        /// 打开技能窗
        /// </summary>
        /// <param name="titleRect"></param>
        /// <param name="lvRect"></param>
        /// <param name="upKeyRect"></param>
        /// <param name="downKeyRect"></param>
        /// <returns></returns>
        private bool OpenSkillWindow()
        {
            bool isGray = false;
            ZTRectangle innertitleRect=ZTRectangle.Empty, innerlvRect = ZTRectangle.Empty, innerupKeyRect = ZTRectangle.Empty, innerdownKeyRect = ZTRectangle.Empty;
            for (int i = 0; i < 2; i++)
            {
                CloseAllAlertWindow(this.cancellationToken, this.GameRect);
                G.Instance.InputControl.PressKey(RandomUtils.KeyPressDuration,HIDCode.K);
 
                bool result=FuncUtils.TimeoutCancelableWrap(5000, this.cancellationToken, () => {
                    //识别技能窗
                    return SkillCVHelper.FindSkillWindow(out innertitleRect, out innerlvRect, out innerupKeyRect, out innerdownKeyRect,out isGray, this.GameRect);
                });
                
                if (result)
                {
                    titleRect = innertitleRect;
                    lvRect = innerlvRect;
                    upKeyRect = innerupKeyRect;
                    downKeyRect = innerdownKeyRect;
                    if (isGray)
                    {
                        //如果当前选的是tp技能学习(tp技能学习的右侧滚动条跟sp右侧的不一样),则:
                        //选中sp技能学习
                        Utility.Structs.ZTPoint spPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 55, lvRect.Start.Y - 80);
                        G.Instance.InputControl.MoveToAndClick(spPoint);
 
                        result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => {
                            //识别技能窗
                            return SkillCVHelper.FindCommonUpDownKey(out innerupKeyRect, out innerdownKeyRect, this.titleRect,this.GameRect);
                        },300);
                        if (!result)
                        {
                            continue;
                        }
                        upKeyRect = innerupKeyRect;
                        downKeyRect = innerdownKeyRect;
                    }
                    return true;
                }
            }
            G.Instance.InfoWriter("打开技能对话框失败");
            return false;
        }
 
 
        private bool InitSkills()
        {
            //点击初始化
            Utility.Structs.ZTPoint initButton = new Utility.Structs.ZTPoint(this.upKeyRect.Start.X - 37, this.upKeyRect.Start.Y - 86);
            G.Instance.InputControl.MoveToAndClick(initButton);
 
            //是否已打开确认对话框
            ZTRectangle notificationRect = ZTRectangle.Empty;
            bool result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => {
                return SkillCVHelper.ExistsNotificationText(out notificationRect,this.GameRect);
            });
            if (!result)
            {
                G.Instance.DebugWriter("公告未找到");
                return false;
            }
 
            //点击确认
            G.Instance.InputControl.Move(0, 0, true, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration);
            G.Instance.InputControl.Move(0, 0, false, false, false);
            Thread.Sleep(1000);
 
            
            //是否已打开完毕对话框 
            result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => {
                return SkillCVHelper.ExistsNotificationText(out notificationRect, this.GameRect);
            });
            if (!result)
            {
                G.Instance.DebugWriter("完毕公告未找到");
                return false;
            }
            //点击确认
            Utility.Structs.ZTPoint okPosition = new Utility.Structs.ZTPoint(notificationRect.GetCenterPoint().X, notificationRect.End.Y + 60);
            G.Instance.InputControl.MoveToAndClick(okPosition);
            Thread.Sleep(RandomUtils.G(500,800));
            return true;
        }
 
 
        /// <summary>
        /// 关闭所有弹出窗
        /// </summary>
        /// <param name="cancelToken"></param>
        /// <param name="gameRect"></param>
        /// <returns></returns>
        private void CloseAllAlertWindow(CancellationToken cancelToken, ZTRectangle gameRect)
        {
            while (!cancelToken.IsCancellationRequested)
            {
                //G.Instance.InputControl.MoveTo(gameRect.Start.X,gameRect.Start.Y, false, false, false);
                //Thread.Sleep(10);
                //截图
                Image<Rgb, byte> image = ScreenCapture.Instance.CaptureScreenReturnImage();
 
                ZTRectangle closeButtonRect = ZTRectangle.Empty;
                if (!DnfCVHelper.GetAlertWindow(out closeButtonRect, image, gameRect))
                {
                    return;
                }
 
                G.Instance.InputControl.MoveToAndClick(closeButtonRect.GetCenterPoint());
                Thread.Sleep(500);
            }
        }
 
        /// <summary>
        /// 设置顶端技能
        /// </summary>
        /// <returns></returns>
        private bool SettingTopSkills()
        {
            //物理暴击
            Utility.Structs.ZTPoint skillPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 200, lvRect.Start.Y - 42);
            SettingSkill(skillPoint);
 
            //物理背击
            skillPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 280, lvRect.Start.Y - 42);
            SettingSkill(skillPoint);
            return true;
        }
 
        /// <summary>
        /// 要点的技能列表
        /// 内部为每个节所相对于节的相对位置
        /// </summary>
        private List<Utility.Structs.ZTPoint>[] toAddLevelSkills = new List<Utility.Structs.ZTPoint>[] {
            new List<Utility.Structs.ZTPoint> (){
                new Utility.Structs.ZTPoint(762-346,450-237),//疾风之棍棒精通
            },
            new List<Utility.Structs.ZTPoint> (){
                new Utility.Structs.ZTPoint(182,17),//朔风牵引
                new Utility.Structs.ZTPoint(274,17),//流风决
                new Utility.Structs.ZTPoint(481-251,342-262),//风鸣冲击
                new Utility.Structs.ZTPoint(323,82),//游离之风
                new Utility.Structs.ZTPoint(574-251,409-262),//双翼风刃
                new Utility.Structs.ZTPoint(574-251,477-262),//风暴之眼
                new Utility.Structs.ZTPoint(529-251,544-262),//真空旋风破
            },
            new List<Utility.Structs.ZTPoint> (){
                new Utility.Structs.ZTPoint(432-251,275-329),//风暴之拳
                new Utility.Structs.ZTPoint(479-251,342-329),//万象风龙阵
                new Utility.Structs.ZTPoint(572-251,340-329),//御风之力
                new Utility.Structs.ZTPoint(433-251,478-329),//风神决
                new Utility.Structs.ZTPoint(526-251,475-329),//风卷残云
                new Utility.Structs.ZTPoint(574-251,476-329),//游龙惊风破
                new Utility.Structs.ZTPoint(431-251,542-329),//九霄风雷
                new Utility.Structs.ZTPoint(663-295,545-331),//无限风域
            }
        };
 
        /// <summary>
        /// 设置SP技能
        /// </summary>
        /// <returns></returns>
        private bool SettingSPSkills()
        {
            //选中sp技能学习
            Utility.Structs.ZTPoint spPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 55, lvRect.Start.Y - 80);
            G.Instance.InputControl.MoveToAndClick(spPoint);
 
            ZTRectangle numberLimitArea = new ZTRectangle(lvRect.Start.X-5,lvRect.End.Y,lvRect.End.X+21,lvRect.End.Y+340);
            bool[] addedFlag = new bool[] {false,false,false };
            bool isdown = true;
            for (int i = 0; i < 4; i++)
            {   
                for (int count = 0; count < 10; count++)
                {
                    if (this.cancellationToken.IsCancellationRequested)
                    {
                        return false;
                    }
 
                    //是否有数字
                    bool result = FuncUtils.TimeoutCancelableWrap(1000, this.cancellationToken, () => {
                        return SkillCVHelper.HasNumberText(numberLimitArea);
                    }, 100);
                    if (!result)
                    {
                        continue;
                    }
 
                    //查找是否是某节,
                    Int32 numberSection = 0;
                    ZTRectangle sectionRect = ZTRectangle.Empty;
                    if (SkillCVHelper.IsNumberSections(out numberSection, out sectionRect, numberLimitArea))
                    {
                        if (!addedFlag[numberSection])
                        {
                            //没有添加,则循环把此节下的所有技能都加上
                            foreach (var item in toAddLevelSkills[numberSection])
                            {
                                SettingSkill(sectionRect.Start.Add(item));
                            }
                            addedFlag[numberSection] = true;
                        }
 
                        if (count == 0)
                        {
                            if (numberSection == 0)
                            {
                                //一开始是1区则向下
                                isdown = true;
                            }
                            if (numberSection == 2)
                            {
                                //一开始是3区则向上
                                isdown = false;
                            }
 
                        }
                    }
                    
 
                    if (isdown)
                    {
                        G.Instance.InputControl.MoveToAndClick(downKeyRect.GetCenterPoint());
                    }
                    else
                    {
                        G.Instance.InputControl.MoveToAndClick(upKeyRect.GetCenterPoint());
                    }
                }
 
                if (addedFlag[0] == true && addedFlag[1] == true && addedFlag[2] == true)
                {
                    return true;
                }
                isdown = !isdown;
            }
 
            return false;
        }
 
        /// <summary>
        /// 设置TP技能
        /// </summary>
        /// <returns></returns>
        private bool SettingTPSkills()
        {
            //选中tp技能学习
            Utility.Structs.ZTPoint spPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 253, lvRect.Start.Y - 80);
            G.Instance.InputControl.MoveToAndClick(spPoint);
 
            Utility.Structs.ZTPoint[] skills = new Utility.Structs.ZTPoint[] {
 
                new Utility.Structs.ZTPoint(334-296,277-251),//1.第一行第一个
                new Utility.Structs.ZTPoint(381-296,545-251),//2.第三行第二个
                new Utility.Structs.ZTPoint(664-296,413-251),//3.第二行倒数第三个
                new Utility.Structs.ZTPoint(567-296,410-251),//4.第二行倒数第五个
                new Utility.Structs.ZTPoint(758-296,411-251),//5.第二行倒数第一个
            };
 
            for (int i = 0; i < skills.Length; i++)
            {
                SettingSkill(lvRect.Start.Add(skills[i]));
            }
 
            return true;
        }
 
        /// <summary>
        /// 学习
        /// </summary>
        /// <returns></returns>
        private bool Studay()
        {
            Utility.Structs.ZTPoint studayPoint = new Utility.Structs.ZTPoint(this.downKeyRect.Start.X-331,this.downKeyRect.End.Y+27);
            G.Instance.InputControl.MoveToAndClick(studayPoint);
            Thread.Sleep(1000);
            //点击确认
            G.Instance.InputControl.Move(0, 0, true, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration);
            G.Instance.InputControl.Move(0, 0, false, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration*3);
            return true;
        }
 
        /// <summary>
        /// 设置技能
        /// </summary>
        /// <param name="skillPoint"></param>
        /// <returns></returns>
        private bool SettingSkill(Utility.Structs.ZTPoint skillPoint)
        {
            //84,71
            ZTRectangle limitRect = new ZTRectangle(skillPoint.X-84,skillPoint.Y-71,skillPoint.X+84,skillPoint.Y+71);
 
            bool result = false;
            ZTRectangle addSkillLevelButton = ZTRectangle.Empty;
 
            //选中技能,试两次
            int addTry = 0;
            for (; addTry < 2; addTry++)
            {
                bool skillIsFull = false;
                G.Instance.InputControl.MoveToAndClick(skillPoint);
                Thread.Sleep(500);
                result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => {
                    return SkillCVHelper.IsSelectSkill(out addSkillLevelButton, out skillIsFull, limitRect);
                });
                if (result)
                {
                    if (skillIsFull)
                    {
                        return true;
                    }
                    break;
                }
            }
            if (addTry >= 2)
            {
                return false;
            }
 
 
            //加技能点,试两次
            for (addTry = 0; addTry < 2; addTry++)
            {
                G.Instance.InputControl.MoveToAndClick(addSkillLevelButton.GetCenterPoint());
                result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => {
                    return SkillCVHelper.SkillIsFullLevel(limitRect);
                });
                if (result)
                {
                    return true;
                }
            }
 
 
            return false;
        }
 
        /// <summary>
        /// 格式化摆放技能栏
        /// </summary>
        /// <returns></returns>
        private bool FormatSkillColumn()
        {
            //打开已学技能窗
            ZTRectangle studayTextRect = ZTRectangle.Empty;
            if (!OpenStudaySkillWindow(out studayTextRect))
            {
                G.Instance.DebugWriter("未指开已学技能窗口");
                return false;
            }
 
            //技能栏全部技能移动已学技能窗
            if (!MoveSkillToStudayWindow(studayTextRect))
            {
                G.Instance.DebugWriter("移动至已学技能窗口失败");
                return false;
            }
 
            //技能窗内容分步移
            if (!MoveSkillToExpress(studayTextRect))
            {
                G.Instance.DebugWriter("移动至快捷栏失败");
                return false;
            }
            return true;
        }
 
        /// <summary>
        /// 打开已学技能窗口
        /// </summary>
        /// <returns></returns>
        private bool OpenStudaySkillWindow(out ZTRectangle studayTextRect)
        {
            studayTextRect = ZTRectangle.Empty;
            ZTRectangle innerstudyTextRect = ZTRectangle.Empty;
            Utility.Structs.ZTPoint openwindowButton = new Utility.Structs.ZTPoint(this.titleRect.Start.X + 194, this.titleRect.Start.Y + 517);
            for (int i = 0; i < 2; i++)
            {
                if (this.cancellationToken.IsCancellationRequested)
                {
                    return false;
                }
                G.Instance.InputControl.MoveToAndClick(openwindowButton);
                bool result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => {
                    return SkillCVHelper.StudaySkillWindowIsOpen(out innerstudyTextRect,this.GameRect);
                }, 200);
 
                if (result)
                {
                    studayTextRect = innerstudyTextRect;
                    return true;
                }
            }
            return false;
        }
 
        /// <summary>
        /// 从快捷栏向已学技能栏移动技能
        /// </summary>
        /// <returns></returns>
        private bool MoveSkillToStudayWindow(ZTRectangle studayTextRect)
        {
            ZTRectangle targetRect = GetStudaySkillRect(studayTextRect, 27);
 
            for (int i = 0; i < 12; i++)
            {
                ZTRectangle expressRect = GetExpressSkillRect(i);
                MoveSkill(expressRect.GetCenterPoint(), targetRect.GetCenterPoint());
            }
            return true;
        }
 
 
        /// <summary>
        /// 识别出来的技能索引和在技能快捷栏中的对应关系
        /// 对应关系是-1的不放在快捷栏里
        /// </summary>
        Dictionary<Int32, Int32> skillToExpressMap = new Dictionary<int, int>() {
            { 4 ,0},
            { 13,1},
            { 8 ,2},
            { 9 ,3},
            { 15,4},
            { 12,5},
 
            { 6 ,6},
            { 10,7},
            { 7 ,8},
            { 11,9},
            { 14,10},
            { 16,11}
 
        };
        /// <summary>
        /// 从已学技能栏向快捷栏移动技能
        /// </summary>
        /// <param name="studayTextRect"></param>
        /// <returns></returns>
        private bool MoveSkillToExpress(ZTRectangle studayTextRect)
        {
            int i = 0;
            int count = 17;
            while (i < count)
            {
                if (this.cancellationToken.IsCancellationRequested)
                {
                    return false;
                }
                //获取位置,并将鼠标移到位置,显示出技能名
                Utility.Structs.ZTPoint studayPoint = GetStudaySkillRect(studayTextRect, i).GetCenterPoint();
                G.Instance.InputControl.MoveTo(studayPoint.X, studayPoint.Y, false, false, false);
                Thread.Sleep(1000);
 
                //识别
                Int32 skillIndex = 0;//技能索引
                ZTRectangle discenrnRect = new ZTRectangle(studayPoint.X - 150, this.GameRect.Start.Y, studayPoint.X, studayPoint.Y);
                bool result = FuncUtils.TimeoutCancelableWrap(2000, this.cancellationToken, () => {
                    return SkillCVHelper.GetSkillName(out skillIndex, discenrnRect);
                }, 200);
                if (result)
                {
                    if (skillToExpressMap.ContainsKey(skillIndex))
                    {
                        //要放到技能栏的位置
                        Utility.Structs.ZTPoint to = GetExpressSkillRect(skillToExpressMap[skillIndex]).GetCenterPoint();
                        MoveSkill(studayPoint, to);
                        count--;
                        continue;
                    }
                }
                else
                {
                    G.Instance.DebugWriter("识别技能错误,index=" + i.ToString());
                }
                i++;
            }
            
            return true;
        }
 
 
        /// <summary>
        /// 移动技能
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        private bool MoveSkill(Utility.Structs.ZTPoint from, Utility.Structs.ZTPoint to)
        {
            //移动指定位置
            G.Instance.InputControl.MoveTo(from.X, from.Y, false, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration*2);
            
            //按下
            G.Instance.InputControl.Move(0, 0, true, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration * 3);
 
            //移到目标位置
            G.Instance.InputControl.MoveTo(to.X, to.Y, true, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration*2);
 
 
            //松开
            G.Instance.InputControl.Move(0, 0, false, false, false);
            Thread.Sleep(RandomUtils.MouseClickDuration * 2);
            return true;
        }
 
        /// <summary>
        /// 得到快捷栏技能定位
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        private ZTRectangle GetExpressSkillRect(int index)
        {
            //x209,y488
            Int32 row = index / 6;
            Int32 col = index % 6;
 
            int x = this.titleRect.Start.X + 209 + col * 33;
            int y = this.titleRect.Start.Y + 488 + row * 33;
 
            return new ZTRectangle(x, y, x + 33, y + 33);
        }
 
        /// <summary>
        /// 得到已学技能栏定位
        /// </summary>
        /// <param name="studayTextRect"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        private ZTRectangle GetStudaySkillRect(ZTRectangle studayTextRect, Int32 index)
        {
            //x:-122,y:44
            Int32 row = index / 7;
            Int32 col = index % 7;
 
            int x = studayTextRect.Start.X + (-122) + col * 31;
            int y = studayTextRect.Start.Y + 44 + row * 31;
 
            return new ZTRectangle(x, y, x + 31, y + 31);
        }
    }
}