1gameRoot = modules.game_interface.getRootPanel()
2ComboBoxSelect = 3
3ComboBoxType = 1
4market_box_rare = -1
5market_box_star = -1
6SlotSkillSelect = 0
7Opcodes = 100
8Opcodes_1 = 101
9Opcodes_2 = 107
10insert_market = 108
11load_myoffert_market = 109
12search_market = 110
13remove_item_market = 111
14buy_market_item = 112
15history_market = 113
16market_offert_sell = 125
17opcode_offert_item_list = 126
18TotalItem = 0
19TotalCust = 0
20BagSelect = 0
21skillRare = 0
22bonusVenda = 0
23itemId = 0000
24tutor = 0
25atual_gold = 0
26countWindow = nil
27exitWindow = nil
28sellWindow = nil
29centralBox = false
30CLICK_BUY = false
31Temp_StarItem = 0
32TotalPage = 01
33AtualPage = 01
34WordPesquisa = 00
35MaxBullet = 0
36DepotActive = false
37onPVPRoomWindow = nil
38DepotDelay = false
39DepotCountMax = 00
40ActiveComboBox = 03
41Empty_Market_Seller = 01
42local HoverMobile = 00
43local delaySearch = 00
44local DELAY_CLICK, SECONDS_DELAY = false, 01
45ID_UPGRADE, LEVEL_UPGRADE, STAR_UPGRADE, SELECT_ITEM_UPGRADE, UPGRADE_BAG, UPGRADE_NEWVALOR, UPGRADE_SELECTION, UPGRADE_COMBO, UPGRADE_ORIG_STAR, TARGET, RARE_GUN = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
46PRICE_SUCESS_GOLD, RATE_CHANCE_UPGRADE, COUNT_CLICK_SUCESS = 0, 0, 0
47
48local SAVE_OFFERT_ID, RARE_OFFERT = 0, 0
49local _MARKET_SEARCH_TABLE = {}
50local _MARKET_FILTER_TABLE = {}
51local MAX_LIST_VIEW = 25
52local PAGE_START = 01
53local NEW_MAX = 00
54local OFFERT_CLICK_LIST_ITEM = 00
55local PAYMENT_OFFERT_TYPE, OFFERT_LIST_ID, OFFERT_PLAYER_ID, OFFERT_LIST_NAME, OFFERT_LIST_ANONYMOUS, OFFERT_LIST_POS_ID = 00, 00, 00, "", 00, 00
56local ListOrder = 01
57local ORDER_BACKPACK_TYPE = 01
58
59local OFFERTS_LIST = {
60 [01] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
61 [02] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
62 [03] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
63 [04] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
64 [05] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
65 [06] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
66 [07] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
67 [08] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
68 [09] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
69 [10] = {UID_1 = 0000, UID_2 = 0000, UID_3 = 0000, UID_4 = 0000, UID_5 = 0000, UID_6 = 0000, UID_7 = 0000, UID_8 = 0000, UID_9 = 0000, UID_10 = 0000, SLOT = 0000, EXT = 0000, BAG = 0000};
70}
71local _MARKET_OFFERTS = {
72 [00] = {PAGE = 00, MAX_LIST_VIEW = 10},
73 [01] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
74 [02] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
75 [03] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
76 [04] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
77 [05] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
78 [06] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
79 [07] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
80 [08] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
81 [09] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
82 [10] = {ID = 00, PLAYER_ID = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00};
83}
84local _MARKET_SELLER = {
85 [01] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
86 [02] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
87 [03] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
88 [04] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
89 [05] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
90 [06] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
91 [07] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
92 [08] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
93 [09] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
94 [10] = {ID = 00, PLAYER_ID = 00, TYPE = 00, ANONYMOUS = 00, PRICE = 0000, NAME = "", TIMER = 00, UID_1 = 0000, UID_2 = 00, UID_3 = 00, UID_4 = 00, UID_5 = 00, UID_6 = 00, UID_7 = 00, UID_8 = 00, UID_9 = 00, UID_10 = 00, OFFERT = 00};
95}
96local _MARKET_HISTORY = {
97 [01] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
98 [02] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
99 [03] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
100 [04] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
101 [05] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
102 [06] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
103 [07] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
104 [08] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
105 [09] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
106 [10] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
107 [11] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
108 [12] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
109 [13] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
110 [14] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
111 [15] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
112 [16] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
113 [17] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
114 [18] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
115 [19] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
116 [20] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
117 [21] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
118 [22] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
119 [23] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
120 [24] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
121 [25] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
122 [26] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
123 [27] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
124 [28] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
125 [29] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
126 [30] = {ID = 00, PLAYER_ID = 00, SALE = 00, ITEMTYPE = 0000, QNT = 00, PRICE = 00, DATE = 0000, ITEM_NAME = "", SELLER_NAME = "", ANONYMOUS = 00, SALE_TYPE = 00};
127}
128local HoveWindow = {
129 [00] = {
130 [01] = {"/images/custom/UI/btMarket_on", "/images/custom/UI/btMarket_off"};
131 [02] = {"/images/custom/UI/btVendas_on", "/images/custom/UI/btVendas_off"};
132 [03] = {"/images/custom/UI/btUpgrade_on", "/images/custom/UI/btUpgrade_off"};
133 [04] = {"/images/custom/UI/btSkills_on", "/images/custom/UI/btSkills_off"};
134 [05] = {"/images/custom/UI/btDepot_on", "/images/custom/UI/btDepot_off"};
135 };
136 [01] = {
137 [01] = {"/images/custom/UI/btMobileMarket_on", "/images/custom/UI/btMobileMarket_off"};
138 [02] = {"/images/custom/UI/Mobile_Vendas_on", "/images/custom/UI/Mobile_Vendas_off"};
139 [03] = {"/images/custom/UI/Mobile_Upgrade_on", "/images/custom/UI/Mobile_Upgrade_off"};
140 [04] = {"/images/custom/UI/Mobile_Skills_on", "/images/custom/UI/Mobile_Skills_off"};
141 [05] = {"/images/custom/UI/btMobileDepot_on", "/images/custom/UI/btMobileDepot_off"};
142 };
143}
144local TUTORIAL = {
145 [01] = {
146 [01] = "CLIQUE NA SUA ARMA PARA ABRIR O MENU DE SLOTS";
147 [02] = "SELECIONE O SLOT DISPONiVEL EM SUA ARMA PARA EQUIPAR UMA SKILL";
148 [03] = "EM SUA BACKPACK, CLIQUE NA HABILIDADE QUE ERYN LHE DEU";
149 [04] = "AGORA CLIQUE NO BOTAO 'APRIMORAR' PARA FINALIZAR";
150 }
151}
152local DEPOT_TEMP = {
153 [01] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
154 [02] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
155 [03] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
156 [04] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
157 [05] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
158 [06] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
159 [07] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
160 [08] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
161 [09] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
162 [10] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
163 [11] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
164 [12] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
165 [13] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
166 [14] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
167 [15] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
168 [16] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
169 [17] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
170 [18] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
171 [19] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
172 [20] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
173 [21] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
174 [22] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
175 [23] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
176 [24] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
177 [25] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
178 [26] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
179 [27] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
180 [28] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
181 [29] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
182 [30] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
183 [31] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
184 [32] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
185 [33] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
186 [34] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
187 [35] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
188 [36] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
189 [37] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
190 [38] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
191 [39] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
192 [40] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
193 [41] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
194 [42] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
195 [43] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
196 [44] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
197 [45] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
198 [46] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
199 [47] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
200 [48] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
201 [49] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
202 [50] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
203
204 [51] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
205 [52] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
206 [53] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
207 [54] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
208 [55] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
209 [56] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
210 [57] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
211 [58] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
212 [59] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
213 [60] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
214 [61] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
215 [62] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
216 [63] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
217 [64] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
218 [65] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
219 [66] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
220 [67] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
221 [68] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
222 [69] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
223 [70] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
224 [71] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
225 [72] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
226 [73] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
227 [74] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
228 [75] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
229 [76] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
230 [77] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
231 [78] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
232 [79] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
233 [80] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
234 [81] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
235 [82] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
236 [83] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
237 [84] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
238 [85] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
239 [86] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
240 [87] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
241 [88] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
242 [89] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
243 [90] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
244 [91] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
245 [92] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
246 [93] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
247 [94] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
248 [95] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
249 [96] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
250 [97] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
251 [98] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
252 [99] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
253 [100] = {UID_01 = 0000, UID_02 = 0000, UID_03 = 0000, UID_04 = 0000, UID_05 = 0000, UID_06 = 0000, UID_07 = 0000, UID_08 = 0000, UID_09 = 0000, UID_10 = 0000};
254
255}
256local function onDelayClick(timer)
257 if timer > 00 then
258 timer = timer - 01
259 scheduleEvent(function()
260 onDelayClick(timer)
261 end, 1000)
262 else
263 DELAY_CLICK = false
264 end
265end
266
267local MaxDepotSlot = #DEPOT_TEMP
268function init()
269 connect(g_game, {
270 connect(g_game, 'onTextMessage', onCentralBox),
271 connect(g_game, { onGameEnd = offline })
272 })
273
274 ProtocolGame.registerExtendedOpcode(Opcodes, function(protocol, opcode, buffer) end)
275 CentralBox = g_ui.displayUI('box')
276
277 ExitBox = CentralBox:recursiveGetChildById('exit')
278 Depot = CentralBox:recursiveGetChildById('depot')
279 DepotWindow = CentralBox:recursiveGetChildById('depotWindow')
280 DepotPanel = CentralBox:recursiveGetChildById('DepotPanel')
281 maxDepotItem = CentralBox:recursiveGetChildById('maxDepotItem')
282 DepotBackpack = CentralBox:recursiveGetChildById('depotBackpack')
283 DepotOrder = CentralBox:recursiveGetChildById('DepotOrder')
284 DepotBackpack:addOption(tr("Amulet"), "01")
285 DepotBackpack:addOption(tr("Helmet"), "02")
286 DepotBackpack:addOption(tr("Backpack"), "03")
287 DepotBackpack:addOption(tr("Weapon"), "04")
288 DepotBackpack:addOption(tr("Armor"), "05")
289 DepotBackpack:addOption(tr("Glove"), "06")
290 DepotBackpack:addOption(tr("Ring"), "07")
291 DepotBackpack:addOption(tr("Legs"), "08")
292 DepotBackpack:addOption(tr("Boots"), "09")
293 DepotWindow:hide()
294 Market = CentralBox:recursiveGetChildById('market')
295 MarketWindow = CentralBox:recursiveGetChildById('marketWindow')
296 MarketPanel = CentralBox:recursiveGetChildById('MarketPanel')
297 Search_1 = CentralBox:recursiveGetChildById('txtSearchItem')
298 Search_2 = CentralBox:recursiveGetChildById('searchItem')
299 BuyMarket = CentralBox:recursiveGetChildById('buyMarket')
300 NextPage = CentralBox:recursiveGetChildById('nextMarketPage')
301 LabelPage = CentralBox:recursiveGetChildById('labelPage')
302 LastPage = CentralBox:recursiveGetChildById('lastMarketPage')
303 QntEmptySlot = CentralBox:recursiveGetChildById('txtQntEmptySlot')
304 BuyMarket.onClick = function()
305 ComboBoxSelect = 00
306 RareSearchItem:setVisible(false)
307 StarSearchItem:setVisible(false)
308 marketBoxBackpack:setOption("-", "00")
309 g_game.getProtocolGame():sendExtendedOpcode(search_market, "0,|")
310 --onMarket(01)
311 end
312 SellMarket = CentralBox:recursiveGetChildById('sellMarket')
313 SellMarket.onClick = function()
314 g_game.getProtocolGame():sendExtendedOpcode(load_myoffert_market)
315 end
316 HistoryMarket = CentralBox:recursiveGetChildById('marketHistory')
317 HistoryPanel = CentralBox:recursiveGetChildById('HistoryPanel')
318 HistMarket = CentralBox:recursiveGetChildById('histMarket')
319 HistMarket.onClick = function()
320 g_game.getProtocolGame():sendExtendedOpcode(history_market)
321 onMarket(03)
322 end
323 LabelCat = CentralBox:recursiveGetChildById('labelMarket')
324 ComboBoxCat = CentralBox:recursiveGetChildById('selectCat')
325 buttonSeller = CentralBox:recursiveGetChildById('btSeller')
326 buttonOffert = CentralBox:recursiveGetChildById('btOffert')
327 itemMarketView = CentralBox:recursiveGetChildById('itemMarketView')
328
329 insertOffert = CentralBox:recursiveGetChildById('insertOffert')
330 OffertPanel = CentralBox:recursiveGetChildById('OffertPanel')
331 offertSearch = CentralBox:recursiveGetChildById('offertSearch')
332 offertMarketView = CentralBox:recursiveGetChildById('offertMarketView')
333 qntLabelOffert = CentralBox:recursiveGetChildById('qntLabelOffert')
334 infoRareOffert = CentralBox:recursiveGetChildById('infoRareOffert')
335 cbInsertRareOffert = CentralBox:recursiveGetChildById('cbInsertRareOffert')
336 cbInsertRareOffert:addOption(tr("Comum"), "00")
337 cbInsertRareOffert:addOption(tr("Melhorado"), "01")
338 cbInsertRareOffert:addOption(tr("Raro"), "02")
339 cbInsertRareOffert:addOption(tr("Epico"), "03")
340 cbInsertRareOffert:addOption(tr("Lendario"), "04")
341 cbInsertRareOffert.onOptionChange = OffertInsertMarketRareChangeSortType
342 OffertBox = g_ui.displayUI('offert')
343 OffertBox:hide()
344
345 txtInsertQntOffert = CentralBox:recursiveGetChildById('txtInsertQntOffert')
346 txtInsertUndOffert = CentralBox:recursiveGetChildById('txtInsertUndOffert')
347 txtInsertVipOffert = CentralBox:recursiveGetChildById('txtInsertVipOffert')
348 txtInsertTotalOffert = CentralBox:recursiveGetChildById('txtInsertTotalOffert')
349 AnonymousOptionOffert = CentralBox:recursiveGetChildById('AnonymousOptionOffert')
350 btFinishOffert = CentralBox:recursiveGetChildById('btFinishOffert')
351 btCancelOffert = CentralBox:recursiveGetChildById('btCancelOffert')
352
353 offertBoxBackpack = CentralBox:recursiveGetChildById('offertBoxBackpack')
354 offertBoxBackpack:addOption(tr("Amulet"), "01")
355 offertBoxBackpack:addOption(tr("Helmet"), "02")
356 offertBoxBackpack:addOption(tr("Produtos de Criaturas"), "03")
357 offertBoxBackpack:addOption(tr("Weapon"), "04")
358 offertBoxBackpack:addOption(tr("Armor"), "05")
359 offertBoxBackpack:addOption(tr("Glove"), "06")
360 offertBoxBackpack:addOption(tr("Ring"), "07")
361 offertBoxBackpack:addOption(tr("Legs"), "08")
362 offertBoxBackpack:addOption(tr("Boots"), "09")
363 offertBoxBackpack:addOption(tr("Vip Coins"), "10")
364 offertBoxBackpack:addOption(tr("Atributos"), "11")
365 offertBoxBackpack:addOption(tr("Skills"), "12")
366
367 insertItem = CentralBox:recursiveGetChildById('insertItem')
368 MarketFinish = CentralBox:recursiveGetChildById('btFinish')
369 AnonymousOption = CentralBox:recursiveGetChildById('AnonymousOption')
370 marketBoxBackpack = CentralBox:recursiveGetChildById('selectCat')
371 labelUnd = CentralBox:recursiveGetChildById('labelUnd')
372 labelTotal = CentralBox:recursiveGetChildById('labelTotal')
373 marketBoxBackpack:addOption("-", "00")
374 marketBoxBackpack:addOption(tr("Amulet"), "01")
375 marketBoxBackpack:addOption(tr("Helmet"), "02")
376 marketBoxBackpack:addOption(tr("Produtos de Criaturas"), "03")
377 marketBoxBackpack:addOption(tr("Weapon"), "04")
378 marketBoxBackpack:addOption(tr("Armor"), "05")
379 marketBoxBackpack:addOption(tr("Glove"), "06")
380 marketBoxBackpack:addOption(tr("Ring"), "07")
381 marketBoxBackpack:addOption(tr("Legs"), "08")
382 marketBoxBackpack:addOption(tr("Boots"), "09")
383 marketBoxBackpack:addOption(tr("Vip Coins"), "10")
384 marketBoxBackpack:addOption(tr("Atributos"), "11")
385 marketBoxBackpack:addOption(tr("Skills"), "12")
386 --marketBoxBackpack:addOption("Runas", "13")
387
388 MarketInsertItem = CentralBox:recursiveGetChildById('marketBoxBackpack')
389 MarketInsertItem:addOption(tr("Amulet"), "01")
390 MarketInsertItem:addOption(tr("Helmet"), "02")
391 MarketInsertItem:addOption(tr("Backpack"), "03")
392 MarketInsertItem:addOption(tr("Weapon"), "04")
393 MarketInsertItem:addOption(tr("Armor"), "05")
394 MarketInsertItem:addOption(tr("Glove"), "06")
395 MarketInsertItem:addOption(tr("Ring"), "07")
396 MarketInsertItem:addOption(tr("Legs"), "08")
397 MarketInsertItem:addOption(tr("Boots"), "09")
398 MarketInsertItem:addOption(tr("Vip Coins"), "10")
399
400 RareSearchItem = CentralBox:recursiveGetChildById('selectRare')
401 RareSearchItem:addOption(tr("Tudo"), "-1")
402 RareSearchItem:addOption(tr("Comum"), "00")
403 RareSearchItem:addOption(tr("Melhorado"), "01")
404 RareSearchItem:addOption(tr("Raro"), "02")
405 RareSearchItem:addOption(tr("Epico"), "03")
406 RareSearchItem:addOption(tr("Lendario"), "04")
407
408 StarSearchItem = CentralBox:recursiveGetChildById('selectStar')
409 StarSearchItem:addOption(tr("Tudo"), "-1")
410 StarSearchItem:addOption(tr("Metralhadora"), "01")
411 StarSearchItem:addOption(tr("Pistola"), "02")
412 StarSearchItem:addOption(tr("Rifle"), "03")
413 StarSearchItem:addOption(tr("Espingarda"), "04")
414
415 QntItem = CentralBox:recursiveGetChildById('txtInsertQnt')
416 PriceUndItem = CentralBox:recursiveGetChildById('txtInsertUnd')
417 PriceVipItem = CentralBox:recursiveGetChildById('txtInsertVip')
418 TotalPrice = CentralBox:recursiveGetChildById('txtInsertTotal')
419 MarketWindow:hide()
420 -----------------------------------------------------------------------
421 Vendas = CentralBox:recursiveGetChildById('vendas')
422 GoldCoin = CentralBox:recursiveGetChildById('txtGold')
423 VendasWindow = CentralBox:recursiveGetChildById('vendasWindow')
424 loadAmmo = CentralBox:recursiveGetChildById('loadAmmo')
425 MaxItem = CentralBox:recursiveGetChildById('maxItem')
426 CustoTotal = CentralBox:recursiveGetChildById('custoTotal')
427 SelectAll = CentralBox:recursiveGetChildById('selectAll')
428 SellItems = CentralBox:recursiveGetChildById('sell')
429 BonuSell = CentralBox:recursiveGetChildById('bonuSell')
430 SelectAll.onClick = function() onSelectAll() end
431 SellItems.onClick = function() onSell() end
432 VendasWindow:hide()
433 ComboBag = CentralBox:recursiveGetChildById('selectBackpack')
434 ComboBag:addOption(tr("Amulet"), "01")
435 ComboBag:addOption(tr("Helmet"), "02")
436 ComboBag:addOption(tr("Backpack"), "03")
437 ComboBag:addOption(tr("Weapon"), "04")
438 ComboBag:addOption(tr("Armor"), "05")
439 ComboBag:addOption(tr("Glove"), "06")
440 ComboBag:addOption(tr("Ring"), "07")
441 ComboBag:addOption(tr("Legs"), "08")
442 ComboBag:addOption(tr("Boots"), "09")
443 -----------------------------------------------------------------------
444 Upgrade = CentralBox:recursiveGetChildById('upgrade')
445 ItemEquipado = CentralBox:recursiveGetChildById('itemEquipado')
446 ItemSelectView = CentralBox:recursiveGetChildById('itemUpgradeView')
447 UpgradeLevelGun = CentralBox:recursiveGetChildById('upgradeLevelGun')
448 UpgradeLevelEquip = CentralBox:recursiveGetChildById('upgradeLevelEquip')
449 UpgradeStar = CentralBox:recursiveGetChildById('upgradeStar')
450 DMGMin = CentralBox:recursiveGetChildById('dmgMin')
451 UPMin = CentralBox:recursiveGetChildById('upMin')
452 DMGMax = CentralBox:recursiveGetChildById('dmgMax')
453 UPMax = CentralBox:recursiveGetChildById('upMax')
454 DEFESA = CentralBox:recursiveGetChildById('valueDef')
455 ESQUIVA = CentralBox:recursiveGetChildById('valueEsq')
456 MAGICO = CentralBox:recursiveGetChildById('valueMag')
457 StarAntes = CentralBox:recursiveGetChildById('starAntes')
458 TextAntes = CentralBox:recursiveGetChildById('txtAntes')
459 StarDepois = CentralBox:recursiveGetChildById('starDepois')
460 TextDepois = CentralBox:recursiveGetChildById('txtDepois')
461 LevelRec = CentralBox:recursiveGetChildById('recLevelUpgrade')
462 CoinsRec = CentralBox:recursiveGetChildById('upgradecoins')
463 ButtonUpgrade = CentralBox:recursiveGetChildById('btupgrade')
464 UP_Item1 = CentralBox:recursiveGetChildById('item1')
465 UP_Item2 = CentralBox:recursiveGetChildById('item2')
466 UP_Item3 = CentralBox:recursiveGetChildById('item3')
467 UP_Item4 = CentralBox:recursiveGetChildById('item4')
468 coinMenSucess = CentralBox:recursiveGetChildById('coinMenSucess')
469 coinMoreSucess = CentralBox:recursiveGetChildById('coinMoreSucess')
470 rateSucess = CentralBox:recursiveGetChildById('rateSucess')
471
472 UpgradeWindow = CentralBox:recursiveGetChildById('upgradeWindow')
473 UpgradeWindow:hide()
474 ComboBagUpgrade = CentralBox:recursiveGetChildById('selectBagUpgrade')
475 ComboBagUpgrade:addOption(tr("Amulet"), "01")
476 ComboBagUpgrade:addOption(tr("Helmet"), "02")
477 ComboBagUpgrade:addOption(tr("Weapon"), "04")
478 ComboBagUpgrade:addOption(tr("Armor"), "05")
479 ComboBagUpgrade:addOption(tr("Glove"), "06")
480 --ComboBagUpgrade:addOption("Ring", "07")
481 ComboBagUpgrade:addOption(tr("Legs"), "08")
482 ComboBagUpgrade:addOption(tr("Boots"), "09")
483 TypeUpgrade = CentralBox:recursiveGetChildById('selectUpgrade')
484 TypeUpgrade:addOption("Level", "01")
485 TypeUpgrade:addOption("Star", "02")
486 -----------------------------------------------------------------------
487 Skill = CentralBox:recursiveGetChildById('skill')
488 AmuletItem = CentralBox:recursiveGetChildById('AmuletItem')
489 HelmetItem = CentralBox:recursiveGetChildById('HelmetItem')
490 BackpackItem = CentralBox:recursiveGetChildById('BackpackItem')
491 GunItem = CentralBox:recursiveGetChildById('GunItem')
492 ArmorItem = CentralBox:recursiveGetChildById('ArmorItem')
493 GloveItem = CentralBox:recursiveGetChildById('GloveItem')
494 RingItem = CentralBox:recursiveGetChildById('RingItem')
495 LegsItem = CentralBox:recursiveGetChildById('LegsItem')
496 BootsItem = CentralBox:recursiveGetChildById('BootsItem')
497 SkillSelectItem = CentralBox:recursiveGetChildById('SkillSelectItem')
498 Skill1 = CentralBox:recursiveGetChildById('Skill1')
499 Skill2 = CentralBox:recursiveGetChildById('Skill2')
500 Skill3 = CentralBox:recursiveGetChildById('Skill3')
501 BACKPACK_01 = CentralBox:recursiveGetChildById('SBackpack1')
502 BACKPACK_02 = CentralBox:recursiveGetChildById('SBackpack2')
503 BACKPACK_03 = CentralBox:recursiveGetChildById('SBackpack3')
504 BACKPACK_04 = CentralBox:recursiveGetChildById('SBackpack4')
505 SkillButton = CentralBox:recursiveGetChildById('btSkill')
506 SkillTutor = CentralBox:recursiveGetChildById('txtTutor')
507 SkillWindow = CentralBox:recursiveGetChildById('skillWindow')
508 SkillWindow:hide()
509 BackgroundCentral = g_ui.displayUI('central')
510 BackgroundCentral:hide()
511 CentralBox:hide()
512end
513function onCentralBox(mode, text)
514 if not g_game.isOnline() then
515 return
516 end
517 if mode == MessageModes.Failure then
518 if string.find(text, "@CentralBox") then
519 local t = string.explode(text, " ")
520 tutor = tonumber(t[03])
521 bonusVenda = tonumber(t[04])
522 if modules.game_menu.onGetDailyEvent(00) == 04 then
523 bonusVenda = bonusVenda + tonumber(t[05])
524 end
525 DepotActive = false
526 DepotDelay = false
527 BackgroundCentral:setParent(gameRoot)
528 BackgroundCentral:addAnchor(AnchorTop, 'gameMapPanel', AnchorTop)
529 BackgroundCentral:addAnchor(AnchorRight, 'gameMapPanel', AnchorRight)
530 BackgroundCentral:addAnchor(AnchorLeft, 'gameMapPanel', AnchorLeft)
531 BackgroundCentral:addAnchor(AnchorBottom, 'gameMapPanel', AnchorBottom)
532 BackgroundCentral:focus()
533 BackgroundCentral:raise()
534 BonuSell:setText(tr('BONUS DE VENDA:').. ' ' ..bonusVenda.. '%')
535 CLICK_BUY = false
536 if g_app.isMobile() then
537 HoverMobile = 01
538 modules.game_menu.CloseAllMobileWindow()
539 modules.client_mobile.onHideUI(00)
540 else
541 HoverMobile = 00
542 end
543
544 BackgroundCentral:show()
545 centralBox = true
546 GoldCoin:setText(mask_number(tonumber(t[02])))
547 atual_gold = tonumber(t[02])
548 g_effects.fadeIn(BackgroundCentral, 250)
549
550 scheduleEvent(function()
551 CentralBox:show()
552 g_effects.fadeIn(CentralBox, 250)
553 Depot:hide() Market:hide() Vendas:hide() Upgrade:hide() Skill:hide() GoldCoin:hide() ExitBox:hide()
554 scheduleEvent(function() Depot:show() g_effects.fadeIn(Depot, 250) end, 200)
555 scheduleEvent(function() Market:show() g_effects.fadeIn(Market, 250) end, 200)
556 scheduleEvent(function() Vendas:show() g_effects.fadeIn(Vendas, 250) end, 300)
557 scheduleEvent(function() Upgrade:show() g_effects.fadeIn(Upgrade, 250) end, 400)
558 scheduleEvent(function() Skill:show() g_effects.fadeIn(Skill, 250) end, 500)
559 scheduleEvent(function() GoldCoin:show() g_effects.fadeIn(GoldCoin, 250) end, 600)
560 scheduleEvent(function() ExitBox:show() g_effects.fadeIn(ExitBox, 250) end, 600)
561
562 onResetButtons()
563 end, 200)
564 end
565 if string.find(text, "@ReloadMaxBullet") then
566 local t = string.explode(text, " ")
567 MaxBullet = tonumber(t[02])
568 end
569 if string.find(text, "@MarketInsertComboBox") then
570 LoadInsertMarketItem(01)
571 end
572 if string.find(text, "@OpenSellComboBox") then
573 LoadBagVendas(01)
574 end
575 if string.find(text, "@OpenSkillBag") then
576 LoadSkills(01)
577 end
578 if string.find(text, "@SkillUpgradeSucess") then
579 if tutor > 0 then
580 closer()
581 modules.game_alert.onShowTutor(09)
582 end
583 resetSkillSelect()
584 TotalItem = 0
585 SlotSkillSelect = 0
586 SkillButton:disable()
587 modules.game_menu.ConfigHotkeys()
588 onSkillSelectItem(00, 00, 00)
589 g_game.talk(g_game.talk("!backpack 52 03 00"))
590 BackgroundCentral:focus()
591 BackgroundCentral:raise()
592 end
593 if string.find(text, "@SkillFailUpgrade") then
594 resetSkillSelect()
595 if SlotSkillSelect == 01 then
596 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
597 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
598 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
599 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
600 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
601 Skill1:setImageSource("/images/custom/UI/spell_slot")
602 if skillRare > 1 then
603 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
604 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
605 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
606 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
607 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
608 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
609 else
610 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
611 Skill2:setImageSource("/images/custom/UI/insert_skill")
612 end
613 end
614 if skillRare > 2 then
615 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
616 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
617 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
618 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
619 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
620 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
621 else
622 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
623 Skill3:setImageSource("/images/custom/UI/insert_skill")
624 end
625 end
626 elseif SlotSkillSelect == 02 then
627 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
628 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
629 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
630 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
631 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
632 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
633 else
634 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
635 Skill1:setImageSource("/images/custom/UI/insert_skill")
636 end
637 Skill2:setImageSource("/images/custom/UI/spell_slot")
638 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
639 if skillRare > 2 then
640 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
641 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
642 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
643 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
644 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
645 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
646 else
647 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
648 Skill3:setImageSource("/images/custom/UI/insert_skill")
649 end
650 end
651 elseif SlotSkillSelect == 03 then
652 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
653 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
654 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
655 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
656 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
657 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
658 else
659 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
660 Skill1:setImageSource("/images/custom/UI/insert_skill")
661 end
662 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
663 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
664 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
665 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
666 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
667 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
668 else
669 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
670 Skill2:setImageSource("/images/custom/UI/insert_skill")
671 end
672 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
673 Skill3:setImageSource("/images/custom/UI/spell_slot")
674 end
675 end
676 if string.find(text, "@OpenUpgradeBox") then
677 LoadUpgradeBox(01)
678 end
679 if string.find(text, "@AceptUpgrade") then
680 resetUpgradeItem()
681 LoadUpgradeBox(01)
682 modules.game_menu.onTooltipInv()
683 end
684 if string.find(text, "@AfterSell") then
685 local t = string.explode(text, " ")
686 onResetSelectItem()
687 g_game.talk(g_game.talk("!backpack 50 " ..t[02].. " " ..t[03]))
688 TotalItem = 0
689 TotalCust = 0
690 end
691 if string.find(text, "@HistoryLoad") then
692 local t = string.explode(text, "|")
693 Index = tonumber(t[02])
694 if Index == 01 then
695 CleanAllMarketSlots()
696 for DEL = 01, #_MARKET_HISTORY do
697 DEL_ID = HistoryPanel:recursiveGetChildById('H_LIST_' ..DEL)
698 if DEL_ID then
699 DEL_ID:destroy()
700 end
701 end
702 end
703 if _MARKET_HISTORY[Index] then
704 _MARKET_HISTORY[Index].ID = tonumber(t[03])
705 _MARKET_HISTORY[Index].PLAYER_ID = tonumber(t[04])
706 _MARKET_HISTORY[Index].SALE = tonumber(t[05])
707 _MARKET_HISTORY[Index].ITEMTYPE = tonumber(t[06])
708 _MARKET_HISTORY[Index].QNT = tonumber(t[07])
709 _MARKET_HISTORY[Index].PRICE = tonumber(t[08])
710 _MARKET_HISTORY[Index].DATE = tonumber(t[09])
711 _MARKET_HISTORY[Index].ITEM_NAME = t[10]
712 _MARKET_HISTORY[Index].SELLER_NAME = t[11]
713 _MARKET_HISTORY[Index].ANONYMOUS = tonumber(t[12])
714 _MARKET_HISTORY[Index].SALE_TYPE = tonumber(t[13])
715 end
716 end
717 if string.find(text, "@ShowHistory") then
718 local t = string.explode(text, " ")
719 if tonumber(t[02]) == 00 then
720 CleanAllMarketSlots()
721 else
722 onMarket(03)
723 end
724 end
725 if string.find(text, "@LoadMyOffers") then
726 local t = string.explode(text, " ")
727 Index = tonumber(t[02])
728 if Index == 01 then
729 for DEL = 01, 999 do
730 DEL_ID = MarketPanel:recursiveGetChildById('M_LIST_' ..DEL)
731 if DEL_ID then
732 DEL_ID:destroy()
733 else
734 break
735 end
736 end
737 CleanAllMarketSlots()
738 end
739
740 _MARKET_SELLER[Index].ID = tonumber(t[03])
741 _MARKET_SELLER[Index].PLAYER_ID = tonumber(t[04])
742 _MARKET_SELLER[Index].ANONYMOUS = tonumber(t[05])
743 _MARKET_SELLER[Index].PRICE = tonumber(t[06])
744 _MARKET_SELLER[Index].TIMER = tonumber(t[07])
745 _MARKET_SELLER[Index].UID_1 = tonumber(t[08])
746 _MARKET_SELLER[Index].UID_2 = tonumber(t[09])
747 _MARKET_SELLER[Index].UID_3 = tonumber(t[10])
748 _MARKET_SELLER[Index].UID_4 = tonumber(t[11])
749 _MARKET_SELLER[Index].UID_5 = tonumber(t[12])
750 _MARKET_SELLER[Index].UID_6 = tonumber(t[13])
751 _MARKET_SELLER[Index].UID_7 = tonumber(t[14])
752 _MARKET_SELLER[Index].UID_8 = tonumber(t[15])
753 _MARKET_SELLER[Index].UID_9 = tonumber(t[16])
754 _MARKET_SELLER[Index].UID_10 = tonumber(t[17])
755 _MARKET_SELLER[Index].TYPE = tonumber(t[18])
756 _MARKET_SELLER[Index].OFFERT = tonumber(t[19])
757
758 Empty_Market_Seller = 01
759 end
760 if string.find(text, "@ProcurandoMarket") then
761 local t = string.explode(text, "|")
762 if tonumber(t[18]) == 01 then
763 if #_MARKET_SEARCH_TABLE > 0 then
764 for k in pairs (_MARKET_SEARCH_TABLE) do
765 _MARKET_SEARCH_TABLE [k] = nil
766 end
767 end
768 end
769 local strMarket = t[02].. "@" ..t[03].. "@" ..t[04].. "@" ..t[05].. "@" ..t[06].. "@" ..t[07].. "@" ..t[08].. "@" ..t[09].. "@" ..t[10].. "@" ..t[11].. "@" ..t[12].. "@" ..t[13].. "@" ..t[14].. "@" ..t[15].. "@" ..t[16].. "@" ..t[17].. "@" ..t[19].. "@" ..t[18].. "@" ..t[20]
770 table.insert(_MARKET_SEARCH_TABLE, strMarket)
771 end
772 if string.find(text, "@RemoveSlotsMarket") then
773 local t = string.explode(text, " ")
774 if tonumber(t[02]) == 01 then
775 CleanAllMarketSlots()
776 Empty_Market_Seller = 01
777 elseif tonumber(t[02]) == 02 then
778 if t[03] then
779 if tonumber(t[03]) > 00 then
780 table.remove(_MARKET_SEARCH_TABLE, tonumber(t[04]))
781 end
782
783 if WordPesquisa == 01 then
784 g_game.getProtocolGame():sendExtendedOpcode(search_market, "0," ..Search_1:getText())
785 else
786 g_game.getProtocolGame():sendExtendedOpcode(search_market, ComboBoxSelect.. ",|")
787 end
788 return true
789 end
790
791 Empty_Market_Seller = 01
792 ComboBoxSelect = 00
793 market_box_rare = -1
794 market_box_star = -1
795
796 marketBoxBackpack:setOption("-", "00")
797 g_game.getProtocolGame():sendExtendedOpcode(search_market, "0,|")
798 return true
799 else
800 CleanAllMarketSlots()
801 Empty_Market_Seller = 00
802 QntEmptySlot:setText("0/10")
803 QntEmptySlot:setColor('white')
804 end
805
806 for DEL = 01, #_MARKET_SELLER do
807 DEL_ID = MarketPanel:recursiveGetChildById('M_LIST_' ..DEL)
808 if DEL_ID then
809 DEL_ID:destroy()
810 end
811 end
812 scheduleEvent(function()
813 CleanAllMarketSlots()
814 QntEmptySlot:setText("0/10")
815 QntEmptySlot:setColor('white')
816 g_game.getProtocolGame():sendExtendedOpcode(load_myoffert_market)
817 end, 1000)
818 end
819 if string.find(text, "@DefinePage") then
820 local t = string.explode(text, " ")
821 local TotalItems = tonumber(t[02])
822 TotalPage = 1
823 if TotalItems > 10 then
824 repeat
825 if TotalItems > (TotalPage * 10) then
826 TotalItems = TotalItems - 10
827 TotalPage = TotalPage + 1
828 else
829 break
830 end
831 until TotalItems < 01
832 end
833 loadMarketPage()
834 end
835 if string.find(text, "@MyOffertRefresh") then
836 local t = string.explode(text, " ")
837 TotalPage = 01
838 AtualPage = 01
839 PAGE_START = 00
840 local countPage = #_MARKET_SEARCH_TABLE
841 for _PAGE = 01, 9999 do
842 countPage = countPage - MAX_LIST_VIEW
843 if countPage >= MAX_LIST_VIEW then
844 TotalPage = TotalPage + 01
845 elseif countPage > 0 then
846 TotalPage = TotalPage + 01
847 break
848 else
849 break
850 end
851 end
852
853 LastPage:disable()
854 NextPage:disable()
855 labelUnd:setText('-')
856 labelTotal:setText(tr('Valor Total'))
857 LabelPage:setText(AtualPage.. "/" ..TotalPage)
858 onMarket(tonumber(t[02]))
859 end
860 if string.find(text, "@DepotBackpack") then
861 LoadBagDepot(01)
862 end
863 if string.find(text, "@DepotItems") then
864 local t = string.explode(text, " ")
865 local DEPOT_INDEX = tonumber(t[12])
866 if DEPOT_INDEX == 01 then
867 for DEL_DEPOT = 01, MaxDepotSlot do
868 DEPOT_ID = CentralBox:recursiveGetChildById('DEPOT_' ..DEL_DEPOT)
869 if DEPOT_ID then
870 DEPOT_ID:destroy()
871 end
872
873 DEPOT_TEMP[DEL_DEPOT].UID_01 = 0000
874 DEPOT_TEMP[DEL_DEPOT].UID_02 = 0000
875 DEPOT_TEMP[DEL_DEPOT].UID_03 = 0000
876 DEPOT_TEMP[DEL_DEPOT].UID_04 = 0000
877 DEPOT_TEMP[DEL_DEPOT].UID_05 = 0000
878 DEPOT_TEMP[DEL_DEPOT].UID_06 = 0000
879 DEPOT_TEMP[DEL_DEPOT].UID_07 = 0000
880 DEPOT_TEMP[DEL_DEPOT].UID_08 = 0000
881 DEPOT_TEMP[DEL_DEPOT].UID_09 = 0000
882 DEPOT_TEMP[DEL_DEPOT].UID_10 = 0000
883 end
884 DepotCountMax = 00
885 LoadBagDepot(01)
886 end
887
888 DEPOT = g_ui.createWidget('UIButton', DepotPanel)
889 DEPOT:setId("DEPOT_" ..DEPOT_INDEX)
890 DEPOT:setText("")
891 DEPOT:setTextOffset("00 30")
892 DEPOT:setImageSource("/images/custom/UI/item_slot")
893 DEPOT:setIcon("/images/custom/Items/0")
894 DEPOT:setMarginTop(05)
895 DEPOT:setMarginLeft(05)
896 DEPOT.onClick = function() end
897
898 if tonumber(t[02]) > 00 then
899 DepotCountMax = DepotCountMax + 01
900 DEPOT_TEMP[DEPOT_INDEX].UID_01 = tonumber(t[02]) -- ID
901 DEPOT_TEMP[DEPOT_INDEX].UID_02 = tonumber(t[03]) -- RARE
902 DEPOT_TEMP[DEPOT_INDEX].UID_03 = tonumber(t[04]) -- STAR
903 DEPOT_TEMP[DEPOT_INDEX].UID_04 = tonumber(t[05]) -- SKILL 01 QNT
904 DEPOT_TEMP[DEPOT_INDEX].UID_05 = tonumber(t[06]) -- SKILL 02 LEVEL
905 DEPOT_TEMP[DEPOT_INDEX].UID_06 = tonumber(t[07]) -- SKILL 03 ATR1
906 DEPOT_TEMP[DEPOT_INDEX].UID_07 = tonumber(t[08]) -- LEVEL ATR2
907 DEPOT_TEMP[DEPOT_INDEX].UID_08 = tonumber(t[09]) -- EXP
908 DEPOT_TEMP[DEPOT_INDEX].UID_09 = tonumber(t[10]) -- UNIQUE ITEM
909 DEPOT_TEMP[DEPOT_INDEX].UID_10 = tonumber(t[11]) -- AMMO
910 local SLOT_TYPE = modules.game_database.getItemInfo(DEPOT_TEMP[DEPOT_INDEX].UID_01, 02)
911
912 DEPOT:setImageSource("/images/custom/UI/rare_" ..DEPOT_TEMP[DEPOT_INDEX].UID_02)
913 DEPOT:setIcon("/images/custom/Items/" ..DEPOT_TEMP[DEPOT_INDEX].UID_01)
914 if SLOT_TYPE == 1 or SLOT_TYPE == 7 then
915 DEPOT:setTooltip("@JOIAS " ..DEPOT_TEMP[DEPOT_INDEX].UID_01.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_02.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_03.. " 0 " ..DEPOT_TEMP[DEPOT_INDEX].UID_05.. " 0 0 0 " ..DEPOT_TEMP[DEPOT_INDEX].UID_09.. " 0")
916 elseif SLOT_TYPE == 4 then
917 DEPOT:setTooltip("@GUN " ..DEPOT_TEMP[DEPOT_INDEX].UID_01.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_02.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_03.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_04.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_05.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_06.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_07.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_08.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_09.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_10)
918 elseif SLOT_TYPE == 0 or SLOT_TYPE == 11 or SLOT_TYPE == 12 then
919 DEPOT:setTooltip("@BAG " ..DEPOT_TEMP[DEPOT_INDEX].UID_01.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_02.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_03.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_04.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_05.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_06.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_07.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_08.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_09.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_10)
920 if DEPOT_TEMP[DEPOT_INDEX].UID_04 > 0 then
921 if DEPOT_TEMP[DEPOT_INDEX].UID_04 < 10 then
922 DEPOT:setText("0" ..DEPOT_TEMP[DEPOT_INDEX].UID_04)
923 else
924 DEPOT:setText(DEPOT_TEMP[DEPOT_INDEX].UID_04)
925 end
926 else
927 DEPOT:setText("")
928 end
929 else
930 DEPOT:setTooltip("@EQUIP " ..DEPOT_TEMP[DEPOT_INDEX].UID_01.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_02.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_03.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_04.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_05.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_06.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_07.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_08.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_09.. " " ..DEPOT_TEMP[DEPOT_INDEX].UID_10)
931 end
932 DEPOT.onClick = function() onClickDepotItem(02, SLOT_TYPE, DEPOT_INDEX, DEPOT_TEMP[DEPOT_INDEX].UID_01, DEPOT_TEMP[DEPOT_INDEX].UID_04) end
933 end
934
935 maxDepotItem:setText('Itens: ' ..DepotCountMax.. '/' ..#DEPOT_TEMP)
936 if DepotCountMax > 80 and DepotCountMax < 100 then
937 maxDepotItem:setColor('orange')
938 elseif DepotCountMax < 80 then
939 maxDepotItem:setColor('white')
940 else
941 maxDepotItem:setColor('red')
942 end
943 end
944 if string.find(text, "@LoadOffertList") then
945 local t = string.explode(text, "@")
946 if tonumber(t[03]) == 01 then
947 for X = 01, #OFFERTS_LIST do
948 OFFERTS_LIST[X].UID_1 = 0000
949 OFFERTS_LIST[X].UID_2 = 0000
950 OFFERTS_LIST[X].UID_3 = 0000
951 OFFERTS_LIST[X].UID_4 = 0000
952 OFFERTS_LIST[X].UID_5 = 0000
953 OFFERTS_LIST[X].UID_6 = 0000
954 OFFERTS_LIST[X].UID_7 = 0000
955 OFFERTS_LIST[X].UID_8 = 0000
956 OFFERTS_LIST[X].UID_9 = 0000
957 OFFERTS_LIST[X].UID_10 = 0000
958 OFFERTS_LIST[X].SLOT = 0000
959 OFFERTS_LIST[X].EXT = 0000
960 OFFERTS_LIST[X].BAG = 0000
961 end
962
963 ListOrder = 01
964 end
965
966 OFFERTS_LIST[ListOrder].UID_1 = tonumber(t[04])
967 OFFERTS_LIST[ListOrder].UID_2 = tonumber(t[05])
968 OFFERTS_LIST[ListOrder].UID_3 = tonumber(t[06])
969 OFFERTS_LIST[ListOrder].UID_4 = tonumber(t[07])
970 OFFERTS_LIST[ListOrder].UID_5 = tonumber(t[08])
971 OFFERTS_LIST[ListOrder].UID_6 = tonumber(t[09])
972 OFFERTS_LIST[ListOrder].UID_7 = tonumber(t[10])
973 OFFERTS_LIST[ListOrder].UID_8 = tonumber(t[11])
974 OFFERTS_LIST[ListOrder].UID_9 = tonumber(t[12])
975 OFFERTS_LIST[ListOrder].UID_10 = tonumber(t[13])
976 OFFERTS_LIST[ListOrder].SLOT = tonumber(t[14])
977 OFFERTS_LIST[ListOrder].EXT = tonumber(t[15])
978 OFFERTS_LIST[ListOrder].BAG = tonumber(t[16])
979
980 ListOrder = ListOrder + 01
981 end
982 if string.find(text, "@ShowOffertList") then
983 for X = 01, #OFFERTS_LIST do
984 ItemList = OffertBox:recursiveGetChildById('List_' ..X)
985 if OFFERTS_LIST[X].UID_1 > 0000 then
986 ItemList:setBorderWidth(0)
987 ItemList:setBorderColor("white")
988 ItemList:setText("")
989 ItemList:setImageSource("/images/custom/UI/rare_" ..OFFERTS_LIST[X].UID_2)
990 ItemList:setIcon("/images/custom/Items/" ..OFFERTS_LIST[X].UID_1)
991 local SLOT_TYPE = OFFERTS_LIST[X].SLOT
992
993 if SLOT_TYPE == 1 or SLOT_TYPE == 7 then
994 ItemList:setTooltip("@JOIAS " ..OFFERTS_LIST[X].UID_1.. " " ..OFFERTS_LIST[X].UID_2.. " " ..OFFERTS_LIST[X].UID_3.. " 0 " ..OFFERTS_LIST[X].UID_5.. " 0 0 0 " ..OFFERTS_LIST[X].UID_9.. " 0")
995 elseif SLOT_TYPE == 4 then
996 ItemList:setTooltip("@GUN " ..OFFERTS_LIST[X].UID_1.. " " ..OFFERTS_LIST[X].UID_2.. " " ..OFFERTS_LIST[X].UID_3.. " " ..OFFERTS_LIST[X].UID_4.. " " ..OFFERTS_LIST[X].UID_5.. " " ..OFFERTS_LIST[X].UID_6.. " " ..OFFERTS_LIST[X].UID_7.. " " ..OFFERTS_LIST[X].UID_8.. " " ..OFFERTS_LIST[X].UID_9.. " " ..OFFERTS_LIST[X].UID_10)
997 elseif SLOT_TYPE == 0 or SLOT_TYPE == 11 or SLOT_TYPE == 12 then
998 ItemList:setTooltip("@BAG " ..OFFERTS_LIST[X].UID_1.. " " ..OFFERTS_LIST[X].UID_2.. " " ..OFFERTS_LIST[X].UID_3.. " " ..OFFERTS_LIST[X].UID_4.. " " ..OFFERTS_LIST[X].UID_5.. " " ..OFFERTS_LIST[X].UID_6.. " " ..OFFERTS_LIST[X].UID_7.. " " ..OFFERTS_LIST[X].UID_8.. " " ..OFFERTS_LIST[X].UID_9.. " " ..OFFERTS_LIST[X].UID_10)
999 if OFFERTS_LIST[X].UID_4 > 0 then
1000 if OFFERTS_LIST[X].UID_4 < 10 then
1001 ItemList:setText("0" ..OFFERTS_LIST[X].UID_4)
1002 else
1003 ItemList:setText(OFFERTS_LIST[X].UID_4)
1004 end
1005 else
1006 ItemList:setText("")
1007 end
1008 else
1009 ItemList:setTooltip("@EQUIP " ..OFFERTS_LIST[X].UID_1.. " " ..OFFERTS_LIST[X].UID_2.. " " ..OFFERTS_LIST[X].UID_3.. " " ..OFFERTS_LIST[X].UID_4.. " " ..OFFERTS_LIST[X].UID_5.. " " ..OFFERTS_LIST[X].UID_6.. " " ..OFFERTS_LIST[X].UID_7.. " " ..OFFERTS_LIST[X].UID_8.. " " ..OFFERTS_LIST[X].UID_9.. " " ..OFFERTS_LIST[X].UID_10)
1010 end
1011 ItemList.onClick = function(widget)
1012 OFFERT_CLICK_LIST_ITEM = X
1013 for X = 01, #OFFERTS_LIST do
1014 BorderList = OffertBox:recursiveGetChildById('List_' ..X)
1015 BorderList:setBorderWidth(0)
1016 BorderList:setBorderColor("white")
1017 end
1018 widget:setBorderWidth(2)
1019 widget:setBorderColor("yellow")
1020
1021 end
1022 else
1023 ItemList:setText("")
1024 ItemList:setImageSource("/images/custom/UI/item_slot")
1025 ItemList:setIcon("/images/custom/Items/0")
1026 ItemList:setTooltip("")
1027 ItemList.onClick = function() end
1028 end
1029 end
1030
1031 OffertBox:show()
1032 OffertBox:focus()
1033 OffertBox:raise()
1034 end
1035 end
1036end
1037
1038function onCentralBoxFocus()
1039 if centralBox then
1040 modules.client_mobile.onHideUI(00)
1041 BackgroundCentral:focus()
1042 BackgroundCentral:raise()
1043 end
1044end
1045function setSortDepotType(value)
1046 ComboBoxSelect = tonumber(value)
1047 BagSelect = 0
1048 g_game.talk(g_game.talk("!backpack 54 " ..value.. " 00"))
1049end
1050function onChangeSortDepotType(comboBox, option, value)
1051 setSortDepotType(value:lower())
1052end
1053function LoadBagDepot(Index)
1054 local Max = 20
1055 DEPOT_BAG = CentralBox:recursiveGetChildById('DepotBag' ..Index)
1056 scheduleEvent(function()
1057 if modules.game_database.getItemBagId(Index) > 0 then
1058 local bagid = Index
1059 local id = modules.game_database.getItemBagId(bagid)
1060 local SLOT_BAG = modules.game_database.getItemInfo(id, 02)
1061
1062 ActiveComboBox = SLOT_BAG
1063 DEPOT_BAG:setText("")
1064 DEPOT_BAG:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(bagid))
1065 DEPOT_BAG:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(bagid))
1066
1067 if SLOT_BAG == 1 or SLOT_BAG == 7 then
1068 local starr = modules.game_database.getPosBackpack(bagid, 3) or 0
1069 local rare = modules.game_database.getPosBackpack(bagid, 2)
1070 local level = modules.game_database.getPosBackpack(bagid, 5)
1071 local lock = modules.game_database.getPosBackpack(bagid, 9)
1072 DEPOT_BAG:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..starr.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
1073 DEPOT_BAG.onClick = function() onClickDepotItem(01, SLOT_BAG, bagid) end
1074 elseif SLOT_BAG == 4 then
1075 local skill_01 = modules.game_database.getPosBackpack(bagid, 4)
1076 local skill_02 = modules.game_database.getPosBackpack(bagid, 5)
1077 local skill_03 = modules.game_database.getPosBackpack(bagid, 6)
1078 local level = modules.game_database.getPosBackpack(bagid, 7)
1079 local star = modules.game_database.getPosBackpack(bagid, 3) or 0
1080 local rare = modules.game_database.getPosBackpack(bagid, 2)
1081 local ammo = modules.game_database.getPosBackpack(bagid, 10)
1082 local lock = modules.game_database.getPosBackpack(bagid, 9)
1083 local bonus = modules.game_database.getPosBackpack(bagid, 8)
1084 DEPOT_BAG.onClick = function() onClickDepotItem(01, SLOT_BAG, bagid) end
1085 DEPOT_BAG:setTooltip("@GUN " ..id.. " " ..rare.. " " ..star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..level.. " " ..bonus.. " " ..lock.. " " ..ammo)
1086 elseif SLOT_BAG == 0 or SLOT_BAG == 11 or SLOT_BAG == 12 then
1087 local qnt = modules.game_database.getPosBackpack(bagid, 04)
1088 local starr = modules.game_database.getPosBackpack(bagid, 3) or 0
1089 local rare = modules.game_database.getPosBackpack(bagid, 2)
1090 local lock = modules.game_database.getPosBackpack(bagid, 9)
1091 DEPOT_BAG:setTooltip("@BAG " ..id.. " " ..rare.. " " ..starr.. " " ..qnt.. " 0 0 0 0 " ..lock.. " 0")
1092 DEPOT_BAG.onClick = function() onClickDepotItem(01, SLOT_BAG, bagid, id, qnt) end
1093 if qnt > 0 then
1094 if qnt < 10 then
1095 DEPOT_BAG:setText("0" ..modules.game_database.getPosBackpack(bagid, 04))
1096 else
1097 DEPOT_BAG:setText(modules.game_database.getPosBackpack(bagid, 04))
1098 end
1099 else
1100 DEPOT_BAG:setText("")
1101 end
1102 else
1103 DEPOT_BAG.onClick = function() onClickDepotItem(01, SLOT_BAG, bagid) end
1104 local starr = modules.game_database.getPosBackpack(bagid, 3) or 0
1105 local levell = modules.game_database.getPosBackpack(bagid, 5)
1106 local atr1 = modules.game_database.getPosBackpack(bagid, 6)
1107 local atr2 = modules.game_database.getPosBackpack(bagid, 7)
1108 local rare = modules.game_database.getPosBackpack(bagid, 2)
1109 local lock = modules.game_database.getPosBackpack(bagid, 9)
1110 local bonus = modules.game_database.getPosBackpack(bagid, 8)
1111 DEPOT_BAG:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..starr.. " 0 " ..levell.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
1112 end
1113 else
1114 DEPOT_BAG:setIcon("/images/custom/UI/none")
1115 DEPOT_BAG:setImageSource("/images/custom/UI/item_slot")
1116 DEPOT_BAG:setTooltip("")
1117 DEPOT_BAG:setText("")
1118 DEPOT_BAG.onClick = function() end
1119 end
1120
1121 DEPOT_BAG:show()
1122 g_effects.fadeIn(DEPOT_BAG, 50)
1123 if Index < Max then
1124 Index = Index + 1
1125 LoadBagDepot(Index)
1126 else
1127 BACKPACK_01 = CentralBox:recursiveGetChildById('DepotBackpack1')
1128 BACKPACK_02 = CentralBox:recursiveGetChildById('DepotBackpack2')
1129 BACKPACK_03 = CentralBox:recursiveGetChildById('DepotBackpack3')
1130 BACKPACK_04 = CentralBox:recursiveGetChildById('DepotBackpack4')
1131 BACKPACK_01:show()
1132 BACKPACK_02:show()
1133 BACKPACK_03:show()
1134 BACKPACK_04:show()
1135
1136 BACKPACK_01:setTooltip("Backpack 01")
1137 g_effects.fadeIn(BACKPACK_01, 250)
1138 BACKPACK_01.onClick = function()
1139 BagSelect = 0
1140 g_game.talk(g_game.talk("!backpack 54 "..ComboBoxSelect.. " 00"))
1141 end
1142 if modules.game_database.getExtension(ComboBoxSelect) >= 01 then
1143 BACKPACK_02:setTooltip("Backpack 02")
1144 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot")
1145 g_effects.fadeIn(BACKPACK_02, 250)
1146
1147 BACKPACK_02.onClick = function()
1148 BagSelect = 1
1149 g_game.talk(g_game.talk("!backpack 54 "..ComboBoxSelect.. " 01"))
1150 end
1151 else
1152 g_effects.fadeIn(BACKPACK_02, 250)
1153 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot_lock")
1154 BACKPACK_02:setTooltip(tr("Compre um novo Slot no Shop"))
1155 BACKPACK_02.onClick = function() end
1156 end
1157 if modules.game_database.getExtension(ComboBoxSelect) >= 02 then
1158 BACKPACK_03:setTooltip("Backpack 03")
1159 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot")
1160 g_effects.fadeIn(BACKPACK_03, 250)
1161
1162 BACKPACK_03.onClick = function()
1163 BagSelect = 2
1164 g_game.talk(g_game.talk("!backpack 54 "..ComboBoxSelect.. " 02"))
1165 end
1166 else
1167 g_effects.fadeIn(BACKPACK_03, 250)
1168 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot_lock")
1169 BACKPACK_03:setTooltip(tr("Compre um novo Slot no Shop"))
1170 BACKPACK_03.onClick = function() end
1171 end
1172 if modules.game_database.getExtension(ComboBoxSelect) >= 03 then
1173 BACKPACK_04:setTooltip("Backpack 04")
1174 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot")
1175 g_effects.fadeIn(BACKPACK_04, 250)
1176
1177 BACKPACK_04.onClick = function()
1178 BagSelect = 3
1179 g_game.talk(g_game.talk("!backpack 54 "..ComboBoxSelect.. " 03"))
1180 end
1181 else
1182 g_effects.fadeIn(BACKPACK_04, 250)
1183 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot_lock")
1184 BACKPACK_04:setTooltip(tr("Compre um novo Slot no Shop"))
1185 BACKPACK_04.onClick = function() end
1186 end
1187
1188 DepotOrder:show()
1189 if ORDER_BACKPACK_TYPE == 01 then -- ORGANIZAR POR RARIDADE
1190 DepotOrder:setTooltip(tr("Organizar por Level"))
1191 elseif ORDER_BACKPACK_TYPE == 02 then -- ORGANIZAR POR LEVEL
1192 DepotOrder:setTooltip(tr("Organizar por Preco"))
1193 elseif ORDER_BACKPACK_TYPE == 03 then -- ORGANIZAR POR PRECO
1194 DepotOrder:setTooltip(tr("Organizar por Raridade"))
1195 end
1196 DepotOrder:setImageSource("/images/custom/UI/order_" ..ORDER_BACKPACK_TYPE)
1197 DepotOrder.onClick = function() onDepotOrder() end
1198 end
1199 end, 10)
1200end
1201function onDepotOrder()
1202 if DELAY_CLICK then
1203 return
1204 end
1205 if ORDER_BACKPACK_TYPE == 01 then -- ORGANIZAR POR RARIDADE
1206 ORDER_BACKPACK_TYPE = 02
1207 elseif ORDER_BACKPACK_TYPE == 02 then -- ORGANIZAR POR LEVEL
1208 ORDER_BACKPACK_TYPE = 03
1209 elseif ORDER_BACKPACK_TYPE == 03 then -- ORGANIZAR POR PRECO
1210 ORDER_BACKPACK_TYPE = 01
1211 end
1212
1213 DELAY_CLICK = true
1214 g_game.talk(g_game.talk("!inventario 52 " ..ORDER_BACKPACK_TYPE))
1215 onDelayClick(02)
1216end
1217function onResetDepotCombobox(slot)
1218 if slot == 01 then
1219 DepotBackpack:setOption("Amulet", "01")
1220 end
1221 if slot == 02 then
1222 DepotBackpack:setOption("Helmet", "02")
1223 end
1224 if slot == 03 then
1225 DepotBackpack:setOption("Backpack", "03")
1226 end
1227 if slot == 04 then
1228 DepotBackpack:setOption("Weapon", "04")
1229 end
1230 if slot == 05 then
1231 DepotBackpack:setOption("Armor", "05")
1232 end
1233 if slot == 06 then
1234 DepotBackpack:setOption("Glove", "06")
1235 end
1236 if slot == 07 then
1237 DepotBackpack:setOption("Ring", "07")
1238 end
1239 if slot == 08 then
1240 DepotBackpack:setOption("Legs", "08")
1241 end
1242 if slot == 09 then
1243 DepotBackpack:setOption("Boots", "09")
1244 end
1245
1246 ComboBoxSelect = slot
1247 BagSelect = 0
1248 g_game.talk(g_game.talk("!backpack 54 " ..slot.. " 00"))
1249end
1250function onClickDepotItem(type, slot, pos, id, max)
1251 if DepotDelay then
1252 return
1253 end
1254
1255 if type == 01 then -- ADICIONANDO AO DEPOT
1256 if slot == 03 or slot == 00 or slot == 11 or slot == 12 then
1257 if DepotCountMax >= MaxDepotSlot then
1258 if modules.game_database.getPosBackpack(pos, 09) > 00 then
1259 modules.game_interface.onLoginAdvice(tr('Seu Depot atingiu a capacidade m�xima.'))
1260 return
1261 else
1262 local itemid = modules.game_database.getPosBackpack(pos, 01)
1263 local searchStack = 00
1264 for X = 01, #DEPOT_TEMP do
1265 if itemid == DEPOT_TEMP[X].UID_01 then
1266 searchStack = 01
1267 break
1268 end
1269 end
1270 if searchStack == 00 then
1271 modules.game_interface.onLoginAdvice(tr('Seu Depot atingiu a capacidade m�xima.'))
1272 return
1273 end
1274 end
1275 end
1276 if max == 01 then
1277 g_game.talk(g_game.talk("!depot 01 " ..ComboBoxSelect.. " " ..BagSelect.. " " ..pos.. " 01"))
1278 DepotDelay = true
1279 scheduleEvent(function()
1280 DepotDelay = false
1281 end, 1000)
1282 return
1283 end
1284 local count = max
1285 local Quantity = max
1286
1287 if countWindow ~= nil then
1288 countWindow:destroy()
1289 countWindow = nil
1290 end
1291 countWindow = g_ui.createWidget('CountWindow', rootWidget)
1292 countWindow:setText(tr("Selecione a quantidade"))
1293 local itembox = countWindow:getChildById('item')
1294 local scrollbar = countWindow:getChildById('countScrollBar')
1295 itembox:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(pos))
1296 itembox:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(pos))
1297 itembox:setSize({width = 42, height = 50})
1298 itembox:setMarginTop(-07)
1299 itembox:setTextOffset('00 30')
1300 itembox:setText(count)
1301 countWindow:focus()
1302 scrollbar:setMaximum(count)
1303 scrollbar:setMinimum(1)
1304 scrollbar:setMarginTop(10)
1305 scrollbar:setValue(count)
1306
1307 local spinbox = countWindow:getChildById('spinBox')
1308 spinbox:setMaximum(count)
1309 spinbox:setMinimum(0)
1310 spinbox:setValue(0)
1311 spinbox:hideButtons()
1312 spinbox:focus()
1313 spinbox.firstEdit = true
1314
1315 local spinBoxValueChange = function(self, value)
1316 spinbox.firstEdit = false
1317 scrollbar:setValue(value)
1318 end
1319 spinbox.onValueChange = spinBoxValueChange
1320 local check = function()
1321 if spinbox.firstEdit then
1322 spinbox:setValue(spinbox:getMaximum())
1323 spinbox.firstEdit = false
1324 end
1325 end
1326 scrollbar.onValueChange = function(self, value)
1327 Quantity = value
1328 itembox:setText(value)
1329 spinbox.onValueChange = nil
1330 spinbox:setValue(value)
1331 spinbox.onValueChange = spinBoxValueChange
1332 end
1333
1334 local okButton = countWindow:getChildById('buttonOk')
1335 okButton.onClick = function()
1336 countWindow:destroy()
1337 countWindow = nil
1338 g_game.talk(g_game.talk("!depot 01 " ..ComboBoxSelect.. " " ..BagSelect.. " " ..pos.. " " ..Quantity))
1339 end
1340 local cancelButton = countWindow:getChildById('buttonCancel')
1341 cancelButton.onClick = function()
1342 countWindow:destroy()
1343 countWindow = nil
1344 end
1345 else
1346 if DepotCountMax >= MaxDepotSlot then
1347 modules.game_interface.onLoginAdvice(tr('Seu Depot atingiu a capacidade m�xima.'))
1348 return
1349 end
1350 g_game.talk(g_game.talk("!depot 01 " ..ComboBoxSelect.. " " ..BagSelect.. " " ..pos.. " 01"))
1351 end
1352 end
1353 if type == 02 then -- REMOVENDO DO DEPOT
1354 if slot == 03 or slot == 00 or slot == 11 or slot == 12 then
1355 slot = 03
1356 if max == 01 then
1357 g_game.talk(g_game.talk("!depot 02 " ..slot.. " " ..BagSelect.. " " ..pos.. " 01"))
1358 onResetDepotCombobox(slot)
1359 DepotDelay = true
1360 scheduleEvent(function()
1361 DepotDelay = false
1362 end, 1000)
1363 return
1364 end
1365
1366 local count = max
1367 local Quantity = max
1368
1369 if countWindow ~= nil then
1370 countWindow:destroy()
1371 countWindow = nil
1372 end
1373 countWindow = g_ui.createWidget('CountWindow', rootWidget)
1374 countWindow:setText(tr("Selecione a quantidade"))
1375 local itembox = countWindow:getChildById('item')
1376 local scrollbar = countWindow:getChildById('countScrollBar')
1377 itembox:setIcon("/images/custom/Items/" ..DEPOT_TEMP[pos].UID_01)
1378 itembox:setImageSource("/images/custom/UI/rare_" ..DEPOT_TEMP[pos].UID_02)
1379 itembox:setSize({width = 42, height = 50})
1380 itembox:setMarginTop(-07)
1381 itembox:setTextOffset('00 30')
1382 itembox:setText(count)
1383 countWindow:focus()
1384 scrollbar:setMaximum(count)
1385 scrollbar:setMinimum(1)
1386 scrollbar:setMarginTop(10)
1387 scrollbar:setValue(count)
1388
1389 local spinbox = countWindow:getChildById('spinBox')
1390 spinbox:setMaximum(count)
1391 spinbox:setMinimum(0)
1392 spinbox:setValue(0)
1393 spinbox:hideButtons()
1394 spinbox:focus()
1395 spinbox.firstEdit = true
1396
1397 local spinBoxValueChange = function(self, value)
1398 spinbox.firstEdit = false
1399 scrollbar:setValue(value)
1400 end
1401 spinbox.onValueChange = spinBoxValueChange
1402 local check = function()
1403 if spinbox.firstEdit then
1404 spinbox:setValue(spinbox:getMaximum())
1405 spinbox.firstEdit = false
1406 end
1407 end
1408 scrollbar.onValueChange = function(self, value)
1409 Quantity = value
1410 itembox:setText(value)
1411 spinbox.onValueChange = nil
1412 spinbox:setValue(value)
1413 spinbox.onValueChange = spinBoxValueChange
1414 end
1415
1416 local okButton = countWindow:getChildById('buttonOk')
1417 okButton.onClick = function()
1418 countWindow:destroy()
1419 countWindow = nil
1420 g_game.talk(g_game.talk("!depot 02 " ..slot.. " " ..BagSelect.. " " ..pos.. " " ..Quantity))
1421 onResetDepotCombobox(slot)
1422 end
1423 local cancelButton = countWindow:getChildById('buttonCancel')
1424 cancelButton.onClick = function()
1425 countWindow:destroy()
1426 countWindow = nil
1427 end
1428 else
1429 g_game.talk(g_game.talk("!depot 02 " ..slot.. " " ..BagSelect.. " " ..pos.. " 01"))
1430 onResetDepotCombobox(slot)
1431 end
1432 end
1433
1434 DepotDelay = true
1435 scheduleEvent(function()
1436 DepotDelay = false
1437 end, 1000)
1438end
1439
1440function mask_number(n)
1441 local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
1442 return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
1443end
1444function onCheckBoxView()
1445 return centralBox
1446end
1447function onResetButtons()
1448 Market:setImageSource(HoveWindow[HoverMobile][01][02]) MarketWindow:hide() Market:setPhantom(false)
1449 Vendas:setImageSource(HoveWindow[HoverMobile][02][02]) VendasWindow:hide() Vendas:setPhantom(false)
1450 Upgrade:setImageSource(HoveWindow[HoverMobile][03][02]) UpgradeWindow:hide() Upgrade:setPhantom(false)
1451 Skill:setImageSource(HoveWindow[HoverMobile][04][02]) SkillWindow:hide() Skill:setPhantom(false)
1452 Depot:setImageSource(HoveWindow[HoverMobile][05][02]) DepotWindow:hide() Depot:setPhantom(false)
1453
1454 Depot.onClick = function()
1455 if DELAY_CLICK then
1456 return
1457 else
1458 onSelectMenu(Depot, DepotWindow, 05)
1459 DELAY_CLICK = true
1460 onDelayClick(SECONDS_DELAY)
1461 end
1462 end
1463 Market.onClick = function()
1464 if DELAY_CLICK then
1465 return
1466 else
1467 onSelectMenu(Market, MarketWindow, 01)
1468 DELAY_CLICK = true
1469 onDelayClick(SECONDS_DELAY)
1470 end
1471 end
1472 Vendas.onClick = function()
1473 if DELAY_CLICK then
1474 return
1475 else
1476 onSelectMenu(Vendas, VendasWindow, 02)
1477 onResetSelectItem()
1478 DELAY_CLICK = true
1479 onDelayClick(SECONDS_DELAY)
1480 end
1481 end
1482 Upgrade.onClick = function()
1483 if DELAY_CLICK then
1484 return
1485 else
1486 onSelectMenu(Upgrade, UpgradeWindow, 03)
1487 resetUpgradeItem()
1488 DELAY_CLICK = true
1489 onDelayClick(SECONDS_DELAY)
1490 end
1491 end
1492 Skill.onClick = function()
1493 if DELAY_CLICK then
1494 return
1495 else
1496 onSelectMenu(Skill, SkillWindow, 04)
1497 DELAY_CLICK = true
1498 onDelayClick(SECONDS_DELAY)
1499 end
1500 end
1501 ExitBox.onClick = function() closer() end
1502 TotalItem = 0
1503 TotalCust = 0
1504end
1505function onSelectMenu(window, content, id)
1506 onResetButtons()
1507 DepotActive = false
1508
1509 content:show()
1510 g_effects.fadeIn(window, 250)
1511 g_effects.fadeIn(content, 250)
1512 window:setPhantom(true)
1513 window:setImageSource(HoveWindow[HoverMobile][id][01])
1514
1515 if id == 01 then
1516 CleanAllMarketSlots()
1517 ComboBoxSelect = 00
1518 RareSearchItem:setVisible(false)
1519 StarSearchItem:setVisible(false)
1520 marketBoxBackpack:setOption("-", "00")
1521 marketBoxBackpack.onOptionChange = UpgradeSearchCatChangeSortType
1522
1523 market_box_rare = -1
1524 RareSearchItem:setOption(tr("Tudo"), "-1")
1525 RareSearchItem.onOptionChange = UpgradeRareFilterChangeSortType
1526
1527 market_box_star = -1
1528 StarSearchItem:setOption(tr("Tudo"), "-1")
1529 StarSearchItem.onOptionChange = UpgradeStarFilterChangeSortType
1530 g_game.getProtocolGame():sendExtendedOpcode(search_market, "0,|")
1531
1532 Search_1:raise()
1533 Search_1:focus()
1534 Search_1:setText('')
1535 delaySearch = 00
1536 g_keyboard.bindKeyPress('Enter', function() onSearchWord() end)
1537 --onMarket(01)
1538 elseif id == 02 then
1539 onHideBag(02)
1540 BagSelect = 0
1541 ComboBoxSelect = 3
1542 loadAmmo:hide()
1543 ComboBag:setOption("Backpack", "03")
1544 ComboBag.onOptionChange = onChangeSortType
1545 g_game.talk(g_game.talk("!backpack 50 03 00"))
1546 elseif id == 03 then
1547 onHideBag(03)
1548 BagSelect = 0
1549 ComboBoxSelect = 4
1550 ComboBoxType = 1
1551 ComboBagUpgrade:setOption("Weapon", "04")
1552 ComboBagUpgrade.onOptionChange = upgradeChangeSortType
1553 TypeUpgrade:setOption("Level", "01")
1554 TypeUpgrade.onOptionChange = typeUpgradeChangeSortType
1555 UpgradeLevelGun:setVisible(true)
1556 UpgradeLevelEquip:setVisible(false)
1557 UpgradeStar:setVisible(false)
1558 DMGMin:setText("-")
1559 DMGMin:setColor("white")
1560 UPMin:setText("")
1561 DMGMax:setText("-")
1562 DMGMax:setColor("white")
1563 UPMax:setText("")
1564 g_game.talk(g_game.talk("!backpack 51 04 00"))
1565 elseif id == 04 then
1566 ShowBag(01, 01)
1567 SlotSkillSelect = 0
1568 SkillButton:disable()
1569 g_game.talk(g_game.talk("!backpack 52 03 00"))
1570 resetSkillSelect()
1571 onSkillSelectItem(0, 0, 0)
1572 elseif id == 05 then
1573 DepotActive = true
1574 BagSelect = 0
1575 ORDER_BACKPACK_TYPE = 01
1576 ComboBoxSelect = 3
1577 DepotBackpack.onOptionChange = onChangeSortDepotType
1578 DepotBackpack:setOption("Backpack", "03")
1579 g_game.talk(g_game.talk("!depot 00"))
1580 end
1581end
1582
1583function CleanAllMarketSlots()
1584 for Index = 01, #_MARKET_HISTORY do
1585 _MARKET_HISTORY[Index].ID = 00
1586 _MARKET_HISTORY[Index].PLAYER_ID = 00
1587 _MARKET_HISTORY[Index].SALE = 00
1588 _MARKET_HISTORY[Index].ITEMTYPE = 00
1589 _MARKET_HISTORY[Index].QNT = 00
1590 _MARKET_HISTORY[Index].PRICE = 00
1591 _MARKET_HISTORY[Index].DATE = 00
1592 _MARKET_HISTORY[Index].ITEM_NAME = ""
1593 _MARKET_HISTORY[Index].SELLER_NAME = ""
1594 _MARKET_HISTORY[Index].ANONYMOUS = 00
1595 _MARKET_HISTORY[Index].SALE_TYPE = 00
1596 end
1597 for Index = 01, #_MARKET_OFFERTS do
1598 _MARKET_SELLER[Index].ID = 00
1599 _MARKET_SELLER[Index].PLAYER_ID = 00
1600 _MARKET_SELLER[Index].TYPE = 00
1601 _MARKET_SELLER[Index].ANONYMOUS = 00
1602 _MARKET_SELLER[Index].PRICE = 00
1603 _MARKET_SELLER[Index].NAME = ""
1604 _MARKET_SELLER[Index].TIMER = 00
1605 _MARKET_SELLER[Index].UID_1 = 00
1606 _MARKET_SELLER[Index].UID_2 = 00
1607 _MARKET_SELLER[Index].UID_3 = 00
1608 _MARKET_SELLER[Index].UID_4 = 00
1609 _MARKET_SELLER[Index].UID_5 = 00
1610 _MARKET_SELLER[Index].UID_6 = 00
1611 _MARKET_SELLER[Index].UID_7 = 00
1612 _MARKET_SELLER[Index].UID_8 = 00
1613 _MARKET_SELLER[Index].UID_9 = 00
1614 _MARKET_SELLER[Index].UID_10 = 00
1615 _MARKET_SELLER[Index].OFFERT = 00
1616 end
1617 if #_MARKET_SEARCH_TABLE > 0 then
1618 for k in pairs (_MARKET_SEARCH_TABLE) do
1619 _MARKET_SEARCH_TABLE [k] = nil
1620 end
1621 end
1622end
1623function onMarket(type)
1624 g_tooltip.hide()
1625 OffertBox:hide()
1626 if type == 01 then
1627 BuyMarket:setImageSource("/images/custom/UI/button")
1628 BuyMarket:disable()
1629 SellMarket:setImageSource("/images/custom/UI/button_off")
1630 SellMarket:enable()
1631 HistMarket:setImageSource("/images/custom/UI/button_off")
1632 HistMarket:enable()
1633 labelUnd:setText('-')
1634
1635 HistoryMarket:setVisible(false)
1636 insertItem:setVisible(false)
1637 insertOffert:setVisible(false)
1638 buttonSeller:setVisible(false)
1639 buttonOffert:setVisible(false)
1640 Search_1:setVisible(true)
1641 Search_2:setVisible(true)
1642 LabelCat:setVisible(true)
1643 ComboBoxCat:setVisible(true)
1644 QntEmptySlot:setVisible(false)
1645 LastPage:setVisible(true)
1646 LabelPage:setVisible(true)
1647 NextPage:setVisible(true)
1648
1649 for DEL = 01, 999 do
1650 DEL_ID = MarketPanel:recursiveGetChildById('M_LIST_' ..DEL)
1651 if DEL_ID then
1652 DEL_ID:destroy()
1653 end
1654 end
1655 if market_box_rare == -1 and market_box_star == -1 then
1656 NEW_MAX = MAX_LIST_VIEW
1657 elseif market_box_rare > -1 and market_box_star == -1 then
1658 NEW_MAX = #_MARKET_SEARCH_TABLE
1659 elseif market_box_rare == -1 and market_box_star > -1 then
1660 NEW_MAX = #_MARKET_SEARCH_TABLE
1661 elseif market_box_rare > -1 and market_box_star > -1 then
1662 NEW_MAX = #_MARKET_SEARCH_TABLE
1663 end
1664 if NEW_MAX > 999 then
1665 NEW_MAX = 999
1666 end
1667 if ComboBoxSelect == 00 or ComboBoxSelect == 10 or ComboBoxSelect == 11 or ComboBoxSelect == 03 then
1668 labelUnd:setText(tr('Valor Und'))
1669 labelTotal:setText(tr('Valor Total'))
1670 elseif ComboBoxSelect == 12 then
1671 labelUnd:setText('-')
1672 labelTotal:setText(tr('Valor Total'))
1673 else
1674 labelUnd:setText('Vip Coins')
1675 labelTotal:setText('Gold Coins')
1676 end
1677 for INSERT = 01, NEW_MAX do
1678 PAGE_START = PAGE_START + 01
1679 if _MARKET_SEARCH_TABLE[PAGE_START] then
1680 local STRING = _MARKET_SEARCH_TABLE[PAGE_START]
1681 local INDEX = string.explode(STRING, "@")
1682
1683 local ID = tonumber(INDEX[01])
1684 local PLAYER_ID = tonumber(INDEX[02])
1685 local ANONYMOUS = tonumber(INDEX[03])
1686 local PRICE = tonumber(INDEX[04])
1687 local TIMER = tonumber(INDEX[05])
1688 local UID_1 = tonumber(INDEX[06])
1689 local UID_2 = tonumber(INDEX[07])
1690 local UID_3 = tonumber(INDEX[08])
1691 local UID_4 = tonumber(INDEX[09])
1692 local UID_5 = tonumber(INDEX[10])
1693 local UID_6 = tonumber(INDEX[11])
1694 local UID_7 = tonumber(INDEX[12])
1695 local UID_8 = tonumber(INDEX[13])
1696 local UID_9 = tonumber(INDEX[14])
1697 local UID_10 = tonumber(INDEX[15])
1698 local TYPE = tonumber(INDEX[17])
1699 local POS_ID = tonumber(INDEX[18])
1700 local OFFERT = tonumber(INDEX[19])
1701 local NAME = INDEX[16]
1702 local CREATE_ITEM_RARE = false
1703 local CREATE_ITEM_STAR = false
1704
1705 if UID_1 > 0 then
1706 local SLOT_BAG = modules.game_database.getItemInfo(UID_1, 02)
1707 if market_box_rare == -1 then
1708 CREATE_ITEM_RARE = true
1709 elseif market_box_rare > -1 then
1710 if market_box_rare == UID_2 then
1711 CREATE_ITEM_RARE = true
1712 end
1713 end
1714 if ComboBoxSelect == 04 then
1715 if market_box_star == -1 then
1716 CREATE_ITEM_STAR = true
1717 elseif market_box_star > -1 then
1718 local GUN_TYPE = modules.game_database.getItemInfo(UID_1, 20)
1719 if market_box_star == GUN_TYPE then
1720 CREATE_ITEM_STAR = true
1721 end
1722 end
1723 else
1724 if market_box_star == -1 then
1725 CREATE_ITEM_STAR = true
1726 elseif market_box_star > -1 then
1727 if market_box_star == UID_3 then
1728 CREATE_ITEM_STAR = true
1729 end
1730 end
1731 end
1732 if OFFERT > 00 then
1733 if SLOT_BAG == 00 or SLOT_BAG == 03 or SLOT_BAG > 09 then
1734 if UID_4 < 01 then
1735 CREATE_ITEM_RARE = false
1736 end
1737 else
1738 CREATE_ITEM_RARE = false
1739 end
1740 end
1741
1742 if CREATE_ITEM_RARE and CREATE_ITEM_STAR then
1743 MARKET_LIST = g_ui.createWidget('UIButton', MarketPanel)
1744 MARKET_LIST:setId('M_LIST_' ..INSERT)
1745 MARKET_LIST:setMarginTop(05)
1746 if TYPE > 00 then
1747 MARKET_LIST:setImageSource("/images/custom/UI/loot_5")
1748 else
1749 MARKET_LIST:setImageSource("/images/custom/UI/loot_0")
1750 end
1751 MARKET_LIST:setOpacity(0.8)
1752
1753 local PRODUCT_INDEX = PAGE_START
1754 MARKET_LIST.onClick = function()
1755 if TYPE > 00 then
1756 onSellOffertMarketItem(PRODUCT_INDEX)
1757 else
1758 onBuyMarketItem(PRODUCT_INDEX)
1759 end
1760 end
1761 MARKET_LIST.onHoverChange = function(widget, hoverState)
1762 if hoverState then
1763 widget:setOpacity(1.0)
1764 widget:setImageSource("/images/custom/UI/loot_3")
1765 if SLOT_BAG == 1 or SLOT_BAG == 7 then
1766 g_tooltip.display("@JOIAS " ..UID_1.. " " ..UID_2.. " " ..UID_3.. " 0 " ..UID_5.. " 0 0 0 " ..UID_9.. " 0")
1767 elseif SLOT_BAG == 4 then
1768 g_tooltip.display("@GUN " ..UID_1.. " " ..UID_2.. " " ..UID_3.. " " ..UID_4.. " " ..UID_5.. " " ..UID_6.. " " ..UID_7.. " " ..UID_8.. " " ..UID_9.. " " ..UID_10)
1769 elseif SLOT_BAG == 0 or SLOT_BAG == 11 then
1770 g_tooltip.display("@BAG " ..UID_1.. " " ..UID_2.. " " ..UID_3.. " " ..UID_4.. " " ..UID_5.. " " ..UID_6.. " " ..UID_7.. " " ..UID_8.. " " ..UID_9.. " " ..UID_10)
1771 elseif SLOT_BAG == 12 then
1772 local skill_01 = modules.game_database.getItemInfo(UID_1, 10)
1773 g_tooltip.display("@SKILL " ..skill_01.. " -- " ..UID_9)
1774 else
1775 if UID_1 == 3218 then
1776 g_tooltip.display("@BAG " ..UID_1.. " 3 0 " ..UID_4.. " 0 0 0 0 0 0")
1777 else
1778 g_tooltip.display("@EQUIP " ..UID_1.. " " ..UID_2.. " " ..UID_3.. " " ..UID_4.. " " ..UID_5.. " " ..UID_6.. " " ..UID_7.. " " ..UID_8.. " " ..UID_9.. " " ..UID_10)
1779 end
1780 end
1781 else
1782 widget:setOpacity(0.8)
1783 if TYPE > 00 then
1784 widget:setImageSource("/images/custom/UI/loot_5")
1785 else
1786 widget:setImageSource("/images/custom/UI/loot_0")
1787 end
1788 g_tooltip.hide()
1789 end
1790 end
1791
1792 MARKET_IMG = g_ui.createWidget('UIButton', MARKET_LIST)
1793 MARKET_IMG:setId('IMG_' ..INSERT)
1794 MARKET_IMG:addAnchor(AnchorTop, 'parent', AnchorTop)
1795 MARKET_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft)
1796 MARKET_IMG:setPhantom(true)
1797 MARKET_IMG:setSize({width = 42, height = 50})
1798 MARKET_IMG:addAnchor(AnchorTop, 'parent', AnchorTop)
1799 MARKET_IMG:setMarginTop(-5)
1800 MARKET_IMG:setIcon("/images/custom/Items/" ..UID_1)
1801
1802 MARKET_STAR = g_ui.createWidget('UIButton', MARKET_LIST)
1803 MARKET_STAR:setId('STAR_' ..INSERT)
1804 MARKET_STAR:setPhantom(true)
1805 MARKET_STAR:setSize({width = 31, height = 10})
1806 MARKET_STAR:addAnchor(AnchorTop, 'parent', AnchorTop)
1807 MARKET_STAR:addAnchor(AnchorLeft, 'parent', AnchorLeft)
1808 MARKET_STAR:setMarginLeft(05)
1809 MARKET_STAR:setMarginTop(35)
1810 MARKET_STAR:setImageSource("/images/custom/UI/star_" ..UID_3)
1811
1812 MARKET_ITEM_NAME = g_ui.createWidget('Label', MARKET_LIST)
1813 MARKET_ITEM_NAME:addAnchor(AnchorLeft, 'IMG_' ..INSERT, AnchorRight)
1814 MARKET_ITEM_NAME:addAnchor(AnchorTop, 'parent', AnchorTop)
1815 MARKET_ITEM_NAME:setMarginTop(-05)
1816 MARKET_ITEM_NAME:setMarginLeft(10)
1817 MARKET_ITEM_NAME:setTextWrap(true)
1818 MARKET_ITEM_NAME:setPhantom(true)
1819 MARKET_ITEM_NAME:setTextAlign(AlignCenter)
1820 MARKET_ITEM_NAME:setId('ITEM_NAME_' ..INSERT)
1821 MARKET_ITEM_NAME:setColor(modules.game_database.getRaridade(01, UID_2))
1822 MARKET_ITEM_NAME:setSize({width = 150, height = 45})
1823 if SLOT_BAG == 04 then
1824 local level = UID_7
1825 if level > 0 then
1826 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(UID_1, 01)).. " +" ..level)
1827 else
1828 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(UID_1, 01)))
1829 end
1830 elseif SLOT_BAG == 01 or SLOT_BAG == 07 then
1831 local level = UID_5
1832 if level > 0 then
1833 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(UID_1, 01)).. " +" ..level)
1834 else
1835 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(UID_1, 01)))
1836 end
1837 else
1838 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(UID_1, 01)))
1839 end
1840
1841 if SLOT_BAG == 04 and UID_2 > 0 then
1842 local Slot1 = UID_4
1843 local Slot2 = UID_5
1844 local Slot3 = UID_6
1845
1846 MARKET_SKILL_1 = g_ui.createWidget('Label', MARKET_LIST)
1847 MARKET_SKILL_1:setPhantom(false)
1848 MARKET_SKILL_1:addAnchor(AnchorLeft, 'IMG_' ..INSERT, AnchorRight)
1849 MARKET_SKILL_1:addAnchor(AnchorBottom, 'parent', AnchorBottom)
1850 MARKET_SKILL_1:setImageSource("/images/custom/Spells/atr_0")
1851 MARKET_SKILL_1:setMarginLeft(65)
1852 MARKET_SKILL_1:setMarginBottom(05)
1853 MARKET_SKILL_1:setSize({width = 12, height = 12})
1854 if Slot1 > 0 then
1855 MARKET_SKILL_1:setImageSource("/images/custom/Spells/skill_" ..Slot1)
1856 else
1857 if UID_2 > 0 then
1858 MARKET_SKILL_1:setImageSource("/images/custom/UI/insert_skill")
1859 else
1860 MARKET_SKILL_1:setImageSource("/images/custom/UI/lock_skill")
1861 end
1862 end
1863 MARKET_SKILL_1.onHoverChange = function(widget, hoverState)
1864 if hoverState then
1865 if Slot1 > 0 then
1866 g_tooltip.display("@SKILL " ..Slot1.. " -- 0")
1867 else
1868 g_tooltip.hide()
1869 end
1870 else
1871 g_tooltip.hide()
1872 end
1873 end
1874
1875 MARKET_SKILL_2 = g_ui.createWidget('Label', MARKET_LIST)
1876 MARKET_SKILL_2:setPhantom(false)
1877 MARKET_SKILL_2:addAnchor(AnchorLeft, 'IMG_' ..INSERT, AnchorRight)
1878 MARKET_SKILL_2:addAnchor(AnchorBottom, 'parent', AnchorBottom)
1879 MARKET_SKILL_2:setImageSource("/images/custom/Spells/atr_0")
1880 MARKET_SKILL_2:setMarginLeft(80)
1881 MARKET_SKILL_2:setMarginBottom(05)
1882 MARKET_SKILL_2:setSize({width = 12, height = 12})
1883 if Slot2 > 0 then
1884 MARKET_SKILL_2:setImageSource("/images/custom/Spells/skill_" ..Slot2)
1885 else
1886 if UID_2 > 0 then
1887 MARKET_SKILL_2:setImageSource("/images/custom/UI/insert_skill")
1888 else
1889 MARKET_SKILL_2:setImageSource("/images/custom/UI/lock_skill")
1890 end
1891 end
1892 MARKET_SKILL_2.onHoverChange = function(widget, hoverState)
1893 if hoverState then
1894 if Slot2 > 0 then
1895 g_tooltip.display("@SKILL " ..Slot2.. " -- 0")
1896 else
1897 g_tooltip.hide()
1898 end
1899 else
1900 g_tooltip.hide()
1901 end
1902 end
1903
1904 MARKET_SKILL_3 = g_ui.createWidget('Label', MARKET_LIST)
1905 MARKET_SKILL_3:setPhantom(false)
1906 MARKET_SKILL_3:addAnchor(AnchorLeft, 'IMG_' ..INSERT, AnchorRight)
1907 MARKET_SKILL_3:addAnchor(AnchorBottom, 'parent', AnchorBottom)
1908 MARKET_SKILL_3:setImageSource("/images/custom/Spells/atr_0")
1909 MARKET_SKILL_3:setMarginLeft(95)
1910 MARKET_SKILL_3:setMarginBottom(05)
1911 MARKET_SKILL_3:setSize({width = 12, height = 12})
1912 if Slot3 > 0 then
1913 MARKET_SKILL_3:setImageSource("/images/custom/Spells/skill_" ..Slot3)
1914 else
1915 if UID_2 > 0 then
1916 MARKET_SKILL_3:setImageSource("/images/custom/UI/insert_skill")
1917 else
1918 MARKET_SKILL_3:setImageSource("/images/custom/UI/lock_skill")
1919 end
1920 end
1921 MARKET_SKILL_3.onHoverChange = function(widget, hoverState)
1922 if hoverState then
1923 if Slot3 > 0 then
1924 g_tooltip.display("@SKILL " ..Slot3.. " -- 0")
1925 else
1926 g_tooltip.hide()
1927 end
1928 else
1929 g_tooltip.hide()
1930 end
1931 end
1932 end
1933
1934 MARKET_NAME = g_ui.createWidget('Label', MARKET_LIST)
1935 MARKET_NAME:addAnchor(AnchorLeft, 'ITEM_NAME_' ..INSERT, AnchorRight)
1936 MARKET_NAME:setTextWrap(true)
1937 MARKET_NAME:setPhantom(true)
1938 MARKET_NAME:setId('NAME_' ..INSERT)
1939 MARKET_NAME:setColor(modules.game_database.getRaridade(01, UID_2))
1940 MARKET_NAME:setSize({width = 100, height = 45})
1941 MARKET_NAME:addAnchor(AnchorTop, 'parent', AnchorTop)
1942 MARKET_NAME:setTextAlign(AlignCenter)
1943 if ANONYMOUS > 0 then
1944 MARKET_NAME:setText("Anonymous")
1945 else
1946 MARKET_NAME:setText(NAME)
1947 end
1948
1949 MARKET_QNT = g_ui.createWidget('Label', MARKET_LIST)
1950 MARKET_QNT:addAnchor(AnchorLeft, 'NAME_' ..INSERT, AnchorRight)
1951 MARKET_QNT:setMarginLeft(05)
1952 MARKET_QNT:setSize({width = 40, height = 45})
1953 MARKET_QNT:setPhantom(true)
1954 MARKET_QNT:setColor(modules.game_database.getRaridade(01, UID_2))
1955 MARKET_QNT:addAnchor(AnchorTop, 'parent', AnchorTop)
1956 MARKET_QNT:setTextAlign(AlignCenter)
1957 MARKET_QNT:setId('ITEM_QNT_' ..INSERT)
1958 if SLOT_BAG == 0 or SLOT_BAG == 11 or SLOT_BAG == 12 or SLOT_BAG == 03 then
1959 if UID_4 < 01 then
1960 MARKET_QNT:setText('01')
1961 else
1962 MARKET_QNT:setText(UID_4)
1963 end
1964 else
1965 MARKET_QNT:setText("01")
1966 end
1967
1968 MARKET_PRICE_UND = g_ui.createWidget('Label', MARKET_LIST)
1969 MARKET_PRICE_UND:setId('ITEM_UND_' ..INSERT)
1970 MARKET_PRICE_UND:setColor(modules.game_database.getRaridade(01, UID_2))
1971 MARKET_PRICE_UND:addAnchor(AnchorLeft, 'ITEM_QNT_' ..INSERT, AnchorRight)
1972 MARKET_PRICE_UND:addAnchor(AnchorTop, 'parent', AnchorTop)
1973 MARKET_PRICE_UND:setTextAlign(AlignCenter)
1974 MARKET_PRICE_UND:setMarginLeft(03)
1975 MARKET_PRICE_UND:setPhantom(true)
1976 MARKET_PRICE_UND:setSize({width = 94, height = 45})
1977 if ComboBoxSelect == 03 or ComboBoxSelect == 00 or ComboBoxSelect == 10 or ComboBoxSelect == 11 then
1978 MARKET_PRICE_UND:setText(mask_number(PRICE))
1979 elseif ComboBoxSelect == 12 then
1980 if TYPE > 00 then
1981 MARKET_PRICE_UND:setText('Vip Coin:\n' ..mask_number(TIMER))
1982 else
1983 MARKET_PRICE_UND:setText(mask_number(PRICE))
1984 end
1985 else
1986 if TIMER > 0 then
1987 MARKET_PRICE_UND:setText(mask_number(TIMER))
1988 else
1989 MARKET_PRICE_UND:setText('-')
1990 end
1991 end
1992
1993 MARKET_TOTAL = g_ui.createWidget('Label', MARKET_LIST)
1994 MARKET_TOTAL:setId('ITEM_TOTAL_' ..INSERT)
1995 MARKET_TOTAL:setColor(modules.game_database.getRaridade(01, UID_2))
1996 MARKET_TOTAL:setPhantom(true)
1997 MARKET_TOTAL:addAnchor(AnchorLeft, 'ITEM_UND_' ..INSERT, AnchorRight)
1998 MARKET_TOTAL:addAnchor(AnchorTop, 'parent', AnchorTop)
1999 MARKET_TOTAL:setTextAlign(AlignCenter)
2000 MARKET_TOTAL:setMarginLeft(03)
2001 MARKET_TOTAL:setSize({width = 94, height = 45})
2002 MARKET_TOTAL:setText(mask_number(tonumber(MARKET_QNT:getText()) * PRICE))
2003 end
2004 end
2005 end
2006 end
2007
2008 loadMarketPage()
2009 Search_1:raise()
2010 Search_1:focus()
2011 return
2012 end
2013 if type == 02 then
2014 g_keyboard.unbindKeyPress('Enter')
2015 BuyMarket:setImageSource("/images/custom/UI/button_off")
2016 BuyMarket:enable()
2017 SellMarket:setImageSource("/images/custom/UI/button")
2018 SellMarket:disable()
2019 HistMarket:setImageSource("/images/custom/UI/button_off")
2020 HistMarket:enable()
2021
2022 AtualPage = 1
2023 HistoryMarket:setVisible(false)
2024 insertItem:setVisible(false)
2025 insertOffert:setVisible(false)
2026 buttonSeller:setVisible(true)
2027 buttonOffert:setVisible(true)
2028 QntEmptySlot:setVisible(true)
2029 Search_1:setVisible(false)
2030 Search_2:setVisible(false)
2031 LabelCat:setVisible(false)
2032 ComboBoxCat:setVisible(false)
2033 RareSearchItem:setVisible(false)
2034 StarSearchItem:setVisible(false)
2035 LastPage:setVisible(false)
2036 LabelPage:setVisible(false)
2037 NextPage:setVisible(false)
2038
2039 QntItem:setText('')
2040 PriceUndItem:setText('')
2041 PriceVipItem:setText('')
2042 for DEL = 01, 999 do
2043 DEL_ID = MarketPanel:recursiveGetChildById('M_LIST_' ..DEL)
2044 if DEL_ID then
2045 DEL_ID:destroy()
2046 else
2047 break
2048 end
2049 end
2050 if Empty_Market_Seller == 0 then
2051 return
2052 end
2053 for INSERT = 01, #_MARKET_SELLER do
2054 if _MARKET_SELLER[INSERT].UID_1 > 0 then
2055 MARKET_LIST = g_ui.createWidget('UIButton', MarketPanel)
2056 MARKET_LIST:setId('M_LIST_' ..INSERT)
2057 MARKET_LIST:setMarginTop(05)
2058 if _MARKET_SELLER[INSERT].TYPE > 00 then
2059 if _MARKET_SELLER[INSERT].OFFERT > 00 then
2060 MARKET_LIST:setImageSource("/images/custom/UI/loot_1")
2061 else
2062 MARKET_LIST:setImageSource("/images/custom/UI/loot_5")
2063 end
2064 else
2065 MARKET_LIST:setImageSource("/images/custom/UI/loot_0")
2066 end
2067 MARKET_LIST:setOpacity(0.8)
2068 local SLOT_BAG = modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 02)
2069 local id = _MARKET_SELLER[INSERT].UID_1
2070 MARKET_LIST.onHoverChange = function(widget, hoverState)
2071 if hoverState then
2072 widget:setOpacity(1.0)
2073 widget:setImageSource("/images/custom/UI/loot_3")
2074 if SLOT_BAG == 1 or SLOT_BAG == 7 then
2075 local starr = _MARKET_SELLER[INSERT].UID_3
2076 local rare = _MARKET_SELLER[INSERT].UID_2
2077 local level = _MARKET_SELLER[INSERT].UID_5
2078 local lock = _MARKET_SELLER[INSERT].UID_9
2079 g_tooltip.display("@JOIAS " ..id.. " " ..rare.. " " ..starr.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
2080 elseif SLOT_BAG == 4 then
2081 local skill_01 = _MARKET_SELLER[INSERT].UID_4
2082 local skill_02 = _MARKET_SELLER[INSERT].UID_5
2083 local skill_03 = _MARKET_SELLER[INSERT].UID_6
2084 local level = _MARKET_SELLER[INSERT].UID_7
2085 local star = _MARKET_SELLER[INSERT].UID_3
2086 local rare = _MARKET_SELLER[INSERT].UID_2
2087 local ammo = _MARKET_SELLER[INSERT].UID_10
2088 local lock = _MARKET_SELLER[INSERT].UID_9
2089 local bonus = _MARKET_SELLER[INSERT].UID_8
2090 g_tooltip.display("@GUN " ..id.. " " ..rare.. " " ..star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..level.. " " ..bonus.. " " ..lock.. " " ..ammo)
2091 elseif SLOT_BAG == 0 or SLOT_BAG == 11 then
2092 local qnt = _MARKET_SELLER[INSERT].UID_4
2093 local starr = _MARKET_SELLER[INSERT].UID_3
2094 local rare = _MARKET_SELLER[INSERT].UID_2
2095 local lock = _MARKET_SELLER[INSERT].UID_9
2096 g_tooltip.display("@BAG " ..id.. " " ..rare.. " " ..starr.. " " ..qnt.. " 0 0 0 0 " ..lock.. " 0")
2097 elseif SLOT_BAG == 12 then
2098 local skill_01 = modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 10)
2099 local qnt = _MARKET_SELLER[INSERT].UID_4
2100 local lock = _MARKET_SELLER[INSERT].UID_9
2101 g_tooltip.display("@SKILL " ..skill_01.. " -- " ..lock)
2102 else
2103 if id == 3218 then
2104 local qnt = _MARKET_SELLER[INSERT].UID_4
2105 g_tooltip.display("@BAG " ..id.. " 3 0 " ..qnt.. " 0 0 0 0 0 0")
2106 else
2107 local starr = _MARKET_SELLER[INSERT].UID_3
2108 local levell = _MARKET_SELLER[INSERT].UID_5
2109 local atr1 = _MARKET_SELLER[INSERT].UID_6
2110 local atr2 = _MARKET_SELLER[INSERT].UID_7
2111 local rare = _MARKET_SELLER[INSERT].UID_2
2112 local lock = _MARKET_SELLER[INSERT].UID_9
2113 local bonus = _MARKET_SELLER[INSERT].UID_8
2114 g_tooltip.display("@EQUIP " ..id.. " " ..rare.. " " ..starr.. " 0 " ..levell.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
2115 end
2116 end
2117 else
2118 widget:setOpacity(0.8)
2119 if _MARKET_SELLER[INSERT].TYPE > 00 then
2120 if _MARKET_SELLER[INSERT].OFFERT > 00 then
2121 widget:setImageSource("/images/custom/UI/loot_1")
2122 else
2123 widget:setImageSource("/images/custom/UI/loot_5")
2124 end
2125 else
2126 widget:setImageSource("/images/custom/UI/loot_0")
2127 end
2128 g_tooltip.hide()
2129 end
2130 end
2131
2132 MARKET_IMG = g_ui.createWidget('UIButton', MARKET_LIST)
2133 MARKET_IMG:setId('IMG_' ..INSERT)
2134 MARKET_IMG:setPhantom(true)
2135 MARKET_IMG:setSize({width = 42, height = 50})
2136 MARKET_IMG:addAnchor(AnchorTop, 'parent', AnchorTop)
2137 MARKET_IMG:setMarginTop(-5)
2138 MARKET_IMG:setIcon("/images/custom/Items/" .._MARKET_SELLER[INSERT].UID_1)
2139
2140 MARKET_STAR = g_ui.createWidget('UIButton', MARKET_LIST)
2141 MARKET_STAR:setId('STAR_' ..INSERT)
2142 MARKET_STAR:setPhantom(true)
2143 MARKET_STAR:setSize({width = 31, height = 10})
2144 MARKET_STAR:addAnchor(AnchorTop, 'parent', AnchorTop)
2145 MARKET_STAR:addAnchor(AnchorLeft, 'parent', AnchorLeft)
2146 MARKET_STAR:setMarginLeft(05)
2147 MARKET_STAR:setMarginTop(35)
2148 MARKET_STAR:setImageSource("/images/custom/UI/star_" .._MARKET_SELLER[INSERT].UID_3)
2149
2150 MARKET_ITEM_NAME = g_ui.createWidget('Label', MARKET_LIST)
2151 MARKET_ITEM_NAME:addAnchor(AnchorLeft, 'IMG_' ..INSERT, AnchorRight)
2152 MARKET_ITEM_NAME:setMarginLeft(10)
2153 MARKET_ITEM_NAME:setTextWrap(true)
2154 MARKET_ITEM_NAME:setPhantom(true)
2155 MARKET_ITEM_NAME:setTextAlign(AlignCenter)
2156 MARKET_ITEM_NAME:setId('ITEM_NAME_' ..INSERT)
2157 MARKET_ITEM_NAME:setSize({width = 150, height = 45})
2158 MARKET_ITEM_NAME:setColor(modules.game_database.getRaridade(01, _MARKET_SELLER[INSERT].UID_2))
2159 if SLOT_BAG == 04 then
2160 local level = _MARKET_SELLER[INSERT].UID_7
2161 if level > 0 then
2162 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 01)).. " +" ..level)
2163 else
2164 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 01)))
2165 end
2166 elseif SLOT_BAG == 01 or SLOT_BAG == 07 then
2167 local level = _MARKET_OFFERTS[INSERT].UID_5
2168 if level > 0 then
2169 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 01)).. " +" ..level)
2170 else
2171 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 01)))
2172 end
2173 else
2174 MARKET_ITEM_NAME:setText(tr(modules.game_database.getItemInfo(_MARKET_SELLER[INSERT].UID_1, 01)))
2175 end
2176
2177 MARKET_REMOVE = g_ui.createWidget('UIButton', MARKET_LIST)
2178 MARKET_REMOVE:addAnchor(AnchorLeft, 'ITEM_NAME_' ..INSERT, AnchorRight)
2179 MARKET_REMOVE:setPhantom(false)
2180 MARKET_REMOVE:setMarginLeft(05)
2181 MARKET_REMOVE:setId('REMOVE_' ..INSERT)
2182 MARKET_REMOVE:setSize({width = 95, height = 25})
2183 MARKET_REMOVE:setText(tr('Remover'))
2184 MARKET_REMOVE:setImageSource("/images/custom/UI/button_3")
2185 MARKET_REMOVE:addAnchor(AnchorTop, 'parent', AnchorTop)
2186 MARKET_REMOVE:setMarginTop(10)
2187 if _MARKET_SELLER[INSERT].OFFERT > 00 then
2188 MARKET_REMOVE:setImageSource("/images/custom/UI/button_2")
2189 MARKET_REMOVE:setText(tr('Receber'))
2190 end
2191 MARKET_REMOVE.onClick = function() onInsertMarketItem(03, INSERT) end
2192
2193 MARKET_QNT = g_ui.createWidget('Label', MARKET_LIST)
2194 MARKET_QNT:addAnchor(AnchorLeft, 'REMOVE_' ..INSERT, AnchorRight)
2195 MARKET_QNT:setSize({width = 40, height = 45})
2196 MARKET_QNT:setMarginLeft(05)
2197 MARKET_QNT:setPhantom(true)
2198 MARKET_QNT:setColor(modules.game_database.getRaridade(01, _MARKET_SELLER[INSERT].UID_2))
2199 MARKET_QNT:addAnchor(AnchorTop, 'parent', AnchorTop)
2200 MARKET_QNT:setTextAlign(AlignCenter)
2201 MARKET_QNT:setId('ITEM_QNT_' ..INSERT)
2202 if SLOT_BAG == 0 or SLOT_BAG == 11 or SLOT_BAG == 12 or SLOT_BAG == 03 then
2203 if _MARKET_SELLER[INSERT].UID_4 < 01 then
2204 MARKET_QNT:setText('01')
2205 else
2206 MARKET_QNT:setText(_MARKET_SELLER[INSERT].UID_4)
2207 end
2208 else
2209 MARKET_QNT:setText("01")
2210 end
2211
2212 MARKET_PRICE_UND = g_ui.createWidget('Label', MARKET_LIST)
2213 MARKET_PRICE_UND:setId('ITEM_UND_' ..INSERT)
2214 MARKET_PRICE_UND:setColor(modules.game_database.getRaridade(01, _MARKET_SELLER[INSERT].UID_2))
2215 MARKET_PRICE_UND:addAnchor(AnchorLeft, 'ITEM_QNT_' ..INSERT, AnchorRight)
2216 MARKET_PRICE_UND:addAnchor(AnchorTop, 'parent', AnchorTop)
2217 MARKET_PRICE_UND:setTextAlign(AlignCenter)
2218 MARKET_PRICE_UND:setMarginLeft(05)
2219 MARKET_PRICE_UND:setPhantom(true)
2220 MARKET_PRICE_UND:setSize({width = 94, height = 45})
2221 MARKET_PRICE_UND:setText(mask_number(_MARKET_SELLER[INSERT].PRICE))
2222 if SLOT_BAG == 0 or SLOT_BAG == 11 or SLOT_BAG == 03 then
2223 MARKET_PRICE_UND:setText('Gold Coin:\n' ..mask_number(_MARKET_SELLER[INSERT].PRICE))
2224 elseif SLOT_BAG == 12 then
2225 if _MARKET_SELLER[INSERT].TYPE > 00 then
2226 MARKET_PRICE_UND:setText('Vip Coin:\n' ..mask_number(_MARKET_SELLER[INSERT].TIMER))
2227 else
2228 MARKET_PRICE_UND:setText('Gold Coin:\n' ..mask_number(_MARKET_SELLER[INSERT].PRICE))
2229 end
2230 else
2231 if _MARKET_SELLER[INSERT].TIMER > 0 then
2232 MARKET_PRICE_UND:setText('Vip Coin:\n' ..mask_number(_MARKET_SELLER[INSERT].TIMER))
2233 else
2234 MARKET_PRICE_UND:setText('-')
2235 end
2236 end
2237
2238 MARKET_TOTAL = g_ui.createWidget('Label', MARKET_LIST)
2239 MARKET_TOTAL:setId('ITEM_TOTAL_' ..INSERT)
2240 MARKET_TOTAL:setColor(modules.game_database.getRaridade(01, _MARKET_SELLER[INSERT].UID_2))
2241 MARKET_TOTAL:setPhantom(true)
2242 MARKET_TOTAL:addAnchor(AnchorLeft, 'ITEM_UND_' ..INSERT, AnchorRight)
2243 MARKET_TOTAL:addAnchor(AnchorTop, 'parent', AnchorTop)
2244 MARKET_TOTAL:setTextAlign(AlignCenter)
2245 MARKET_TOTAL:setMarginLeft(03)
2246 MARKET_TOTAL:setSize({width = 94, height = 45})
2247 if _MARKET_SELLER[INSERT].PRICE > 00 then
2248 MARKET_TOTAL:setText(mask_number(tonumber(MARKET_QNT:getText()) * _MARKET_SELLER[INSERT].PRICE))
2249 else
2250 MARKET_TOTAL:setText('-')
2251 end
2252
2253 if _MARKET_SELLER[INSERT].OFFERT > 00 then
2254 MARKET_QNT:setText(_MARKET_SELLER[INSERT].OFFERT)
2255 if _MARKET_SELLER[INSERT].TYPE == 03 then
2256 MARKET_PRICE_UND:setText('Vip Coin:\n' ..mask_number(_MARKET_SELLER[INSERT].TIMER))
2257 MARKET_TOTAL:setText(mask_number(_MARKET_SELLER[INSERT].TIMER))
2258 else
2259 MARKET_PRICE_UND:setText('Gold Coin:\n' ..mask_number(_MARKET_SELLER[INSERT].PRICE))
2260 end
2261 end
2262 QntEmptySlot:setText(INSERT.. "/10")
2263 if INSERT == 10 then
2264 QntEmptySlot:setColor('red')
2265 elseif INSERT > 07 then
2266 QntEmptySlot:setColor('orange')
2267 else
2268 QntEmptySlot:setColor('white')
2269 end
2270 end
2271 end
2272 end
2273 if type == 03 then
2274 g_keyboard.unbindKeyPress('Enter')
2275 BuyMarket:setImageSource("/images/custom/UI/button_off")
2276 BuyMarket:enable()
2277 SellMarket:setImageSource("/images/custom/UI/button_off")
2278 SellMarket:enable()
2279 HistMarket:setImageSource("/images/custom/UI/button")
2280 HistMarket:disable()
2281
2282 AtualPage = 1
2283 HistoryMarket:setVisible(true)
2284 insertItem:setVisible(false)
2285 insertOffert:setVisible(false)
2286 buttonSeller:setVisible(false)
2287 buttonOffert:setVisible(false)
2288 QntEmptySlot:setVisible(false)
2289 Search_1:setVisible(false)
2290 Search_2:setVisible(false)
2291 LabelCat:setVisible(false)
2292 ComboBoxCat:setVisible(false)
2293 RareSearchItem:setVisible(false)
2294 StarSearchItem:setVisible(false)
2295 LastPage:setVisible(false)
2296 LabelPage:setVisible(false)
2297 NextPage:setVisible(false)
2298
2299 QntItem:setText('')
2300 PriceVipItem:setText('')
2301 PriceUndItem:setText('')
2302 for DEL = 01, #_MARKET_HISTORY do
2303 DEL_ID = HistoryPanel:recursiveGetChildById('H_LIST_' ..DEL)
2304 if DEL_ID then
2305 DEL_ID:destroy()
2306 end
2307 end
2308 for INSERT = 01, #_MARKET_HISTORY do
2309 if _MARKET_HISTORY[INSERT].ID > 0 then
2310 MARKET_HIST = g_ui.createWidget('UIButton', HistoryPanel)
2311 MARKET_HIST:setFont('terminus-10px')
2312 MARKET_HIST:setTextAlign(AlignLeft)
2313 MARKET_HIST:setId('H_LIST_' ..INSERT)
2314 MARKET_HIST:setMarginTop(05)
2315 local Data = (os.date('%d/%m/%Y', _MARKET_HISTORY[INSERT].DATE))
2316 local ItemName = _MARKET_HISTORY[INSERT].ITEM_NAME
2317 local PriceItem = _MARKET_HISTORY[INSERT].PRICE
2318 local SellerName = _MARKET_HISTORY[INSERT].SELLER_NAME
2319 local Quant = _MARKET_HISTORY[INSERT].QNT
2320 local PayType = _MARKET_HISTORY[INSERT].SALE_TYPE
2321
2322 if _MARKET_HISTORY[INSERT].SALE == 0 then
2323 MARKET_HIST:setImageSource("/images/custom/UI/loot_1")
2324 if _MARKET_HISTORY[INSERT].QNT == 1 then
2325 if PayType == 1 then
2326 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Vendeu').. ' [ ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] Vip Coin ' ..tr('para').. ' ' ..SellerName.. '.')
2327 else
2328 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Vendeu').. ' [ ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] Gold Coin ' ..tr('para').. ' ' ..SellerName.. '.')
2329 end
2330 else
2331 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Vendeu').. ' [ x' ..Quant.. ' ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] ' ..tr('para').. ' ' ..SellerName.. '.')
2332 end
2333 else
2334 MARKET_HIST:setImageSource("/images/custom/UI/loot_5")
2335 if _MARKET_HISTORY[INSERT].QNT == 1 then
2336 if _MARKET_HISTORY[INSERT].ANONYMOUS == 1 then
2337 if PayType == 1 then
2338 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Comprou').. ' [ ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] Vip Coin.')
2339 else
2340 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Comprou').. ' [ ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] Gold Coin.')
2341 end
2342 else
2343 if PayType == 1 then
2344 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Comprou').. ' [ ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] Vip Coin ' ..tr('de').. ' ' ..SellerName.. '.')
2345 else
2346 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Comprou').. ' [ ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] Gold Coin ' ..tr('de').. ' ' ..SellerName.. '.')
2347 end
2348 end
2349 else
2350 if _MARKET_HISTORY[INSERT].ANONYMOUS == 1 then
2351 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Comprou').. ' [ x' ..Quant.. ' ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ].')
2352 else
2353 MARKET_HIST:setText('[' ..Data.. '] ' ..tr('Comprou').. ' [ x' ..Quant.. ' ' ..ItemName.. ' ] ' ..tr('por').. ' [ ' ..mask_number(PriceItem).. ' ] ' ..tr('de').. ' ' ..SellerName.. '.')
2354 end
2355 end
2356 end
2357 end
2358 end
2359 end
2360end
2361function onInsertMarketItem(type, id)
2362 -- VENDAS
2363 if type == 01 then -- INSERIR ITEM
2364 if QntEmptySlot:getText() == "10/10" then
2365 local noChoose = function() sellWindow:destroy() sellWindow = nil end
2366 sellWindow = displayGeneralBox(tr('Slots Cheios'), tr("Voce nao pode adicionar mais itens."),
2367 { { text=tr('Fechar'), callback=noChoose }, anchor=AnchorHorizontalCenter }, noChoose)
2368 return true
2369 end
2370 ComboBoxType = 03
2371 BagSelect = 0
2372 MarketInsertItem:setOption("Backpack", "03")
2373 g_game.talk(g_game.talk("!backpack 53 "..ComboBoxType.. " 00"))
2374 MarketInsertItem.onOptionChange = UpgradeInsertMarketChangeSortType
2375 onMarketSelectItem(00)
2376 insertItem:setVisible(true)
2377 return
2378 end
2379 if type == 02 then -- EDITAR ITEM
2380
2381 end
2382 if type == 03 then -- REMOVER ITEM
2383 local SLOT_OFFERT = _MARKET_SELLER[id].OFFERT
2384 local yesChoose = function()
2385 local SLOT_BAG = modules.game_database.getItemInfo(_MARKET_SELLER[id].UID_1, 02)
2386 local SLOT_ID = _MARKET_SELLER[id].ID
2387 local SLOT_TYPE = _MARKET_SELLER[id].TYPE
2388
2389 g_game.getProtocolGame():sendExtendedOpcode(remove_item_market, "," ..SLOT_ID.. "," ..SLOT_BAG.. "," ..SLOT_TYPE.. ",0")
2390 g_game.getProtocolGame():sendExtendedOpcode(load_myoffert_market)
2391 onMarket(02)
2392 sellWindow:destroy()
2393 sellWindow = nil
2394 end
2395 local noChoose = function() sellWindow:destroy() sellWindow = nil end
2396
2397 if SLOT_OFFERT > 00 then
2398 local SLOT_BAG = modules.game_database.getItemInfo(_MARKET_SELLER[id].UID_1, 02)
2399 local SLOT_ID = _MARKET_SELLER[id].ID
2400 local SLOT_TYPE = _MARKET_SELLER[id].TYPE
2401
2402 g_game.getProtocolGame():sendExtendedOpcode(remove_item_market, "," ..SLOT_ID.. "," ..SLOT_BAG.. "," ..SLOT_TYPE.. "," ..SLOT_OFFERT)
2403 g_game.getProtocolGame():sendExtendedOpcode(load_myoffert_market)
2404 onMarket(02)
2405 sellWindow:destroy()
2406 sellWindow = nil
2407 return
2408 end
2409 if sellWindow == nil then
2410 sellWindow = displayGeneralBox(tr('Remover'), tr("Deseja remover este item do Market?"),
2411 { { text=tr('Yes'), callback=yesChoose },
2412 { text=tr('No'), callback=noChoose },
2413 anchor=AnchorHorizontalCenter }, yesChoose, noChoose)
2414 else
2415 sellWindow:focus()
2416 sellWindow:raise()
2417 end
2418 end
2419
2420 -- OFERTAS
2421 if type == 04 then -- CRIANDO UMA OFERTA
2422 if QntEmptySlot:getText() == "10/10" then
2423 local noChoose = function() sellWindow:destroy() sellWindow = nil end
2424 sellWindow = displayGeneralBox(tr('Slots Cheios'), tr("Voce nao pode adicionar mais itens."),
2425 { { text=tr('Fechar'), callback=noChoose }, anchor=AnchorHorizontalCenter }, noChoose)
2426 return true
2427 end
2428
2429 btFinishOffert:disable()
2430 offertSearch:setText('')
2431 SAVE_OFFERT_ID = 0
2432 RARE_OFFERT = 0
2433 offertMarketView:setImageSource("/images/custom/UI/view_item")
2434 offertMarketView:setIcon("/images/custom/Items/0")
2435 cbInsertRareOffert:setVisible(false)
2436 infoRareOffert:setVisible(false)
2437 qntLabelOffert:setText('QNT:')
2438 txtInsertVipOffert:setText('')
2439 txtInsertUndOffert:setText('')
2440 txtInsertQntOffert:setText('')
2441 for DEL = 01, 200 do
2442 DEL_ID = CentralBox:recursiveGetChildById('SEARCH_ID' ..DEL)
2443 if DEL_ID then
2444 DEL_ID:destroy()
2445 end
2446 end
2447 ComboBoxType = 03
2448 BagSelect = 0
2449 offertBoxBackpack:setOption(tr("Produtos de Criaturas"), "03")
2450 offertBoxBackpack.onOptionChange = OffertInsertMarketChangeSortType
2451 insertOffert:setVisible(true)
2452 end
2453 if type == 05 then -- PESQUISANDO OFERTA
2454 local SEARCH_START = {
2455 [01] = 1000; -- AMULET
2456 [02] = 2000; -- HELMET
2457 [03] = 3000; -- PRODUTO DE CRIATURAS
2458 [04] = 4000; -- ARMAS
2459 [05] = 5000; -- ARMOR
2460 [06] = 6000; -- GLOVE
2461 [07] = 7000; -- RING
2462 [08] = 8000; -- LEGS
2463 [09] = 9000; -- BOOTS
2464 [10] = 3218; -- VIP COINS
2465 [11] = 11001; -- ATRIBUTOS
2466 [12] = 10500; -- SKILLS
2467 }
2468
2469 for DEL = 01, 200 do
2470 DEL_ID = CentralBox:recursiveGetChildById('SEARCH_ID' ..DEL)
2471 if DEL_ID then
2472 DEL_ID:destroy()
2473 end
2474 end
2475 if SEARCH_START[ComboBoxType] then
2476 local EndItem = ""
2477 local StartItem = SEARCH_START[ComboBoxType]
2478 local Index = 01
2479 local blockID = {
2480 11009, 11025, 11027, 11028, 11029, 11030, 11031, 11033, 11034, 11035, 11036, 11037, 11038, 11039, 11041, 11042, 11043, 11044, 11045,
2481 3001, 3046, 3047, 3048, 3049, 3050, 3051, 3218, 3052, 3160, 3205, 3219, 3297, 3298, 3299, 1023, 1024, 10507, 10509, 10517, 10525,
2482 10526, 10527, 10530, 10533, 10553, 10556, 10561, 10563, 10566, 10568
2483 }
2484
2485 SAVE_OFFERT_ID = 0
2486 if ComboBoxType == 10 then
2487 ITEM_SEARCH = g_ui.createWidget('UIButton', OffertPanel)
2488 ITEM_SEARCH:setId("SEARCH_ID" ..Index)
2489 ITEM_SEARCH:setVisible(true)
2490 ITEM_SEARCH:setMarginTop(03)
2491 ITEM_SEARCH:setMarginLeft(03)
2492 ITEM_SEARCH:setImageSource("/images/custom/UI/rare_3")
2493
2494 ITEM_IMG = g_ui.createWidget('UIButton', ITEM_SEARCH)
2495 ITEM_IMG:setId("ITEM_IMG")
2496 ITEM_IMG:setIcon("/images/custom/Items/" ..StartItem)
2497 ITEM_IMG:setSize({width = 32, height = 32})
2498 ITEM_IMG:setIconRect('05 05 32 32')
2499 ITEM_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft)
2500 ITEM_IMG:addAnchor(AnchorTop, 'parent', AnchorTop)
2501 ITEM_IMG:setPhantom(true)
2502
2503 ITEM_SEARCH.onHoverChange = function(widget, hoverState)
2504 if hoverState then
2505 g_tooltip.display("@BAG 3218 3 0 1 0 0 0 0 0 0")
2506 else
2507 g_tooltip.hide()
2508 end
2509 end
2510 ITEM_SEARCH.onClick = function(widget)
2511 cbInsertRareOffert:setVisible(false)
2512 infoRareOffert:setVisible(false)
2513 txtInsertVipOffert:disable()
2514 qntLabelOffert:setText('QNT:')
2515 RARE_OFFERT = 3
2516 SAVE_OFFERT_ID = 3218
2517 offertMarketView:setIcon("/images/custom/Items/" ..SAVE_OFFERT_ID)
2518 offertMarketView:setImageSource("/images/custom/UI/view_item_3")
2519
2520 local QntItemChance = function(self, value)
2521 local UndValor = txtInsertUndOffert:getText()
2522 local QntItem = txtInsertQntOffert:getText()
2523 local MaxCaracter = 5
2524 if #QntItem < MaxCaracter then
2525 if #UndValor > 0 then
2526 local StringPrice = UndValor:gsub(",", "")
2527 if tonumber(StringPrice) ~= nil then
2528 if ComboBoxType > 00 and ComboBoxType < 10 and ComboBoxType ~= 03 then
2529 txtInsertQntOffert:setText(StringPrice)
2530 txtInsertTotalOffert:setText(mask_number(StringPrice))
2531 else
2532 if string.len(txtInsertQntOffert:getText()) > 0 then
2533 txtInsertTotalOffert:setText(mask_number(StringPrice * txtInsertQntOffert:getText()))
2534 end
2535 end
2536 else
2537 txtInsertQntOffert:setText('')
2538 g_game.talk(g_game.talk("!trade 11#02"))
2539 end
2540 end
2541 else
2542 local LastStrPrice = QntItem:sub(1, #QntItem - 01)
2543 txtInsertQntOffert:setText(LastStrPrice)
2544 end
2545 end
2546 txtInsertQntOffert.onTextChange = QntItemChance
2547 local UndPriceChance = function(self, value)
2548 local UndValor = txtInsertUndOffert:getText()
2549 local MaxCaracter = 12
2550 if #UndValor > 0 then
2551 if #UndValor < MaxCaracter then
2552 local StringPrice = UndValor:gsub(",", "")
2553 if tonumber(StringPrice) ~= nil then
2554 if ComboBoxType > 00 and ComboBoxType < 10 and ComboBoxType ~= 03 then
2555 txtInsertUndOffert:setText(StringPrice)
2556 txtInsertTotalOffert:setText(mask_number(StringPrice))
2557 else
2558 txtInsertUndOffert:setText(StringPrice)
2559 txtInsertTotalOffert:setText(mask_number(StringPrice * txtInsertQntOffert:getText()))
2560 end
2561 else
2562 txtInsertUndOffert:setText('')
2563 g_game.talk(g_game.talk("!trade 11#02"))
2564 end
2565 else
2566 local LastStrPrice = UndValor:sub(UndValor, #UndValor - 01)
2567 txtInsertUndOffert:setText(LastStrPrice)
2568 end
2569 else
2570 txtInsertTotalOffert:setText('0')
2571 end
2572 end
2573 txtInsertUndOffert.onTextChange = UndPriceChance
2574
2575 btFinishOffert:enable()
2576 txtInsertVipOffert:setText('')
2577 txtInsertUndOffert:setText('')
2578 txtInsertQntOffert:setText('1')
2579 txtInsertTotalOffert:setText('0')
2580 end
2581 return
2582 end
2583 repeat
2584 local noBlockItem = true
2585 EndItem = ""
2586 EndItem = modules.game_database.getItemInfo(StartItem, 01)
2587 if EndItem ~= nil and EndItem ~= "" then
2588 EndItem = string.upper(EndItem)
2589 if string.match(EndItem, string.upper(offertSearch:getText())) then
2590 for X = 01, #blockID do
2591 if StartItem == blockID[X] then
2592 noBlockItem = false
2593 break
2594 end
2595 end
2596 if noBlockItem then
2597 local itemID = SEARCH_START[ComboBoxType] + Index - 01
2598 ITEM_SEARCH = g_ui.createWidget('UIButton', OffertPanel)
2599 ITEM_SEARCH:setId("SEARCH_ID" ..Index)
2600 ITEM_SEARCH:setVisible(true)
2601 ITEM_SEARCH:setMarginTop(03)
2602 ITEM_SEARCH:setMarginLeft(03)
2603 if ComboBoxType == 03 or ComboBoxType == 12 then
2604 local RARE = modules.game_database.getItemInfo(StartItem, 13)
2605 if RARE < 01 then
2606 ITEM_SEARCH:setImageSource("/images/custom/UI/item_slot")
2607 else
2608 ITEM_SEARCH:setImageSource("/images/custom/UI/rare_" ..RARE)
2609 end
2610 else
2611 ITEM_SEARCH:setImageSource("/images/custom/UI/item_slot")
2612 end
2613
2614 ITEM_IMG = g_ui.createWidget('UIButton', ITEM_SEARCH)
2615 ITEM_IMG:setId("ITEM_IMG")
2616 ITEM_IMG:setIcon("/images/custom/Items/" ..StartItem)
2617 ITEM_IMG:setSize({width = 32, height = 32})
2618 ITEM_IMG:setIconRect('05 05 32 32')
2619 ITEM_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft)
2620 ITEM_IMG:addAnchor(AnchorTop, 'parent', AnchorTop)
2621 ITEM_IMG:setPhantom(true)
2622
2623 ITEM_SEARCH.onHoverChange = function(widget, hoverState)
2624 if hoverState then
2625 if ComboBoxType == 1 or ComboBoxType == 7 then
2626 g_tooltip.display("@JOIAS " ..itemID.. " 0 0 0 0 0 0 0 0 0")
2627 elseif ComboBoxType == 4 then
2628 g_tooltip.display("@GUN " ..itemID.. " 0 0 0 0 0 0 0 0 0")
2629 elseif ComboBoxType == 03 or ComboBoxType == 11 then
2630 local rare = modules.game_database.getItemInfo(itemID, 13)
2631 g_tooltip.display("@BAG " ..itemID.. " " ..rare.. " 0 1 0 0 0 0 0 0")
2632 elseif ComboBoxType == 12 then
2633 local skillID = modules.game_database.getItemInfo(itemID, 10)
2634 g_tooltip.display("@SKILL " ..skillID.. " --")
2635 else
2636 g_tooltip.display("@EQUIP " ..itemID.. " 0 0 0 0 0 0 0 0 0")
2637 end
2638 else
2639 g_tooltip.hide()
2640 end
2641 end
2642 ITEM_SEARCH.onClick = function(widget)
2643 if widget:getBorderTopWidth() == 0 then
2644 onResetSelectOffertItem()
2645 widget:setBorderWidth(2)
2646 widget:setBorderColor("yellow")
2647
2648 SAVE_OFFERT_ID = itemID
2649 if ComboBoxType == 03 or ComboBoxType == 11 then
2650 cbInsertRareOffert:setVisible(false)
2651 infoRareOffert:setVisible(false)
2652 txtInsertVipOffert:disable()
2653 qntLabelOffert:setText('QNT:')
2654 local RARE = modules.game_database.getItemInfo(SAVE_OFFERT_ID, 13)
2655 if RARE < 01 then
2656 RARE_OFFERT = 0
2657 offertMarketView:setImageSource("/images/custom/UI/view_item_0")
2658 else
2659 RARE_OFFERT = RARE
2660 offertMarketView:setImageSource("/images/custom/UI/view_item_" ..RARE)
2661 end
2662 elseif ComboBoxType == 12 then
2663 cbInsertRareOffert:setVisible(false)
2664 infoRareOffert:setVisible(false)
2665 txtInsertVipOffert:enable()
2666 txtInsertQntOffert:setText('1')
2667 txtInsertQntOffert:disable()
2668 qntLabelOffert:setText('QNT:')
2669 local RARE = modules.game_database.getItemInfo(SAVE_OFFERT_ID, 13)
2670 if RARE < 01 then
2671 RARE_OFFERT = 0
2672 offertMarketView:setImageSource("/images/custom/UI/view_item_0")
2673 else
2674 RARE_OFFERT = RARE
2675 offertMarketView:setImageSource("/images/custom/UI/view_item_" ..RARE)
2676 end
2677 else
2678 txtInsertVipOffert:enable()
2679 cbInsertRareOffert:setOption("Comum", "00")
2680 cbInsertRareOffert:setVisible(true)
2681 infoRareOffert:setVisible(true)
2682 qntLabelOffert:setText('RARE:')
2683 RARE_OFFERT = 0
2684 offertMarketView:setImageSource("/images/custom/UI/view_item_0")
2685 end
2686 offertMarketView:setIcon("/images/custom/Items/" ..SAVE_OFFERT_ID)
2687
2688 local QntItemChance = function(self, value)
2689 local UndValor = txtInsertUndOffert:getText()
2690 local QntItem = txtInsertQntOffert:getText()
2691 local MaxCaracter = 5
2692 if #QntItem < MaxCaracter then
2693 if #UndValor > 0 then
2694 local StringPrice = UndValor:gsub(",", "")
2695 if tonumber(StringPrice) ~= nil then
2696 if ComboBoxType > 00 and ComboBoxType < 10 and ComboBoxType ~= 03 then
2697 txtInsertQntOffert:setText(StringPrice)
2698 txtInsertTotalOffert:setText(mask_number(StringPrice))
2699 else
2700 if string.len(txtInsertQntOffert:getText()) > 0 then
2701 txtInsertTotalOffert:setText(mask_number(StringPrice * txtInsertQntOffert:getText()))
2702 end
2703 end
2704 else
2705 txtInsertQntOffert:setText('')
2706 g_game.talk(g_game.talk("!trade 11#02"))
2707 end
2708 end
2709 else
2710 local LastStrPrice = QntItem:sub(1, #QntItem - 01)
2711 txtInsertQntOffert:setText(LastStrPrice)
2712 end
2713 end
2714 txtInsertQntOffert.onTextChange = QntItemChance
2715 local UndPriceChance = function(self, value)
2716 local UndValor = txtInsertUndOffert:getText()
2717 local MaxCaracter = 12
2718 if #UndValor > 0 then
2719 if #UndValor < MaxCaracter then
2720 local StringPrice = UndValor:gsub(",", "")
2721 if tonumber(StringPrice) ~= nil then
2722 if ComboBoxType > 00 and ComboBoxType < 10 and ComboBoxType ~= 03 then
2723 txtInsertUndOffert:setText(StringPrice)
2724 txtInsertTotalOffert:setText(mask_number(StringPrice))
2725 else
2726 txtInsertUndOffert:setText(StringPrice)
2727 txtInsertTotalOffert:setText(mask_number(StringPrice * txtInsertQntOffert:getText()))
2728 end
2729 else
2730 txtInsertUndOffert:setText('')
2731 g_game.talk(g_game.talk("!trade 11#02"))
2732 end
2733 else
2734 local LastStrPrice = UndValor:sub(UndValor, #UndValor - 01)
2735 txtInsertUndOffert:setText(LastStrPrice)
2736 end
2737 else
2738 txtInsertTotalOffert:setText('0')
2739 end
2740 end
2741 txtInsertUndOffert.onTextChange = UndPriceChance
2742
2743 btFinishOffert:enable()
2744 txtInsertVipOffert:setText('')
2745 txtInsertUndOffert:setText('')
2746 txtInsertQntOffert:setText('1')
2747 txtInsertTotalOffert:setText('0')
2748 else
2749 SAVE_OFFERT_ID = 0
2750 RARE_OFFERT = 0
2751 offertMarketView:setImageSource("/images/custom/UI/view_item")
2752 offertMarketView:setIcon("/images/custom/Items/0")
2753 cbInsertRareOffert:setVisible(false)
2754 infoRareOffert:setVisible(false)
2755 qntLabelOffert:setText('QNT:')
2756 txtInsertVipOffert:setText('')
2757 txtInsertUndOffert:setText('')
2758 txtInsertQntOffert:setText('')
2759 btFinishOffert:disable()
2760 widget:setBorderWidth(0)
2761 widget:setBorderColor("white")
2762 end
2763 end
2764
2765 ITEM_SEARCH:setBorderWidth(0)
2766 ITEM_SEARCH:setBorderColor("white")
2767 end
2768 end
2769 else
2770 return
2771 end
2772
2773 Index = Index + 01
2774 StartItem = StartItem + 01
2775 until Index > 149
2776
2777 offertSearch:focus()
2778 end
2779 end
2780 if type == 06 then -- FINALIZANDO OFERTA
2781 if SAVE_OFFERT_ID > 0 and txtInsertUndOffert:getText() ~= nil then
2782 if string.len(txtInsertUndOffert:getText()) > 0 or string.len(txtInsertVipOffert:getText()) > 0 then
2783 local checkAnonymous = 0
2784 local localPlayer = g_game.getLocalPlayer()
2785 local getPrice = txtInsertUndOffert:getText()
2786 local getUnd = txtInsertQntOffert:getText()
2787 local getVip = txtInsertVipOffert:getText()
2788 if #getUnd < 01 then
2789 getUnd = "1"
2790 end
2791 if #getVip < 01 then
2792 getVip = "0"
2793 end
2794 if #getPrice < 01 then
2795 getPrice = "0"
2796 end
2797 local FinalPrice = getPrice:gsub(",", "")
2798 if AnonymousOptionOffert:isChecked() then
2799 if localPlayer:isPremium() then
2800 checkAnonymous = 1
2801 else
2802 AnonymousOptionOffert:setChecked(false)
2803 modules.game_interface.onLoginAdvice(tr('Somente jogadores Premium Account podem ocultar seu nome.'))
2804 checkAnonymous = 0
2805 return
2806 end
2807 end
2808 if #getPrice > 0 or #getVip > 0 and #getUnd > 0 then
2809 g_game.getProtocolGame():sendExtendedOpcode(insert_market, getUnd.. "," ..FinalPrice.. "," ..ComboBoxType.. "," ..SAVE_OFFERT_ID.. "," ..RARE_OFFERT.. "," ..checkAnonymous.. "," ..getVip.. ",1")
2810 end
2811 end
2812 end
2813 end
2814 if type == 07 then -- VENDENDO ITEM SELECIONADO DA LISTA
2815 if OFFERT_CLICK_LIST_ITEM > 00 then
2816 g_game.getProtocolGame():sendExtendedOpcode(market_offert_sell, "," ..OFFERT_LIST_ID.. "," ..OFFERT_PLAYER_ID.. ",1," ..OFFERT_LIST_NAME.. "," ..OFFERT_LIST_ANONYMOUS.. "," ..PAYMENT_OFFERT_TYPE.. "," ..OFFERT_LIST_POS_ID.. "," ..OFFERTS_LIST[OFFERT_CLICK_LIST_ITEM].SLOT.. "," ..OFFERTS_LIST[OFFERT_CLICK_LIST_ITEM].EXT.. "," ..OFFERTS_LIST[OFFERT_CLICK_LIST_ITEM].BAG)
2817 end
2818 end
2819end
2820
2821function onResetSelectOffertItem()
2822 for X = 01, 200 do
2823 OFFERT_ID = CentralBox:recursiveGetChildById('SEARCH_ID' ..X)
2824 if OFFERT_ID then
2825 OFFERT_ID:setBorderWidth(0)
2826 OFFERT_ID:setBorderColor("white")
2827 end
2828 end
2829end
2830function LoadInsertMarketItem(Index)
2831 local Max = 20
2832 MARKET_BAG = CentralBox:recursiveGetChildById('MBag' ..Index)
2833 scheduleEvent(function()
2834 if ComboBoxType < 10 and modules.game_database.getItemBagId(Index) > 0 then
2835 local bagid = Index
2836 local id = modules.game_database.getItemBagId(bagid)
2837 local SLOT_BAG = modules.game_database.getItemInfo(id, 02)
2838 MARKET_BAG:setText("")
2839 MARKET_BAG:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(bagid))
2840 MARKET_BAG:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(bagid))
2841 if SLOT_BAG == 1 or SLOT_BAG == 7 then
2842 local starr = modules.game_database.getPosBackpack(bagid, 3)
2843 local rare = modules.game_database.getPosBackpack(bagid, 2)
2844 local level = modules.game_database.getPosBackpack(bagid, 5)
2845 local lock = modules.game_database.getPosBackpack(bagid, 9)
2846 MARKET_BAG:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..starr.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
2847 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2848 if lock > 00 then
2849 MARKET_BAG.onClick = function() end
2850 else
2851 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2852 end
2853 elseif SLOT_BAG == 4 then
2854 local skill_01 = modules.game_database.getPosBackpack(bagid, 4)
2855 local skill_02 = modules.game_database.getPosBackpack(bagid, 5)
2856 local skill_03 = modules.game_database.getPosBackpack(bagid, 6)
2857 local level = modules.game_database.getPosBackpack(bagid, 7)
2858 local star = modules.game_database.getPosBackpack(bagid, 3)
2859 local rare = modules.game_database.getPosBackpack(bagid, 2)
2860 local ammo = modules.game_database.getPosBackpack(bagid, 10)
2861 local lock = modules.game_database.getPosBackpack(bagid, 9)
2862 local bonus = modules.game_database.getPosBackpack(bagid, 8)
2863 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2864 MARKET_BAG:setTooltip("@GUN " ..id.. " " ..rare.. " " ..star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..level.. " " ..bonus.. " " ..lock.. " " ..ammo)
2865 if lock > 00 then
2866 MARKET_BAG.onClick = function() end
2867 else
2868 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2869 end
2870 elseif SLOT_BAG == 0 or SLOT_BAG == 11 then
2871 local qnt = modules.game_database.getPosBackpack(bagid, 04)
2872 local starr = modules.game_database.getPosBackpack(bagid, 3)
2873 local rare = modules.game_database.getPosBackpack(bagid, 2)
2874 local lock = modules.game_database.getPosBackpack(bagid, 9)
2875 MARKET_BAG:setTooltip("@BAG " ..id.. " " ..rare.. " " ..starr.. " " ..qnt.. " 0 0 0 0 " ..lock.. " 0")
2876 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2877 if qnt > 0 then
2878 if qnt < 10 then
2879 MARKET_BAG:setText("0" ..modules.game_database.getPosBackpack(bagid, 04))
2880 else
2881 MARKET_BAG:setText(modules.game_database.getPosBackpack(bagid, 04))
2882 end
2883 else
2884 MARKET_BAG:setText("")
2885 end
2886 if lock > 00 then
2887 MARKET_BAG.onClick = function() end
2888 else
2889 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2890 end
2891 elseif SLOT_BAG == 12 then
2892 local skill_01 = modules.game_database.getItemInfo(id, 10)
2893 local qnt = modules.game_database.getPosBackpack(bagid, 04)
2894 local lock = modules.game_database.getPosBackpack(bagid, 09)
2895 MARKET_BAG:setTooltip("@SKILL " ..skill_01.. " -- " ..lock)
2896 if qnt > 0 then
2897 if qnt < 10 then
2898 MARKET_BAG:setText("0" ..modules.game_database.getPosBackpack(bagid, 04))
2899 else
2900 MARKET_BAG:setText(modules.game_database.getPosBackpack(bagid, 04))
2901 end
2902 else
2903 MARKET_BAG:setText("")
2904 end
2905 if lock > 00 then
2906 MARKET_BAG.onClick = function() end
2907 else
2908 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2909 end
2910 else
2911 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2912 local starr = modules.game_database.getPosBackpack(bagid, 3)
2913 local levell = modules.game_database.getPosBackpack(bagid, 5)
2914 local atr1 = modules.game_database.getPosBackpack(bagid, 6)
2915 local atr2 = modules.game_database.getPosBackpack(bagid, 7)
2916 local rare = modules.game_database.getPosBackpack(bagid, 2)
2917 local lock = modules.game_database.getPosBackpack(bagid, 9)
2918 local bonus = modules.game_database.getPosBackpack(bagid, 8)
2919 MARKET_BAG:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..starr.. " 0 " ..levell.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
2920 if lock > 00 then
2921 MARKET_BAG.onClick = function() end
2922 else
2923 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2924 end
2925 end
2926 else
2927 if ComboBoxType == 10 and Index == 01 then
2928 local bagid = Index
2929 local id = 3218
2930 local qnt = modules.game_database.checkVipCoins(01)
2931 MARKET_BAG:setText("")
2932 MARKET_BAG:setImageSource("/images/custom/UI/rare_3")
2933 MARKET_BAG:setIcon("/images/custom/Items/" ..id)
2934 MARKET_BAG.onClick = function() onMarketSelectItem(01, bagid) end
2935 if qnt > 0 then
2936 if qnt < 10 then
2937 MARKET_BAG:setText("0" ..qnt)
2938 else
2939 MARKET_BAG:setText(qnt)
2940 end
2941 else
2942 MARKET_BAG:setText("0")
2943 end
2944 else
2945 MARKET_BAG:setIcon("/images/custom/UI/none")
2946 MARKET_BAG:setImageSource("/images/custom/UI/item_slot")
2947 MARKET_BAG:setTooltip("")
2948 MARKET_BAG:setText("")
2949 MARKET_BAG.onClick = function() end
2950 end
2951 end
2952
2953 MARKET_BAG:show()
2954 g_effects.fadeIn(MARKET_BAG, 50)
2955 if Index < Max then
2956 Index = Index + 1
2957 LoadInsertMarketItem(Index)
2958 else
2959 BACKPACK_01 = CentralBox:recursiveGetChildById('marketBackpack1')
2960 BACKPACK_02 = CentralBox:recursiveGetChildById('marketBackpack2')
2961 BACKPACK_03 = CentralBox:recursiveGetChildById('marketBackpack3')
2962 BACKPACK_04 = CentralBox:recursiveGetChildById('marketBackpack4')
2963 BACKPACK_01:show()
2964 BACKPACK_02:show()
2965 BACKPACK_03:show()
2966 BACKPACK_04:show()
2967
2968 if ComboBoxType == 10 then
2969 BACKPACK_01:setTooltip("Backpack 01")
2970 g_effects.fadeIn(BACKPACK_01, 250)
2971 BACKPACK_01.onClick = function() end
2972
2973 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot_lock")
2974 g_effects.fadeIn(BACKPACK_02, 250)
2975 BACKPACK_02.onClick = function() end
2976
2977 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot_lock")
2978 g_effects.fadeIn(BACKPACK_03, 250)
2979 BACKPACK_03.onClick = function() end
2980
2981 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot_lock")
2982 g_effects.fadeIn(BACKPACK_04, 250)
2983 BACKPACK_04.onClick = function() end
2984 else
2985 BACKPACK_01:setTooltip("Backpack 01")
2986 g_effects.fadeIn(BACKPACK_01, 250)
2987 BACKPACK_01.onClick = function()
2988 BagSelect = 0
2989 onMarketSelectItem(00)
2990 g_game.talk(g_game.talk("!backpack 53 "..ComboBoxType.. " 00"))
2991 end
2992 if modules.game_database.getExtension(ComboBoxType) >= 01 then
2993 BACKPACK_02:setTooltip("Backpack 02")
2994 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot")
2995 g_effects.fadeIn(BACKPACK_02, 250)
2996
2997 BACKPACK_02.onClick = function()
2998 BagSelect = 1
2999 onMarketSelectItem(00)
3000 g_game.talk(g_game.talk("!backpack 53 "..ComboBoxType.. " 01"))
3001 end
3002 else
3003 g_effects.fadeIn(BACKPACK_02, 250)
3004 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot_lock")
3005 BACKPACK_02:setTooltip(tr("Compre um novo Slot no Shop"))
3006 BACKPACK_02.onClick = function() end
3007 end
3008 if modules.game_database.getExtension(ComboBoxType) >= 02 then
3009 BACKPACK_03:setTooltip("Backpack 03")
3010 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot")
3011 g_effects.fadeIn(BACKPACK_03, 250)
3012
3013 BACKPACK_03.onClick = function()
3014 BagSelect = 2
3015 onMarketSelectItem(00)
3016 g_game.talk(g_game.talk("!backpack 53 "..ComboBoxType.. " 02"))
3017 end
3018 else
3019 g_effects.fadeIn(BACKPACK_03, 250)
3020 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot_lock")
3021 BACKPACK_03:setTooltip(tr("Compre um novo Slot no Shop"))
3022 BACKPACK_03.onClick = function() end
3023 end
3024 if modules.game_database.getExtension(ComboBoxType) >= 03 then
3025 BACKPACK_04:setTooltip("Backpack 04")
3026 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot")
3027 g_effects.fadeIn(BACKPACK_04, 250)
3028
3029 BACKPACK_04.onClick = function()
3030 BagSelect = 3
3031 onMarketSelectItem(00)
3032 g_game.talk(g_game.talk("!backpack 53 "..ComboBoxType.. " 03"))
3033 end
3034 else
3035 g_effects.fadeIn(BACKPACK_04, 250)
3036 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot_lock")
3037 BACKPACK_04:setTooltip(tr("Compre um novo Slot no Shop"))
3038 BACKPACK_04.onClick = function() end
3039 end
3040 end
3041 end
3042 end, 10)
3043end
3044function onMarketSelectItem(type, bag)
3045 if type == 00 then
3046 for X = 01, 20 do
3047 MARKET_BAG = CentralBox:recursiveGetChildById('MBag' ..X)
3048 MARKET_BAG:setBorderWidth(0)
3049 end
3050 QntItem:setText('')
3051 TotalPrice:setText('')
3052 PriceUndItem:setText('')
3053 PriceVipItem:setText('')
3054 QntItem:disable()
3055 PriceUndItem:disable()
3056 PriceVipItem:disable()
3057 AnonymousOption:setChecked(false)
3058 itemMarketView:setImageSource("/images/custom/UI/view_item")
3059 itemMarketView:setIcon("/images/custom/Items/0")
3060 return
3061 end
3062 if type == 01 then
3063 onMarketSelectItem(00)
3064 local MaxCaracter = 12
3065 if ComboBoxType == 10 then
3066 local QntMax = modules.game_database.checkVipCoins(01)
3067 MARKET_BAG_SELECT = CentralBox:recursiveGetChildById('MBag' ..bag)
3068 Rare = 03
3069 ID = 3218
3070 Slot = 10
3071 MARKET_BAG_SELECT:setBorderWidth(2)
3072 MARKET_BAG_SELECT:setBorderColor("yellow")
3073 itemMarketView:setImageSource("/images/custom/UI/view_item_" ..Rare)
3074 itemMarketView:setIcon("/images/custom/Items/" ..ID)
3075
3076 local QntItemChance = function(self, value)
3077 local Quant = QntItem:getText()
3078 local UndValor = PriceUndItem:getText()
3079 local StringPrice = "0"
3080 if #UndValor > 0 then
3081 StringPrice = UndValor:gsub(",", "")
3082 end
3083 if #Quant > 0 then
3084 if tonumber(Quant) ~= nil then
3085 if tonumber(Quant) <= QntMax then
3086 QntItem:setText(Quant)
3087 TotalPrice:setText(mask_number(StringPrice * QntItem:getText()))
3088 else
3089 QntItem:setText(QntMax)
3090 TotalPrice:setText(mask_number(StringPrice * QntItem:getText()))
3091 end
3092 else
3093 QntItem:setText('')
3094 g_game.talk(g_game.talk("!trade 11#02"))
3095 end
3096 end
3097 end
3098 QntItem.onTextChange = QntItemChance
3099
3100 PriceUndItem:enable()
3101 PriceVipItem:disable()
3102 local UndPriceChance = function(self, value)
3103 local UndValor = PriceUndItem:getText()
3104 if #UndValor > 0 then
3105 if #UndValor < MaxCaracter then
3106 local StringPrice = UndValor:gsub(",", "")
3107 if tonumber(StringPrice) ~= nil then
3108 if Slot > 00 and Slot < 10 and ComboBoxType ~= 03 then
3109 PriceUndItem:setText(StringPrice)
3110 TotalPrice:setText(mask_number(StringPrice))
3111 else
3112 PriceUndItem:setText(StringPrice)
3113 TotalPrice:setText(mask_number(StringPrice * QntItem:getText()))
3114 end
3115 else
3116 PriceUndItem:setText('')
3117 g_game.talk(g_game.talk("!trade 11#02"))
3118 end
3119 else
3120 local LastStrPrice = UndValor:sub(UndValor, #UndValor - 01)
3121 PriceUndItem:setText(LastStrPrice)
3122 --g_game.talk(g_game.talk("!trade 11#04"))
3123 end
3124 end
3125 end
3126 PriceUndItem.onTextChange = UndPriceChance
3127
3128 MarketFinish.onClick = function()
3129 local checkAnonymous = 0
3130 local localPlayer = g_game.getLocalPlayer()
3131 local getPrice = PriceUndItem:getText()
3132 local getUnd = QntItem:getText()
3133 local FinalPrice = getPrice:gsub(",", "")
3134 if AnonymousOption:isChecked() then
3135 if localPlayer:isPremium() then
3136 checkAnonymous = 1
3137 else
3138 AnonymousOption:setChecked(false)
3139 modules.game_interface.onLoginAdvice(tr('Somente jogadores Premium Account podem ocultar seu nome.'))
3140 checkAnonymous = 0
3141 return
3142 end
3143 end
3144 if #getPrice > 0 and #getUnd > 0 then
3145 g_game.getProtocolGame():sendExtendedOpcode(insert_market, getUnd.. "," ..FinalPrice.. "," ..ComboBoxType.. "," ..BagSelect.. "," ..bag.. "," ..checkAnonymous.. ",0,0")
3146 end
3147 end
3148
3149 if Slot == 00 or Slot > 09 then
3150 QntItem:enable()
3151 QntItem:setText(QntMax)
3152 else
3153 QntItem:setText('1')
3154 QntItem:disable()
3155 end
3156 return
3157 else
3158 local QntMax = modules.game_database.getPosBackpack(bag, 04)
3159 MARKET_BAG_SELECT = CentralBox:recursiveGetChildById('MBag' ..bag)
3160 Rare = modules.game_database.getRareBagId(bag)
3161 ID = modules.game_database.getItemBagId(bag, 01)
3162 Slot = modules.game_database.getItemInfo(ID, 02)
3163 MARKET_BAG_SELECT:setBorderWidth(2)
3164 MARKET_BAG_SELECT:setBorderColor("yellow")
3165 itemMarketView:setImageSource("/images/custom/UI/view_item_" ..Rare)
3166 itemMarketView:setIcon("/images/custom/Items/" ..ID)
3167
3168 local QntItemChance = function(self, value)
3169 local Quant = QntItem:getText()
3170 local UndValor = PriceUndItem:getText()
3171 local StringPrice = "0"
3172 if #UndValor > 0 then
3173 StringPrice = UndValor:gsub(",", "")
3174 end
3175 if #Quant > 0 then
3176 if tonumber(Quant) ~= nil then
3177 if tonumber(Quant) <= QntMax then
3178 QntItem:setText(Quant)
3179 TotalPrice:setText(mask_number(StringPrice * QntItem:getText()))
3180 else
3181 QntItem:setText(QntMax)
3182 TotalPrice:setText(mask_number(StringPrice * QntItem:getText()))
3183 end
3184 else
3185 QntItem:setText('')
3186 g_game.talk(g_game.talk("!trade 11#02"))
3187 end
3188 end
3189 end
3190 QntItem.onTextChange = QntItemChance
3191
3192 PriceUndItem:enable()
3193 local UndPriceChance = function(self, value)
3194 local UndValor = PriceUndItem:getText()
3195 if #UndValor > 0 then
3196 if #UndValor < MaxCaracter then
3197 local StringPrice = UndValor:gsub(",", "")
3198 if tonumber(StringPrice) ~= nil then
3199 if Slot > 00 and Slot < 10 and ComboBoxType ~= 03 then
3200 PriceUndItem:setText(StringPrice)
3201 TotalPrice:setText(mask_number(StringPrice))
3202 else
3203 PriceUndItem:setText(StringPrice)
3204 TotalPrice:setText(mask_number(StringPrice * QntItem:getText()))
3205 end
3206 else
3207 PriceUndItem:setText('')
3208 g_game.talk(g_game.talk("!trade 11#02"))
3209 end
3210 else
3211 local LastStrPrice = UndValor:sub(UndValor, #UndValor - 01)
3212 PriceUndItem:setText(LastStrPrice)
3213 --g_game.talk(g_game.talk("!trade 11#04"))
3214 end
3215 end
3216 end
3217 PriceUndItem.onTextChange = UndPriceChance
3218
3219 PriceVipItem:enable()
3220 local VipPriceChance = function(self, value)
3221 local Quant = PriceVipItem:getText()
3222 if #Quant > 0 then
3223 if tonumber(Quant) ~= nil then
3224 else
3225 PriceVipItem:setText('')
3226 g_game.talk(g_game.talk("!trade 11#02"))
3227 end
3228 end
3229 end
3230 PriceVipItem.onTextChange = VipPriceChance
3231
3232 PriceUndItem:focus()
3233 PriceUndItem:raise()
3234 MarketFinish.onClick = function()
3235 local localPlayer = g_game.getLocalPlayer()
3236 local checkAnonymous = 0
3237 local getPrice = PriceUndItem:getText()
3238 local getUnd = QntItem:getText()
3239 local getVip = PriceVipItem:getText()
3240 local FinalPrice = getPrice:gsub(",", "")
3241 if #getVip < 01 then
3242 getVip = "0"
3243 end
3244 if AnonymousOption:isChecked() then
3245 if localPlayer:isPremium() then
3246 checkAnonymous = 1
3247 else
3248 AnonymousOption:setChecked(false)
3249 modules.game_interface.onLoginAdvice(tr('Somente jogadores Premium Account podem ocultar seu nome.'))
3250 checkAnonymous = 0
3251 return
3252 end
3253 end
3254 if #getPrice > 0 and #getUnd > 0 then
3255 g_game.getProtocolGame():sendExtendedOpcode(insert_market, getUnd.. "," ..FinalPrice.. "," ..ComboBoxType.. "," ..BagSelect.. "," ..bag.. "," ..checkAnonymous.. "," ..getVip.. ",0")
3256 end
3257 end
3258 if Slot == 00 or Slot > 09 then
3259 PriceVipItem:disable()
3260 PriceVipItem:setText('0')
3261 QntItem:enable()
3262 QntItem:setText(QntMax)
3263 else
3264 QntItem:setText('1')
3265 QntItem:disable()
3266 end
3267 return
3268 end
3269 end
3270end
3271function InsertMarketChangeSort(value)
3272 ComboBoxType = tonumber(value)
3273 if ComboBoxType == 10 then
3274 g_game.talk(g_game.talk("!inventario 28")) -- Gold Coins
3275 LoadInsertMarketItem(01)
3276 else
3277 onMarketSelectItem(00)
3278 g_game.talk(g_game.talk("!backpack 53 "..ComboBoxType.. " 00"))
3279 end
3280end
3281function onSellOffertMarketItem(idd)
3282 if _MARKET_SEARCH_TABLE[idd] then
3283 local STRING = _MARKET_SEARCH_TABLE[idd]
3284 local INDEX = string.explode(STRING, "@")
3285
3286 local ID = tonumber(INDEX[01])
3287 local PLAYER_ID = tonumber(INDEX[02])
3288 local ANONYMOUS = tonumber(INDEX[03])
3289 local PRICE = tonumber(INDEX[04])
3290 local TIMER = tonumber(INDEX[05])
3291 local UID_1 = tonumber(INDEX[06])
3292 local UID_2 = tonumber(INDEX[07])
3293 local UID_3 = tonumber(INDEX[08])
3294 local UID_4 = tonumber(INDEX[09])
3295 local UID_5 = tonumber(INDEX[10])
3296 local UID_6 = tonumber(INDEX[11])
3297 local UID_7 = tonumber(INDEX[12])
3298 local UID_8 = tonumber(INDEX[13])
3299 local UID_9 = tonumber(INDEX[14])
3300 local UID_10 = tonumber(INDEX[15])
3301 local POS_ID = tonumber(INDEX[18])
3302 local NAME = INDEX[16]
3303
3304 local SLOTS = modules.game_database.getItemInfo(UID_1, 02)
3305 local FinalQnt = 01
3306 local yesChoose = function()
3307 if SLOTS == 00 or SLOTS == 03 or SLOTS > 09 then
3308 g_game.getProtocolGame():sendExtendedOpcode(market_offert_sell, "," ..ID.. "," ..PLAYER_ID.. "," ..FinalQnt.. "," ..NAME.. "," ..ANONYMOUS.. ",0," ..POS_ID)
3309 else
3310 PAYMENT_OFFERT_TYPE = 0
3311 OFFERT_LIST_ID = ID
3312 OFFERT_PLAYER_ID = PLAYER_ID
3313 OFFERT_LIST_NAME = NAME
3314 OFFERT_LIST_ANONYMOUS = ANONYMOUS
3315 OFFERT_LIST_POS_ID = POS_ID
3316 g_game.getProtocolGame():sendExtendedOpcode(opcode_offert_item_list, "," ..UID_1.. "," ..UID_2.. "," ..UID_3.. "," ..SLOTS)
3317 end
3318 sellWindow:destroy()
3319 sellWindow = nil
3320 end
3321 local vipChoose = function()
3322 PAYMENT_OFFERT_TYPE = 01
3323 OFFERT_LIST_ID = ID
3324 OFFERT_PLAYER_ID = PLAYER_ID
3325 OFFERT_LIST_NAME = NAME
3326 OFFERT_LIST_ANONYMOUS = ANONYMOUS
3327 OFFERT_LIST_POS_ID = POS_ID
3328 --g_game.getProtocolGame():sendExtendedOpcode(market_offert_sell, "," ..ID.. "," ..PLAYER_ID.. "," ..FinalQnt.. "," ..NAME.. "," ..ANONYMOUS.. ",1," ..POS_ID)
3329 g_game.getProtocolGame():sendExtendedOpcode(opcode_offert_item_list, "," ..UID_1.. "," ..UID_2.. "," ..UID_3.. "," ..SLOTS)
3330 sellWindow:destroy()
3331 sellWindow = nil
3332 end
3333 local noChoose = function() sellWindow:destroy() sellWindow = nil end
3334
3335 if sellWindow == nil then
3336 local localPlayer = g_game.getLocalPlayer()
3337 if localPlayer:getName() == NAME then
3338 sellWindow = displayGeneralBox(tr('MARKET'), tr("Voce nao pode vender para si mesmo."),
3339 { { text=tr('Fechar'), callback=noChoose }, anchor=AnchorHorizontalCenter }, noChoose)
3340 return
3341 end
3342 if SLOTS == 00 or SLOTS == 03 or SLOTS > 09 then
3343 local TotalQnt = UID_4
3344 local TotalPrice = PRICE * TotalQnt
3345 sellWindow = g_ui.displayUI('buy')
3346 scrollbar = sellWindow:recursiveGetChildById('countScrollBar')
3347 Info = sellWindow:recursiveGetChildById('buyInfo')
3348 confirmButton = sellWindow:recursiveGetChildById('confirmBuy')
3349 confirmButton:setText('Vender')
3350 BuyLabel = sellWindow:recursiveGetChildById('txtLabel')
3351 BuyLabel:setText(tr('Deseja vender?'))
3352 Info:setText(tr("Vendendo o item").. ":\n\nItem: " ..modules.game_database.getItemInfo(UID_1, 01).. "\n" ..tr("Quantidade").. ": x" ..TotalQnt.. "\n" ..tr("Valor Und").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Total").. ": " ..mask_number(TotalPrice))
3353 FinalQnt = TotalQnt
3354 scrollbar:setMaximum(TotalQnt)
3355 scrollbar:setMinimum(1)
3356 scrollbar:setValue(TotalQnt)
3357 scrollbar.onValueChange = function(self, value)
3358 TotalPrice = PRICE * value
3359 FinalQnt = value
3360 Info:setText(tr("Vendendo o item").. ":\n\nItem: " ..modules.game_database.getItemInfo(UID_1, 01).. "\n" ..tr("Quantidade").. ": x" ..value.. "\n" ..tr("Valor Und").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Total").. ": " ..mask_number(TotalPrice))
3361 end
3362
3363 confirmButton.onClick = function()
3364 g_game.getProtocolGame():sendExtendedOpcode(market_offert_sell, "," ..ID.. "," ..PLAYER_ID.. "," ..FinalQnt.. "," ..NAME.. "," ..ANONYMOUS.. ",0," ..POS_ID)
3365 sellWindow:destroy()
3366 sellWindow = nil
3367 end
3368 sellWindow:show()
3369 return true
3370 else
3371 FinalQnt = 01
3372 end
3373 if TIMER > 0 then
3374 if PRICE > 0 then
3375 sellWindow = displayGeneralBox(tr('MARKET'), tr("Vendendo o item").. ":\n\nItem: " ..modules.game_database.getItemInfo(UID_1, 01).. "\n" ..tr("Quantidade").. ": x1\n\n" ..tr("Valor Gold Coin").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Vip Coin").. ": " ..mask_number(TIMER).. "\n\n" ..tr("Aceitar qual pagamento por seu item").. ":\n",
3376 { { text=tr('Gold Coin'), callback=yesChoose },
3377 { text=tr('Vip Coin'), callback=vipChoose },
3378 { text=tr('Cancelar'), callback=noChoose },
3379 anchor=AnchorHorizontalCenter }, yesChoose, vipChoose, noChoose)
3380 else
3381 sellWindow = displayGeneralBox(tr('MARKET'), tr("Vendendo o item").. ":\n\nItem: " ..modules.game_database.getItemInfo(UID_1, 01).. "\n" ..tr("Quantidade").. ": x1\n\n" ..tr("Valor Vip Coin").. ": " ..mask_number(TIMER).. "\n\n" ..tr("Confirmar venda").. "?\n",
3382 { { text=tr('Vender'), callback=vipChoose },
3383 { text=tr('Cancelar'), callback=noChoose },
3384 anchor=AnchorHorizontalCenter }, vipChoose, noChoose)
3385 end
3386 else
3387 sellWindow = displayGeneralBox(tr('MARKET'), tr("Vendendo o item").. ":\n\nItem: " ..modules.game_database.getItemInfo(UID_1, 01).. "\n" ..tr("Quantidade").. ": x1\n\n" ..tr("Valor Gold Coin").. ": " ..mask_number(PRICE).. "\n\n" ..tr("Confirmar venda").. "?\n",
3388 { { text=tr('Vender'), callback=yesChoose },
3389 { text=tr('Cancelar'), callback=noChoose },
3390 anchor=AnchorHorizontalCenter }, yesChoose, noChoose)
3391 end
3392 else
3393 sellWindow:focus()
3394 sellWindow:raise()
3395 end
3396 end
3397end
3398function onBuyMarketItem(idd)
3399 if _MARKET_SEARCH_TABLE[idd] then
3400 local STRING = _MARKET_SEARCH_TABLE[idd]
3401 local INDEX = string.explode(STRING, "@")
3402
3403 local ID = tonumber(INDEX[01])
3404 local PLAYER_ID = tonumber(INDEX[02])
3405 local ANONYMOUS = tonumber(INDEX[03])
3406 local PRICE = tonumber(INDEX[04])
3407 local TIMER = tonumber(INDEX[05])
3408 local UID_1 = tonumber(INDEX[06])
3409 local UID_2 = tonumber(INDEX[07])
3410 local UID_3 = tonumber(INDEX[08])
3411 local UID_4 = tonumber(INDEX[09])
3412 local UID_5 = tonumber(INDEX[10])
3413 local UID_6 = tonumber(INDEX[11])
3414 local UID_7 = tonumber(INDEX[12])
3415 local UID_8 = tonumber(INDEX[13])
3416 local UID_9 = tonumber(INDEX[14])
3417 local UID_10 = tonumber(INDEX[15])
3418 local POS_ID = tonumber(INDEX[18])
3419 local NAME = INDEX[16]
3420
3421 local FinalQnt = 01
3422 local yesChoose = function()
3423 g_game.getProtocolGame():sendExtendedOpcode(buy_market_item, "," ..ID.. "," ..PLAYER_ID.. "," ..FinalQnt.. "," ..NAME.. "," ..ANONYMOUS.. ",0," ..POS_ID)
3424 sellWindow:destroy()
3425 sellWindow = nil
3426 end
3427 local vipChoose = function()
3428 g_game.getProtocolGame():sendExtendedOpcode(buy_market_item, "," ..ID.. "," ..PLAYER_ID.. "," ..FinalQnt.. "," ..NAME.. "," ..ANONYMOUS.. ",1," ..POS_ID)
3429 sellWindow:destroy()
3430 sellWindow = nil
3431 end
3432 local noChoose = function() sellWindow:destroy() sellWindow = nil end
3433
3434 if sellWindow == nil then
3435 local localPlayer = g_game.getLocalPlayer()
3436 if localPlayer:getName() == NAME then
3437 sellWindow = displayGeneralBox(tr('MARKET'), tr("Voce nao pode comprar seus proprios produtos."),
3438 { { text=tr('Fechar'), callback=noChoose }, anchor=AnchorHorizontalCenter }, noChoose)
3439 return
3440 end
3441 local SLOTS = modules.game_database.getItemInfo(UID_1, 02)
3442 if SLOTS == 00 or SLOTS == 03 or SLOTS > 09 then
3443 local TotalQnt = UID_4
3444 local TotalPrice = PRICE * TotalQnt
3445 sellWindow = g_ui.displayUI('buy')
3446 scrollbar = sellWindow:recursiveGetChildById('countScrollBar')
3447 Info = sellWindow:recursiveGetChildById('buyInfo')
3448 confirmButton = sellWindow:recursiveGetChildById('confirmBuy')
3449 Info:setText(tr("Confirmacao de compra").. ":\n\nItem: " ..tr(modules.game_database.getItemInfo(UID_1, 01)).. "\n" ..tr("Quantidade").. ": x" ..TotalQnt.. "\n" ..tr("Valor Und").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Total").. ": " ..mask_number(TotalPrice))
3450 FinalQnt = TotalQnt
3451 scrollbar:setMaximum(TotalQnt)
3452 scrollbar:setMinimum(1)
3453 scrollbar:setValue(TotalQnt)
3454 scrollbar.onValueChange = function(self, value)
3455 TotalPrice = PRICE * value
3456 FinalQnt = value
3457 Info:setText(tr("Confirmacao de compra").. ":\n\nItem: " ..tr(modules.game_database.getItemInfo(UID_1, 01)).. "\n" ..tr("Quantidade").. ": x" ..value.. "\n" ..tr("Valor Und").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Total").. ": " ..mask_number(TotalPrice))
3458 end
3459
3460 confirmButton.onClick = function()
3461 g_game.getProtocolGame():sendExtendedOpcode(buy_market_item, "," ..ID.. "," ..PLAYER_ID.. "," ..FinalQnt.. "," ..NAME.. "," ..ANONYMOUS.. ",0," ..POS_ID)
3462 sellWindow:destroy()
3463 sellWindow = nil
3464 end
3465 sellWindow:show()
3466 return true
3467 else
3468 FinalQnt = 01
3469 end
3470
3471 if TIMER < 01 then
3472 sellWindow = displayGeneralBox(tr('MARKET'), tr("Confirmacao de compra").. ":\n\nItem: " ..tr(modules.game_database.getItemInfo(UID_1, 01)).. "\n" ..tr("Quantidade").. ": x1\n" ..tr("Valor Und").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Total").. ": " ..mask_number(PRICE).. "\n\n" ..tr("Confirmar compra").. "?\n",
3473 { { text=tr('Comprar'), callback=yesChoose },
3474 { text=tr('Cancelar'), callback=noChoose },
3475 anchor=AnchorHorizontalCenter }, yesChoose, noChoose)
3476 else
3477 sellWindow = displayGeneralBox(tr('MARKET'), tr("Confirmacao de compra").. ":\n\nItem: " ..tr(modules.game_database.getItemInfo(UID_1, 01)).. "\n" ..tr("Quantidade").. ": x1\n" ..tr("Valor Und").. ": " ..mask_number(PRICE).. "\n\n" ..tr("Valor Gold Coin").. ": " ..mask_number(PRICE).. "\n" ..tr("Valor Vip Coin").. ": " ..mask_number(TIMER).. "\n\n" ..tr("Escolha como deseja pagar").. ":\n",
3478 { { text=tr('Gold Coin'), callback=yesChoose },
3479 { text=tr('Vip Coin'), callback=vipChoose },
3480 { text=tr('Cancelar'), callback=noChoose },
3481 anchor=AnchorHorizontalCenter }, yesChoose, vipChoose, noChoose)
3482 end
3483 else
3484 sellWindow:focus()
3485 sellWindow:raise()
3486 end
3487 end
3488end
3489function loadMarketPage()
3490 if AtualPage == 01 then
3491 LastPage:disable()
3492 else
3493 LastPage:enable()
3494 end
3495 if TotalPage == 01 or AtualPage == TotalPage then
3496 NextPage:disable()
3497 else
3498 NextPage:enable()
3499 end
3500
3501 LastPage.onClick = function()
3502 if AtualPage == 02 then
3503 PAGE_START = 00
3504 AtualPage = AtualPage - 01
3505 else
3506 AtualPage = AtualPage - 01
3507 PAGE_START = MAX_LIST_VIEW * (AtualPage - 01)
3508 end
3509 onMarket(01)
3510 end
3511 NextPage.onClick = function()
3512 AtualPage = AtualPage + 01
3513 onMarket(01)
3514 end
3515 LabelPage:setText(AtualPage.. "/" ..TotalPage)
3516end
3517
3518
3519function InsertOffertRareChangeSort(value)
3520 RARE_OFFERT = tonumber(value)
3521 offertMarketView:setImageSource("/images/custom/UI/view_item_" ..RARE_OFFERT)
3522end
3523function OffertInsertMarketRareChangeSortType(comboBox, option, value)
3524 InsertOffertRareChangeSort(value:lower())
3525end
3526function InsertOffertChangeSort(value)
3527 ComboBoxType = tonumber(value)
3528 offertSearch:setText('')
3529 SAVE_OFFERT_ID = 0
3530 RARE_OFFERT = 0
3531 offertMarketView:setImageSource("/images/custom/UI/view_item")
3532 offertMarketView:setIcon("/images/custom/Items/0")
3533 cbInsertRareOffert:setVisible(false)
3534 infoRareOffert:setVisible(false)
3535 qntLabelOffert:setText('QNT:')
3536 txtInsertVipOffert:setText('')
3537 txtInsertUndOffert:setText('')
3538 txtInsertQntOffert:setText('')
3539 btFinishOffert:disable()
3540 for DEL = 01, 200 do
3541 DEL_ID = CentralBox:recursiveGetChildById('SEARCH_ID' ..DEL)
3542 if DEL_ID then
3543 DEL_ID:destroy()
3544 end
3545 end
3546
3547 offertSearch:focus()
3548end
3549function OffertInsertMarketChangeSortType(comboBox, option, value)
3550 InsertOffertChangeSort(value:lower())
3551end
3552function UpgradeInsertMarketChangeSortType(comboBox, option, value)
3553 InsertMarketChangeSort(value:lower())
3554end
3555function SearchCatMarketChangeSort(value)
3556 ComboBoxSelect = tonumber(value)
3557 CleanAllMarketSlots()
3558 WordPesquisa = 0
3559 AtualPage = 1
3560 market_box_rare = -1
3561 market_box_star = -1
3562 RareSearchItem:setOption(tr("Tudo"), "-1")
3563 StarSearchItem:setOption(tr("Tudo"), "-1")
3564 Search_1:setText('')
3565 Search_1:raise()
3566 Search_1:focus()
3567 g_game.getProtocolGame():sendExtendedOpcode(search_market, ComboBoxSelect.. ",|")
3568 --onMarket(01)
3569
3570 if ComboBoxSelect == 04 then
3571 RareSearchItem:setVisible(true)
3572 StarSearchItem:setVisible(true)
3573 elseif ComboBoxSelect == 03 or ComboBoxSelect == 00 or ComboBoxSelect == 10 then
3574 RareSearchItem:setVisible(false)
3575 StarSearchItem:setVisible(false)
3576 else
3577 RareSearchItem:setVisible(true)
3578 StarSearchItem:setVisible(false)
3579 end
3580end
3581function UpgradeSearchCatChangeSortType(comboBox, option, value)
3582 SearchCatMarketChangeSort(value:lower())
3583end
3584function RareFilterMarketChangeSort(value)
3585 market_box_rare = tonumber(value)
3586 if market_box_rare < 00 then
3587 TotalPage = 01
3588 AtualPage = 01
3589 PAGE_START = 00
3590 local countPage = #_MARKET_SEARCH_TABLE
3591 for _PAGE = 01, 9999 do
3592 countPage = countPage - MAX_LIST_VIEW
3593 if countPage >= MAX_LIST_VIEW then
3594 TotalPage = TotalPage + 01
3595 elseif countPage > 0 then
3596 TotalPage = TotalPage + 01
3597 break
3598 else
3599 break
3600 end
3601 end
3602
3603 LastPage:disable()
3604 NextPage:disable()
3605 LabelPage:setText(AtualPage.. "/" ..TotalPage)
3606 onMarket(01)
3607 else
3608 TotalPage = 01
3609 AtualPage = 01
3610 PAGE_START = 00
3611 LastPage:disable()
3612 NextPage:disable()
3613 LabelPage:setText(AtualPage.. "/" ..TotalPage)
3614 onMarket(01)
3615 end
3616end
3617function UpgradeRareFilterChangeSortType(comboBox, option, value)
3618 RareFilterMarketChangeSort(value:lower())
3619end
3620function StarFilterMarketChangeSort(value)
3621 market_box_star = tonumber(value)
3622 if market_box_star < 00 then
3623 TotalPage = 01
3624 AtualPage = 01
3625 PAGE_START = 00
3626 local countPage = #_MARKET_SEARCH_TABLE
3627 for _PAGE = 01, 9999 do
3628 countPage = countPage - MAX_LIST_VIEW
3629 if countPage >= MAX_LIST_VIEW then
3630 TotalPage = TotalPage + 01
3631 elseif countPage > 0 then
3632 TotalPage = TotalPage + 01
3633 break
3634 else
3635 break
3636 end
3637 end
3638
3639 LastPage:disable()
3640 NextPage:disable()
3641 LabelPage:setText(AtualPage.. "/" ..TotalPage)
3642 onMarket(01)
3643 else
3644 TotalPage = 01
3645 AtualPage = 01
3646 PAGE_START = 00
3647 LastPage:disable()
3648 NextPage:disable()
3649 LabelPage:setText(AtualPage.. "/" ..TotalPage)
3650 onMarket(01)
3651 end
3652end
3653function UpgradeStarFilterChangeSortType(comboBox, option, value)
3654 StarFilterMarketChangeSort(value:lower())
3655end
3656
3657function onSearchWord()
3658 if delaySearch == 00 then
3659 if #Search_1:getText() > 0 then
3660 CleanAllMarketSlots()
3661 delaySearch = 01
3662 WordPesquisa = 01
3663 AtualPage = 01
3664 RareSearchItem:setVisible(false)
3665 StarSearchItem:setVisible(false)
3666 g_game.getProtocolGame():sendExtendedOpcode(search_market, "0," ..Search_1:getText())
3667 --onMarket(01)
3668 end
3669
3670 scheduleEvent(function()
3671 delaySearch = 00
3672 end, 1000)
3673 end
3674
3675 --scheduleEvent(function() g_keyboard.bindKeyPress('Enter', function() onSearchWord() end) end, delaySearch)
3676end
3677function onCloseInsertItem()
3678 insertOffert:setVisible(false)
3679 insertItem:setVisible(false)
3680 if sellWindow ~= nil then
3681 sellWindow:destroy()
3682 sellWindow = nil
3683 end
3684 OffertBox:hide()
3685end
3686
3687-- FUNCTIONS SKILLS
3688function onSkillUpgrade(bagpos, IDSkill)
3689 if TotalItem == 1 then
3690 g_game.talk(g_game.talk("!inventario 29 " ..ComboBoxType.." " ..itemId.. " " ..BagSelect.. " " ..bagpos.. " " ..IDSkill.. " " ..SlotSkillSelect))
3691 end
3692end
3693function SkillsHide()
3694 --[[
3695 for X = 01, 20 do
3696 BAG = CentralBox:recursiveGetChildById('SBag' ..X)
3697 BAG:hide()
3698 end
3699 SkillSelectItem:hide()
3700 Skill1:hide() Skill2:hide() Skill3:hide()
3701 BACKPACK_01:hide()
3702 BACKPACK_02:hide()
3703 BACKPACK_03:hide()
3704 BACKPACK_04:hide()
3705 ]]
3706
3707end
3708function resetSkillSelect()
3709 for X = 01, 20 do
3710 BAG = CentralBox:recursiveGetChildById('SBag' ..X)
3711 BAG:setBorderWidth(0)
3712 end
3713end
3714function ShowBag(type, id)
3715 if type == 01 then
3716 for X = 01, 20 do
3717 BAG = CentralBox:recursiveGetChildById('SBag' ..X)
3718 BAG:setOpacity("1.0")
3719 BAG:show()
3720 --g_effects.fadeIn(BAG, 50)
3721 if modules.game_database.getItemBagId(X) > 0 then
3722 if id ~= nil then
3723 if id == 4 then
3724 local bagpos = X
3725 local slotID = modules.game_database.getItemInfo(modules.game_database.getItemBagId(bagpos), 02)
3726 local skillid = modules.game_database.getItemInfo(modules.game_database.getItemBagId(bagpos), 10)
3727 if skillid > 0 and slotID == 12 then
3728 BAG.onClick = function() onSelectSkill(skillid, bagpos) end
3729 else
3730 BAG.onClick = function() end
3731 BAG:setOpacity("0.5")
3732 end
3733 elseif id == 2 or id == 5 or id == 6 or id == 8 or id == 9 then
3734 local bagpos = X
3735 local slotID = modules.game_database.getItemInfo(modules.game_database.getItemBagId(bagpos), 02)
3736 if slotID == 11 then
3737 local skillid = modules.game_database.getItemInfo(modules.game_database.getItemBagId(bagpos), 10)
3738 BAG.onClick = function() onSelectSkill(skillid, bagpos) end
3739 else
3740 BAG.onClick = function() end
3741 BAG:setOpacity("0.5")
3742 end
3743 else
3744 local bagpos = X
3745 local slotID = modules.game_database.getItemInfo(modules.game_database.getItemBagId(bagpos), 02)
3746 BAG.onClick = function() end
3747 BAG:setOpacity("0.5")
3748 end
3749 else
3750 local bagpos = X
3751 local slotID = modules.game_database.getItemInfo(modules.game_database.getItemBagId(bagpos), 02)
3752 BAG.onClick = function() end
3753 BAG:setOpacity("0.5")
3754 end
3755 end
3756 end
3757 else
3758 for X = 01, 20 do
3759 BAG = CentralBox:recursiveGetChildById('SBag' ..X)
3760 BAG:hide()
3761 BAG.onClick = function() end
3762 end
3763 end
3764end
3765function onSelectSkill(id, pos)
3766 if SlotSkillSelect > 0 then
3767 resetSkillSelect()
3768 if tutor > 0 then
3769 SkillTutor:setText(TUTORIAL[01][04])
3770 end
3771 SKILL_BAG = CentralBox:recursiveGetChildById('SBag' ..pos)
3772 if SKILL_BAG:getBorderTopWidth() == 0 then
3773 SKILL_BAG:setBorderWidth(2)
3774 SKILL_BAG:setBorderColor("yellow")
3775 TotalItem = 1
3776 SkillButton:enable()
3777 SkillButton.onClick = function() onSkillUpgrade(pos, id) end
3778 if ComboBoxType == 4 then
3779 if SlotSkillSelect == 01 then
3780 Skill1:setImageSource("/images/custom/Spells/skill_" ..id)
3781 elseif SlotSkillSelect == 02 then
3782 Skill2:setImageSource("/images/custom/Spells/skill_" ..id)
3783 elseif SlotSkillSelect == 03 then
3784 Skill3:setImageSource("/images/custom/Spells/skill_" ..id)
3785 end
3786 else
3787 if SlotSkillSelect == 01 then
3788 Skill1:setImageSource("/images/custom/Spells/atr_" ..id)
3789 elseif SlotSkillSelect == 02 then
3790 Skill2:setImageSource("/images/custom/Spells/atr_" ..id)
3791 end
3792 end
3793 else
3794 SKILL_BAG:setBorderWidth(0)
3795 TotalItem = 0
3796 SkillButton:disable()
3797 if ComboBoxType == 4 then
3798 if SlotSkillSelect == 01 then
3799 Skill1:setImageSource("/images/custom/UI/spell_slot")
3800 if skillRare > 1 then
3801 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
3802 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
3803 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
3804 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
3805 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
3806 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
3807 else
3808 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3809 Skill2:setImageSource("/images/custom/UI/insert_skill")
3810 end
3811 end
3812 if skillRare > 2 then
3813 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
3814 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
3815 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
3816 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
3817 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
3818 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
3819 else
3820 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3821 Skill3:setImageSource("/images/custom/UI/insert_skill")
3822 end
3823 end
3824 elseif SlotSkillSelect == 02 then
3825 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
3826 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
3827 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
3828 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
3829 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
3830 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
3831 else
3832 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3833 Skill1:setImageSource("/images/custom/UI/insert_skill")
3834 end
3835 Skill2:setImageSource("/images/custom/UI/spell_slot")
3836 if skillRare > 2 then
3837 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
3838 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
3839 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
3840 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
3841 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
3842 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
3843 else
3844 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3845 Skill3:setImageSource("/images/custom/UI/insert_skill")
3846 end
3847 end
3848 elseif SlotSkillSelect == 03 then
3849 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
3850 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
3851 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
3852 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
3853 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
3854 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
3855 else
3856 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3857 Skill1:setImageSource("/images/custom/UI/insert_skill")
3858 end
3859 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
3860 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
3861 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
3862 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
3863 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
3864 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
3865 else
3866 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3867 Skill2:setImageSource("/images/custom/UI/insert_skill")
3868 end
3869 Skill3:setImageSource("/images/custom/UI/spell_slot")
3870 end
3871 else
3872 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
3873 atr_01 = modules.game_database.getInventory(ComboBoxType, 6)
3874 atr_02 = modules.game_database.getInventory(ComboBoxType, 7)name = modules.game_database.getAtrInfo(atr_01, 00)
3875 desc = modules.game_database.getAtrInfo(atr_01, 07)
3876 percent = modules.game_database.getAtrInfo(atr_01, 01)
3877 text = modules.game_database.getAtrInfo(atr_01, 02)
3878
3879 Skill1:setTooltip(name.. "\n" ..desc.. " (" ..text.. " " ..percent.."%)")
3880 Skill1:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(ComboBoxType, 06))
3881 Skill1.onClick = function() end
3882 else
3883 if SlotSkillSelect == 01 then
3884 Skill1:setImageSource("/images/custom/UI/spell_slot")
3885 end
3886 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3887 Skill1.onClick = function()
3888 resetSkillSelect()
3889 Skill1:setImageSource("/images/custom/UI/spell_slot")
3890 if modules.game_database.getInventory(ComboBoxType, 07) > 0 then
3891 Skill2:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(ComboBoxType, 07))
3892 else
3893 Skill2:setImageSource("/images/custom/UI/insert_skill")
3894 end
3895 ShowBag(01, ComboBoxType)
3896 SlotSkillSelect = 1
3897 end
3898 end
3899 if modules.game_database.getInventory(ComboBoxType, 07) > 0 then
3900 atr_01 = modules.game_database.getInventory(ComboBoxType, 6)
3901 atr_02 = modules.game_database.getInventory(ComboBoxType, 7)
3902 name = modules.game_database.getAtrInfo(atr_02, 00)
3903 desc = modules.game_database.getAtrInfo(atr_02, 07)
3904 percent = modules.game_database.getAtrInfo(atr_02, 01)
3905 text = modules.game_database.getAtrInfo(atr_02, 02)
3906
3907 Skill2:setTooltip(name.. "\n" ..desc.. " (" ..text.. " " ..percent.."%)")
3908 Skill2:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(ComboBoxType, 07))
3909 Skill2.onClick = function() end
3910 else
3911 if SlotSkillSelect == 02 then
3912 Skill2:setImageSource("/images/custom/UI/spell_slot")
3913 end
3914 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3915 Skill2.onClick = function()
3916 resetSkillSelect()
3917 Skill2:setImageSource("/images/custom/UI/spell_slot")
3918 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
3919 Skill1:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(ComboBoxType, 06))
3920 else
3921 Skill1:setImageSource("/images/custom/UI/insert_skill")
3922 end
3923 ShowBag(01, ComboBoxType)
3924 SlotSkillSelect = 2
3925 end
3926 end
3927 end
3928 end
3929 end
3930end
3931function onSkillSelectItem(id, slotpos, rare)
3932 SkillButton:disable()
3933 SkillSelectItem:setImageSource("/images/custom/UI/item_slot")
3934 SkillSelectItem:setIcon("/images/custom/Items/0")
3935 Skill1:setImageSource("/images/custom/UI/insert_skill")
3936 Skill2:setImageSource("/images/custom/UI/insert_skill")
3937 Skill3:setImageSource("/images/custom/UI/insert_skill")
3938 Skill1:hide() Skill2:hide() Skill3:hide()
3939 Skill1:setTooltip("") Skill2:setTooltip("") Skill3:setTooltip("")
3940 ShowBag(01, 01)
3941 if tutor > 0 then
3942 SkillTutor:setText(TUTORIAL[01][02])
3943 end
3944 if id == 04 then
3945 SkillSelectItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(slotpos, 02))
3946 SkillSelectItem:setIcon("/images/custom/Items/" ..modules.game_database.getInventory(slotpos, 01))
3947 SkillSelectItem:show()
3948 g_effects.fadeIn(SkillSelectItem, 250)
3949 scheduleEvent(function()
3950 if rare > 0 then
3951 if modules.game_database.getInventory(slotpos, 04) > 0 then
3952 skill_01 = modules.game_database.getInventory(slotpos, 4)
3953 skill_02 = modules.game_database.getInventory(slotpos, 5)
3954 skill_03 = modules.game_database.getInventory(slotpos, 6)
3955 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
3956 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 04))
3957 if rare == 4 then
3958 resetSkillSelect()
3959 Skill1.onClick = function()
3960 if tutor > 0 then
3961 SkillTutor:setText(TUTORIAL[01][03])
3962 end
3963 resetSkillSelect()
3964 Skill1:setImageSource("/images/custom/UI/spell_slot")
3965 if rare > 1 then
3966 if modules.game_database.getInventory(slotpos, 05) > 0 then
3967 skill_01 = modules.game_database.getInventory(slotpos, 4)
3968 skill_02 = modules.game_database.getInventory(slotpos, 5)
3969 skill_03 = modules.game_database.getInventory(slotpos, 6)
3970 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
3971 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 05))
3972 else
3973 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3974 Skill2:setImageSource("/images/custom/UI/insert_skill")
3975 end
3976 end
3977 if rare > 2 then
3978 if modules.game_database.getInventory(slotpos, 06) > 0 then
3979 skill_01 = modules.game_database.getInventory(slotpos, 4)
3980 skill_02 = modules.game_database.getInventory(slotpos, 5)
3981 skill_03 = modules.game_database.getInventory(slotpos, 6)
3982 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
3983 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 06))
3984 else
3985 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3986 Skill3:setImageSource("/images/custom/UI/insert_skill")
3987 end
3988 end
3989 ShowBag(01, ComboBoxType)
3990 SlotSkillSelect = 1
3991 end
3992 else
3993 Skill1.onClick = function() end
3994 end
3995 else
3996 resetSkillSelect()
3997 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
3998 Skill1:setImageSource("/images/custom/UI/insert_skill")
3999 Skill1.onClick = function()
4000 if tutor > 0 then
4001 SkillTutor:setText(TUTORIAL[01][03])
4002 end
4003 resetSkillSelect()
4004 Skill1:setImageSource("/images/custom/UI/spell_slot")
4005 if rare > 1 then
4006 if modules.game_database.getInventory(slotpos, 05) > 0 then
4007 skill_01 = modules.game_database.getInventory(slotpos, 4)
4008 skill_02 = modules.game_database.getInventory(slotpos, 5)
4009 skill_03 = modules.game_database.getInventory(slotpos, 6)
4010 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4011 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 05))
4012 else
4013 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4014 Skill2:setImageSource("/images/custom/UI/insert_skill")
4015 end
4016 end
4017 if rare > 2 then
4018 if modules.game_database.getInventory(slotpos, 06) > 0 then
4019 skill_01 = modules.game_database.getInventory(slotpos, 4)
4020 skill_02 = modules.game_database.getInventory(slotpos, 5)
4021 skill_03 = modules.game_database.getInventory(slotpos, 6)
4022 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4023 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 06))
4024 else
4025 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4026 Skill3:setImageSource("/images/custom/UI/insert_skill")
4027 end
4028 end
4029 ShowBag(01, ComboBoxType)
4030 SlotSkillSelect = 1
4031 end
4032 end
4033 else
4034 Skill1:setTooltip(tr("Itens com raridade inferior a 'Melhorado' nao recebem slot."))
4035 Skill1:setImageSource("/images/custom/UI/lock_skill")
4036 Skill1.onClick = function() end
4037 end
4038 Skill1:show()
4039 g_effects.fadeIn(Skill1, 250)
4040 scheduleEvent(function()
4041 if rare > 1 then
4042 if modules.game_database.getInventory(slotpos, 05) > 0 then
4043 skill_01 = modules.game_database.getInventory(slotpos, 4)
4044 skill_02 = modules.game_database.getInventory(slotpos, 5)
4045 skill_03 = modules.game_database.getInventory(slotpos, 6)
4046 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4047 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 05))
4048 if rare == 4 then
4049 resetSkillSelect()
4050 Skill2.onClick = function()
4051 resetSkillSelect()
4052 Skill2:setImageSource("/images/custom/UI/spell_slot")
4053 if modules.game_database.getInventory(slotpos, 04) > 0 then
4054 skill_01 = modules.game_database.getInventory(slotpos, 4)
4055 skill_02 = modules.game_database.getInventory(slotpos, 5)
4056 skill_03 = modules.game_database.getInventory(slotpos, 6)
4057 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4058 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 04))
4059 else
4060 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4061 Skill1:setImageSource("/images/custom/UI/insert_skill")
4062 end
4063 if rare > 2 then
4064 if modules.game_database.getInventory(slotpos, 06) > 0 then
4065 skill_01 = modules.game_database.getInventory(slotpos, 4)
4066 skill_02 = modules.game_database.getInventory(slotpos, 5)
4067 skill_03 = modules.game_database.getInventory(slotpos, 6)
4068 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4069 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 06))
4070 else
4071 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4072 Skill3:setImageSource("/images/custom/UI/insert_skill")
4073 end
4074 end
4075 ShowBag(01, ComboBoxType)
4076 SlotSkillSelect = 2
4077 end
4078 else
4079 Skill2.onClick = function() end
4080 end
4081 else
4082 resetSkillSelect()
4083 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4084 Skill2:setImageSource("/images/custom/UI/insert_skill")
4085 Skill2.onClick = function()
4086 resetSkillSelect()
4087 Skill2:setImageSource("/images/custom/UI/spell_slot")
4088 if modules.game_database.getInventory(slotpos, 04) > 0 then
4089 skill_01 = modules.game_database.getInventory(slotpos, 4)
4090 skill_02 = modules.game_database.getInventory(slotpos, 5)
4091 skill_03 = modules.game_database.getInventory(slotpos, 6)
4092 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4093 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 04))
4094 else
4095 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4096 Skill1:setImageSource("/images/custom/UI/insert_skill")
4097 end
4098 if rare > 2 then
4099 if modules.game_database.getInventory(slotpos, 06) > 0 then
4100 skill_01 = modules.game_database.getInventory(slotpos, 4)
4101 skill_02 = modules.game_database.getInventory(slotpos, 5)
4102 skill_03 = modules.game_database.getInventory(slotpos, 6)
4103 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4104 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 06))
4105 else
4106 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4107 Skill3:setImageSource("/images/custom/UI/insert_skill")
4108 end
4109 end
4110 ShowBag(01, ComboBoxType)
4111 SlotSkillSelect = 2
4112 end
4113 end
4114 else
4115 Skill2:setTooltip(tr("Itens com raridade inferior a 'Raro' nao recebe um segundo slot."))
4116 Skill2:setImageSource("/images/custom/UI/lock_skill")
4117 Skill2.onClick = function() end
4118 end
4119 Skill2:show()
4120 g_effects.fadeIn(Skill2, 250)
4121 scheduleEvent(function()
4122 if rare > 2 then
4123 if modules.game_database.getInventory(slotpos, 06) > 0 then
4124 skill_01 = modules.game_database.getInventory(slotpos, 4)
4125 skill_02 = modules.game_database.getInventory(slotpos, 5)
4126 skill_03 = modules.game_database.getInventory(slotpos, 6)
4127 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4128 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 06))
4129 if rare == 4 then
4130 resetSkillSelect()
4131 --Skill3:setTooltip("Clique para escolher uma\nSkill de sua Backpack")
4132 --Skill3:setImageSource("/images/custom/UI/insert_skill")
4133 Skill3.onClick = function()
4134 resetSkillSelect()
4135 Skill3:setImageSource("/images/custom/UI/spell_slot")
4136 if modules.game_database.getInventory(slotpos, 04) > 0 then
4137 skill_01 = modules.game_database.getInventory(slotpos, 4)
4138 skill_02 = modules.game_database.getInventory(slotpos, 5)
4139 skill_03 = modules.game_database.getInventory(slotpos, 6)
4140 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4141 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 04))
4142 else
4143 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4144 Skill1:setImageSource("/images/custom/UI/insert_skill")
4145 end
4146 if modules.game_database.getInventory(slotpos, 05) > 0 then
4147 skill_01 = modules.game_database.getInventory(slotpos, 4)
4148 skill_02 = modules.game_database.getInventory(slotpos, 5)
4149 skill_03 = modules.game_database.getInventory(slotpos, 6)
4150 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4151 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 05))
4152 else
4153 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4154 Skill2:setImageSource("/images/custom/UI/insert_skill")
4155 end
4156 ShowBag(01, ComboBoxType)
4157 SlotSkillSelect = 3
4158 end
4159 else
4160 Skill3.onClick = function() end
4161 end
4162 else
4163 resetSkillSelect()
4164 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4165 Skill3:setImageSource("/images/custom/UI/insert_skill")
4166 Skill3.onClick = function()
4167 resetSkillSelect()
4168 Skill3:setImageSource("/images/custom/UI/spell_slot")
4169 if modules.game_database.getInventory(slotpos, 04) > 0 then
4170 skill_01 = modules.game_database.getInventory(slotpos, 4)
4171 skill_02 = modules.game_database.getInventory(slotpos, 5)
4172 skill_03 = modules.game_database.getInventory(slotpos, 6)
4173 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4174 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 04))
4175 else
4176 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4177 Skill1:setImageSource("/images/custom/UI/insert_skill")
4178 end
4179 if modules.game_database.getInventory(slotpos, 05) > 0 then
4180 skill_01 = modules.game_database.getInventory(slotpos, 4)
4181 skill_02 = modules.game_database.getInventory(slotpos, 5)
4182 skill_03 = modules.game_database.getInventory(slotpos, 6)
4183 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4184 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(slotpos, 05))
4185 else
4186 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4187 Skill2:setImageSource("/images/custom/UI/insert_skill")
4188 end
4189 ShowBag(01, ComboBoxType)
4190 SlotSkillSelect = 3
4191 end
4192 end
4193 else
4194 Skill3:setTooltip(tr("Itens com raridade inferior a 'Epico' nao recebe um terceiro slot."))
4195 Skill3:setImageSource("/images/custom/UI/lock_skill")
4196 Skill3.onClick = function() end
4197 end
4198 Skill3:show()
4199 g_effects.fadeIn(Skill3, 250)
4200 end, 50)
4201 end, 50)
4202 end, 50)
4203 elseif id == 02 or id == 05 or id == 06 or id == 08 or id == 09 then
4204 SkillSelectItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(slotpos, 02))
4205 SkillSelectItem:setIcon("/images/custom/Items/" ..modules.game_database.getInventory(slotpos, 01))
4206 SkillSelectItem:show()
4207 g_effects.fadeIn(SkillSelectItem, 250)
4208 scheduleEvent(function()
4209 if modules.game_database.getInventory(slotpos, 06) > 0 then
4210 atr_01 = modules.game_database.getInventory(slotpos, 6)
4211 atr_02 = modules.game_database.getInventory(slotpos, 7)
4212 name = modules.game_database.getAtrInfo(atr_01, 00)
4213 desc = modules.game_database.getAtrInfo(atr_01, 07)
4214 percent = modules.game_database.getAtrInfo(atr_01, 01)
4215 text = modules.game_database.getAtrInfo(atr_01, 02)
4216 txtper = modules.game_database.getAtrInfo(atr_01, 08)
4217
4218 Skill1:setTooltip(name.. "\n" ..desc.. " (" ..text.. " " ..percent.."" ..txtper..")")
4219 Skill1:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(slotpos, 06))
4220 Skill1.onClick = function() end
4221 else
4222 resetSkillSelect()
4223 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4224 Skill1.onClick = function()
4225 resetSkillSelect()
4226 Skill1:setImageSource("/images/custom/UI/spell_slot")
4227 if modules.game_database.getInventory(slotpos, 07) > 0 then
4228 Skill2:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(slotpos, 07))
4229 else
4230 Skill2:setImageSource("/images/custom/UI/insert_skill")
4231 end
4232 ShowBag(01, ComboBoxType)
4233 SlotSkillSelect = 1
4234 end
4235 end
4236
4237 Skill1:show()
4238 g_effects.fadeIn(Skill1, 250)
4239 scheduleEvent(function()
4240 if modules.game_database.getInventory(slotpos, 07) > 0 then
4241 atr_01 = modules.game_database.getInventory(slotpos, 6)
4242 atr_02 = modules.game_database.getInventory(slotpos, 7)
4243 name = modules.game_database.getAtrInfo(atr_02, 00)
4244 desc = modules.game_database.getAtrInfo(atr_02, 07)
4245 percent = modules.game_database.getAtrInfo(atr_02, 01)
4246 text = modules.game_database.getAtrInfo(atr_02, 02)
4247
4248 Skill2:setTooltip(name.. "\n" ..desc.. " (" ..text.. " " ..percent.."%)")
4249 Skill2:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(slotpos, 07))
4250 Skill2.onClick = function() end
4251 else
4252 resetSkillSelect()
4253 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4254 Skill2.onClick = function()
4255 resetSkillSelect()
4256 Skill2:setImageSource("/images/custom/UI/spell_slot")
4257 if modules.game_database.getInventory(slotpos, 06) > 0 then
4258 Skill1:setImageSource("/images/custom/Spells/atr_" ..modules.game_database.getInventory(slotpos, 06))
4259 else
4260 Skill1:setImageSource("/images/custom/UI/insert_skill")
4261 end
4262 ShowBag(01, ComboBoxType)
4263 SlotSkillSelect = 2
4264 end
4265 end
4266
4267 Skill2:show()
4268 g_effects.fadeIn(Skill2, 250)
4269 end, 50)
4270 end, 50)
4271 end
4272end
4273function onClickBackpack()
4274 resetSkillSelect()
4275 if SlotSkillSelect == 01 then
4276 if ComboBoxType ~= 4 then
4277 onSkillSelectItem(ComboBoxType, ComboBoxType, skillRare)
4278 return true
4279 end
4280 Skill1:setImageSource("/images/custom/UI/spell_slot")
4281 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4282 if skillRare > 1 then
4283 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
4284 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4285 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4286 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4287 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4288 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
4289 else
4290 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4291 Skill2:setImageSource("/images/custom/UI/insert_skill")
4292 end
4293 end
4294 if skillRare > 2 then
4295 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
4296 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4297 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4298 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4299 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4300 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
4301 else
4302 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4303 Skill3:setImageSource("/images/custom/UI/insert_skill")
4304 end
4305 end
4306 elseif SlotSkillSelect == 02 then
4307 if ComboBoxType ~= 4 then
4308 onSkillSelectItem(ComboBoxType, ComboBoxType, skillRare)
4309 return true
4310 end
4311 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
4312 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4313 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4314 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4315 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4316 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
4317 else
4318 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4319 Skill1:setImageSource("/images/custom/UI/insert_skill")
4320 end
4321
4322 Skill2:setImageSource("/images/custom/UI/spell_slot")
4323 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4324 if skillRare > 2 then
4325 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
4326 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4327 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4328 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4329 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4330 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
4331 else
4332 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4333 Skill3:setImageSource("/images/custom/UI/insert_skill")
4334 end
4335 end
4336 elseif SlotSkillSelect == 03 then
4337 if ComboBoxType ~= 4 then
4338 onSkillSelectItem(ComboBoxType, ComboBoxType, skillRare)
4339 return true
4340 end
4341 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
4342 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4343 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4344 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4345 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4346 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
4347 else
4348 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4349 Skill1:setImageSource("/images/custom/UI/insert_skill")
4350 end
4351 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
4352 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4353 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4354 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4355 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4356 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
4357 else
4358 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4359 Skill2:setImageSource("/images/custom/UI/insert_skill")
4360 end
4361 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4362 Skill3:setImageSource("/images/custom/UI/spell_slot")
4363 end
4364end
4365function LoadSkills(Index)
4366 SKILL_BAG = CentralBox:recursiveGetChildById('SBag' ..Index)
4367 scheduleEvent(function()
4368 if modules.game_database.getItemBagId(Index) > 0 then
4369 local id_bag = Index
4370 local id = modules.game_database.getItemBagId(id_bag)
4371 local slot_bag = modules.game_database.getItemInfo(id, 02)
4372 SKILL_BAG:setText("")
4373 SKILL_BAG:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(id_bag))
4374 SKILL_BAG:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(id_bag))
4375 local qnt = modules.game_database.getPosBackpack(id_bag, 04)
4376 if slot_bag == 12 then
4377 local skill_01 = modules.game_database.getItemInfo(id, 10)
4378 SKILL_BAG:setTooltip("@SKILL " ..skill_01.. " --")
4379 else
4380 local starr = modules.game_database.getPosBackpack(id_bag, 03)
4381 local rare = modules.game_database.getPosBackpack(id_bag, 02)
4382 local lock = modules.game_database.getPosBackpack(id_bag, 09)
4383 SKILL_BAG:setTooltip("@BAG " ..id.. " " ..rare.. " " ..starr.. " " ..qnt.. " 0 0 0 0 " ..lock.. " 0")
4384 end
4385 if qnt > 0 then
4386 if qnt < 10 then
4387 SKILL_BAG:setText("0" ..modules.game_database.getPosBackpack(id_bag, 04))
4388 else
4389 SKILL_BAG:setText(modules.game_database.getPosBackpack(id_bag, 04))
4390 end
4391 else
4392 SKILL_BAG:setText("")
4393 end
4394 else
4395 SKILL_BAG:setIcon("/images/custom/UI/none")
4396 SKILL_BAG:setImageSource("/images/custom/UI/item_slot")
4397 SKILL_BAG:setTooltip("")
4398 SKILL_BAG:setText("")
4399 SKILL_BAG.onClick = function() end
4400 end
4401 SKILL_BAG:show()
4402 if Index < 20 then
4403 Index = Index + 1
4404 LoadSkills(Index)
4405 else
4406 if modules.game_database.getInventory(01, 01) > 0 then
4407 local id = modules.game_database.getInventory(01, 01)
4408 local star = modules.game_database.getInventory(1, 3)
4409 local rare = modules.game_database.getInventory(1, 2)
4410 local level = modules.game_database.getInventory(1, 5)
4411 local lock = modules.game_database.getInventory(1, 9)
4412
4413 AmuletItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(01, 02))
4414 AmuletItem:setIcon("/images/custom/Items/" ..id)
4415 AmuletItem:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
4416 else
4417 AmuletItem:setImageSource("/images/custom/UI/item_slot")
4418 AmuletItem:setIcon("/images/custom/Items/0")
4419 AmuletItem:setTooltip("")
4420 end
4421 if modules.game_database.getInventory(02, 01) > 0 then
4422 itemId = modules.game_database.getInventory(2, 1)
4423 star = modules.game_database.getInventory(2, 3)
4424 level = modules.game_database.getInventory(2, 5)
4425 local Rari = modules.game_database.getInventory(2, 2)
4426 local atr1 = modules.game_database.getInventory(2, 6)
4427 local atr2 = modules.game_database.getInventory(2, 7)
4428 local rare = modules.game_database.getInventory(2, 2)
4429 local lock = modules.game_database.getInventory(2, 9)
4430 local bonus = modules.game_database.getInventory(2, 8)
4431
4432 HelmetItem.onClick = function() skillRare = Rari ComboBoxType = 02 onSkillSelectItem(ComboBoxType, 02, Rari) end
4433 HelmetItem:setTooltip("@EQUIP " ..itemId.. " " ..Rari.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
4434 HelmetItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(02, 02))
4435 HelmetItem:setIcon("/images/custom/Items/" ..itemId)
4436 --g_effects.fadeIn(HelmetItem, 250)
4437 else
4438 HelmetItem:setImageSource("/images/custom/UI/item_slot")
4439 HelmetItem:setIcon("/images/custom/Items/0")
4440 HelmetItem:setTooltip("")
4441 --g_effects.fadeIn(HelmetItem, 250)
4442 end
4443 if modules.game_database.getInventory(03, 01) > 0 then
4444 id = modules.game_database.getInventory(3, 1)
4445 star = modules.game_database.getInventory(3, 3)
4446 rare = modules.game_database.getInventory(3, 2)
4447 level = modules.game_database.getInventory(3, 5)
4448 lock = modules.game_database.getInventory(3, 9)
4449 BackpackItem:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
4450 BackpackItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(03, 02))
4451 BackpackItem:setIcon("/images/custom/Items/" ..id)
4452 else
4453 BackpackItem:setImageSource("/images/custom/UI/item_slot")
4454 BackpackItem:setIcon("/images/custom/Items/0")
4455 BackpackItem:setTooltip("")
4456 end
4457 if modules.game_database.getInventory(04, 01) > 0 then
4458 itemId = modules.game_database.getInventory(4, 1)
4459 skill_01 = modules.game_database.getInventory(4, 4)
4460 skill_02 = modules.game_database.getInventory(4, 5)
4461 skill_03 = modules.game_database.getInventory(4, 6)
4462 Level = modules.game_database.getInventory(4, 7)
4463 Star = modules.game_database.getInventory(4, 3)
4464 local Rari = modules.game_database.getInventory(04, 02)
4465 local lock = modules.game_database.getInventory(04, 09)
4466 local Bonus = modules.game_database.getInventory(04, 08)
4467 local Ammo = modules.game_database.getInventory(04, 10)
4468
4469 GunItem.onClick = function() skillRare = Rari ComboBoxType = 04 onSkillSelectItem(ComboBoxType, 04, Rari) end
4470 GunItem:setTooltip("@INVGUN " ..itemId.. " " ..Rari.. " " ..Star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..Level.. " " ..Bonus.. " " ..lock.. " " ..Ammo)
4471 GunItem:setImageSource("/images/custom/UI/rare_" ..Rari)
4472 GunItem:setIcon("/images/custom/Items/" ..itemId)
4473 --g_effects.fadeIn(GunItem, 250)
4474 else
4475 GunItem:setImageSource("/images/custom/UI/item_slot")
4476 GunItem:setIcon("/images/custom/Items/0")
4477 GunItem:setTooltip("")
4478 GunItem.onClick = function() end
4479 --g_effects.fadeIn(GunItem, 250)
4480 end
4481 if modules.game_database.getInventory(05, 01) > 0 then
4482 itemId = modules.game_database.getInventory(5, 1)
4483 star = modules.game_database.getInventory(5, 3)
4484 level = modules.game_database.getInventory(5, 5)
4485 local Rari = modules.game_database.getInventory(05, 02)
4486 local atr1 = modules.game_database.getInventory(5, 6)
4487 local atr2 = modules.game_database.getInventory(5, 7)
4488 local lock = modules.game_database.getInventory(5, 9)
4489 local bonus = modules.game_database.getInventory(5, 8)
4490
4491 ArmorItem.onClick = function() skillRare = Rari ComboBoxType = 05 onSkillSelectItem(ComboBoxType, 05, Rari) end
4492 ArmorItem:setTooltip("@EQUIP " ..itemId.. " " ..Rari.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
4493 ArmorItem:setImageSource("/images/custom/UI/rare_" ..Rari)
4494 ArmorItem:setIcon("/images/custom/Items/" ..itemId)
4495 --g_effects.fadeIn(ArmorItem, 250)
4496 else
4497 ArmorItem:setImageSource("/images/custom/UI/item_slot")
4498 ArmorItem:setIcon("/images/custom/Items/0")
4499 ArmorItem:setTooltip("")
4500 --g_effects.fadeIn(ArmorItem, 250)
4501 end
4502 if modules.game_database.getInventory(06, 01) > 0 then
4503 itemId = modules.game_database.getInventory(6, 1)
4504 star = modules.game_database.getInventory(6, 3)
4505 level = modules.game_database.getInventory(6, 5)
4506 local Rari = modules.game_database.getInventory(6, 2)
4507 local atr1 = modules.game_database.getInventory(6, 6)
4508 local atr2 = modules.game_database.getInventory(6, 7)
4509 local lock = modules.game_database.getInventory(6, 9)
4510 local bonus = modules.game_database.getInventory(6, 8)
4511
4512 GloveItem.onClick = function() skillRare = Rari ComboBoxType = 06 onSkillSelectItem(ComboBoxType, 06, Rari) end
4513 GloveItem:setTooltip("@EQUIP " ..itemId.. " " ..Rari.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
4514 GloveItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(06, 02))
4515 GloveItem:setIcon("/images/custom/Items/" ..itemId)
4516 --g_effects.fadeIn(GloveItem, 250)
4517 else
4518 GloveItem:setImageSource("/images/custom/UI/item_slot")
4519 GloveItem:setIcon("/images/custom/Items/0")
4520 GloveItem:setTooltip("")
4521 --g_effects.fadeIn(GloveItem, 250)
4522 end
4523 if modules.game_database.getInventory(07, 01) > 0 then
4524 id = modules.game_database.getInventory(7, 1)
4525 star = modules.game_database.getInventory(7, 3)
4526 rare = modules.game_database.getInventory(7, 2)
4527 level = modules.game_database.getInventory(7, 5)
4528 lock = modules.game_database.getInventory(7, 9)
4529 RingItem:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
4530 RingItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(07, 02))
4531 RingItem:setIcon("/images/custom/Items/" ..id)
4532 else
4533 RingItem:setImageSource("/images/custom/UI/item_slot")
4534 RingItem:setIcon("/images/custom/Items/0")
4535 RingItem:setTooltip("")
4536 end
4537 if modules.game_database.getInventory(08, 01) > 0 then
4538 itemId = modules.game_database.getInventory(8, 1)
4539 star = modules.game_database.getInventory(8, 3)
4540 level = modules.game_database.getInventory(8, 5)
4541 local Rari = modules.game_database.getInventory(8, 2)
4542 local atr1 = modules.game_database.getInventory(8, 6)
4543 local atr2 = modules.game_database.getInventory(8, 7)
4544 local lock = modules.game_database.getInventory(8, 9)
4545 local bonus = modules.game_database.getInventory(8, 8)
4546
4547 LegsItem.onClick = function() skillRare = Rari ComboBoxType = 08 onSkillSelectItem(ComboBoxType, 08, Rari) end
4548 LegsItem:setTooltip("@EQUIP " ..itemId.. " " ..Rari.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
4549 LegsItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(08, 02))
4550 LegsItem:setIcon("/images/custom/Items/" ..itemId)
4551 --g_effects.fadeIn(LegsItem, 250)
4552 else
4553 LegsItem:setImageSource("/images/custom/UI/item_slot")
4554 LegsItem:setIcon("/images/custom/Items/0")
4555 LegsItem:setTooltip("")
4556 --g_effects.fadeIn(LegsItem, 250)
4557 end
4558 if modules.game_database.getInventory(09, 01) > 0 then
4559 itemId = modules.game_database.getInventory(9, 1)
4560 star = modules.game_database.getInventory(9, 3)
4561 level = modules.game_database.getInventory(9, 5)
4562 local Rari = modules.game_database.getInventory(9, 2)
4563 local atr1 = modules.game_database.getInventory(9, 6)
4564 local atr2 = modules.game_database.getInventory(9, 7)
4565 local lock = modules.game_database.getInventory(9, 9)
4566 local bonus = modules.game_database.getInventory(9, 8)
4567
4568 BootsItem.onClick = function() skillRare = Rari ComboBoxType = 09 onSkillSelectItem(ComboBoxType, 09, Rari) end
4569 BootsItem:setTooltip("@EQUIP " ..itemId.. " " ..Rari.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
4570 BootsItem:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(09, 02))
4571 BootsItem:setIcon("/images/custom/Items/" ..itemId)
4572 --g_effects.fadeIn(BootsItem, 250)
4573 else
4574 BootsItem:setImageSource("/images/custom/UI/item_slot")
4575 BootsItem:setIcon("/images/custom/Items/0")
4576 BootsItem:setTooltip("")
4577 --g_effects.fadeIn(BootsItem, 250)
4578 end
4579
4580 BACKPACK_01 = CentralBox:recursiveGetChildById('SBackpack1')
4581 BACKPACK_02 = CentralBox:recursiveGetChildById('SBackpack2')
4582 BACKPACK_03 = CentralBox:recursiveGetChildById('SBackpack3')
4583 BACKPACK_04 = CentralBox:recursiveGetChildById('SBackpack4')
4584 BACKPACK_01:show()
4585 BACKPACK_02:show()
4586 BACKPACK_03:show()
4587 BACKPACK_04:show()
4588
4589 BACKPACK_01:setTooltip("Backpack 01")
4590 g_effects.fadeIn(BACKPACK_01, 250)
4591 BACKPACK_01.onClick = function()
4592 onClickBackpack()
4593 BagSelect = 0
4594 g_game.talk(g_game.talk("!backpack 52 03 00"))
4595 end
4596 if modules.game_database.getExtension(03) >= 01 then
4597 BACKPACK_02:setTooltip("Backpack 02")
4598 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot")
4599 BACKPACK_02:show()
4600 g_effects.fadeIn(BACKPACK_02, 250)
4601
4602 BACKPACK_02.onClick = function()
4603 onClickBackpack()
4604 BagSelect = 1
4605 g_game.talk(g_game.talk("!backpack 52 03 01"))
4606 end
4607 else
4608 g_effects.fadeIn(BACKPACK_02, 250)
4609 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot_lock")
4610 BACKPACK_02:setTooltip(tr("Compre um novo Slot no Shop"))
4611 BACKPACK_02.onClick = function() end
4612 end
4613 if modules.game_database.getExtension(03) >= 02 then
4614 BACKPACK_03:setTooltip("Backpack 03")
4615 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot")
4616 BACKPACK_03:show()
4617 g_effects.fadeIn(BACKPACK_03, 250)
4618
4619 BACKPACK_03.onClick = function()
4620 resetSkillSelect()
4621
4622 if SlotSkillSelect == 01 then
4623 Skill1:setImageSource("/images/custom/UI/spell_slot")
4624 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4625 if skillRare > 1 then
4626 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
4627 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4628 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4629 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4630 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4631 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
4632 else
4633 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4634 Skill2:setImageSource("/images/custom/UI/insert_skill")
4635 end
4636 end
4637 if skillRare > 2 then
4638 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
4639 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4640 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4641 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4642 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4643 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
4644 else
4645 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4646 Skill3:setImageSource("/images/custom/UI/insert_skill")
4647 end
4648 end
4649 elseif SlotSkillSelect == 02 then
4650 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
4651 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4652 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4653 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4654 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4655 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
4656 else
4657 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4658 Skill1:setImageSource("/images/custom/UI/insert_skill")
4659 end
4660 Skill2:setImageSource("/images/custom/UI/spell_slot")
4661 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4662 if skillRare > 2 then
4663 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
4664 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4665 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4666 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4667 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4668 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
4669 else
4670 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4671 Skill3:setImageSource("/images/custom/UI/insert_skill")
4672 end
4673 end
4674 elseif SlotSkillSelect == 03 then
4675 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
4676 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4677 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4678 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4679 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4680 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
4681 else
4682 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4683 Skill1:setImageSource("/images/custom/UI/insert_skill")
4684 end
4685 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
4686 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4687 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4688 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4689 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4690 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
4691 else
4692 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4693 Skill2:setImageSource("/images/custom/UI/insert_skill")
4694 end
4695 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4696 Skill3:setImageSource("/images/custom/UI/spell_slot")
4697 end
4698 BagSelect = 2
4699 g_game.talk(g_game.talk("!backpack 52 03 02"))
4700 end
4701 else
4702 g_effects.fadeIn(BACKPACK_03, 250)
4703 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot_lock")
4704 BACKPACK_03:setTooltip(tr("Compre um novo Slot no Shop"))
4705 BACKPACK_03.onClick = function() end
4706 end
4707 if modules.game_database.getExtension(03) >= 03 then
4708 BACKPACK_04:setTooltip("Backpack 04")
4709 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot")
4710 BACKPACK_04:show()
4711 g_effects.fadeIn(BACKPACK_04, 250)
4712
4713 BACKPACK_04.onClick = function()
4714 resetSkillSelect()
4715
4716 if SlotSkillSelect == 01 then
4717 Skill1:setImageSource("/images/custom/UI/spell_slot")
4718 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4719 if skillRare > 1 then
4720 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
4721 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4722 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4723 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4724 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4725 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
4726 else
4727 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4728 Skill2:setImageSource("/images/custom/UI/insert_skill")
4729 end
4730 end
4731 if skillRare > 2 then
4732 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
4733 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4734 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4735 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4736 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4737 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
4738 else
4739 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4740 Skill3:setImageSource("/images/custom/UI/insert_skill")
4741 end
4742 end
4743 elseif SlotSkillSelect == 02 then
4744 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
4745 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4746 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4747 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4748 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4749 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
4750 else
4751 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4752 Skill1:setImageSource("/images/custom/UI/insert_skill")
4753 end
4754 Skill2:setImageSource("/images/custom/UI/spell_slot")
4755 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4756 if skillRare > 2 then
4757 if modules.game_database.getInventory(ComboBoxType, 06) > 0 then
4758 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4759 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4760 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4761 Skill3:setTooltip("@SKILL " ..skill_03.. " F3")
4762 Skill3:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 06))
4763 else
4764 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4765 Skill3:setImageSource("/images/custom/UI/insert_skill")
4766 end
4767 end
4768 elseif SlotSkillSelect == 03 then
4769 if modules.game_database.getInventory(ComboBoxType, 04) > 0 then
4770 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4771 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4772 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4773 Skill1:setTooltip("@SKILL " ..skill_01.. " F1")
4774 Skill1:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 04))
4775 else
4776 Skill1:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4777 Skill1:setImageSource("/images/custom/UI/insert_skill")
4778 end
4779 if modules.game_database.getInventory(ComboBoxType, 05) > 0 then
4780 skill_01 = modules.game_database.getInventory(ComboBoxType, 4)
4781 skill_02 = modules.game_database.getInventory(ComboBoxType, 5)
4782 skill_03 = modules.game_database.getInventory(ComboBoxType, 6)
4783 Skill2:setTooltip("@SKILL " ..skill_02.. " F2")
4784 Skill2:setImageSource("/images/custom/Spells/skill_" ..modules.game_database.getInventory(ComboBoxType, 05))
4785 else
4786 Skill2:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4787 Skill2:setImageSource("/images/custom/UI/insert_skill")
4788 end
4789 Skill3:setTooltip(tr("Clique para escolher uma\nSkill de sua Backpack"))
4790 Skill3:setImageSource("/images/custom/UI/spell_slot")
4791 end
4792 BagSelect = 3
4793 g_game.talk(g_game.talk("!backpack 52 03 03"))
4794 end
4795 else
4796 g_effects.fadeIn(BACKPACK_04, 250)
4797 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot_lock")
4798 BACKPACK_04:setTooltip(tr("Compre um novo Slot no Shop"))
4799 BACKPACK_04.onClick = function() end
4800 end
4801 end
4802 end, 10)
4803
4804 if tutor > 0 then
4805 SkillTutor:setText(TUTORIAL[01][01])
4806 end
4807 ShowBag(01, 01)
4808end
4809
4810function setSortType(value)
4811 ComboBoxSelect = tonumber(value)
4812 onResetSelectItem()
4813 g_game.talk(g_game.talk("!backpack 50 " ..value.. " 00"))
4814 TotalItem = 0
4815 TotalCust = 0
4816 if ComboBoxSelect == 04 then
4817 loadAmmo:show()
4818 else
4819 loadAmmo:hide()
4820 end
4821end
4822function onChangeSortType(comboBox, option, value)
4823 setSortType(value:lower())
4824end
4825function setUpgradeSortType(value)
4826 ComboBoxSelect = tonumber(value)
4827 TypeUpgrade:setOption("Level", "01")
4828 ComboBoxType = tonumber(value)
4829 ComboBoxType = 1
4830 if ComboBoxSelect == 4 then
4831 UpgradeLevelGun:setVisible(true)
4832 UpgradeLevelEquip:setVisible(false)
4833 UpgradeStar:setVisible(false)
4834 else
4835 UpgradeLevelGun:setVisible(false)
4836 UpgradeLevelEquip:setVisible(true)
4837 UpgradeStar:setVisible(false)
4838 end
4839 if modules.game_database.getInventory(ComboBoxSelect, 01) > 0 then
4840 ItemEquipado.onClick = function() upgradeSelectItem(0) end
4841 else
4842 ItemEquipado.onClick = function() end
4843 end
4844 resetUpgradeItem()
4845 g_game.talk(g_game.talk("!backpack 51 " ..value.. " 00"))
4846end
4847function upgradeChangeSortType(comboBox, option, value)
4848 setUpgradeSortType(value:lower())
4849end
4850function typeUpgradeChangeSort(value)
4851 ComboBoxType = tonumber(value)
4852 if value == "01" then
4853 onLoadUpgradeItens(02)
4854 if ComboBoxSelect == 4 then
4855 UpgradeLevelGun:setVisible(true)
4856 UpgradeLevelEquip:setVisible(false)
4857 UpgradeStar:setVisible(false)
4858 else
4859 UpgradeLevelGun:setVisible(false)
4860 UpgradeLevelEquip:setVisible(true)
4861 UpgradeStar:setVisible(false)
4862 end
4863 else
4864 onLoadUpgradeItens(03)
4865 UpgradeLevelEquip:setVisible(false)
4866 UpgradeLevelGun:setVisible(false)
4867 UpgradeStar:setVisible(true)
4868 end
4869
4870 if modules.game_database.getInventory(ComboBoxSelect, 01) > 0 then
4871 ItemEquipado.onClick = function() upgradeSelectItem(0) end
4872 else
4873 ItemEquipado.onClick = function() end
4874 end
4875end
4876function typeUpgradeChangeSortType(comboBox, option, value)
4877 typeUpgradeChangeSort(value:lower())
4878end
4879
4880-- FUNCTIONS VENDAS
4881function LoadBagVendas(Index)
4882 local Max = 20
4883 SELL_BAG = CentralBox:recursiveGetChildById('Bag' ..Index)
4884 scheduleEvent(function()
4885 if modules.game_database.getItemBagId(Index) > 0 then
4886 local bagid = Index
4887 local id = modules.game_database.getItemBagId(bagid)
4888 local SLOT_BAG = modules.game_database.getItemInfo(id, 02)
4889 SELL_BAG:setText("")
4890 SELL_BAG:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(bagid))
4891 SELL_BAG:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(bagid))
4892 SelectAll:enable()
4893
4894 if SLOT_BAG == 1 or SLOT_BAG == 7 then
4895 local starr = modules.game_database.getPosBackpack(bagid, 3)
4896 local rare = modules.game_database.getPosBackpack(bagid, 2)
4897 local level = modules.game_database.getPosBackpack(bagid, 5)
4898 local lock = modules.game_database.getPosBackpack(bagid, 9)
4899 SELL_BAG:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..starr.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
4900 SELL_BAG.onClick = function() onSelectItem(00, bagid) end
4901 elseif SLOT_BAG == 4 then
4902 local skill_01 = modules.game_database.getPosBackpack(bagid, 4)
4903 local skill_02 = modules.game_database.getPosBackpack(bagid, 5)
4904 local skill_03 = modules.game_database.getPosBackpack(bagid, 6)
4905 local level = modules.game_database.getPosBackpack(bagid, 7)
4906 local star = modules.game_database.getPosBackpack(bagid, 3)
4907 local rare = modules.game_database.getPosBackpack(bagid, 2)
4908 local ammo = modules.game_database.getPosBackpack(bagid, 10)
4909 local lock = modules.game_database.getPosBackpack(bagid, 9)
4910 local bonus = modules.game_database.getPosBackpack(bagid, 8)
4911 SELL_BAG.onClick = function() onSelectItem(00, bagid) end
4912 SELL_BAG:setTooltip("@GUN " ..id.. " " ..rare.. " " ..star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..level.. " " ..bonus.. " " ..lock.. " " ..ammo)
4913 elseif SLOT_BAG == 0 or SLOT_BAG == 11 or SLOT_BAG == 12 then
4914 local qnt = modules.game_database.getPosBackpack(bagid, 04)
4915 local starr = modules.game_database.getPosBackpack(bagid, 3)
4916 local rare = modules.game_database.getPosBackpack(bagid, 2)
4917 local lock = modules.game_database.getPosBackpack(bagid, 9)
4918 SELL_BAG:setTooltip("@BAG " ..id.. " " ..rare.. " " ..starr.. " " ..qnt.. " 0 0 0 0 " ..lock.. " 0")
4919 --SelectAll:disable()
4920 SELL_BAG.onClick = function() onSelectItem(01, bagid) end
4921 --SELL_BAG.onClick = function() onStackableSell(qnt, (Index - 1)) end
4922 if qnt > 0 then
4923 if qnt < 10 then
4924 SELL_BAG:setText("0" ..modules.game_database.getPosBackpack(bagid, 04))
4925 else
4926 SELL_BAG:setText(modules.game_database.getPosBackpack(bagid, 04))
4927 end
4928 else
4929 SELL_BAG:setText("")
4930 end
4931 else
4932 SELL_BAG.onClick = function() onSelectItem(00, bagid) end
4933 local starr = modules.game_database.getPosBackpack(bagid, 3)
4934 local levell = modules.game_database.getPosBackpack(bagid, 5)
4935 local atr1 = modules.game_database.getPosBackpack(bagid, 6)
4936 local atr2 = modules.game_database.getPosBackpack(bagid, 7)
4937 local rare = modules.game_database.getPosBackpack(bagid, 2)
4938 local lock = modules.game_database.getPosBackpack(bagid, 9)
4939 local bonus = modules.game_database.getPosBackpack(bagid, 8)
4940 SELL_BAG:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..starr.. " 0 " ..levell.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
4941 end
4942 else
4943 SELL_BAG:setIcon("/images/custom/UI/none")
4944 SELL_BAG:setImageSource("/images/custom/UI/item_slot")
4945 SELL_BAG:setTooltip("")
4946 SELL_BAG:setText("")
4947 SELL_BAG.onClick = function() end
4948 end
4949
4950 SELL_BAG:show()
4951 g_effects.fadeIn(SELL_BAG, 50)
4952 if Index < Max then
4953 Index = Index + 1
4954 LoadBagVendas(Index)
4955 else
4956 BACKPACK_01 = CentralBox:recursiveGetChildById('Backpack1')
4957 BACKPACK_02 = CentralBox:recursiveGetChildById('Backpack2')
4958 BACKPACK_03 = CentralBox:recursiveGetChildById('Backpack3')
4959 BACKPACK_04 = CentralBox:recursiveGetChildById('Backpack4')
4960 BACKPACK_01:show()
4961 BACKPACK_02:show()
4962 BACKPACK_03:show()
4963 BACKPACK_04:show()
4964
4965 BACKPACK_01:setTooltip("Backpack 01")
4966 g_effects.fadeIn(BACKPACK_01, 250)
4967 BACKPACK_01.onClick = function()
4968 onResetSelectItem()
4969 BagSelect = 0
4970 g_game.talk(g_game.talk("!backpack 50 "..ComboBoxSelect.. " 00"))
4971 end
4972 if modules.game_database.getExtension(ComboBoxSelect) >= 01 then
4973 BACKPACK_02:setTooltip("Backpack 02")
4974 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot")
4975 g_effects.fadeIn(BACKPACK_02, 250)
4976
4977 BACKPACK_02.onClick = function()
4978 onResetSelectItem()
4979 BagSelect = 1
4980 g_game.talk(g_game.talk("!backpack 50 "..ComboBoxSelect.. " 01"))
4981 end
4982 else
4983 g_effects.fadeIn(BACKPACK_02, 250)
4984 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot_lock")
4985 BACKPACK_02:setTooltip(tr("Compre um novo Slot no Shop"))
4986 BACKPACK_02.onClick = function() end
4987 end
4988 if modules.game_database.getExtension(ComboBoxSelect) >= 02 then
4989 BACKPACK_03:setTooltip("Backpack 03")
4990 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot")
4991 g_effects.fadeIn(BACKPACK_03, 250)
4992
4993 BACKPACK_03.onClick = function()
4994 onResetSelectItem()
4995 BagSelect = 2
4996 g_game.talk(g_game.talk("!backpack 50 "..ComboBoxSelect.. " 02"))
4997 end
4998 else
4999 g_effects.fadeIn(BACKPACK_03, 250)
5000 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot_lock")
5001 BACKPACK_03:setTooltip(tr("Compre um novo Slot no Shop"))
5002 BACKPACK_03.onClick = function() end
5003 end
5004 if modules.game_database.getExtension(ComboBoxSelect) >= 03 then
5005 BACKPACK_04:setTooltip("Backpack 04")
5006 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot")
5007 g_effects.fadeIn(BACKPACK_04, 250)
5008
5009 BACKPACK_04.onClick = function()
5010 onResetSelectItem()
5011 BagSelect = 3
5012 g_game.talk(g_game.talk("!backpack 50 "..ComboBoxSelect.. " 03"))
5013 end
5014 else
5015 g_effects.fadeIn(BACKPACK_04, 250)
5016 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot_lock")
5017 BACKPACK_04:setTooltip(tr("Compre um novo Slot no Shop"))
5018 BACKPACK_04.onClick = function() end
5019 end
5020
5021 end
5022 end, 10)
5023end
5024function onSell()
5025 if TotalItem > 0 then
5026 local yesChoose = function()
5027 local SelectSell = ""
5028 for X = 01, 20 do
5029 BAG = CentralBox:recursiveGetChildById('Bag' ..X)
5030 if BAG:getBorderTopWidth() > 0 then
5031 if string.len(SelectSell) > 0 then
5032 SelectSell = SelectSell .. "," ..X
5033 else
5034 SelectSell = SelectSell ..X
5035 end
5036 end
5037 end
5038
5039 g_game.getProtocolGame():sendExtendedOpcode(Opcodes, TotalItem.. "," ..TotalCust.. "," ..BagSelect.. "," ..ComboBoxSelect.. "," ..SelectSell)
5040 onResetSelectItem()
5041 BagSelect = 0
5042 sellWindow:destroy()
5043 sellWindow = nil
5044 end
5045 local noChoose = function() sellWindow:destroy() sellWindow = nil end
5046
5047 if sellWindow == nil then
5048 sellWindow = displayGeneralBox(tr('Venda'), tr("Deseja realmente vender todos os items selecionados por").. " $ " ..TotalCust.."?",
5049 { { text=tr('Yes'), callback=yesChoose },
5050 { text=tr('No'), callback=noChoose },
5051 anchor=AnchorHorizontalCenter }, yesChoose, noChoose)
5052 else
5053 sellWindow:focus()
5054 sellWindow:raise()
5055 end
5056 end
5057end
5058function onSelectAll()
5059 TotalItem = 0
5060 TotalCust = 0
5061 for X = 01, 20 do
5062 if modules.game_database.getItemBagId(X) > 0 then
5063 --local lock = modules.game_database.getPosBackpack(X, 09)
5064 --if lock == 00 then
5065 BAG = CentralBox:recursiveGetChildById('Bag' ..X)
5066 local qnt = 01
5067 if ComboBoxSelect == 3 then
5068 qnt = modules.game_database.getPosBackpack(X, 04)
5069 end
5070 local Price = (modules.game_database.getItemInfo(modules.game_database.getItemBagId(X), 9) * qnt)
5071 local Bonus = 0
5072 if bonusVenda > 0 then
5073 Bonus = bonusVenda * (Price / 100)
5074 Price = math.floor(Price + Bonus)
5075 end
5076 if BAG:getBorderTopWidth() == 0 then
5077 BAG:setBorderWidth(2)
5078 BAG:setBorderColor("yellow")
5079 TotalItem = TotalItem + 1
5080 MaxItem:setText("Itens: " ..TotalItem)
5081 TotalCust = TotalCust + Price
5082 CustoTotal:setText(mask_number(TotalCust))
5083 end
5084 --end
5085 end
5086 end
5087end
5088function onResetSelectItem()
5089 for X = 01, 20 do
5090 BAG = CentralBox:recursiveGetChildById('Bag' ..X)
5091 BAG:setBorderWidth(0)
5092 end
5093 MaxItem:setText("Itens: " .."0")
5094 CustoTotal:setText("0")
5095 TotalItem = 0
5096 TotalCust = 0
5097end
5098function onSelectItem(type, bag)
5099 if type == 00 then
5100 BAG_WINDOW = CentralBox:recursiveGetChildById('Bag' ..bag)
5101 local qnt = 01
5102 if ComboBoxSelect == 3 then
5103 qnt = modules.game_database.getPosBackpack(bag, 04)
5104 end
5105 local Price = (modules.game_database.getItemInfo(modules.game_database.getItemBagId(bag), 9) * qnt)
5106 local Bonus = 0
5107 if bonusVenda > 0 then
5108 Bonus = bonusVenda * (Price / 100)
5109 Price = Price + Bonus
5110 end
5111 if BAG_WINDOW:getBorderTopWidth() == 0 then
5112 BAG_WINDOW:setBorderWidth(2)
5113 BAG_WINDOW:setBorderColor("yellow")
5114 TotalItem = TotalItem + 1
5115 MaxItem:setText("Itens: " ..TotalItem)
5116 TotalCust = TotalCust + Price
5117 CustoTotal:setText(mask_number(TotalCust))
5118 else
5119 BAG_WINDOW:setBorderWidth(0)
5120 TotalItem = TotalItem - 1
5121 MaxItem:setText("Itens: " ..TotalItem)
5122 TotalCust = TotalCust - Price
5123 CustoTotal:setText(mask_number(TotalCust))
5124 end
5125 else
5126 if TotalItem > 0 then
5127 onSelectItem(00, bag)
5128 else
5129 local qnt = modules.game_database.getPosBackpack(bag, 04)
5130 onStackableSell(qnt, bag)
5131 end
5132 end
5133end
5134function onStackableSell(max, id, ext, slot)
5135 local count = max
5136 local Quantity = max
5137 local ItemPrice = modules.game_database.getItemInfo(modules.game_database.getItemBagId(id), 9) * count
5138 local Bonus = 0
5139 if bonusVenda > 0 then
5140 Bonus = bonusVenda * (ItemPrice / 100)
5141 ItemPrice = math.floor(ItemPrice + Bonus)
5142 end
5143
5144 if countWindow == nil then
5145 countWindow = g_ui.createWidget('CountWindow', rootWidget)
5146 end
5147 countWindow:setText(tr("Valor da Venda").. " [$ " ..mask_number(ItemPrice).. "]")
5148 local itembox = countWindow:getChildById('item')
5149 local scrollbar = countWindow:getChildById('countScrollBar')
5150 itembox:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(id))
5151 itembox:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(id))
5152 itembox:setSize({width = 42, height = 50})
5153 itembox:setMarginTop(-07)
5154 itembox:setTextOffset('00 30')
5155 itembox:setText(count)
5156 countWindow:focus()
5157 countWindow:raise()
5158 scrollbar:setMaximum(count)
5159 scrollbar:setMinimum(1)
5160 scrollbar:setMarginTop(10)
5161 scrollbar:setValue(count)
5162
5163 local spinbox = countWindow:getChildById('spinBox')
5164 spinbox:setMaximum(count)
5165 spinbox:setMinimum(0)
5166 spinbox:setValue(0)
5167 spinbox:hideButtons()
5168 spinbox:focus()
5169 spinbox.firstEdit = true
5170
5171
5172 local spinBoxValueChange = function(self, value)
5173 spinbox.firstEdit = false
5174 scrollbar:setValue(value)
5175 end
5176 spinbox.onValueChange = spinBoxValueChange
5177 local check = function()
5178 if spinbox.firstEdit then
5179 spinbox:setValue(spinbox:getMaximum())
5180 spinbox.firstEdit = false
5181 end
5182 end
5183 scrollbar.onValueChange = function(self, value)
5184 ItemPrice = modules.game_database.getItemInfo(modules.game_database.getItemBagId(id), 9) * value
5185 if bonusVenda > 0 then
5186 Bonus = bonusVenda * (ItemPrice / 100)
5187 ItemPrice = math.floor(ItemPrice + Bonus)
5188 end
5189
5190 Quantity = value
5191 itembox:setText(value)
5192 countWindow:setText(tr("Valor da Venda").. " [$ " ..mask_number(ItemPrice).. "]")
5193 spinbox.onValueChange = nil
5194 spinbox:setValue(value)
5195 spinbox.onValueChange = spinBoxValueChange
5196 end
5197
5198 local okButton = countWindow:getChildById('buttonOk')
5199 g_keyboard.bindKeyPress('Enter', function()
5200 local StringPrice = ItemPrice--ItemPrice:gsub(",", "")
5201 if ext ~= nil then
5202 BagSelect = ext
5203 ComboBoxSelect = slot
5204 end
5205
5206 g_game.getProtocolGame():sendExtendedOpcode(Opcodes_1, StringPrice.. "," ..BagSelect.. "," ..ComboBoxSelect.. "," ..Quantity.. "," ..id)
5207 countWindow:destroy()
5208 countWindow = nil
5209 g_keyboard.unbindKeyPress('Enter')
5210 end)
5211 okButton.onClick = function()
5212 local StringPrice = ItemPrice--ItemPrice:gsub(",", "")
5213 if ext ~= nil then
5214 BagSelect = ext
5215 ComboBoxSelect = slot
5216 end
5217
5218 g_game.getProtocolGame():sendExtendedOpcode(Opcodes_1, StringPrice.. "," ..BagSelect.. "," ..ComboBoxSelect.. "," ..Quantity.. "," ..id)
5219 countWindow:destroy()
5220 countWindow = nil
5221 g_keyboard.unbindKeyPress('Enter')
5222 end
5223 local cancelButton = countWindow:getChildById('buttonCancel')
5224 cancelButton.onClick = function()
5225 countWindow:destroy()
5226 countWindow = nil
5227 g_keyboard.unbindKeyPress('Enter')
5228 end
5229end
5230
5231-- FUNCTIONS COMPRAS
5232local BUY_WINDOW = nil
5233function onBuy(product, id, rare)
5234 if CLICK_BUY then
5235 return
5236 end
5237
5238 local FINAL_PRICE = 0
5239 local price = modules.game_database.getItemInfo(id, 9)
5240 local max = 9999
5241 if product == 01 then
5242 if modules.game_database.getInventory(04, 01) > 00 then
5243 local RANK_ID = modules.game_database.getTask(00)
5244 local AMMO_COUNT = modules.game_database.getInventory(04, 10)
5245 if RANK_ID < 01 then
5246 RANK_ID = 01
5247 end
5248 if AMMO_COUNT < 00 then
5249 AMMO_COUNT = 00
5250 end
5251
5252 RANK_ID = RANK_ID * 500
5253 MaxBullet = RANK_ID - AMMO_COUNT
5254 if MaxBullet > 0 then
5255 max = MaxBullet
5256 else
5257 modules.game_interface.onLoginAdvice(tr('Sua arma ja esta com a capacidade maxima de municao.'))
5258 return
5259 end
5260 else
5261 modules.game_interface.onLoginAdvice(tr('Voce precisa ter uma arma equipada.'))
5262 return
5263 end
5264 end
5265
5266 local count = max
5267 local Quantity = max
5268 local ItemPrice = modules.game_database.getItemInfo(id, 9) * count
5269 if product ~= 01 then
5270 for Contagem = 01, 9999 do
5271 local check = price * Contagem
5272 if check > atual_gold then
5273 max = Contagem - 1
5274 break
5275 elseif check == atual_gold then
5276 max = Contagem
5277 break
5278 end
5279 end
5280 end
5281 count = max
5282 Quantity = max
5283 ItemPrice = modules.game_database.getItemInfo(id, 9) * count
5284 FINAL_PRICE = ItemPrice
5285 if max <= 0 then
5286 return
5287 end
5288 if BUY_WINDOW == nil then
5289 BUY_WINDOW = g_ui.createWidget('CountWindow', rootWidget)
5290 end
5291 BUY_WINDOW:setText(tr("Valor da Compra").. " [$ " ..mask_number(ItemPrice).. "]")
5292 local itembox = BUY_WINDOW:getChildById('item')
5293 local scrollbar = BUY_WINDOW:getChildById('countScrollBar')
5294 itembox:setIcon("/images/custom/Items/" ..id)
5295 itembox:setImageSource("/images/custom/UI/rare_" ..rare)
5296 itembox:setSize({width = 42, height = 50})
5297 itembox:setMarginTop(-07)
5298 itembox:setTextOffset('00 30')
5299 itembox:setText(count)
5300 BUY_WINDOW:focus()
5301 scrollbar:setMaximum(max)
5302 scrollbar:setMinimum(1)
5303 scrollbar:setMarginTop(10)
5304 scrollbar:setValue(count)
5305
5306 local spinbox = BUY_WINDOW:getChildById('spinBox')
5307 spinbox:setMaximum(count)
5308 spinbox:setMinimum(0)
5309 spinbox:setValue(0)
5310 spinbox:hideButtons()
5311 spinbox:focus()
5312 spinbox.firstEdit = true
5313
5314 local spinBoxValueChange = function(self, value)
5315 spinbox.firstEdit = false
5316 scrollbar:setValue(value)
5317 end
5318 spinbox.onValueChange = spinBoxValueChange
5319 local check = function()
5320 if spinbox.firstEdit then
5321 spinbox:setValue(spinbox:getMaximum())
5322 spinbox.firstEdit = false
5323 end
5324 end
5325 scrollbar.onValueChange = function(self, value)
5326 ItemPrice = modules.game_database.getItemInfo(id, 9) * value
5327 FINAL_PRICE = modules.game_database.getItemInfo(id, 9) * value
5328 Quantity = value
5329 itembox:setText(value)
5330 BUY_WINDOW:setText(tr("Valor da Compra").. " [$ " ..mask_number(ItemPrice).. "]")
5331 spinbox.onValueChange = nil
5332 spinbox:setValue(value)
5333 spinbox.onValueChange = spinBoxValueChange
5334 end
5335
5336 local okBuyButton = BUY_WINDOW:getChildById('buttonOk')
5337 okBuyButton.onClick = function()
5338 g_game.getProtocolGame():sendExtendedOpcode(Opcodes_2, product.. "," ..FINAL_PRICE.. "," ..Quantity.. "," ..id)
5339 BUY_WINDOW:destroy()
5340 BUY_WINDOW = nil
5341 end
5342 local cancelBuyButton = BUY_WINDOW:getChildById('buttonCancel')
5343 cancelBuyButton.onClick = function()
5344 BUY_WINDOW:destroy()
5345 BUY_WINDOW = nil
5346 end
5347
5348 CLICK_BUY = true
5349 scheduleEvent(function()
5350 CLICK_BUY = false
5351 end, 1000)
5352end
5353function onLoadAmmo()
5354 local TOTAL_PRICE = 0
5355 local LEVEL_FOR_RARE = 05
5356 local LEVEL_FOR_LEVEL = 04
5357 local RANK_ID = modules.game_database.getTask(00)
5358 if RANK_ID < 01 then
5359 RANK_ID = 01
5360 end
5361 RANK_ID = RANK_ID * 500
5362 ----------------------- EQUIPADO -----------------------
5363 local ITEMID = modules.game_database.getInventory(04, 01)
5364 if ITEMID > 00 then
5365 local GUN_RARE = modules.game_database.getInventory(04, 02)
5366 local GUN_STAR = modules.game_database.getInventory(04, 03)
5367 local GUN_LEVEL = modules.game_database.getInventory(04, 07)
5368 local AMMO_COUNT = modules.game_database.getInventory(04, 10)
5369 local GUN_BASE_LEVEL = modules.game_database.getItemInfo(ITEMID, 19)
5370 local PRICE_AMMO_UND = 00
5371 local PRICE_AMMO_GUN = 00
5372
5373 if AMMO_COUNT < 00 then
5374 AMMO_COUNT = 00
5375 end
5376 if AMMO_COUNT < RANK_ID then
5377 MAX_BULLET = RANK_ID - AMMO_COUNT
5378 local REQUISITO_LEVEL = GUN_BASE_LEVEL + (GUN_RARE * LEVEL_FOR_RARE) + (GUN_LEVEL * LEVEL_FOR_LEVEL) + ((GUN_STAR * 10) * LEVEL_FOR_LEVEL)
5379 if REQUISITO_LEVEL < 30 then
5380 PRICE_AMMO_UND = modules.game_database.getItemInfo(10450, 09)
5381 elseif REQUISITO_LEVEL < 60 then
5382 PRICE_AMMO_UND = modules.game_database.getItemInfo(10451, 09)
5383 elseif REQUISITO_LEVEL < 99 then
5384 PRICE_AMMO_UND = modules.game_database.getItemInfo(10452, 09)
5385 elseif REQUISITO_LEVEL < 150 then
5386 PRICE_AMMO_UND = modules.game_database.getItemInfo(10453, 09)
5387 elseif REQUISITO_LEVEL > 150 then
5388 PRICE_AMMO_UND = modules.game_database.getItemInfo(10454, 09)
5389 end
5390
5391 PRICE_AMMO_GUN = MAX_BULLET * PRICE_AMMO_UND
5392 TOTAL_PRICE = TOTAL_PRICE + PRICE_AMMO_GUN
5393 end
5394 end
5395 ----------------------- BACKPACK -----------------------
5396 for X = 01, 20 do
5397 local ITEMID = modules.game_database.getPosBackpack(X, 01)
5398 if ITEMID > 00 then
5399 local GUN_RARE = modules.game_database.getPosBackpack(X, 02)
5400 local GUN_STAR = modules.game_database.getPosBackpack(X, 03)
5401 local GUN_LEVEL = modules.game_database.getPosBackpack(X, 07)
5402 local AMMO_COUNT = modules.game_database.getPosBackpack(X, 10)
5403 local GUN_BASE_LEVEL = modules.game_database.getItemInfo(ITEMID, 19)
5404 local PRICE_AMMO_UND = 00
5405 local PRICE_AMMO_GUN = 00
5406
5407 if AMMO_COUNT < 00 then
5408 AMMO_COUNT = 00
5409 end
5410 if AMMO_COUNT < RANK_ID then
5411 MAX_BULLET = RANK_ID - AMMO_COUNT
5412 local REQUISITO_LEVEL = GUN_BASE_LEVEL + (GUN_RARE * LEVEL_FOR_RARE) + (GUN_LEVEL * LEVEL_FOR_LEVEL) + ((GUN_STAR * 10) * LEVEL_FOR_LEVEL)
5413 if REQUISITO_LEVEL < 30 then
5414 PRICE_AMMO_UND = modules.game_database.getItemInfo(10450, 09)
5415 elseif REQUISITO_LEVEL < 60 then
5416 PRICE_AMMO_UND = modules.game_database.getItemInfo(10451, 09)
5417 elseif REQUISITO_LEVEL < 99 then
5418 PRICE_AMMO_UND = modules.game_database.getItemInfo(10452, 09)
5419 elseif REQUISITO_LEVEL < 150 then
5420 PRICE_AMMO_UND = modules.game_database.getItemInfo(10453, 09)
5421 elseif REQUISITO_LEVEL > 150 then
5422 PRICE_AMMO_UND = modules.game_database.getItemInfo(10454, 09)
5423 end
5424
5425 PRICE_AMMO_GUN = MAX_BULLET * PRICE_AMMO_UND
5426 TOTAL_PRICE = TOTAL_PRICE + PRICE_AMMO_GUN
5427 end
5428 end
5429 end
5430
5431 local yesChoose = function()
5432 g_game.getProtocolGame():sendExtendedOpcode(Opcodes_2, "3," ..TOTAL_PRICE)
5433 onPVPRoomWindow:destroy()
5434 onPVPRoomWindow = nil
5435 end
5436 local noChoose = function()
5437 onPVPRoomWindow:destroy()
5438 onPVPRoomWindow = nil
5439 end
5440 if onPVPRoomWindow ~= nil then
5441 onPVPRoomWindow:destroy()
5442 onPVPRoomWindow = nil
5443 end
5444
5445 onPVPRoomWindow = displayGeneralBox(tr('RECARGA TOTAL'), tr("Recarregar todas as armas\nde sua Backpack vai custar").. ":\n\n [ " ..mask_number(TOTAL_PRICE).. " ]",
5446 { { text=tr('Comprar'), callback=yesChoose },
5447 { text=tr('Cancelar'), callback=noChoose },
5448 anchor=AnchorHorizontalCenter }, yesChoose, noChoose)
5449end
5450function onHideBag(id)
5451 if id == 02 then
5452 for X = 01, 20 do
5453 BAG = CentralBox:recursiveGetChildById('Bag' ..X)
5454 BAG:hide()
5455 end
5456 elseif id == 03 then
5457 for X = 01, 20 do
5458 BAG = CentralBox:recursiveGetChildById('UBag' ..X)
5459 BAG:hide()
5460 end
5461 end
5462end
5463function setGold(gold)
5464 GoldCoin:setText(mask_number(tonumber(gold)))
5465 atual_gold = tonumber(gold)
5466end
5467
5468-- FUNCTIONS UPGRADE
5469function upgradeSelectItem(bag)
5470 BAG_WINDOW = CentralBox:recursiveGetChildById('UBag' ..bag)
5471 local ID = 0
5472 local Rare = 0
5473 local MultValor = 25
5474
5475 if bag == 0 then
5476 if ItemEquipado:getBorderTopWidth() == 0 then
5477 resetUpgradeItem()
5478 SELECT_ITEM_UPGRADE = 1
5479 Rare = modules.game_database.getInventory(ComboBoxSelect, 02)
5480 ID = modules.game_database.getInventory(ComboBoxSelect, 01)
5481 ItemEquipado:setBorderWidth(2)
5482 ItemEquipado:setBorderColor("yellow")
5483 ItemSelectView:setImageSource("/images/custom/UI/view_item_" ..Rare)
5484 ItemSelectView:setIcon("/images/custom/Items/" ..ID)
5485 if ComboBoxSelect == 4 then
5486 local LevelItem = modules.game_database.getInventory(ComboBoxSelect, 07)
5487 local StarItem = modules.game_database.getInventory(ComboBoxSelect, 03)
5488 local RareItem = modules.game_database.getInventory(ComboBoxSelect, 02)
5489 -- LEVEL REQUERIDO
5490 local localPlayer = g_game.getLocalPlayer()
5491 local GUN_BASE_LEVEL = modules.game_database.getItemInfo(ID, 19)
5492 local LEVEL_FOR_RARE = 05
5493 local LEVEL_FOR_LEVEL = 04
5494 if RareItem < 0 then RareItem = 0 end
5495 if LevelItem < 0 then LevelItem = 0 end
5496 if StarItem < 0 then StarItem = 0 end
5497
5498 REQUISITO_LEVEL = GUN_BASE_LEVEL + (RareItem * LEVEL_FOR_RARE) + ((LevelItem + 01) * LEVEL_FOR_LEVEL) + ((StarItem * 10) * LEVEL_FOR_LEVEL)
5499 if localPlayer:getLevel() >= REQUISITO_LEVEL then
5500 LevelRec:setColor('#05AC5E')
5501 else
5502 LevelRec:setColor('#AC0505')
5503 end
5504 LevelRec:setText(tr('NIVEL REQUERIDO: LV. ').. '' ..REQUISITO_LEVEL)
5505 LevelRec:setTooltip(tr('Apos o upgrade, esse seria o nv. exigido\npara equipar este item'))
5506
5507 -- PRE�O DO UPGRADE
5508 local PriceBase = modules.game_database.getItemInfo(ID, 16, 0, 1)
5509 Temp_StarItem = StarItem
5510 --if (Temp_StarItem * 10) > 0 then Temp_StarItem = (Temp_StarItem * 10) else Temp_StarItem = 1 end
5511 local NewValor = math.floor((PriceBase * (Temp_StarItem + 01) * (LevelItem + 01))) * MultValor
5512 --print("NewValor: " ..NewValor)
5513
5514 onLoadUpgradeItens(01, ID, LevelItem, Temp_StarItem, bag, BagSelect, ComboBoxSelect, NewValor, StarItem, 00, RareItem)
5515 if ComboBoxType == 01 then
5516 onLoadUpgradeItens(02)
5517 else
5518 onLoadUpgradeItens(03)
5519 end
5520
5521 if LevelItem == 10 then
5522 DMGMin:setText("Max")
5523 DMGMin:setColor("white")
5524 UPMin:setText("")
5525 DMGMax:setText("Max")
5526 DMGMax:setColor("white")
5527 UPMax:setText("")
5528 LevelRec:setText('')
5529 LevelRec:setTooltip('')
5530 else
5531 local DmgForLevel = 0
5532 if ID >= 4000 and ID <= 4004 then -- ESPINGARDA
5533 DmgForLevel = 4
5534 elseif ID >= 4005 and ID <= 4014 then -- RIFLE
5535 DmgForLevel = 2
5536 elseif ID >= 4015 and ID <= 4030 then -- PISTOLA
5537 DmgForLevel = 3
5538 elseif ID >= 4031 and ID <= 4049 then -- METRALHADORA
5539 DmgForLevel = 1
5540 end
5541 DMGMin:setText((modules.game_database.onDamage(ID, LevelItem, StarItem, "Min", RareItem) + DmgForLevel))
5542 DMGMin:setColor("green")
5543 UPMin:setText("+" ..DmgForLevel)
5544 DMGMax:setText((modules.game_database.onDamage(ID, LevelItem, StarItem, "Max", RareItem) + DmgForLevel))
5545 DMGMax:setColor("green")
5546 UPMax:setText("+" ..DmgForLevel)
5547 end
5548 if StarItem == 3 then
5549 StarAntes:setImageSource("/images/custom/UI/star_3")
5550 StarDepois:setImageSource("/images/custom/UI/star_3")
5551 else
5552 StarAntes:setImageSource("/images/custom/UI/star_" ..StarItem)
5553 StarDepois:setImageSource("/images/custom/UI/star_" ..(StarItem +1))
5554 end
5555 if StarItem < 3 then
5556 if LevelItem < 09 then
5557 TextAntes:setText("-")
5558 TextAntes:setColor("red")
5559 TextDepois:setText("-")
5560 TextDepois:setColor("red")
5561 else
5562 TextAntes:setText(StarItem)
5563 TextAntes:setColor("red")
5564 TextDepois:setText(StarItem + 1)
5565 TextDepois:setColor("green")
5566 end
5567 else
5568 TextAntes:setText("-")
5569 TextAntes:setColor("white")
5570 TextDepois:setText("-")
5571 TextDepois:setColor("white")
5572 end
5573 else
5574 local LevelItem = modules.game_database.getInventory(ComboBoxSelect, 05)
5575 local StarItem = modules.game_database.getInventory(ComboBoxSelect, 03)
5576 local RareItem = modules.game_database.getInventory(ComboBoxSelect, 02)
5577 -- LEVEL REQUERIDO
5578 local localPlayer = g_game.getLocalPlayer()
5579 if LevelItem < 0 then LevelItem = 0 end
5580 if StarItem < 0 then StarItem = 0 end
5581 local itemRecLevel = 00
5582 if ComboBoxSelect == 01 or ComboBoxSelect == 07 then
5583 itemRecLevel = 00
5584 LevelRec:setColor("green")
5585 LevelRec:setText(tr('TEMPO AUMENTADO: ').. '' ..((LevelItem + 1) + (StarItem * 10) + 5).. ' SEG')
5586 LevelRec:setTooltip('')
5587 else
5588 itemRecLevel = (modules.game_database.getItemInfo(ID, 3) + (LevelItem + 1) + (StarItem * 10)) * 2
5589 if localPlayer:getLevel() >= itemRecLevel then
5590 LevelRec:setColor('#05AC5E')
5591 else
5592 LevelRec:setColor('#AC0505')
5593 end
5594 LevelRec:setText(tr('NIVEL REQUERIDO: LV. ').. '' ..itemRecLevel)
5595 LevelRec:setTooltip(tr('Apos o upgrade, esse seria o nv. exigido\npara equipar este item'))
5596 end
5597
5598 -- PRE�O DO UPGRADE
5599 local PriceBase = modules.game_database.getItemInfo(ID, 16, 0, 1)
5600 Temp_StarItem = StarItem
5601 --if (Temp_StarItem * 10) > 0 then Temp_StarItem = (Temp_StarItem * 10) else Temp_StarItem = 1 end
5602 local NewValor = math.floor((PriceBase * (Temp_StarItem + 01) * (LevelItem + 01))) * MultValor
5603 --print("NewValor: " ..NewValor)
5604
5605 onLoadUpgradeItens(01, ID, LevelItem, Temp_StarItem, bag, BagSelect, ComboBoxSelect, NewValor, StarItem, 00, RareItem)
5606 if ComboBoxType == 01 then
5607 onLoadUpgradeItens(02)
5608 else
5609 onLoadUpgradeItens(03)
5610 end
5611
5612 if LevelItem == 10 then
5613 DEFESA:setText("Max")
5614 ESQUIVA:setText("Max")
5615 MAGICO:setText("Max")
5616 DEFESA:setColor("white")
5617 ESQUIVA:setColor("white")
5618 MAGICO:setColor("white")
5619 LevelRec:setText('')
5620 LevelRec:setTooltip('')
5621 else
5622 if ComboBoxSelect == 01 or ComboBoxSelect == 07 then
5623 DEFESA:setText("-")
5624 ESQUIVA:setText("-")
5625 MAGICO:setText("-")
5626 DEFESA:setColor("white")
5627 ESQUIVA:setColor("white")
5628 MAGICO:setColor("white")
5629 else
5630 DEFESA:setText((modules.game_database.onArmor(ID, LevelItem, StarItem, "DEF", RareItem) + 1))
5631 ESQUIVA:setText((modules.game_database.onArmor(ID, LevelItem, StarItem, "ESQ", RareItem) + 1))
5632 MAGICO:setText((modules.game_database.onArmor(ID, LevelItem, StarItem, "MAG", RareItem) + 1))
5633 DEFESA:setColor("green")
5634 ESQUIVA:setColor("green")
5635 MAGICO:setColor("green")
5636 end
5637 end
5638 if StarItem == 3 then
5639 StarAntes:setImageSource("/images/custom/UI/star_3")
5640 StarDepois:setImageSource("/images/custom/UI/star_3")
5641 else
5642 StarAntes:setImageSource("/images/custom/UI/star_" ..StarItem)
5643 StarDepois:setImageSource("/images/custom/UI/star_" ..(StarItem +1))
5644 end
5645 if StarItem < 3 then
5646 if LevelItem < 10 then
5647 TextAntes:setText("-")
5648 TextAntes:setColor("red")
5649 TextDepois:setText("-")
5650 TextDepois:setColor("red")
5651 else
5652 TextAntes:setText(StarItem)
5653 TextAntes:setColor("red")
5654 TextDepois:setText(StarItem + 1)
5655 TextDepois:setColor("green")
5656 end
5657 else
5658 TextAntes:setText("-")
5659 TextAntes:setColor("white")
5660 TextDepois:setText("-")
5661 TextDepois:setColor("white")
5662 end
5663 end
5664 else
5665 resetUpgradeItem()
5666 SELECT_ITEM_UPGRADE = 0
5667 ItemEquipado:setBorderWidth(0)
5668 ItemSelectView:setImageSource("/images/custom/UI/view_item")
5669 ItemSelectView:setIcon("/images/custom/UI/none")
5670 end
5671 else
5672 if BAG_WINDOW:getBorderTopWidth() == 0 then
5673 resetUpgradeItem()
5674 SELECT_ITEM_UPGRADE = 1
5675 Rare = modules.game_database.getRareBagId(bag)
5676 ID = modules.game_database.getItemBagId(bag, 01)
5677 ItemEquipado:setBorderWidth(0)
5678 BAG_WINDOW:setBorderWidth(2)
5679 BAG_WINDOW:setBorderColor("yellow")
5680 ItemSelectView:setImageSource("/images/custom/UI/view_item_" ..Rare)
5681 ItemSelectView:setIcon("/images/custom/Items/" ..ID)
5682 if ComboBoxSelect == 4 then
5683 local LevelItem = modules.game_database.getPosBackpack(bag, 07)
5684 local StarItem = modules.game_database.getPosBackpack(bag, 03)
5685 local RareItem = modules.game_database.getPosBackpack(bag, 02)
5686
5687 -- LEVEL REQUERIDO
5688 local localPlayer = g_game.getLocalPlayer()
5689 local GUN_BASE_LEVEL = modules.game_database.getItemInfo(ID, 19)
5690 local LEVEL_FOR_RARE = 05
5691 local LEVEL_FOR_LEVEL = 04
5692 if RareItem < 0 then RareItem = 0 end
5693 if LevelItem < 0 then LevelItem = 0 end
5694 if StarItem < 0 then StarItem = 0 end
5695
5696 REQUISITO_LEVEL = GUN_BASE_LEVEL + (RareItem * LEVEL_FOR_RARE) + ((LevelItem + 01) * LEVEL_FOR_LEVEL) + ((StarItem * 10) * LEVEL_FOR_LEVEL)
5697 if localPlayer:getLevel() >= REQUISITO_LEVEL then
5698 LevelRec:setColor('#05AC5E')
5699 else
5700 LevelRec:setColor('#AC0505')
5701 end
5702 LevelRec:setText(tr('NIVEL REQUERIDO: LV. ').. '' ..REQUISITO_LEVEL)
5703 LevelRec:setTooltip(tr('Apos o upgrade, esse seria o nv. exigido\npara equipar este item'))
5704
5705 -- PRE�O DO UPGRADE
5706 local PriceBase = modules.game_database.getItemInfo(ID, 16, 0, 1)
5707 Temp_StarItem = StarItem
5708 --if (Temp_StarItem * 10) > 0 then Temp_StarItem = (Temp_StarItem * 10) else Temp_StarItem = 1 end
5709 local NewValor = math.floor((PriceBase * (Temp_StarItem + 01) * (LevelItem + 01))) * MultValor
5710 --print("NewValor: " ..NewValor)
5711
5712 onLoadUpgradeItens(01, ID, LevelItem, Temp_StarItem, bag, BagSelect, ComboBoxSelect, NewValor, StarItem, 01, RareItem)
5713 if ComboBoxType == 01 then
5714 onLoadUpgradeItens(02)
5715 else
5716 onLoadUpgradeItens(03)
5717 end
5718
5719 if LevelItem == 10 then
5720 DMGMin:setText("Max")
5721 DMGMin:setColor("white")
5722 UPMin:setText("")
5723 DMGMax:setText("Max")
5724 DMGMax:setColor("white")
5725 UPMax:setText("")
5726 LevelRec:setText('')
5727 LevelRec:setTooltip('')
5728 else
5729 local DmgForLevel = 0
5730 if ID >= 4000 and ID <= 4004 then -- ESPINGARDA
5731 DmgForLevel = 4
5732 elseif ID >= 4005 and ID <= 4014 then -- RIFLE
5733 DmgForLevel = 2
5734 elseif ID >= 4015 and ID <= 4030 then -- PISTOLA
5735 DmgForLevel = 3
5736 elseif ID >= 4031 and ID <= 4049 then -- METRALHADORA
5737 DmgForLevel = 1
5738 end
5739 DMGMin:setText((modules.game_database.onDamage(ID, LevelItem, StarItem, "Min", RareItem) + DmgForLevel))
5740 DMGMin:setColor("green")
5741 UPMin:setText("+" ..DmgForLevel)
5742 DMGMax:setText((modules.game_database.onDamage(ID, LevelItem, StarItem, "Max", RareItem) + DmgForLevel))
5743 DMGMax:setColor("green")
5744 UPMax:setText("+" ..DmgForLevel)
5745 end
5746 if StarItem == 3 then
5747 StarAntes:setImageSource("/images/custom/UI/star_3")
5748 StarDepois:setImageSource("/images/custom/UI/star_3")
5749 else
5750 StarAntes:setImageSource("/images/custom/UI/star_" ..StarItem)
5751 StarDepois:setImageSource("/images/custom/UI/star_" ..(StarItem +1))
5752 end
5753 if StarItem < 3 then
5754 if LevelItem < 09 then
5755 TextAntes:setText("-")
5756 TextAntes:setColor("red")
5757 TextDepois:setText("-")
5758 TextDepois:setColor("red")
5759 else
5760 TextAntes:setText(StarItem)
5761 TextAntes:setColor("red")
5762 TextDepois:setText(StarItem + 1)
5763 TextDepois:setColor("green")
5764 end
5765 else
5766 TextAntes:setText("-")
5767 TextAntes:setColor("white")
5768 TextDepois:setText("-")
5769 TextDepois:setColor("white")
5770 end
5771 else
5772 local LevelItem = modules.game_database.getPosBackpack(bag, 05)
5773 local StarItem = modules.game_database.getPosBackpack(bag, 03)
5774 local RareItem = modules.game_database.getPosBackpack(bag, 02)
5775
5776 -- LEVEL REQUERIDO
5777 local localPlayer = g_game.getLocalPlayer()
5778 if LevelItem < 0 then LevelItem = 0 end
5779 if StarItem < 0 then StarItem = 0 end
5780 local itemRecLevel = 00
5781 if ComboBoxSelect == 01 or ComboBoxSelect == 07 then
5782 itemRecLevel = 00
5783 LevelRec:setColor("green")
5784 LevelRec:setText(tr('TEMPO AUMENTADO: ').. '' ..((LevelItem + 1) + (StarItem * 10) + 5).. ' SEG')
5785 LevelRec:setTooltip('')
5786 else
5787 itemRecLevel = (modules.game_database.getItemInfo(ID, 3) + (LevelItem + 1) + (StarItem * 10)) * 2
5788 if localPlayer:getLevel() >= itemRecLevel then
5789 LevelRec:setColor('#05AC5E')
5790 else
5791 LevelRec:setColor('#AC0505')
5792 end
5793 LevelRec:setText(tr('NIVEL REQUERIDO: LV. ').. '' ..itemRecLevel)
5794 LevelRec:setTooltip(tr('Apos o upgrade, esse seria o nv. exigido\npara equipar este item'))
5795 end
5796
5797 -- PRE�O DO UPGRADE
5798 local PriceBase = modules.game_database.getItemInfo(ID, 16, 0, 1)
5799 Temp_StarItem = StarItem
5800 --if (Temp_StarItem * 10) > 0 then Temp_StarItem = (Temp_StarItem * 10) else Temp_StarItem = 1 end
5801 local NewValor = math.floor((PriceBase * (Temp_StarItem + 01) * (LevelItem + 01))) * MultValor
5802 --print("NewValor: " ..NewValor)
5803
5804 onLoadUpgradeItens(01, ID, LevelItem, Temp_StarItem, bag, BagSelect, ComboBoxSelect, NewValor, StarItem, 01, RareItem)
5805 if ComboBoxType == 01 then
5806 onLoadUpgradeItens(02)
5807 else
5808 onLoadUpgradeItens(03)
5809 end
5810
5811 if LevelItem == 10 then
5812 DEFESA:setText("Max")
5813 ESQUIVA:setText("Max")
5814 MAGICO:setText("Max")
5815 DEFESA:setColor("white")
5816 ESQUIVA:setColor("white")
5817 MAGICO:setColor("white")
5818 LevelRec:setText('')
5819 LevelRec:setTooltip('')
5820 else
5821 if ComboBoxSelect == 01 or ComboBoxSelect == 07 then
5822 DEFESA:setText("-")
5823 ESQUIVA:setText("-")
5824 MAGICO:setText("-")
5825 DEFESA:setColor("white")
5826 ESQUIVA:setColor("white")
5827 MAGICO:setColor("white")
5828 else
5829 DEFESA:setText((modules.game_database.onArmor(ID, LevelItem, StarItem, "DEF", RareItem) + 1))
5830 ESQUIVA:setText((modules.game_database.onArmor(ID, LevelItem, StarItem, "ESQ", RareItem) + 1))
5831 MAGICO:setText((modules.game_database.onArmor(ID, LevelItem, StarItem, "MAG", RareItem) + 1))
5832 DEFESA:setColor("green")
5833 ESQUIVA:setColor("green")
5834 MAGICO:setColor("green")
5835 end
5836 end
5837 if StarItem == 3 then
5838 StarAntes:setImageSource("/images/custom/UI/star_3")
5839 StarDepois:setImageSource("/images/custom/UI/star_3")
5840 else
5841 StarAntes:setImageSource("/images/custom/UI/star_" ..StarItem)
5842 StarDepois:setImageSource("/images/custom/UI/star_" ..(StarItem +1))
5843 end
5844 if StarItem < 3 then
5845 if LevelItem < 10 then
5846 TextAntes:setText("-")
5847 TextAntes:setColor("red")
5848 TextDepois:setText("-")
5849 TextDepois:setColor("red")
5850 else
5851 TextAntes:setText(StarItem)
5852 TextAntes:setColor("red")
5853 TextDepois:setText(StarItem + 1)
5854 TextDepois:setColor("green")
5855 end
5856 else
5857 TextAntes:setText("-")
5858 TextAntes:setColor("white")
5859 TextDepois:setText("-")
5860 TextDepois:setColor("white")
5861 end
5862 end
5863 else
5864 resetUpgradeItem()
5865 SELECT_ITEM_UPGRADE = 0
5866 BAG_WINDOW:setBorderWidth(0)
5867 ItemSelectView:setImageSource("/images/custom/UI/view_item")
5868 ItemSelectView:setIcon("/images/custom/UI/none")
5869 end
5870 end
5871end
5872function onClickUpgradeItem(itemid, backpack, bagselection, combocheck, itemstar, itemlevel, gunarm, target)
5873 local yesChoose = function()
5874 g_game.talk(g_game.talk("!upgrade 00 " ..itemid.. " " ..backpack.. " " ..bagselection.. " " ..combocheck.. " " ..itemstar.. " " ..itemlevel.. " " ..gunarm.. " " ..target.. " " ..COUNT_CLICK_SUCESS.. " " ..RARE_GUN))
5875 exitWindow:destroy()
5876 exitWindow = nil
5877 end
5878 local noChoose = function() exitWindow:destroy() exitWindow = nil end
5879
5880 if exitWindow == nil then
5881 exitWindow = displayGeneralBox(tr('Upgrade'), tr("Deseja realmente aprimorar este item?"),
5882 { { text=tr('Yes'), callback=yesChoose },
5883 { text=tr('No'), callback=noChoose },
5884 anchor=AnchorHorizontalCenter }, yesChoose, noChoose)
5885 else
5886 exitWindow:focus()
5887 exitWindow:raise()
5888 end
5889end
5890function onLoadUpgradeItens(type, ID, LevelItem, Temp_StarItem, bag, BagSelect, CombSelect, NewValor, StarItem, TargetItem, RareGun)
5891 if type == 01 then
5892 ID_UPGRADE = ID
5893 LEVEL_UPGRADE = LevelItem
5894 STAR_UPGRADE = Temp_StarItem
5895 UPGRADE_BAG = bag
5896 UPGRADE_NEWVALOR = NewValor
5897 UPGRADE_SELECTION = BagSelect
5898 UPGRADE_COMBO = CombSelect
5899 UPGRADE_ORIG_STAR = StarItem
5900 TARGET = TargetItem
5901 RARE_GUN = RareGun
5902 return true
5903 end
5904 if type == 02 then
5905 if SELECT_ITEM_UPGRADE == 1 then
5906 ButtonUpgrade.onClick = function() onClickUpgradeItem(ID_UPGRADE, UPGRADE_BAG, UPGRADE_SELECTION, UPGRADE_COMBO, STAR_UPGRADE, LEVEL_UPGRADE, 00, TARGET) end
5907 if LEVEL_UPGRADE == 10 then
5908 ButtonUpgrade:disable()
5909 CoinsRec:setText('')
5910 coinMenSucess:setTooltip('')
5911 coinMoreSucess:setTooltip('')
5912 coinMenSucess.onClick = function() end
5913 coinMoreSucess.onClick = function() end
5914 rateSucess:setText(tr("Chance de Sucesso: ").. "0%")
5915 return
5916 else
5917 if RARE_GUN < 0 then RARE_GUN = 1 end
5918 RATE_CHANCE_UPGRADE = 95 - (((LEVEL_UPGRADE + 02) * 02) + (STAR_UPGRADE * 20))
5919 PRICE_SUCESS_GOLD = UPGRADE_NEWVALOR * (RARE_GUN + 01)
5920 rateSucess:setText(tr("Chance de Sucesso: ").. "" ..RATE_CHANCE_UPGRADE.. "%")
5921 CoinsRec:setText(mask_number(PRICE_SUCESS_GOLD))
5922 coinMoreSucess.onClick = function()
5923 if RATE_CHANCE_UPGRADE < 100 then
5924 RATE_CHANCE_UPGRADE = RATE_CHANCE_UPGRADE + 02
5925 PRICE_SUCESS_GOLD = PRICE_SUCESS_GOLD + (UPGRADE_NEWVALOR * (RARE_GUN + 01))
5926 if RATE_CHANCE_UPGRADE > 100 then
5927 RATE_CHANCE_UPGRADE = 100
5928 end
5929 COUNT_CLICK_SUCESS = COUNT_CLICK_SUCESS + 01
5930 rateSucess:setText(tr("Chance de Sucesso: ").. "" ..RATE_CHANCE_UPGRADE.. "%")
5931 CoinsRec:setText(mask_number(PRICE_SUCESS_GOLD))
5932 end
5933 end
5934 coinMenSucess.onClick = function()
5935 if PRICE_SUCESS_GOLD > UPGRADE_NEWVALOR then
5936 RATE_CHANCE_UPGRADE = RATE_CHANCE_UPGRADE - 02
5937 PRICE_SUCESS_GOLD = PRICE_SUCESS_GOLD - (UPGRADE_NEWVALOR * (RARE_GUN + 01))
5938 COUNT_CLICK_SUCESS = COUNT_CLICK_SUCESS - 01
5939 if COUNT_CLICK_SUCESS < 0 then
5940 COUNT_CLICK_SUCESS = 01
5941 end
5942 rateSucess:setText(tr("Chance de Sucesso: ").. "" ..RATE_CHANCE_UPGRADE.. "%")
5943 CoinsRec:setText(mask_number(PRICE_SUCESS_GOLD))
5944 end
5945 end
5946 TotalItem = 0
5947 COUNT_CLICK_SUCESS = 1
5948 local RARE_UPGRADE = {
5949 [-1] = 03,
5950 [00] = 03,
5951 [01] = 03,
5952 [02] = 05,
5953 [03] = 07,
5954 [04] = 10,
5955 }
5956 for itemX = 01, 04 do
5957 local Rare = modules.game_database.getItemInfo(modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 01), 13)
5958 if STAR_UPGRADE < 1 then STAR_UPGRADE = 0 end
5959 if UPGRADE_ORIG_STAR < 1 then UPGRADE_ORIG_STAR = 1 end
5960
5961 if RARE_GUN < 0 then RARE_GUN = 1 end
5962 if itemX == 01 then
5963 local itemID = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 01)
5964 local BaseQnt = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 02)
5965 --print("((" ..BaseQnt.. " + 05) + " ..LEVEL_UPGRADE.. ") * (" ..STAR_UPGRADE.. " + 01) + " ..RARE_UPGRADE[RARE_GUN].. ")")
5966 local Qnt = ((BaseQnt + 05) + LEVEL_UPGRADE + 01) * (STAR_UPGRADE + 01) + RARE_UPGRADE[RARE_GUN]
5967 if itemID > 0 then
5968 TotalItem = TotalItem + 1
5969 UP_Item1:setImageSource("/images/custom/UI/rare_" ..Rare)
5970 UP_Item1:setIcon("/images/custom/Items/" ..itemID)
5971 if Qnt < 10 then
5972 UP_Item1:setText("0" ..Qnt)
5973 else
5974 UP_Item1:setText(Qnt)
5975 end
5976 UP_Item1:setTooltip("@BAG " ..itemID.. " " ..Rare.. " 0 " ..Qnt.. " 0 0 0 0 0 0")
5977 else
5978 UP_Item1:setImageSource("/images/custom/UI/item_slot")
5979 UP_Item1:setIcon("/images/custom/UI/none")
5980 UP_Item1:setText("")
5981 UP_Item1:setTooltip("")
5982 end
5983 elseif itemX == 02 then
5984 local itemID = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 01)
5985 local BaseQnt = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 02)
5986 local Qnt = ((BaseQnt + 05) + LEVEL_UPGRADE + 01) * (STAR_UPGRADE + 01) + RARE_UPGRADE[RARE_GUN]
5987 if itemID > 0 then
5988 TotalItem = TotalItem + 1
5989 UP_Item2:setImageSource("/images/custom/UI/rare_" ..Rare)
5990 UP_Item2:setIcon("/images/custom/Items/" ..itemID)
5991 if Qnt < 10 then
5992 UP_Item2:setText("0" ..Qnt)
5993 else
5994 UP_Item2:setText(Qnt)
5995 end
5996 UP_Item2:setTooltip("@BAG " ..itemID.. " " ..Rare.. " 0 " ..Qnt.. " 0 0 0 0 0 0")
5997 else
5998 UP_Item2:setImageSource("/images/custom/UI/item_slot")
5999 UP_Item2:setIcon("/images/custom/UI/none")
6000 UP_Item2:setText("")
6001 UP_Item2:setTooltip("")
6002 end
6003 elseif itemX == 03 then
6004 local itemID = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 01)
6005 local BaseQnt = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 02)
6006 local Qnt = ((BaseQnt + 05) + LEVEL_UPGRADE + 01) * (STAR_UPGRADE + 01) + RARE_UPGRADE[RARE_GUN]
6007 if itemID > 0 then
6008 TotalItem = TotalItem + 1
6009 UP_Item3:setImageSource("/images/custom/UI/rare_" ..Rare)
6010 UP_Item3:setIcon("/images/custom/Items/" ..itemID)
6011 if Qnt < 10 then
6012 UP_Item3:setText("0" ..Qnt)
6013 else
6014 UP_Item3:setText(Qnt)
6015 end
6016 UP_Item3:setTooltip("@BAG " ..itemID.. " " ..Rare.. " 0 " ..Qnt.. " 0 0 0 0 0 0")
6017 else
6018 UP_Item3:setImageSource("/images/custom/UI/item_slot")
6019 UP_Item3:setIcon("/images/custom/UI/none")
6020 UP_Item3:setText("")
6021 UP_Item3:setTooltip("")
6022 end
6023 elseif itemX == 04 then
6024 local itemID = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 01)
6025 local BaseQnt = modules.game_database.getItemInfo(ID_UPGRADE, 16, itemX, 02)
6026 local Qnt = ((BaseQnt + 05) + LEVEL_UPGRADE + 01) * (STAR_UPGRADE + 01) + RARE_UPGRADE[RARE_GUN]
6027 if itemID > 0 then
6028 TotalItem = TotalItem + 1
6029 UP_Item4:setImageSource("/images/custom/UI/rare_" ..Rare)
6030 UP_Item4:setIcon("/images/custom/Items/" ..itemID)
6031 if Qnt < 10 then
6032 UP_Item4:setText("0" ..Qnt)
6033 else
6034 UP_Item4:setText(Qnt)
6035 end
6036 UP_Item4:setTooltip("@BAG " ..itemID.. " " ..Rare.. " 0 " ..Qnt.. " 0 0 0 0 0 0")
6037 else
6038 UP_Item4:setImageSource("/images/custom/UI/item_slot")
6039 UP_Item4:setIcon("/images/custom/UI/none")
6040 UP_Item4:setText("")
6041 UP_Item4:setTooltip("")
6042 end
6043 end
6044 end
6045 ButtonUpgrade:enable()
6046 end
6047 else
6048 for X = 01, 04 do
6049 ITEMX = CentralBox:recursiveGetChildById('item' ..X)
6050 ITEMX:setImageSource("/images/custom/UI/item_slot")
6051 ITEMX:setIcon("/images/custom/UI/none")
6052 ITEMX:setText("")
6053 ITEMX:setTooltip("")
6054 end
6055 ButtonUpgrade:disable()
6056 CoinsRec:setText("")
6057 coinMenSucess:setTooltip('')
6058 coinMoreSucess:setTooltip('')
6059 coinMenSucess.onClick = function() end
6060 coinMoreSucess.onClick = function() end
6061 rateSucess:setText(tr("Chance de Sucesso: ").. "0%")
6062 end
6063 elseif type == 03 then
6064 if SELECT_ITEM_UPGRADE == 1 then
6065 ButtonUpgrade.onClick = function() onClickUpgradeItem(ID_UPGRADE, UPGRADE_BAG, UPGRADE_SELECTION, UPGRADE_COMBO, STAR_UPGRADE, LEVEL_UPGRADE, 01, TARGET) end
6066 if UPGRADE_ORIG_STAR < 03 then
6067 if LEVEL_UPGRADE <= 09 then
6068 ButtonUpgrade:disable()
6069 CoinsRec:setText("")
6070 for X = 01, 04 do
6071 ITEMX = CentralBox:recursiveGetChildById('item' ..X)
6072 ITEMX:setImageSource("/images/custom/UI/item_slot")
6073 ITEMX:setIcon("/images/custom/UI/none")
6074 ITEMX:setText("")
6075 ITEMX:setTooltip("")
6076 end
6077 return true
6078 else
6079 ButtonUpgrade:enable()
6080 CoinsRec:setText(mask_number(UPGRADE_NEWVALOR))
6081 local itemID = modules.game_database.getItemInfo(ID_UPGRADE, 17, 01)
6082 local BaseQnt = modules.game_database.getItemInfo(ID_UPGRADE, 17, 02)
6083 local RuneRare = modules.game_database.getItemInfo(itemID, 13)
6084 --print("QNT: " ..BaseQnt.. " * STAR_UPGRADE: " ..STAR_UPGRADE.. " / 3 = [ " ..math.floor((BaseQnt * STAR_UPGRADE) / 3).. " ]")
6085 local Qnt = BaseQnt--math.floor((BaseQnt * STAR_UPGRADE) / 2)
6086 if Qnt < 1 then Qnt = 1 end
6087 UP_Item1:setImageSource("/images/custom/UI/rare_" ..RuneRare)
6088 UP_Item1:setIcon("/images/custom/Items/" ..itemID)
6089 UP_Item1:setText(Qnt)
6090 UP_Item1:setTooltip("@BAG " ..itemID.. " " ..RuneRare.. " 0 " ..Qnt.. " 0 0 0 0 0 0")
6091
6092 UP_Item2:setImageSource("/images/custom/UI/item_slot")
6093 UP_Item2:setIcon("/images/custom/UI/none")
6094 UP_Item2:setText("")
6095 UP_Item2:setTooltip("")
6096
6097 UP_Item3:setImageSource("/images/custom/UI/item_slot")
6098 UP_Item3:setIcon("/images/custom/UI/none")
6099 UP_Item3:setText("")
6100 UP_Item3:setTooltip("")
6101
6102 UP_Item4:setImageSource("/images/custom/UI/item_slot")
6103 UP_Item4:setIcon("/images/custom/UI/none")
6104 UP_Item4:setText("")
6105 UP_Item4:setTooltip("")
6106 end
6107 else
6108 ButtonUpgrade:disable()
6109 CoinsRec:setText("")
6110 coinMenSucess:setTooltip('')
6111 coinMoreSucess:setTooltip('')
6112 coinMenSucess.onClick = function() end
6113 coinMoreSucess.onClick = function() end
6114 for X = 01, 04 do
6115 ITEMX = CentralBox:recursiveGetChildById('item' ..X)
6116 ITEMX:setImageSource("/images/custom/UI/item_slot")
6117 ITEMX:setIcon("/images/custom/UI/none")
6118 ITEMX:setText("")
6119 ITEMX:setTooltip("")
6120 end
6121 end
6122 else
6123 for X = 01, 04 do
6124 ITEMX = CentralBox:recursiveGetChildById('item' ..X)
6125 ITEMX:setImageSource("/images/custom/UI/item_slot")
6126 ITEMX:setIcon("/images/custom/UI/none")
6127 ITEMX:setText("")
6128 ITEMX:setTooltip("")
6129 end
6130 ButtonUpgrade:disable()
6131 CoinsRec:setText("")
6132 coinMenSucess:setTooltip('')
6133 coinMoreSucess:setTooltip('')
6134 coinMenSucess.onClick = function() end
6135 coinMoreSucess.onClick = function() end
6136 end
6137 else
6138 for X = 01, 04 do
6139 ITEMX = CentralBox:recursiveGetChildById('item' ..X)
6140 ITEMX:setImageSource("/images/custom/UI/item_slot")
6141 ITEMX:setIcon("/images/custom/UI/none")
6142 ITEMX:setText("")
6143 ITEMX:setTooltip("")
6144 end
6145 ButtonUpgrade:disable()
6146 CoinsRec:setText("")
6147 coinMenSucess:setTooltip('')
6148 coinMoreSucess:setTooltip('')
6149 coinMenSucess.onClick = function() end
6150 coinMoreSucess.onClick = function() end
6151 rateSucess:setText(tr("Chance de Sucesso: ").. "0%")
6152 end
6153end
6154function resetUpgradeItem()
6155 for X = 01, 20 do
6156 BAG = CentralBox:recursiveGetChildById('UBag' ..X)
6157 BAG:setBorderWidth(0)
6158 end
6159 for X = 01, 04 do
6160 ITEMX = CentralBox:recursiveGetChildById('item' ..X)
6161 ITEMX:setImageSource("/images/custom/UI/item_slot")
6162 ITEMX:setIcon("/images/custom/UI/none")
6163 ITEMX:setText("")
6164 ITEMX:setTooltip("")
6165 end
6166 ItemEquipado:setBorderWidth(0)
6167 ItemSelectView:setImageSource("/images/custom/UI/view_item")
6168 ItemSelectView:setIcon("/images/custom/UI/none")
6169 DMGMin:setText("-")
6170 DMGMin:setColor("white")
6171 UPMin:setText("")
6172 DMGMax:setText("-")
6173 DMGMax:setColor("white")
6174 UPMax:setText("")
6175 DEFESA:setText("0")
6176 ESQUIVA:setText("0")
6177 MAGICO:setText("0")
6178 DEFESA:setColor("white")
6179 ESQUIVA:setColor("white")
6180 MAGICO:setColor("white")
6181 StarAntes:setImageSource("/images/custom/UI/star_0")
6182 StarDepois:setImageSource("/images/custom/UI/star_0")
6183 TextAntes:setText("-")
6184 TextAntes:setColor("white")
6185 TextDepois:setText("-")
6186 TextDepois:setColor("white")
6187 LevelRec:setText('')
6188 LevelRec:setTooltip('')
6189 CoinsRec:setText('')
6190 ButtonUpgrade:disable()
6191 coinMenSucess:setTooltip('')
6192 coinMoreSucess:setTooltip('')
6193 rateSucess:setText(tr("Chance de Sucesso: ").. "0%")
6194end
6195function LoadUpgradeBox(Index)
6196 local Max = 20
6197 ItemEquipado:setImageSource("/images/custom/UI/item_slot")
6198 ItemEquipado:setIcon("/images/custom/UI/none")
6199 UP_BAG = CentralBox:recursiveGetChildById('UBag' ..Index)
6200 scheduleEvent(function()
6201 if modules.game_database.getItemBagId(Index) > 0 then
6202 local bagid = Index
6203 local id = modules.game_database.getItemBagId(bagid)
6204 local SLOT_BAG = modules.game_database.getItemInfo(id, 02)
6205 UP_BAG:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getRareBagId(bagid))
6206 UP_BAG:setIcon("/images/custom/Items/" ..modules.game_database.getItemBagId(bagid))
6207
6208 if SLOT_BAG == 1 or SLOT_BAG == 7 then
6209 local star = modules.game_database.getPosBackpack(bagid, 3)
6210 local rare = modules.game_database.getPosBackpack(bagid, 2)
6211 local level = modules.game_database.getPosBackpack(bagid, 5)
6212 local lock = modules.game_database.getPosBackpack(bagid, 9)
6213 UP_BAG:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
6214 UP_BAG.onClick = function() upgradeSelectItem(bagid) end
6215 elseif SLOT_BAG == 4 then
6216 local skill_01 = modules.game_database.getPosBackpack(bagid, 4)
6217 local skill_02 = modules.game_database.getPosBackpack(bagid, 5)
6218 local skill_03 = modules.game_database.getPosBackpack(bagid, 6)
6219 local level = modules.game_database.getPosBackpack(bagid, 7)
6220 local star = modules.game_database.getPosBackpack(bagid, 3)
6221 local rare = modules.game_database.getPosBackpack(bagid, 2)
6222 local ammo = modules.game_database.getPosBackpack(bagid, 10)
6223 local lock = modules.game_database.getPosBackpack(bagid, 9)
6224 local bonus = modules.game_database.getPosBackpack(bagid, 8)
6225 UP_BAG.onClick = function() upgradeSelectItem(bagid) end
6226 UP_BAG:setTooltip("@GUN " ..id.. " " ..rare.. " " ..star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..level.. " " ..bonus.. " " ..lock.. " " ..ammo)
6227 else
6228 UP_BAG.onClick = function() upgradeSelectItem(bagid) end
6229 local starr = modules.game_database.getPosBackpack(bagid, 3)
6230 local levell = modules.game_database.getPosBackpack(bagid, 5)
6231 local rare = modules.game_database.getPosBackpack(bagid, 2)
6232 local atr1 = modules.game_database.getPosBackpack(bagid, 6)
6233 local atr2 = modules.game_database.getPosBackpack(bagid, 7)
6234 local lock = modules.game_database.getPosBackpack(bagid, 9)
6235 local bonus = modules.game_database.getPosBackpack(bagid, 8)
6236 UP_BAG:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..starr.. " 0 " ..levell.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
6237 end
6238 else
6239 UP_BAG:setIcon("/images/custom/UI/none")
6240 UP_BAG:setImageSource("/images/custom/UI/item_slot")
6241 UP_BAG:setTooltip("")
6242 UP_BAG:setText("")
6243 UP_BAG.onClick = function() end
6244 end
6245
6246 UP_BAG:show()
6247 g_effects.fadeIn(UP_BAG, 50)
6248 if Index < Max then
6249 Index = Index + 1
6250 LoadUpgradeBox(Index)
6251 else
6252 if modules.game_database.getInventory(ComboBoxSelect, 01) > 0 then
6253 ItemEquipado:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getInventory(ComboBoxSelect, 02))
6254 ItemEquipado:setIcon("/images/custom/Items/" ..modules.game_database.getInventory(ComboBoxSelect, 01))
6255 ItemEquipado.onClick = function() upgradeSelectItem(0) end
6256 g_effects.fadeIn(ItemEquipado, 250)
6257 if ComboBoxSelect == 01 then
6258 local id = modules.game_database.getInventory(01, 1)
6259 local star = modules.game_database.getInventory(1, 3)
6260 local rare = modules.game_database.getInventory(1, 2)
6261 local level = modules.game_database.getInventory(1, 5)
6262 local lock = modules.game_database.getInventory(1, 9)
6263 ItemEquipado:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
6264 elseif ComboBoxSelect == 02 then
6265 local id = modules.game_database.getInventory(2, 1)
6266 local star = modules.game_database.getInventory(2, 3)
6267 local level = modules.game_database.getInventory(2, 5)
6268 local atr1 = modules.game_database.getInventory(2, 6)
6269 local atr2 = modules.game_database.getInventory(2, 7)
6270 local rare = modules.game_database.getInventory(2, 2)
6271 local lock = modules.game_database.getInventory(2, 9)
6272 local bonus = modules.game_database.getInventory(2, 8)
6273 ItemEquipado:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
6274 elseif ComboBoxSelect == 04 then
6275 local id = modules.game_database.getInventory(4, 1)
6276 local skill_01 = modules.game_database.getInventory(4, 4)
6277 local skill_02 = modules.game_database.getInventory(4, 5)
6278 local skill_03 = modules.game_database.getInventory(4, 6)
6279 local level = modules.game_database.getInventory(4, 7)
6280 local star = modules.game_database.getInventory(4, 3)
6281 local rare = modules.game_database.getInventory(4, 2)
6282 local lock = modules.game_database.getInventory(4, 9)
6283 local bonus = modules.game_database.getInventory(4, 8)
6284 local ammo = modules.game_database.getInventory(4, 10)
6285
6286 ItemEquipado:setTooltip("@INVGUN " ..id.. " " ..rare.. " " ..star.. " " ..skill_01.. " " ..skill_02.. " " ..skill_03.. " " ..level.. " " ..bonus.. " " ..lock.. " " ..ammo)
6287 elseif ComboBoxSelect == 05 then
6288 local id = modules.game_database.getInventory(05, 1)
6289 local star = modules.game_database.getInventory(5, 3)
6290 local level = modules.game_database.getInventory(5, 5)
6291 local atr1 = modules.game_database.getInventory(5, 6)
6292 local atr2 = modules.game_database.getInventory(5, 7)
6293 local rare = modules.game_database.getInventory(5, 2)
6294 local lock = modules.game_database.getInventory(5, 9)
6295 local bonus = modules.game_database.getInventory(5, 8)
6296 ItemEquipado:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
6297 elseif ComboBoxSelect == 06 then
6298 local id = modules.game_database.getInventory(06, 1)
6299 local star = modules.game_database.getInventory(6, 3)
6300 local level = modules.game_database.getInventory(6, 5)
6301 local atr1 = modules.game_database.getInventory(6, 6)
6302 local atr2 = modules.game_database.getInventory(6, 7)
6303 local rare = modules.game_database.getInventory(6, 2)
6304 local lock = modules.game_database.getInventory(6, 9)
6305 local bonus = modules.game_database.getInventory(6, 9)
6306 ItemEquipado:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
6307 elseif ComboBoxSelect == 07 then
6308 local id = modules.game_database.getInventory(07, 1)
6309 local star = modules.game_database.getInventory(07, 3)
6310 local rare = modules.game_database.getInventory(07, 2)
6311 local level = modules.game_database.getInventory(07, 5)
6312 local lock = modules.game_database.getInventory(07, 9)
6313 ItemEquipado:setTooltip("@JOIAS " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " 0 0 0 " ..lock.. " 0")
6314 elseif ComboBoxSelect == 08 then
6315 local id = modules.game_database.getInventory(08, 1)
6316 local star = modules.game_database.getInventory(8, 3)
6317 local level = modules.game_database.getInventory(8, 5)
6318 local atr1 = modules.game_database.getInventory(8, 6)
6319 local atr2 = modules.game_database.getInventory(8, 7)
6320 local rare = modules.game_database.getInventory(8, 2)
6321 local lock = modules.game_database.getInventory(8, 9)
6322 local bonus = modules.game_database.getInventory(8, 8)
6323 ItemEquipado:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
6324 elseif ComboBoxSelect == 09 then
6325 local id = modules.game_database.getInventory(09, 1)
6326 local star = modules.game_database.getInventory(9, 3)
6327 local level = modules.game_database.getInventory(9, 5)
6328 local atr1 = modules.game_database.getInventory(9, 6)
6329 local atr2 = modules.game_database.getInventory(9, 7)
6330 local rare = modules.game_database.getInventory(9, 2)
6331 local lock = modules.game_database.getInventory(9, 9)
6332 local bonus = modules.game_database.getInventory(9, 8)
6333 ItemEquipado:setTooltip("@EQUIP " ..id.. " " ..rare.. " " ..star.. " 0 " ..level.. " " ..atr1.. " " ..atr2.. " " ..bonus.. " " ..lock.. " 0")
6334 end
6335 else
6336 ItemEquipado:setImageSource("/images/custom/UI/item_slot")
6337 ItemEquipado:setIcon("/images/custom/UI/none")
6338 ItemEquipado:setTooltip("")
6339 g_effects.fadeIn(ItemEquipado, 250)
6340 end
6341
6342 BACKPACK_01 = CentralBox:recursiveGetChildById('UBackpack1')
6343 BACKPACK_02 = CentralBox:recursiveGetChildById('UBackpack2')
6344 BACKPACK_03 = CentralBox:recursiveGetChildById('UBackpack3')
6345 BACKPACK_04 = CentralBox:recursiveGetChildById('UBackpack4')
6346 BACKPACK_01:show()
6347 BACKPACK_02:show()
6348 BACKPACK_03:show()
6349 BACKPACK_04:show()
6350
6351 BACKPACK_01:setTooltip("Backpack 01")
6352 g_effects.fadeIn(BACKPACK_01, 250)
6353 BagSelect = 0
6354 BACKPACK_01.onClick = function()
6355 resetUpgradeItem()
6356 BagSelect = 0
6357 g_game.talk(g_game.talk("!backpack 51 "..ComboBoxSelect.. " 00"))
6358 end
6359 if modules.game_database.getExtension(ComboBoxSelect) >= 01 then
6360 BACKPACK_02:setTooltip("Backpack 02")
6361 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot")
6362 g_effects.fadeIn(BACKPACK_02, 250)
6363
6364 BACKPACK_02.onClick = function()
6365 resetUpgradeItem()
6366 BagSelect = 1
6367 g_game.talk(g_game.talk("!backpack 51 "..ComboBoxSelect.. " 01"))
6368 end
6369 else
6370 g_effects.fadeIn(BACKPACK_02, 250)
6371 BACKPACK_02:setImageSource("/images/custom/UI/backpack_slot_lock")
6372 BACKPACK_02:setTooltip(tr("Compre um novo Slot no Shop"))
6373 BACKPACK_02.onClick = function() end
6374 end
6375 if modules.game_database.getExtension(ComboBoxSelect) >= 02 then
6376 BACKPACK_03:setTooltip("Backpack 03")
6377 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot")
6378 g_effects.fadeIn(BACKPACK_03, 250)
6379
6380 BACKPACK_03.onClick = function()
6381 resetUpgradeItem()
6382 BagSelect = 2
6383 g_game.talk(g_game.talk("!backpack 51 "..ComboBoxSelect.. " 02"))
6384 end
6385 else
6386 g_effects.fadeIn(BACKPACK_03, 250)
6387 BACKPACK_03:setImageSource("/images/custom/UI/backpack_slot_lock")
6388 BACKPACK_03:setTooltip(tr("Compre um novo Slot no Shop"))
6389 BACKPACK_03.onClick = function() end
6390 end
6391 if modules.game_database.getExtension(ComboBoxSelect) >= 03 then
6392 BACKPACK_04:setTooltip("Backpack 04")
6393 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot")
6394 g_effects.fadeIn(BACKPACK_04, 250)
6395
6396 BACKPACK_04.onClick = function()
6397 resetUpgradeItem()
6398 BagSelect = 3
6399 g_game.talk(g_game.talk("!backpack 51 "..ComboBoxSelect.. " 03"))
6400 end
6401 else
6402 g_effects.fadeIn(BACKPACK_04, 250)
6403 BACKPACK_04:setImageSource("/images/custom/UI/backpack_slot_lock")
6404 BACKPACK_04:setTooltip(tr("Compre um novo Slot no Shop"))
6405 BACKPACK_04.onClick = function() end
6406 end
6407
6408 end
6409 end, 10)
6410
6411 LevelRec:setText("")
6412 LevelRec:setTooltip('')
6413 CoinsRec:setText("")
6414 coinMenSucess:setTooltip('')
6415 coinMoreSucess:setTooltip('')
6416 rateSucess:setText(tr("Chance de Sucesso: ").. "0%")
6417 ButtonUpgrade:disable()
6418end
6419
6420function closer()
6421 -- ...existing code...
6422 CentralBox:hide()
6423 if BUY_WINDOW then
6424 BUY_WINDOW:destroy()
6425 end
6426 BackgroundCentral:hide()
6427 -- Rebind Enter para abrir el chat
6428 g_keyboard.bindKeyPress('Enter', function()
6429 modules.game_chat.show()
6430 end)
6431 centralBox = false
6432 DepotActive = false
6433 BUY_WINDOW = nil
6434 if g_app.isMobile() then
6435 modules.client_mobile.onHideUI(01)
6436 end
6437end
6438function offline()
6439 CentralBox:hide()
6440 if BUY_WINDOW then
6441 BUY_WINDOW:destroy()
6442 end
6443 Market:hide()
6444 MarketWindow:hide()
6445 Vendas:hide()
6446 VendasWindow:hide()
6447 Upgrade:hide()
6448 UpgradeWindow:hide()
6449 Skill:hide()
6450 SkillWindow:hide()
6451 BackgroundCentral:hide()
6452 centralBox = false
6453 DepotActive = false
6454 BUY_WINDOW = nil
6455end
6456function terminate()
6457 disconnect(g_game, {
6458 disconnect(g_game, 'onTextMessage', onCentralBox),
6459 })
6460 disconnect(g_game, { onGameEnd = offline })
6461
6462 BUY_WINDOW = nil
6463 ProtocolGame.unregisterExtendedOpcode(Opcodes)
6464 CentralBox:destroy()
6465 BackgroundCentral:destroy()
6466end
6467