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
|
using System;
using KKSG;
using XUtliPoolLib;
namespace XMainClient
{
internal class XNormalShopGoods
{
public XItem item;
public int priceType;
public int priceValue;
public int soldNum;
public int totalSoldNum;
public int needLevel;
public bool isLevelEnough;
public uint weeklyBuyCount;
public void UpdateData(ShopItem data)
{
this.item = XBagDocument.MakeXItem(data.Item);
ShopTable.RowData dataById = XNormalShopDocument.GetDataById((uint)data.Item.uid);
bool flag = dataById != null;
if (flag)
{
this.priceType = (int)dataById.ConsumeItem[0];
this.priceValue = (int)dataById.ConsumeItem[1];
this.soldNum = (int)data.dailybuycount;
this.totalSoldNum = (int)data.buycount;
this.weeklyBuyCount = data.weekbuycount;
this.needLevel = (int)dataById.LevelCondition;
this.SetLevelCondition(dataById.Type, (uint)dataById.LevelCondition);
}
}
public static XNormalShopGoods MakeGoodsFromData(ShopItem data)
{
XNormalShopGoods xnormalShopGoods = new XNormalShopGoods();
xnormalShopGoods.UpdateData(data);
return xnormalShopGoods;
}
public void UpdateData(PartnerShopItemClient data)
{
ShopTable.RowData dataById = XNormalShopDocument.GetDataById(data.id);
bool flag = dataById == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("not find this shopItem,shopid is :" + data.id, null, null, null, null, null);
}
else
{
ItemList.RowData itemConf = XBagDocument.GetItemConf((int)dataById.ItemId);
bool flag2 = itemConf == null;
if (flag2)
{
XSingleton<XDebug>.singleton.AddErrorLog("not find this item,shopid is :" + data.id, "itemid is :" + dataById.ItemId, null, null, null, null);
}
else
{
bool flag3 = itemConf.ItemType == 1;
int itemID;
if (flag3)
{
itemID = XBagDocument.ConvertTemplate(itemConf);
}
else
{
itemID = itemConf.ItemID;
}
this.item = XBagDocument.MakeXItem(itemID, dataById.IsNotBind);
this.item.uid = (ulong)data.id;
this.item.itemCount = 0;
this.priceType = (int)dataById.ConsumeItem[0];
this.priceValue = (int)dataById.ConsumeItem[1];
this.soldNum = (int)data.buy_count;
this.totalSoldNum = (int)dataById.DailyCountCondition;
this.weeklyBuyCount = (uint)dataById.WeekCountCondition;
this.needLevel = (int)dataById.LevelCondition;
this.SetLevelCondition(dataById.Type, (uint)dataById.LevelCondition);
}
}
}
public void UpdateData(DragonGuildShopItemClient data)
{
ShopTable.RowData dataById = XNormalShopDocument.GetDataById(data.id);
bool flag = dataById == null;
if (flag)
{
XSingleton<XDebug>.singleton.AddErrorLog("not find this shopItem,shopid is :" + data.id, null, null, null, null, null);
}
else
{
ItemList.RowData itemConf = XBagDocument.GetItemConf((int)dataById.ItemId);
bool flag2 = itemConf == null;
if (flag2)
{
XSingleton<XDebug>.singleton.AddErrorLog("not find this item,shopid is :" + data.id, "itemid is :" + dataById.ItemId, null, null, null, null);
}
else
{
bool flag3 = itemConf.ItemType == 1;
int itemID;
if (flag3)
{
itemID = XBagDocument.ConvertTemplate(itemConf);
}
else
{
itemID = itemConf.ItemID;
}
this.item = XBagDocument.MakeXItem(itemID, dataById.IsNotBind);
this.item.uid = (ulong)data.id;
this.item.itemCount = 0;
this.priceType = (int)dataById.ConsumeItem[0];
this.priceValue = (int)dataById.ConsumeItem[1];
this.soldNum = (int)data.buy_count;
this.totalSoldNum = (int)dataById.DailyCountCondition;
this.weeklyBuyCount = (uint)dataById.WeekCountCondition;
this.needLevel = (int)dataById.LevelCondition;
this.SetLevelCondition(dataById.Type, (uint)dataById.LevelCondition);
}
}
}
public static XNormalShopGoods MakeGoodsFromData(PartnerShopItemClient data)
{
XNormalShopGoods xnormalShopGoods = new XNormalShopGoods();
xnormalShopGoods.UpdateData(data);
return xnormalShopGoods;
}
public static XNormalShopGoods MakeGoodsFromData(DragonGuildShopItemClient data)
{
XNormalShopGoods xnormalShopGoods = new XNormalShopGoods();
xnormalShopGoods.UpdateData(data);
return xnormalShopGoods;
}
private void SetLevelCondition(uint type, uint level)
{
bool flag = type == 20u;
if (flag)
{
this.isLevelEnough = (XPartnerDocument.Doc.CurPartnerLevel >= level);
}
else
{
this.isLevelEnough = (XSingleton<XAttributeMgr>.singleton.XPlayerData.Level >= level);
}
}
}
}
|