function onSay(player, words, param) local split = param:splitTrimmed(" ") local SECTION = tonumber(split[01]) local INDEX = tonumber(split[02]) if SECTION == 01 then player:setStorageValue(_DESAFIOS[00].DESAFIO_ID, INDEX) player:setStorageValue(_DESAFIOS[00].DESAFIO_COUNT, 00) local K = player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) local L = player:getStorageValue(_DESAFIOS[00].DESAFIO_COUNT) local M = player:getStorageValue(_SYSTEM.DESAFIOS_COIN) or 0 player:sendCancelMessage("@reloadDesafios " ..K.. " " ..L.. " " ..M) return false end if SECTION == 02 then local PAY_TYPE = tonumber(split[03]) if PAY_TYPE == 01 then if player:getStorageValue(_SYSTEM.DESAFIOS_COIN) < _SHOP_DESAFIO[INDEX].COINS then player:popupFYI("Você não possui pontos de desafio suficientes.") return false end else local SALDO_VIP = PlayerVipCoins(player, 00) if SALDO_VIP < _SHOP_DESAFIO[INDEX].VIP[02] then player:popupFYI("Você não possui vip coins suficientes.") return false end end if INDEX == 01 then -- EXTENSOR DE TASK if player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) < 01 then player:setStorageValue(_DESAFIOS[00].DESAFIO_TYPE, 01) player:setStorageValue(_DESAFIOS[00].DESAFIO_SHOP, 05) player:getPosition():sendMagicEffect(13) player:popupFYI("Compra realizada com sucesso.") else player:popupFYI("Você só pode ter 1 benefício ativo ao mesmo tempo.") return false end end if INDEX == 02 then -- DESCONSTRUTOR if player:getStorageValue(_DESAFIOS[00].DESAFIO_SHOP) < 01 then player:setStorageValue(_DESAFIOS[00].DESAFIO_TYPE, 02) player:setStorageValue(_DESAFIOS[00].DESAFIO_SHOP, 05) player:getPosition():sendMagicEffect(13) player:sendCancelMessage("@ToolsLoad " ..player:getStorageValue(_SYSTEM.TOOLS[01]).. " " ..player:getStorageValue(_SYSTEM.TOOLS[02]).. " 1") player:popupFYI("Compra realizada com sucesso.") player:sendCancelMessage("@TutorShow 51") else player:popupFYI("Você só pode ter 1 benefício ativo ao mesmo tempo.") return false end end if INDEX >= 03 then if _SHOP_DESAFIO[INDEX].SPECIAL_ID[01] == 01 then -- OUTFIT local OUTFIT_HE = _SHOP_DESAFIO[INDEX].SPECIAL_ID[02] local OUTFIT_SHE = _SHOP_DESAFIO[INDEX].SPECIAL_ID[03] if player:hasOutfit(OUTFIT_HE, 00) or player:hasOutfit(OUTFIT_SHE, 00) then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:popupFYI("Você já possui esta outfit.") return false else player:addOutfit(OUTFIT_HE, 01) player:addOutfit(OUTFIT_SHE, 01) player:popupFYI("Compra realizada com sucesso.") end end if _SHOP_DESAFIO[INDEX].SPECIAL_ID[01] == 02 then -- MONTARIAS local MOUNT_ID = _SHOP_DESAFIO[INDEX].SPECIAL_ID[02] if player:hasMount(MOUNT_ID) then player:getPosition():sendMagicEffect(CONST_ME_POFF) player:popupFYI("Você já possui esta montaria.") return false else player:addMount(MOUNT_ID) player:popupFYI("Compra realizada com sucesso.") player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) end end end if PAY_TYPE == 02 then PlayerVipCoins(player, 01, _SHOP_DESAFIO[INDEX].COINS) else player:setStorageValue(_SYSTEM.DESAFIOS_COIN, player:getStorageValue(_SYSTEM.DESAFIOS_COIN) - _SHOP_DESAFIO[INDEX].COINS) end local K = player:getStorageValue(_DESAFIOS[00].DESAFIO_ID) local L = player:getStorageValue(_DESAFIOS[00].DESAFIO_COUNT) local M = player:getStorageValue(_SYSTEM.DESAFIOS_COIN) or 0 player:sendCancelMessage("@reloadDesafios " ..K.. " " ..L.. " " ..M) doBackpack(player, 11) return false end return false end