Ir para conteúdo
Propaganda

OTClient Shiny Ditto Memory [Modulo] 2024


Posts Recomendados

  • Suporte

E aí Galera Beleza Vim Aqui Postar Esse Módulo Que Já Foi Disponibilizado No TK Sou Apenas Estou Repostando Para Vocês Aqui Vou Deixar Os Créditos Originais Do Dono

o modulo é um Shiny Ditto Memory para PDA ,o melhor é que nao precisa de source e é bem simples de instalar !

1° ponto - Adicionar o memory sistem por TalkAction do @zipter98 (fiz algumas correçoes e melhorias no script para funcionar de uma melhor forma com o modulo)

em Talkactions.xml adicione a tag :  <talkaction words="/memory;!memory" event="script" value="sdittomemory.lua"/>

2° - Em talkaction/script ,crie um arquivo sdittomemory.lua e cole esse script :

local maxSlots = 3            --Quantia máxima de slots.
function getDittoSlots(item)
    if not item or item < 1 then
        return false
    elseif not getItemAttribute(item, "ehshinyditto") and getItemAttribute(item, "poke") ~= "Shiny Ditto" then
        return false
    end
    local slots = {}
    for i = 1, maxSlots do
        local attr = getItemAttribute(item, "memory"..i)
        if attr then
            slots[i] = attr
        end
    end
    return slots
end
function hasDittoSavedPokemon(item, name)
    if not item or item < 1 then
        return false
    elseif not getItemAttribute(item, "ehshinyditto") and getItemAttribute(item, "poke") ~= "Shiny Ditto" then
        return false
    end
    local check
    for i = 1, maxSlots do
        local attr = getItemAttribute(item, "memory"..i)
        if attr and attr == name then
            check = true
            break
        end
    end
    return check
end
function onSay(cid, words, param)
    local item = getPlayerSlotItem(cid, 8).uid
    if item < 1 then
        doPlayerSendCancel(cid, "Put a pokeball in the pokeball slot.")
    elseif not getItemAttribute(item, "ehshinyditto") and getItemAttribute(item, "poke") ~= "Shiny Ditto" then
        doPlayerSendCancel(cid, "Put a pokeball with a Ditto in the pokeball slot.")
    elseif param == "" then
        doPlayerSendCancel(cid, "Especify a param.")
    else
        param = param:lower()
        if param == "check" then
            local str = ""
            for i = 1, maxSlots do
                local attr = getItemAttribute(item, "memory"..i) or "No memory"
                if str == "" then
                    str = i.." - "..attr
                else
                    str = str.."\n"..i.." - "..attr
                end
            end
            doPlayerPopupFYI(cid, "Ditto Memory:\n"..str.."")
        elseif param:find("delete") then
            local slot = tonumber(param:match("delete (.+)"))
            if slot and slot <= maxSlots and slot > 0 then
                if getDittoSlots(item)[slot] then
                    doItemSetAttribute(item, "memory"..slot, false)
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Ditto Memory] Slot "..slot.." deleted.")
                else
                    doPlayerSendCancel(cid, "This slot is empty.")
                end
            else
                doPlayerSendCancel(cid, "Invalid slot.")
            end
        else
            local summons = getCreatureSummons(cid)
            if #summons == 0 then
                doPlayerSendCancel(cid, "You don't have any pokemon out of the pokeball.")
            else
                if param:find("save") then
                    local transformedPoke = getItemAttribute(item, "poke")
                    if transformedPoke and type(transformedPoke) == "string" and transformedPoke ~= "Shiny Ditto" then
                        local slot = tonumber(param:match("save (.+)"))
                        if slot and slot <= maxSlots and slot > 0 then
                            if not getDittoSlots(item)[slot] and not hasDittoSavedPokemon(item, transformedPoke) then
                                doItemSetAttribute(item, "memory"..slot, transformedPoke)
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Ditto Memory] You saved at the slot "..slot..": "..transformedPoke..".")
                            else
                                doPlayerSendCancel(cid, "This slot isn't empty or your Ditto already has this pokemon saved in his memory.")
                            end
                        else
                            doPlayerSendCancel(cid, "Invalid slot.")
                        end
                    else
                        doPlayerSendCancel(cid, "Your Ditto isn't transformed in any pokemon.")
                    end
                else
                    local slot = tonumber(param)
                    local transformPoke = getDittoSlots(item)[slot]
                    local pok = getCreatureMaster(summons[1])
                    local pos = getCreaturePosition(summons[1])
                    local cd = 2
                    
                    if not slot then
                        doPlayerSendCancel(cid, "Invalid param.")
                    elseif slot <= 0 or slot > maxSlots then
                        doPlayerSendCancel(cid, "Use a valid slot.")
                    elseif not transformPoke then
                        doPlayerSendCancel(cid, "This slot is empty.")
                    elseif getPlayerStorageValue(summons[1], 1010) == transformPoke then
                        doPlayerSendCancel(cid, "Your Ditto is already transformed in this pokemon.")
                    else
                    
if getPlayerStorageValue(cid, 918351) > os.time () then
        doPlayerSendCancel(cid, "Espere "..getPlayerStorageValue(cid, 918351) - os.time ().." segundo(s) para trocar")
        return true
        end
        
                local needCds = true                  
        if needCds then
            for i = 1, 12 do
                if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then
                    return doPlayerSendCancel(cid, "Para trocar, todas os moves precisam esta carregados.")
                end
            end
        end


                        setPlayerStorageValue(cid, 918351, os.time () + cd)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[Ditto Memory] Using the slot "..slot..", your Ditto transformed into a "..transformPoke..".")
                        setPlayerStorageValue(summons[1], 1010, transformPoke)
                        doSetCreatureOutfit(summons[1], {lookType = getPokemonXMLOutfit(transformPoke)}, -1)
                        doSendMagicEffect(getThingPos(summons[1]), 184)
                        doCreatureSay(summons[1], "TRANSFORM!", TALKTYPE_MONSTER)
                        doItemSetAttribute(item, "poke", transformPoke)
                        doRemoveCreature(summons[1])
                        doSummonMonster(pok, transformPoke)
                        doTeleportThing(getCreatureSummons(pok)[1], pos, false)
                        adjustStatus(getCreatureSummons(pok)[1], getPlayerSlotItem(pok, 8).uid, true, false)
                        doCreatureSetNick(getCreatureSummons(pok)[1], "Ditto")
                        if useKpdoDlls then
                            doUpdateMoves(cid)
                        end
                    end
                end
            end
        end
    end
    return true
end

em : local cd = 2 (em segundos) mude para o numero que desejar como cooldown para efetuar a troca .

Para efetuar a troca o pokemon precisa esta com os Moves 100% ,caso contrario ira mandar uma mensagem de bloqueio.

 


3° - em somefunctions.lua adicione essas funçoes !

function doDittoTransform(ditto, pokemon)
local sid = getCreatureMaster(ditto)
local eff = 184
local name = pokemon
local pos = getCreaturePosition(ditto)
local outfit = getPokemonXMLOutfit(pokemon)
 doSendMagicEffect(getThingPosWithDebug(ditto), eff)
 doSetCreatureOutfit(ditto, {lookType = outfit}, -1)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ehditto", 1)
 doPlayerSay(sid, ""..getPokeName(ditto)..", transform into "..getArticle(pokemon).." "..pokemon.."!", 1)
  doCreatureSay(ditto, "TRANSFORM!", TALKTYPE_MONSTER)
 doRemoveCreature(ditto)
 doSummonMonster(sid, name)
 doTeleportThing(getCreatureSummons(sid)[1], pos, false)
 adjustStatus(getCreatureSummons(sid)[1], getPlayerSlotItem(sid, 8).uid, true, false)
 doCreatureSetNick(getCreatureSummons(sid)[1], "Ditto")
doUpdateMoves(sid)
return true
end

function doDittoRevert(m)
local sid = m
local eff = 184
local name = "Ditto"
local outfit = getPokemonXMLOutfit(name)
if #getCreatureSummons(sid) <= 0 then
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ehditto", 1)
elseif #getCreatureSummons(sid) == 1 then
local ditto = getCreatureSummons(sid)[1]
local pos = getCreaturePosition(ditto)
if getCreatureName(ditto) == "Ditto" then
return true
end
 doSendMagicEffect(getThingPosWithDebug(ditto), eff)
 doSetCreatureOutfit(ditto, {lookType = outfit}, -1)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ehditto", 1)
 doPlayerSay(sid, ""..getPokeName(ditto)..", untransfrom!", 1)
  doCreatureSay(ditto, "TRANSFORM!", TALKTYPE_MONSTER)
 doRemoveCreature(ditto)
 doSummonMonster(sid, name)
 doTeleportThing(getCreatureSummons(sid)[1], pos, false)
 adjustStatus(getCreatureSummons(sid)[1], getPlayerSlotItem(sid, 8).uid, true, false)
doUpdateMoves(sid)
end
end 

function doShinyDittoTransform(ditto, pokemon)
local sid = getCreatureMaster(ditto)
local eff = 184
local name = pokemon
local pos = getCreaturePosition(ditto)
local outfit = getPokemonXMLOutfit(pokemon)
 doSendMagicEffect(getThingPosWithDebug(ditto), eff)
 doSetCreatureOutfit(ditto, {lookType = outfit}, -1)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ehshinyditto", 1)
 doPlayerSay(sid, ""..getPokeName(ditto)..", transform into "..getArticle(pokemon).." "..pokemon.."!", 1)
  doCreatureSay(ditto, "TRANSFORM!", TALKTYPE_MONSTER)
 doRemoveCreature(ditto)
 doSummonMonster(sid, name)
 doTeleportThing(getCreatureSummons(sid)[1], pos, false)
 adjustStatus(getCreatureSummons(sid)[1], getPlayerSlotItem(sid, 8).uid, true, false)
 doCreatureSetNick(getCreatureSummons(sid)[1], "Ditto")
doUpdateMoves(sid)
return true
end

function doShinyDittoRevert(m)
local sid = m
local eff = 184
local name = "Shiny Ditto"
local outfit = getPokemonXMLOutfit(name)
if #getCreatureSummons(sid) <= 0 then
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ehshinyditto", 1)
elseif #getCreatureSummons(sid) == 1 then
local ditto = getCreatureSummons(sid)[1]
local pos = getCreaturePosition(ditto)
if getCreatureName(ditto) == "Shiny Ditto" then
return true
end
 doSendMagicEffect(getThingPosWithDebug(ditto), eff)
 doSetCreatureOutfit(ditto, {lookType = outfit}, -1)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ehshinyditto", 1)
 doPlayerSay(sid, ""..getPokeName(ditto)..", untransfrom!", 1)
  doCreatureSay(ditto, "TRANSFORM!", TALKTYPE_MONSTER)
 doRemoveCreature(ditto)
 doSummonMonster(sid, name)
 doTeleportThing(getCreatureSummons(sid)[1], pos, false)
 adjustStatus(getCreatureSummons(sid)[1], getPlayerSlotItem(sid, 8).uid, true, false)
doUpdateMoves(sid)
end
end 

tem umas correções q eu mesmo fiz no ditto system e shiny ditto system ,e é necessario pro modulo funcionar 100% .

4° - extraia e adicione o arquivo na pasta Modulos do seu OTClient !

pronto , com isso vai funcionar o modulo image.png.832acea1f94f8543bf0282b573cc421f.png

1 - no icone salvar , vc consegue salvar o pokemon que o ditto esta transformado em cada slot (pokebola) e reverter o ditto.
2 - no icone check , vc consegue remover uma memoria ou checar quais memorias o seu ditto esta usando.
3 - e no icone transformar vc transforma em cada memoria salva no s.ditto e tbm consegue reverter para virar um pokemon novo sem usar a memori etc..


entao é isso galera , espero que seja util .

CREDITOS :

@zipter98 

@usoparagames

game_memory.rar

  • Like 1
Link para o comentário
Compartilhar em outros sites

  • Moderador

Tópico Aprovado!
Somos gratos por sua contribuição, com certeza será útil para toda a comunidade! ❤️  REP+

Link para o comentário
Compartilhar em outros sites

  • 5 meses depois...

rapaz so tem um problema , como remover o memory agora  ? pois quando dou remover da invalid param 

Link para o comentário
Compartilhar em outros sites

Participe da Conversa

Você pode postar agora e se cadastrar mais tarde. Cadastre-se Agora para publicar com Sua Conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.

×
  • Criar Novo...