| | | @@ -0,0 +1,4824 @@ |
| 1 | + | gameRootPanel = nil |
| 2 | + | gameMapPanel = nil |
| 3 | + | gameRightPanels = nil |
| 4 | + | gameLeftPanels = nil |
| 5 | + | gameBottomPanel = nil |
| 6 | + | gameActionPanel = nil |
| 7 | + | gameLeftActions = nil |
| 8 | + | logoutButton = nil |
| 9 | + | mouseGrabberWidget = nil |
| 10 | + | countWindow = nil |
| 11 | + | logoutWindow = nil |
| 12 | + | exitWindow = nil |
| 13 | + | bottomSplitter = nil |
| 14 | + | onBotWindow = nil |
| 15 | + | limitedZoom = false |
| 16 | + | defaultZoom = 12 |
| 17 | + | tradeShow = 0 |
| 18 | + | TradeOpcodes = 102 |
| 19 | + | FinishTradeOP01 = 103 |
| 20 | + | FinishTradeOP02 = 104 |
| 21 | + | FinishTradeOP03 = 105 |
| 22 | + | BotMonitoramento = 120 |
| 23 | + | PIX_REAL_NAME, PIX_EMAIL, PIX_BANK, HIGH_PLAYER_ACCOUNT, GM_NAME = "", "", "", "", "" |
| 24 | + | CriptoMoeda, CriptoPrice, SaldoBlacklist, RequestFinalCoin, RequestFinalValor, EditOldCript, PixBoxView = 0, 0, 0, 0, 0, 0, false |
| 25 | + | DinRealCalculo = 0 |
| 26 | + | BotMonitoreOn = false |
| 27 | + | hookedMenuOptions = {} |
| 28 | + | lastDirTime = g_clock.millis() |
| 29 | + | local KARDS_RANK_EXP = { |
| 30 | + | [01] = {NAME = 'BRONZE', TIER = 01, EXP = 0050, BONUS = 00}; |
| 31 | + | [02] = {NAME = 'BRONZE', TIER = 02, EXP = 0150, BONUS = 02}; |
| 32 | + | [03] = {NAME = 'BRONZE', TIER = 03, EXP = 0300, BONUS = 04}; |
| 33 | + | [04] = {NAME = 'BRONZE', TIER = 04, EXP = 0450, BONUS = 06}; |
| 34 | + | [05] = {NAME = 'SILVER', TIER = 01, EXP = 0650, BONUS = 08}; |
| 35 | + | [06] = {NAME = 'SILVER', TIER = 02, EXP = 0850, BONUS = 10}; |
| 36 | + | [07] = {NAME = 'SILVER', TIER = 03, EXP = 1050, BONUS = 12}; |
| 37 | + | [08] = {NAME = 'SILVER', TIER = 04, EXP = 1250, BONUS = 14}; |
| 38 | + | [09] = {NAME = 'GOLD', TIER = 01, EXP = 1500, BONUS = 16}; |
| 39 | + | [10] = {NAME = 'GOLD', TIER = 02, EXP = 1750, BONUS = 18}; |
| 40 | + | [11] = {NAME = 'GOLD', TIER = 03, EXP = 2000, BONUS = 20}; |
| 41 | + | [12] = {NAME = 'GOLD', TIER = 04, EXP = 2250, BONUS = 22}; |
| 42 | + | [13] = {NAME = 'PLATINUM', TIER = 01, EXP = 2550, BONUS = 24}; |
| 43 | + | [14] = {NAME = 'PLATINUM', TIER = 02, EXP = 2850, BONUS = 26}; |
| 44 | + | [15] = {NAME = 'PLATINUM', TIER = 03, EXP = 3150, BONUS = 28}; |
| 45 | + | [16] = {NAME = 'PLATINUM', TIER = 04, EXP = 3450, BONUS = 30}; |
| 46 | + | [17] = {NAME = 'DIAMOND', TIER = 01, EXP = 3800, BONUS = 32}; |
| 47 | + | [18] = {NAME = 'DIAMOND', TIER = 02, EXP = 4150, BONUS = 34}; |
| 48 | + | [19] = {NAME = 'DIAMOND', TIER = 03, EXP = 4500, BONUS = 36}; |
| 49 | + | [20] = {NAME = 'DIAMOND', TIER = 04, EXP = 5000, BONUS = 38}; |
| 50 | + | [21] = {NAME = 'MYSTIC', TIER = 04, EXP = 5000, BONUS = 40}; |
| 51 | + | } |
| 52 | + | local EVENTOS_TABLE = { |
| 53 | + | [00] = { |
| 54 | + | EVENT_ID = 3085; |
| 55 | + | EVENT_UID_1 = 3086; |
| 56 | + | EVENT_UID_2 = 3087; |
| 57 | + | EVENT_UID_3 = 3088; |
| 58 | + | EVENT_UID_4 = 3089; |
| 59 | + | EVENT_UID_5 = 3090; |
| 60 | + | EVENT_UID_6 = 3091; |
| 61 | + | EVENT_UID_7 = 3092; |
| 62 | + | EVENT_UID_8 = 3093; |
| 63 | + | EVENT_UID_9 = 3094; |
| 64 | + | EVENT_UID_10 = 3095; |
| 65 | + | EVENT_UID_11 = 3096; |
| 66 | + | EVENT_UID_12 = 3097; |
| 67 | + | }; |
| 68 | + | [01] = { |
| 69 | + | DATA_INICIO = 01; |
| 70 | + | DATA_FIM = 20; |
| 71 | + | EVENT_NAME = 'BENCAO DOS DEUSES'; |
| 72 | + | DATA_DESC = '01 a 20'; |
| 73 | + | MES_NAME = 'Janeiro'; |
| 74 | + | EVENT_INF = 'No ServerSave, 03 monstros serao escolhidos aleatoriamente. Ate o proximo SS, esses monstros droparam Gold Token. Use-os para comprar o buff.'; |
| 75 | + | GOLD_TOKEN = 1280; |
| 76 | + | }; |
| 77 | + | [02] = { |
| 78 | + | DATA_INICIO = 12; |
| 79 | + | DATA_FIM = 20; |
| 80 | + | EVENT_NAME = 'MODO ONLINE'; |
| 81 | + | DATA_DESC = '02 a 20'; |
| 82 | + | MES_NAME = 'Fevereiro'; |
| 83 | + | EVENT_INF = 'Todo o servidor deve eliminar 5000 monstros (qualquer monstro). Ao concluir, ate o SS das 00:00h todos os jogadores Online receberao 1x Online Points adicional.'; |
| 84 | + | }; |
| 85 | + | [03] = { |
| 86 | + | DATA_INICIO = 15; |
| 87 | + | DATA_FIM = 25; |
| 88 | + | EVENT_NAME = 'CRYPTOBLOOD'; |
| 89 | + | DATA_DESC = '15 a 25'; |
| 90 | + | MES_NAME = 'Marco'; |
| 91 | + | EVENT_INF = 'O valor fixo e 50.000. Para todo o servidor, a cada monstro morto (qualquer monstro) o preco e diminuido em 1. O valor fixo e resetado a cada ServerSave.'; |
| 92 | + | }; |
| 93 | + | [04] = { |
| 94 | + | DATA_INICIO = 01; |
| 95 | + | DATA_FIM = 15; |
| 96 | + | EVENT_NAME = 'ESSENCIAS ELEMENTAIS'; |
| 97 | + | DATA_DESC = '01 a 15'; |
| 98 | + | MES_NAME = 'Abril'; |
| 99 | + | EVENT_INF = 'Durante o evento, todos os monstros terao chance de dropar um dos 04 cristais. Use-as para ativar um dos buffs abaixo por 01 hora.'; |
| 100 | + | BUFF_ELE = 1281; |
| 101 | + | }; |
| 102 | + | [05] = { |
| 103 | + | DATA_INICIO = 01; |
| 104 | + | DATA_FIM = 15; |
| 105 | + | EVENT_NAME = 'ESTOQUE DE SUPRIMENTO'; |
| 106 | + | DATA_DESC = '01 a 15'; |
| 107 | + | MES_NAME = 'Maio'; |
| 108 | + | EVENT_INF = 'Apos o ServerSave das 00:00h uma nova lista de itens surgira. Entregue os itens solicitados para receber sua recompensa em Task Points.'; |
| 109 | + | ITEMS_TASK = { |
| 110 | + | [01] = {3005, 3006, 3007, 3011, 3013, 3014, 3042, 3044, 3056, 3060, 3108, 3109, 3140, 3169, 3175, 3178, 3187, 3193, 3244, 3253}; |
| 111 | + | [02] = {3016, 3020, 3037, 3038, 3039, 3062, 3064, 3067, 3068, 3074, 3075, 3093, 3081, 3110, 3115, 3131, 3206, 3212, 3240, 3279}; |
| 112 | + | [03] = {3022, 3023, 3029, 3030, 3032, 3231, 3035, 3065, 3087, 3089, 3079, 3097, 3100, 3116, 3119, 3136, 3138, 3148, 3234, 3271}; |
| 113 | + | }; |
| 114 | + | }; |
| 115 | + | [06] = { |
| 116 | + | DATA_INICIO = 12; |
| 117 | + | DATA_FIM = 25; |
| 118 | + | EVENT_NAME = 'LEVEL E GANHE'; |
| 119 | + | DATA_DESC = '12 a 25'; |
| 120 | + | MES_NAME = 'Junho'; |
| 121 | + | EVENT_INF = 'A cada nivel obtido por qualquer jogador Nv. 100 ou maior no servidor, todos online ganham pontos. Use os pontos para abrir a caixa de presentes.'; |
| 122 | + | POINTS = 1282; |
| 123 | + | }; |
| 124 | + | [07] = { |
| 125 | + | DATA_INICIO = 10; |
| 126 | + | DATA_FIM = 20; |
| 127 | + | EVENT_NAME = 'CAMPEONATO DE KARD'; |
| 128 | + | DATA_DESC = '10 a 20'; |
| 129 | + | MES_NAME = 'Julho'; |
| 130 | + | EVENT_INF = 'Durante o evento, a cada duelo de Kard vencido contra NPCs voce recebera um bonus de EXP. Esse bonus se acumula a cada vitoria ate o limite de 300%. O bonus de EXP reseta apos o ServerSave das 00:00h.'; |
| 131 | + | EXP_BONUS = 1283; |
| 132 | + | NPC = { |
| 133 | + | [01] = {NAME = "Charos", EXP = 01, SIZE = {41, 48, 07, 13}, RASTREAR = {{x=3529, y=1544, z=07}}}; |
| 134 | + | [02] = {NAME = "Partos", EXP = 02, SIZE = {40, 48, 07, 13}, RASTREAR = {{x=3546, y=1744, z=07}}}; |
| 135 | + | [03] = {NAME = "Bozo", EXP = 03, SIZE = {57, 48, 07, 05}, RASTREAR = {{x=3483, y=1696, z=07}}}; |
| 136 | + | [04] = {NAME = "Galuna", EXP = 04, SIZE = {40, 48, 07, 13}, RASTREAR = {{x=3374, y=1728, z=07}}}; |
| 137 | + | [05] = {NAME = "Gareth", EXP = 05, SIZE = {64, 64, 02, 05}, RASTREAR = {{x=3312, y=1733, z=07}}}; |
| 138 | + | [06] = {NAME = "Hanna", EXP = 06, SIZE = {40, 48, 07, 13}, RASTREAR = {{x=3291, y=1766, z=07}}}; |
| 139 | + | [07] = {NAME = "Harsky", EXP = 07, SIZE = {42, 48, 07, 13}, RASTREAR = {{x=3213, y=1727, z=07}}}; |
| 140 | + | [08] = {NAME = "Henricus", EXP = 08, SIZE = {51, 48, 07, 11}, RASTREAR = {{x=3311, y=1701, z=07}}}; |
| 141 | + | [09] = {NAME = "Marvik", EXP = 09, SIZE = {40, 45, 07, 13}, RASTREAR = {{x=3765, y=1820, z=07}}}; |
| 142 | + | [10] = {NAME = "Kevin", EXP = 10, SIZE = {33, 48, 10, 15}, RASTREAR = {{x=3360, y=1918, z=07}}}; |
| 143 | + | [11] = {NAME = "Lungelen", EXP = 11, SIZE = {53, 48, 05, 09}, RASTREAR = {{x=3369, y=2061, z=07}}}; |
| 144 | + | [12] = {NAME = "Palomino", EXP = 12, SIZE = {51, 48, 05, 10}, RASTREAR = {{x=3815, y=1487, z=07}}}; |
| 145 | + | [13] = {NAME = "Hoggle", EXP = 13, SIZE = {40, 48, 07, 13}, RASTREAR = {{x=3375, y=1860, z=07}}}; |
| 146 | + | [14] = {NAME = "Naji", EXP = 14, SIZE = {35, 48, 07, 13}, RASTREAR = {{x=3825, y=1746, z=07}}}; |
| 147 | + | [15] = {NAME = "Loria", EXP = 15, SIZE = {33, 48, 10, 15}, RASTREAR = {{x=3378, y=1939, z=07}}}; |
| 148 | + | [16] = {NAME = "Muriel", EXP = 16, SIZE = {38, 45, 07, 13}, RASTREAR = {{x=3809, y=1787, z=07}}}; |
| 149 | + | [17] = {NAME = "Lynda", EXP = 17, SIZE = {36, 48, 07, 13}, RASTREAR = {{x=3490, y=1905, z=07}}}; |
| 150 | + | [18] = {NAME = "Norf", EXP = 18, SIZE = {64, 48, 05, 01}, RASTREAR = {{x=3881, y=1538, z=07}}}; |
| 151 | + | --[12] = {NAME = "Lubo", EXP = 26, SIZE = {38, 48, 07, 13}, RASTREAR = {{x=3999, y=991, z=07}}}; |
| 152 | + | }; |
| 153 | + | }; |
| 154 | + | [08] = { |
| 155 | + | DATA_INICIO = 14; |
| 156 | + | DATA_FIM = 25; |
| 157 | + | EVENT_NAME = 'DESCONTRUTOR'; |
| 158 | + | DATA_DESC = '14 a 25'; |
| 159 | + | MES_NAME = 'Agosto'; |
| 160 | + | EVENT_INF = 'Durante o evento, a opcao de destruir o item sera substituida por Descontruir. Ao fazer isso, voce obtem parte dos materiais de upgrade daquele item.'; |
| 161 | + | }; |
| 162 | + | [09] = { |
| 163 | + | DATA_INICIO = 07; |
| 164 | + | DATA_FIM = 20; |
| 165 | + | EVENT_NAME = 'MESTRES DA GUERRA'; |
| 166 | + | DATA_DESC = '07 a 20'; |
| 167 | + | MES_NAME = 'Setembro'; |
| 168 | + | EVENT_INF = 'Durante o evento, todas as recompensas de PVP Points da Warzone serao dobradas.'; |
| 169 | + | }; |
| 170 | + | [10] = { |
| 171 | + | DATA_INICIO = 10; |
| 172 | + | DATA_FIM = 20; |
| 173 | + | EVENT_NAME = 'BAU DO DRAGAO'; |
| 174 | + | DATA_DESC = '10 a 20'; |
| 175 | + | MES_NAME = 'Outubro'; |
| 176 | + | EVENT_INF = 'Durante o evento, todos os bosses da blacklist droparam um item chamado Chave do Evento. Quanto mais forte o boss, mais facil de dropar a chave. Use a chave para abrir o bau do dragao.'; |
| 177 | + | KEYS_EVENT = 1286; |
| 178 | + | }; |
| 179 | + | [11] = { |
| 180 | + | DATA_INICIO = 20; |
| 181 | + | DATA_FIM = 28; |
| 182 | + | EVENT_NAME = 'PILARES DA FORTUNA'; |
| 183 | + | DATA_DESC = '20 a 28'; |
| 184 | + | MES_NAME = 'Novembro'; |
| 185 | + | EVENT_INF = '05 Pilares serao invocados no mapa. Ao destruir o primeiro, o servidor tera 05 minutos para destruir os outros. Se conseguirem, o bonus abaixo ficara ativo ate o proximo ServerSave.'; |
| 186 | + | PILLAR_STEP = 3098; |
| 187 | + | PILLAR_POS = { |
| 188 | + | [01] = {POS = {{x=3771, y=1059, z=07}}, TILE = {3771, 1059, 07}}; |
| 189 | + | [02] = {POS = {{x=3271, y=1373, z=07}}, TILE = {3271, 1373, 07}}; |
| 190 | + | [03] = {POS = {{x=3400, y=1991, z=07}}, TILE = {3400, 1991, 07}}; |
| 191 | + | [04] = {POS = {{x=3871, y=1650, z=07}}, TILE = {3871, 1650, 07}}; |
| 192 | + | [05] = {POS = {{x=3661, y=1812, z=07}}, TILE = {3661, 1812, 07}}; |
| 193 | + | }; |
| 194 | + | }; |
| 195 | + | [12] = { |
| 196 | + | DATA_INICIO = 15; |
| 197 | + | DATA_FIM = 25; |
| 198 | + | EVENT_NAME = 'OS ESCOLHIDOS'; |
| 199 | + | DATA_DESC = '15 a 25'; |
| 200 | + | MES_NAME = 'Dezembro'; |
| 201 | + | EVENT_INF = '03 classes serao selecionados. Eliminando monstros da classe, o servidor ganha Pontos de Meta. Matar monstros de outras classes, perdem Pontos de Meta. Alcance a meta para ativar o bonus.'; |
| 202 | + | }; |
| 203 | + | } |
| 204 | + | local HISTORY_CRIPTO = { |
| 205 | + | [01] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 206 | + | [02] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 207 | + | [03] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 208 | + | [04] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 209 | + | [05] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 210 | + | [06] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 211 | + | [07] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 212 | + | [08] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 213 | + | [09] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 214 | + | [10] = {ID = 0000, ACCOUNT_ID = 0000, NAME = "", EMAIL = "", BANK = "", CRIPTOMOEDA = 0000, PRICE = "", VALOR = "", STATUS = 00, OBS = ""}, |
| 215 | + | } |
| 216 | + | |
| 217 | + | local function loadModules() |
| 218 | + | -- libraries modules 0-99 |
| 219 | + | g_modules.autoLoadModules(99) |
| 220 | + | g_modules.ensureModuleLoaded("gamelib") |
| 221 | + | |
| 222 | + | -- client modules 100-499 |
| 223 | + | g_modules.autoLoadModules(499) |
| 224 | + | g_modules.ensureModuleLoaded("client") |
| 225 | + | |
| 226 | + | -- game modules 500-999 |
| 227 | + | g_modules.autoLoadModules(999) |
| 228 | + | g_modules.ensureModuleLoaded("game_interface") |
| 229 | + | |
| 230 | + | -- mods 1000-9999 |
| 231 | + | g_modules.autoLoadModules(9999) |
| 232 | + | end |
| 233 | + | function init() |
| 234 | + | g_ui.importStyle('styles/countwindow') |
| 235 | + | |
| 236 | + | connect(g_game, { |
| 237 | + | onGameStart = onGameStart, |
| 238 | + | onGameEnd = onGameEnd, |
| 239 | + | onLoginAdvice = onLoginAdvice, |
| 240 | + | connect(g_game, 'onTextMessage', onInterfaceMsg), |
| 241 | + | }, true) |
| 242 | + | |
| 243 | + | -- Call load AFTER game window has been created and |
| 244 | + | -- resized to a stable state, otherwise the saved |
| 245 | + | -- settings can get overridden by false onGeometryChange |
| 246 | + | -- events |
| 247 | + | connect(g_app, { |
| 248 | + | onRun = load, |
| 249 | + | onExit = save |
| 250 | + | }) |
| 251 | + | |
| 252 | + | tradeWindow = g_ui.displayUI('trade') |
| 253 | + | TraderName = tradeWindow:recursiveGetChildById('traderTarget') |
| 254 | + | PlayerName = tradeWindow:recursiveGetChildById('playerOwn') |
| 255 | + | TraderMobileWindow = tradeWindow:recursiveGetChildById('tradeMobileWindow') |
| 256 | + | TraderWindow = tradeWindow:recursiveGetChildById('traderWindow') |
| 257 | + | Loading = tradeWindow:recursiveGetChildById('Loading') |
| 258 | + | TextLoading = tradeWindow:recursiveGetChildById('txtLoading') |
| 259 | + | StartTrade = tradeWindow:recursiveGetChildById('StartTrade') |
| 260 | + | |
| 261 | + | -- Ajusta la posición del nombre del jugador |
| 262 | + | PlayerName:setPosition({x = 200, y = 5}) -- Ajusta estos valores |
| 263 | + | |
| 264 | + | coinsWindow = tradeWindow:recursiveGetChildById('goldInsert') |
| 265 | + | coinsVIPWindow = tradeWindow:recursiveGetChildById('vipInsert') |
| 266 | + | CancelTrade = tradeWindow:recursiveGetChildById('CancelTrade') |
| 267 | + | InsertGCoin = tradeWindow:recursiveGetChildById('InsertGCoin') |
| 268 | + | InsertVCoin = tradeWindow:recursiveGetChildById('InsertVCoin') |
| 269 | + | PGCoin = tradeWindow:recursiveGetChildById('PGCoin') |
| 270 | + | PVCoin = tradeWindow:recursiveGetChildById('PVCoin') |
| 271 | + | TGCoin = tradeWindow:recursiveGetChildById('TGCoin') |
| 272 | + | TVCoin = tradeWindow:recursiveGetChildById('TVCoin') |
| 273 | + | MobileInsertGCoin = tradeWindow:recursiveGetChildById('MobileInsertGCoin') |
| 274 | + | MobileInsertVCoin = tradeWindow:recursiveGetChildById('MobileInsertVCoin') |
| 275 | + | MobilePGCoin = tradeWindow:recursiveGetChildById('MobilePGCoin') |
| 276 | + | MobilePVCoin = tradeWindow:recursiveGetChildById('MobilePVCoin') |
| 277 | + | MobileTGCoin = tradeWindow:recursiveGetChildById('MobileTGCoin') |
| 278 | + | MobileTVCoin = tradeWindow:recursiveGetChildById('MobileTVCoin') |
| 279 | + | coinsVIPWindow:hide() |
| 280 | + | coinsWindow:hide() |
| 281 | + | tradeWindow:hide() |
| 282 | + | |
| 283 | + | ProtocolGame.registerExtendedOpcode(TradeOpcodes, function(protocol, opcode, buffer) end) |
| 284 | + | ProtocolGame.registerExtendedOpcode(FinishTradeOP01, function(protocol, opcode, buffer) end) |
| 285 | + | ProtocolGame.registerExtendedOpcode(FinishTradeOP02, function(protocol, opcode, buffer) end) |
| 286 | + | ProtocolGame.registerExtendedOpcode(FinishTradeOP03, function(protocol, opcode, buffer) end) |
| 287 | + | ProtocolGame.registerExtendedOpcode(BotMonitoramento, function(protocol, opcode, buffer) end) |
| 288 | + | |
| 289 | + | gameRootPanel = g_ui.displayUI('gameinterface') |
| 290 | + | gameRootPanel:hide() |
| 291 | + | gameRootPanel:lower() |
| 292 | + | gameRootPanel.onGeometryChange = updateStretchShrink |
| 293 | + | |
| 294 | + | mouseGrabberWidget = gameRootPanel:getChildById('mouseGrabber') |
| 295 | + | mouseGrabberWidget.onMouseRelease = onMouseGrabberRelease |
| 296 | + | mouseGrabberWidget.onTouchRelease = mouseGrabberWidget.onMouseRelease |
| 297 | + | |
| 298 | + | bottomSplitter = gameRootPanel:getChildById('bottomSplitter') |
| 299 | + | gameMapPanel = gameRootPanel:getChildById('gameMapPanel') |
| 300 | + | gameRightPanels = gameRootPanel:getChildById('gameRightPanels') |
| 301 | + | gameLeftPanels = gameRootPanel:getChildById('gameLeftPanels') |
| 302 | + | gameBottomPanel = gameRootPanel:getChildById('gameBottomPanel') |
| 303 | + | gameActionPanel = gameRootPanel:getChildById('gameActionPanel') |
| 304 | + | gameLeftActions = gameRootPanel:getChildById('gameLeftActions') |
| 305 | + | SupMobile1 = gameLeftActions:recursiveGetChildById('sup02') |
| 306 | + | SupMobile2 = gameLeftActions:recursiveGetChildById('sup01') |
| 307 | + | SupMobile3 = gameLeftActions:recursiveGetChildById('sup03') |
| 308 | + | SkillMobile1 = gameLeftActions:recursiveGetChildById('spell01') |
| 309 | + | SkillMobile2 = gameLeftActions:recursiveGetChildById('spell02') |
| 310 | + | SkillMobile3 = gameLeftActions:recursiveGetChildById('spell03') |
| 311 | + | |
| 312 | + | ClosedMenu = gameRootPanel:recursiveGetChildById('closedMenu') |
| 313 | + | ClosedMenu:hide() |
| 314 | + | ClosedMenu:setVisible(false) |
| 315 | + | ViewItems = gameRootPanel:recursiveGetChildById('viewItems') |
| 316 | + | ViewItems:hide() |
| 317 | + | ViewItems:setVisible(false) |
| 318 | + | |
| 319 | + | SKILLBAR = gameLeftActions:recursiveGetChildById('menuBar') |
| 320 | + | SKILLBAR:hide() |
| 321 | + | SKILLBAR:setVisible(false) |
| 322 | + | |
| 323 | + | SHOP_WINDOW = gameRootPanel:recursiveGetChildById('shopMobile') |
| 324 | + | VipLabel = gameRootPanel:recursiveGetChildById('VipLabel') |
| 325 | + | OnlineLabel = gameRootPanel:recursiveGetChildById('OnlineLabel') |
| 326 | + | PVPLabel = gameRootPanel:recursiveGetChildById('PVPLabel') |
| 327 | + | VipLabelSelect = gameRootPanel:recursiveGetChildById('VipLabelSelect') |
| 328 | + | OnlineLabelSelect = gameRootPanel:recursiveGetChildById('OnlineLabelSelect') |
| 329 | + | PVPLabelSelect = gameRootPanel:recursiveGetChildById('PVPLabelSelect') |
| 330 | + | |
| 331 | + | PremiumLabel = gameRootPanel:recursiveGetChildById('PremiumLabel') |
| 332 | + | ConsumiveisLabel = gameRootPanel:recursiveGetChildById('ConsumiveisLabel') |
| 333 | + | BuffLabel = gameRootPanel:recursiveGetChildById('BuffLabel') |
| 334 | + | ServicosLabel = gameRootPanel:recursiveGetChildById('ServicosLabel') |
| 335 | + | EspecialLabel = gameRootPanel:recursiveGetChildById('EspecialLabel') |
| 336 | + | FerramentasLabel = gameRootPanel:recursiveGetChildById('FerramentasLabel') |
| 337 | + | OutfitLabel = gameRootPanel:recursiveGetChildById('OutfitLabel') |
| 338 | + | MontariaLabel = gameRootPanel:recursiveGetChildById('MontariaLabel') |
| 339 | + | BackpackLabel = gameRootPanel:recursiveGetChildById('BackpackLabel') |
| 340 | + | KardLabel = gameRootPanel:recursiveGetChildById('KardLabel') |
| 341 | + | ExtensoesLabel = gameRootPanel:recursiveGetChildById('ExtensoesLabel') |
| 342 | + | WarzoneLabel = gameRootPanel:recursiveGetChildById('WarzoneLabel') |
| 343 | + | SHOP_SELECT = gameRootPanel:recursiveGetChildById('shopSelectPanel') |
| 344 | + | SHOP_SCROLL = gameRootPanel:recursiveGetChildById('selectPanelScrollBar') |
| 345 | + | SHOP_SELECT_PANEL = gameRootPanel:recursiveGetChildById('selectPanel') |
| 346 | + | SHOP_SELECT_DESC = gameRootPanel:recursiveGetChildById('SelectDesc') |
| 347 | + | SHOP_WINDOW:hide() |
| 348 | + | |
| 349 | + | EQUIPAMENT = gameRootPanel:recursiveGetChildById('menuEquip') |
| 350 | + | MOBILE_AMULET = gameRootPanel:recursiveGetChildById('mobileAmulet') |
| 351 | + | MOBILE_HELMET = gameRootPanel:recursiveGetChildById('mobileHelmet') |
| 352 | + | MOBILE_BACKPACK = gameRootPanel:recursiveGetChildById('mobileBackpack') |
| 353 | + | MOBILE_GUN = gameRootPanel:recursiveGetChildById('mobileGun') |
| 354 | + | MOBILE_ARMOR = gameRootPanel:recursiveGetChildById('mobileArmor') |
| 355 | + | MOBILE_GLOVE = gameRootPanel:recursiveGetChildById('mobileGlove') |
| 356 | + | MOBILE_RING = gameRootPanel:recursiveGetChildById('mobileRing') |
| 357 | + | MOBILE_LEGS = gameRootPanel:recursiveGetChildById('mobileLegs') |
| 358 | + | MOBILE_BOOTS = gameRootPanel:recursiveGetChildById('mobileBoots') |
| 359 | + | MOBILE_INV_KARDS = gameRootPanel:recursiveGetChildById('mobileInvetarioKards') |
| 360 | + | MOBILE_INV_KARDS_IMG = gameRootPanel:recursiveGetChildById('ImgSummonEquip') |
| 361 | + | MOBILE_INV_KARDS_NAM = gameRootPanel:recursiveGetChildById('NameSummonEquip') |
| 362 | + | MOBILE_INV_KARDS_STA = gameRootPanel:recursiveGetChildById('StarSummonEquip') |
| 363 | + | MOBILE_SELECT_KARDS = gameRootPanel:recursiveGetChildById('kardSelect') |
| 364 | + | MOBILE_SELECT_CLASS = gameRootPanel:recursiveGetChildById('txtSummonStar') |
| 365 | + | MOBILE_SELECT_FILTR = gameRootPanel:recursiveGetChildById('filtroStar') |
| 366 | + | MOBILE_SELECT_NEWSU = gameRootPanel:recursiveGetChildById('NewSummon') |
| 367 | + | MOBILE_SELECT_NEWIM = gameRootPanel:recursiveGetChildById('ImgSummonNew') |
| 368 | + | MOBILE_SELECT_NEWIN = gameRootPanel:recursiveGetChildById('NewSummonInfo') |
| 369 | + | MOBILE_SELECT_PROGR = gameRootPanel:recursiveGetChildById('NewSumProgress') |
| 370 | + | MOBILE_SELECT_LASTS = gameRootPanel:recursiveGetChildById('lastSum') |
| 371 | + | MOBILE_SELECT_COUNT = gameRootPanel:recursiveGetChildById('countSum') |
| 372 | + | MOBILE_SELECT_NEXTS = gameRootPanel:recursiveGetChildById('nextSum') |
| 373 | + | MOBILE_SELECT_EQUIP = gameRootPanel:recursiveGetChildById('EquipSummon') |
| 374 | + | EQUIPAMENT:setVisible(false) |
| 375 | + | |
| 376 | + | ACTIVE_MOBILE_LIST = gameRootPanel:recursiveGetChildById('mobileActiveList') |
| 377 | + | ACTIVE_SCROLL = gameRootPanel:recursiveGetChildById('activeMobileListScrollBar') |
| 378 | + | ACTIVE_LIST = gameRootPanel:recursiveGetChildById('activeMobilePanel') |
| 379 | + | ACTIVE_MOBILE_RANK = gameRootPanel:recursiveGetChildById('mobileHallFame') |
| 380 | + | ACTIVE_MOBILE_FILTRO_RANK = gameRootPanel:recursiveGetChildById('rankMobileFiltro') |
| 381 | + | ACTIVE_MOBILE_FILTRO_RANK:addOption("Level", "00") |
| 382 | + | ACTIVE_MOBILE_FILTRO_RANK:addOption("Metralhadora", "01") |
| 383 | + | ACTIVE_MOBILE_FILTRO_RANK:addOption("Rifle", "02") |
| 384 | + | ACTIVE_MOBILE_FILTRO_RANK:addOption("Pistola", "03") |
| 385 | + | ACTIVE_MOBILE_FILTRO_RANK:addOption("Espingarda", "04") |
| 386 | + | RANK_LIST_MOBILE = gameRootPanel:recursiveGetChildById('rankMobilePanel') |
| 387 | + | FENDA_MOBILE_PANEL = gameRootPanel:recursiveGetChildById('mobileFenda') |
| 388 | + | FENDA_MOBILE_LIST = gameRootPanel:recursiveGetChildById('fendaMobilePanel') |
| 389 | + | KARD_MOBILE_PANEL_OFF = gameRootPanel:recursiveGetChildById('mobileKardsOff') |
| 390 | + | KARD_MOBILE_PANEL_ON = gameRootPanel:recursiveGetChildById('showMobileKards') |
| 391 | + | KARD_NPC_MOBILE_PANEL = gameRootPanel:recursiveGetChildById('KardsNPCPanel') |
| 392 | + | KARDS_RANK_IMG = gameRootPanel:recursiveGetChildById('kardsImg') |
| 393 | + | KARDS_RANK_PROG = gameRootPanel:recursiveGetChildById('krank') |
| 394 | + | KARDS_RANK_LABEL = gameRootPanel:recursiveGetChildById('kardlabel') |
| 395 | + | KARDS_RANK_NAME = gameRootPanel:recursiveGetChildById('rankKardName') |
| 396 | + | KARDS_BANNER = gameRootPanel:recursiveGetChildById('kardsBanner') |
| 397 | + | KARDS_TIER = gameRootPanel:recursiveGetChildById('tierKardName') |
| 398 | + | COLISEU_MOBILE_PANEL_OFF = gameRootPanel:recursiveGetChildById('mobileColiseuOff') |
| 399 | + | COLISEU_MOBILE_PANEL_ON = gameRootPanel:recursiveGetChildById('mobileColiseuOn') |
| 400 | + | COLISEU_MOBILE_LABEL = gameRootPanel:recursiveGetChildById('coliseuLabel') |
| 401 | + | COLISEU_MOBILE_TXT = gameRootPanel:recursiveGetChildById('coliseutxt') |
| 402 | + | COLISEU_MOBILE_SHOP_PANEL = gameRootPanel:recursiveGetChildById('ColiseuShopPanel') |
| 403 | + | MOBILE_EVENT_0 = gameRootPanel:recursiveGetChildById('mobileEvents_0') |
| 404 | + | MOBILE_EVENT_1 = gameRootPanel:recursiveGetChildById('mobileEvents_1') |
| 405 | + | MOBILE_EVENT_2 = gameRootPanel:recursiveGetChildById('mobileEvents_2') |
| 406 | + | MOBILE_EVENT_3 = gameRootPanel:recursiveGetChildById('mobileEvents_3') |
| 407 | + | MOBILE_EVENT_4 = gameRootPanel:recursiveGetChildById('mobileEvents_4') |
| 408 | + | MOBILE_EVENT_5 = gameRootPanel:recursiveGetChildById('mobileEvents_5') |
| 409 | + | MOBILE_EVENT_6 = gameRootPanel:recursiveGetChildById('mobileEvents_6') |
| 410 | + | MOBILE_EVENT_7 = gameRootPanel:recursiveGetChildById('mobileEvents_7') |
| 411 | + | MOBILE_EVENT_8 = gameRootPanel:recursiveGetChildById('mobileEvents_8') |
| 412 | + | MOBILE_EVENT_9 = gameRootPanel:recursiveGetChildById('mobileEvents_9') |
| 413 | + | MOBILE_EVENT_10 = gameRootPanel:recursiveGetChildById('mobileEvents_10') |
| 414 | + | MOBILE_EVENT_11 = gameRootPanel:recursiveGetChildById('mobileEvents_11') |
| 415 | + | MOBILE_EVENT_12 = gameRootPanel:recursiveGetChildById('mobileEvents_12') |
| 416 | + | MOBILE_PLAY_ON = gameRootPanel:recursiveGetChildById('mobileOnlines') |
| 417 | + | MOBILE_ONLINE_LABEL = gameRootPanel:recursiveGetChildById('onlineLabel') |
| 418 | + | MOBILE_ONLINE_LIST = gameRootPanel:recursiveGetChildById('OnlinePanel') |
| 419 | + | MOBILE_CRIPTOMOEDA = gameRootPanel:recursiveGetChildById('mobileCriptomoedas') |
| 420 | + | CRIPT_BUTTON = gameRootPanel:recursiveGetChildById('Criptomoedas') |
| 421 | + | CRIPT_SALDO = gameRootPanel:recursiveGetChildById('infoCriptValue') |
| 422 | + | SALDO_BLACKMARKET = gameRootPanel:recursiveGetChildById('saldoBlackMarket') |
| 423 | + | SALDO_BMARKET = gameRootPanel:recursiveGetChildById('saldoBMarket') |
| 424 | + | CRIPT_VALOR = gameRootPanel:recursiveGetChildById('infoPriceValue') |
| 425 | + | CRIPT_TXT = gameRootPanel:recursiveGetChildById('criptTxT') |
| 426 | + | CRIPT_PAY = gameRootPanel:recursiveGetChildById('criptPagamento') |
| 427 | + | STEP_REQUEST = gameRootPanel:recursiveGetChildById('stepRequest') |
| 428 | + | PAYMENT_METH_PANEL = gameRootPanel:recursiveGetChildById('showPayMeth') |
| 429 | + | PAYMENT_METH_REAL = gameRootPanel:recursiveGetChildById('btPauMethReal') |
| 430 | + | PAYMENT_METH_VIP = gameRootPanel:recursiveGetChildById('btPauMethVip') |
| 431 | + | REQUEST_PAY_PANEL = gameRootPanel:recursiveGetChildById('showRequestPay') |
| 432 | + | REQUEST_PANEL = gameRootPanel:recursiveGetChildById('CriptPanel') |
| 433 | + | REQUEST_STEP_1 = gameRootPanel:recursiveGetChildById('configPanel_1') |
| 434 | + | PAYMENT_METH_DESC = gameRootPanel:recursiveGetChildById('paymenthMethDesc') |
| 435 | + | PIX_LABEL_NAME = gameRootPanel:recursiveGetChildById('realName') |
| 436 | + | PIX_LABEL_EMAIL = gameRootPanel:recursiveGetChildById('realEmail') |
| 437 | + | PIX_LABEL_BANK = gameRootPanel:recursiveGetChildById('realBank') |
| 438 | + | PIX_EDIT = gameRootPanel:recursiveGetChildById('PixEdit') |
| 439 | + | NEXT_STEP_1 = gameRootPanel:recursiveGetChildById('NextStep_1') |
| 440 | + | LAST_STEP_1 = gameRootPanel:recursiveGetChildById('LastStep_1') |
| 441 | + | REQUEST_STEP_2 = gameRootPanel:recursiveGetChildById('configPanel_2') |
| 442 | + | CRIPT_COUNT = gameRootPanel:recursiveGetChildById('CoinCount') |
| 443 | + | CRIPT_SCROLL = gameRootPanel:recursiveGetChildById('criptScrollBar') |
| 444 | + | CRIPT_FINAL_PRICE = gameRootPanel:recursiveGetChildById('criptFinalPrice') |
| 445 | + | NEXT_STEP_2 = gameRootPanel:recursiveGetChildById('NextStep_2') |
| 446 | + | LAST_STEP_2 = gameRootPanel:recursiveGetChildById('LastStep_2') |
| 447 | + | REQUEST_STEP_3 = gameRootPanel:recursiveGetChildById('configPanel_3') |
| 448 | + | FINAL_VALOR = gameRootPanel:recursiveGetChildById('txtValor') |
| 449 | + | FINAL_NOME = gameRootPanel:recursiveGetChildById('txtNome') |
| 450 | + | FINAL_EMAIL = gameRootPanel:recursiveGetChildById('txtEmail') |
| 451 | + | FINAL_BANK = gameRootPanel:recursiveGetChildById('txtBank') |
| 452 | + | FINAL_COIN = gameRootPanel:recursiveGetChildById('txtCoin') |
| 453 | + | NEXT_STEP_3 = gameRootPanel:recursiveGetChildById('NextStep_3') |
| 454 | + | LAST_STEP_3 = gameRootPanel:recursiveGetChildById('LastStep_3') |
| 455 | + | FINAL_INFO = gameRootPanel:recursiveGetChildById('alertInfo') |
| 456 | + | |
| 457 | + | REQUEST_PAY_PANEL:hide() |
| 458 | + | REQUEST_STEP_1:hide() |
| 459 | + | REQUEST_STEP_2:hide() |
| 460 | + | LOAD_REQUEST = gameRootPanel:recursiveGetChildById('showRequestLoad') |
| 461 | + | LOAD_REQUEST:hide() |
| 462 | + | |
| 463 | + | STATUS = gameRootPanel:recursiveGetChildById('mobileStatus') |
| 464 | + | STATUS_SCROLL = gameRootPanel:recursiveGetChildById('statusPanelListScrollBar') |
| 465 | + | STATUS_LIST = gameRootPanel:recursiveGetChildById('statusPanel') |
| 466 | + | MOBILE_MAESTRIA = gameRootPanel:recursiveGetChildById('panelMaestria') |
| 467 | + | MOBILE_ESPECIALISTA = gameRootPanel:recursiveGetChildById('panelEspecialista') |
| 468 | + | MOBILE_LABEL_DIST = gameRootPanel:recursiveGetChildById('LabelAtrPoints') |
| 469 | + | MOBILE_PASSIVE_1 = gameRootPanel:recursiveGetChildById('passiveMobile_1') |
| 470 | + | MOBILE_TXT_PASSIVE_1 = gameRootPanel:recursiveGetChildById('TextPanelPassiveMobile_1') |
| 471 | + | MOBILE_PASSIVE_2 = gameRootPanel:recursiveGetChildById('passiveMobile_2') |
| 472 | + | MOBILE_TXT_PASSIVE_2 = gameRootPanel:recursiveGetChildById('TextPanelPassiveMobile_2') |
| 473 | + | MOBILE_PASSIVE_3 = gameRootPanel:recursiveGetChildById('passiveMobile_3') |
| 474 | + | MOBILE_TXT_PASSIVE_3 = gameRootPanel:recursiveGetChildById('TextPanelPassiveMobile_3') |
| 475 | + | MOBILE_PASSIVE_4 = gameRootPanel:recursiveGetChildById('passiveMobile_4') |
| 476 | + | MOBILE_TXT_PASSIVE_4 = gameRootPanel:recursiveGetChildById('TextPanelPassiveMobile_4') |
| 477 | + | MOBILE_PASSIVE_5 = gameRootPanel:recursiveGetChildById('passiveMobile_5') |
| 478 | + | MOBILE_TXT_PASSIVE_5 = gameRootPanel:recursiveGetChildById('TextPanelPassiveMobile_5') |
| 479 | + | MOBILE_PASSIVE_6 = gameRootPanel:recursiveGetChildById('passiveMobile_6') |
| 480 | + | MOBILE_TXT_PASSIVE_6 = gameRootPanel:recursiveGetChildById('TextPanelPassiveMobile_6') |
| 481 | + | |
| 482 | + | MOBILE_STATUS_HP = gameRootPanel:recursiveGetChildById('statusHP') |
| 483 | + | MOBILE_STATUS_ATK = gameRootPanel:recursiveGetChildById('statusAtk') |
| 484 | + | MOBILE_STATUS_DEF = gameRootPanel:recursiveGetChildById('statusDef') |
| 485 | + | MOBILE_STATUS_ESQ = gameRootPanel:recursiveGetChildById('statusEsq') |
| 486 | + | MOBILE_STATUS_FIRE = gameRootPanel:recursiveGetChildById('statusFire') |
| 487 | + | MOBILE_STATUS_ICE = gameRootPanel:recursiveGetChildById('statusIce') |
| 488 | + | MOBILE_STATUS_ENERGY = gameRootPanel:recursiveGetChildById('statusEnergy') |
| 489 | + | MOBILE_STATUS_EARTH = gameRootPanel:recursiveGetChildById('statusEarth') |
| 490 | + | MOBILE_STATUS_DEATH = gameRootPanel:recursiveGetChildById('statusDeath') |
| 491 | + | MOBILE_STATUS_METRA = gameRootPanel:recursiveGetChildById('statusMetralhadora') |
| 492 | + | MOBILE_STATUS_RIFLE = gameRootPanel:recursiveGetChildById('statusRifle') |
| 493 | + | MOBILE_STATUS_PISTO = gameRootPanel:recursiveGetChildById('statusPistola') |
| 494 | + | MOBILE_STATUS_ESPIN = gameRootPanel:recursiveGetChildById('statusEspingarda') |
| 495 | + | MOBILE_STATUS_TAX = gameRootPanel:recursiveGetChildById('statusTaxa') |
| 496 | + | MOBILE_STATUS_CRI = gameRootPanel:recursiveGetChildById('statusCritico') |
| 497 | + | MOBILE_STATUS_PEN = gameRootPanel:recursiveGetChildById('statusPenalidade') |
| 498 | + | MOBILE_STATUS_PVP = gameRootPanel:recursiveGetChildById('statusPvp') |
| 499 | + | STATUS:setVisible(false) |
| 500 | + | STATUS_SCROLL:setVisible(false) |
| 501 | + | STATUS_LIST:setVisible(false) |
| 502 | + | |
| 503 | + | QUEST = gameRootPanel:recursiveGetChildById('questMobile') |
| 504 | + | QUEST_ID_DETALHES = gameRootPanel:recursiveGetChildById('questDetalhesMobile') |
| 505 | + | QUEST_SCROLL = gameRootPanel:recursiveGetChildById('questMobileListScrollBar') |
| 506 | + | QUEST_LIST = gameRootPanel:recursiveGetChildById('questMobilePanel') |
| 507 | + | QUEST_LOAD = gameRootPanel:recursiveGetChildById('loadingQuest') |
| 508 | + | QUEST_TITLE = gameRootPanel:recursiveGetChildById('Q_Title') |
| 509 | + | QUEST_RASTREAR = gameRootPanel:recursiveGetChildById('Q_Rastrear') |
| 510 | + | QUEST_DETALHES = gameRootPanel:recursiveGetChildById('Q_Detalhes') |
| 511 | + | QUEST_PROGRESS = gameRootPanel:recursiveGetChildById('Q_Progress') |
| 512 | + | QUEST_REWARDS = gameRootPanel:recursiveGetChildById('Q_Rewards') |
| 513 | + | QUEST:setVisible(false) |
| 514 | + | QUEST_SCROLL:setVisible(false) |
| 515 | + | QUEST_LIST:setVisible(false) |
| 516 | + | QUEST_LOAD:setVisible(false) |
| 517 | + | QUEST_PROGRESS:setVisible(false) |
| 518 | + | QUEST_ID_DETALHES:setVisible(false) |
| 519 | + | |
| 520 | + | BLACKLIST = gameRootPanel:recursiveGetChildById('blacklistMobile') |
| 521 | + | BLACKLIST_SCROLL = gameRootPanel:recursiveGetChildById('blacklistMobileListScrollBar') |
| 522 | + | BLACKLIST_LIST = gameRootPanel:recursiveGetChildById('blacklistMobilePanel') |
| 523 | + | BLACKLIST_RANK_NAME = gameRootPanel:recursiveGetChildById('rankMobileName') |
| 524 | + | BLACKLIST_PROGRESS = gameRootPanel:recursiveGetChildById('TaskProgress') |
| 525 | + | BLACKLIST_NEXT = gameRootPanel:recursiveGetChildById('nextMobileRank') |
| 526 | + | BLACKLIST_BACK = gameRootPanel:recursiveGetChildById('backMobileRank') |
| 527 | + | BLACKLIST_WHITE = gameRootPanel:recursiveGetChildById('whitePoints') |
| 528 | + | BLACKLIST_YELLOW = gameRootPanel:recursiveGetChildById('yelllowPoints') |
| 529 | + | BLACKLIST_BLUE = gameRootPanel:recursiveGetChildById('bluePoints') |
| 530 | + | BLACKLIST:setVisible(false) |
| 531 | + | BLACKLIST_SCROLL:setVisible(false) |
| 532 | + | BLACKLIST_LIST:setVisible(false) |
| 533 | + | |
| 534 | + | OPEN_BACKPACK = gameRootPanel:recursiveGetChildById('openMobileBackpack') |
| 535 | + | EXT_BACKPACK = gameRootPanel:recursiveGetChildById('extendedBag') |
| 536 | + | BACK_SCROLL = gameRootPanel:recursiveGetChildById('bagPanelListScrollBar') |
| 537 | + | BACK_LIST = gameRootPanel:recursiveGetChildById('bagPanel') |
| 538 | + | OPEN_BACKPACK:setVisible(false) |
| 539 | + | BACK_SCROLL:setVisible(false) |
| 540 | + | BACK_LIST:setVisible(false) |
| 541 | + | EXT_BACKPACK:setVisible(false) |
| 542 | + | |
| 543 | + | logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'), |
| 544 | + | '/images/topbuttons/logout', tryLogout, true) |
| 545 | + | |
| 546 | + | |
| 547 | + | gameRightPanels:addChild(g_ui.createWidget('GameSidePanel')) |
| 548 | + | |
| 549 | + | --setupLeftActions() |
| 550 | + | refreshViewMode() |
| 551 | + | |
| 552 | + | bindKeys() |
| 553 | + | |
| 554 | + | connect(gameMapPanel, { onGeometryChange = updateSize, onVisibleDimensionChange = updateSize }) |
| 555 | + | connect(g_game, { onMapChangeAwareRange = updateSize }) |
| 556 | + | |
| 557 | + | if g_game.isOnline() then |
| 558 | + | show() |
| 559 | + | end |
| 560 | + | end |
| 561 | + | function onInterfaceMsg(mode, text) |
| 562 | + | if not g_game.isOnline() then |
| 563 | + | return |
| 564 | + | end |
| 565 | + | if mode == MessageModes.Failure then |
| 566 | + | if string.find(text, "@RankLevel") then |
| 567 | + | local t = string.explode(text, "#") |
| 568 | + | if not g_app.isMobile() then |
| 569 | + | return |
| 570 | + | end |
| 571 | + | if tonumber(t[02]) == 01 then |
| 572 | + | for X = 01, 50 do |
| 573 | + | RANK_ID = gameRootPanel:recursiveGetChildById('RANK_' ..X) |
| 574 | + | if RANK_ID then |
| 575 | + | RANK_ID:destroy() |
| 576 | + | end |
| 577 | + | end |
| 578 | + | end |
| 579 | + | |
| 580 | + | RANK_LINHA = g_ui.createWidget('UIButton', RANK_LIST_MOBILE) |
| 581 | + | RANK_LINHA:setId('RANK_' ..tonumber(t[02])) |
| 582 | + | RANK_LINHA:setMarginTop(03) |
| 583 | + | |
| 584 | + | RANK_POS = g_ui.createWidget('UIButton', RANK_LINHA) |
| 585 | + | RANK_POS:setId('RANK_POS') |
| 586 | + | RANK_POS:setSize({width = 20, height = 18}) |
| 587 | + | RANK_POS:setFont('terminus-10px') |
| 588 | + | RANK_POS:setTextAlign(AlignCenter) |
| 589 | + | if tonumber(t[02]) > 09 then |
| 590 | + | RANK_POS:setText(t[02]) |
| 591 | + | else |
| 592 | + | RANK_POS:setText("0" ..t[02]) |
| 593 | + | end |
| 594 | + | if tonumber(t[02]) > 10 then |
| 595 | + | RANK_POS:setImageSource("/images/custom/Task/Monster_1") |
| 596 | + | else |
| 597 | + | RANK_POS:setImageSource("/images/custom/Task/Monster_2") |
| 598 | + | end |
| 599 | + | |
| 600 | + | RANK_NAME = g_ui.createWidget('UIButton', RANK_LINHA) |
| 601 | + | RANK_NAME:setId('RANK_NAME') |
| 602 | + | RANK_NAME:setSize({width = 90, height = 18}) |
| 603 | + | RANK_NAME:setFont('terminus-10px') |
| 604 | + | RANK_NAME:setTextAlign(AlignCenter) |
| 605 | + | RANK_NAME:setImageSource("/images/custom/Task/Monster_1") |
| 606 | + | RANK_NAME:addAnchor(AnchorLeft, 'RANK_POS', AnchorRight) |
| 607 | + | RANK_NAME:setMarginLeft(03) |
| 608 | + | RANK_NAME:setText(t[03]) |
| 609 | + | |
| 610 | + | RANK_LEVEL = g_ui.createWidget('UIButton', RANK_LINHA) |
| 611 | + | RANK_LEVEL:setSize({width = 40, height = 18}) |
| 612 | + | RANK_LEVEL:setFont('terminus-10px') |
| 613 | + | RANK_LEVEL:setTextAlign(AlignCenter) |
| 614 | + | RANK_LEVEL:setImageSource("/images/custom/Task/Monster_1") |
| 615 | + | RANK_LEVEL:addAnchor(AnchorLeft, 'RANK_NAME', AnchorRight) |
| 616 | + | RANK_LEVEL:setMarginLeft(03) |
| 617 | + | RANK_LEVEL:setText("Lv." ..t[04]) |
| 618 | + | end |
| 619 | + | if string.find(text, "@RankSkills") then |
| 620 | + | local t = string.explode(text, "#") |
| 621 | + | if not g_app.isMobile() then |
| 622 | + | return |
| 623 | + | end |
| 624 | + | if tonumber(t[02]) == 01 then |
| 625 | + | for X = 01, 50 do |
| 626 | + | RANK_ID = gameRootPanel:recursiveGetChildById('RANK_' ..X) |
| 627 | + | if RANK_ID then |
| 628 | + | RANK_ID:destroy() |
| 629 | + | end |
| 630 | + | end |
| 631 | + | end |
| 632 | + | |
| 633 | + | RANK_LINHA = g_ui.createWidget('UIButton', RANK_LIST_MOBILE) |
| 634 | + | RANK_LINHA:setId('RANK_' ..tonumber(t[02])) |
| 635 | + | RANK_LINHA:setMarginTop(03) |
| 636 | + | |
| 637 | + | RANK_POS = g_ui.createWidget('UIButton', RANK_LINHA) |
| 638 | + | RANK_POS:setId('RANK_POS') |
| 639 | + | RANK_POS:setSize({width = 20, height = 18}) |
| 640 | + | RANK_POS:setFont('terminus-10px') |
| 641 | + | RANK_POS:setTextAlign(AlignCenter) |
| 642 | + | RANK_POS:setImageSource("/images/custom/Task/Monster_1") |
| 643 | + | if tonumber(t[02]) > 09 then |
| 644 | + | RANK_POS:setText(t[02]) |
| 645 | + | else |
| 646 | + | RANK_POS:setText("0" ..t[02]) |
| 647 | + | end |
| 648 | + | |
| 649 | + | RANK_NAME = g_ui.createWidget('UIButton', RANK_LINHA) |
| 650 | + | RANK_NAME:setId('RANK_NAME') |
| 651 | + | RANK_NAME:setSize({width = 90, height = 18}) |
| 652 | + | RANK_NAME:setFont('terminus-10px') |
| 653 | + | RANK_NAME:setTextAlign(AlignCenter) |
| 654 | + | RANK_NAME:setImageSource("/images/custom/Task/Monster_1") |
| 655 | + | RANK_NAME:addAnchor(AnchorLeft, 'RANK_POS', AnchorRight) |
| 656 | + | RANK_NAME:setMarginLeft(03) |
| 657 | + | RANK_NAME:setText(t[03]) |
| 658 | + | |
| 659 | + | RANK_LEVEL = g_ui.createWidget('UIButton', RANK_LINHA) |
| 660 | + | RANK_LEVEL:setSize({width = 40, height = 18}) |
| 661 | + | RANK_LEVEL:setFont('terminus-10px') |
| 662 | + | RANK_LEVEL:setTextAlign(AlignCenter) |
| 663 | + | RANK_LEVEL:setImageSource("/images/custom/Task/Monster_1") |
| 664 | + | RANK_LEVEL:addAnchor(AnchorLeft, 'RANK_NAME', AnchorRight) |
| 665 | + | RANK_LEVEL:setMarginLeft(03) |
| 666 | + | if tonumber(t[04]) > 09 then |
| 667 | + | RANK_LEVEL:setText(t[04]) |
| 668 | + | else |
| 669 | + | RANK_LEVEL:setText("0" ..t[04]) |
| 670 | + | end |
| 671 | + | end |
| 672 | + | if string.find(text, "@Fendas") then |
| 673 | + | local t = string.explode(text, ",") |
| 674 | + | if not g_app.isMobile() then |
| 675 | + | return |
| 676 | + | end |
| 677 | + | for X = 02, 51 do |
| 678 | + | FENDAS_ID = gameRootPanel:recursiveGetChildById('FENDAS_' ..X) |
| 679 | + | if FENDAS_ID then |
| 680 | + | FENDAS_ID:destroy() |
| 681 | + | end |
| 682 | + | end |
| 683 | + | local CountSeladas = 0 |
| 684 | + | for F = 02, 51 do |
| 685 | + | FENDAS_SLOT = g_ui.createWidget('UIButton', FENDA_MOBILE_LIST) |
| 686 | + | FENDAS_SLOT:setTooltip(modules.game_database.onGlobalRandom(06, 00, (F - 01))) |
| 687 | + | FENDAS_SLOT:setId('FENDAS_' ..F) |
| 688 | + | FENDAS_IMG = g_ui.createWidget('UIButton', FENDAS_SLOT) |
| 689 | + | FENDAS_IMG:setIcon("/images/custom/Task/Monster_1") |
| 690 | + | FENDAS_IMG:setIconSize({width = 45, height = 15}) |
| 691 | + | FENDAS_IMG:setText(" Lv." ..modules.game_database.onGlobalRandom(06, 01, (F - 01))) |
| 692 | + | FENDAS_IMG:setTooltip(modules.game_database.onGlobalRandom(06, 00, (F - 01))) |
| 693 | + | FENDAS_IMG:setFont('terminus-10px') |
| 694 | + | FENDAS_IMG:setTextAlign(AlignCenter) |
| 695 | + | FENDAS_IMG:addAnchor(AnchorBottom, 'parent', AnchorBottom) |
| 696 | + | FENDAS_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 697 | + | |
| 698 | + | FENDAS_LOG = g_ui.createWidget('UIButton', FENDAS_SLOT) |
| 699 | + | FENDAS_LOG:setTooltip(modules.game_database.onGlobalRandom(06, 00, (F - 01))) |
| 700 | + | FENDAS_LOG:setImageSource("/images/custom/UI/dimensional") |
| 701 | + | FENDAS_LOG:setImageSize({width = 32, height = 32}) |
| 702 | + | FENDAS_LOG:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 703 | + | FENDAS_LOG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 704 | + | FENDAS_LOG:setMarginTop(03) |
| 705 | + | FENDAS_LOG:setMarginLeft(07) |
| 706 | + | FENDAS_SLOT:setMarginTop(05) |
| 707 | + | if tonumber(t[F]) == 01 then |
| 708 | + | CountSeladas = CountSeladas + 01 |
| 709 | + | FENDAS_SLOT:setImageSource("/images/custom/Task/Monster_2") |
| 710 | + | else |
| 711 | + | FENDAS_SLOT:setImageSource("/images/custom/Task/Monster_1") |
| 712 | + | end |
| 713 | + | end |
| 714 | + | end |
| 715 | + | if string.find(text, "@KDLoad") then |
| 716 | + | local t = string.explode(text, " ") |
| 717 | + | if not g_app.isMobile() then |
| 718 | + | return |
| 719 | + | end |
| 720 | + | local EXP = tonumber(t[02]) |
| 721 | + | local ON = tonumber(t[03]) |
| 722 | + | local id = 07 |
| 723 | + | local INDEX = 00 |
| 724 | + | if ON == 01 then |
| 725 | + | KARD_MOBILE_PANEL_ON:show() |
| 726 | + | for X = 01, #KARDS_RANK_EXP do |
| 727 | + | if X == 21 then |
| 728 | + | INDEX = 21 |
| 729 | + | break |
| 730 | + | elseif EXP < KARDS_RANK_EXP[X].EXP then |
| 731 | + | INDEX = X |
| 732 | + | break |
| 733 | + | end |
| 734 | + | end |
| 735 | + | if INDEX > 01 then |
| 736 | + | EXP = EXP - KARDS_RANK_EXP[INDEX - 01].EXP |
| 737 | + | end |
| 738 | + | KARDS_RANK_IMG:setImageSource("/images/custom/UI/kardrank_" ..INDEX) |
| 739 | + | KARDS_BANNER:setImageSource("/images/custom/UI/loot_" ..KARDS_RANK_EXP[INDEX].TIER) |
| 740 | + | KARDS_RANK_NAME:setText(KARDS_RANK_EXP[INDEX].NAME) |
| 741 | + | KARDS_TIER:setText('TIER: ' ..KARDS_RANK_EXP[INDEX].TIER) |
| 742 | + | KARDS_RANK_PROG:setValue(EXP, 0, KARDS_RANK_EXP[INDEX].EXP) |
| 743 | + | KARDS_RANK_LABEL:setText(EXP.. ' / ' ..KARDS_RANK_EXP[INDEX].EXP.. ' | '.. tr('BONUS DE VENDA').. ': ' ..KARDS_RANK_EXP[INDEX].BONUS.. '%') |
| 744 | + | for DEL_NPC = 01, #EVENTOS_TABLE[id].NPC do |
| 745 | + | NPC_ID = gameRootPanel:recursiveGetChildById('_NPC_ID_' ..DEL_NPC) |
| 746 | + | if NPC_ID then |
| 747 | + | NPC_ID:destroy() |
| 748 | + | end |
| 749 | + | end |
| 750 | + | for _DUEL = 01, #EVENTOS_TABLE[id].NPC do |
| 751 | + | local RASTREAR_ID = id |
| 752 | + | NPC = g_ui.createWidget('UIButton', KARD_NPC_MOBILE_PANEL) |
| 753 | + | NPC:setId("_NPC_ID_" .._DUEL) |
| 754 | + | NPC:setImageSource("/images/custom/Task/Monster_1") |
| 755 | + | NPC:setMarginTop(05) |
| 756 | + | |
| 757 | + | NPC_DESC = g_ui.createWidget('UIButton', NPC) |
| 758 | + | NPC_DESC:setSize({width = 20, height = 35}) |
| 759 | + | NPC_DESC:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 760 | + | NPC_DESC:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 761 | + | NPC_DESC:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 762 | + | NPC_DESC:setMarginTop(05) |
| 763 | + | NPC_DESC:setMarginLeft(70) |
| 764 | + | NPC_DESC:setMarginRight(10) |
| 765 | + | NPC_DESC:setTextAlign(AlignLeft) |
| 766 | + | NPC_DESC:setText(EVENTOS_TABLE[id].NPC[_DUEL].NAME.. "\nEXP: " ..EVENTOS_TABLE[id].NPC[_DUEL].EXP) |
| 767 | + | |
| 768 | + | NPC_IMG = g_ui.createWidget('UIButton', NPC) |
| 769 | + | NPC_IMG:setSize({width = EVENTOS_TABLE[id].NPC[_DUEL].SIZE[01], height = EVENTOS_TABLE[id].NPC[_DUEL].SIZE[02]}) |
| 770 | + | NPC_IMG:setImageSource("/images/custom/Monster/Humanos/" ..EVENTOS_TABLE[id].NPC[_DUEL].NAME) |
| 771 | + | NPC_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 772 | + | NPC_IMG:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 773 | + | NPC_IMG:setMarginLeft(EVENTOS_TABLE[id].NPC[_DUEL].SIZE[04]) |
| 774 | + | NPC_IMG:setMarginTop(EVENTOS_TABLE[id].NPC[_DUEL].SIZE[03]) |
| 775 | + | |
| 776 | + | NPC_RAST = g_ui.createWidget('UIButton', NPC) |
| 777 | + | NPC_RAST:setSize({width = 20, height = 20}) |
| 778 | + | NPC_RAST:setImageSource("/images/custom/UI/button") |
| 779 | + | NPC_RAST:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 780 | + | NPC_RAST:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 781 | + | NPC_RAST:addAnchor(AnchorBottom, 'parent', AnchorBottom) |
| 782 | + | NPC_RAST:setMarginLeft(70) |
| 783 | + | NPC_RAST:setMarginRight(10) |
| 784 | + | NPC_RAST:setMarginBottom(05) |
| 785 | + | NPC_RAST:setOpacity(0.8) |
| 786 | + | NPC_RAST:setText(tr("RASTREAR")) |
| 787 | + | NPC_RAST.onClick = function() |
| 788 | + | local DESC = tr("NPC de Duelo").. "\n[ " ..EVENTOS_TABLE[id].NPC[_DUEL].NAME.. " ]" |
| 789 | + | local POS = EVENTOS_TABLE[id].NPC[_DUEL].RASTREAR[01] |
| 790 | + | modules.game_minimap.onRastrearQuest(POS, DESC) |
| 791 | + | modules.game_textmessage.displayGameMessage(tr('A localizacao de').. ' ' ..EVENTOS_TABLE[id].NPC[_DUEL].NAME.. ' '.. tr('foi agora\nmarcado em seu mapa.')) |
| 792 | + | end |
| 793 | + | NPC_RAST.onHoverChange = function(widget, hoverState) |
| 794 | + | if hoverState then |
| 795 | + | widget:setOpacity(1.0) |
| 796 | + | else |
| 797 | + | widget:setOpacity(0.6) |
| 798 | + | end |
| 799 | + | end |
| 800 | + | end |
| 801 | + | else |
| 802 | + | KARD_MOBILE_PANEL_OFF:show() |
| 803 | + | return |
| 804 | + | end |
| 805 | + | end |
| 806 | + | if string.find(text, "@ColiseuLoad") then |
| 807 | + | local t = string.explode(text, " ") |
| 808 | + | if not g_app.isMobile() then |
| 809 | + | return |
| 810 | + | end |
| 811 | + | local KEYS = tonumber(t[02]) |
| 812 | + | local HARD = tonumber(t[03]) |
| 813 | + | local QUEST = tonumber(t[04]) |
| 814 | + | local ACT = tonumber(t[05]) |
| 815 | + | if ACT == 01 then |
| 816 | + | local HardTxt = 'Facil' |
| 817 | + | if HARD == 02 then |
| 818 | + | HardTxt = 'Medio' |
| 819 | + | elseif HARD == 03 then |
| 820 | + | HardTxt = 'Dificil' |
| 821 | + | elseif HARD >= 04 then |
| 822 | + | HardTxt = 'Expert' |
| 823 | + | end |
| 824 | + | |
| 825 | + | COLISEU_MOBILE_LABEL:setText(tr("Chaves").. ": " ..KEYS.. " | " ..tr("Dificuldade").. ": " ..tr(HardTxt)) |
| 826 | + | return |
| 827 | + | end |
| 828 | + | if QUEST == 01 then |
| 829 | + | onMobileColiseuShop(KEYS, HARD, ACT) |
| 830 | + | scheduleEvent(function() |
| 831 | + | COLISEU_MOBILE_PANEL_ON:show() |
| 832 | + | end, 500) |
| 833 | + | else |
| 834 | + | scheduleEvent(function() |
| 835 | + | COLISEU_MOBILE_PANEL_OFF:show() |
| 836 | + | end, 500) |
| 837 | + | end |
| 838 | + | end |
| 839 | + | if string.find(text, "@EventosLoad") then |
| 840 | + | local t = string.explode(text, " ") |
| 841 | + | local IDD = tonumber(t[02]) |
| 842 | + | if not g_app.isMobile() then |
| 843 | + | return |
| 844 | + | end |
| 845 | + | if IDD == 00 then |
| 846 | + | EVENTOS_TABLE[00].EVENT_UID_1 = tonumber(t[03]) |
| 847 | + | EVENTOS_TABLE[00].EVENT_UID_2 = tonumber(t[04]) |
| 848 | + | end |
| 849 | + | if IDD == 01 then |
| 850 | + | EVENTOS_TABLE[00].EVENT_UID_1 = tonumber(t[03]) |
| 851 | + | EVENTOS_TABLE[00].EVENT_UID_2 = tonumber(t[04]) |
| 852 | + | EVENTOS_TABLE[00].EVENT_UID_3 = tonumber(t[05]) |
| 853 | + | EVENTOS_TABLE[00].EVENT_UID_4 = tonumber(t[06]) |
| 854 | + | EVENTOS_TABLE[00].EVENT_UID_5 = tonumber(t[07]) |
| 855 | + | EVENTOS_TABLE[00].EVENT_UID_6 = tonumber(t[08]) |
| 856 | + | EVENTOS_TABLE[00].EVENT_UID_7 = tonumber(t[09]) |
| 857 | + | EVENTOS_TABLE[00].EVENT_UID_8 = tonumber(t[10]) |
| 858 | + | EVENTOS_TABLE[00].EVENT_UID_9 = tonumber(t[11]) |
| 859 | + | |
| 860 | + | EVENTOS_TABLE[IDD].GOLD_TOKEN = tonumber(t[12]) |
| 861 | + | end |
| 862 | + | if IDD == 02 then |
| 863 | + | EVENTOS_TABLE[00].EVENT_UID_1 = tonumber(t[03]) |
| 864 | + | end |
| 865 | + | if IDD == 03 then |
| 866 | + | EVENTOS_TABLE[00].EVENT_UID_1 = tonumber(t[03]) |
| 867 | + | end |
| 868 | + | if IDD == 05 then |
| 869 | + | EVENTOS_TABLE[00].EVENT_UID_1 = tonumber(t[12]) |
| 870 | + | EVENTOS_TABLE[00].EVENT_UID_2 = tonumber(t[13]) |
| 871 | + | EVENTOS_TABLE[00].EVENT_UID_3 = tonumber(t[14]) |
| 872 | + | EVENTOS_TABLE[00].EVENT_UID_4 = tonumber(t[03]) |
| 873 | + | EVENTOS_TABLE[00].EVENT_UID_5 = tonumber(t[04]) |
| 874 | + | EVENTOS_TABLE[00].EVENT_UID_6 = tonumber(t[05]) |
| 875 | + | EVENTOS_TABLE[00].EVENT_UID_7 = tonumber(t[06]) |
| 876 | + | EVENTOS_TABLE[00].EVENT_UID_8 = tonumber(t[07]) |
| 877 | + | EVENTOS_TABLE[00].EVENT_UID_9 = tonumber(t[08]) |
| 878 | + | EVENTOS_TABLE[00].EVENT_UID_10 = tonumber(t[09]) |
| 879 | + | EVENTOS_TABLE[00].EVENT_UID_11 = tonumber(t[10]) |
| 880 | + | EVENTOS_TABLE[00].EVENT_UID_12 = tonumber(t[11]) |
| 881 | + | end |
| 882 | + | if IDD == 06 then |
| 883 | + | EVENTOS_TABLE[06].POINTS = tonumber(t[03]) |
| 884 | + | end |
| 885 | + | if IDD == 07 then |
| 886 | + | EVENTOS_TABLE[07].EXP_BONUS = tonumber(t[03]) |
| 887 | + | end |
| 888 | + | if IDD == 10 then |
| 889 | + | EVENTOS_TABLE[10].KEYS_EVENT = tonumber(t[03]) |
| 890 | + | end |
| 891 | + | if IDD == 11 then |
| 892 | + | EVENTOS_TABLE[11].PILLAR_STEP = tonumber(t[03]) |
| 893 | + | end |
| 894 | + | if IDD == 12 then |
| 895 | + | EVENTOS_TABLE[00].EVENT_UID_1 = tonumber(t[03]) |
| 896 | + | EVENTOS_TABLE[00].EVENT_UID_2 = tonumber(t[04]) |
| 897 | + | EVENTOS_TABLE[00].EVENT_UID_3 = tonumber(t[05]) |
| 898 | + | EVENTOS_TABLE[00].EVENT_UID_4 = tonumber(t[06]) |
| 899 | + | EVENTOS_TABLE[00].EVENT_UID_5 = tonumber(t[07]) |
| 900 | + | end |
| 901 | + | |
| 902 | + | onMobileLoadEvents(IDD) |
| 903 | + | end |
| 904 | + | if string.find(text, "@PlayersOnline") then |
| 905 | + | local t = string.explode(text, "#") |
| 906 | + | if not g_app.isMobile() then |
| 907 | + | return |
| 908 | + | end |
| 909 | + | if tonumber(t[02]) == 01 then |
| 910 | + | for X = 01, 1000 do |
| 911 | + | ONLINE_ID = gameRootPanel:recursiveGetChildById('ONLINE_' ..X) |
| 912 | + | if ONLINE_ID then |
| 913 | + | ONLINE_ID:destroy() |
| 914 | + | else |
| 915 | + | break |
| 916 | + | end |
| 917 | + | end |
| 918 | + | end |
| 919 | + | |
| 920 | + | local localPlayer = g_game.getLocalPlayer() |
| 921 | + | ONLINE_LIN = g_ui.createWidget('UIButton', MOBILE_ONLINE_LIST) |
| 922 | + | ONLINE_LIN:setId('ONLINE_' ..tonumber(t[02])) |
| 923 | + | ONLINE_LIN:setMarginTop(03) |
| 924 | + | |
| 925 | + | ONLINE_NAME = g_ui.createWidget('UIButton', ONLINE_LIN) |
| 926 | + | ONLINE_NAME:setId('ONLINE_NAME') |
| 927 | + | ONLINE_NAME:setSize({width = 100, height = 20}) |
| 928 | + | ONLINE_NAME:setFont('small-9px') |
| 929 | + | ONLINE_NAME:setTextAlign(AlignCenter) |
| 930 | + | ONLINE_NAME:setImageSource("/images/custom/Task/Monster_1") |
| 931 | + | ONLINE_NAME:setText(t[03]) |
| 932 | + | |
| 933 | + | ONLINE_LEVEL = g_ui.createWidget('UIButton', ONLINE_LIN) |
| 934 | + | ONLINE_LEVEL:setId('ONLINE_LEVEL') |
| 935 | + | ONLINE_LEVEL:setSize({width = 30, height = 20}) |
| 936 | + | ONLINE_LEVEL:setFont('small-9px') |
| 937 | + | ONLINE_LEVEL:setTextAlign(AlignCenter) |
| 938 | + | ONLINE_LEVEL:setImageSource("/images/custom/Task/Monster_2") |
| 939 | + | ONLINE_LEVEL:addAnchor(AnchorLeft, 'ONLINE_NAME', AnchorRight) |
| 940 | + | ONLINE_LEVEL:setMarginLeft(03) |
| 941 | + | ONLINE_LEVEL:setText("Lv." ..t[04]) |
| 942 | + | |
| 943 | + | ONLINE_MENU = g_ui.createWidget('UIButton', ONLINE_LIN) |
| 944 | + | ONLINE_MENU:setSize({width = 30, height = 20}) |
| 945 | + | ONLINE_MENU:setText("...") |
| 946 | + | ONLINE_MENU:addAnchor(AnchorLeft, 'ONLINE_LEVEL', AnchorRight) |
| 947 | + | ONLINE_MENU:setMarginLeft(03) |
| 948 | + | if localPlayer:getName() == t[03] then |
| 949 | + | ONLINE_MENU:setImageSource("/images/custom/Task/Monster_1") |
| 950 | + | ONLINE_MENU.onClick = function() end |
| 951 | + | else |
| 952 | + | ONLINE_MENU:setImageSource("/images/custom/Task/Monster_3") |
| 953 | + | ONLINE_MENU.onClick = function() |
| 954 | + | local playerName = t[03] |
| 955 | + | local menu = g_ui.createWidget('PopupMenu') |
| 956 | + | menu:addOption("Ver Equipamentos", function() g_game.talk(g_game.talk("!spy " ..playerName)) end) |
| 957 | + | menu:addOption("Enviar Mensagem", function() g_game.openPrivateChannel(playerName) end) |
| 958 | + | menu:addOption("Add. Vip List", function() g_game.addVip(playerName) end) |
| 959 | + | menu:addOption("Copiar Nome", function() |
| 960 | + | g_window.setClipboardText(playerName) |
| 961 | + | modules.game_adm.onSetAdmName(playerName) |
| 962 | + | end) |
| 963 | + | menu:display() |
| 964 | + | end |
| 965 | + | end |
| 966 | + | |
| 967 | + | MOBILE_ONLINE_LABEL:setText(tr("Jogadores Online").. ": " ..t[02]) |
| 968 | + | end |
| 969 | + | if string.find(text, "@CriptLoad") then |
| 970 | + | local t = string.explode(text, "-") |
| 971 | + | local localPlayer = g_game.getLocalPlayer() |
| 972 | + | if not g_app.isMobile() then |
| 973 | + | return |
| 974 | + | end |
| 975 | + | if tonumber(t[02]) == 01 then |
| 976 | + | if tonumber(t[03]) == 01 then |
| 977 | + | for _ERASE = 01, #HISTORY_CRIPTO do |
| 978 | + | HISTORY_CRIPTO[_ERASE].ID = 0000 |
| 979 | + | HISTORY_CRIPTO[_ERASE].ACCOUNT_ID = 0000 |
| 980 | + | HISTORY_CRIPTO[_ERASE].NAME = "" |
| 981 | + | HISTORY_CRIPTO[_ERASE].EMAIL = "" |
| 982 | + | HISTORY_CRIPTO[_ERASE].BANK = "" |
| 983 | + | HISTORY_CRIPTO[_ERASE].CRIPTOMOEDA = 0000 |
| 984 | + | HISTORY_CRIPTO[_ERASE].PRICE = "" |
| 985 | + | HISTORY_CRIPTO[_ERASE].VALOR = "" |
| 986 | + | HISTORY_CRIPTO[_ERASE].STATUS = 0000 |
| 987 | + | HISTORY_CRIPTO[_ERASE].OBS = "" |
| 988 | + | end |
| 989 | + | end |
| 990 | + | for _ADD = 01, #HISTORY_CRIPTO do |
| 991 | + | if HISTORY_CRIPTO[_ADD].ID == 0000 then |
| 992 | + | HISTORY_CRIPTO[_ADD].ID = tonumber(t[04]) |
| 993 | + | HISTORY_CRIPTO[_ADD].ACCOUNT_ID = tonumber(t[05]) |
| 994 | + | HISTORY_CRIPTO[_ADD].NAME = t[06] |
| 995 | + | HISTORY_CRIPTO[_ADD].EMAIL = t[07] |
| 996 | + | HISTORY_CRIPTO[_ADD].BANK = t[08] |
| 997 | + | HISTORY_CRIPTO[_ADD].CRIPTOMOEDA = tonumber(t[09]) |
| 998 | + | HISTORY_CRIPTO[_ADD].PRICE = t[10] |
| 999 | + | HISTORY_CRIPTO[_ADD].VALOR = t[11] |
| 1000 | + | HISTORY_CRIPTO[_ADD].STATUS = tonumber(t[12]) |
| 1001 | + | HISTORY_CRIPTO[_ADD].OBS = t[13] |
| 1002 | + | break |
| 1003 | + | end |
| 1004 | + | end |
| 1005 | + | else |
| 1006 | + | for _DEL = 01, #HISTORY_CRIPTO do |
| 1007 | + | DEL_CRIPT = gameRootPanel:recursiveGetChildById('HistCript_' .._DEL) |
| 1008 | + | if DEL_CRIPT then |
| 1009 | + | DEL_CRIPT:destroy() |
| 1010 | + | else |
| 1011 | + | break |
| 1012 | + | end |
| 1013 | + | end |
| 1014 | + | for _LOAD = 01, #HISTORY_CRIPTO do |
| 1015 | + | if HISTORY_CRIPTO[_LOAD].ID > 0000 then |
| 1016 | + | HIST_REQUEST = g_ui.createWidget('UIButton', REQUEST_PANEL) |
| 1017 | + | HIST_REQUEST:setId('HistCript_' .._LOAD) |
| 1018 | + | HIST_REQUEST:setImageSource("/images/custom/Task/Monster_1") |
| 1019 | + | HIST_REQUEST:setOpacity('0.8') |
| 1020 | + | HIST_REQUEST:setMarginTop(05) |
| 1021 | + | HIST_REQUEST.onHoverChange = function(widget, hoverState) |
| 1022 | + | if hoverState then |
| 1023 | + | widget:setOpacity('1.0') |
| 1024 | + | else |
| 1025 | + | widget:setOpacity('0.8') |
| 1026 | + | end |
| 1027 | + | end |
| 1028 | + | |
| 1029 | + | REQUEST_IMG_STATUS = g_ui.createWidget('UIButton', HIST_REQUEST) |
| 1030 | + | REQUEST_IMG_STATUS:setId('imgStatus_' .._LOAD) |
| 1031 | + | REQUEST_IMG_STATUS:setSize({width = 44, height = 44}) |
| 1032 | + | REQUEST_IMG_STATUS:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 1033 | + | REQUEST_IMG_STATUS:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1034 | + | REQUEST_IMG_STATUS:setMarginTop(03) |
| 1035 | + | REQUEST_IMG_STATUS:setMarginLeft(10) |
| 1036 | + | REQUEST_IMG_STATUS:setPhantom(true) |
| 1037 | + | |
| 1038 | + | REQUEST_TXT_STATUS = g_ui.createWidget('UIButton', HIST_REQUEST) |
| 1039 | + | REQUEST_TXT_STATUS:setId('txtStatus_' .._LOAD) |
| 1040 | + | REQUEST_TXT_STATUS:setFont('terminus-10px') |
| 1041 | + | REQUEST_TXT_STATUS:setTextAlign(AlignLeft) |
| 1042 | + | REQUEST_TXT_STATUS:setSize({width = 150, height = 15}) |
| 1043 | + | REQUEST_TXT_STATUS:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 1044 | + | REQUEST_TXT_STATUS:addAnchor(AnchorLeft, 'imgStatus_' .._LOAD, AnchorRight) |
| 1045 | + | REQUEST_TXT_STATUS:setMarginTop(05) |
| 1046 | + | REQUEST_TXT_STATUS:setMarginLeft(20) |
| 1047 | + | REQUEST_TXT_STATUS:setPhantom(true) |
| 1048 | + | |
| 1049 | + | REQUEST_ID = g_ui.createWidget('UIButton', HIST_REQUEST) |
| 1050 | + | REQUEST_ID:setId('txtIDStatus_' .._LOAD) |
| 1051 | + | REQUEST_ID:setFont('terminus-10px') |
| 1052 | + | REQUEST_ID:setText(tr("Pedido ID").. ": " ..HISTORY_CRIPTO[_LOAD].ID) |
| 1053 | + | REQUEST_ID:setTextAlign(AlignLeft) |
| 1054 | + | REQUEST_ID:setSize({width = 150, height = 15}) |
| 1055 | + | REQUEST_ID:addAnchor(AnchorTop, 'txtStatus_' .._LOAD, AnchorBottom) |
| 1056 | + | REQUEST_ID:addAnchor(AnchorLeft, 'imgStatus_' .._LOAD, AnchorRight) |
| 1057 | + | REQUEST_ID:setMarginLeft(20) |
| 1058 | + | REQUEST_ID:setPhantom(true) |
| 1059 | + | |
| 1060 | + | REQUEST_VALOR = g_ui.createWidget('UIButton', HIST_REQUEST) |
| 1061 | + | REQUEST_VALOR:setId('txtValorStatus_' .._LOAD) |
| 1062 | + | REQUEST_VALOR:setFont('terminus-10px') |
| 1063 | + | REQUEST_VALOR:setText(tr("Valor: R$").. " " ..HISTORY_CRIPTO[_LOAD].VALOR) |
| 1064 | + | REQUEST_VALOR:setTextAlign(AlignLeft) |
| 1065 | + | REQUEST_VALOR:setSize({width = 150, height = 15}) |
| 1066 | + | REQUEST_VALOR:addAnchor(AnchorTop, 'txtIDStatus_' .._LOAD, AnchorBottom) |
| 1067 | + | REQUEST_VALOR:addAnchor(AnchorLeft, 'imgStatus_' .._LOAD, AnchorRight) |
| 1068 | + | REQUEST_VALOR:setMarginLeft(20) |
| 1069 | + | REQUEST_VALOR:setPhantom(true) |
| 1070 | + | |
| 1071 | + | if HISTORY_CRIPTO[_LOAD].STATUS == 01 then -- EM ANALISE |
| 1072 | + | REQUEST_IMG_STATUS:setImageSource("/images/custom/UI/loading") |
| 1073 | + | REQUEST_TXT_STATUS:setText(tr("Em Analise...")) |
| 1074 | + | REQUEST_TXT_STATUS:setColor("yellow") |
| 1075 | + | elseif HISTORY_CRIPTO[_LOAD].STATUS == 02 then -- ALERTA (DIVERGENCIA) |
| 1076 | + | REQUEST_IMG_STATUS:setImageSource("/images/custom/UI/alert") |
| 1077 | + | REQUEST_TXT_STATUS:setText(tr("Erro Encontrado")) |
| 1078 | + | REQUEST_TXT_STATUS:setColor("black") |
| 1079 | + | HIST_REQUEST:setImageSource("/images/custom/Task/Monster_2") |
| 1080 | + | elseif HISTORY_CRIPTO[_LOAD].STATUS == 03 then -- CANCELADO |
| 1081 | + | REQUEST_IMG_STATUS:setImageSource("/images/custom/UI/block") |
| 1082 | + | REQUEST_TXT_STATUS:setText(tr("Pagamento Cancelado")) |
| 1083 | + | REQUEST_TXT_STATUS:setColor("white") |
| 1084 | + | HIST_REQUEST:setImageSource("/images/custom/Task/Monster_5") |
| 1085 | + | elseif HISTORY_CRIPTO[_LOAD].STATUS == 04 then -- APROVADO (PAGO) |
| 1086 | + | REQUEST_IMG_STATUS:setImageSource("/images/custom/UI/confirm") |
| 1087 | + | REQUEST_TXT_STATUS:setText(tr("Pagamento Realizado")) |
| 1088 | + | REQUEST_TXT_STATUS:setColor("white") |
| 1089 | + | HIST_REQUEST:setImageSource("/images/custom/Task/Monster_4") |
| 1090 | + | HIST_REQUEST.onClick = function() end |
| 1091 | + | end |
| 1092 | + | |
| 1093 | + | local INDEX_SAVE = _LOAD |
| 1094 | + | HIST_REQUEST.onClick = function() onRequestPay(03, INDEX_SAVE) end |
| 1095 | + | end |
| 1096 | + | end |
| 1097 | + | |
| 1098 | + | CRIPT_SALDO = gameRootPanel:recursiveGetChildById('infoCriptValue') |
| 1099 | + | SALDO_BLACKMARKET = gameRootPanel:recursiveGetChildById('saldoBlackMarket') |
| 1100 | + | |
| 1101 | + | CriptoMoeda = tonumber(t[03]) |
| 1102 | + | SaldoBlacklist = tonumber(t[04]) |
| 1103 | + | HIGH_PLAYER_ACCOUNT = t[05] |
| 1104 | + | if CriptoMoeda < 00 then CriptoMoeda = 0 end |
| 1105 | + | CRIPT_SALDO:setText(CriptoMoeda) |
| 1106 | + | SALDO_BLACKMARKET:setText(SaldoBlacklist) |
| 1107 | + | SALDO_BMARKET:setText(SaldoBlacklist) |
| 1108 | + | if localPlayer:getLevel() < 100 then |
| 1109 | + | CriptoPrice = 0.05 |
| 1110 | + | elseif localPlayer:getLevel() < 200 then |
| 1111 | + | CriptoPrice = 0.06 |
| 1112 | + | elseif localPlayer:getLevel() < 300 then |
| 1113 | + | CriptoPrice = 0.07 |
| 1114 | + | elseif localPlayer:getLevel() < 400 then |
| 1115 | + | CriptoPrice = 0.08 |
| 1116 | + | elseif localPlayer:getLevel() < 500 then |
| 1117 | + | CriptoPrice = 0.09 |
| 1118 | + | elseif localPlayer:getLevel() < 600 then |
| 1119 | + | CriptoPrice = 0.10 |
| 1120 | + | elseif localPlayer:getLevel() < 700 then |
| 1121 | + | CriptoPrice = 0.11 |
| 1122 | + | elseif localPlayer:getLevel() < 800 then |
| 1123 | + | CriptoPrice = 0.12 |
| 1124 | + | elseif localPlayer:getLevel() < 900 then |
| 1125 | + | CriptoPrice = 0.13 |
| 1126 | + | elseif localPlayer:getLevel() < 999 then |
| 1127 | + | CriptoPrice = 0.14 |
| 1128 | + | elseif localPlayer:getLevel() > 999 then |
| 1129 | + | CriptoPrice = 0.15 |
| 1130 | + | else |
| 1131 | + | CriptoPrice = 0 |
| 1132 | + | end |
| 1133 | + | |
| 1134 | + | CRIPT_TXT:setText(tr("Valor da criptomoeda baseado\nem seu nivel: R$").. " " ..CriptoPrice.. ".") |
| 1135 | + | DinRealCalculo = CriptoMoeda * CriptoPrice |
| 1136 | + | CRIPT_VALOR:setText("R$ " ..mask_number(DinRealCalculo)) |
| 1137 | + | MOBILE_CRIPTOMOEDA:show() |
| 1138 | + | LOAD_REQUEST:hide() |
| 1139 | + | end |
| 1140 | + | end |
| 1141 | + | if string.find(text, "@LoadPix") then |
| 1142 | + | local t = string.explode(text, "-") |
| 1143 | + | if not g_app.isMobile() then |
| 1144 | + | return |
| 1145 | + | end |
| 1146 | + | PIX_REAL_NAME = t[02] |
| 1147 | + | PIX_EMAIL = t[03] |
| 1148 | + | PIX_BANK = t[04] |
| 1149 | + | |
| 1150 | + | PIX_LABEL_NAME:setText(PIX_REAL_NAME) |
| 1151 | + | PIX_LABEL_EMAIL:setText(PIX_EMAIL) |
| 1152 | + | PIX_LABEL_BANK:setText(PIX_BANK) |
| 1153 | + | LOAD_REQUEST:hide() |
| 1154 | + | REQUEST_STEP_1:show() |
| 1155 | + | REQUEST_PAY_PANEL:show() |
| 1156 | + | end |
| 1157 | + | |
| 1158 | + | if string.find(text, "@ClientSystem") then |
| 1159 | + | local t = string.explode(text, " ") |
| 1160 | + | if tonumber(t[02]) == 00 then -- REINICIAR O CLIENTE |
| 1161 | + | g_app.restart() |
| 1162 | + | end |
| 1163 | + | if tonumber(t[02]) == 01 then -- FECHAR O CLIENTE |
| 1164 | + | g_app.exit() |
| 1165 | + | end |
| 1166 | + | if tonumber(t[02]) == 02 then -- CHAMAR O AUTO UPDATE |
| 1167 | + | g_modules.ensureModuleLoaded("updater") |
| 1168 | + | return Updater.init(loadModules) |
| 1169 | + | end |
| 1170 | + | if tonumber(t[02]) == 03 then -- CHECAR CLIENTE OFICIAL |
| 1171 | + | --scheduleEvent(function() |
| 1172 | + | g_game.talk(g_game.talk("!inventario 50")) |
| 1173 | + | --end, 500) |
| 1174 | + | return |
| 1175 | + | end |
| 1176 | + | end |
| 1177 | + | if string.find(text, "@BotCheck") then |
| 1178 | + | local t = string.explode(text, "-") |
| 1179 | + | if tonumber(t[02]) == 01 then |
| 1180 | + | BotMonitoreOn = true |
| 1181 | + | GM_NAME = t[03] |
| 1182 | + | onBotCheck() |
| 1183 | + | modules.game_walking.onRestartMonitore(01) |
| 1184 | + | elseif tonumber(t[02]) == 03 then |
| 1185 | + | local yesChoose = function() |
| 1186 | + | modules.game_adm.onMonitoramento(16, GM_NAME) |
| 1187 | + | onBotWindow:destroy() |
| 1188 | + | onBotWindow = nil |
| 1189 | + | end |
| 1190 | + | if onBotWindow ~= nil then |
| 1191 | + | onBotWindow:destroy() |
| 1192 | + | onBotWindow = nil |
| 1193 | + | end |
| 1194 | + | |
| 1195 | + | onBotWindow = displayGeneralBox(tr('Programa Ilegal Detectado'), tr("Um programa ilegal foi identificado em seu cliente.\nDesative todos e confirme sua presenca."), |
| 1196 | + | { { text=tr('Confirmar'), callback=yesChoose }, |
| 1197 | + | anchor=AnchorHorizontalCenter }, yesChoose) |
| 1198 | + | else |
| 1199 | + | BotMonitoreOn = false |
| 1200 | + | end |
| 1201 | + | end |
| 1202 | + | end |
| 1203 | + | end |
| 1204 | + | |
| 1205 | + | function onMonitoreBotCheck() |
| 1206 | + | return BotMonitoreOn |
| 1207 | + | end |
| 1208 | + | function setMonitoreBotCheck(value) |
| 1209 | + | BotMonitoreOn = false |
| 1210 | + | modules.game_walking.onRestartMonitore(00) |
| 1211 | + | return |
| 1212 | + | end |
| 1213 | + | function onBotCheck() |
| 1214 | + | if BotMonitoreOn == false then return end |
| 1215 | + | -- CHECANDO BOT V8 |
| 1216 | + | local BotV8 = 00 |
| 1217 | + | local settings = g_settings.getNode('bot') or {} |
| 1218 | + | local index = g_game.getCharacterName() .. "_" .. g_game.getClientVersion() |
| 1219 | + | if settings[index] ~= nil then |
| 1220 | + | if settings[index].enabled == true then |
| 1221 | + | BotV8 = 01 |
| 1222 | + | else |
| 1223 | + | settings[index] = { |
| 1224 | + | enabled=false, |
| 1225 | + | config="" |
| 1226 | + | } |
| 1227 | + | end |
| 1228 | + | end |
| 1229 | + | |
| 1230 | + | -- CHECANDO VERSAO PC | MOBILE |
| 1231 | + | local ClientType = 00 |
| 1232 | + | if g_app.isMobile() then |
| 1233 | + | ClientType = 01 |
| 1234 | + | end |
| 1235 | + | |
| 1236 | + | -- CHECANDO AUTO TARGET |
| 1237 | + | local getFollow = 00 |
| 1238 | + | local localPlayer = g_game.getLocalPlayer() |
| 1239 | + | g_game.getProtocolGame():sendExtendedOpcode(BotMonitoramento, BotV8.. "," ..ClientType.. "," ..getFollow.. "," ..localPlayer:getName().. "," ..localPlayer:getPosition().x.. "," ..localPlayer:getPosition().y.. "," ..localPlayer:getPosition().z.. "," ..GM_NAME) |
| 1240 | + | end |
| 1241 | + | function onEditPix(name, pix, banco) |
| 1242 | + | PIX_LABEL_NAME:setText(name) |
| 1243 | + | PIX_LABEL_EMAIL:setText(pix) |
| 1244 | + | PIX_LABEL_BANK:setText(banco) |
| 1245 | + | |
| 1246 | + | PIX_REAL_NAME = name |
| 1247 | + | PIX_EMAIL = pix |
| 1248 | + | PIX_BANK = banco |
| 1249 | + | end |
| 1250 | + | function onMobileColiseuShop(keys, hard) |
| 1251 | + | local ATR_SHOP = { |
| 1252 | + | [01] = {11001, 11006, 11007, 11008, 11015, 11020}; |
| 1253 | + | [02] = {11001, 11006, 11007, 11008, 11015, 11020, 11004, 11005, 11011, 11014, 11032, 11040}; |
| 1254 | + | [03] = {11001, 11006, 11007, 11008, 11015, 11020, 11004, 11005, 11011, 11014, 11032, 11040, 11003, 11010, 11012, 11016, 11026}; |
| 1255 | + | [04] = {11001, 11006, 11007, 11008, 11015, 11020, 11004, 11005, 11011, 11014, 11032, 11040, 11003, 11010, 11012, 11016, 11026, 11002, 11013, 11017, 11018, 11019, 11021, 11022, 11023, 11024}; |
| 1256 | + | [05] = {11001, 11006, 11007, 11008, 11015, 11020, 11004, 11005, 11011, 11014, 11032, 11040, 11003, 11010, 11012, 11016, 11026, 11002, 11013, 11017, 11018, 11019, 11021, 11022, 11023, 11024}; |
| 1257 | + | }; |
| 1258 | + | |
| 1259 | + | local HardTxt = 'Facil' |
| 1260 | + | if hard == 02 then |
| 1261 | + | HardTxt = 'Medio' |
| 1262 | + | elseif hard == 03 then |
| 1263 | + | HardTxt = 'Dificil' |
| 1264 | + | elseif hard >= 04 then |
| 1265 | + | HardTxt = 'Expert' |
| 1266 | + | end |
| 1267 | + | |
| 1268 | + | COLISEU_MOBILE_LABEL:setText(tr("Chaves").. ": " ..keys.. "\n".. tr("Dificuldade").. ": " ..tr(HardTxt)) |
| 1269 | + | for _ATR_DEL = 01, 50 do |
| 1270 | + | ATR_IDD = gameRootPanel:recursiveGetChildById('ATR_' .._ATR_DEL) |
| 1271 | + | if ATR_IDD then |
| 1272 | + | ATR_IDD:destroy() |
| 1273 | + | else |
| 1274 | + | break |
| 1275 | + | end |
| 1276 | + | end |
| 1277 | + | for X = 01, #ATR_SHOP[hard] do |
| 1278 | + | local BUY_INDEX = X |
| 1279 | + | local ATR_ITEMID = ATR_SHOP[hard][X] |
| 1280 | + | |
| 1281 | + | ATR_OFFERT = g_ui.createWidget('UIButton', COLISEU_MOBILE_SHOP_PANEL) |
| 1282 | + | ATR_OFFERT:setId('ATR_' ..X) |
| 1283 | + | ATR_OFFERT:setImageSource("/images/custom/Shop/OfferPanel") |
| 1284 | + | ATR_OFFERT:setOpacity('0.8') |
| 1285 | + | ATR_OFFERT.onHoverChange = function(widget, hoverState) |
| 1286 | + | if hoverState then |
| 1287 | + | widget:setOpacity('1.0') |
| 1288 | + | g_tooltip.display("@BAG " ..ATR_ITEMID.. " 0 0 1") |
| 1289 | + | else |
| 1290 | + | widget:setOpacity('0.8') |
| 1291 | + | g_tooltip.hide() |
| 1292 | + | end |
| 1293 | + | end |
| 1294 | + | |
| 1295 | + | ATR_ITEM_IMG = g_ui.createWidget('UIButton', ATR_OFFERT) |
| 1296 | + | ATR_ITEM_IMG:setPhantom(true) |
| 1297 | + | ATR_ITEM_IMG:setSize({width = 32, height = 32}) |
| 1298 | + | ATR_ITEM_IMG:setImageSource("/images/custom/Items/" ..ATR_ITEMID) |
| 1299 | + | ATR_ITEM_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1300 | + | ATR_ITEM_IMG:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 1301 | + | ATR_ITEM_IMG:setMarginLeft(20) |
| 1302 | + | ATR_ITEM_IMG:setMarginTop(10) |
| 1303 | + | |
| 1304 | + | ATR_ITEM_NAME = g_ui.createWidget('UIButton', ATR_OFFERT) |
| 1305 | + | ATR_ITEM_NAME:setSize({width = 10, height = 35}) |
| 1306 | + | ATR_ITEM_NAME:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1307 | + | ATR_ITEM_NAME:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 1308 | + | ATR_ITEM_NAME:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 1309 | + | ATR_ITEM_NAME:setFont('lucida-11px-rounded') |
| 1310 | + | ATR_ITEM_NAME:setMarginLeft(05) |
| 1311 | + | ATR_ITEM_NAME:setMarginRight(05) |
| 1312 | + | ATR_ITEM_NAME:setMarginTop(50) |
| 1313 | + | ATR_ITEM_NAME:setPhantom(true) |
| 1314 | + | ATR_ITEM_NAME:setTextWrap(true) |
| 1315 | + | ATR_ITEM_NAME:setText(modules.game_database.getItemInfo(ATR_ITEMID, 01)) |
| 1316 | + | |
| 1317 | + | ATR_PRICE = g_ui.createWidget('UIButton', ATR_OFFERT) |
| 1318 | + | ATR_PRICE:setSize({width = 10, height = 20}) |
| 1319 | + | ATR_PRICE:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1320 | + | ATR_PRICE:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 1321 | + | ATR_PRICE:addAnchor(AnchorBottom, 'parent', AnchorBottom) |
| 1322 | + | ATR_PRICE:setImageSource("/images/custom/Shop/buyBt_1") |
| 1323 | + | ATR_PRICE:setFont('lucida-11px-rounded') |
| 1324 | + | ATR_PRICE:setMarginLeft(05) |
| 1325 | + | ATR_PRICE:setMarginRight(05) |
| 1326 | + | ATR_PRICE:setMarginBottom(05) |
| 1327 | + | ATR_PRICE:setTextWrap(true) |
| 1328 | + | ATR_PRICE:setPhantom(true) |
| 1329 | + | ATR_PRICE:setText('25') |
| 1330 | + | |
| 1331 | + | ATR_OFFERT.onClick = function() |
| 1332 | + | local yesChoose = function() |
| 1333 | + | g_game.talk(g_game.talk("!inventario 44 02 " ..ATR_ITEMID)) |
| 1334 | + | atrBuy:destroy() |
| 1335 | + | end |
| 1336 | + | local noChoose = function() atrBuy:destroy() end |
| 1337 | + | atrBuy = displayGeneralBox(tr('Comprar'), tr("Deseja comprar o atributo para equipamento").. " [ " ..modules.game_database.getItemInfo(ATR_ITEMID, 01).. " ]?", |
| 1338 | + | { { text=tr('Comprar'), callback=yesChoose }, |
| 1339 | + | { text=tr('Cancelar'), callback=noChoose }, |
| 1340 | + | anchor=AnchorHorizontalCenter }, yesChoose, noChoose) |
| 1341 | + | end |
| 1342 | + | end |
| 1343 | + | end |
| 1344 | + | function onMobilePaymentMeth() |
| 1345 | + | local localPlayer = g_game.getLocalPlayer() |
| 1346 | + | onMobileHiderWindows() |
| 1347 | + | LOAD_REQUEST:show() |
| 1348 | + | |
| 1349 | + | local VipConsPayment = 00 |
| 1350 | + | local realDin = DinRealCalculo |
| 1351 | + | repeat |
| 1352 | + | realDin = realDin - 0.30 |
| 1353 | + | VipConsPayment = VipConsPayment + 01 |
| 1354 | + | until realDin < 00 |
| 1355 | + | VipConsPayment = VipConsPayment - 01 |
| 1356 | + | if VipConsPayment < 00 then |
| 1357 | + | VipConsPayment = 00 |
| 1358 | + | end |
| 1359 | + | PAYMENT_METH_REAL:setText(tr('REC. EM DINHEIRO').. ':\nR$ ' ..mask_number(DinRealCalculo)) |
| 1360 | + | PAYMENT_METH_VIP:setText(tr('REC. EM VIP COINS').. ':\n' ..VipConsPayment) |
| 1361 | + | PAYMENT_METH_REAL.onClick = function() |
| 1362 | + | if DinRealCalculo < 01 then |
| 1363 | + | modules.game_interface.onLoginAdvice(tr("E necessario ter no minimo R$ 1.00 para poder solicitar pagamento.")) |
| 1364 | + | return |
| 1365 | + | end |
| 1366 | + | if SaldoBlacklist < 01 then |
| 1367 | + | modules.game_interface.onLoginAdvice(tr("Nao ha saldo suficiente no black market.")) |
| 1368 | + | return |
| 1369 | + | end |
| 1370 | + | onMobileHiderWindows() |
| 1371 | + | onRequestPay(01) |
| 1372 | + | end |
| 1373 | + | PAYMENT_METH_VIP.onClick = function() |
| 1374 | + | if VipConsPayment > 00 then |
| 1375 | + | local yesChoose = function() |
| 1376 | + | g_game.talk(g_game.talk("!inventario 45 " ..DinRealCalculo)) |
| 1377 | + | buyVipWindow:destroy() |
| 1378 | + | |
| 1379 | + | onMobileHiderWindows() |
| 1380 | + | LOAD_REQUEST:show() |
| 1381 | + | scheduleEvent(function() |
| 1382 | + | g_game.talk(g_game.talk("!inventario 37")) |
| 1383 | + | return |
| 1384 | + | end, 500) |
| 1385 | + | return |
| 1386 | + | end |
| 1387 | + | local noChoose = function() |
| 1388 | + | buyVipWindow:destroy() |
| 1389 | + | end |
| 1390 | + | buyVipWindow = displayGeneralBox(tr('Comprar Vip Coins'), tr("Essa acao nao podera ser desfeita.\nDeseja comprar").. " " ..VipConsPayment.. " ".. tr("Vip Coins usando todas as suas").. " " ..CriptoMoeda.. " " ..tr("criptomoedas").. "?", |
| 1391 | + | { { text=tr('Comprar'), callback=yesChoose }, |
| 1392 | + | { text=tr('Cancelar'), callback=noChoose }, |
| 1393 | + | anchor=AnchorHorizontalCenter }, yesChoose, noChoose) |
| 1394 | + | return |
| 1395 | + | else |
| 1396 | + | modules.game_interface.onLoginAdvice(tr("Voce nao possui saldo suficiente.")) |
| 1397 | + | return |
| 1398 | + | end |
| 1399 | + | end |
| 1400 | + | |
| 1401 | + | if HIGH_PLAYER_ACCOUNT ~= localPlayer:getName() then |
| 1402 | + | PAYMENT_METH_REAL:disable() |
| 1403 | + | PAYMENT_METH_VIP:disable() |
| 1404 | + | PAYMENT_METH_REAL:setImageSource("/images/custom/Task/Monster_5") |
| 1405 | + | PAYMENT_METH_VIP:setImageSource("/images/custom/Task/Monster_5") |
| 1406 | + | PAYMENT_METH_DESC:setText(tr('Somente o personagem de nivel mais alto nessa conta pode usar estes servicos.')) |
| 1407 | + | --elseif g_app.isMobile() then |
| 1408 | + | -- PAYMENT_METH_REAL:disable() |
| 1409 | + | -- PAYMENT_METH_VIP:enable() |
| 1410 | + | -- PAYMENT_METH_REAL:setImageSource("/images/custom/Task/Monster_5") |
| 1411 | + | -- PAYMENT_METH_VIP:setImageSource("/images/custom/Task/Monster_2") |
| 1412 | + | -- PAYMENT_METH_DESC:setText('Alguns servicos estao indisponiveis para mobile no momento.') |
| 1413 | + | else |
| 1414 | + | PAYMENT_METH_DESC:setText('') |
| 1415 | + | PAYMENT_METH_REAL:enable() |
| 1416 | + | PAYMENT_METH_VIP:enable() |
| 1417 | + | PAYMENT_METH_REAL:setImageSource("/images/custom/Task/Monster_4") |
| 1418 | + | PAYMENT_METH_VIP:setImageSource("/images/custom/Task/Monster_2") |
| 1419 | + | end |
| 1420 | + | scheduleEvent(function() |
| 1421 | + | LOAD_REQUEST:hide() |
| 1422 | + | PAYMENT_METH_PANEL:show() |
| 1423 | + | return |
| 1424 | + | end, 500) |
| 1425 | + | end |
| 1426 | + | function onRequestPay(step, edit, finish) |
| 1427 | + | REQUEST_PAY_PANEL:show() |
| 1428 | + | REQUEST_STEP_1:hide() |
| 1429 | + | REQUEST_STEP_2:hide() |
| 1430 | + | REQUEST_STEP_3:hide() |
| 1431 | + | local VALOR_INICIAL = CriptoMoeda * CriptoPrice |
| 1432 | + | if edit == nil then |
| 1433 | + | if VALOR_INICIAL < 01 then |
| 1434 | + | modules.game_interface.onLoginAdvice(tr("E necessario ter no minimo R$ 1.00 para poder solicitar pagamento.")) |
| 1435 | + | return |
| 1436 | + | end |
| 1437 | + | end |
| 1438 | + | if step == 01 then |
| 1439 | + | MOBILE_CRIPTOMOEDA:hide() |
| 1440 | + | PAYMENT_METH_PANEL:hide() |
| 1441 | + | LOAD_REQUEST:show() |
| 1442 | + | STEP_REQUEST:setImageSource("/images/custom/UI/step_1") |
| 1443 | + | |
| 1444 | + | if edit then |
| 1445 | + | PIX_REAL_NAME = HISTORY_CRIPTO[edit].NAME |
| 1446 | + | PIX_EMAIL = HISTORY_CRIPTO[edit].EMAIL |
| 1447 | + | PIX_BANK = HISTORY_CRIPTO[edit].BANK |
| 1448 | + | PIX_LABEL_NAME:setText(PIX_REAL_NAME) |
| 1449 | + | PIX_LABEL_EMAIL:setText(PIX_EMAIL) |
| 1450 | + | PIX_LABEL_BANK:setText(PIX_BANK) |
| 1451 | + | |
| 1452 | + | LOAD_REQUEST:hide() |
| 1453 | + | REQUEST_STEP_1:show() |
| 1454 | + | REQUEST_PAY_PANEL:show() |
| 1455 | + | end |
| 1456 | + | PIX_EDIT.onClick = function() |
| 1457 | + | modules.game_menu.onPix(02, PIX_REAL_NAME) |
| 1458 | + | modules.game_menu.onPix(03, PIX_EMAIL) |
| 1459 | + | modules.game_menu.onPix(04, PIX_BANK) |
| 1460 | + | modules.game_menu.onPix(01) |
| 1461 | + | end |
| 1462 | + | LAST_STEP_1.onClick = function() |
| 1463 | + | REQUEST_STEP_1:hide() |
| 1464 | + | REQUEST_STEP_2:hide() |
| 1465 | + | REQUEST_STEP_3:hide() |
| 1466 | + | MOBILE_CRIPTOMOEDA:hide() |
| 1467 | + | REQUEST_PAY_PANEL:hide() |
| 1468 | + | PAYMENT_METH_PANEL:hide() |
| 1469 | + | onMobilePaymentMeth() |
| 1470 | + | end |
| 1471 | + | NEXT_STEP_1.onClick = function() |
| 1472 | + | if #PIX_REAL_NAME > 04 then |
| 1473 | + | if #PIX_EMAIL > 10 then |
| 1474 | + | if #PIX_BANK > 04 then |
| 1475 | + | if edit then |
| 1476 | + | onRequestPay(02, edit) |
| 1477 | + | else |
| 1478 | + | onRequestPay(02) |
| 1479 | + | end |
| 1480 | + | else |
| 1481 | + | modules.game_interface.onLoginAdvice(tr("Nome da instituicao financeira negado.")) |
| 1482 | + | return |
| 1483 | + | end |
| 1484 | + | else |
| 1485 | + | modules.game_interface.onLoginAdvice(tr("Email invalido.")) |
| 1486 | + | return |
| 1487 | + | end |
| 1488 | + | else |
| 1489 | + | modules.game_interface.onLoginAdvice(tr("Nome muito curto.")) |
| 1490 | + | return |
| 1491 | + | end |
| 1492 | + | end |
| 1493 | + | if edit then |
| 1494 | + | return |
| 1495 | + | else |
| 1496 | + | scheduleEvent(function() |
| 1497 | + | REQUEST_STEP_1:show() |
| 1498 | + | LOAD_REQUEST:hide() |
| 1499 | + | g_game.talk("!inventario 38") |
| 1500 | + | end, 500) |
| 1501 | + | end |
| 1502 | + | end |
| 1503 | + | if step == 02 then |
| 1504 | + | MOBILE_CRIPTOMOEDA:hide() |
| 1505 | + | REQUEST_PAY_PANEL:hide() |
| 1506 | + | LOAD_REQUEST:show() |
| 1507 | + | STEP_REQUEST:setImageSource("/images/custom/UI/step_2") |
| 1508 | + | |
| 1509 | + | local NEW_MAX = 0 |
| 1510 | + | local NewMoeda, NewPrice = 0, 0 |
| 1511 | + | if edit then |
| 1512 | + | EditOldValor = HISTORY_CRIPTO[edit].VALOR |
| 1513 | + | EditOldCript = HISTORY_CRIPTO[edit].CRIPTOMOEDA |
| 1514 | + | NewPrice = HISTORY_CRIPTO[edit].PRICE |
| 1515 | + | NEW_MAX = HISTORY_CRIPTO[edit].CRIPTOMOEDA + CriptoMoeda |
| 1516 | + | |
| 1517 | + | NewMoeda = HISTORY_CRIPTO[edit].CRIPTOMOEDA |
| 1518 | + | RequestFinalCoin = NewMoeda |
| 1519 | + | CRIPT_SCROLL:setMaximum(NEW_MAX) |
| 1520 | + | CRIPT_SCROLL:setValue(NewMoeda) |
| 1521 | + | CRIPT_COUNT:setText(NewMoeda) |
| 1522 | + | RequestFinalValor = NewMoeda * NewPrice |
| 1523 | + | CRIPT_FINAL_PRICE:setText("R$ " ..RequestFinalValor) |
| 1524 | + | else |
| 1525 | + | CRIPT_COUNT:setText(CriptoMoeda) |
| 1526 | + | CRIPT_SCROLL:setValue(CriptoMoeda) |
| 1527 | + | CRIPT_SCROLL:setMaximum(CriptoMoeda) |
| 1528 | + | CRIPT_FINAL_PRICE:setText("R$ " ..VALOR_INICIAL) |
| 1529 | + | RequestFinalCoin = CriptoMoeda |
| 1530 | + | RequestFinalValor = VALOR_INICIAL |
| 1531 | + | end |
| 1532 | + | |
| 1533 | + | CRIPT_SCROLL:setMinimum(0) |
| 1534 | + | |
| 1535 | + | CRIPT_SCROLL.onValueChange = function(self, value) |
| 1536 | + | local FinalPrice = value * CriptoPrice |
| 1537 | + | if edit then |
| 1538 | + | FinalPrice = value * NewPrice |
| 1539 | + | end |
| 1540 | + | |
| 1541 | + | CRIPT_COUNT:setText(value) |
| 1542 | + | CRIPT_FINAL_PRICE:setText("R$ " ..FinalPrice) |
| 1543 | + | RequestFinalCoin = value |
| 1544 | + | RequestFinalValor = FinalPrice |
| 1545 | + | end |
| 1546 | + | NEXT_STEP_2.onClick = function() |
| 1547 | + | if edit then |
| 1548 | + | local CHECK_PRICE_CRIPT = RequestFinalCoin * NewPrice |
| 1549 | + | if CHECK_PRICE_CRIPT == 00 then |
| 1550 | + | local yesChoose = function() |
| 1551 | + | g_game.getProtocolGame():sendExtendedOpcode(Opcode_cripto, "3," ..HISTORY_CRIPTO[edit].VALOR.. "," ..PIX_REAL_NAME.. "," ..PIX_EMAIL.. "," ..PIX_BANK.. "," ..HISTORY_CRIPTO[edit].CRIPTOMOEDA.. "," ..CriptoPrice.. "," ..EditOldCript.. "," ..HISTORY_CRIPTO[edit].ID.. "," ..EditOldValor) |
| 1552 | + | exitWindow:destroy() |
| 1553 | + | REQUEST_STEP_1:hide() |
| 1554 | + | REQUEST_STEP_2:hide() |
| 1555 | + | REQUEST_STEP_3:hide() |
| 1556 | + | REQUEST_PAY_PANEL:hide() |
| 1557 | + | LOAD_REQUEST:show() |
| 1558 | + | return |
| 1559 | + | end |
| 1560 | + | local noChoose = function() exitWindow:destroy() end |
| 1561 | + | |
| 1562 | + | exitWindow = displayGeneralBox(tr('Deletar Pedido'), tr("Continuar deletara esse pedido de pagamento.\nDeseja realmente deletar este pedido?"), |
| 1563 | + | { { text=tr('Yes'), callback=yesChoose }, |
| 1564 | + | { text=tr('No'), callback=noChoose }, |
| 1565 | + | anchor=AnchorHorizontalCenter }, yesChoose, noChoose) |
| 1566 | + | return |
| 1567 | + | |
| 1568 | + | elseif CHECK_PRICE_CRIPT > 00 and CHECK_PRICE_CRIPT < 01 then |
| 1569 | + | modules.game_interface.onLoginAdvice("E necessario ter no minimo R$ 1.00 para poder solicitar pagamento.") |
| 1570 | + | return |
| 1571 | + | end |
| 1572 | + | onRequestPay(03, edit, true) |
| 1573 | + | else |
| 1574 | + | local CHECK_PRICE_CRIPT = RequestFinalCoin * CriptoPrice |
| 1575 | + | if CHECK_PRICE_CRIPT < 01 then |
| 1576 | + | modules.game_interface.onLoginAdvice("E necessario ter no minimo R$ 1.00 para poder solicitar pagamento.") |
| 1577 | + | return |
| 1578 | + | end |
| 1579 | + | onRequestPay(03) |
| 1580 | + | end |
| 1581 | + | end |
| 1582 | + | LAST_STEP_2.onClick = function() |
| 1583 | + | if edit then |
| 1584 | + | onRequestPay(01, edit) |
| 1585 | + | else |
| 1586 | + | onRequestPay(01) |
| 1587 | + | end |
| 1588 | + | end |
| 1589 | + | scheduleEvent(function() |
| 1590 | + | REQUEST_STEP_2:show() |
| 1591 | + | REQUEST_PAY_PANEL:show() |
| 1592 | + | LOAD_REQUEST:hide() |
| 1593 | + | end, 500) |
| 1594 | + | end |
| 1595 | + | if step == 03 then |
| 1596 | + | MOBILE_CRIPTOMOEDA:hide() |
| 1597 | + | REQUEST_PAY_PANEL:hide() |
| 1598 | + | LOAD_REQUEST:show() |
| 1599 | + | if edit then |
| 1600 | + | if finish then |
| 1601 | + | FINAL_INFO:setText(tr("Qualquer divergencia anulara o pedido.")) |
| 1602 | + | STEP_REQUEST:show() |
| 1603 | + | NEXT_STEP_3:setText(tr("AVANCAR")) |
| 1604 | + | NEXT_STEP_3:show() |
| 1605 | + | LAST_STEP_3:show() |
| 1606 | + | STEP_REQUEST:setImageSource("/images/custom/UI/step_3") |
| 1607 | + | |
| 1608 | + | FINAL_VALOR:setText("R$ " ..RequestFinalValor) |
| 1609 | + | FINAL_NOME:setText(PIX_REAL_NAME) |
| 1610 | + | FINAL_EMAIL:setText(PIX_EMAIL) |
| 1611 | + | FINAL_BANK:setText(PIX_BANK) |
| 1612 | + | FINAL_COIN:setText(RequestFinalCoin) |
| 1613 | + | |
| 1614 | + | NEXT_STEP_3.onClick = function() |
| 1615 | + | if RequestFinalValor > SaldoBlacklist then |
| 1616 | + | modules.game_interface.onLoginAdvice(tr("Nao ha saldo suficiente na Black Market para pagar sua solicitacao.")) |
| 1617 | + | return |
| 1618 | + | end |
| 1619 | + | onFinalizarRequest(edit) |
| 1620 | + | end |
| 1621 | + | LAST_STEP_3.onClick = function() |
| 1622 | + | onRequestPay(02, edit) |
| 1623 | + | end |
| 1624 | + | else |
| 1625 | + | STEP_REQUEST:hide() |
| 1626 | + | if HISTORY_CRIPTO[edit].STATUS == 01 then |
| 1627 | + | FINAL_INFO:setText(tr("Qualquer divergencia anulara o pedido.")) |
| 1628 | + | NEXT_STEP_3:setText(tr("EDITAR")) |
| 1629 | + | NEXT_STEP_3:show() |
| 1630 | + | elseif HISTORY_CRIPTO[edit].STATUS == 02 then |
| 1631 | + | FINAL_INFO:setText(HISTORY_CRIPTO[edit].OBS) |
| 1632 | + | NEXT_STEP_3:setText(tr("EDITAR")) |
| 1633 | + | NEXT_STEP_3:show() |
| 1634 | + | else |
| 1635 | + | FINAL_INFO:setText(HISTORY_CRIPTO[edit].OBS) |
| 1636 | + | NEXT_STEP_3:hide() |
| 1637 | + | end |
| 1638 | + | FINAL_VALOR:setText("R$ " ..HISTORY_CRIPTO[edit].VALOR) |
| 1639 | + | FINAL_NOME:setText(HISTORY_CRIPTO[edit].NAME) |
| 1640 | + | FINAL_EMAIL:setText(HISTORY_CRIPTO[edit].EMAIL) |
| 1641 | + | FINAL_BANK:setText(HISTORY_CRIPTO[edit].BANK) |
| 1642 | + | FINAL_COIN:setText(HISTORY_CRIPTO[edit].CRIPTOMOEDA) |
| 1643 | + | |
| 1644 | + | LAST_STEP_3:show() |
| 1645 | + | NEXT_STEP_3.onClick = function() |
| 1646 | + | if RequestFinalValor > SaldoBlacklist then |
| 1647 | + | modules.game_interface.onLoginAdvice(tr("Nao ha saldo suficiente na Black Market para pagar sua solicitacao.")) |
| 1648 | + | return |
| 1649 | + | end |
| 1650 | + | onRequestPay(01, edit) |
| 1651 | + | end |
| 1652 | + | LAST_STEP_3.onClick = function() |
| 1653 | + | REQUEST_STEP_1:hide() |
| 1654 | + | REQUEST_STEP_2:hide() |
| 1655 | + | REQUEST_STEP_3:hide() |
| 1656 | + | REQUEST_PAY_PANEL:hide() |
| 1657 | + | |
| 1658 | + | MOBILE_CRIPTOMOEDA:show() |
| 1659 | + | LOAD_REQUEST:hide() |
| 1660 | + | end |
| 1661 | + | end |
| 1662 | + | else |
| 1663 | + | FINAL_INFO:setText(tr("Qualquer divergencia anulara o pedido.")) |
| 1664 | + | STEP_REQUEST:show() |
| 1665 | + | NEXT_STEP_3:setText(tr("AVANCAR")) |
| 1666 | + | NEXT_STEP_3:show() |
| 1667 | + | LAST_STEP_3:show() |
| 1668 | + | STEP_REQUEST:setImageSource("/images/custom/UI/step_3") |
| 1669 | + | |
| 1670 | + | FINAL_VALOR:setText("R$ " ..RequestFinalValor) |
| 1671 | + | FINAL_NOME:setText(PIX_REAL_NAME) |
| 1672 | + | FINAL_EMAIL:setText(PIX_EMAIL) |
| 1673 | + | FINAL_BANK:setText(PIX_BANK) |
| 1674 | + | FINAL_COIN:setText(RequestFinalCoin) |
| 1675 | + | |
| 1676 | + | NEXT_STEP_3.onClick = function() |
| 1677 | + | if RequestFinalValor > SaldoBlacklist then |
| 1678 | + | modules.game_interface.onLoginAdvice(tr("Nao ha saldo suficiente na Black Market para pagar sua solicitacao.")) |
| 1679 | + | return |
| 1680 | + | end |
| 1681 | + | onFinalizarRequest() |
| 1682 | + | end |
| 1683 | + | LAST_STEP_3.onClick = function() onRequestPay(02) end |
| 1684 | + | end |
| 1685 | + | scheduleEvent(function() |
| 1686 | + | REQUEST_STEP_3:show() |
| 1687 | + | REQUEST_PAY_PANEL:show() |
| 1688 | + | LOAD_REQUEST:hide() |
| 1689 | + | end, 500) |
| 1690 | + | end |
| 1691 | + | end |
| 1692 | + | function onFinalizarRequest(edit) |
| 1693 | + | REQUEST_STEP_1:hide() |
| 1694 | + | REQUEST_STEP_2:hide() |
| 1695 | + | REQUEST_STEP_3:hide() |
| 1696 | + | MOBILE_CRIPTOMOEDA:hide() |
| 1697 | + | REQUEST_PAY_PANEL:hide() |
| 1698 | + | PAYMENT_METH_PANEL:hide() |
| 1699 | + | LOAD_REQUEST:show() |
| 1700 | + | |
| 1701 | + | if edit then |
| 1702 | + | modules.game_menu.onMobileFinishRequest(02, RequestFinalValor, PIX_REAL_NAME, PIX_EMAIL, PIX_BANK, RequestFinalCoin, CriptoPrice, EditOldCript, HISTORY_CRIPTO[edit].ID, EditOldValor) |
| 1703 | + | else |
| 1704 | + | modules.game_menu.onMobileFinishRequest(01, RequestFinalValor, PIX_REAL_NAME, PIX_EMAIL, PIX_BANK, RequestFinalCoin, CriptoPrice, EditOldCript) |
| 1705 | + | end |
| 1706 | + | end |
| 1707 | + | function onMobileHiderWindows() |
| 1708 | + | MOBILE_CRIPTOMOEDA:setVisible(false) |
| 1709 | + | REQUEST_PAY_PANEL:hide() |
| 1710 | + | PAYMENT_METH_PANEL:hide() |
| 1711 | + | LOAD_REQUEST:hide() |
| 1712 | + | end |
| 1713 | + | function onMobileLoadEvents(id) |
| 1714 | + | EVENT_PANEL = gameRootPanel:recursiveGetChildById('mobileEvents_' ..id) |
| 1715 | + | if id > 00 then |
| 1716 | + | EVENT_TITLE = gameRootPanel:recursiveGetChildById('eventTitle_' ..id) |
| 1717 | + | EVENT_SUB_TITLE = gameRootPanel:recursiveGetChildById('eventSubTitle_' ..id) |
| 1718 | + | EVENT_INFO = gameRootPanel:recursiveGetChildById('eventInfo_' ..id) |
| 1719 | + | |
| 1720 | + | EVENT_TITLE:setText(EVENTOS_TABLE[id].EVENT_NAME) |
| 1721 | + | EVENT_SUB_TITLE:setText(EVENTOS_TABLE[id].DATA_DESC.. " de " ..EVENTOS_TABLE[id].MES_NAME) |
| 1722 | + | EVENT_INFO:setText(EVENTOS_TABLE[id].EVENT_INF) |
| 1723 | + | |
| 1724 | + | if id == 01 then |
| 1725 | + | MONSTER_1 = gameRootPanel:recursiveGetChildById('Monster_1') |
| 1726 | + | MONSTER_2 = gameRootPanel:recursiveGetChildById('Monster_2') |
| 1727 | + | MONSTER_3 = gameRootPanel:recursiveGetChildById('Monster_3') |
| 1728 | + | BUFF_ACTIVE_BT = gameRootPanel:recursiveGetChildById('buyBuff') |
| 1729 | + | |
| 1730 | + | MONSTER_1:setImageSource("/images/custom/Monster/" ..EVENTOS_TABLE[00].EVENT_UID_3) |
| 1731 | + | MONSTER_1:setImageRect(modules.game_database.onKard(04, EVENTOS_TABLE[00].EVENT_UID_1, EVENTOS_TABLE[00].EVENT_UID_2)) |
| 1732 | + | MONSTER_1:setTooltip(modules.game_database.onKard(01, EVENTOS_TABLE[00].EVENT_UID_1, EVENTOS_TABLE[00].EVENT_UID_2)) |
| 1733 | + | MONSTER_2:setImageSource("/images/custom/Monster/" ..EVENTOS_TABLE[00].EVENT_UID_6) |
| 1734 | + | MONSTER_2:setImageRect(modules.game_database.onKard(04, EVENTOS_TABLE[00].EVENT_UID_4, EVENTOS_TABLE[00].EVENT_UID_5)) |
| 1735 | + | MONSTER_2:setTooltip(modules.game_database.onKard(01, EVENTOS_TABLE[00].EVENT_UID_4, EVENTOS_TABLE[00].EVENT_UID_5)) |
| 1736 | + | MONSTER_3:setImageSource("/images/custom/Monster/" ..EVENTOS_TABLE[00].EVENT_UID_9) |
| 1737 | + | MONSTER_3:setImageRect(modules.game_database.onKard(04, EVENTOS_TABLE[00].EVENT_UID_7, EVENTOS_TABLE[00].EVENT_UID_8)) |
| 1738 | + | MONSTER_3:setTooltip(modules.game_database.onKard(01, EVENTOS_TABLE[00].EVENT_UID_7, EVENTOS_TABLE[00].EVENT_UID_8)) |
| 1739 | + | |
| 1740 | + | SALDO_GOLD_TOKEN:setText('Saldo Gold Token: ' ..EVENTOS_TABLE[01].GOLD_TOKEN) |
| 1741 | + | BUFF_ACTIVE_BT.onClick = function() |
| 1742 | + | if EVENTOS_TABLE[01].GOLD_TOKEN >= 50 then |
| 1743 | + | g_game.talk(g_game.talk("!inventario 41 01")) |
| 1744 | + | else |
| 1745 | + | modules.game_textmessage.displayGameMessage(tr('E necessario 50 Gold Tokens para ativar este Buff.')) |
| 1746 | + | end |
| 1747 | + | end |
| 1748 | + | end |
| 1749 | + | if id == 02 then |
| 1750 | + | local QNT = EVENTOS_TABLE[00].EVENT_UID_1 |
| 1751 | + | local META = 5000 |
| 1752 | + | META_BAR = gameRootPanel:recursiveGetChildById('metaModoOnline') |
| 1753 | + | META_PANEL = gameRootPanel:recursiveGetChildById('bonusPanel') |
| 1754 | + | META_DESC = gameRootPanel:recursiveGetChildById('bonusDesc') |
| 1755 | + | PROGRESS_LABEL = gameRootPanel:recursiveGetChildById('labelModoOnline') |
| 1756 | + | |
| 1757 | + | META_BAR:setValue(QNT, 0, META) |
| 1758 | + | PROGRESS_LABEL:setText(QNT.. ' / ' ..META) |
| 1759 | + | if QNT == META then |
| 1760 | + | META_PANEL:setImageSource("/images/custom/Task/Monster_4") |
| 1761 | + | META_DESC:setText(tr('BONUS ATIVO:\n\n1x Online Points adicional para cada uma hora online.')) |
| 1762 | + | else |
| 1763 | + | META_PANEL:setImageSource("/images/custom/Task/Monster_1") |
| 1764 | + | META_DESC:setText(tr('BONUS AINDA NAO ATIVO:\n\n1x Online Points adicional para cada uma hora online.')) |
| 1765 | + | end |
| 1766 | + | end |
| 1767 | + | if id == 03 then |
| 1768 | + | local DESCONTO = EVENTOS_TABLE[00].EVENT_UID_1 |
| 1769 | + | if DESCONTO < 00 then |
| 1770 | + | DESCONTO = 00 |
| 1771 | + | end |
| 1772 | + | local FIXO_PRICE = 50000 |
| 1773 | + | local TOTAL_DESCONTO = FIXO_PRICE - DESCONTO |
| 1774 | + | |
| 1775 | + | PRICE_CRYPT = gameRootPanel:recursiveGetChildById('finalCryptPrice') |
| 1776 | + | BUY_CRYPT = gameRootPanel:recursiveGetChildById('buyTask_1') |
| 1777 | + | |
| 1778 | + | PRICE_CRYPT:setText(mask_number(TOTAL_DESCONTO)) |
| 1779 | + | BUY_CRYPT:setTooltip(tr('Compre Criptomoedas usando suas Gold Coins.')) |
| 1780 | + | BUY_CRYPT.onClick = function() g_game.talk(g_game.talk("!inventario 41 02")) end |
| 1781 | + | end |
| 1782 | + | if id == 04 then |
| 1783 | + | BUFF_FIRE_EVENT = gameRootPanel:recursiveGetChildById('buyFire') |
| 1784 | + | BUFF_ENERGY_EVENT = gameRootPanel:recursiveGetChildById('buyEnergy') |
| 1785 | + | BUFF_EARTH_EVENT = gameRootPanel:recursiveGetChildById('buyEarth') |
| 1786 | + | BUFF_ICE_EVENT = gameRootPanel:recursiveGetChildById('buyIce') |
| 1787 | + | |
| 1788 | + | BUFF_FIRE_EVENT.onClick = function() g_game.talk(g_game.talk("!inventario 41 04 01")) end |
| 1789 | + | BUFF_ENERGY_EVENT.onClick = function() g_game.talk(g_game.talk("!inventario 41 04 03")) end |
| 1790 | + | BUFF_EARTH_EVENT.onClick = function() g_game.talk(g_game.talk("!inventario 41 04 04")) end |
| 1791 | + | BUFF_ICE_EVENT.onClick = function() g_game.talk(g_game.talk("!inventario 41 04 02")) end |
| 1792 | + | end |
| 1793 | + | if id == 05 then |
| 1794 | + | ITEM_1 = gameRootPanel:recursiveGetChildById('eventItem_1_1') |
| 1795 | + | ITEM_2 = gameRootPanel:recursiveGetChildById('eventItem_1_2') |
| 1796 | + | ITEM_3 = gameRootPanel:recursiveGetChildById('eventItem_1_3') |
| 1797 | + | ITEM_4 = gameRootPanel:recursiveGetChildById('eventItem_2_1') |
| 1798 | + | ITEM_5 = gameRootPanel:recursiveGetChildById('eventItem_2_2') |
| 1799 | + | ITEM_6 = gameRootPanel:recursiveGetChildById('eventItem_2_3') |
| 1800 | + | ITEM_7 = gameRootPanel:recursiveGetChildById('eventItem_3_1') |
| 1801 | + | ITEM_8 = gameRootPanel:recursiveGetChildById('eventItem_3_2') |
| 1802 | + | ITEM_9 = gameRootPanel:recursiveGetChildById('eventItem_3_3') |
| 1803 | + | QNT_ITEM_1 = gameRootPanel:recursiveGetChildById('qntItem_1_1') |
| 1804 | + | QNT_ITEM_2 = gameRootPanel:recursiveGetChildById('qntItem_1_2') |
| 1805 | + | QNT_ITEM_3 = gameRootPanel:recursiveGetChildById('qntItem_1_3') |
| 1806 | + | QNT_ITEM_4 = gameRootPanel:recursiveGetChildById('qntItem_2_1') |
| 1807 | + | QNT_ITEM_5 = gameRootPanel:recursiveGetChildById('qntItem_2_2') |
| 1808 | + | QNT_ITEM_6 = gameRootPanel:recursiveGetChildById('qntItem_2_3') |
| 1809 | + | QNT_ITEM_7 = gameRootPanel:recursiveGetChildById('qntItem_3_1') |
| 1810 | + | QNT_ITEM_8 = gameRootPanel:recursiveGetChildById('qntItem_3_2') |
| 1811 | + | QNT_ITEM_9 = gameRootPanel:recursiveGetChildById('qntItem_3_3') |
| 1812 | + | ENTREGA_1 = gameRootPanel:recursiveGetChildById('buyEntrega_1') |
| 1813 | + | ENTREGA_2 = gameRootPanel:recursiveGetChildById('buyEntrega_2') |
| 1814 | + | ENTREGA_3 = gameRootPanel:recursiveGetChildById('buyEntrega_3') |
| 1815 | + | |
| 1816 | + | ITEM_1:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_4, 13)) |
| 1817 | + | ITEM_1:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_4) |
| 1818 | + | ITEM_1:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_4.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_4, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_1.. " 0") |
| 1819 | + | ITEM_2:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_5, 13)) |
| 1820 | + | ITEM_2:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_5) |
| 1821 | + | ITEM_2:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_5.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_5, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_1.. " 0") |
| 1822 | + | ITEM_3:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_6, 13)) |
| 1823 | + | ITEM_3:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_6) |
| 1824 | + | ITEM_3:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_6.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_6, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_1.. " 0") |
| 1825 | + | QNT_ITEM_1:setText(EVENTOS_TABLE[00].EVENT_UID_1) |
| 1826 | + | QNT_ITEM_2:setText(EVENTOS_TABLE[00].EVENT_UID_1) |
| 1827 | + | QNT_ITEM_3:setText(EVENTOS_TABLE[00].EVENT_UID_1) |
| 1828 | + | |
| 1829 | + | ITEM_4:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_7, 13)) |
| 1830 | + | ITEM_4:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_7) |
| 1831 | + | ITEM_4:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_7.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_7, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_2.. " 0") |
| 1832 | + | ITEM_5:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_8, 13)) |
| 1833 | + | ITEM_5:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_8) |
| 1834 | + | ITEM_5:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_8.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_8, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_2.. " 0") |
| 1835 | + | ITEM_6:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_9, 13)) |
| 1836 | + | ITEM_6:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_9) |
| 1837 | + | ITEM_6:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_9.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_9, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_2.. " 0") |
| 1838 | + | QNT_ITEM_4:setText(EVENTOS_TABLE[00].EVENT_UID_2) |
| 1839 | + | QNT_ITEM_5:setText(EVENTOS_TABLE[00].EVENT_UID_2) |
| 1840 | + | QNT_ITEM_6:setText(EVENTOS_TABLE[00].EVENT_UID_2) |
| 1841 | + | |
| 1842 | + | ITEM_7:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_10, 13)) |
| 1843 | + | ITEM_7:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_10) |
| 1844 | + | ITEM_7:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_10.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_10, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_3.. " 0") |
| 1845 | + | ITEM_8:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_11, 13)) |
| 1846 | + | ITEM_8:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_11) |
| 1847 | + | ITEM_8:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_11.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_11, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_3.. " 0") |
| 1848 | + | ITEM_9:setImageSource("/images/custom/UI/rare_" ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_12, 13)) |
| 1849 | + | ITEM_9:setIcon("/images/custom/Items/" ..EVENTOS_TABLE[00].EVENT_UID_12) |
| 1850 | + | ITEM_9:setTooltip("@BAG " ..EVENTOS_TABLE[00].EVENT_UID_12.. " 0 " ..modules.game_database.getItemInfo(EVENTOS_TABLE[00].EVENT_UID_12, 13).. " " ..EVENTOS_TABLE[00].EVENT_UID_3.. " 0") |
| 1851 | + | QNT_ITEM_7:setText(EVENTOS_TABLE[00].EVENT_UID_3) |
| 1852 | + | QNT_ITEM_8:setText(EVENTOS_TABLE[00].EVENT_UID_3) |
| 1853 | + | QNT_ITEM_9:setText(EVENTOS_TABLE[00].EVENT_UID_3) |
| 1854 | + | |
| 1855 | + | ENTREGA_1.onClick = function() g_game.talk(g_game.talk("!inventario 41 05 01")) end |
| 1856 | + | ENTREGA_2.onClick = function() g_game.talk(g_game.talk("!inventario 41 05 02")) end |
| 1857 | + | ENTREGA_3.onClick = function() g_game.talk(g_game.talk("!inventario 41 05 03")) end |
| 1858 | + | end |
| 1859 | + | if id == 06 then |
| 1860 | + | SALDO_LEVEL_TOKEN:setText(tr('Saldo de Pontos').. ': ' ..EVENTOS_TABLE[06].POINTS) |
| 1861 | + | PRESENT_BUTTON = gameRootPanel:recursiveGetChildById('buyPresent') |
| 1862 | + | PRESENT_BUTTON.onClick = function() g_game.talk(g_game.talk("!inventario 41 06")) end |
| 1863 | + | end |
| 1864 | + | if id == 07 then |
| 1865 | + | SALDO_BONUS_EXP:setText(tr('Bonus de EXP ativo').. ': ' ..EVENTOS_TABLE[07].EXP_BONUS.. "%") |
| 1866 | + | for DEL_NPC = 01, #EVENTOS_TABLE[id].NPC do |
| 1867 | + | NPC_ID = gameRootPanel:recursiveGetChildById('_NPC_ID_' ..DEL_NPC) |
| 1868 | + | if NPC_ID then |
| 1869 | + | NPC_ID:destroy() |
| 1870 | + | end |
| 1871 | + | end |
| 1872 | + | for _DUEL = 01, #EVENTOS_TABLE[id].NPC do |
| 1873 | + | local RASTREAR_ID = id |
| 1874 | + | NPC = g_ui.createWidget('UIButton', EVENT_SCROLL) |
| 1875 | + | NPC:setId("_NPC_ID_" .._DUEL) |
| 1876 | + | NPC:setImageSource("/images/custom/Task/Monster_1") |
| 1877 | + | NPC:setMarginTop(05) |
| 1878 | + | |
| 1879 | + | NPC_DESC = g_ui.createWidget('UIButton', NPC) |
| 1880 | + | NPC_DESC:setSize({width = 20, height = 35}) |
| 1881 | + | NPC_DESC:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1882 | + | NPC_DESC:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 1883 | + | NPC_DESC:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 1884 | + | NPC_DESC:setMarginTop(05) |
| 1885 | + | NPC_DESC:setMarginLeft(70) |
| 1886 | + | NPC_DESC:setMarginRight(10) |
| 1887 | + | NPC_DESC:setTextAlign(AlignLeft) |
| 1888 | + | NPC_DESC:setText(EVENTOS_TABLE[id].NPC[_DUEL].NAME.. "\n".. tr("Bonus de EXP").. ": " ..EVENTOS_TABLE[id].NPC[_DUEL].EXP.. "%") |
| 1889 | + | |
| 1890 | + | NPC_IMG = g_ui.createWidget('UIButton', NPC) |
| 1891 | + | NPC_IMG:setSize({width = EVENTOS_TABLE[id].NPC[_DUEL].SIZE[01], height = EVENTOS_TABLE[id].NPC[_DUEL].SIZE[02]}) |
| 1892 | + | NPC_IMG:setImageSource("/images/custom/Monster/Humanos/" ..EVENTOS_TABLE[id].NPC[_DUEL].NAME) |
| 1893 | + | NPC_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1894 | + | NPC_IMG:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 1895 | + | NPC_IMG:setMarginLeft(EVENTOS_TABLE[id].NPC[_DUEL].SIZE[04]) |
| 1896 | + | NPC_IMG:setMarginTop(EVENTOS_TABLE[id].NPC[_DUEL].SIZE[03]) |
| 1897 | + | |
| 1898 | + | NPC_RAST = g_ui.createWidget('UIButton', NPC) |
| 1899 | + | NPC_RAST:setSize({width = 20, height = 20}) |
| 1900 | + | NPC_RAST:setImageSource("/images/custom/UI/button") |
| 1901 | + | NPC_RAST:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 1902 | + | NPC_RAST:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 1903 | + | NPC_RAST:addAnchor(AnchorBottom, 'parent', AnchorBottom) |
| 1904 | + | NPC_RAST:setMarginLeft(70) |
| 1905 | + | NPC_RAST:setMarginRight(10) |
| 1906 | + | NPC_RAST:setMarginBottom(05) |
| 1907 | + | NPC_RAST:setOpacity(0.8) |
| 1908 | + | NPC_RAST:setText(tr("RASTREAR NPC")) |
| 1909 | + | NPC_RAST.onClick = function() |
| 1910 | + | local DESC = tr("NPC de Duelo").. "\n[ " ..EVENTOS_TABLE[id].NPC[_DUEL].NAME.. " ]" |
| 1911 | + | local POS = EVENTOS_TABLE[id].NPC[_DUEL].RASTREAR[01] |
| 1912 | + | modules.game_minimap.onRastrearQuest(POS, DESC) |
| 1913 | + | modules.game_textmessage.displayGameMessage(tr('A localizacao de').. ' ' ..EVENTOS_TABLE[id].NPC[_DUEL].NAME.. ' '.. tr('foi agora\nmarcado em seu mapa.')) |
| 1914 | + | end |
| 1915 | + | NPC_RAST.onHoverChange = function(widget, hoverState) |
| 1916 | + | if hoverState then |
| 1917 | + | widget:setOpacity(1.0) |
| 1918 | + | else |
| 1919 | + | widget:setOpacity(0.6) |
| 1920 | + | end |
| 1921 | + | end |
| 1922 | + | end |
| 1923 | + | end |
| 1924 | + | if id == 10 then |
| 1925 | + | BUY_CHEST = gameRootPanel:recursiveGetChildById('buyChest') |
| 1926 | + | KEYS_LABEL = gameRootPanel:recursiveGetChildById('saldoKeys') |
| 1927 | + | |
| 1928 | + | KEYS_LABEL:setText(tr('Chaves do Evento').. ': ' ..EVENTOS_TABLE[10].KEYS_EVENT) |
| 1929 | + | BUY_CHEST.onClick = function() g_game.talk(g_game.talk("!inventario 41 10")) end |
| 1930 | + | end |
| 1931 | + | if id == 11 then |
| 1932 | + | PILLAR_BONUS = gameRootPanel:recursiveGetChildById('pillarBonus') |
| 1933 | + | PILLAR_TXT = gameRootPanel:recursiveGetChildById('pillartxt') |
| 1934 | + | |
| 1935 | + | if EVENTOS_TABLE[11].PILLAR_STEP == 06 then |
| 1936 | + | PILLAR_BONUS:setImageSource("/images/custom/Task/Monster_2") |
| 1937 | + | PILLAR_TXT:setText(tr("BONUS ATIVO:\n\nO dobro de Gold Coins de todas as criaturas ate o proximo ServerSave.")) |
| 1938 | + | else |
| 1939 | + | PILLAR_BONUS:setImageSource("/images/custom/Task/Monster_1") |
| 1940 | + | PILLAR_TXT:setText(tr("BONUS AINDA NAO ATIVO:\n\nO dobro de Gold Coins de todas as criaturas ate o proximo ServerSave.")) |
| 1941 | + | end |
| 1942 | + | |
| 1943 | + | RASTREAR_PILLAR = gameRootPanel:recursiveGetChildById('rastrearPillar') |
| 1944 | + | RASTREAR_PILLAR.onClick = function() g_game.talk(g_game.talk("!inventario 41 11")) end |
| 1945 | + | end |
| 1946 | + | if id == 12 then |
| 1947 | + | local QNT = EVENTOS_TABLE[00].EVENT_UID_4 |
| 1948 | + | local META = 1000 |
| 1949 | + | local MAX = 2000 |
| 1950 | + | local CLASSES_IMG = { |
| 1951 | + | [01] = {NAME = 'DRAGON', IMG = '/images/custom/Spells/Passiva/passive_4019'}; |
| 1952 | + | [02] = {NAME = 'MAGICA', IMG = '/images/custom/Spells/Passiva/passive_4026'}; |
| 1953 | + | [03] = {NAME = 'REPTEIS', IMG = '/images/custom/Spells/Passiva/passive_4036'}; |
| 1954 | + | [04] = {NAME = 'AQU�TICOS', IMG = '/images/custom/Spells/Passiva/passive_4046'}; |
| 1955 | + | [05] = {NAME = 'MORTO-VIVO', IMG = '/images/custom/Spells/Passiva/passive_4049'}; |
| 1956 | + | [06] = {NAME = 'VERMES', IMG = '/images/custom/Spells/Passiva/passive_4020'}; |
| 1957 | + | [07] = {NAME = 'MAM�FEROS', IMG = '/images/custom/Spells/Passiva/passive_4015'}; |
| 1958 | + | [08] = {NAME = 'DEMON', IMG = '/images/custom/Spells/Passiva/passive_4030'}; |
| 1959 | + | [09] = {NAME = 'GIGANTES', IMG = '/images/custom/Spells/Passiva/passive_4033'}; |
| 1960 | + | [10] = {NAME = 'CONSTRUCTOS', IMG = '/images/custom/Spells/Passiva/passive_4001'}; |
| 1961 | + | [11] = {NAME = 'HUMANOIDES', IMG = '/images/custom/Spells/Passiva/passive_4005'}; |
| 1962 | + | [12] = {NAME = 'DIMENSIONAIS', IMG = '/images/custom/Spells/Passiva/passive_4012'}; |
| 1963 | + | } |
| 1964 | + | local BONUS_BUFF = { |
| 1965 | + | [01] = {TOOL = 'Municao infinita ate o proximo ServerSave.', IMG = '/images/custom/Items/10454'}; |
| 1966 | + | [02] = {TOOL = 'Potions infinita ate o proximo ServerSave.', IMG = '/images/custom/UI/Supreme_Health_Potion'}; |
| 1967 | + | } |
| 1968 | + | META_BAR = gameRootPanel:recursiveGetChildById('metaEscolhidos') |
| 1969 | + | META_PANEL = gameRootPanel:recursiveGetChildById('bonusEscolhidos') |
| 1970 | + | META_DESC = gameRootPanel:recursiveGetChildById('bonusEscolhidosDesc') |
| 1971 | + | PROGRESS_LABEL = gameRootPanel:recursiveGetChildById('labelEscolhidos') |
| 1972 | + | CLASS_IMG_1 = gameRootPanel:recursiveGetChildById('classe_1') |
| 1973 | + | CLASS_IMG_2 = gameRootPanel:recursiveGetChildById('classe_2') |
| 1974 | + | CLASS_IMG_3 = gameRootPanel:recursiveGetChildById('classe_3') |
| 1975 | + | ICON_IMG = gameRootPanel:recursiveGetChildById('iconImg12') |
| 1976 | + | |
| 1977 | + | META_BAR:setValue(QNT, 0, MAX) |
| 1978 | + | PROGRESS_LABEL:setText(QNT.. ' / ' ..MAX) |
| 1979 | + | if QNT >= META then |
| 1980 | + | META_BAR:setBackgroundColor("#2b8a44") |
| 1981 | + | PROGRESS_LABEL:setColor("#2b8a44") |
| 1982 | + | META_PANEL:setImageSource("/images/custom/Task/Monster_4") |
| 1983 | + | ICON_IMG:setImageSource(BONUS_BUFF[EVENTOS_TABLE[00].EVENT_UID_5].IMG) |
| 1984 | + | META_DESC:setText(tr('ATIVO').. ':\n\n' ..tr(BONUS_BUFF[EVENTOS_TABLE[00].EVENT_UID_5].TOOL)) |
| 1985 | + | else |
| 1986 | + | META_BAR:setBackgroundColor("white") |
| 1987 | + | PROGRESS_LABEL:setColor("white") |
| 1988 | + | META_PANEL:setImageSource("/images/custom/Task/Monster_1") |
| 1989 | + | ICON_IMG:setImageSource(BONUS_BUFF[EVENTOS_TABLE[00].EVENT_UID_5].IMG) |
| 1990 | + | META_DESC:setText(tr('NAO ATIVO').. ':\n\n' ..tr(BONUS_BUFF[EVENTOS_TABLE[00].EVENT_UID_5].TOOL)) |
| 1991 | + | end |
| 1992 | + | |
| 1993 | + | CLASS_IMG_1:setIcon(CLASSES_IMG[EVENTOS_TABLE[00].EVENT_UID_1].IMG) |
| 1994 | + | CLASS_IMG_2:setIcon(CLASSES_IMG[EVENTOS_TABLE[00].EVENT_UID_2].IMG) |
| 1995 | + | CLASS_IMG_3:setIcon(CLASSES_IMG[EVENTOS_TABLE[00].EVENT_UID_3].IMG) |
| 1996 | + | CLASS_IMG_1:setTooltip(tr(CLASSES_IMG[EVENTOS_TABLE[00].EVENT_UID_1].NAME)) |
| 1997 | + | CLASS_IMG_2:setTooltip(tr(CLASSES_IMG[EVENTOS_TABLE[00].EVENT_UID_2].NAME)) |
| 1998 | + | CLASS_IMG_3:setTooltip(tr(CLASSES_IMG[EVENTOS_TABLE[00].EVENT_UID_3].NAME)) |
| 1999 | + | CLASS_IMG_1:setIconSize('50 55') |
| 2000 | + | CLASS_IMG_2:setIconSize('50 55') |
| 2001 | + | CLASS_IMG_3:setIconSize('50 55') |
| 2002 | + | end |
| 2003 | + | else |
| 2004 | + | NO_EVENT_DESC = gameRootPanel:recursiveGetChildById('noEventDesc') |
| 2005 | + | if EVENTOS_TABLE[00].EVENT_UID_2 > EVENTOS_TABLE[EVENTOS_TABLE[00].EVENT_UID_1].DATA_INICIO then |
| 2006 | + | if EVENTOS_TABLE[00].EVENT_UID_1 == 12 then |
| 2007 | + | NO_EVENT_DESC:setText(tr('Nao ha nenhum evento ativo no momento.\n\nO proximo evento automatico sera').. ':\n\n\n[ ' ..tr(EVENTOS_TABLE[01].EVENT_NAME).. ' ]\n' ..EVENTOS_TABLE[01].DATA_DESC.. ' de ' ..EVENTOS_TABLE[01].MES_NAME) |
| 2008 | + | else |
| 2009 | + | NO_EVENT_DESC:setText(tr('Nao ha nenhum evento ativo no momento.\n\nO proximo evento automatico sera').. ':\n\n\n[ ' ..tr(EVENTOS_TABLE[EVENTOS_TABLE[00].EVENT_UID_1 + 01].EVENT_NAME).. ' ]\n' ..EVENTOS_TABLE[EVENTOS_TABLE[00].EVENT_UID_1 + 01].DATA_DESC.. ' de ' ..EVENTOS_TABLE[01].MES_NAME) |
| 2010 | + | end |
| 2011 | + | else |
| 2012 | + | NO_EVENT_DESC:setText(tr('Nao ha nenhum evento ativo no momento.\n\nO proximo evento automatico sera').. ':\n\n\n[ ' ..tr(EVENTOS_TABLE[EVENTOS_TABLE[00].EVENT_UID_1].EVENT_NAME).. ' ]\n' ..EVENTOS_TABLE[EVENTOS_TABLE[00].EVENT_UID_1].DATA_DESC.. ' de ' ..EVENTOS_TABLE[01].MES_NAME) |
| 2013 | + | end |
| 2014 | + | end |
| 2015 | + | |
| 2016 | + | EVENT_PANEL:show() |
| 2017 | + | end |
| 2018 | + | function onMobileWindow(id, type, subtype) |
| 2019 | + | if id == 01 then |
| 2020 | + | return SupMobile1 |
| 2021 | + | elseif id == 02 then |
| 2022 | + | return SupMobile2 |
| 2023 | + | elseif id == 03 then |
| 2024 | + | return SupMobile3 |
| 2025 | + | elseif id == 04 then |
| 2026 | + | return SkillMobile1 |
| 2027 | + | elseif id == 05 then |
| 2028 | + | return SkillMobile2 |
| 2029 | + | elseif id == 06 then |
| 2030 | + | return SkillMobile3 |
| 2031 | + | elseif id == 24 then |
| 2032 | + | return ClosedMenu |
| 2033 | + | elseif id == 101 then |
| 2034 | + | return ViewItems |
| 2035 | + | |
| 2036 | + | -- INVENTARIO |
| 2037 | + | elseif id == 07 then |
| 2038 | + | return MOBILE_AMULET |
| 2039 | + | elseif id == 08 then |
| 2040 | + | return MOBILE_HELMET |
| 2041 | + | elseif id == 09 then |
| 2042 | + | return MOBILE_BACKPACK |
| 2043 | + | elseif id == 10 then |
| 2044 | + | return MOBILE_GUN |
| 2045 | + | elseif id == 11 then |
| 2046 | + | return MOBILE_ARMOR |
| 2047 | + | elseif id == 12 then |
| 2048 | + | return MOBILE_GLOVE |
| 2049 | + | elseif id == 13 then |
| 2050 | + | return MOBILE_RING |
| 2051 | + | elseif id == 14 then |
| 2052 | + | return MOBILE_LEGS |
| 2053 | + | elseif id == 15 then |
| 2054 | + | return MOBILE_BOOTS |
| 2055 | + | elseif id == 82 then |
| 2056 | + | return MOBILE_INV_KARDS |
| 2057 | + | elseif id == 83 then |
| 2058 | + | return EXT_BACKPACK |
| 2059 | + | elseif id == 84 then |
| 2060 | + | if type then |
| 2061 | + | return gameRootPanel:recursiveGetChildById('Backpack_0' ..type) |
| 2062 | + | end |
| 2063 | + | elseif id == 85 then |
| 2064 | + | return MOBILE_INV_KARDS_IMG |
| 2065 | + | elseif id == 86 then |
| 2066 | + | return MOBILE_INV_KARDS_NAM |
| 2067 | + | elseif id == 87 then |
| 2068 | + | return MOBILE_INV_KARDS_STA |
| 2069 | + | elseif id == 88 then |
| 2070 | + | return MOBILE_INV_KARDS_STA |
| 2071 | + | elseif id == 89 then |
| 2072 | + | return MOBILE_SELECT_CLASS |
| 2073 | + | elseif id == 90 then |
| 2074 | + | return MOBILE_SELECT_FILTR |
| 2075 | + | elseif id == 91 then |
| 2076 | + | return MOBILE_SELECT_NEWSU |
| 2077 | + | elseif id == 92 then |
| 2078 | + | return MOBILE_SELECT_NEWIM |
| 2079 | + | elseif id == 93 then |
| 2080 | + | return MOBILE_SELECT_NEWIN |
| 2081 | + | elseif id == 94 then |
| 2082 | + | return MOBILE_SELECT_PROGR |
| 2083 | + | elseif id == 95 then |
| 2084 | + | return MOBILE_SELECT_LASTS |
| 2085 | + | elseif id == 96 then |
| 2086 | + | return MOBILE_SELECT_COUNT |
| 2087 | + | elseif id == 97 then |
| 2088 | + | return MOBILE_SELECT_NEXTS |
| 2089 | + | elseif id == 98 then |
| 2090 | + | return MOBILE_SELECT_EQUIP |
| 2091 | + | elseif id == 99 then |
| 2092 | + | return MOBILE_SELECT_KARDS |
| 2093 | + | |
| 2094 | + | -- UI |
| 2095 | + | elseif id == 16 then |
| 2096 | + | return EQUIPAMENT |
| 2097 | + | elseif id == 17 then |
| 2098 | + | return EQUIP_SCROLL |
| 2099 | + | elseif id == 18 then |
| 2100 | + | return EQUIP_LIST |
| 2101 | + | elseif id == 19 then |
| 2102 | + | return SKILLBAR |
| 2103 | + | elseif id == 20 then |
| 2104 | + | return OPEN_BACKPACK |
| 2105 | + | elseif id == 21 then |
| 2106 | + | if type then |
| 2107 | + | return gameRootPanel:recursiveGetChildById('Bag' ..type) |
| 2108 | + | end |
| 2109 | + | elseif id == 22 then |
| 2110 | + | return BACK_SCROLL |
| 2111 | + | elseif id == 23 then |
| 2112 | + | return BACK_LIST |
| 2113 | + | |
| 2114 | + | -- STATUS |
| 2115 | + | elseif id == 25 then |
| 2116 | + | return STATUS |
| 2117 | + | elseif id == 26 then |
| 2118 | + | return STATUS_SCROLL |
| 2119 | + | elseif id == 27 then |
| 2120 | + | return STATUS_LIST |
| 2121 | + | elseif id == 28 then |
| 2122 | + | return MOBILE_MAESTRIA |
| 2123 | + | elseif id == 29 then |
| 2124 | + | return MOBILE_ESPECIALISTA |
| 2125 | + | elseif id == 30 then |
| 2126 | + | return MOBILE_STATUS_HP |
| 2127 | + | elseif id == 31 then |
| 2128 | + | return MOBILE_STATUS_ATK |
| 2129 | + | elseif id == 32 then |
| 2130 | + | return MOBILE_STATUS_DEF |
| 2131 | + | elseif id == 33 then |
| 2132 | + | return MOBILE_STATUS_ESQ |
| 2133 | + | elseif id == 34 then |
| 2134 | + | return |
| 2135 | + | elseif id == 35 then |
| 2136 | + | return MOBILE_STATUS_TAX |
| 2137 | + | elseif id == 36 then |
| 2138 | + | return MOBILE_STATUS_CRI |
| 2139 | + | elseif id == 37 then |
| 2140 | + | return MOBILE_STATUS_PEN |
| 2141 | + | elseif id == 100 then |
| 2142 | + | return MOBILE_STATUS_PVP |
| 2143 | + | elseif id == 102 then |
| 2144 | + | return |
| 2145 | + | elseif id == 103 then |
| 2146 | + | return |
| 2147 | + | elseif id == 104 then |
| 2148 | + | return |
| 2149 | + | elseif id == 105 then |
| 2150 | + | return |
| 2151 | + | elseif id == 106 then |
| 2152 | + | return |
| 2153 | + | elseif id == 107 then |
| 2154 | + | return |
| 2155 | + | elseif id == 108 then |
| 2156 | + | return MOBILE_STATUS_FIRE |
| 2157 | + | elseif id == 109 then |
| 2158 | + | return MOBILE_STATUS_ICE |
| 2159 | + | elseif id == 110 then |
| 2160 | + | return MOBILE_STATUS_ENERGY |
| 2161 | + | elseif id == 111 then |
| 2162 | + | return MOBILE_STATUS_EARTH |
| 2163 | + | elseif id == 112 then |
| 2164 | + | return MOBILE_STATUS_DEATH |
| 2165 | + | elseif id == 113 then |
| 2166 | + | return MOBILE_STATUS_METRA |
| 2167 | + | elseif id == 114 then |
| 2168 | + | return MOBILE_STATUS_RIFLE |
| 2169 | + | elseif id == 115 then |
| 2170 | + | return MOBILE_STATUS_PISTO |
| 2171 | + | elseif id == 116 then |
| 2172 | + | return MOBILE_STATUS_ESPIN |
| 2173 | + | elseif id == 117 then |
| 2174 | + | return MOBILE_LABEL_DIST |
| 2175 | + | elseif id == 118 then |
| 2176 | + | return ACTIVE_MOBILE_LIST |
| 2177 | + | elseif id == 119 then |
| 2178 | + | return MOBILE_PASSIVE_1 |
| 2179 | + | elseif id == 120 then |
| 2180 | + | return MOBILE_PASSIVE_2 |
| 2181 | + | elseif id == 121 then |
| 2182 | + | return MOBILE_PASSIVE_3 |
| 2183 | + | elseif id == 122 then |
| 2184 | + | return MOBILE_PASSIVE_4 |
| 2185 | + | elseif id == 123 then |
| 2186 | + | return MOBILE_PASSIVE_5 |
| 2187 | + | elseif id == 124 then |
| 2188 | + | return MOBILE_PASSIVE_6 |
| 2189 | + | elseif id == 125 then |
| 2190 | + | return ACTIVE_MOBILE_RANK |
| 2191 | + | elseif id == 126 then |
| 2192 | + | return ACTIVE_MOBILE_FILTRO_RANK |
| 2193 | + | elseif id == 127 then |
| 2194 | + | return FENDA_MOBILE_PANEL |
| 2195 | + | elseif id == 128 then |
| 2196 | + | return KARD_MOBILE_PANEL_OFF |
| 2197 | + | elseif id == 129 then |
| 2198 | + | return KARD_MOBILE_PANEL_ON |
| 2199 | + | elseif id == 130 then |
| 2200 | + | return COLISEU_MOBILE_PANEL_OFF |
| 2201 | + | elseif id == 131 then |
| 2202 | + | return COLISEU_MOBILE_PANEL_ON |
| 2203 | + | elseif id == 132 then |
| 2204 | + | return MOBILE_EVENT_1 |
| 2205 | + | elseif id == 133 then |
| 2206 | + | return MOBILE_EVENT_2 |
| 2207 | + | elseif id == 134 then |
| 2208 | + | return MOBILE_EVENT_3 |
| 2209 | + | elseif id == 135 then |
| 2210 | + | return MOBILE_EVENT_4 |
| 2211 | + | elseif id == 136 then |
| 2212 | + | return MOBILE_EVENT_5 |
| 2213 | + | elseif id == 137 then |
| 2214 | + | return MOBILE_EVENT_6 |
| 2215 | + | elseif id == 138 then |
| 2216 | + | return MOBILE_EVENT_7 |
| 2217 | + | elseif id == 139 then |
| 2218 | + | return MOBILE_EVENT_8 |
| 2219 | + | elseif id == 140 then |
| 2220 | + | return MOBILE_EVENT_9 |
| 2221 | + | elseif id == 141 then |
| 2222 | + | return MOBILE_EVENT_10 |
| 2223 | + | elseif id == 142 then |
| 2224 | + | return MOBILE_EVENT_11 |
| 2225 | + | elseif id == 143 then |
| 2226 | + | return MOBILE_EVENT_12 |
| 2227 | + | elseif id == 144 then |
| 2228 | + | return MOBILE_PLAY_ON |
| 2229 | + | elseif id == 145 then |
| 2230 | + | return MOBILE_CRIPTOMOEDA |
| 2231 | + | elseif id == 146 then |
| 2232 | + | return PAYMENT_METH_PANEL |
| 2233 | + | elseif id == 147 then |
| 2234 | + | return REQUEST_PAY_PANEL |
| 2235 | + | elseif id == 148 then |
| 2236 | + | return REQUEST_STEP_1 |
| 2237 | + | elseif id == 149 then |
| 2238 | + | return REQUEST_STEP_2 |
| 2239 | + | elseif id == 150 then |
| 2240 | + | return REQUEST_STEP_3 |
| 2241 | + | elseif id == 151 then |
| 2242 | + | return MOBILE_EVENT_0 |
| 2243 | + | elseif id == 152 then |
| 2244 | + | return MOBILE_TXT_PASSIVE_1 |
| 2245 | + | elseif id == 153 then |
| 2246 | + | return MOBILE_TXT_PASSIVE_2 |
| 2247 | + | elseif id == 154 then |
| 2248 | + | return MOBILE_TXT_PASSIVE_3 |
| 2249 | + | elseif id == 155 then |
| 2250 | + | return MOBILE_TXT_PASSIVE_4 |
| 2251 | + | elseif id == 156 then |
| 2252 | + | return MOBILE_TXT_PASSIVE_5 |
| 2253 | + | elseif id == 157 then |
| 2254 | + | return MOBILE_TXT_PASSIVE_6 |
| 2255 | + | |
| 2256 | + | -- QUEST |
| 2257 | + | elseif id == 39 then |
| 2258 | + | return QUEST |
| 2259 | + | elseif id == 40 then |
| 2260 | + | return QUEST_SCROLL |
| 2261 | + | elseif id == 41 then |
| 2262 | + | return QUEST_LIST |
| 2263 | + | elseif id == 42 then |
| 2264 | + | if type then |
| 2265 | + | return gameRootPanel:recursiveGetChildById('MOBILE_Q_' ..type) |
| 2266 | + | end |
| 2267 | + | elseif id == 43 then |
| 2268 | + | return QUEST_LOAD |
| 2269 | + | elseif id == 44 then |
| 2270 | + | return QUEST_TITLE |
| 2271 | + | elseif id == 45 then |
| 2272 | + | return QUEST_RASTREAR |
| 2273 | + | elseif id == 46 then |
| 2274 | + | return QUEST_DETALHES |
| 2275 | + | elseif id == 47 then |
| 2276 | + | return QUEST_PROGRESS |
| 2277 | + | elseif id == 51 then |
| 2278 | + | return QUEST_ID_DETALHES |
| 2279 | + | |
| 2280 | + | -- BLACKLIST |
| 2281 | + | elseif id == 48 then |
| 2282 | + | return BLACKLIST |
| 2283 | + | elseif id == 49 then |
| 2284 | + | return BLACKLIST_SCROLL |
| 2285 | + | elseif id == 50 then |
| 2286 | + | return BLACKLIST_LIST |
| 2287 | + | elseif id == 57 then |
| 2288 | + | return BLACKLIST_RANK_NAME |
| 2289 | + | elseif id == 52 then |
| 2290 | + | return BLACKLIST_PROGRESS |
| 2291 | + | elseif id == 53 then |
| 2292 | + | return BLACKLIST_NEXT |
| 2293 | + | elseif id == 54 then |
| 2294 | + | return BLACKLIST_BACK |
| 2295 | + | elseif id == 55 then |
| 2296 | + | if type then |
| 2297 | + | return gameRootPanel:recursiveGetChildById('Task_' ..type) |
| 2298 | + | end |
| 2299 | + | elseif id == 56 then |
| 2300 | + | if type then |
| 2301 | + | return gameRootPanel:recursiveGetChildById('ImgTask' ..type) |
| 2302 | + | end |
| 2303 | + | elseif id == 58 then |
| 2304 | + | return BLACKLIST_WHITE |
| 2305 | + | elseif id == 59 then |
| 2306 | + | return BLACKLIST_YELLOW |
| 2307 | + | elseif id == 60 then |
| 2308 | + | return BLACKLIST_BLUE |
| 2309 | + | |
| 2310 | + | -- SHOP |
| 2311 | + | elseif id == 61 then |
| 2312 | + | return SHOP_WINDOW |
| 2313 | + | elseif id == 62 then |
| 2314 | + | return SHOP_SELECT |
| 2315 | + | elseif id == 63 then |
| 2316 | + | return VipLabel |
| 2317 | + | elseif id == 64 then |
| 2318 | + | return OnlineLabel |
| 2319 | + | elseif id == 65 then |
| 2320 | + | return PVPLabel |
| 2321 | + | elseif id == 66 then |
| 2322 | + | return VipLabelSelect |
| 2323 | + | elseif id == 67 then |
| 2324 | + | return OnlineLabelSelect |
| 2325 | + | elseif id == 68 then |
| 2326 | + | return PVPLabelSelect |
| 2327 | + | elseif id == 80 then |
| 2328 | + | if type and subtype then |
| 2329 | + | return gameRootPanel:recursiveGetChildById(type.. "" ..subtype) |
| 2330 | + | else |
| 2331 | + | return gameRootPanel:recursiveGetChildById(type) |
| 2332 | + | end |
| 2333 | + | |
| 2334 | + | elseif id == 38 then |
| 2335 | + | return gameLeftActions |
| 2336 | + | end |
| 2337 | + | end |
| 2338 | + | function onMobileExecute(id, value) |
| 2339 | + | if id == 01 then -- CARREGA MISS�ES |
| 2340 | + | local QuestCheck = 00 |
| 2341 | + | for Q = 01, modules.game_database.getMaxQuest() do |
| 2342 | + | QUEST_ID = gameRootPanel:recursiveGetChildById('MOBILE_Q_' ..Q) |
| 2343 | + | if QUEST_ID then |
| 2344 | + | QUEST_ID:destroy() |
| 2345 | + | end |
| 2346 | + | end |
| 2347 | + | for X = 01, modules.game_database.getMaxQuest() do |
| 2348 | + | if modules.game_database.getQuestInfo(X, 10) == false then |
| 2349 | + | if modules.game_database.getQuestInfo(X, 00) > 0 and modules.game_database.getQuestInfo(X, 00) < 100 then |
| 2350 | + | local posQuest = X |
| 2351 | + | Quest = g_ui.createWidget('UIButton', QUEST_LIST) |
| 2352 | + | Quest:setId('MOBILE_Q_' ..X) |
| 2353 | + | Quest:setMarginTop(05) |
| 2354 | + | Quest:setImageSource("/images/custom/Task/Monster_1") |
| 2355 | + | Quest.onHoverChange = function(widget, hoverState) |
| 2356 | + | if hoverState then |
| 2357 | + | widget:setImageSource("/images/custom/Task/Monster_3") |
| 2358 | + | else |
| 2359 | + | widget:setImageSource("/images/custom/Task/Monster_1") |
| 2360 | + | end |
| 2361 | + | end |
| 2362 | + | Quest.onClick = function() |
| 2363 | + | if Novato == 03 then |
| 2364 | + | modules.game_alert.onShowTutor(04) |
| 2365 | + | Novato = 4 |
| 2366 | + | end |
| 2367 | + | onMobileExecute(02, posQuest) |
| 2368 | + | end |
| 2369 | + | |
| 2370 | + | TextQuest = g_ui.createWidget('UIButton', Quest) |
| 2371 | + | TextQuest:setId('TitleQuest') |
| 2372 | + | TextQuest:setSize({width = 175, height = 15}) |
| 2373 | + | TextQuest:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2374 | + | TextQuest:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 2375 | + | TextQuest:setTextAlign(AlignLeft) |
| 2376 | + | TextQuest:setPhantom(true) |
| 2377 | + | TextQuest:setTextWrap(true) |
| 2378 | + | TextQuest:setMarginTop(08) |
| 2379 | + | TextQuest:setMarginLeft(15) |
| 2380 | + | TextQuest:setFont('verdana-11px-antialised') |
| 2381 | + | TextQuest:setText(tr(modules.game_database.getQuestInfo(X, 01))) |
| 2382 | + | |
| 2383 | + | InfoQuest = g_ui.createWidget('UIButton', Quest) |
| 2384 | + | InfoQuest:setSize({width = 175, height = 15}) |
| 2385 | + | InfoQuest:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2386 | + | InfoQuest:addAnchor(AnchorTop, 'TitleQuest', AnchorBottom) |
| 2387 | + | InfoQuest:setTextAlign(AlignLeft) |
| 2388 | + | InfoQuest:setPhantom(true) |
| 2389 | + | InfoQuest:setTextWrap(true) |
| 2390 | + | InfoQuest:setMarginTop(01) |
| 2391 | + | InfoQuest:setMarginLeft(15) |
| 2392 | + | InfoQuest:setFont('lucida-11px-rounded') |
| 2393 | + | InfoQuest:setColor(modules.game_database.getQuestInfo(X, 13)) |
| 2394 | + | InfoQuest:setText(tr(modules.game_database.getQuestInfo(X, 12))) |
| 2395 | + | |
| 2396 | + | QuestCheck = QuestCheck + 1 |
| 2397 | + | end |
| 2398 | + | end |
| 2399 | + | end |
| 2400 | + | end |
| 2401 | + | if id == 02 then -- VISUALIZA UMA MISSAO |
| 2402 | + | for Q = 01, modules.game_database.getMaxQuest() do |
| 2403 | + | QUEST_ID = gameRootPanel:recursiveGetChildById('MOBILE_Q_' ..Q) |
| 2404 | + | if QUEST_ID then |
| 2405 | + | QUEST_ID:destroy() |
| 2406 | + | end |
| 2407 | + | end |
| 2408 | + | if value > 0 then |
| 2409 | + | QUEST_ID_DETALHES:setVisible(true) |
| 2410 | + | QUEST_TITLE:setVisible(true) |
| 2411 | + | QUEST_RASTREAR:setVisible(true) |
| 2412 | + | QUEST_DETALHES:setVisible(true) |
| 2413 | + | QUEST_REWARDS:setVisible(true) |
| 2414 | + | |
| 2415 | + | QUEST_TITLE:setText(tr(modules.game_database.getQuestInfo(value, 01))) |
| 2416 | + | QUEST_DETALHES:setText(tr(modules.game_database.getQuestInfo(value, 02))) |
| 2417 | + | QUEST_REWARDS:setText(tr("RECOMPENSA").. ":\n" ..modules.game_database.getQuestInfo(value, 03)) |
| 2418 | + | local TYPE = modules.game_database.getQuestInfo(value, 11) |
| 2419 | + | if TYPE == "HUNT" or TYPE == "ITEMS" then |
| 2420 | + | local Atl = modules.game_database.getQuestInfo(value, 06) |
| 2421 | + | local Max = modules.game_database.getQuestInfo(value, 07) |
| 2422 | + | local QuestValue = modules.game_database.getQuestInfo(value, 00) |
| 2423 | + | local BAR = modules.game_database.getQuestInfo(value, 09, QuestValue) |
| 2424 | + | if BAR == "SHOW" then |
| 2425 | + | QUEST_PROGRESS:show() |
| 2426 | + | QUEST_PROGRESS:setText(Atl.. ' / ' ..Max) |
| 2427 | + | QUEST_PROGRESS:setValue(Atl, 0, Max) |
| 2428 | + | end |
| 2429 | + | else |
| 2430 | + | QUEST_PROGRESS:hide() |
| 2431 | + | end |
| 2432 | + | QUEST_RASTREAR.onClick = function() |
| 2433 | + | local QuestValue = modules.game_database.getQuestInfo(value, 00) |
| 2434 | + | local DESC = tr("Objetivo da Quest").. "\n[ " ..modules.game_database.getQuestInfo(value, 01).. " ]" |
| 2435 | + | for X_POS = 01, modules.game_database.getQuestInfo(value, 08, QuestValue) do |
| 2436 | + | local Qnt = X_POS |
| 2437 | + | local POS = modules.game_database.getQuestInfo(value, 04, QuestValue, X_POS) |
| 2438 | + | modules.game_minimap.onRastrearQuest(POS, DESC, Qnt) |
| 2439 | + | end |
| 2440 | + | |
| 2441 | + | if Novato == 04 then |
| 2442 | + | modules.game_alert.onShowTutor(05) |
| 2443 | + | Novato = 5 |
| 2444 | + | end |
| 2445 | + | |
| 2446 | + | modules.game_menu.CloseAllMobileWindow() |
| 2447 | + | modules.game_menu.mobileQuestShow() |
| 2448 | + | g_game.talk(g_game.talk("!inventario 27")) |
| 2449 | + | end |
| 2450 | + | return |
| 2451 | + | end |
| 2452 | + | end |
| 2453 | + | if id == 03 then -- STATUS |
| 2454 | + | local localPlayer = g_game.getLocalPlayer() |
| 2455 | + | local MAESTRIA_TYPE = modules.game_database.getMaestriaEsp(00) |
| 2456 | + | if MAESTRIA_TYPE < 0 then MAESTRIA_TYPE = 0 end |
| 2457 | + | local ESPECIALISTA_TYPE = modules.game_database.getMaestriaEsp(01) |
| 2458 | + | if ESPECIALISTA_TYPE < 0 then ESPECIALISTA_TYPE = 0 end |
| 2459 | + | |
| 2460 | + | MOBILE_MAESTRIA:setTooltip('') |
| 2461 | + | MOBILE_ESPECIALISTA:setTooltip('') |
| 2462 | + | if MAESTRIA_TYPE > 0 then |
| 2463 | + | local MAESTRIA_LEVEL = modules.game_database.getMaestriaEsp(02) |
| 2464 | + | if MAESTRIA_LEVEL < 0 then MAESTRIA_LEVEL = 0 end |
| 2465 | + | if MAESTRIA_LEVEL < 5 then |
| 2466 | + | MOBILE_MAESTRIA:setText(tr('Maestria Nv.').. ' ' ..MAESTRIA_LEVEL.. "\n" ..GET_MAESTRIA[MAESTRIA_TYPE][00]) |
| 2467 | + | else |
| 2468 | + | MOBILE_MAESTRIA:setText(tr('Maestria Nv.').. ' ' ..MAESTRIA_LEVEL.. "\n" ..GET_MAESTRIA[MAESTRIA_TYPE][00]) |
| 2469 | + | end |
| 2470 | + | else |
| 2471 | + | MOBILE_MAESTRIA:setText(tr('Maestria:\nBloqueado')) |
| 2472 | + | end |
| 2473 | + | if ESPECIALISTA_TYPE > 0 then |
| 2474 | + | local ESPECIALISTA_LEVEL = modules.game_database.getMaestriaEsp(03) |
| 2475 | + | if ESPECIALISTA_LEVEL < 0 then ESPECIALISTA_LEVEL = 0 end |
| 2476 | + | if ESPECIALISTA_LEVEL < 6 then |
| 2477 | + | MOBILE_ESPECIALISTA:setText(tr('Especialista Nv.').. ' ' ..ESPECIALISTA_LEVEL.. "\n" ..GET_ESPECIALISTA[ESPECIALISTA_TYPE][00]) |
| 2478 | + | else |
| 2479 | + | MOBILE_ESPECIALISTA:setText(tr('Especialista Nv.').. ' ' ..ESPECIALISTA_LEVEL.. "\n" ..GET_ESPECIALISTA[ESPECIALISTA_TYPE][00]) |
| 2480 | + | end |
| 2481 | + | else |
| 2482 | + | MOBILE_ESPECIALISTA:setText(tr('Especialista:\nBloqueado')) |
| 2483 | + | end |
| 2484 | + | |
| 2485 | + | MOBILE_STATUS_DEF:setText(modules.game_database.getStatus(01)) |
| 2486 | + | MOBILE_STATUS_FIRE:setText(modules.game_database.getStatus(08).. "%") |
| 2487 | + | MOBILE_STATUS_ICE:setText(modules.game_database.getStatus(09).. "%") |
| 2488 | + | MOBILE_STATUS_ENERGY:setText(modules.game_database.getStatus(10).. "%") |
| 2489 | + | MOBILE_STATUS_EARTH:setText(modules.game_database.getStatus(11).. "%") |
| 2490 | + | MOBILE_STATUS_DEATH:setText(modules.game_database.getStatus(12).. "%") |
| 2491 | + | MOBILE_STATUS_TAX:setText(modules.game_database.getStatus(04).. "%") |
| 2492 | + | MOBILE_STATUS_PEN:setText(modules.game_database.getStatus(06).. "%") |
| 2493 | + | MOBILE_STATUS_PVP:setText(modules.game_database.getStatus(07)) |
| 2494 | + | |
| 2495 | + | modules.game_menu.onStatusCheck() |
| 2496 | + | end |
| 2497 | + | if id == 04 then -- ACTIVE (LIST) |
| 2498 | + | ACTIVE_MOBILE_LIST:show() |
| 2499 | + | end |
| 2500 | + | if id == 05 then -- ACTIVE (HALL OF FAME) |
| 2501 | + | ACTIVE_MOBILE_FILTRO_RANK:setOption("Level", "00") |
| 2502 | + | ACTIVE_MOBILE_FILTRO_RANK.onOptionChange = onMobileChangeRankSortType |
| 2503 | + | ACTIVE_MOBILE_RANK:show() |
| 2504 | + | end |
| 2505 | + | if id == 06 then -- ACTIVE (FENDAS) |
| 2506 | + | FENDA_MOBILE_PANEL:show() |
| 2507 | + | end |
| 2508 | + | if id == 07 then -- ACTIVE (SHOP) |
| 2509 | + | for X = 01, modules.game_menu.onTableShop(16) do |
| 2510 | + | SHOP_OFFERT = gameRootPanel:recursiveGetChildById('OfertaLabel_' ..X) |
| 2511 | + | SHOP_OFFERT:setVisible(false) |
| 2512 | + | for INDEX = 01, modules.game_menu.onTableShop(17, X) do |
| 2513 | + | if modules.game_menu.onTableShop(09, X, INDEX) > 00 then |
| 2514 | + | SHOP_OFFERT:setVisible(true) |
| 2515 | + | break |
| 2516 | + | elseif modules.game_menu.onTableShop(12, X, INDEX) > 00 then |
| 2517 | + | SHOP_OFFERT:setVisible(true) |
| 2518 | + | break |
| 2519 | + | elseif modules.game_menu.onTableShop(15, X, INDEX) > 00 then |
| 2520 | + | SHOP_OFFERT:setVisible(true) |
| 2521 | + | break |
| 2522 | + | end |
| 2523 | + | end |
| 2524 | + | end |
| 2525 | + | |
| 2526 | + | modules.game_menu.closer_boxShop() |
| 2527 | + | PremiumLabel.onClick = function() onMobileShopSelect(01) end |
| 2528 | + | ConsumiveisLabel.onClick = function() onMobileShopSelect(02) end |
| 2529 | + | BuffLabel.onClick = function() onMobileShopSelect(03) end |
| 2530 | + | ServicosLabel.onClick = function() onMobileShopSelect(04) end |
| 2531 | + | EspecialLabel.onClick = function() onMobileShopSelect(05) end |
| 2532 | + | FerramentasLabel.onClick = function() onMobileShopSelect(06) end |
| 2533 | + | OutfitLabel.onClick = function() onMobileShopSelect(07) end |
| 2534 | + | MontariaLabel.onClick = function() onMobileShopSelect(08) end |
| 2535 | + | BackpackLabel.onClick = function() onMobileShopSelect(09) end |
| 2536 | + | KardLabel.onClick = function() onMobileShopSelect(10) end |
| 2537 | + | ExtensoesLabel.onClick = function() onMobileShopSelect(11) end |
| 2538 | + | WarzoneLabel.onClick = function() onMobileShopSelect(12) end |
| 2539 | + | SHOP_WINDOW:show() |
| 2540 | + | end |
| 2541 | + | end |
| 2542 | + | function onMobileShopHome() |
| 2543 | + | SHOP_SELECT:hide() |
| 2544 | + | modules.game_menu.closer_boxShop() |
| 2545 | + | SHOP_WINDOW:show() |
| 2546 | + | end |
| 2547 | + | function onMobileShopSelect(cat) |
| 2548 | + | SHOP_WINDOW:hide() |
| 2549 | + | local MAX_PRODUCT_IN_SHOP = 99 |
| 2550 | + | |
| 2551 | + | for _SHOP = 01, MAX_PRODUCT_IN_SHOP do |
| 2552 | + | SHOP_OFFERT = gameRootPanel:recursiveGetChildById('offertShop_' .._SHOP) |
| 2553 | + | if SHOP_OFFERT then |
| 2554 | + | SHOP_OFFERT:destroy() |
| 2555 | + | else |
| 2556 | + | break |
| 2557 | + | end |
| 2558 | + | end |
| 2559 | + | for X = 01, modules.game_menu.onTableShop(17, cat) do |
| 2560 | + | if modules.game_menu.onTableShop(18, cat, X) then |
| 2561 | + | local CatIndex = cat..'-' ..X |
| 2562 | + | SHOP_SELECT_DESC:setText(tr(modules.game_menu.onTableShop(02, cat, 00))) |
| 2563 | + | |
| 2564 | + | SHOP_OFFERT = g_ui.createWidget('UIButton', SHOP_SELECT_PANEL) |
| 2565 | + | SHOP_OFFERT:setId('offertShop_' ..X) |
| 2566 | + | SHOP_OFFERT:setImageSource("/images/custom/Shop/OfferPanel") |
| 2567 | + | SHOP_OFFERT:setOpacity('0.8') |
| 2568 | + | SHOP_OFFERT:setMarginTop(05) |
| 2569 | + | SHOP_OFFERT.onHoverChange = function(widget, hoverState) |
| 2570 | + | if hoverState then |
| 2571 | + | widget:setOpacity('1.0') |
| 2572 | + | else |
| 2573 | + | widget:setOpacity('0.8') |
| 2574 | + | end |
| 2575 | + | end |
| 2576 | + | |
| 2577 | + | SHOP_OFFERT_LABEL = g_ui.createWidget('UIButton', SHOP_OFFERT) |
| 2578 | + | SHOP_OFFERT_LABEL:setSize({width = 42, height = 15}) |
| 2579 | + | SHOP_OFFERT_LABEL:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 2580 | + | SHOP_OFFERT_LABEL:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2581 | + | SHOP_OFFERT_LABEL:setImageSource("/images/custom/Shop/OfertaLabel") |
| 2582 | + | SHOP_OFFERT_LABEL:setMarginTop(05) |
| 2583 | + | SHOP_OFFERT_LABEL:setMarginLeft(05) |
| 2584 | + | SHOP_OFFERT_LABEL:setPhantom(true) |
| 2585 | + | |
| 2586 | + | SHOP_ITEM_IMG = g_ui.createWidget('UIButton', SHOP_OFFERT) |
| 2587 | + | SHOP_ITEM_IMG:setPhantom(true) |
| 2588 | + | if modules.game_menu.onTableShop(04, cat, X) then |
| 2589 | + | SHOP_ITEM_IMG:setSize({width = 32, height = 32}) |
| 2590 | + | SHOP_ITEM_IMG:setImageSource("/images/custom/Shop/" ..cat.. "-" ..X) |
| 2591 | + | SHOP_ITEM_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2592 | + | SHOP_ITEM_IMG:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 2593 | + | SHOP_ITEM_IMG:setMarginLeft(45) |
| 2594 | + | SHOP_ITEM_IMG:setMarginTop(30) |
| 2595 | + | else |
| 2596 | + | SHOP_ITEM_IMG:setSize({width = 64, height = 64}) |
| 2597 | + | SHOP_ITEM_IMG:setImageSource("/images/custom/Shop/" ..cat.. "-" ..X) |
| 2598 | + | SHOP_ITEM_IMG:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2599 | + | SHOP_ITEM_IMG:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 2600 | + | SHOP_ITEM_IMG:setMarginLeft(35) |
| 2601 | + | SHOP_ITEM_IMG:setMarginTop(10) |
| 2602 | + | end |
| 2603 | + | |
| 2604 | + | SHOP_ITEM_NAME = g_ui.createWidget('UIButton', SHOP_OFFERT) |
| 2605 | + | SHOP_ITEM_NAME:setSize({width = 10, height = 30}) |
| 2606 | + | SHOP_ITEM_NAME:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2607 | + | SHOP_ITEM_NAME:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 2608 | + | SHOP_ITEM_NAME:addAnchor(AnchorTop, 'parent', AnchorTop) |
| 2609 | + | SHOP_ITEM_NAME:setFont('lucida-11px-rounded') |
| 2610 | + | SHOP_ITEM_NAME:setMarginLeft(05) |
| 2611 | + | SHOP_ITEM_NAME:setMarginRight(05) |
| 2612 | + | SHOP_ITEM_NAME:setMarginTop(75) |
| 2613 | + | SHOP_ITEM_NAME:setPhantom(true) |
| 2614 | + | SHOP_ITEM_NAME:setTextWrap(true) |
| 2615 | + | SHOP_ITEM_NAME:setText(tr(modules.game_menu.onTableShop(01, cat, X))) |
| 2616 | + | |
| 2617 | + | SHOP_PRICE_ONE = g_ui.createWidget('UIButton', SHOP_OFFERT) |
| 2618 | + | SHOP_PRICE_ONE:setSize({width = 10, height = 20}) |
| 2619 | + | SHOP_PRICE_ONE:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2620 | + | SHOP_PRICE_ONE:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 2621 | + | SHOP_PRICE_ONE:addAnchor(AnchorBottom, 'parent', AnchorBottom) |
| 2622 | + | SHOP_PRICE_ONE:setImageSource("/images/custom/Shop/buyBt_3") |
| 2623 | + | SHOP_PRICE_ONE:setFont('lucida-11px-rounded') |
| 2624 | + | SHOP_PRICE_ONE:setMarginLeft(05) |
| 2625 | + | SHOP_PRICE_ONE:setMarginRight(05) |
| 2626 | + | SHOP_PRICE_ONE:setMarginBottom(05) |
| 2627 | + | SHOP_PRICE_ONE:setTextWrap(true) |
| 2628 | + | SHOP_PRICE_ONE:setPhantom(true) |
| 2629 | + | |
| 2630 | + | if modules.game_menu.onTableShop(09, cat, X) > 00 then |
| 2631 | + | SHOP_PRICE_ONE:setText(modules.game_menu.onTableShop(09, cat, X)) |
| 2632 | + | SHOP_OFFERT_LABEL:setVisible(true) |
| 2633 | + | ITEM_PRICE_ONE = modules.game_menu.onTableShop(09, cat, X) |
| 2634 | + | else |
| 2635 | + | SHOP_PRICE_ONE:setText(modules.game_menu.onTableShop(08, cat, X)) |
| 2636 | + | SHOP_OFFERT_LABEL:setVisible(false) |
| 2637 | + | ITEM_PRICE_ONE = modules.game_menu.onTableShop(08, cat, X) |
| 2638 | + | end |
| 2639 | + | if modules.game_menu.onTableShop(10, cat, X) or modules.game_menu.onTableShop(13, cat, X) then |
| 2640 | + | SHOP_PRICE_TWO = g_ui.createWidget('UIButton', SHOP_OFFERT) |
| 2641 | + | SHOP_PRICE_TWO:setSize({width = 10, height = 20}) |
| 2642 | + | SHOP_PRICE_TWO:addAnchor(AnchorLeft, 'parent', AnchorLeft) |
| 2643 | + | SHOP_PRICE_TWO:addAnchor(AnchorRight, 'parent', AnchorRight) |
| 2644 | + | SHOP_PRICE_TWO:addAnchor(AnchorBottom, 'parent', AnchorBottom) |
| 2645 | + | SHOP_PRICE_TWO:setFont('lucida-11px-rounded') |
| 2646 | + | SHOP_PRICE_TWO:setMarginLeft(05) |
| 2647 | + | SHOP_PRICE_TWO:setMarginRight(05) |
| 2648 | + | SHOP_PRICE_TWO:setMarginBottom(28) |
| 2649 | + | SHOP_PRICE_TWO:setTextWrap(true) |
| 2650 | + | SHOP_PRICE_TWO:setPhantom(true) |
| 2651 | + | |
| 2652 | + | if modules.game_menu.onTableShop(10, cat, X) then |
| 2653 | + | SHOP_PRICE_TWO:setImageSource("/images/custom/Shop/buyBt_2") |
| 2654 | + | ITEM_TWO_TYPE = 02 |
| 2655 | + | if modules.game_menu.onTableShop(12, cat, X) > 00 then |
| 2656 | + | SHOP_PRICE_TWO:setText(modules.game_menu.onTableShop(12, cat, X)) |
| 2657 | + | ITEM_PRICE_TWO = modules.game_menu.onTableShop(12, cat, X) |
| 2658 | + | if not SHOP_OFFERT_LABEL:isVisible() then |
| 2659 | + | SHOP_OFFERT_LABEL:setVisible(true) |
| 2660 | + | end |
| 2661 | + | else |
| 2662 | + | SHOP_PRICE_TWO:setText(modules.game_menu.onTableShop(11, cat, X)) |
| 2663 | + | ITEM_PRICE_TWO = modules.game_menu.onTableShop(11, cat, X) |
| 2664 | + | end |
| 2665 | + | else |
| 2666 | + | SHOP_PRICE_TWO:setImageSource("/images/custom/Shop/buyBt_1") |
| 2667 | + | ITEM_TWO_TYPE = 01 |
| 2668 | + | if modules.game_menu.onTableShop(15, cat, X) > 00 then |
| 2669 | + | SHOP_PRICE_TWO:setText(modules.game_menu.onTableShop(15, cat, X)) |
| 2670 | + | ITEM_PRICE_TWO = modules.game_menu.onTableShop(15, cat, X) |
| 2671 | + | if not SHOP_OFFERT_LABEL:isVisible() then |
| 2672 | + | SHOP_OFFERT_LABEL:setVisible(true) |
| 2673 | + | end |
| 2674 | + | else |
| 2675 | + | SHOP_PRICE_TWO:setText(modules.game_menu.onTableShop(14, cat, X)) |
| 2676 | + | ITEM_PRICE_TWO = modules.game_menu.onTableShop(14, cat, X) |
| 2677 | + | end |
| 2678 | + | end |
| 2679 | + | end |
| 2680 | + | SHOP_OFFERT.onClick = function() |
| 2681 | + | local Index = X |
| 2682 | + | modules.game_menu.onShopBox(cat, Index) |
| 2683 | + | end |
| 2684 | + | else |
| 2685 | + | SHOP_OFFERT = g_ui.createWidget('UIButton', SHOP_SELECT_PANEL) |
| 2686 | + | SHOP_OFFERT:setId('offertShop_' ..X) |
| 2687 | + | SHOP_OFFERT:setVisible(false) |
| 2688 | + | end |
| 2689 | + | end |
| 2690 | + | SHOP_SELECT:show() |
| 2691 | + | end |
| 2692 | + | function setMobileRankSortType(value) |
| 2693 | + | if value == "00" then |
| 2694 | + | g_game.talk(g_game.talk("!rank 00 01")) |
| 2695 | + | else |
| 2696 | + | g_game.talk(g_game.talk("!rank 01 " ..value.. " 01")) |
| 2697 | + | end |
| 2698 | + | end |
| 2699 | + | function onMobileChangeRankSortType(comboBox, option, value) |
| 2700 | + | setMobileRankSortType(value:lower()) |
| 2701 | + | end |
| 2702 | + | function bindKeys() |
| 2703 | + | gameRootPanel:setAutoRepeatDelay(10) |
| 2704 | + | |
| 2705 | + | local lastAction = 0 |
| 2706 | + | g_keyboard.bindKeyPress('Escape', function() |
| 2707 | + | if lastAction + 50 > g_clock.millis() then return end |
| 2708 | + | lastAction = g_clock.millis() |
| 2709 | + | g_game.cancelAttackAndFollow() |
| 2710 | + | end, gameRootPanel) |
| 2711 | + | g_keyboard.bindKeyPress('Ctrl+=', function() if g_game.getFeature(GameNoDebug) then return end gameMapPanel:zoomIn() end, gameRootPanel) |
| 2712 | + | g_keyboard.bindKeyPress('Ctrl+-', function() if g_game.getFeature(GameNoDebug) then return end gameMapPanel:zoomOut() end, gameRootPanel) |
| 2713 | + | g_keyboard.bindKeyDown('Ctrl+Q', function() tryLogout(false) end, gameRootPanel) |
| 2714 | + | g_keyboard.bindKeyDown('Ctrl+L', function() tryLogout(false) end, gameRootPanel) |
| 2715 | + | g_keyboard.bindKeyDown('Ctrl+W', function() g_map.cleanTexts() modules.game_textmessage.clearMessages() end, gameRootPanel) |
| 2716 | + | end |
| 2717 | + | |
| 2718 | + | function unbindWalkKey(key) |
| 2719 | + | g_keyboard.unbindKeyDown(key, gameRootPanel) |
| 2720 | + | g_keyboard.unbindKeyUp(key, gameRootPanel) |
| 2721 | + | g_keyboard.unbindKeyPress(key, gameRootPanel) |
| 2722 | + | end |
| 2723 | + | |
| 2724 | + | local countdownWindow = nil |
| 2725 | + | local function startLogoutCountdown() |
| 2726 | + | if countdownWindow then return end |
| 2727 | + | |
| 2728 | + | local remainingTime = 10 |
| 2729 | + | local function updateCountdown() |
| 2730 | + | if not countdownWindow then return end |
| 2731 | + | countdownWindow:getChildById('countdownLabel'):setText(tr('Saliendo en: %s', remainingTime)) |
| 2732 | + | remainingTime = remainingTime - 1 |
| 2733 | + | |
| 2734 | + | if remainingTime <= 0 then |
| 2735 | + | if countdownWindow then |
| 2736 | + | countdownWindow:destroy() |
| 2737 | + | countdownWindow = nil |
| 2738 | + | end |
| 2739 | + | tryLogout(false) |
| 2740 | + | return |
| 2741 | + | end |
| 2742 | + | |
| 2743 | + | scheduleEvent(updateCountdown, 1000) |
| 2744 | + | end |
| 2745 | + | |
| 2746 | + | local function cancelCountdown() |
| 2747 | + | if countdownWindow then |
| 2748 | + | countdownWindow:destroy() |
| 2749 | + | countdownWindow = nil |
| 2750 | + | end |
| 2751 | + | end |
| 2752 | + | |
| 2753 | + | countdownWindow = displayGeneralBox(tr('Logout'), tr('Saliendo en: 10'), |
| 2754 | + | { { text=tr('Cancelar'), callback=cancelCountdown }, |
| 2755 | + | anchor=AnchorHorizontalCenter }, cancelCountdown) |
| 2756 | + | |
| 2757 | + | updateCountdown() |
| 2758 | + | end |
| 2759 | + | |
| 2760 | + | function tryLogout(prompt) |
| 2761 | + | if type(prompt) ~= "boolean" then |
| 2762 | + | prompt = true |
| 2763 | + | end |
| 2764 | + | if not g_game.isOnline() then |
| 2765 | + | exit() |
| 2766 | + | return |
| 2767 | + | end |
| 2768 | + | |
| 2769 | + | if logoutWindow then |
| 2770 | + | return |
| 2771 | + | end |
| 2772 | + | |
| 2773 | + | local msg, yesCallback |
| 2774 | + | if not g_game.isConnectionOk() then |
| 2775 | + | msg = 'Your connection is failing, if you logout now your character will be still online, do you want to force logout?' |
| 2776 | + | |
| 2777 | + | yesCallback = function() |
| 2778 | + | g_game.forceLogout() |
| 2779 | + | if logoutWindow then |
| 2780 | + | logoutWindow:destroy() |
| 2781 | + | logoutWindow=nil |
| 2782 | + | end |
| 2783 | + | end |
| 2784 | + | else |
| 2785 | + | msg = 'Are you sure you want to logout?' |
| 2786 | + | |
| 2787 | + | yesCallback = function() |
| 2788 | + | g_game.safeLogout() |
| 2789 | + | if logoutWindow then |
| 2790 | + | logoutWindow:destroy() |
| 2791 | + | logoutWindow=nil |
| 2792 | + | end |
| 2793 | + | end |
| 2794 | + | end |
| 2795 | + | |
| 2796 | + | local noCallback = function() |
| 2797 | + | logoutWindow:destroy() |
| 2798 | + | logoutWindow=nil |
| 2799 | + | end |
| 2800 | + | |
| 2801 | + | if prompt then |
| 2802 | + | logoutWindow = displayGeneralBox(tr('Logout'), tr(msg), { |
| 2803 | + | { text=tr('Yes'), callback=yesCallback }, |
| 2804 | + | { text=tr('No'), callback=noCallback }, |
| 2805 | + | anchor=AnchorHorizontalCenter}, yesCallback, noCallback) |
| 2806 | + | else |
| 2807 | + | yesCallback() |
| 2808 | + | end |
| 2809 | + | end |
| 2810 | + | |
| 2811 | + | function ZoomScreen(id) |
| 2812 | + | if id == 01 then |
| 2813 | + | gameMapPanel:zoomIn() |
| 2814 | + | else |
| 2815 | + | gameMapPanel:zoomOut() |
| 2816 | + | end |
| 2817 | + | end |
| 2818 | + | function terminate() |
| 2819 | + | hide() |
| 2820 | + | |
| 2821 | + | hookedMenuOptions = {} |
| 2822 | + | markThing = nil |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | disconnect(g_game, { |
| 2826 | + | onGameStart = onGameStart, |
| 2827 | + | onGameEnd = onGameEnd, |
| 2828 | + | onLoginAdvice = onLoginAdvice |
| 2829 | + | }) |
| 2830 | + | |
| 2831 | + | disconnect(g_game, 'onTextMessage', onInterfaceMsg) |
| 2832 | + | disconnect(gameMapPanel, { onGeometryChange = updateSize }) |
| 2833 | + | connect(gameMapPanel, { onGeometryChange = updateSize, onVisibleDimensionChange = updateSize }) |
| 2834 | + | |
| 2835 | + | ProtocolGame.unregisterExtendedOpcode(TradeOpcodes) |
| 2836 | + | ProtocolGame.unregisterExtendedOpcode(FinishTradeOP01) |
| 2837 | + | ProtocolGame.unregisterExtendedOpcode(FinishTradeOP02) |
| 2838 | + | ProtocolGame.unregisterExtendedOpcode(FinishTradeOP03) |
| 2839 | + | ProtocolGame.unregisterExtendedOpcode(BotMonitoramento) |
| 2840 | + | logoutButton:destroy() |
| 2841 | + | gameRootPanel:destroy() |
| 2842 | + | tradeWindow:destroy() |
| 2843 | + | end |
| 2844 | + | |
| 2845 | + | function onGameStart() |
| 2846 | + | refreshViewMode() |
| 2847 | + | show() |
| 2848 | + | |
| 2849 | + | -- open tibia has delay in auto walking |
| 2850 | + | if not g_game.isOfficialTibia() then |
| 2851 | + | g_game.enableFeature(GameForceFirstAutoWalkStep) |
| 2852 | + | else |
| 2853 | + | g_game.disableFeature(GameForceFirstAutoWalkStep) |
| 2854 | + | end |
| 2855 | + | end |
| 2856 | + | |
| 2857 | + | function onGameEnd() |
| 2858 | + | hide() |
| 2859 | + | modules.client_topmenu.getTopMenu():setImageColor('white') |
| 2860 | + | end |
| 2861 | + | |
| 2862 | + | function show() |
| 2863 | + | connect(g_app, { onClose = tryExit }) |
| 2864 | + | modules.client_background.hide() |
| 2865 | + | gameRootPanel:show() |
| 2866 | + | gameRootPanel:focus() |
| 2867 | + | gameMapPanel:followCreature(g_game.getLocalPlayer()) |
| 2868 | + | |
| 2869 | + | updateStretchShrink() |
| 2870 | + | logoutButton:setTooltip(tr('Logout')) |
| 2871 | + | |
| 2872 | + | addEvent(function() |
| 2873 | + | if not limitedZoom or g_game.isGM() then |
| 2874 | + | gameMapPanel:setMaxZoomOut(513) |
| 2875 | + | gameMapPanel:setLimitVisibleRange(false) |
| 2876 | + | else |
| 2877 | + | gameMapPanel:setMaxZoomOut(15) |
| 2878 | + | gameMapPanel:setLimitVisibleRange(true) |
| 2879 | + | end |
| 2880 | + | end) |
| 2881 | + | end |
| 2882 | + | |
| 2883 | + | function hide() |
| 2884 | + | disconnect(g_app, { onClose = tryExit }) |
| 2885 | + | logoutButton:setTooltip(tr('Exit')) |
| 2886 | + | |
| 2887 | + | if logoutWindow then |
| 2888 | + | logoutWindow:destroy() |
| 2889 | + | logoutWindow = nil |
| 2890 | + | end |
| 2891 | + | if exitWindow then |
| 2892 | + | exitWindow:destroy() |
| 2893 | + | exitWindow = nil |
| 2894 | + | end |
| 2895 | + | if countWindow then |
| 2896 | + | countWindow:destroy() |
| 2897 | + | countWindow = nil |
| 2898 | + | end |
| 2899 | + | gameRootPanel:hide() |
| 2900 | + | tradeWindow:hide() |
| 2901 | + | modules.client_background.show() |
| 2902 | + | end |
| 2903 | + | |
| 2904 | + | function save() |
| 2905 | + | local settings = {} |
| 2906 | + | settings.splitterMarginBottom = bottomSplitter:getMarginBottom() |
| 2907 | + | g_settings.setNode('game_interface', settings) |
| 2908 | + | end |
| 2909 | + | |
| 2910 | + | function load() |
| 2911 | + | local settings = g_settings.getNode('game_interface') |
| 2912 | + | if settings then |
| 2913 | + | if settings.splitterMarginBottom then |
| 2914 | + | bottomSplitter:setMarginBottom(settings.splitterMarginBottom) |
| 2915 | + | end |
| 2916 | + | end |
| 2917 | + | end |
| 2918 | + | |
| 2919 | + | function onLoginAdvice(message) |
| 2920 | + | displayInfoBox(tr("For Your Information"), message) |
| 2921 | + | end |
| 2922 | + | |
| 2923 | + | function forceExit() |
| 2924 | + | g_game.cancelLogin() |
| 2925 | + | scheduleEvent(exit, 10) |
| 2926 | + | return true |
| 2927 | + | end |
| 2928 | + | |
| 2929 | + | function tryExit() |
| 2930 | + | if exitWindow then |
| 2931 | + | return true |
| 2932 | + | end |
| 2933 | + | |
| 2934 | + | local logoutFunc = function() g_game.safeLogout() exitWindow:destroy() exitWindow = nil end |
| 2935 | + | local cancelFunc = function() exitWindow:destroy() exitWindow = nil end |
| 2936 | + | |
| 2937 | + | exitWindow = displayGeneralBox(tr('Exit'), tr("Log out before closing the client to leave the game properly."), |
| 2938 | + | { { text=tr('Logout'), callback=logoutFunc }, |
| 2939 | + | { text=tr('Cancel'), callback=cancelFunc }, |
| 2940 | + | anchor=AnchorHorizontalCenter}, logoutFunc, cancelFunc) |
| 2941 | + | |
| 2942 | + | return true |
| 2943 | + | end |
| 2944 | + | |
| 2945 | + | function tryLogout(prompt) |
| 2946 | + | if type(prompt) ~= "boolean" then |
| 2947 | + | prompt = true |
| 2948 | + | end |
| 2949 | + | if not g_game.isOnline() then |
| 2950 | + | exit() |
| 2951 | + | return |
| 2952 | + | end |
| 2953 | + | |
| 2954 | + | if logoutWindow then |
| 2955 | + | return |
| 2956 | + | end |
| 2957 | + | |
| 2958 | + | local msg, yesCallback |
| 2959 | + | if not g_game.isConnectionOk() then |
| 2960 | + | msg = 'Your connection is failing, if you logout now your character will be still online, do you want to force logout?' |
| 2961 | + | |
| 2962 | + | yesCallback = function() |
| 2963 | + | g_game.forceLogout() |
| 2964 | + | if logoutWindow then |
| 2965 | + | logoutWindow:destroy() |
| 2966 | + | logoutWindow=nil |
| 2967 | + | end |
| 2968 | + | end |
| 2969 | + | else |
| 2970 | + | msg = 'Are you sure you want to logout?' |
| 2971 | + | |
| 2972 | + | yesCallback = function() |
| 2973 | + | g_game.safeLogout() |
| 2974 | + | if logoutWindow then |
| 2975 | + | logoutWindow:destroy() |
| 2976 | + | logoutWindow=nil |
| 2977 | + | end |
| 2978 | + | end |
| 2979 | + | end |
| 2980 | + | |
| 2981 | + | local noCallback = function() |
| 2982 | + | logoutWindow:destroy() |
| 2983 | + | logoutWindow=nil |
| 2984 | + | end |
| 2985 | + | |
| 2986 | + | if prompt then |
| 2987 | + | logoutWindow = displayGeneralBox(tr('Logout'), tr(msg), { |
| 2988 | + | { text=tr('Yes'), callback=yesCallback }, |
| 2989 | + | { text=tr('No'), callback=noCallback }, |
| 2990 | + | anchor=AnchorHorizontalCenter}, yesCallback, noCallback) |
| 2991 | + | else |
| 2992 | + | yesCallback() |
| 2993 | + | end |
| 2994 | + | end |
| 2995 | + | |
| 2996 | + | function updateStretchShrink() |
| 2997 | + | if modules.client_options.getOption('dontStretchShrink') and not alternativeView then |
| 2998 | + | gameMapPanel:setVisibleDimension({ width = 15, height = 11 }) |
| 2999 | + | |
| 3000 | + | -- Set gameMapPanel size to height = 11 * 32 + 2 |
| 3001 | + | bottomSplitter:setMarginBottom(bottomSplitter:getMarginBottom() + (gameMapPanel:getHeight() - 32 * 11) - 10) |
| 3002 | + | end |
| 3003 | + | end |
| 3004 | + | |
| 3005 | + | function onMouseGrabberRelease(self, mousePosition, mouseButton) |
| 3006 | + | if mouseButton == MouseTouch then return end |
| 3007 | + | if selectedThing == nil then return false end |
| 3008 | + | if mouseButton == MouseLeftButton then |
| 3009 | + | local clickedWidget = gameRootPanel:recursiveGetChildByPos(mousePosition, false) |
| 3010 | + | if clickedWidget then |
| 3011 | + | if selectedType == 'use' then |
| 3012 | + | onUseWith(clickedWidget, mousePosition) |
| 3013 | + | elseif selectedType == 'trade' then |
| 3014 | + | onTradeWith(clickedWidget, mousePosition) |
| 3015 | + | end |
| 3016 | + | end |
| 3017 | + | end |
| 3018 | + | |
| 3019 | + | selectedThing = nil |
| 3020 | + | g_mouse.popCursor('target') |
| 3021 | + | self:ungrabMouse() |
| 3022 | + | gameMapPanel:blockNextMouseRelease(true) |
| 3023 | + | return true |
| 3024 | + | end |
| 3025 | + | |
| 3026 | + | function onUseWith(clickedWidget, mousePosition) |
| 3027 | + | if clickedWidget:getClassName() == 'UIGameMap' then |
| 3028 | + | local tile = clickedWidget:getTile(mousePosition) |
| 3029 | + | if tile then |
| 3030 | + | if selectedThing:isFluidContainer() or selectedThing:isMultiUse() then |
| 3031 | + | if selectedThing:getId() == 3180 or selectedThing:getId() == 3156 then |
| 3032 | + | -- special version for mwall |
| 3033 | + | g_game.useWith(selectedThing, tile:getTopUseThing(), selectedSubtype) |
| 3034 | + | else |
| 3035 | + | g_game.useWith(selectedThing, tile:getTopMultiUseThingEx(clickedWidget:getPositionOffset(mousePosition)), selectedSubtype) |
| 3036 | + | end |
| 3037 | + | else |
| 3038 | + | g_game.useWith(selectedThing, tile:getTopUseThing(), selectedSubtype) |
| 3039 | + | end |
| 3040 | + | end |
| 3041 | + | elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then |
| 3042 | + | g_game.useWith(selectedThing, clickedWidget:getItem(), selectedSubtype) |
| 3043 | + | elseif clickedWidget:getClassName() == 'UICreatureButton' then |
| 3044 | + | local creature = clickedWidget:getCreature() |
| 3045 | + | if creature then |
| 3046 | + | g_game.useWith(selectedThing, creature, selectedSubtype) |
| 3047 | + | end |
| 3048 | + | end |
| 3049 | + | end |
| 3050 | + | |
| 3051 | + | function onTradeWith(clickedWidget, mousePosition) |
| 3052 | + | if clickedWidget:getClassName() == 'UIGameMap' then |
| 3053 | + | local tile = clickedWidget:getTile(mousePosition) |
| 3054 | + | if tile then |
| 3055 | + | g_game.requestTrade(selectedThing, tile:getTopCreatureEx(clickedWidget:getPositionOffset(mousePosition))) |
| 3056 | + | end |
| 3057 | + | elseif clickedWidget:getClassName() == 'UICreatureButton' then |
| 3058 | + | local creature = clickedWidget:getCreature() |
| 3059 | + | if creature then |
| 3060 | + | g_game.requestTrade(selectedThing, creature) |
| 3061 | + | end |
| 3062 | + | end |
| 3063 | + | end |
| 3064 | + | |
| 3065 | + | function startUseWith(thing, subType) |
| 3066 | + | gameMapPanel:blockNextMouseRelease() |
| 3067 | + | if not thing then return end |
| 3068 | + | if g_ui.isMouseGrabbed() then |
| 3069 | + | if selectedThing then |
| 3070 | + | selectedThing = thing |
| 3071 | + | selectedType = 'use' |
| 3072 | + | end |
| 3073 | + | return |
| 3074 | + | end |
| 3075 | + | selectedType = 'use' |
| 3076 | + | selectedThing = thing |
| 3077 | + | selectedSubtype = subType or 0 |
| 3078 | + | mouseGrabberWidget:grabMouse() |
| 3079 | + | g_mouse.pushCursor('target') |
| 3080 | + | end |
| 3081 | + | |
| 3082 | + | function startTradeWith(thing) |
| 3083 | + | if not thing then return end |
| 3084 | + | if g_ui.isMouseGrabbed() then |
| 3085 | + | if selectedThing then |
| 3086 | + | selectedThing = thing |
| 3087 | + | selectedType = 'trade' |
| 3088 | + | end |
| 3089 | + | return |
| 3090 | + | end |
| 3091 | + | selectedType = 'trade' |
| 3092 | + | selectedThing = thing |
| 3093 | + | mouseGrabberWidget:grabMouse() |
| 3094 | + | g_mouse.pushCursor('target') |
| 3095 | + | end |
| 3096 | + | |
| 3097 | + | function isMenuHookCategoryEmpty(category) |
| 3098 | + | if category then |
| 3099 | + | for _,opt in pairs(category) do |
| 3100 | + | if opt then return false end |
| 3101 | + | end |
| 3102 | + | end |
| 3103 | + | return true |
| 3104 | + | end |
| 3105 | + | |
| 3106 | + | function addMenuHook(category, name, callback, condition, shortcut) |
| 3107 | + | if not hookedMenuOptions[category] then |
| 3108 | + | hookedMenuOptions[category] = {} |
| 3109 | + | end |
| 3110 | + | hookedMenuOptions[category][name] = { |
| 3111 | + | callback = callback, |
| 3112 | + | condition = condition, |
| 3113 | + | shortcut = shortcut |
| 3114 | + | } |
| 3115 | + | end |
| 3116 | + | |
| 3117 | + | function isNumber(str) |
| 3118 | + | return tonumber(str) and true or false |
| 3119 | + | end |
| 3120 | + | |
| 3121 | + | function removeMenuHook(category, name) |
| 3122 | + | if not name then |
| 3123 | + | hookedMenuOptions[category] = {} |
| 3124 | + | else |
| 3125 | + | hookedMenuOptions[category][name] = nil |
| 3126 | + | end |
| 3127 | + | end |
| 3128 | + | |
| 3129 | + | -- NEW TRADE SYSTEM |
| 3130 | + | local TRADER_NAME = "" |
| 3131 | + | local START_TRADE, START_PLAYER = 0 |
| 3132 | + | local WAIT_ACCEPT = 0 |
| 3133 | + | local PLAYER_GOLD, TRADER_GOLD = 000, 000 |
| 3134 | + | local PLAYER_VIP, TRADER_VIP = 000, 000 |
| 3135 | + | local TEMP_GOLD, TEMP_VIP = 0, 0 |
| 3136 | + | local CONFIRM_WINDOW = nil |
| 3137 | + | local SLOT_QNT = { |
| 3138 | + | ["Player"] = { |
| 3139 | + | [01] = {QNT = 00}; |
| 3140 | + | [02] = {QNT = 00}; |
| 3141 | + | [03] = {QNT = 00}; |
| 3142 | + | [04] = {QNT = 00}; |
| 3143 | + | [05] = {QNT = 00}; |
| 3144 | + | [06] = {QNT = 00}; |
| 3145 | + | [07] = {QNT = 00}; |
| 3146 | + | [08] = {QNT = 00}; |
| 3147 | + | [09] = {QNT = 00}; |
| 3148 | + | [10] = {QNT = 00}; |
| 3149 | + | }; |
| 3150 | + | ["Trader"] = { |
| 3151 | + | [01] = {QNT = 00}; |
| 3152 | + | [02] = {QNT = 00}; |
| 3153 | + | [03] = {QNT = 00}; |
| 3154 | + | [04] = {QNT = 00}; |
| 3155 | + | [05] = {QNT = 00}; |
| 3156 | + | [06] = {QNT = 00}; |
| 3157 | + | [07] = {QNT = 00}; |
| 3158 | + | [08] = {QNT = 00}; |
| 3159 | + | [09] = {QNT = 00}; |
| 3160 | + | [10] = {QNT = 00}; |
| 3161 | + | } |
| 3162 | + | } |
| 3163 | + | local _TRADE = { |
| 3164 | + | ["Player"] = { |
| 3165 | + | [00] = {ID_1 = "P"}; |
| 3166 | + | [01] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3167 | + | [02] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3168 | + | [03] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3169 | + | [04] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3170 | + | [05] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3171 | + | [06] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3172 | + | [07] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3173 | + | [08] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3174 | + | [09] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3175 | + | [10] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3176 | + | [11] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3177 | + | [12] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3178 | + | [13] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3179 | + | [14] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3180 | + | [15] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3181 | + | [16] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3182 | + | [17] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3183 | + | [18] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3184 | + | [19] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3185 | + | [20] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3186 | + | }; |
| 3187 | + | ["Trader"] = { |
| 3188 | + | [00] = {ID_1 = "T"}; |
| 3189 | + | [01] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3190 | + | [02] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3191 | + | [03] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3192 | + | [04] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3193 | + | [05] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3194 | + | [06] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3195 | + | [07] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3196 | + | [08] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3197 | + | [09] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3198 | + | [10] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3199 | + | [11] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3200 | + | [12] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3201 | + | [13] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3202 | + | [14] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3203 | + | [15] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3204 | + | [16] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3205 | + | [17] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3206 | + | [18] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3207 | + | [19] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3208 | + | [20] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3209 | + | }; |
| 3210 | + | } |
| 3211 | + | function onSetTraderName(thingName) |
| 3212 | + | TRADER_NAME = thingName |
| 3213 | + | end |
| 3214 | + | function onAcceptTrade() |
| 3215 | + | if g_app.isMobile() then |
| 3216 | + | TraderMobileWindow:show() |
| 3217 | + | if modules.game_menu.getMenuShow() == 0 then |
| 3218 | + | modules.game_menu.OptionsInventario() |
| 3219 | + | end |
| 3220 | + | else |
| 3221 | + | TraderWindow:show() |
| 3222 | + | end |
| 3223 | + | Loading:hide() |
| 3224 | + | TextLoading:hide() |
| 3225 | + | WAIT_ACCEPT = 01 |
| 3226 | + | if modules.game_menu.getMenuShow() == 0 then |
| 3227 | + | modules.game_menu.OpenInventario() |
| 3228 | + | end |
| 3229 | + | end |
| 3230 | + | function onTradeClose(step) |
| 3231 | + | if TRADER_NAME ~= "" then |
| 3232 | + | g_game.talk(g_game.talk("!trade 2#" ..TRADER_NAME)) |
| 3233 | + | end |
| 3234 | + | TRADER_NAME = "" |
| 3235 | + | tradeShow = 00 |
| 3236 | + | START_TRADE = 00 |
| 3237 | + | START_PLAYER = 00 |
| 3238 | + | WAIT_ACCEPT = 00 |
| 3239 | + | coinsWindow:hide() |
| 3240 | + | tradeWindow:hide() |
| 3241 | + | if CONFIRM_WINDOW ~= nil then |
| 3242 | + | CONFIRM_WINDOW:destroy() |
| 3243 | + | CONFIRM_WINDOW = nil |
| 3244 | + | end |
| 3245 | + | modules.game_menu.closedInventario() |
| 3246 | + | if step then |
| 3247 | + | return |
| 3248 | + | end |
| 3249 | + | if g_app.isMobile() then |
| 3250 | + | modules.game_menu.onResetMenuBar() |
| 3251 | + | end |
| 3252 | + | end |
| 3253 | + | function getTrade() |
| 3254 | + | return tradeShow |
| 3255 | + | end |
| 3256 | + | function onLoadTrader(thing) |
| 3257 | + | local TRADE_TEMP = { |
| 3258 | + | [01] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3259 | + | [02] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3260 | + | [03] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3261 | + | [04] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3262 | + | [05] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3263 | + | [06] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3264 | + | [07] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3265 | + | [08] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3266 | + | [09] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3267 | + | [10] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3268 | + | [11] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3269 | + | [12] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3270 | + | [13] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3271 | + | [14] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3272 | + | [15] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3273 | + | [16] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3274 | + | [17] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3275 | + | [18] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3276 | + | [19] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3277 | + | [20] = {ID_1 = 0000, ID_2 = 0000, ID_3 = 0000, ID_4 = 0000, ID_5 = 0000, ID_6 = 0000, ID_7 = 0000, ID_8 = 0000, ID_9 = 0000, ID_10 = 0000, SLOT = 0000, EXT = 0000, POS_SLOT = 0000}; |
| 3278 | + | } |
| 3279 | + | local POS_TEMP = 01 |
| 3280 | + | for O = 01, 20 do |
| 3281 | + | if _TRADE[thing][O].ID_1 > 0 then |
| 3282 | + | TRADE_TEMP[POS_TEMP].ID_1 = _TRADE[thing][O].ID_1 |
| 3283 | + | TRADE_TEMP[POS_TEMP].ID_2 = _TRADE[thing][O].ID_2 |
| 3284 | + | TRADE_TEMP[POS_TEMP].ID_3 = _TRADE[thing][O].ID_3 |
| 3285 | + | TRADE_TEMP[POS_TEMP].ID_4 = _TRADE[thing][O].ID_4 |
| 3286 | + | TRADE_TEMP[POS_TEMP].ID_5 = _TRADE[thing][O].ID_5 |
| 3287 | + | TRADE_TEMP[POS_TEMP].ID_6 = _TRADE[thing][O].ID_6 |
| 3288 | + | TRADE_TEMP[POS_TEMP].ID_7 = _TRADE[thing][O].ID_7 |
| 3289 | + | TRADE_TEMP[POS_TEMP].ID_8 = _TRADE[thing][O].ID_8 |
| 3290 | + | TRADE_TEMP[POS_TEMP].ID_9 = _TRADE[thing][O].ID_9 |
| 3291 | + | TRADE_TEMP[POS_TEMP].ID_10 = _TRADE[thing][O].ID_10 |
| 3292 | + | |
| 3293 | + | TRADE_TEMP[POS_TEMP].SLOT = _TRADE[thing][O].SLOT |
| 3294 | + | TRADE_TEMP[POS_TEMP].EXT = _TRADE[thing][O].EXT |
| 3295 | + | TRADE_TEMP[POS_TEMP].POS_SLOT = _TRADE[thing][O].POS_SLOT |
| 3296 | + | |
| 3297 | + | POS_TEMP = POS_TEMP + 1 |
| 3298 | + | end |
| 3299 | + | end |
| 3300 | + | for EMPTY = 01, 10 do |
| 3301 | + | SLOT_QNT[thing][EMPTY].QNT = 00 |
| 3302 | + | end |
| 3303 | + | for I = 01, 20 do |
| 3304 | + | _TRADE[thing][I].ID_1 = TRADE_TEMP[I].ID_1 |
| 3305 | + | _TRADE[thing][I].ID_2 = TRADE_TEMP[I].ID_2 |
| 3306 | + | _TRADE[thing][I].ID_3 = TRADE_TEMP[I].ID_3 |
| 3307 | + | _TRADE[thing][I].ID_4 = TRADE_TEMP[I].ID_4 |
| 3308 | + | _TRADE[thing][I].ID_5 = TRADE_TEMP[I].ID_5 |
| 3309 | + | _TRADE[thing][I].ID_6 = TRADE_TEMP[I].ID_6 |
| 3310 | + | _TRADE[thing][I].ID_7 = TRADE_TEMP[I].ID_7 |
| 3311 | + | _TRADE[thing][I].ID_8 = TRADE_TEMP[I].ID_8 |
| 3312 | + | _TRADE[thing][I].ID_9 = TRADE_TEMP[I].ID_9 |
| 3313 | + | _TRADE[thing][I].ID_10 = TRADE_TEMP[I].ID_10 |
| 3314 | + | |
| 3315 | + | _TRADE[thing][I].SLOT = TRADE_TEMP[I].SLOT |
| 3316 | + | _TRADE[thing][I].EXT = TRADE_TEMP[I].EXT |
| 3317 | + | _TRADE[thing][I].POS_SLOT = TRADE_TEMP[I].POS_SLOT |
| 3318 | + | |
| 3319 | + | if g_app.isMobile() then |
| 3320 | + | ITEM = tradeWindow:recursiveGetChildById("Mobile".._TRADE[thing][00].ID_1.. 'Bag' ..I) |
| 3321 | + | else |
| 3322 | + | ITEM = tradeWindow:recursiveGetChildById(_TRADE[thing][00].ID_1.. 'Bag' ..I) |
| 3323 | + | end |
| 3324 | + | if TRADE_TEMP[I].ID_1 > 0 then |
| 3325 | + | local _BAG = I |
| 3326 | + | local _ID = TRADE_TEMP[I].ID_1 |
| 3327 | + | local _SLOT = TRADE_TEMP[I].SLOT |
| 3328 | + | SLOT_QNT[thing][_SLOT].QNT = SLOT_QNT[thing][_SLOT].QNT + 1 |
| 3329 | + | ITEM:setText("") |
| 3330 | + | ITEM:setImageSource("/images/custom/UI/rare_" ..TRADE_TEMP[I].ID_2) |
| 3331 | + | ITEM:setIcon("/images/custom/Items/" ..TRADE_TEMP[I].ID_1) |
| 3332 | + | ITEM.onMouseRelease = function(widget, mousePos, mouseButton) |
| 3333 | + | if (widget:containsPoint(mousePos) and mouseButton == MouseLeftButton) then |
| 3334 | + | return |
| 3335 | + | elseif (widget:containsPoint(mousePos) and mouseButton == MouseRightButton) then |
| 3336 | + | if thing == "Player" then |
| 3337 | + | onMenuTrade(_BAG) |
| 3338 | + | else |
| 3339 | + | return |
| 3340 | + | end |
| 3341 | + | end |
| 3342 | + | end |
| 3343 | + | if _SLOT == 3 or _SLOT == 0 or _SLOT > 10 then |
| 3344 | + | ITEM:setTooltip("@BAG " .._ID.. " " ..TRADE_TEMP[I].ID_3.. " " ..TRADE_TEMP[I].ID_2.. " " ..TRADE_TEMP[I].ID_4.. " " ..TRADE_TEMP[I].ID_9) |
| 3345 | + | if TRADE_TEMP[I].ID_4 > 0 then |
| 3346 | + | if TRADE_TEMP[I].ID_4 < 10 then |
| 3347 | + | ITEM:setText("0" ..TRADE_TEMP[I].ID_4) |
| 3348 | + | else |
| 3349 | + | ITEM:setText(TRADE_TEMP[I].ID_4) |
| 3350 | + | end |
| 3351 | + | else |
| 3352 | + | ITEM:setText("") |
| 3353 | + | end |
| 3354 | + | elseif _SLOT == 1 or _SLOT == 7 then |
| 3355 | + | ITEM:setTooltip("@JOIAS " .._ID.. " " ..TRADE_TEMP[I].ID_3.. " " ..TRADE_TEMP[I].ID_2.. " " ..TRADE_TEMP[I].ID_5.. " " ..TRADE_TEMP[I].ID_9) |
| 3356 | + | elseif _SLOT == 4 then |
| 3357 | + | ITEM:setTooltip("@GUN " .._ID.. " " ..TRADE_TEMP[I].ID_4.. " " ..TRADE_TEMP[I].ID_5.. " " ..TRADE_TEMP[I].ID_6.. " " ..TRADE_TEMP[I].ID_7.. " " ..TRADE_TEMP[I].ID_3.. " " ..TRADE_TEMP[I].ID_2.. " " ..TRADE_TEMP[I].ID_9) |
| 3358 | + | elseif _SLOT == 12 then |
| 3359 | + | local SKILL_ID = modules.game_database.getItemInfo(_ID, 10) |
| 3360 | + | ITEM:setTooltip("@SKILL " ..SKILL_ID.. " --") |
| 3361 | + | else |
| 3362 | + | ITEM:setTooltip("@EQUIP " .._ID.. " " ..TRADE_TEMP[I].ID_3.. " " ..TRADE_TEMP[I].ID_5.. " " ..TRADE_TEMP[I].ID_6.. " " ..TRADE_TEMP[I].ID_7.. " " ..TRADE_TEMP[I].ID_2.. " " ..TRADE_TEMP[I].ID_9) |
| 3363 | + | end |
| 3364 | + | else |
| 3365 | + | ITEM:setIcon("/images/custom/UI/none") |
| 3366 | + | ITEM:setImageSource("/images/custom/UI/item_slot") |
| 3367 | + | ITEM:setTooltip("") |
| 3368 | + | ITEM:setText("") |
| 3369 | + | ITEM.onMouseRelease = function(widget, mousePos, mouseButton) |
| 3370 | + | if (widget:containsPoint(mousePos) and mouseButton == MouseLeftButton) then |
| 3371 | + | return |
| 3372 | + | elseif (widget:containsPoint(mousePos) and mouseButton == MouseRightButton) then |
| 3373 | + | return |
| 3374 | + | end |
| 3375 | + | end |
| 3376 | + | end |
| 3377 | + | end |
| 3378 | + | |
| 3379 | + | g_game.talk(g_game.talk("!trade 10#" ..TRADER_NAME)) |
| 3380 | + | end |
| 3381 | + | function onMenuTrade(POS) |
| 3382 | + | local menu = g_ui.createWidget('PopupMenu') |
| 3383 | + | menu:addOption("Remover", function() |
| 3384 | + | _TRADE["Player"][POS].ID_1 = 0000 |
| 3385 | + | _TRADE["Player"][POS].ID_2 = 0000 |
| 3386 | + | _TRADE["Player"][POS].ID_3 = 0000 |
| 3387 | + | _TRADE["Player"][POS].ID_4 = 0000 |
| 3388 | + | _TRADE["Player"][POS].ID_5 = 0000 |
| 3389 | + | _TRADE["Player"][POS].ID_6 = 0000 |
| 3390 | + | _TRADE["Player"][POS].ID_7 = 0000 |
| 3391 | + | _TRADE["Player"][POS].ID_8 = 0000 |
| 3392 | + | _TRADE["Player"][POS].ID_9 = 0000 |
| 3393 | + | _TRADE["Player"][POS].ID_10 = 0000 |
| 3394 | + | _TRADE["Player"][POS].SLOT = 0000 |
| 3395 | + | _TRADE["Player"][POS].EXT = 0000 |
| 3396 | + | _TRADE["Player"][POS].POS_SLOT = 0000 |
| 3397 | + | |
| 3398 | + | onLoadTrader("Player") |
| 3399 | + | g_game.talk(g_game.talk("!trade 7#" ..TRADER_NAME.. "#" ..POS)) |
| 3400 | + | end) |
| 3401 | + | menu:display() |
| 3402 | + | end |
| 3403 | + | |
| 3404 | + | function onRefreshTraderItems(POS) |
| 3405 | + | _TRADE["Trader"][POS].ID_1 = 0000 |
| 3406 | + | _TRADE["Trader"][POS].ID_2 = 0000 |
| 3407 | + | _TRADE["Trader"][POS].ID_3 = 0000 |
| 3408 | + | _TRADE["Trader"][POS].ID_4 = 0000 |
| 3409 | + | _TRADE["Trader"][POS].ID_5 = 0000 |
| 3410 | + | _TRADE["Trader"][POS].ID_6 = 0000 |
| 3411 | + | _TRADE["Trader"][POS].ID_7 = 0000 |
| 3412 | + | _TRADE["Trader"][POS].ID_8 = 0000 |
| 3413 | + | _TRADE["Trader"][POS].ID_9 = 0000 |
| 3414 | + | _TRADE["Trader"][POS].ID_10 = 0000 |
| 3415 | + | _TRADE["Trader"][POS].SLOT = 0000 |
| 3416 | + | _TRADE["Trader"][POS].EXT = 0000 |
| 3417 | + | _TRADE["Trader"][POS].POS_SLOT = 0000 |
| 3418 | + | |
| 3419 | + | onLoadTrader("Trader") |
| 3420 | + | end |
| 3421 | + | function onInsertTrade(thing, id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, slot, ext, pos_slot, refresh) |
| 3422 | + | if WAIT_ACCEPT == 00 then |
| 3423 | + | return |
| 3424 | + | end |
| 3425 | + | --if START_PLAYER == 00 then |
| 3426 | + | local CHECK_BUSCA = 0 |
| 3427 | + | if thing == "Player" then |
| 3428 | + | for BUSCAR = 01, 20 do |
| 3429 | + | if _TRADE[thing][BUSCAR].ID_1 > 0 then |
| 3430 | + | if _TRADE[thing][BUSCAR].SLOT == slot and _TRADE[thing][BUSCAR].EXT == ext and _TRADE[thing][BUSCAR].POS_SLOT == pos_slot then |
| 3431 | + | CHECK_BUSCA = 01 |
| 3432 | + | break |
| 3433 | + | end |
| 3434 | + | end |
| 3435 | + | end |
| 3436 | + | end |
| 3437 | + | if CHECK_BUSCA == 00 then |
| 3438 | + | for INSERT = 01, 20 do |
| 3439 | + | if _TRADE[thing][INSERT].ID_1 == 0 then |
| 3440 | + | _TRADE[thing][INSERT].ID_1 = id1 |
| 3441 | + | _TRADE[thing][INSERT].ID_2 = id2 |
| 3442 | + | _TRADE[thing][INSERT].ID_3 = id3 |
| 3443 | + | _TRADE[thing][INSERT].ID_4 = id4 |
| 3444 | + | _TRADE[thing][INSERT].ID_5 = id5 |
| 3445 | + | _TRADE[thing][INSERT].ID_6 = id6 |
| 3446 | + | _TRADE[thing][INSERT].ID_7 = id7 |
| 3447 | + | _TRADE[thing][INSERT].ID_8 = id8 |
| 3448 | + | _TRADE[thing][INSERT].ID_9 = id9 |
| 3449 | + | _TRADE[thing][INSERT].ID_10 = id10 |
| 3450 | + | |
| 3451 | + | _TRADE[thing][INSERT].SLOT = slot |
| 3452 | + | _TRADE[thing][INSERT].EXT = ext |
| 3453 | + | _TRADE[thing][INSERT].POS_SLOT = pos_slot |
| 3454 | + | |
| 3455 | + | if refresh == 0 then |
| 3456 | + | g_game.getProtocolGame():sendExtendedOpcode(TradeOpcodes, thing.. "," ..INSERT.. "," .._TRADE[thing][INSERT].ID_1.. "," .._TRADE[thing][INSERT].ID_2.. "," .._TRADE[thing][INSERT].ID_3.. "," .._TRADE[thing][INSERT].ID_4.. "," .._TRADE[thing][INSERT].ID_5.. "," .._TRADE[thing][INSERT].ID_6.. "," .._TRADE[thing][INSERT].ID_7.. "," .._TRADE[thing][INSERT].ID_8.. "," .._TRADE[thing][INSERT].ID_9.. "," .._TRADE[thing][INSERT].ID_10.. "," .._TRADE[thing][INSERT].SLOT.. "," .._TRADE[thing][INSERT].EXT.. "," .._TRADE[thing][INSERT].POS_SLOT.. "," ..TRADER_NAME) |
| 3457 | + | end |
| 3458 | + | break |
| 3459 | + | end |
| 3460 | + | end |
| 3461 | + | end |
| 3462 | + | |
| 3463 | + | onLoadTrader(thing) |
| 3464 | + | --end |
| 3465 | + | end |
| 3466 | + | function onStartTrade(type, creatureName) |
| 3467 | + | if type == 01 then -- INICIAR TROCA |
| 3468 | + | for X = 01, 20 do |
| 3469 | + | ITEM = tradeWindow:recursiveGetChildById('PBag' ..X) |
| 3470 | + | ITEM:setOpacity(0.8) |
| 3471 | + | ITEM:setPhantom(true) |
| 3472 | + | end |
| 3473 | + | START_PLAYER = 01 |
| 3474 | + | if #coinsWindow:getText() > 0 then |
| 3475 | + | if tonumber(coinsWindow:getText()) ~= nil then |
| 3476 | + | if tonumber(coinsWindow:getText()) <= PLAYER_GOLD then |
| 3477 | + | if tonumber(coinsWindow:getText()) < 0 then |
| 3478 | + | PGCoin:setText('0') |
| 3479 | + | else |
| 3480 | + | PGCoin:setText(coinsWindow:getText()) |
| 3481 | + | end |
| 3482 | + | g_game.talk(g_game.talk("!trade 8#" ..TRADER_NAME.. "#" ..PGCoin:getText().. "#1")) |
| 3483 | + | coinsWindow:setText('') |
| 3484 | + | coinsWindow:hide() |
| 3485 | + | InsertGCoin.onClick = function() GoldEdit(01) end |
| 3486 | + | else |
| 3487 | + | g_game.talk(g_game.talk("!trade 11#01")) -- Voce nao possui tanto gold coins. |
| 3488 | + | InsertGCoin.onClick = function() GoldEdit(02) end |
| 3489 | + | return false |
| 3490 | + | end |
| 3491 | + | else |
| 3492 | + | g_game.talk(g_game.talk("!trade 11#02")) -- Somente n�meros |
| 3493 | + | InsertGCoin.onClick = function() GoldEdit(02) end |
| 3494 | + | return false |
| 3495 | + | end |
| 3496 | + | else |
| 3497 | + | coinsWindow:hide() |
| 3498 | + | end |
| 3499 | + | if #coinsVIPWindow:getText() > 0 then |
| 3500 | + | if tonumber(coinsVIPWindow:getText()) ~= nil then |
| 3501 | + | if tonumber(coinsVIPWindow:getText()) <= PLAYER_VIP then |
| 3502 | + | if tonumber(coinsVIPWindow:getText()) < 0 then |
| 3503 | + | PVCoin:setText('0') |
| 3504 | + | else |
| 3505 | + | PVCoin:setText(coinsVIPWindow:getText()) |
| 3506 | + | end |
| 3507 | + | g_game.talk(g_game.talk("!trade 8#" ..TRADER_NAME.. "#" ..PVCoin:getText().. "#2")) |
| 3508 | + | coinsVIPWindow:setText('') |
| 3509 | + | coinsVIPWindow:hide() |
| 3510 | + | InsertVCoin.onClick = function() GoldEdit(03) end |
| 3511 | + | else |
| 3512 | + | g_game.talk(g_game.talk("!trade 11#03")) -- Voce nao possui tanto vip coins. |
| 3513 | + | InsertVCoin.onClick = function() GoldEdit(04) end |
| 3514 | + | return false |
| 3515 | + | end |
| 3516 | + | else |
| 3517 | + | g_game.talk(g_game.talk("!trade 11#02")) -- Somente n�meros |
| 3518 | + | InsertVCoin.onClick = function() GoldEdit(04) end |
| 3519 | + | return false |
| 3520 | + | end |
| 3521 | + | else |
| 3522 | + | coinsVIPWindow:hide() |
| 3523 | + | end |
| 3524 | + | StartTrade:setText(tr('AGUARDANDO RESPOSTA...')) |
| 3525 | + | StartTrade:setPhantom(true) |
| 3526 | + | StartTrade:setImageSource("/images/custom/UI/none") |
| 3527 | + | if START_TRADE == 01 then |
| 3528 | + | g_game.talk(g_game.talk("!trade 9#" ..creatureName)) |
| 3529 | + | else |
| 3530 | + | g_game.talk(g_game.talk("!trade 3#" ..creatureName)) |
| 3531 | + | end |
| 3532 | + | else |
| 3533 | + | START_TRADE = 01 |
| 3534 | + | end |
| 3535 | + | end |
| 3536 | + | function onResetConfirm() |
| 3537 | + | if CONFIRM_WINDOW ~= nil then |
| 3538 | + | CONFIRM_WINDOW:destroy() |
| 3539 | + | CONFIRM_WINDOW = nil |
| 3540 | + | end |
| 3541 | + | |
| 3542 | + | START_TRADE = 00 |
| 3543 | + | START_PLAYER = 00 |
| 3544 | + | |
| 3545 | + | for X = 01, 20 do |
| 3546 | + | ITEM = tradeWindow:recursiveGetChildById('PBag' ..X) |
| 3547 | + | ITEM:setOpacity(1.0) |
| 3548 | + | ITEM:setPhantom(false) |
| 3549 | + | end |
| 3550 | + | |
| 3551 | + | StartTrade:setText(tr('INICIAR TROCA')) |
| 3552 | + | StartTrade:setPhantom(false) |
| 3553 | + | StartTrade:setImageSource("/images/custom/UI/button") |
| 3554 | + | StartTrade.onClick = function() onStartTrade(01, TRADER_NAME) end |
| 3555 | + | end |
| 3556 | + | function onConfirmTrade() |
| 3557 | + | local yesChoose = function() |
| 3558 | + | CONFIRM_WINDOW:destroy() |
| 3559 | + | CONFIRM_WINDOW = nil |
| 3560 | + | g_game.getProtocolGame():sendExtendedOpcode(FinishTradeOP01, TRADER_NAME.. "," ..SLOT_QNT["Trader"][01].QNT.. "," ..SLOT_QNT["Trader"][02].QNT.. "," ..SLOT_QNT["Trader"][03].QNT.. "," ..SLOT_QNT["Trader"][04].QNT.. "," ..SLOT_QNT["Trader"][05].QNT.. "," ..SLOT_QNT["Trader"][06].QNT.. "," ..SLOT_QNT["Trader"][07].QNT.. "," ..SLOT_QNT["Trader"][08].QNT.. "," ..SLOT_QNT["Trader"][09].QNT.. "," ..SLOT_QNT["Trader"][10].QNT.. ",0") |
| 3561 | + | end |
| 3562 | + | local noChoose = function() |
| 3563 | + | CONFIRM_WINDOW:destroy() |
| 3564 | + | CONFIRM_WINDOW = nil |
| 3565 | + | |
| 3566 | + | START_TRADE = 00 |
| 3567 | + | START_PLAYER = 00 |
| 3568 | + | |
| 3569 | + | for X = 01, 20 do |
| 3570 | + | ITEM = tradeWindow:recursiveGetChildById('PBag' ..X) |
| 3571 | + | ITEM:setOpacity(1.0) |
| 3572 | + | ITEM:setPhantom(false) |
| 3573 | + | end |
| 3574 | + | |
| 3575 | + | StartTrade:setText('INICIAR TROCA') |
| 3576 | + | StartTrade:setPhantom(false) |
| 3577 | + | StartTrade:setImageSource("/images/custom/UI/button") |
| 3578 | + | StartTrade.onClick = function() onStartTrade(01, TRADER_NAME) end |
| 3579 | + | |
| 3580 | + | g_game.talk(g_game.talk("!trade 10#" ..TRADER_NAME)) |
| 3581 | + | end |
| 3582 | + | if CONFIRM_WINDOW ~= nil then |
| 3583 | + | CONFIRM_WINDOW:destroy() |
| 3584 | + | CONFIRM_WINDOW = nil |
| 3585 | + | end |
| 3586 | + | |
| 3587 | + | CONFIRM_WINDOW = displayGeneralBox(tr('Trade'), tr("Assim ficou a oferta final. Aceitar oferta?"), |
| 3588 | + | { { text=tr('Yes'), callback=yesChoose }, |
| 3589 | + | { text=tr('No'), callback=noChoose }, |
| 3590 | + | anchor=AnchorHorizontalCenter }, yesChoose, noChoose) |
| 3591 | + | end |
| 3592 | + | function onCheckEmptyTrade(creatureName) |
| 3593 | + | g_game.getProtocolGame():sendExtendedOpcode(FinishTradeOP01, creatureName.. "," ..SLOT_QNT["Trader"][01].QNT.. "," ..SLOT_QNT["Trader"][02].QNT.. "," ..SLOT_QNT["Trader"][03].QNT.. "," ..SLOT_QNT["Trader"][04].QNT.. "," ..SLOT_QNT["Trader"][05].QNT.. "," ..SLOT_QNT["Trader"][06].QNT.. "," ..SLOT_QNT["Trader"][07].QNT.. "," ..SLOT_QNT["Trader"][08].QNT.. "," ..SLOT_QNT["Trader"][09].QNT.. "," ..SLOT_QNT["Trader"][10].QNT.. ",1") |
| 3594 | + | end |
| 3595 | + | function onFinishTrade(thing) |
| 3596 | + | local P_ITEM_01 = _TRADE["Trader"][01].SLOT.."|".._TRADE["Trader"][01].EXT.. "|" .._TRADE["Trader"][01].POS_SLOT.. "|" .._TRADE["Trader"][01].ID_4 |
| 3597 | + | local P_ITEM_02 = _TRADE["Trader"][02].SLOT.."|".._TRADE["Trader"][02].EXT.. "|" .._TRADE["Trader"][02].POS_SLOT.. "|" .._TRADE["Trader"][02].ID_4 |
| 3598 | + | local P_ITEM_03 = _TRADE["Trader"][03].SLOT.."|".._TRADE["Trader"][03].EXT.. "|" .._TRADE["Trader"][03].POS_SLOT.. "|" .._TRADE["Trader"][03].ID_4 |
| 3599 | + | local P_ITEM_04 = _TRADE["Trader"][04].SLOT.."|".._TRADE["Trader"][04].EXT.. "|" .._TRADE["Trader"][04].POS_SLOT.. "|" .._TRADE["Trader"][04].ID_4 |
| 3600 | + | local P_ITEM_05 = _TRADE["Trader"][05].SLOT.."|".._TRADE["Trader"][05].EXT.. "|" .._TRADE["Trader"][05].POS_SLOT.. "|" .._TRADE["Trader"][05].ID_4 |
| 3601 | + | local P_ITEM_06 = _TRADE["Trader"][06].SLOT.."|".._TRADE["Trader"][06].EXT.. "|" .._TRADE["Trader"][06].POS_SLOT.. "|" .._TRADE["Trader"][06].ID_4 |
| 3602 | + | local P_ITEM_07 = _TRADE["Trader"][07].SLOT.."|".._TRADE["Trader"][07].EXT.. "|" .._TRADE["Trader"][07].POS_SLOT.. "|" .._TRADE["Trader"][07].ID_4 |
| 3603 | + | local P_ITEM_08 = _TRADE["Trader"][08].SLOT.."|".._TRADE["Trader"][08].EXT.. "|" .._TRADE["Trader"][08].POS_SLOT.. "|" .._TRADE["Trader"][08].ID_4 |
| 3604 | + | local P_ITEM_09 = _TRADE["Trader"][09].SLOT.."|".._TRADE["Trader"][09].EXT.. "|" .._TRADE["Trader"][09].POS_SLOT.. "|" .._TRADE["Trader"][09].ID_4 |
| 3605 | + | local P_ITEM_10 = _TRADE["Trader"][10].SLOT.."|".._TRADE["Trader"][10].EXT.. "|" .._TRADE["Trader"][10].POS_SLOT.. "|" .._TRADE["Trader"][10].ID_4 |
| 3606 | + | local P_ITEM_11 = _TRADE["Trader"][11].SLOT.."|".._TRADE["Trader"][11].EXT.. "|" .._TRADE["Trader"][11].POS_SLOT.. "|" .._TRADE["Trader"][11].ID_4 |
| 3607 | + | local P_ITEM_12 = _TRADE["Trader"][12].SLOT.."|".._TRADE["Trader"][12].EXT.. "|" .._TRADE["Trader"][12].POS_SLOT.. "|" .._TRADE["Trader"][12].ID_4 |
| 3608 | + | local P_ITEM_13 = _TRADE["Trader"][13].SLOT.."|".._TRADE["Trader"][13].EXT.. "|" .._TRADE["Trader"][13].POS_SLOT.. "|" .._TRADE["Trader"][13].ID_4 |
| 3609 | + | local P_ITEM_14 = _TRADE["Trader"][14].SLOT.."|".._TRADE["Trader"][14].EXT.. "|" .._TRADE["Trader"][14].POS_SLOT.. "|" .._TRADE["Trader"][14].ID_4 |
| 3610 | + | local P_ITEM_15 = _TRADE["Trader"][15].SLOT.."|".._TRADE["Trader"][15].EXT.. "|" .._TRADE["Trader"][15].POS_SLOT.. "|" .._TRADE["Trader"][15].ID_4 |
| 3611 | + | local P_ITEM_16 = _TRADE["Trader"][16].SLOT.."|".._TRADE["Trader"][16].EXT.. "|" .._TRADE["Trader"][16].POS_SLOT.. "|" .._TRADE["Trader"][16].ID_4 |
| 3612 | + | local P_ITEM_17 = _TRADE["Trader"][17].SLOT.."|".._TRADE["Trader"][17].EXT.. "|" .._TRADE["Trader"][17].POS_SLOT.. "|" .._TRADE["Trader"][17].ID_4 |
| 3613 | + | local P_ITEM_18 = _TRADE["Trader"][18].SLOT.."|".._TRADE["Trader"][18].EXT.. "|" .._TRADE["Trader"][18].POS_SLOT.. "|" .._TRADE["Trader"][18].ID_4 |
| 3614 | + | local P_ITEM_19 = _TRADE["Trader"][19].SLOT.."|".._TRADE["Trader"][19].EXT.. "|" .._TRADE["Trader"][19].POS_SLOT.. "|" .._TRADE["Trader"][19].ID_4 |
| 3615 | + | local P_ITEM_20 = _TRADE["Trader"][20].SLOT.."|".._TRADE["Trader"][20].EXT.. "|" .._TRADE["Trader"][20].POS_SLOT.. "|" .._TRADE["Trader"][20].ID_4 |
| 3616 | + | |
| 3617 | + | local GET_PLAYER_GOLD = PGCoin:getText() local GET_PLAYER_VIP = PVCoin:getText() |
| 3618 | + | g_game.getProtocolGame():sendExtendedOpcode(FinishTradeOP03, TRADER_NAME.. "," ..TRADER_GOLD.. "," ..TRADER_VIP.. "," ..GET_PLAYER_GOLD.. "," ..GET_PLAYER_VIP.. "," ..thing) |
| 3619 | + | g_game.getProtocolGame():sendExtendedOpcode(FinishTradeOP02, TRADER_NAME.. "," ..P_ITEM_01.. "," ..P_ITEM_02.. "," ..P_ITEM_03.. "," ..P_ITEM_04.. "," ..P_ITEM_05.. "," ..P_ITEM_06.. "," ..P_ITEM_07.. "," ..P_ITEM_08.. "," ..P_ITEM_09.. "," ..P_ITEM_10.. "," ..P_ITEM_11.. "," ..P_ITEM_12.. "," ..P_ITEM_13.. "," ..P_ITEM_14.. "," ..P_ITEM_15.. "," ..P_ITEM_16.. "," ..P_ITEM_17.. "," ..P_ITEM_18.. "," ..P_ITEM_19.. "," ..P_ITEM_20) |
| 3620 | + | if thing == 01 then |
| 3621 | + | g_game.talk(g_game.talk("!trade 5#" ..TRADER_NAME)) |
| 3622 | + | else |
| 3623 | + | g_game.talk(g_game.talk("!trade 6#" ..TRADER_NAME)) |
| 3624 | + | end |
| 3625 | + | end |
| 3626 | + | function setCoins(type, value) |
| 3627 | + | if g_app.isMobile() then |
| 3628 | + | PGCoin = MobilePGCoin |
| 3629 | + | InsertGCoin = MobileInsertGCoin |
| 3630 | + | InsertVCoin = MobileInsertVCoin |
| 3631 | + | PGCoin = MobilePGCoin |
| 3632 | + | PVCoin = MobilePVCoin |
| 3633 | + | TGCoin = MobileTGCoin |
| 3634 | + | TVCoin = MobileTVCoin |
| 3635 | + | end |
| 3636 | + | if type == 01 then |
| 3637 | + | TRADER_GOLD = value |
| 3638 | + | TGCoin:setText(TRADER_GOLD) |
| 3639 | + | else |
| 3640 | + | TRADER_VIP = value |
| 3641 | + | TVCoin:setText(TRADER_VIP) |
| 3642 | + | end |
| 3643 | + | |
| 3644 | + | onResetConfirm() |
| 3645 | + | end |
| 3646 | + | function GoldEdit(type) |
| 3647 | + | if WAIT_ACCEPT == 00 then |
| 3648 | + | return |
| 3649 | + | end |
| 3650 | + | if g_app.isMobile() then |
| 3651 | + | PGCoin = MobilePGCoin |
| 3652 | + | InsertGCoin = MobileInsertGCoin |
| 3653 | + | InsertVCoin = MobileInsertVCoin |
| 3654 | + | PGCoin = MobilePGCoin |
| 3655 | + | PVCoin = MobilePVCoin |
| 3656 | + | TGCoin = MobileTGCoin |
| 3657 | + | TVCoin = MobileTVCoin |
| 3658 | + | end |
| 3659 | + | if type == 01 then |
| 3660 | + | TEMP_GOLD = PGCoin:getText() |
| 3661 | + | coinsWindow:setText(PGCoin:getText()) |
| 3662 | + | coinsWindow:show() |
| 3663 | + | InsertGCoin.onClick = function() GoldEdit(02) end |
| 3664 | + | elseif type == 02 then |
| 3665 | + | if #coinsWindow:getText() > 0 then |
| 3666 | + | if tonumber(coinsWindow:getText()) ~= nil then |
| 3667 | + | if tonumber(coinsWindow:getText()) <= PLAYER_GOLD then |
| 3668 | + | if tonumber(coinsWindow:getText()) < 0 then |
| 3669 | + | PGCoin:setText('0') |
| 3670 | + | else |
| 3671 | + | PGCoin:setText(coinsWindow:getText()) |
| 3672 | + | end |
| 3673 | + | g_game.talk(g_game.talk("!trade 8#" ..TRADER_NAME.. "#" ..PGCoin:getText().. "#1")) |
| 3674 | + | coinsWindow:setText('') |
| 3675 | + | coinsWindow:hide() |
| 3676 | + | InsertGCoin.onClick = function() GoldEdit(01) end |
| 3677 | + | else |
| 3678 | + | g_game.talk(g_game.talk("!trade 11#01")) -- Voce nao possui tanto gold coins. |
| 3679 | + | InsertGCoin.onClick = function() GoldEdit(02) end |
| 3680 | + | end |
| 3681 | + | else |
| 3682 | + | g_game.talk(g_game.talk("!trade 11#02")) -- Somente n�meros |
| 3683 | + | InsertGCoin.onClick = function() GoldEdit(02) end |
| 3684 | + | end |
| 3685 | + | else |
| 3686 | + | PGCoin:setText(TEMP_GOLD) |
| 3687 | + | coinsWindow:setText('') |
| 3688 | + | coinsWindow:hide() |
| 3689 | + | InsertGCoin.onClick = function() GoldEdit(01) end |
| 3690 | + | end |
| 3691 | + | |
| 3692 | + | elseif type == 03 then |
| 3693 | + | TEMP_VIP = PVCoin:getText() |
| 3694 | + | coinsVIPWindow:setText(PVCoin:getText()) |
| 3695 | + | coinsVIPWindow:show() |
| 3696 | + | InsertVCoin.onClick = function() GoldEdit(04) end |
| 3697 | + | elseif type == 04 then |
| 3698 | + | if #coinsVIPWindow:getText() > 0 then |
| 3699 | + | if tonumber(coinsVIPWindow:getText()) ~= nil then |
| 3700 | + | if tonumber(coinsVIPWindow:getText()) <= PLAYER_VIP then |
| 3701 | + | if tonumber(coinsVIPWindow:getText()) < 0 then |
| 3702 | + | PVCoin:setText('0') |
| 3703 | + | else |
| 3704 | + | PVCoin:setText(coinsVIPWindow:getText()) |
| 3705 | + | end |
| 3706 | + | g_game.talk(g_game.talk("!trade 8#" ..TRADER_NAME.. "#" ..PVCoin:getText().. "#2")) |
| 3707 | + | coinsVIPWindow:setText('') |
| 3708 | + | coinsVIPWindow:hide() |
| 3709 | + | InsertVCoin.onClick = function() GoldEdit(03) end |
| 3710 | + | else |
| 3711 | + | g_game.talk(g_game.talk("!trade 11#03")) -- Voce nao possui tanto vip coins. |
| 3712 | + | InsertVCoin.onClick = function() GoldEdit(04) end |
| 3713 | + | end |
| 3714 | + | else |
| 3715 | + | g_game.talk(g_game.talk("!trade 11#02")) -- Somente n�meros |
| 3716 | + | InsertVCoin.onClick = function() GoldEdit(04) end |
| 3717 | + | end |
| 3718 | + | else |
| 3719 | + | PVCoin:setText(TEMP_VIP) |
| 3720 | + | coinsVIPWindow:setText('') |
| 3721 | + | coinsVIPWindow:hide() |
| 3722 | + | InsertVCoin.onClick = function() GoldEdit(03) end |
| 3723 | + | end |
| 3724 | + | end |
| 3725 | + | end |
| 3726 | + | function setPlayerCoins(type, value) |
| 3727 | + | if type == 01 then |
| 3728 | + | PLAYER_GOLD = value |
| 3729 | + | else |
| 3730 | + | PLAYER_VIP = value |
| 3731 | + | end |
| 3732 | + | |
| 3733 | + | onResetConfirm() |
| 3734 | + | end |
| 3735 | + | function onMobileMount() |
| 3736 | + | local localPlayer = g_game.getLocalPlayer() |
| 3737 | + | if not localPlayer:isMounted() then |
| 3738 | + | localPlayer:mount() |
| 3739 | + | else |
| 3740 | + | localPlayer:dismount() |
| 3741 | + | end |
| 3742 | + | end |
| 3743 | + | function createThingMenu(menuPosition, lookThing, useThing, creatureThing) |
| 3744 | + | if not g_game.isOnline() then return end |
| 3745 | + | |
| 3746 | + | local menu = g_ui.createWidget('PopupMenu') |
| 3747 | + | menu:setGameMenu(true) |
| 3748 | + | |
| 3749 | + | local classic = modules.client_options.getOption('classicControl') |
| 3750 | + | local shortcut = nil |
| 3751 | + | |
| 3752 | + | if not classic and not g_app.isMobile() then shortcut = '(Shift)' else shortcut = nil end |
| 3753 | + | if lookThing then |
| 3754 | + | menu:addOption(tr('Look'), function() g_game.look(lookThing) end, shortcut) |
| 3755 | + | end |
| 3756 | + | |
| 3757 | + | if not classic and not g_app.isMobile() then shortcut = '(Ctrl)' else shortcut = nil end |
| 3758 | + | if useThing then |
| 3759 | + | if useThing:isContainer() then |
| 3760 | + | if useThing:getParentContainer() then |
| 3761 | + | menu:addOption(tr('Open'), function() g_game.open(useThing, useThing:getParentContainer()) end, shortcut) |
| 3762 | + | menu:addOption(tr('Open in new window'), function() g_game.open(useThing) end) |
| 3763 | + | else |
| 3764 | + | menu:addOption(tr('Open'), function() g_game.open(useThing) end, shortcut) |
| 3765 | + | end |
| 3766 | + | else |
| 3767 | + | if useThing:isMultiUse() then |
| 3768 | + | menu:addOption(tr('Use with ...'), function() startUseWith(useThing) end, shortcut) |
| 3769 | + | else |
| 3770 | + | menu:addOption(tr('Use'), function() g_game.use(useThing) end, shortcut) |
| 3771 | + | end |
| 3772 | + | end |
| 3773 | + | |
| 3774 | + | if useThing:isRotateable() then |
| 3775 | + | menu:addOption(tr('Rotate'), function() g_game.rotate(useThing) end) |
| 3776 | + | end |
| 3777 | + | if useThing:isWrapable() then |
| 3778 | + | menu:addOption(tr('Wrap'), function() g_game.wrap(useThing) end) |
| 3779 | + | end |
| 3780 | + | if useThing:isUnwrapable() then |
| 3781 | + | menu:addOption(tr('Unwrap'), function() g_game.wrap(useThing) end) |
| 3782 | + | end |
| 3783 | + | |
| 3784 | + | --if g_game.getFeature(GameBrowseField) and useThing:getPosition().x ~= 0xffff then |
| 3785 | + | -- menu:addOption(tr('Browse Field'), function() g_game.browseField(useThing:getPosition()) end) |
| 3786 | + | --end |
| 3787 | + | end |
| 3788 | + | |
| 3789 | + | --if lookThing and not lookThing:isCreature() and not lookThing:isNotMoveable() and lookThing:isPickupable() then |
| 3790 | + | --menu:addSeparator() |
| 3791 | + | --menu:addOption(tr('Trade with ...'), function() startTradeWith(lookThing) end) |
| 3792 | + | --end |
| 3793 | + | |
| 3794 | + | if lookThing then |
| 3795 | + | local parentContainer = lookThing:getParentContainer() |
| 3796 | + | if parentContainer and parentContainer:hasParent() then |
| 3797 | + | menu:addOption(tr('Move up'), function() g_game.moveToParentContainer(lookThing, lookThing:getCount()) end) |
| 3798 | + | end |
| 3799 | + | end |
| 3800 | + | |
| 3801 | + | if creatureThing then |
| 3802 | + | local localPlayer = g_game.getLocalPlayer() |
| 3803 | + | menu:addSeparator() |
| 3804 | + | |
| 3805 | + | if creatureThing:isLocalPlayer() then |
| 3806 | + | menu:addOption(tr('Set Outfit'), function() g_game.requestOutfit() end) |
| 3807 | + | |
| 3808 | + | if g_game.getFeature(GamePlayerMounts) then |
| 3809 | + | if not localPlayer:isMounted() then |
| 3810 | + | menu:addOption(tr('Mount'), function() localPlayer:mount() end) |
| 3811 | + | else |
| 3812 | + | menu:addOption(tr('Dismount'), function() localPlayer:dismount() end) |
| 3813 | + | end |
| 3814 | + | end |
| 3815 | + | |
| 3816 | + | if g_game.getFeature(GamePrey) and modules.game_prey then |
| 3817 | + | menu:addOption(tr('Open Prey Dialog'), function() modules.game_prey.show() end) |
| 3818 | + | end |
| 3819 | + | |
| 3820 | + | if creatureThing:isPartyMember() then |
| 3821 | + | if creatureThing:isPartyLeader() then |
| 3822 | + | if creatureThing:isPartySharedExperienceActive() then |
| 3823 | + | menu:addOption(tr('Disable Shared Experience'), function() g_game.partyShareExperience(false) end) |
| 3824 | + | else |
| 3825 | + | menu:addOption(tr('Enable Shared Experience'), function() g_game.partyShareExperience(true) end) |
| 3826 | + | end |
| 3827 | + | end |
| 3828 | + | if modules.game_database.getDG(10) == 0 then |
| 3829 | + | menu:addOption(tr('Leave Party'), function() g_game.partyLeave() end) |
| 3830 | + | end |
| 3831 | + | end |
| 3832 | + | |
| 3833 | + | else |
| 3834 | + | local localPosition = localPlayer:getPosition() |
| 3835 | + | if not classic and not g_app.isMobile() then shortcut = '(Alt)' else shortcut = nil end |
| 3836 | + | if creatureThing:getPosition().z == localPosition.z then |
| 3837 | + | if g_game.getAttackingCreature() ~= creatureThing then |
| 3838 | + | menu:addOption(tr('Attack'), function() |
| 3839 | + | if creatureThing:isPlayer() then |
| 3840 | + | if modules.game_menu.getPvPMode() then |
| 3841 | + | g_game.attack(creatureThing) |
| 3842 | + | modules.game_walking.setPressKeyAction(05) |
| 3843 | + | if modules.game_menu.getPvPMode() == false then |
| 3844 | + | modules.game_menu.PvPMode() |
| 3845 | + | end |
| 3846 | + | else |
| 3847 | + | g_game.attack(nil) |
| 3848 | + | end |
| 3849 | + | else |
| 3850 | + | g_game.attack(creatureThing) |
| 3851 | + | modules.game_walking.setPressKeyAction(05) |
| 3852 | + | end |
| 3853 | + | end, shortcut) |
| 3854 | + | else |
| 3855 | + | menu:addOption(tr('Stop Attack'), function() g_game.cancelAttack() g_game.attack(nil) end, shortcut) |
| 3856 | + | end |
| 3857 | + | |
| 3858 | + | if g_game.getFollowingCreature() ~= creatureThing then |
| 3859 | + | menu:addOption(tr('Follow'), function() g_game.follow(creatureThing) end) |
| 3860 | + | else |
| 3861 | + | menu:addOption(tr('Stop Follow'), function() g_game.cancelFollow() end) |
| 3862 | + | end |
| 3863 | + | end |
| 3864 | + | |
| 3865 | + | if creatureThing:isPlayer() then |
| 3866 | + | menu:addSeparator() |
| 3867 | + | local creatureName = creatureThing:getName() |
| 3868 | + | menu:addOption(tr('Message to %s', creatureName), function() g_game.openPrivateChannel(creatureName) end) |
| 3869 | + | menu:addOption(tr('Ver Equipamentos'), function() g_game.talk(g_game.talk("!spy " ..creatureName)) end) |
| 3870 | + | menu:addOption(tr('Trade com %s', creatureName), function() |
| 3871 | + | if modules.game_database.getDG(10) == 00 then |
| 3872 | + | g_game.talk(g_game.talk("!inventario 28")) |
| 3873 | + | |
| 3874 | + | if TRADER_NAME == creatureName then |
| 3875 | + | Loading:hide() |
| 3876 | + | TextLoading:hide() |
| 3877 | + | if g_app.isMobile() then |
| 3878 | + | TraderMobileWindow:show() |
| 3879 | + | if modules.game_menu.getMenuShow() == 0 then |
| 3880 | + | modules.game_menu.OptionsInventario() |
| 3881 | + | end |
| 3882 | + | else |
| 3883 | + | TraderWindow:show() |
| 3884 | + | if modules.game_menu.getMenuShow() == 0 then |
| 3885 | + | modules.game_menu.OpenInventario() |
| 3886 | + | end |
| 3887 | + | end |
| 3888 | + | WAIT_ACCEPT = 01 |
| 3889 | + | g_game.talk(g_game.talk("!trade 1#" ..creatureName)) |
| 3890 | + | else |
| 3891 | + | WAIT_ACCEPT = 00 |
| 3892 | + | Loading:show() |
| 3893 | + | TextLoading:show() |
| 3894 | + | TraderWindow:hide() |
| 3895 | + | TraderMobileWindow:hide() |
| 3896 | + | TRADER_NAME = creatureName |
| 3897 | + | g_game.talk(g_game.talk("!trade 0#" ..TRADER_NAME)) |
| 3898 | + | end |
| 3899 | + | PlayerName:setText(localPlayer:getName()) |
| 3900 | + | TraderName:setText(creatureName) |
| 3901 | + | for Clean = 01, 20 do |
| 3902 | + | _TRADE["Player"][Clean].ID_1 = 0000 |
| 3903 | + | _TRADE["Player"][Clean].ID_2 = 0000 |
| 3904 | + | _TRADE["Player"][Clean].ID_3 = 0000 |
| 3905 | + | _TRADE["Player"][Clean].ID_4 = 0000 |
| 3906 | + | _TRADE["Player"][Clean].ID_5 = 0000 |
| 3907 | + | _TRADE["Player"][Clean].ID_6 = 0000 |
| 3908 | + | _TRADE["Player"][Clean].ID_7 = 0000 |
| 3909 | + | _TRADE["Player"][Clean].ID_8 = 0000 |
| 3910 | + | _TRADE["Player"][Clean].ID_9 = 0000 |
| 3911 | + | _TRADE["Player"][Clean].ID_10 = 0000 |
| 3912 | + | |
| 3913 | + | _TRADE["Player"][Clean].SLOT = 0000 |
| 3914 | + | _TRADE["Player"][Clean].EXT = 0000 |
| 3915 | + | _TRADE["Player"][Clean].POS_SLOT = 0000 |
| 3916 | + | |
| 3917 | + | _TRADE["Trader"][Clean].ID_1 = 0000 |
| 3918 | + | _TRADE["Trader"][Clean].ID_2 = 0000 |
| 3919 | + | _TRADE["Trader"][Clean].ID_3 = 0000 |
| 3920 | + | _TRADE["Trader"][Clean].ID_4 = 0000 |
| 3921 | + | _TRADE["Trader"][Clean].ID_5 = 0000 |
| 3922 | + | _TRADE["Trader"][Clean].ID_6 = 0000 |
| 3923 | + | _TRADE["Trader"][Clean].ID_7 = 0000 |
| 3924 | + | _TRADE["Trader"][Clean].ID_8 = 0000 |
| 3925 | + | _TRADE["Trader"][Clean].ID_9 = 0000 |
| 3926 | + | _TRADE["Trader"][Clean].ID_10 = 0000 |
| 3927 | + | |
| 3928 | + | _TRADE["Trader"][Clean].SLOT = 0000 |
| 3929 | + | _TRADE["Trader"][Clean].EXT = 0000 |
| 3930 | + | _TRADE["Trader"][Clean].POS_SLOT = 0000 |
| 3931 | + | |
| 3932 | + | if g_app.isMobile() then |
| 3933 | + | ITEM_PLAYER = tradeWindow:recursiveGetChildById("Mobile" .._TRADE["Player"][00].ID_1.. 'Bag' ..Clean) |
| 3934 | + | ITEM_TRADER = tradeWindow:recursiveGetChildById("Mobile" .._TRADE["Trader"][00].ID_1.. 'Bag' ..Clean) |
| 3935 | + | else |
| 3936 | + | ITEM_PLAYER = tradeWindow:recursiveGetChildById(_TRADE["Player"][00].ID_1.. 'Bag' ..Clean) |
| 3937 | + | ITEM_TRADER = tradeWindow:recursiveGetChildById(_TRADE["Trader"][00].ID_1.. 'Bag' ..Clean) |
| 3938 | + | end |
| 3939 | + | |
| 3940 | + | ITEM_PLAYER:setIcon("/images/custom/UI/none") |
| 3941 | + | ITEM_PLAYER:setImageSource("/images/custom/UI/item_slot") |
| 3942 | + | ITEM_PLAYER:setTooltip("") |
| 3943 | + | ITEM_PLAYER:setText("") |
| 3944 | + | |
| 3945 | + | ITEM_TRADER:setIcon("/images/custom/UI/none") |
| 3946 | + | ITEM_TRADER:setImageSource("/images/custom/UI/item_slot") |
| 3947 | + | ITEM_TRADER:setTooltip("") |
| 3948 | + | ITEM_TRADER:setText("") |
| 3949 | + | end |
| 3950 | + | for X = 01, 20 do |
| 3951 | + | if g_app.isMobile() then |
| 3952 | + | ITEM = tradeWindow:recursiveGetChildById('MobilePBag' ..X) |
| 3953 | + | else |
| 3954 | + | ITEM = tradeWindow:recursiveGetChildById('PBag' ..X) |
| 3955 | + | end |
| 3956 | + | ITEM:setOpacity(1.0) |
| 3957 | + | ITEM:setPhantom(false) |
| 3958 | + | ITEM.onMouseRelease = function(widget, mousePos, mouseButton) |
| 3959 | + | if (widget:containsPoint(mousePos) and mouseButton == MouseLeftButton) then |
| 3960 | + | return |
| 3961 | + | elseif (widget:containsPoint(mousePos) and mouseButton == MouseRightButton) then |
| 3962 | + | return |
| 3963 | + | end |
| 3964 | + | end |
| 3965 | + | end |
| 3966 | + | StartTrade:setText('INICIAR TROCA') |
| 3967 | + | StartTrade:setPhantom(false) |
| 3968 | + | StartTrade:setImageSource("/images/custom/UI/button") |
| 3969 | + | CancelTrade.onClick = function() |
| 3970 | + | g_game.talk(g_game.talk("!trade 2#" ..creatureName)) |
| 3971 | + | onTradeClose() |
| 3972 | + | end |
| 3973 | + | StartTrade.onClick = function() onStartTrade(01, creatureName) end |
| 3974 | + | InsertGCoin:setTooltip(tr('Clique para inserir um valor.\nClique novamente para confirmar.')) |
| 3975 | + | InsertVCoin:setTooltip(tr('Clique para inserir um valor.\nClique novamente para confirmar.')) |
| 3976 | + | InsertGCoin.onClick = function() GoldEdit(01) end |
| 3977 | + | InsertVCoin.onClick = function() GoldEdit(03) end |
| 3978 | + | PVCoin:setText('0') |
| 3979 | + | PGCoin:setText('0') |
| 3980 | + | TVCoin:setText('0') |
| 3981 | + | TGCoin:setText('0') |
| 3982 | + | MobileInsertGCoin:setTooltip(tr('Clique para inserir um valor.\nClique novamente para confirmar.')) |
| 3983 | + | MobileInsertVCoin:setTooltip(tr('Clique para inserir um valor.\nClique novamente para confirmar.')) |
| 3984 | + | MobileInsertGCoin.onClick = function() GoldEdit(01) end |
| 3985 | + | MobileInsertVCoin.onClick = function() GoldEdit(03) end |
| 3986 | + | MobilePVCoin:setText('0') |
| 3987 | + | MobilePGCoin:setText('0') |
| 3988 | + | MobileTVCoin:setText('0') |
| 3989 | + | MobileTGCoin:setText('0') |
| 3990 | + | START_PLAYER = 00 |
| 3991 | + | TEMP_GOLD = 00 |
| 3992 | + | TEMP_VIP = 00 |
| 3993 | + | TRADER_GOLD = 00 |
| 3994 | + | TRADER_VIP = 00 |
| 3995 | + | tradeShow = 01 |
| 3996 | + | if g_app.isMobile() then |
| 3997 | + | tradeWindow:setParent(gameRootPanel) |
| 3998 | + | tradeWindow:addAnchor(AnchorTop, 'gameMapPanel', AnchorTop) |
| 3999 | + | tradeWindow:addAnchor(AnchorLeft, 'gameMapPanel', AnchorLeft) |
| 4000 | + | tradeWindow:setMarginTop(90) |
| 4001 | + | tradeWindow:setMarginLeft(40) |
| 4002 | + | modules.client_mobile.onHideUI(00) |
| 4003 | + | end |
| 4004 | + | tradeWindow:show() |
| 4005 | + | else |
| 4006 | + | modules.game_interface.onLoginAdvice(tr("Impossivel dar trade no momento.")) |
| 4007 | + | return |
| 4008 | + | end |
| 4009 | + | end) |
| 4010 | + | if modules.game_console.getOwnPrivateTab() then |
| 4011 | + | menu:addOption(tr('Invite to private chat'), function() g_game.inviteToOwnChannel(creatureName) end) |
| 4012 | + | menu:addOption(tr('Exclude from private chat'), function() g_game.excludeFromOwnChannel(creatureName) end) -- [TODO] must be removed after message's popup labels been implemented |
| 4013 | + | end |
| 4014 | + | if not localPlayer:hasVip(creatureName) then |
| 4015 | + | menu:addOption(tr('Add to VIP list'), function() g_game.addVip(creatureName) end) |
| 4016 | + | end |
| 4017 | + | |
| 4018 | + | if modules.game_console.isIgnored(creatureName) then |
| 4019 | + | menu:addOption(tr('Unignore') .. ' ' .. creatureName, function() modules.game_console.removeIgnoredPlayer(creatureName) end) |
| 4020 | + | else |
| 4021 | + | menu:addOption(tr('Ignore') .. ' ' .. creatureName, function() modules.game_console.addIgnoredPlayer(creatureName) end) |
| 4022 | + | end |
| 4023 | + | |
| 4024 | + | local localPlayerShield = localPlayer:getShield() |
| 4025 | + | local creatureShield = creatureThing:getShield() |
| 4026 | + | |
| 4027 | + | if localPlayerShield == ShieldNone or localPlayerShield == ShieldWhiteBlue then |
| 4028 | + | if creatureShield == ShieldWhiteYellow then |
| 4029 | + | menu:addOption(tr('Join %s\'s Party', creatureThing:getName()), function() g_game.partyJoin(creatureThing:getId()) end) |
| 4030 | + | else |
| 4031 | + | menu:addOption(tr('Invite to Party'), function() g_game.partyInvite(creatureThing:getId()) end) |
| 4032 | + | end |
| 4033 | + | elseif localPlayerShield == ShieldWhiteYellow then |
| 4034 | + | if creatureShield == ShieldWhiteBlue then |
| 4035 | + | menu:addOption(tr('Revoke %s\'s Invitation', creatureThing:getName()), function() g_game.partyRevokeInvitation(creatureThing:getId()) end) |
| 4036 | + | end |
| 4037 | + | elseif localPlayerShield == ShieldYellow or localPlayerShield == ShieldYellowSharedExp or localPlayerShield == ShieldYellowNoSharedExpBlink or localPlayerShield == ShieldYellowNoSharedExp then |
| 4038 | + | if creatureShield == ShieldWhiteBlue then |
| 4039 | + | menu:addOption(tr('Revoke %s\'s Invitation', creatureThing:getName()), function() g_game.partyRevokeInvitation(creatureThing:getId()) end) |
| 4040 | + | elseif creatureShield == ShieldBlue or creatureShield == ShieldBlueSharedExp or creatureShield == ShieldBlueNoSharedExpBlink or creatureShield == ShieldBlueNoSharedExp then |
| 4041 | + | menu:addOption(tr('Pass Leadership to %s', creatureThing:getName()), function() g_game.partyPassLeadership(creatureThing:getId()) end) |
| 4042 | + | else |
| 4043 | + | menu:addOption(tr('Invite to Party'), function() g_game.partyInvite(creatureThing:getId()) end) |
| 4044 | + | end |
| 4045 | + | end |
| 4046 | + | end |
| 4047 | + | end |
| 4048 | + | |
| 4049 | + | if modules.game_ruleviolation.hasWindowAccess() and creatureThing:isPlayer() then |
| 4050 | + | menu:addSeparator() |
| 4051 | + | menu:addOption(tr('Rule Violation'), function() modules.game_ruleviolation.show(creatureThing:getName()) end) |
| 4052 | + | end |
| 4053 | + | |
| 4054 | + | menu:addSeparator() |
| 4055 | + | menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(creatureThing:getName()) end) |
| 4056 | + | end |
| 4057 | + | |
| 4058 | + | -- hooked menu options |
| 4059 | + | for _,category in pairs(hookedMenuOptions) do |
| 4060 | + | if not isMenuHookCategoryEmpty(category) then |
| 4061 | + | menu:addSeparator() |
| 4062 | + | for name,opt in pairs(category) do |
| 4063 | + | if opt and opt.condition(menuPosition, lookThing, useThing, creatureThing) then |
| 4064 | + | menu:addOption(name, function() opt.callback(menuPosition, |
| 4065 | + | lookThing, useThing, creatureThing) end, opt.shortcut) |
| 4066 | + | end |
| 4067 | + | end |
| 4068 | + | end |
| 4069 | + | end |
| 4070 | + | |
| 4071 | + | if g_game.getFeature(GameBot) and useThing and useThing:isItem() then |
| 4072 | + | menu:addSeparator() |
| 4073 | + | if useThing:getSubType() > 1 then |
| 4074 | + | menu:addOption("ID: " .. useThing:getId() .. " SubType: " .. useThing:getSubType(), function() end) |
| 4075 | + | else |
| 4076 | + | menu:addOption("ID: " .. useThing:getId(), function() end) |
| 4077 | + | end |
| 4078 | + | end |
| 4079 | + | |
| 4080 | + | menu:display(menuPosition) |
| 4081 | + | end |
| 4082 | + | |
| 4083 | + | function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing, attackCreature, marking) |
| 4084 | + | local keyboardModifiers = g_keyboard.getModifiers() |
| 4085 | + | |
| 4086 | + | if g_app.isMobile() then |
| 4087 | + | if mouseButton == MouseRightButton then |
| 4088 | + | createThingMenu(menuPosition, lookThing, useThing, creatureThing) |
| 4089 | + | return true |
| 4090 | + | end |
| 4091 | + | if mouseButton ~= MouseLeftButton and mouseButton ~= MouseTouch2 and mouseButton ~= MouseTouch3 then |
| 4092 | + | return false |
| 4093 | + | end |
| 4094 | + | local action = getLeftAction() |
| 4095 | + | local player = g_game.getLocalPlayer() |
| 4096 | + | |
| 4097 | + | if creatureThing then |
| 4098 | + | if creatureThing:isNpc() then |
| 4099 | + | action = "attack" |
| 4100 | + | elseif creatureThing:isPlayer() and creatureThing ~= player then |
| 4101 | + | action = "look" |
| 4102 | + | end |
| 4103 | + | elseif useThing then |
| 4104 | + | if useThing:getStackPriority() < 04 then |
| 4105 | + | action = "" |
| 4106 | + | elseif useThing:isContainer() or useThing:isMultiUse() or useThing:isItem() then |
| 4107 | + | action = "use" |
| 4108 | + | end |
| 4109 | + | else |
| 4110 | + | action = "" |
| 4111 | + | end |
| 4112 | + | |
| 4113 | + | if action == "look" then |
| 4114 | + | if lookThing then |
| 4115 | + | g_game.look(lookThing) |
| 4116 | + | return true |
| 4117 | + | end |
| 4118 | + | return true |
| 4119 | + | elseif action == "use" then |
| 4120 | + | if useThing then |
| 4121 | + | if useThing:isContainer() then |
| 4122 | + | if useThing:getParentContainer() then |
| 4123 | + | g_game.open(useThing, useThing:getParentContainer()) |
| 4124 | + | else |
| 4125 | + | g_game.open(useThing) |
| 4126 | + | end |
| 4127 | + | return true |
| 4128 | + | elseif useThing:isMultiUse() then |
| 4129 | + | startUseWith(useThing) |
| 4130 | + | return true |
| 4131 | + | else |
| 4132 | + | g_game.use(useThing) |
| 4133 | + | return true |
| 4134 | + | end |
| 4135 | + | end |
| 4136 | + | return true |
| 4137 | + | elseif action == "attack" then |
| 4138 | + | if attackCreature and attackCreature ~= player then |
| 4139 | + | --resetLeftActions() |
| 4140 | + | g_game.attack(attackCreature) |
| 4141 | + | modules.game_walking.setPressKeyAction(05) |
| 4142 | + | return true |
| 4143 | + | elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then |
| 4144 | + | --resetLeftActions() |
| 4145 | + | g_game.attack(creatureThing) |
| 4146 | + | modules.game_walking.setPressKeyAction(05) |
| 4147 | + | return true |
| 4148 | + | end |
| 4149 | + | return true |
| 4150 | + | elseif action == "follow" then |
| 4151 | + | if attackCreature and attackCreature ~= player then |
| 4152 | + | --resetLeftActions() |
| 4153 | + | g_game.follow(attackCreature) |
| 4154 | + | return true |
| 4155 | + | elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then |
| 4156 | + | --resetLeftActions() |
| 4157 | + | g_game.follow(creatureThing) |
| 4158 | + | return true |
| 4159 | + | end |
| 4160 | + | return true |
| 4161 | + | elseif not autoWalkPos and useThing then |
| 4162 | + | createThingMenu(menuPosition, lookThing, useThing, creatureThing) |
| 4163 | + | return true |
| 4164 | + | end |
| 4165 | + | elseif not modules.client_options.getOption('classicControl') then |
| 4166 | + | if keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then |
| 4167 | + | createThingMenu(menuPosition, lookThing, useThing, creatureThing) |
| 4168 | + | return true |
| 4169 | + | elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4170 | + | g_game.look(lookThing) |
| 4171 | + | return true |
| 4172 | + | elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4173 | + | if useThing:isContainer() then |
| 4174 | + | if useThing:getParentContainer() then |
| 4175 | + | g_game.open(useThing, useThing:getParentContainer()) |
| 4176 | + | else |
| 4177 | + | g_game.open(useThing) |
| 4178 | + | end |
| 4179 | + | return true |
| 4180 | + | elseif useThing:isMultiUse() then |
| 4181 | + | startUseWith(useThing) |
| 4182 | + | return true |
| 4183 | + | else |
| 4184 | + | g_game.use(useThing) |
| 4185 | + | return true |
| 4186 | + | end |
| 4187 | + | return true |
| 4188 | + | elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4189 | + | if attackCreature:isPlayer() then |
| 4190 | + | if modules.game_menu.getPvPMode() then |
| 4191 | + | g_game.attack(attackCreature) |
| 4192 | + | modules.game_walking.setPressKeyAction(05) |
| 4193 | + | if modules.game_menu.getPvPMode() == false then |
| 4194 | + | modules.game_menu.PvPMode() |
| 4195 | + | end |
| 4196 | + | else |
| 4197 | + | g_game.attack(nil) |
| 4198 | + | end |
| 4199 | + | else |
| 4200 | + | g_game.attack(attackCreature) |
| 4201 | + | modules.game_walking.setPressKeyAction(05) |
| 4202 | + | end |
| 4203 | + | return true |
| 4204 | + | elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4205 | + | if creatureThing:isPlayer() then |
| 4206 | + | if modules.game_menu.getPvPMode() then |
| 4207 | + | g_game.attack(creatureThing) |
| 4208 | + | modules.game_walking.setPressKeyAction(05) |
| 4209 | + | if modules.game_menu.getPvPMode() == false then |
| 4210 | + | modules.game_menu.PvPMode() |
| 4211 | + | end |
| 4212 | + | else |
| 4213 | + | g_game.attack(nil) |
| 4214 | + | end |
| 4215 | + | else |
| 4216 | + | g_game.attack(creatureThing) |
| 4217 | + | modules.game_walking.setPressKeyAction(05) |
| 4218 | + | end |
| 4219 | + | return true |
| 4220 | + | end |
| 4221 | + | else -- classic control |
| 4222 | + | if useThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then |
| 4223 | + | local player = g_game.getLocalPlayer() |
| 4224 | + | if attackCreature and attackCreature ~= player then |
| 4225 | + | if attackCreature:isPlayer() then |
| 4226 | + | if modules.game_menu.getPvPMode() then |
| 4227 | + | g_game.attack(attackCreature) |
| 4228 | + | modules.game_walking.setPressKeyAction(05) |
| 4229 | + | if modules.game_menu.getPvPMode() == false then |
| 4230 | + | modules.game_menu.PvPMode() |
| 4231 | + | end |
| 4232 | + | else |
| 4233 | + | g_game.attack(nil) |
| 4234 | + | end |
| 4235 | + | else |
| 4236 | + | g_game.attack(attackCreature) |
| 4237 | + | modules.game_walking.setPressKeyAction(05) |
| 4238 | + | end |
| 4239 | + | return true |
| 4240 | + | elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then |
| 4241 | + | if creatureThing:isPlayer() then |
| 4242 | + | if modules.game_menu.getPvPMode() then |
| 4243 | + | g_game.attack(creatureThing) |
| 4244 | + | modules.game_walking.setPressKeyAction(05) |
| 4245 | + | if modules.game_menu.getPvPMode() == false then |
| 4246 | + | modules.game_menu.PvPMode() |
| 4247 | + | end |
| 4248 | + | else |
| 4249 | + | g_game.attack(nil) |
| 4250 | + | end |
| 4251 | + | else |
| 4252 | + | g_game.attack(creatureThing) |
| 4253 | + | modules.game_walking.setPressKeyAction(05) |
| 4254 | + | end |
| 4255 | + | return true |
| 4256 | + | elseif useThing:isContainer() then |
| 4257 | + | if useThing:getParentContainer() then |
| 4258 | + | g_game.open(useThing, useThing:getParentContainer()) |
| 4259 | + | return true |
| 4260 | + | else |
| 4261 | + | g_game.open(useThing) |
| 4262 | + | return true |
| 4263 | + | end |
| 4264 | + | elseif useThing:isMultiUse() then |
| 4265 | + | startUseWith(useThing) |
| 4266 | + | return true |
| 4267 | + | else |
| 4268 | + | g_game.use(useThing) |
| 4269 | + | return true |
| 4270 | + | end |
| 4271 | + | return true |
| 4272 | + | elseif lookThing and keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4273 | + | g_game.look(lookThing) |
| 4274 | + | return true |
| 4275 | + | elseif lookThing and ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then |
| 4276 | + | g_game.look(lookThing) |
| 4277 | + | return true |
| 4278 | + | elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4279 | + | createThingMenu(menuPosition, lookThing, useThing, creatureThing) |
| 4280 | + | return true |
| 4281 | + | elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4282 | + | if attackCreature:isPlayer() then |
| 4283 | + | if modules.game_menu.getPvPMode() then |
| 4284 | + | g_game.attack(attackCreature) |
| 4285 | + | modules.game_walking.setPressKeyAction(05) |
| 4286 | + | if modules.game_menu.getPvPMode() == false then |
| 4287 | + | modules.game_menu.PvPMode() |
| 4288 | + | end |
| 4289 | + | else |
| 4290 | + | g_game.attack(nil) |
| 4291 | + | end |
| 4292 | + | else |
| 4293 | + | g_game.attack(attackCreature) |
| 4294 | + | modules.game_walking.setPressKeyAction(05) |
| 4295 | + | end |
| 4296 | + | return true |
| 4297 | + | elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then |
| 4298 | + | if creatureThing:isPlayer() then |
| 4299 | + | if modules.game_menu.getPvPMode() then |
| 4300 | + | g_game.attack(creatureThing) |
| 4301 | + | modules.game_walking.setPressKeyAction(05) |
| 4302 | + | if modules.game_menu.getPvPMode() == false then |
| 4303 | + | modules.game_menu.PvPMode() |
| 4304 | + | end |
| 4305 | + | else |
| 4306 | + | g_game.attack(nil) |
| 4307 | + | end |
| 4308 | + | else |
| 4309 | + | g_game.attack(creatureThing) |
| 4310 | + | modules.game_walking.setPressKeyAction(05) |
| 4311 | + | end |
| 4312 | + | return true |
| 4313 | + | end |
| 4314 | + | end |
| 4315 | + | |
| 4316 | + | local player = g_game.getLocalPlayer() |
| 4317 | + | player:stopAutoWalk() |
| 4318 | + | |
| 4319 | + | if autoWalkPos and keyboardModifiers == KeyboardNoModifier and (mouseButton == MouseLeftButton or mouseButton == MouseTouch2 or mouseButton == MouseTouch3) then |
| 4320 | + | local autoWalkTile = g_map.getTile(autoWalkPos) |
| 4321 | + | if autoWalkTile and not autoWalkTile:isWalkable(true) then |
| 4322 | + | modules.game_textmessage.displayFailureMessage(tr('Sorry, not possible.')) |
| 4323 | + | return false |
| 4324 | + | end |
| 4325 | + | |
| 4326 | + | modules.game_walking.setPressKeyAction(02) |
| 4327 | + | player:autoWalk(autoWalkPos) |
| 4328 | + | return true |
| 4329 | + | end |
| 4330 | + | |
| 4331 | + | return false |
| 4332 | + | end |
| 4333 | + | |
| 4334 | + | function moveStackableItem(item, toPos) |
| 4335 | + | if countWindow then |
| 4336 | + | return |
| 4337 | + | end |
| 4338 | + | if g_keyboard.isCtrlPressed() then |
| 4339 | + | g_game.move(item, toPos, item:getCount()) |
| 4340 | + | return |
| 4341 | + | elseif g_keyboard.isShiftPressed() then |
| 4342 | + | g_game.move(item, toPos, 1) |
| 4343 | + | return |
| 4344 | + | end |
| 4345 | + | local count = item:getCount() |
| 4346 | + | |
| 4347 | + | countWindow = g_ui.createWidget('CountWindow', rootWidget) |
| 4348 | + | local itembox = countWindow:getChildById('item') |
| 4349 | + | local scrollbar = countWindow:getChildById('countScrollBar') |
| 4350 | + | itembox:setItemId(item:getId()) |
| 4351 | + | itembox:setItemCount(count) |
| 4352 | + | scrollbar:setMaximum(count) |
| 4353 | + | scrollbar:setMinimum(1) |
| 4354 | + | scrollbar:setValue(count) |
| 4355 | + | |
| 4356 | + | local spinbox = countWindow:getChildById('spinBox') |
| 4357 | + | spinbox:setMaximum(count) |
| 4358 | + | spinbox:setMinimum(0) |
| 4359 | + | spinbox:setValue(0) |
| 4360 | + | spinbox:hideButtons() |
| 4361 | + | spinbox:focus() |
| 4362 | + | spinbox.firstEdit = true |
| 4363 | + | |
| 4364 | + | local spinBoxValueChange = function(self, value) |
| 4365 | + | spinbox.firstEdit = false |
| 4366 | + | scrollbar:setValue(value) |
| 4367 | + | end |
| 4368 | + | spinbox.onValueChange = spinBoxValueChange |
| 4369 | + | |
| 4370 | + | local check = function() |
| 4371 | + | if spinbox.firstEdit then |
| 4372 | + | spinbox:setValue(spinbox:getMaximum()) |
| 4373 | + | spinbox.firstEdit = false |
| 4374 | + | end |
| 4375 | + | end |
| 4376 | + | local okButton = countWindow:getChildById('buttonOk') |
| 4377 | + | local moveFunc = function() |
| 4378 | + | g_game.move(item, toPos, itembox:getItemCount()) |
| 4379 | + | okButton:getParent():destroy() |
| 4380 | + | countWindow = nil |
| 4381 | + | end |
| 4382 | + | local cancelButton = countWindow:getChildById('buttonCancel') |
| 4383 | + | local cancelFunc = function() |
| 4384 | + | cancelButton:getParent():destroy() |
| 4385 | + | countWindow = nil |
| 4386 | + | end |
| 4387 | + | |
| 4388 | + | |
| 4389 | + | g_keyboard.bindKeyPress("Up", function() check() spinbox:up() end, spinbox) |
| 4390 | + | g_keyboard.bindKeyPress("Down", function() check() spinbox:down() end, spinbox) |
| 4391 | + | g_keyboard.bindKeyPress("Right", function() check() spinbox:up() end, spinbox) |
| 4392 | + | g_keyboard.bindKeyPress("Left", function() check() spinbox:down() end, spinbox) |
| 4393 | + | g_keyboard.bindKeyPress("PageUp", function() check() spinbox:setValue(spinbox:getValue()+10) end, spinbox) |
| 4394 | + | g_keyboard.bindKeyPress("PageDown", function() check() spinbox:setValue(spinbox:getValue()-10) end, spinbox) |
| 4395 | + | g_keyboard.bindKeyPress("Enter", function() moveFunc() end, spinbox) |
| 4396 | + | |
| 4397 | + | scrollbar.onValueChange = function(self, value) |
| 4398 | + | itembox:setItemCount(value) |
| 4399 | + | spinbox.onValueChange = nil |
| 4400 | + | spinbox:setValue(value) |
| 4401 | + | spinbox.onValueChange = spinBoxValueChange |
| 4402 | + | end |
| 4403 | + | countWindow.onEnter = moveFunc |
| 4404 | + | countWindow.onEscape = cancelFunc |
| 4405 | + | |
| 4406 | + | okButton.onClick = moveFunc |
| 4407 | + | cancelButton.onClick = cancelFunc |
| 4408 | + | end |
| 4409 | + | |
| 4410 | + | function getRootPanel() |
| 4411 | + | return gameRootPanel |
| 4412 | + | end |
| 4413 | + | |
| 4414 | + | function getMapPanel() |
| 4415 | + | return gameMapPanel |
| 4416 | + | end |
| 4417 | + | |
| 4418 | + | function getRightPanel() |
| 4419 | + | if gameRightPanels:getChildCount() == 0 then |
| 4420 | + | addRightPanel() |
| 4421 | + | end |
| 4422 | + | return gameRightPanels:getChildByIndex(-1) |
| 4423 | + | end |
| 4424 | + | |
| 4425 | + | function getLeftPanel() |
| 4426 | + | if gameLeftPanels:getChildCount() >= 1 then |
| 4427 | + | return gameLeftPanels:getChildByIndex(-1) |
| 4428 | + | end |
| 4429 | + | return getRightPanel() |
| 4430 | + | end |
| 4431 | + | |
| 4432 | + | function getContainerPanel() |
| 4433 | + | local containerPanel = g_settings.getNumber("containerPanel") |
| 4434 | + | if containerPanel >= 5 then |
| 4435 | + | containerPanel = containerPanel - 4 |
| 4436 | + | return gameRightPanels:getChildByIndex(math.min(containerPanel, gameRightPanels:getChildCount())) |
| 4437 | + | end |
| 4438 | + | if gameLeftPanels:getChildCount() == 0 then |
| 4439 | + | return getRightPanel() |
| 4440 | + | end |
| 4441 | + | return gameLeftPanels:getChildByIndex(math.min(containerPanel, gameLeftPanels:getChildCount())) |
| 4442 | + | end |
| 4443 | + | |
| 4444 | + | local function addRightPanel() |
| 4445 | + | if gameRightPanels:getChildCount() >= 4 then |
| 4446 | + | return |
| 4447 | + | end |
| 4448 | + | local panel = g_ui.createWidget('GameSidePanel') |
| 4449 | + | panel:setId("rightPanel" .. (gameRightPanels:getChildCount() + 1)) |
| 4450 | + | gameRightPanels:insertChild(1, panel) |
| 4451 | + | end |
| 4452 | + | |
| 4453 | + | local function addLeftPanel() |
| 4454 | + | if gameLeftPanels:getChildCount() >= 4 then |
| 4455 | + | return |
| 4456 | + | end |
| 4457 | + | local panel = g_ui.createWidget('GameSidePanel') |
| 4458 | + | panel:setId("leftPanel" .. (gameLeftPanels:getChildCount() + 1)) |
| 4459 | + | gameLeftPanels:addChild(panel) |
| 4460 | + | end |
| 4461 | + | |
| 4462 | + | local function removeRightPanel() |
| 4463 | + | if gameRightPanels:getChildCount() <= 1 then |
| 4464 | + | return |
| 4465 | + | end |
| 4466 | + | local panel = gameRightPanels:getChildByIndex(1) |
| 4467 | + | panel:moveTo(gameRightPanels:getChildByIndex(2)) |
| 4468 | + | gameRightPanels:removeChild(panel) |
| 4469 | + | end |
| 4470 | + | |
| 4471 | + | local function removeLeftPanel() |
| 4472 | + | if gameLeftPanels:getChildCount() == 0 then |
| 4473 | + | return |
| 4474 | + | end |
| 4475 | + | local panel = gameLeftPanels:getChildByIndex(-1) |
| 4476 | + | if gameLeftPanels:getChildCount() >= 2 then |
| 4477 | + | panel:moveTo(gameLeftPanels:getChildByIndex(-2)) |
| 4478 | + | else |
| 4479 | + | panel:moveTo(gameRightPanels:getChildByIndex(1)) |
| 4480 | + | end |
| 4481 | + | gameLeftPanels:removeChild(panel) |
| 4482 | + | end |
| 4483 | + | |
| 4484 | + | function getBottomPanel() |
| 4485 | + | return gameBottomPanel |
| 4486 | + | end |
| 4487 | + | |
| 4488 | + | function getActionPanel() |
| 4489 | + | return gameActionPanel |
| 4490 | + | end |
| 4491 | + | |
| 4492 | + | function refreshViewMode() |
| 4493 | + | local classic = false--g_settings.getBoolean("classicView") and not g_app.isMobile() |
| 4494 | + | local rightPanels = g_settings.getNumber("rightPanels") - gameRightPanels:getChildCount() |
| 4495 | + | local leftPanels = g_settings.getNumber("leftPanels") - 1 - gameLeftPanels:getChildCount() |
| 4496 | + | |
| 4497 | + | while rightPanels ~= 0 do |
| 4498 | + | if rightPanels > 0 then |
| 4499 | + | addRightPanel() |
| 4500 | + | rightPanels = rightPanels - 1 |
| 4501 | + | else |
| 4502 | + | removeRightPanel() |
| 4503 | + | rightPanels = rightPanels + 1 |
| 4504 | + | end |
| 4505 | + | end |
| 4506 | + | while leftPanels ~= 0 do |
| 4507 | + | if leftPanels > 0 then |
| 4508 | + | addLeftPanel() |
| 4509 | + | leftPanels = leftPanels - 1 |
| 4510 | + | else |
| 4511 | + | removeLeftPanel() |
| 4512 | + | leftPanels = leftPanels + 1 |
| 4513 | + | end |
| 4514 | + | end |
| 4515 | + | |
| 4516 | + | if not g_game.isOnline() then |
| 4517 | + | return |
| 4518 | + | end |
| 4519 | + | |
| 4520 | + | local minimumWidth = (g_settings.getNumber("rightPanels") + g_settings.getNumber("leftPanels") - 1) * 200 + 200 |
| 4521 | + | minimumWidth = math.max(minimumWidth, g_resources.getLayout() == "mobile" and 640 or 800) |
| 4522 | + | g_window.setMinimumSize({ width = minimumWidth, height = (g_resources.getLayout() == "mobile" and 360 or 600)}) |
| 4523 | + | if g_window.getWidth() < minimumWidth then |
| 4524 | + | local oldPos = g_window.getPosition() |
| 4525 | + | local size = { width = minimumWidth, height = g_window.getHeight() } |
| 4526 | + | g_window.resize(size) |
| 4527 | + | g_window.move(oldPos) |
| 4528 | + | end |
| 4529 | + | |
| 4530 | + | for i=1,gameRightPanels:getChildCount()+gameLeftPanels:getChildCount() do |
| 4531 | + | local panel |
| 4532 | + | if i > gameRightPanels:getChildCount() then |
| 4533 | + | panel = gameLeftPanels:getChildByIndex(i - gameRightPanels:getChildCount()) |
| 4534 | + | else |
| 4535 | + | panel = gameRightPanels:getChildByIndex(i) |
| 4536 | + | end |
| 4537 | + | if classic then |
| 4538 | + | panel:setImageColor('white') |
| 4539 | + | else |
| 4540 | + | panel:setImageColor('alpha') |
| 4541 | + | end |
| 4542 | + | end |
| 4543 | + | |
| 4544 | + | if classic then |
| 4545 | + | gameRightPanels:setMarginTop(0) |
| 4546 | + | gameLeftPanels:setMarginTop(0) |
| 4547 | + | gameMapPanel:setMarginLeft(0) |
| 4548 | + | gameMapPanel:setMarginRight(0) |
| 4549 | + | gameMapPanel:setMarginTop(0) |
| 4550 | + | end |
| 4551 | + | |
| 4552 | + | gameMapPanel:setVisibleDimension({ width = 15, height = 11 }) |
| 4553 | + | |
| 4554 | + | if classic then |
| 4555 | + | g_game.changeMapAwareRange(19, 15) |
| 4556 | + | gameMapPanel:addAnchor(AnchorLeft, 'gameLeftPanels', AnchorRight) |
| 4557 | + | gameMapPanel:addAnchor(AnchorRight, 'gameRightPanels', AnchorLeft) |
| 4558 | + | gameMapPanel:addAnchor(AnchorBottom, 'gameActionPanel', AnchorTop) |
| 4559 | + | gameMapPanel:setKeepAspectRatio(true) |
| 4560 | + | gameMapPanel:setLimitVisibleRange(false) |
| 4561 | + | gameMapPanel:setOn(true) -- frame |
| 4562 | + | |
| 4563 | + | modules.client_topmenu.getTopMenu():setImageColor('white') |
| 4564 | + | |
| 4565 | + | if modules.game_console then |
| 4566 | + | modules.game_console.switchMode(false) |
| 4567 | + | end |
| 4568 | + | else |
| 4569 | + | g_game.changeMapAwareRange(31, 21) |
| 4570 | + | gameMapPanel:fill('parent') |
| 4571 | + | gameMapPanel:setKeepAspectRatio(false) |
| 4572 | + | gameMapPanel:setLimitVisibleRange(false) |
| 4573 | + | gameMapPanel:setOn(true) |
| 4574 | + | if modules.game_alert.onGetCinematic() then |
| 4575 | + | gameMapPanel:setZoom(15) |
| 4576 | + | else |
| 4577 | + | if g_settings.getNumber('zoomLevel') == 1 then |
| 4578 | + | gameMapPanel:setZoom(10) |
| 4579 | + | elseif g_settings.getNumber('zoomLevel') == 2 then |
| 4580 | + | gameMapPanel:setZoom(11) |
| 4581 | + | elseif g_settings.getNumber('zoomLevel') == 3 then |
| 4582 | + | gameMapPanel:setZoom(12) |
| 4583 | + | elseif g_settings.getNumber('zoomLevel') == 4 then |
| 4584 | + | gameMapPanel:setZoom(13) |
| 4585 | + | elseif g_settings.getNumber('zoomLevel') == 5 then |
| 4586 | + | gameMapPanel:setZoom(14) |
| 4587 | + | elseif g_settings.getNumber('zoomLevel') == 6 then |
| 4588 | + | gameMapPanel:setZoom(15) |
| 4589 | + | else |
| 4590 | + | gameMapPanel:setZoom(defaultZoom) |
| 4591 | + | end |
| 4592 | + | end |
| 4593 | + | |
| 4594 | + | modules.client_topmenu.getTopMenu():setImageColor('#ffffff66') |
| 4595 | + | if g_app.isMobile() then |
| 4596 | + | gameMapPanel:setMarginTop(-32) |
| 4597 | + | scheduleEvent(function() |
| 4598 | + | g_game.talk(g_game.talk("!inventario 34 04")) |
| 4599 | + | end, 1000) |
| 4600 | + | end |
| 4601 | + | if modules.game_console then |
| 4602 | + | modules.game_console.switchMode(true) |
| 4603 | + | end |
| 4604 | + | end |
| 4605 | + | if modules.game_actionbar then |
| 4606 | + | modules.game_actionbar.switchMode(not classic) |
| 4607 | + | end |
| 4608 | + | |
| 4609 | + | if g_settings.getBoolean("cacheMap") then |
| 4610 | + | g_game.enableFeature(GameBiggerMapCache) |
| 4611 | + | end |
| 4612 | + | |
| 4613 | + | updateSize() |
| 4614 | + | end |
| 4615 | + | |
| 4616 | + | function limitZoom() |
| 4617 | + | limitedZoom = false |
| 4618 | + | end |
| 4619 | + | |
| 4620 | + | function updateSize() |
| 4621 | + | if g_app.isMobile() then return end |
| 4622 | + | modules.game_menu.onPositionHub() |
| 4623 | + | --g_window.maximize() |
| 4624 | + | |
| 4625 | + | local classic = g_settings.getBoolean("classicView") |
| 4626 | + | local height = gameMapPanel:getHeight() |
| 4627 | + | local width = gameMapPanel:getWidth() |
| 4628 | + | |
| 4629 | + | if not classic then |
| 4630 | + | local rheight = gameRootPanel:getHeight() |
| 4631 | + | local rwidth = gameRootPanel:getWidth() |
| 4632 | + | |
| 4633 | + | local dimenstion = gameMapPanel:getVisibleDimension() |
| 4634 | + | local zoom = gameMapPanel:getZoom() |
| 4635 | + | local awareRange = g_map.getAwareRange() |
| 4636 | + | local dheight = dimenstion.height |
| 4637 | + | local dwidth = dimenstion.width |
| 4638 | + | local tileSize = rheight / dheight |
| 4639 | + | local maxWidth = tileSize * (awareRange.width + 1) |
| 4640 | + | if g_game.getFeature(GameChangeMapAwareRange) and g_game.getFeature(GameNewWalking) then |
| 4641 | + | maxWidth = tileSize * (awareRange.width - 1) |
| 4642 | + | end |
| 4643 | + | gameMapPanel:setMarginTop(-tileSize) |
| 4644 | + | if modules.game_stats then |
| 4645 | + | modules.game_stats.ui:setMarginTop(tileSize) |
| 4646 | + | end |
| 4647 | + | if g_settings.getBoolean("cacheMap") then |
| 4648 | + | gameMapPanel:setMarginLeft(0) |
| 4649 | + | gameMapPanel:setMarginRight(0) |
| 4650 | + | else |
| 4651 | + | local margin = math.max(0, math.floor((rwidth - maxWidth) / 2)) |
| 4652 | + | gameMapPanel:setMarginLeft(margin) |
| 4653 | + | gameMapPanel:setMarginRight(margin) |
| 4654 | + | end |
| 4655 | + | |
| 4656 | + | if modules.game_bot then |
| 4657 | + | for i, child in ipairs(gameMapPanel:getChildren()) do |
| 4658 | + | if child.botIcon and child.onGeometryChange then |
| 4659 | + | child.onGeometryChange(child) |
| 4660 | + | end |
| 4661 | + | end |
| 4662 | + | end |
| 4663 | + | else |
| 4664 | + | if modules.game_stats then |
| 4665 | + | modules.game_stats.ui:setMarginTop(0) |
| 4666 | + | end |
| 4667 | + | end |
| 4668 | + | |
| 4669 | + | modules.game_menu.onPositionHub() |
| 4670 | + | --[[ |
| 4671 | + | local maxWidth = math.floor(height * 2) |
| 4672 | + | local extraMargin = 0 |
| 4673 | + | if width >= maxWidth then |
| 4674 | + | extraMargin = math.ceil((width - maxWidth) / 2) |
| 4675 | + | end |
| 4676 | + | local bottomMaxWidth = 1200 -- something broken, it's not pixels |
| 4677 | + | local bottomMargin = 0 |
| 4678 | + | if width > bottomMaxWidth then |
| 4679 | + | bottomMargin = math.ceil((width - bottomMaxWidth) / 2) |
| 4680 | + | end |
| 4681 | + | gameMapPanel:setMarginLeft(extraMargin) |
| 4682 | + | gameMapPanel:setMarginRight(extraMargin) ]] |
| 4683 | + | end |
| 4684 | + | |
| 4685 | + | function setupLeftActions() |
| 4686 | + | if not g_app.isMobile() then return end |
| 4687 | + | for _, widget in ipairs(gameLeftActions:getChildren()) do |
| 4688 | + | widget.image:setChecked(false) |
| 4689 | + | widget.lastClicked = 0 |
| 4690 | + | widget.onClick = function() |
| 4691 | + | if widget.image:isChecked() then |
| 4692 | + | widget.image:setChecked(false) |
| 4693 | + | if widget.doubleClickAction and widget.lastClicked + 200 > g_clock.millis() then |
| 4694 | + | widget.doubleClickAction() |
| 4695 | + | end |
| 4696 | + | return |
| 4697 | + | end |
| 4698 | + | resetLeftActions() |
| 4699 | + | widget.image:setChecked(true) |
| 4700 | + | widget.lastClicked = g_clock.millis() |
| 4701 | + | end |
| 4702 | + | end |
| 4703 | + | if gameLeftActions.use then |
| 4704 | + | gameLeftActions.use.doubleClickAction = function() |
| 4705 | + | local player = g_game.getLocalPlayer() |
| 4706 | + | local dir = player:getDirection() |
| 4707 | + | local usePos = player:getPrewalkingPosition(true) |
| 4708 | + | if dir == North then |
| 4709 | + | usePos.y = usePos.y - 1 |
| 4710 | + | elseif dir == East then |
| 4711 | + | usePos.x = usePos.x + 1 |
| 4712 | + | elseif dir == South then |
| 4713 | + | usePos.y = usePos.y + 1 |
| 4714 | + | elseif dir == West then |
| 4715 | + | usePos.x = usePos.x - 1 |
| 4716 | + | end |
| 4717 | + | local tile = g_map.getTile(usePos) |
| 4718 | + | if not tile then return end |
| 4719 | + | local thing = tile:getTopUseThing() |
| 4720 | + | if thing then |
| 4721 | + | g_game.use(thing) |
| 4722 | + | end |
| 4723 | + | end |
| 4724 | + | end |
| 4725 | + | if gameLeftActions.attack then |
| 4726 | + | gameLeftActions.attack.doubleClickAction = function() |
| 4727 | + | local battlePanel = modules.game_battle.battlePanel |
| 4728 | + | local attackedCreature = g_game.getAttackingCreature() |
| 4729 | + | local child = battlePanel:getFirstChild() |
| 4730 | + | if child and (not child.creature or not child:isOn()) then |
| 4731 | + | child = nil |
| 4732 | + | end |
| 4733 | + | if child then |
| 4734 | + | g_game.attack(child.creature) |
| 4735 | + | modules.game_walking.setPressKeyAction(05) |
| 4736 | + | else |
| 4737 | + | g_game.attack(nil) |
| 4738 | + | end |
| 4739 | + | end |
| 4740 | + | end |
| 4741 | + | if gameLeftActions.follow then |
| 4742 | + | gameLeftActions.follow.doubleClickAction = function() |
| 4743 | + | local battlePanel = modules.game_battle.battlePanel |
| 4744 | + | local attackedCreature = g_game.getAttackingCreature() |
| 4745 | + | local child = battlePanel:getFirstChild() |
| 4746 | + | if child and (not child.creature or not child:isOn()) then |
| 4747 | + | child = nil |
| 4748 | + | end |
| 4749 | + | if child then |
| 4750 | + | g_game.follow(child.creature) |
| 4751 | + | else |
| 4752 | + | g_game.follow(nil) |
| 4753 | + | end |
| 4754 | + | end |
| 4755 | + | end |
| 4756 | + | if gameLeftActions.look then |
| 4757 | + | gameLeftActions.look.doubleClickAction = function() |
| 4758 | + | local battlePanel = modules.game_battle.battlePanel |
| 4759 | + | local attackedCreature = g_game.getAttackingCreature() |
| 4760 | + | local child = battlePanel:getFirstChild() |
| 4761 | + | if child and (not child.creature or child:isHidden()) then |
| 4762 | + | child = nil |
| 4763 | + | end |
| 4764 | + | if child then |
| 4765 | + | g_game.look(child.creature) |
| 4766 | + | end |
| 4767 | + | end |
| 4768 | + | end |
| 4769 | + | if not gameLeftActions.chat then return end |
| 4770 | + | gameLeftActions.chat.onClick = function() |
| 4771 | + | if gameBottomPanel:getHeight() <= 5 then |
| 4772 | + | gameBottomPanel:setHeight(90) |
| 4773 | + | else |
| 4774 | + | gameBottomPanel:setHeight(0) |
| 4775 | + | end |
| 4776 | + | end |
| 4777 | + | end |
| 4778 | + | |
| 4779 | + | function onChatShow() |
| 4780 | + | MOBILE_EXIT_MENU = modules.game_interface.onMobileWindow(24) |
| 4781 | + | if MOBILE_EXIT_MENU:isVisible() then |
| 4782 | + | return |
| 4783 | + | end |
| 4784 | + | if gameBottomPanel:getHeight() <= 5 then |
| 4785 | + | modules.game_console.onEndNPChat() |
| 4786 | + | modules.game_alert.onHideDisplayMsg() |
| 4787 | + | gameBottomPanel:setHeight(150) |
| 4788 | + | gameBottomPanel:setMarginLeft(190) |
| 4789 | + | gameBottomPanel:setMarginRight(65) |
| 4790 | + | gameBottomPanel:setMarginBottom(05) |
| 4791 | + | |
| 4792 | + | modules.client_mobile.onHideUI(02) |
| 4793 | + | else |
| 4794 | + | gameBottomPanel:setHeight(0) |
| 4795 | + | modules.client_mobile.onHideUI(03) |
| 4796 | + | modules.game_alert.onHideDisplayMsg() |
| 4797 | + | end |
| 4798 | + | end |
| 4799 | + | function resetLeftActions() |
| 4800 | + | for _, widget in ipairs(gameLeftActions:getChildren()) do |
| 4801 | + | widget.image:setChecked(false) |
| 4802 | + | widget.lastClicked = 0 |
| 4803 | + | end |
| 4804 | + | end |
| 4805 | + | |
| 4806 | + | function getLeftAction() |
| 4807 | + | --for _, widget in ipairs(gameLeftActions:getChildren()) do |
| 4808 | + | -- if widget.image:isChecked() then |
| 4809 | + | -- return widget:getId() |
| 4810 | + | -- end |
| 4811 | + | --end |
| 4812 | + | return "use" |
| 4813 | + | end |
| 4814 | + | |
| 4815 | + | function hidenChat() |
| 4816 | + | gameBottomPanel:setHeight(0) |
| 4817 | + | end |
| 4818 | + | function isChatVisible() |
| 4819 | + | return gameBottomPanel:getHeight() >= 5 |
| 4820 | + | end |
| 4821 | + | |
| 4822 | + | function getSplitter() |
| 4823 | + | return bottomSplitter |
| 4824 | + | end |