Ir para conteúdo

TFS 1.5 {8.6} Nekiro Downgrade com montarias e modal window apenas para OTClient.

Featured Replies

Postado
  • Autor

Galera, atualizei a source. Sobre os erros que estavam ocorrendo, era o opcode 201. Sabe por quê? Eu tentei habilitar o opcode para ter uma store, mas não funcionou. Resolvi remover todos os códigos e agora não está mais dando erros de opcode 201 e tudo mais. Em breve, vou postar a store customizada, aquela das prints que vocês viram. Vou ter que organizar para cada site compatível, como Gesior, Znote, e outros. Depois posto aqui para vocês baixarem e testarem.

  • 2 weeks later...
  • Respostas 61
  • Visualizações 13.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • SHARINGAN.exe
    SHARINGAN.exe

    Caso alguém tenha interesse na dll, é só entrar em contato por aqui mesmo ou pelo meu discord: sharingan.exe

  • Mateus Robeerto
    Mateus Robeerto

    @doukxxt   Desculpa pela demora. Os últimos dias foram corridos. Decidi compartilhar isso com vocês   Abra o diretório otc/data/layouts/retro/styles/40-inventory.otui e procure por

  • Mateus Robeerto
    Mateus Robeerto

    Depende do seu gosto... Se for Znote ou MyAcc, é melhor para UniServer. Se for Gesior limpo, é melhor para a antiga versão do XAMPP 7.x. Particularmente, prefiro Gesior com XAMPP... Já estou satisfeit

Posted Images

Postado
  • Autor
Em 31/01/2024 em 20:46, Mateus Robeerto disse:

O gringo não para de me pedir todos os dias... não tive paciência e resolvi fazer uns scripts + module store e enviei para ele. Ele ficou muito feliz por ter essa store custom.. Ele também usa TFS 1.5 e 8.6. Veja como a store ficou... Se você estiver interessado, posso separar e organizar certinho de acordo com o Znote e Gesior... Depois posto aqui xD

Nesse módulo, não é necessário lidar com opcodes... é apenas o script diretamente, simples... muito prático e ágil.

store2.png

store.png

image.png

image.png

@doukxxt

 

Desculpa pela demora. Os últimos dias foram corridos. Decidi compartilhar isso com vocês

 

Abra o diretório otc/data/layouts/retro/styles/40-inventory.otui e procure por essa linha.

 

      Panel
        id: conditionPanel
        layout:
          type: horizontalBox
        height: 22
        padding: 2
        anchors.top: slot8.bottom
        anchors.left: slot6.left
        anchors.right: slot5.right
        margin-top: 4
        border-width: 1
        border-color: #00000077
        background-color: #ffffff22

Adicione abaixo disso.

   StoreButton
        size: 0 20
        anchors.top: prev.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        margin-left: 6
        margin-top: 4
        margin-right: 6
        @onClick: modules.store_module.toggle()

Agora, sobre como comprar itens por pontos, vou postar dois tutoriais para Gesior e Znote.

 

APENAS GESIOR..

Este script serve para trocar itens por pontos. Vou dar um exemplo com a Magic Sword.

 

data/scripts.

local StoreCustom = TalkAction("!shopMagic Sword")

function StoreCustom.onSay(player, words, param)
    local pointsToDeduct = 10

    removePoints(player, pointsToDeduct)

    local newItemID = 2401 -- Replace with the ID of the item the player will receive
    local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory
    player:addItem(newItemID, newItemCount)
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for" .. pointsToDeduct .. " premium points.")
    
    return false
end

function removePoints(player, amount)
    local accountId = player:getAccountId()
    local query = "UPDATE `accounts` SET `premium_points` = `premium_points` - " .. amount .. " WHERE `id` = " .. accountId
    db.query(query)
end


StoreCustom:separator(" ")
StoreCustom:register()

Para saber quantos pontos você tem, digite !points.

local talkaction = TalkAction("!points")

function Player.getPremiumPoints(self)
    local query = db.storeQuery("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. self:getAccountId())
    if not query then
        return false
    end

    local value = result.getNumber(query, "premium_points")
    result.free(query)
    return value
end

function talkaction.onSay(player, words, param, type)
    if words:lower() == "!points" then
        local points = player:getPremiumPoints() 

        if points > 0 then
            local message = "Your premium points balance is: " .. points
            player:popupFYI(message)
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have premium points.")
        end

        return false
    end
    return true
end

talkaction:separator(" ")
talkaction:register()

Para comprar outfits ou addons.

local outfitsCustom = TalkAction("!shopMage", "!shopCitizen", "!shopHunter", "!shopKnight", "!shopNoblewoman", "!shopNobleman", "!shopSummoner", "!shopWarrior", "!shopBarbarian", "!shopDruid", "!shopWizard", "!shopOriental", "!shopPirate", "!shopAssassin", "!shopBeggar", "!shopShaman", "!shopNorsewoman", "!shopNorseman", "!shopNightmare", "!shopJester", "!shopBrotherhood", "!shopDemon Hunter", "!shopYalaharian", "!shopNewly Wed", "!shopWarmaster", "!shopWayfarer", "!shopRetro Warrior", "!shopRetro Citizen", "!shopRetro Hunter", "!shopRetro Knight", "!shopRetro Mage", "!shopRetro Noblewoman", "!shopRetro Nobleman", "!shopRetro Summoner")

function outfitsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    
    if words == "!shopMage" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 138 or 130 -- Mage outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Mage outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Mage outfit!")
        end
		----------------
    elseif words == "!shopCitizen" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 136 or 128 -- Citizen outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Citizen outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Citizen outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Citizen outfit!")
        end
		----------------
    elseif words == "!shopHunter" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 137 or 129 -- Hunter outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Hunter outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Hunter outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Hunter outfit!")
        end
		----------------
	elseif words == "!shopKnight" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 139 or 131 -- Knight outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Knight outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Knight outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Knight outfit!")
        end
	
    -- Add more commands and messages as necessary
    end

    return false
end

outfitsCustom:separator(" ")
outfitsCustom:register()

Para comprar uma montaria.

local shopsCustom = TalkAction("!shopMidnight Panther", "!shopWidow Queen", "!shopRacing Bird", "!shopWar Bear", "!shopBlack Sheep", "!shopDraptor", "!shopTitanica", "!shopTin Lizzard", "!shopBlazebringer", "!shopRapid Boar", "!shopStampor", "!shopUndead Cavebear", "!shopDonkey", "!shopTiger Slug", "!shopUniwheel", "!shopCrystal Wolf", "!shopWar Horse", "!shopKingly Deer", "!shopTamed Panda", "!shopDromedary", "!shopScorpion King", "!shopDarkbrown Rented Horse", "!shopArmoured War Horse", "!shopShadow Draptor", "!shopGrey Rented Horse", "!shopBrown Rented Horse", "!shopLady Bug", "!shopManta Ray", "!shopIronblight", "!shopMagma Crawler", "!shopDragonling", "!shopGnarlhound", "!shopCrimson Ray", "!shopSteelbeak", "!shopWater Buffalo", "!shopTombstinger", "!shopPlatesaurian", "!shopUrsagrodon", "!shopThe Hellgrip", "!shopNoble Lion", "!shopDesert King", "!shopShock Head", "!shopWalker", "!shopAzudocus", "!shopCarpacosaurus", "!shopDeath Crawler", "!shopFlamesteed", "!shopJade Lion", "!shopJade Pincer", "!shopNethersteed", "!shopTempest", "!shopWinter King", "!shopDoombringer", "!shopWoodland Prince", "!shopHailstorm Fury", "!shopSiegebreaker", "!shopPoisonbane", "!shopBlackpelt", "!shopGolden Dragonfly", "!shopSteel Bee", "!shopCopper Fly", "!shopTundra Rambler", "!shopHighland Yak", "!shopGlacier Vagabond", "!shopShadow Hart", "!shopBlack Stag", "!shopEmperor Deer", "!shopFlying Divan", "!shopMagic Carpet", "!shopFloating Kashmir", "!shopRingtail Waccoon", "!shopNight Waccoon", "!shopEmerald Waccoon", "!shopFlitterkatzen", "!shopVenompaw", "!shopBatcat", "!shopSea Devil", "!shopCoralripper", "!shopPlumfish", "!shopGorongra", "!shopNoctungra", "!shopSilverneck", "!shopSlagsnare", "!shopNightstinger", "!shopRazorcreep", "!shopRift Runner", "!shopNightdweller", "!shopFrostflare", "!shopCinderhoof", "!shopMouldpincer", "!shopBloodcurl", "!shopLeafscuttler", "!shopSparkion", "!shopSwamp Snapper", "!shopMould Shell", "!shopReed Lurker", "!shopNeon Sparkid", "!shopVortexion", "!shopIvory Fang", "!shopShadow Claw", "!shopSnow Pelt", "!shopJackalope", "!shopDreadhare", "!shopWolpertinger", "!shopStone Rhino", "!shopGold Sphinx", "!shopEmerald Sphinx", "!shopShadow Sphinx", "!shopJungle Saurian", "!shopEmber Saurian", "!shopLagoon Saurian", "!shopBlazing Unicorn", "!shopArctic Unicorn", "!shopPrismatic unicorn", "!shopCranium Spider", "!shopCave Tarantula", "!shopGloom Widow", "!shopMole", "!shopMarsh Toad", "!shopSanguine Frog", "!shopToxic Toad", "!shopEbony Tiger", "!shopFeral Tiger", "!shopJungle Tiger", "!shopFleeting Knowledge", "!shopTawny Owl", "!shopSnowy Owl", "!shopBoreal Owl", "!shopLacewing Moth", "!shopHibernal Moth", "!shopCold Percht Sleigh", "!shopBright Percht Sleigh", "!shopDark Percht Sleigh", "!shopFestive Snowman", "!shopMuffled Snowman", "!shopCaped Snowman", "!shopRabbit Rickshaw", "!shopBunny Dray", "!shopCony Cart", "!shopRiver Crocovile", "!shopSwamp Crocovile", "!shopNightmarish Crocovile", "!shopGryphon", "!shopJousting Eagle", "!shopCerberus Champion", "!shopCold Percht Sleigh Variant", "!shopBright Percht Sleigh Variant", "!shopDark Percht Sleigh Variant", "!shopCold Percht Sleigh Final", "!shopBright Percht Sleigh Final", "!shopDark Percht Sleigh Final", "!shopBattle Badger", "!shopEther Badger", "!shopZaoan Badger", "!shopBlue Rolling Barrel", "!shopRed Rolling Barrel", "!shopGreen Rolling Barrel", "!shopFloating Sage", "!shopFloating Scholar", "!shopFloating Augur", "!shopHaze", "!shopAntelope", "!shopSnow Strider", "!shopDusk Pryer", "!shopDawn Strayer", "!shopSpectral Horse", "!shopSavanna Ostrich", "!shopCoral Rhea", "!shopEventide Nandu", "!shopVoracious Hyaena", "!shopCunning Hyaena", "!shopScruffy Hyaena", "!shopWhite Lion", "!shopKrakoloss", "!shopMerry Mammoth", "!shopHoliday Mammoth", "!shopFestive Mammoth", "!shopVoid Watcher", "!shopRune Watcher", "!shopRift Watcher", "!shopPhant", "!shopShellodon", "!shopSingeing Steed", "!shopHyacinth", "!shopPeony", "!shopDandelion", "!shopRustwurm", "!shopBogwurm", "!shopGloomwurm", "!shopEmerald Raven", "!shopMystic Raven", "!shopRadiant Raven", "!shopGloothomotive", "!shopTopaz Shrine", "!shopJade Shrine", "!shopObsidian Shrine", "!shopPoppy Ibex", "!shopMint Ibex", "!shopCinnamon Ibex")

function shopsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    if words == "!shopMidnight Panther" then
        local shopId = 1 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Midnight Panther for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Midnight Panther!")
        end
    elseif words == "!shopWidow Queen" then
        local shopId = 2 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) --
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Widow Queen for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Widow Queen!")
        end
    elseif words == "!shopRacing Bird" then
        local shopId = 3 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Racing Bird for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Racing Bird!")
        end
    elseif words == "!shopWar Bear" then
        local shopId = 4 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the War Bear for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the War Bear!")
        end
 
    end
end

shopsCustom:separator(" ")
shopsCustom:register()

Clique no item para ganhar pontos e poder comprar na store!

local premiumPointsAction = Action()

local function doPlayerAddPremiumPoints(player, count)
    local accountId = player:getAccountId()
    db.query('UPDATE accounts SET premium_points = premium_points +' .. count .. ' WHERE id = ' .. db.escapeString(accountId))
end

function premiumPointsAction.onUse(player, item, fromPosition, target, toPosition)
    doPlayerAddPremiumPoints(player, 100)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 100 store point(s) in your account.")
    player:getPosition():sendMagicEffect(28)
    item:remove(1)
    return true
end

premiumPointsAction:id(24774)
premiumPointsAction:register()

 

AGORA É ZNOTE..

magic sword.

local StoreCustom = TalkAction("!shopteste")

function StoreCustom.onSay(player, words, param)
    local pointsToDeduct = 10 -- Replace with the number of points to be deducted

    removePoints(player, pointsToDeduct)

    local newItemID = 2401 -- Replace with the ID of the item the player will receive
    local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory
    player:addItem(newItemID, newItemCount)
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for " .. pointsToDeduct .. " premium points.")
    
    return false
end

function removePoints(player, amount)
    local accountId = player:getAccountId()
    local query = "UPDATE `znote_accounts` SET `points` = `points` - " .. amount .. " WHERE `id` = " .. accountId
    db.query(query)
end

StoreCustom:separator(" ")
StoreCustom:register()

!points

local StoreCustom = TalkAction("!shopteste")

function StoreCustom.onSay(player, words, param)
    local pointsToDeduct = 10 -- Replace with the number of points to be deducted

    removePoints(player, pointsToDeduct)

    local newItemID = 2401 -- Replace with the ID of the item the player will receive
    local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory
    player:addItem(newItemID, newItemCount)
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for " .. pointsToDeduct .. " premium points.")
    
    return false
end

function removePoints(player, amount)
    local accountId = player:getAccountId()
    local query = "UPDATE `znote_accounts` SET `points` = `points` - " .. amount .. " WHERE `id` = " .. accountId
    db.query(query)
end

StoreCustom:separator(" ")
StoreCustom:register()

outfits ou addons.

local outfitsCustom = TalkAction("!shopMage", "!shopCitizen", "!shopHunter", "!shopKnight", "!shopNoblewoman", "!shopNobleman", "!shopSummoner", "!shopWarrior", "!shopBarbarian", "!shopDruid", "!shopWizard", "!shopOriental", "!shopPirate", "!shopAssassin", "!shopBeggar", "!shopShaman", "!shopNorsewoman", "!shopNorseman", "!shopNightmare", "!shopJester", "!shopBrotherhood", "!shopDemon Hunter", "!shopYalaharian", "!shopNewly Wed", "!shopWarmaster", "!shopWayfarer", "!shopRetro Warrior", "!shopRetro Citizen", "!shopRetro Hunter", "!shopRetro Knight", "!shopRetro Mage", "!shopRetro Noblewoman", "!shopRetro Nobleman", "!shopRetro Summoner")

function outfitsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    
    if words == "!shopMage" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 138 or 130 -- Mage outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Mage outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Mage outfit!")
        end
		----------------
    elseif words == "!shopCitizen" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 136 or 128 -- Citizen outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Citizen outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Citizen outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Citizen outfit!")
        end
		----------------
    elseif words == "!shopHunter" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 137 or 129 -- Hunter outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Hunter outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Hunter outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Hunter outfit!")
        end
		----------------
	elseif words == "!shopKnight" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 139 or 131 -- Knight outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Knight outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Knight outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Knight outfit!")
        end
		----------------
		elseif words == "!shopNoblewoman" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 140 or 132 --  outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Noblewoman outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Noblewoman outfit!")
        end
	
    -- Add more commands and messages as necessary
    end

    return false
end

outfitsCustom:separator(" ")
outfitsCustom:register()

Montaria.

local shopsCustom = TalkAction("!shopMidnight Panther", "!shopWidow Queen", "!shopRacing Bird", "!shopWar Bear", "!shopBlack Sheep", "!shopDraptor", "!shopTitanica", "!shopTin Lizzard", "!shopBlazebringer", "!shopRapid Boar", "!shopStampor", "!shopUndead Cavebear", "!shopDonkey", "!shopTiger Slug", "!shopUniwheel", "!shopCrystal Wolf", "!shopWar Horse", "!shopKingly Deer", "!shopTamed Panda", "!shopDromedary", "!shopScorpion King", "!shopDarkbrown Rented Horse", "!shopArmoured War Horse", "!shopShadow Draptor", "!shopGrey Rented Horse", "!shopBrown Rented Horse", "!shopLady Bug", "!shopManta Ray", "!shopIronblight", "!shopMagma Crawler", "!shopDragonling", "!shopGnarlhound", "!shopCrimson Ray", "!shopSteelbeak", "!shopWater Buffalo", "!shopTombstinger", "!shopPlatesaurian", "!shopUrsagrodon", "!shopThe Hellgrip", "!shopNoble Lion", "!shopDesert King", "!shopShock Head", "!shopWalker", "!shopAzudocus", "!shopCarpacosaurus", "!shopDeath Crawler", "!shopFlamesteed", "!shopJade Lion", "!shopJade Pincer", "!shopNethersteed", "!shopTempest", "!shopWinter King", "!shopDoombringer", "!shopWoodland Prince", "!shopHailstorm Fury", "!shopSiegebreaker", "!shopPoisonbane", "!shopBlackpelt", "!shopGolden Dragonfly", "!shopSteel Bee", "!shopCopper Fly", "!shopTundra Rambler", "!shopHighland Yak", "!shopGlacier Vagabond", "!shopShadow Hart", "!shopBlack Stag", "!shopEmperor Deer", "!shopFlying Divan", "!shopMagic Carpet", "!shopFloating Kashmir", "!shopRingtail Waccoon", "!shopNight Waccoon", "!shopEmerald Waccoon", "!shopFlitterkatzen", "!shopVenompaw", "!shopBatcat", "!shopSea Devil", "!shopCoralripper", "!shopPlumfish", "!shopGorongra", "!shopNoctungra", "!shopSilverneck", "!shopSlagsnare", "!shopNightstinger", "!shopRazorcreep", "!shopRift Runner", "!shopNightdweller", "!shopFrostflare", "!shopCinderhoof", "!shopMouldpincer", "!shopBloodcurl", "!shopLeafscuttler", "!shopSparkion", "!shopSwamp Snapper", "!shopMould Shell", "!shopReed Lurker", "!shopNeon Sparkid", "!shopVortexion", "!shopIvory Fang", "!shopShadow Claw", "!shopSnow Pelt", "!shopJackalope", "!shopDreadhare", "!shopWolpertinger", "!shopStone Rhino", "!shopGold Sphinx", "!shopEmerald Sphinx", "!shopShadow Sphinx", "!shopJungle Saurian", "!shopEmber Saurian", "!shopLagoon Saurian", "!shopBlazing Unicorn", "!shopArctic Unicorn", "!shopPrismatic unicorn", "!shopCranium Spider", "!shopCave Tarantula", "!shopGloom Widow", "!shopMole", "!shopMarsh Toad", "!shopSanguine Frog", "!shopToxic Toad", "!shopEbony Tiger", "!shopFeral Tiger", "!shopJungle Tiger", "!shopFleeting Knowledge", "!shopTawny Owl", "!shopSnowy Owl", "!shopBoreal Owl", "!shopLacewing Moth", "!shopHibernal Moth", "!shopCold Percht Sleigh", "!shopBright Percht Sleigh", "!shopDark Percht Sleigh", "!shopFestive Snowman", "!shopMuffled Snowman", "!shopCaped Snowman", "!shopRabbit Rickshaw", "!shopBunny Dray", "!shopCony Cart", "!shopRiver Crocovile", "!shopSwamp Crocovile", "!shopNightmarish Crocovile", "!shopGryphon", "!shopJousting Eagle", "!shopCerberus Champion", "!shopCold Percht Sleigh Variant", "!shopBright Percht Sleigh Variant", "!shopDark Percht Sleigh Variant", "!shopCold Percht Sleigh Final", "!shopBright Percht Sleigh Final", "!shopDark Percht Sleigh Final", "!shopBattle Badger", "!shopEther Badger", "!shopZaoan Badger", "!shopBlue Rolling Barrel", "!shopRed Rolling Barrel", "!shopGreen Rolling Barrel", "!shopFloating Sage", "!shopFloating Scholar", "!shopFloating Augur", "!shopHaze", "!shopAntelope", "!shopSnow Strider", "!shopDusk Pryer", "!shopDawn Strayer", "!shopSpectral Horse", "!shopSavanna Ostrich", "!shopCoral Rhea", "!shopEventide Nandu", "!shopVoracious Hyaena", "!shopCunning Hyaena", "!shopScruffy Hyaena", "!shopWhite Lion", "!shopKrakoloss", "!shopMerry Mammoth", "!shopHoliday Mammoth", "!shopFestive Mammoth", "!shopVoid Watcher", "!shopRune Watcher", "!shopRift Watcher", "!shopPhant", "!shopShellodon", "!shopSingeing Steed", "!shopHyacinth", "!shopPeony", "!shopDandelion", "!shopRustwurm", "!shopBogwurm", "!shopGloomwurm", "!shopEmerald Raven", "!shopMystic Raven", "!shopRadiant Raven", "!shopGloothomotive", "!shopTopaz Shrine", "!shopJade Shrine", "!shopObsidian Shrine", "!shopPoppy Ibex", "!shopMint Ibex", "!shopCinnamon Ibex")

function shopsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    if words == "!shopMidnight Panther" then
        local shopId = 1 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Midnight Panther for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Midnight Panther!")
        end
    elseif words == "!shopWidow Queen" then
        local shopId = 2 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) --
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Widow Queen for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Widow Queen!")
        end
    elseif words == "!shopRacing Bird" then
        local shopId = 3 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Racing Bird for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Racing Bird!")
        end
    elseif words == "!shopWar Bear" then
        local shopId = 4 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the War Bear for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the War Bear!")
        end
   
    end
end

shopsCustom:separator(" ")
shopsCustom:register()

Clique no item para ganhar pontos e poder comprar na store.

local premiumPointsAction = Action()

local function doPlayerAddPremiumPoints(player, count)
    local accountId = player:getAccountId()
    db.query('UPDATE znote_accounts SET points = points +' .. count .. ' WHERE account_id = ' .. db.escapeString(accountId))
end

function premiumPointsAction.onUse(player, item, fromPosition, target, toPosition)
    doPlayerAddPremiumPoints(player, 100)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 100 store point(s) in your account.")
    player:getPosition():sendMagicEffect(28)
    item:remove(1)
    return true
end

premiumPointsAction:id(24774)
premiumPointsAction:register()

É só baixar o module e colocar no seu OTClient... Pronto! Espero que tenha gostado!

https://drive.google.com/file/d/1Cl06Dx2o1ix2AO7aUXJRe292tLvfgU45/view?usp=sharing

 

Editado por Mateus Robeerto (veja o histórico de edições)

Postado
7 horas atrás, Mateus Robeerto disse:

@doukxxt

 

Desculpa pela demora. Os últimos dias foram corridos. Decidi compartilhar isso com vocês

 

Abra o diretório otc/data/layouts/retro/styles/40-inventory.otui e procure por essa linha.

 


      Panel
        id: conditionPanel
        layout:
          type: horizontalBox
        height: 22
        padding: 2
        anchors.top: slot8.bottom
        anchors.left: slot6.left
        anchors.right: slot5.right
        margin-top: 4
        border-width: 1
        border-color: #00000077
        background-color: #ffffff22

Adicione abaixo disso.


   StoreButton
        size: 0 20
        anchors.top: prev.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        margin-left: 6
        margin-top: 4
        margin-right: 6
        @onClick: modules.store_module.toggle()

Agora, sobre como comprar itens por pontos, vou postar dois tutoriais para Gesior e Znote.

 

APENAS GESIOR..

Este script serve para trocar itens por pontos. Vou dar um exemplo com a Magic Sword.

 

data/scripts.


local StoreCustom = TalkAction("!shopMagic Sword")

function StoreCustom.onSay(player, words, param)
    local pointsToDeduct = 10

    removePoints(player, pointsToDeduct)

    local newItemID = 2401 -- Replace with the ID of the item the player will receive
    local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory
    player:addItem(newItemID, newItemCount)
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for" .. pointsToDeduct .. " premium points.")
    
    return false
end

function removePoints(player, amount)
    local accountId = player:getAccountId()
    local query = "UPDATE `accounts` SET `premium_points` = `premium_points` - " .. amount .. " WHERE `id` = " .. accountId
    db.query(query)
end


StoreCustom:separator(" ")
StoreCustom:register()

Para saber quantos pontos você tem, digite !points.


local talkaction = TalkAction("!points")

function Player.getPremiumPoints(self)
    local query = db.storeQuery("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. self:getAccountId())
    if not query then
        return false
    end

    local value = result.getNumber(query, "premium_points")
    result.free(query)
    return value
end

function talkaction.onSay(player, words, param, type)
    if words:lower() == "!points" then
        local points = player:getPremiumPoints() 

        if points > 0 then
            local message = "Your premium points balance is: " .. points
            player:popupFYI(message)
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have premium points.")
        end

        return false
    end
    return true
end

talkaction:separator(" ")
talkaction:register()

Para comprar outfits ou addons.


local outfitsCustom = TalkAction("!shopMage", "!shopCitizen", "!shopHunter", "!shopKnight", "!shopNoblewoman", "!shopNobleman", "!shopSummoner", "!shopWarrior", "!shopBarbarian", "!shopDruid", "!shopWizard", "!shopOriental", "!shopPirate", "!shopAssassin", "!shopBeggar", "!shopShaman", "!shopNorsewoman", "!shopNorseman", "!shopNightmare", "!shopJester", "!shopBrotherhood", "!shopDemon Hunter", "!shopYalaharian", "!shopNewly Wed", "!shopWarmaster", "!shopWayfarer", "!shopRetro Warrior", "!shopRetro Citizen", "!shopRetro Hunter", "!shopRetro Knight", "!shopRetro Mage", "!shopRetro Noblewoman", "!shopRetro Nobleman", "!shopRetro Summoner")

function outfitsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    
    if words == "!shopMage" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 138 or 130 -- Mage outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Mage outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Mage outfit!")
        end
		----------------
    elseif words == "!shopCitizen" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 136 or 128 -- Citizen outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Citizen outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Citizen outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Citizen outfit!")
        end
		----------------
    elseif words == "!shopHunter" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 137 or 129 -- Hunter outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Hunter outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Hunter outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Hunter outfit!")
        end
		----------------
	elseif words == "!shopKnight" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 139 or 131 -- Knight outfit ID
        local outfitCost = 50 -- Cost in premium_points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Knight outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Knight outfit addons for " .. outfitCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Knight outfit!")
        end
	
    -- Add more commands and messages as necessary
    end

    return false
end

outfitsCustom:separator(" ")
outfitsCustom:register()

Para comprar uma montaria.


local shopsCustom = TalkAction("!shopMidnight Panther", "!shopWidow Queen", "!shopRacing Bird", "!shopWar Bear", "!shopBlack Sheep", "!shopDraptor", "!shopTitanica", "!shopTin Lizzard", "!shopBlazebringer", "!shopRapid Boar", "!shopStampor", "!shopUndead Cavebear", "!shopDonkey", "!shopTiger Slug", "!shopUniwheel", "!shopCrystal Wolf", "!shopWar Horse", "!shopKingly Deer", "!shopTamed Panda", "!shopDromedary", "!shopScorpion King", "!shopDarkbrown Rented Horse", "!shopArmoured War Horse", "!shopShadow Draptor", "!shopGrey Rented Horse", "!shopBrown Rented Horse", "!shopLady Bug", "!shopManta Ray", "!shopIronblight", "!shopMagma Crawler", "!shopDragonling", "!shopGnarlhound", "!shopCrimson Ray", "!shopSteelbeak", "!shopWater Buffalo", "!shopTombstinger", "!shopPlatesaurian", "!shopUrsagrodon", "!shopThe Hellgrip", "!shopNoble Lion", "!shopDesert King", "!shopShock Head", "!shopWalker", "!shopAzudocus", "!shopCarpacosaurus", "!shopDeath Crawler", "!shopFlamesteed", "!shopJade Lion", "!shopJade Pincer", "!shopNethersteed", "!shopTempest", "!shopWinter King", "!shopDoombringer", "!shopWoodland Prince", "!shopHailstorm Fury", "!shopSiegebreaker", "!shopPoisonbane", "!shopBlackpelt", "!shopGolden Dragonfly", "!shopSteel Bee", "!shopCopper Fly", "!shopTundra Rambler", "!shopHighland Yak", "!shopGlacier Vagabond", "!shopShadow Hart", "!shopBlack Stag", "!shopEmperor Deer", "!shopFlying Divan", "!shopMagic Carpet", "!shopFloating Kashmir", "!shopRingtail Waccoon", "!shopNight Waccoon", "!shopEmerald Waccoon", "!shopFlitterkatzen", "!shopVenompaw", "!shopBatcat", "!shopSea Devil", "!shopCoralripper", "!shopPlumfish", "!shopGorongra", "!shopNoctungra", "!shopSilverneck", "!shopSlagsnare", "!shopNightstinger", "!shopRazorcreep", "!shopRift Runner", "!shopNightdweller", "!shopFrostflare", "!shopCinderhoof", "!shopMouldpincer", "!shopBloodcurl", "!shopLeafscuttler", "!shopSparkion", "!shopSwamp Snapper", "!shopMould Shell", "!shopReed Lurker", "!shopNeon Sparkid", "!shopVortexion", "!shopIvory Fang", "!shopShadow Claw", "!shopSnow Pelt", "!shopJackalope", "!shopDreadhare", "!shopWolpertinger", "!shopStone Rhino", "!shopGold Sphinx", "!shopEmerald Sphinx", "!shopShadow Sphinx", "!shopJungle Saurian", "!shopEmber Saurian", "!shopLagoon Saurian", "!shopBlazing Unicorn", "!shopArctic Unicorn", "!shopPrismatic unicorn", "!shopCranium Spider", "!shopCave Tarantula", "!shopGloom Widow", "!shopMole", "!shopMarsh Toad", "!shopSanguine Frog", "!shopToxic Toad", "!shopEbony Tiger", "!shopFeral Tiger", "!shopJungle Tiger", "!shopFleeting Knowledge", "!shopTawny Owl", "!shopSnowy Owl", "!shopBoreal Owl", "!shopLacewing Moth", "!shopHibernal Moth", "!shopCold Percht Sleigh", "!shopBright Percht Sleigh", "!shopDark Percht Sleigh", "!shopFestive Snowman", "!shopMuffled Snowman", "!shopCaped Snowman", "!shopRabbit Rickshaw", "!shopBunny Dray", "!shopCony Cart", "!shopRiver Crocovile", "!shopSwamp Crocovile", "!shopNightmarish Crocovile", "!shopGryphon", "!shopJousting Eagle", "!shopCerberus Champion", "!shopCold Percht Sleigh Variant", "!shopBright Percht Sleigh Variant", "!shopDark Percht Sleigh Variant", "!shopCold Percht Sleigh Final", "!shopBright Percht Sleigh Final", "!shopDark Percht Sleigh Final", "!shopBattle Badger", "!shopEther Badger", "!shopZaoan Badger", "!shopBlue Rolling Barrel", "!shopRed Rolling Barrel", "!shopGreen Rolling Barrel", "!shopFloating Sage", "!shopFloating Scholar", "!shopFloating Augur", "!shopHaze", "!shopAntelope", "!shopSnow Strider", "!shopDusk Pryer", "!shopDawn Strayer", "!shopSpectral Horse", "!shopSavanna Ostrich", "!shopCoral Rhea", "!shopEventide Nandu", "!shopVoracious Hyaena", "!shopCunning Hyaena", "!shopScruffy Hyaena", "!shopWhite Lion", "!shopKrakoloss", "!shopMerry Mammoth", "!shopHoliday Mammoth", "!shopFestive Mammoth", "!shopVoid Watcher", "!shopRune Watcher", "!shopRift Watcher", "!shopPhant", "!shopShellodon", "!shopSingeing Steed", "!shopHyacinth", "!shopPeony", "!shopDandelion", "!shopRustwurm", "!shopBogwurm", "!shopGloomwurm", "!shopEmerald Raven", "!shopMystic Raven", "!shopRadiant Raven", "!shopGloothomotive", "!shopTopaz Shrine", "!shopJade Shrine", "!shopObsidian Shrine", "!shopPoppy Ibex", "!shopMint Ibex", "!shopCinnamon Ibex")

function shopsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    if words == "!shopMidnight Panther" then
        local shopId = 1 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Midnight Panther for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Midnight Panther!")
        end
    elseif words == "!shopWidow Queen" then
        local shopId = 2 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) --
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Widow Queen for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Widow Queen!")
        end
    elseif words == "!shopRacing Bird" then
        local shopId = 3 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Racing Bird for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Racing Bird!")
        end
    elseif words == "!shopWar Bear" then
        local shopId = 4 -- Mount ID
        local shopCost = 20 -- Cost in premium_points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the War Bear for " .. shopCost .. " premium_points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the War Bear!")
        end
 
    end
end

shopsCustom:separator(" ")
shopsCustom:register()

Clique no item para ganhar pontos e poder comprar na store!


local premiumPointsAction = Action()

local function doPlayerAddPremiumPoints(player, count)
    local accountId = player:getAccountId()
    db.query('UPDATE accounts SET premium_points = premium_points +' .. count .. ' WHERE id = ' .. db.escapeString(accountId))
end

function premiumPointsAction.onUse(player, item, fromPosition, target, toPosition)
    doPlayerAddPremiumPoints(player, 100)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 100 store point(s) in your account.")
    player:getPosition():sendMagicEffect(28)
    item:remove(1)
    return true
end

premiumPointsAction:id(24774)
premiumPointsAction:register()

 

AGORA É ZNOTE..

magic sword.


local StoreCustom = TalkAction("!shopteste")

function StoreCustom.onSay(player, words, param)
    local pointsToDeduct = 10 -- Replace with the number of points to be deducted

    removePoints(player, pointsToDeduct)

    local newItemID = 2401 -- Replace with the ID of the item the player will receive
    local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory
    player:addItem(newItemID, newItemCount)
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for " .. pointsToDeduct .. " premium points.")
    
    return false
end

function removePoints(player, amount)
    local accountId = player:getAccountId()
    local query = "UPDATE `znote_accounts` SET `points` = `points` - " .. amount .. " WHERE `id` = " .. accountId
    db.query(query)
end

StoreCustom:separator(" ")
StoreCustom:register()

!points


local StoreCustom = TalkAction("!shopteste")

function StoreCustom.onSay(player, words, param)
    local pointsToDeduct = 10 -- Replace with the number of points to be deducted

    removePoints(player, pointsToDeduct)

    local newItemID = 2401 -- Replace with the ID of the item the player will receive
    local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory
    player:addItem(newItemID, newItemCount)
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for " .. pointsToDeduct .. " premium points.")
    
    return false
end

function removePoints(player, amount)
    local accountId = player:getAccountId()
    local query = "UPDATE `znote_accounts` SET `points` = `points` - " .. amount .. " WHERE `id` = " .. accountId
    db.query(query)
end

StoreCustom:separator(" ")
StoreCustom:register()

outfits ou addons.


local outfitsCustom = TalkAction("!shopMage", "!shopCitizen", "!shopHunter", "!shopKnight", "!shopNoblewoman", "!shopNobleman", "!shopSummoner", "!shopWarrior", "!shopBarbarian", "!shopDruid", "!shopWizard", "!shopOriental", "!shopPirate", "!shopAssassin", "!shopBeggar", "!shopShaman", "!shopNorsewoman", "!shopNorseman", "!shopNightmare", "!shopJester", "!shopBrotherhood", "!shopDemon Hunter", "!shopYalaharian", "!shopNewly Wed", "!shopWarmaster", "!shopWayfarer", "!shopRetro Warrior", "!shopRetro Citizen", "!shopRetro Hunter", "!shopRetro Knight", "!shopRetro Mage", "!shopRetro Noblewoman", "!shopRetro Nobleman", "!shopRetro Summoner")

function outfitsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    
    if words == "!shopMage" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 138 or 130 -- Mage outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Mage outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Mage outfit!")
        end
		----------------
    elseif words == "!shopCitizen" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 136 or 128 -- Citizen outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Citizen outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Citizen outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Citizen outfit!")
        end
		----------------
    elseif words == "!shopHunter" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 137 or 129 -- Hunter outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Hunter outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Hunter outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Hunter outfit!")
        end
		----------------
	elseif words == "!shopKnight" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 139 or 131 -- Knight outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add Knight outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Knight outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Knight outfit!")
        end
		----------------
		elseif words == "!shopNoblewoman" then
        local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 140 or 132 --  outfit ID
        local outfitCost = 50 -- Cost in points to acquire the outfit
        if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then
            db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId())
            player:addOutfitAddon(outfitId, 3) -- Add outfit / addons
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Noblewoman outfit addons for " .. outfitCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Noblewoman outfit!")
        end
	
    -- Add more commands and messages as necessary
    end

    return false
end

outfitsCustom:separator(" ")
outfitsCustom:register()

Montaria.


local shopsCustom = TalkAction("!shopMidnight Panther", "!shopWidow Queen", "!shopRacing Bird", "!shopWar Bear", "!shopBlack Sheep", "!shopDraptor", "!shopTitanica", "!shopTin Lizzard", "!shopBlazebringer", "!shopRapid Boar", "!shopStampor", "!shopUndead Cavebear", "!shopDonkey", "!shopTiger Slug", "!shopUniwheel", "!shopCrystal Wolf", "!shopWar Horse", "!shopKingly Deer", "!shopTamed Panda", "!shopDromedary", "!shopScorpion King", "!shopDarkbrown Rented Horse", "!shopArmoured War Horse", "!shopShadow Draptor", "!shopGrey Rented Horse", "!shopBrown Rented Horse", "!shopLady Bug", "!shopManta Ray", "!shopIronblight", "!shopMagma Crawler", "!shopDragonling", "!shopGnarlhound", "!shopCrimson Ray", "!shopSteelbeak", "!shopWater Buffalo", "!shopTombstinger", "!shopPlatesaurian", "!shopUrsagrodon", "!shopThe Hellgrip", "!shopNoble Lion", "!shopDesert King", "!shopShock Head", "!shopWalker", "!shopAzudocus", "!shopCarpacosaurus", "!shopDeath Crawler", "!shopFlamesteed", "!shopJade Lion", "!shopJade Pincer", "!shopNethersteed", "!shopTempest", "!shopWinter King", "!shopDoombringer", "!shopWoodland Prince", "!shopHailstorm Fury", "!shopSiegebreaker", "!shopPoisonbane", "!shopBlackpelt", "!shopGolden Dragonfly", "!shopSteel Bee", "!shopCopper Fly", "!shopTundra Rambler", "!shopHighland Yak", "!shopGlacier Vagabond", "!shopShadow Hart", "!shopBlack Stag", "!shopEmperor Deer", "!shopFlying Divan", "!shopMagic Carpet", "!shopFloating Kashmir", "!shopRingtail Waccoon", "!shopNight Waccoon", "!shopEmerald Waccoon", "!shopFlitterkatzen", "!shopVenompaw", "!shopBatcat", "!shopSea Devil", "!shopCoralripper", "!shopPlumfish", "!shopGorongra", "!shopNoctungra", "!shopSilverneck", "!shopSlagsnare", "!shopNightstinger", "!shopRazorcreep", "!shopRift Runner", "!shopNightdweller", "!shopFrostflare", "!shopCinderhoof", "!shopMouldpincer", "!shopBloodcurl", "!shopLeafscuttler", "!shopSparkion", "!shopSwamp Snapper", "!shopMould Shell", "!shopReed Lurker", "!shopNeon Sparkid", "!shopVortexion", "!shopIvory Fang", "!shopShadow Claw", "!shopSnow Pelt", "!shopJackalope", "!shopDreadhare", "!shopWolpertinger", "!shopStone Rhino", "!shopGold Sphinx", "!shopEmerald Sphinx", "!shopShadow Sphinx", "!shopJungle Saurian", "!shopEmber Saurian", "!shopLagoon Saurian", "!shopBlazing Unicorn", "!shopArctic Unicorn", "!shopPrismatic unicorn", "!shopCranium Spider", "!shopCave Tarantula", "!shopGloom Widow", "!shopMole", "!shopMarsh Toad", "!shopSanguine Frog", "!shopToxic Toad", "!shopEbony Tiger", "!shopFeral Tiger", "!shopJungle Tiger", "!shopFleeting Knowledge", "!shopTawny Owl", "!shopSnowy Owl", "!shopBoreal Owl", "!shopLacewing Moth", "!shopHibernal Moth", "!shopCold Percht Sleigh", "!shopBright Percht Sleigh", "!shopDark Percht Sleigh", "!shopFestive Snowman", "!shopMuffled Snowman", "!shopCaped Snowman", "!shopRabbit Rickshaw", "!shopBunny Dray", "!shopCony Cart", "!shopRiver Crocovile", "!shopSwamp Crocovile", "!shopNightmarish Crocovile", "!shopGryphon", "!shopJousting Eagle", "!shopCerberus Champion", "!shopCold Percht Sleigh Variant", "!shopBright Percht Sleigh Variant", "!shopDark Percht Sleigh Variant", "!shopCold Percht Sleigh Final", "!shopBright Percht Sleigh Final", "!shopDark Percht Sleigh Final", "!shopBattle Badger", "!shopEther Badger", "!shopZaoan Badger", "!shopBlue Rolling Barrel", "!shopRed Rolling Barrel", "!shopGreen Rolling Barrel", "!shopFloating Sage", "!shopFloating Scholar", "!shopFloating Augur", "!shopHaze", "!shopAntelope", "!shopSnow Strider", "!shopDusk Pryer", "!shopDawn Strayer", "!shopSpectral Horse", "!shopSavanna Ostrich", "!shopCoral Rhea", "!shopEventide Nandu", "!shopVoracious Hyaena", "!shopCunning Hyaena", "!shopScruffy Hyaena", "!shopWhite Lion", "!shopKrakoloss", "!shopMerry Mammoth", "!shopHoliday Mammoth", "!shopFestive Mammoth", "!shopVoid Watcher", "!shopRune Watcher", "!shopRift Watcher", "!shopPhant", "!shopShellodon", "!shopSingeing Steed", "!shopHyacinth", "!shopPeony", "!shopDandelion", "!shopRustwurm", "!shopBogwurm", "!shopGloomwurm", "!shopEmerald Raven", "!shopMystic Raven", "!shopRadiant Raven", "!shopGloothomotive", "!shopTopaz Shrine", "!shopJade Shrine", "!shopObsidian Shrine", "!shopPoppy Ibex", "!shopMint Ibex", "!shopCinnamon Ibex")

function shopsCustom.onSay(player, words, param)
    if words == "/shop" then
        return false
    end
    
    if words == "!shopMidnight Panther" then
        local shopId = 1 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Midnight Panther for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Midnight Panther!")
        end
    elseif words == "!shopWidow Queen" then
        local shopId = 2 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) --
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Widow Queen for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Widow Queen!")
        end
    elseif words == "!shopRacing Bird" then
        local shopId = 3 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Racing Bird for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Racing Bird!")
        end
    elseif words == "!shopWar Bear" then
        local shopId = 4 -- Mount ID
        local shopCost = 20 -- Cost in points to acquire the shop
        if not player:hasMount(shopId) then
            db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId())
            player:addMount(shopId) -- 
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the War Bear for " .. shopCost .. " points!")
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the War Bear!")
        end
   
    end
end

shopsCustom:separator(" ")
shopsCustom:register()

Clique no item para ganhar pontos e poder comprar na store.


local premiumPointsAction = Action()

local function doPlayerAddPremiumPoints(player, count)
    local accountId = player:getAccountId()
    db.query('UPDATE znote_accounts SET points = points +' .. count .. ' WHERE account_id = ' .. db.escapeString(accountId))
end

function premiumPointsAction.onUse(player, item, fromPosition, target, toPosition)
    doPlayerAddPremiumPoints(player, 100)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 100 store point(s) in your account.")
    player:getPosition():sendMagicEffect(28)
    item:remove(1)
    return true
end

premiumPointsAction:id(24774)
premiumPointsAction:register()

É só baixar o module e colocar no seu OTClient... Pronto! Espero que tenha gostado!


https://drive.google.com/file/d/1Cl06Dx2o1ix2AO7aUXJRe292tLvfgU45/view?usp=sharing

 

muito obrigado mano,vc vai ajudar muita gente com esse tutorial :)

 

Postado
  • Autor
Em 23/02/2024 em 21:23, doukxxt disse:

!points

Postei sem querer. Agora, sim, está usando o comando !pontos para saber quantos pontos você tem, apenas para o Znote.

 

local talkaction = TalkAction("!points")

function Player.getZnotePoints(self)
    local query = db.storeQuery("SELECT `points` FROM `znote_accounts` WHERE `id` = " .. self:getAccountId())
    if not query then
        return 0
    end

    local value = result.getNumber(query, "points")
    result.free(query)
    return value or 0
end

function talkaction.onSay(player, words, param, type)
    if words:lower() == "!points" then
        local points = player:getZnotePoints()

       if points > 0 then
            local message = "Your premium points balance is: " .. points
            player:popupFYI(message)
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have premium points.")
        end

        return false
    end
    return true
end

talkaction:separator(" ")
talkaction:register()

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo