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
|
using System;
using System.Collections.Generic;
using KKSG;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XLevelUpStatusDocument : XDocComponent
{
public override uint ID
{
get
{
return XLevelUpStatusDocument.uuID;
}
}
public bool bBlock
{
get
{
return this._bBlock;
}
set
{
this._bBlock = value;
bool flag = !this._bBlock;
if (flag)
{
this.CheckLevelUp();
}
}
}
public List<uint> NewSkillID
{
get
{
return this._newSkillID;
}
}
public uint CurLevel
{
get
{
return this._CurLevel;
}
set
{
this._CurLevel = value;
}
}
public uint PreLevel
{
get
{
return this._PreLevel;
}
set
{
this._PreLevel = value;
}
}
public List<uint> AttrID
{
get
{
return this._AttrID;
}
set
{
this._AttrID = value;
}
}
public List<uint> AttrOldValue
{
get
{
return this._AttrOldValue;
}
set
{
this._AttrOldValue = value;
}
}
public List<uint> AttrNewValue
{
get
{
return this._AttrNewValue;
}
set
{
this._AttrNewValue = value;
}
}
public ulong Exp { get; set; }
public ulong MaxExp { get; set; }
public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("LevelUpStatusDocument");
private uint _PreLevel;
private uint _CurLevel;
private List<uint> _AttrID = new List<uint>();
private List<uint> _AttrOldValue = new List<uint>();
private List<uint> _AttrNewValue = new List<uint>();
public List<uint> _newSkillID = new List<uint>();
private bool Show = false;
private bool _bBlock;
public override void OnAttachToHost(XObject host)
{
base.OnAttachToHost(host);
this.CurLevel = 0u;
this.PreLevel = 0u;
}
public override void OnEnterScene()
{
base.OnEnterScene();
}
public override void OnEnterSceneFinally()
{
this._bBlock = false;
XSingleton<XTimerMgr>.singleton.SetTimer(0.5f, new XTimerMgr.ElapsedEventHandler(this.ShowLevelUp), null);
}
public void CheckLevelUp()
{
bool bBlock = this._bBlock;
if (!bBlock)
{
bool flag = (this.CurLevel == this.PreLevel && this.CurLevel == 0u) || XSingleton<XEntityMgr>.singleton.Player == null;
if (!flag)
{
XRole player = XSingleton<XEntityMgr>.singleton.Player;
bool flag2 = (this.CurLevel != this.PreLevel || player.Attributes.Exp != this.Exp) && DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible();
if (flag2)
{
DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.SetGetExpAnimation(this.CalGetExp(player.Attributes.Exp), XSingleton<XEntityMgr>.singleton.Player.EngineObject.Position);
}
player.Attributes.Level = this.CurLevel;
player.Attributes.Exp = this.Exp;
player.Attributes.MaxExp = this.MaxExp;
bool flag3 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible();
if (flag3)
{
DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.SetExp(XSingleton<XEntityMgr>.singleton.Player.Attributes as XPlayerAttributes);
DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.SetLevel(this.CurLevel);
DlgBase<RadioDlg, RadioBehaviour>.singleton.Show(true);
bool flag4 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._yuyinHandler != null;
if (flag4)
{
DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton._yuyinHandler.Refresh((XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HALL) ? YuyinIconType.Hall : YuyinIconType.Guild);
}
}
bool flag5 = DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.IsVisible();
if (flag5)
{
DlgBase<XChatSmallView, XChatSmallBehaviour>.singleton.SetExp();
}
bool flag6 = this.CurLevel > this.PreLevel;
if (flag6)
{
XSingleton<XFxMgr>.singleton.CreateAndPlay(XSingleton<XGlobalConfig>.singleton.GetValue("LevelupFx"), player.MoveObj, Vector3.zero, Vector3.one, 1f, true, 5f, true);
this.SetLevelUpStatus();
XPlayerLevelChangedEventArgs @event = XEventPool<XPlayerLevelChangedEventArgs>.GetEvent();
@event.level = this.CurLevel;
@event.PreLevel = this.PreLevel;
@event.Firer = XSingleton<XGame>.singleton.Doc;
XSingleton<XEventMgr>.singleton.FireEvent(@event);
XSingleton<XGameSysMgr>.singleton.OnLevelChanged(this._CurLevel);
DlgBase<DungeonSelect, DungeonSelectBehaviour>.singleton.OnPlayerLevelUp();
bool flag7 = DlgBase<ItemSystemDlg, TabDlgBehaviour>.singleton.IsVisible();
if (flag7)
{
DlgBase<ItemSystemDlg, TabDlgBehaviour>.singleton.OnLevelChange();
}
}
}
}
}
public void SetLevelUpStatus()
{
bool flag = (ulong)this.CurLevel >= (ulong)((long)XSingleton<XGlobalConfig>.singleton.GetInt("ShowLevelUpLimit"));
if (flag)
{
this.Show = true;
this.ShowLevelUp(null);
}
}
public void LevelRewardShowLevelUp()
{
bool show = this.Show;
if (show)
{
bool flag = !DlgBase<XLevelUpStatusView, XLevelUpStatusBehaviour>.singleton.IsVisible();
if (flag)
{
DlgBase<XLevelUpStatusView, XLevelUpStatusBehaviour>.singleton.SetVisible(true, true);
}
this.RefreshNewSkillID();
DlgBase<XLevelUpStatusView, XLevelUpStatusBehaviour>.singleton.ShowLevelUpStatus();
this.Show = false;
}
}
public void ShowLevelUp(object o = null)
{
bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall && this.Show;
if (flag)
{
bool flag2 = !DlgBase<XLevelUpStatusView, XLevelUpStatusBehaviour>.singleton.IsVisible();
if (flag2)
{
DlgBase<XLevelUpStatusView, XLevelUpStatusBehaviour>.singleton.SetVisible(true, true);
}
this.RefreshNewSkillID();
DlgBase<XLevelUpStatusView, XLevelUpStatusBehaviour>.singleton.ShowLevelUpStatus();
this.Show = false;
}
}
public void RefreshNewSkillID()
{
this._newSkillID.Clear();
int num = XFastEnumIntEqualityComparer<RoleType>.ToInt(XSingleton<XEntityMgr>.singleton.Player.PlayerAttributes.Profession);
int num2 = num % 10;
int num3 = (num > 10) ? (num % 100) : 0;
int num4 = (num > 100) ? (num % 1000) : 0;
int num5 = (num > 1000) ? (num % 10000) : 0;
bool flag = num2 > 0;
if (flag)
{
List<uint> profSkillID = XSingleton<XSkillEffectMgr>.singleton.GetProfSkillID(num2);
for (int i = 0; i < profSkillID.Count; i++)
{
SkillList.RowData skillConfig = XSingleton<XSkillEffectMgr>.singleton.GetSkillConfig(profSkillID[i], 0u);
bool flag2 = (uint)skillConfig.UpReqRoleLevel[0] == this.CurLevel;
if (flag2)
{
this._newSkillID.Add(profSkillID[i]);
}
}
}
bool flag3 = num3 > 0;
if (flag3)
{
List<uint> profSkillID2 = XSingleton<XSkillEffectMgr>.singleton.GetProfSkillID(num3);
for (int j = 0; j < profSkillID2.Count; j++)
{
SkillList.RowData skillConfig2 = XSingleton<XSkillEffectMgr>.singleton.GetSkillConfig(profSkillID2[j], 0u);
bool flag4 = (uint)skillConfig2.UpReqRoleLevel[0] == this.CurLevel;
if (flag4)
{
this._newSkillID.Add(profSkillID2[j]);
}
}
}
bool flag5 = num4 > 0;
if (flag5)
{
List<uint> profSkillID3 = XSingleton<XSkillEffectMgr>.singleton.GetProfSkillID(num4);
for (int k = 0; k < profSkillID3.Count; k++)
{
SkillList.RowData skillConfig3 = XSingleton<XSkillEffectMgr>.singleton.GetSkillConfig(profSkillID3[k], 0u);
bool flag6 = (uint)skillConfig3.UpReqRoleLevel[0] == this.CurLevel;
if (flag6)
{
this._newSkillID.Add(profSkillID3[k]);
}
}
}
bool flag7 = num5 > 0;
if (flag7)
{
List<uint> profSkillID4 = XSingleton<XSkillEffectMgr>.singleton.GetProfSkillID(num5);
for (int l = 0; l < profSkillID4.Count; l++)
{
SkillList.RowData skillConfig4 = XSingleton<XSkillEffectMgr>.singleton.GetSkillConfig(profSkillID4[l], 0u);
bool flag8 = (uint)skillConfig4.UpReqRoleLevel[0] == this.CurLevel;
if (flag8)
{
this._newSkillID.Add(profSkillID4[l]);
}
}
}
XSingleton<XGameSysMgr>.singleton.RecalculateRedPointState(XSysDefine.XSys_Skill, true);
}
private ulong CalGetExp(ulong preExp)
{
bool flag = this.PreLevel == this.CurLevel;
ulong result;
if (flag)
{
result = this.Exp - preExp;
}
else
{
ulong num = 0UL;
PlayerLevelTable.RowData byLevel = XSingleton<XEntityMgr>.singleton.LevelTable.GetByLevel((int)(this.PreLevel + 1u));
num += (ulong)(byLevel.Exp - (long)preExp);
for (uint num2 = this.PreLevel + 1u; num2 < this.CurLevel; num2 += 1u)
{
byLevel = XSingleton<XEntityMgr>.singleton.LevelTable.GetByLevel((int)(num2 + 1u));
num += (ulong)byLevel.Exp;
}
result = num + this.Exp;
}
return result;
}
protected override void OnReconnected(XReconnectedEventArgs arg)
{
}
}
}
|