Postado Maio 21, 2023 1 ano Olá galera bom dia , boa tarde e boa noite a todos ! venho trazer meu primeiro projeto para contribuir com o TK , se trata de um modulo bastante util como é minha primeira vez trazendo algo aqui , talvez eu esqueça de algo , sem enrolação vamos la. 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 : Citar 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 ! Citar 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 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 Eu game_memory.rar Editado Maio 23, 2023 1 ano por brunei melhoria no script ( adicionado cooldown e um bloqueio na troca caso o pokemon n esteja com os moves 100% carregados ) (veja o histórico de edições)
Postado Maio 22, 2023 1 ano Cara, ficou simplesmente perfeito, um detalhezinho que faltou é um exaust pra não spammar as trocas
Postado Maio 23, 2023 1 ano Autor que bom que gostou mano, e obrigado pela dica com isso agora creio que esteja 100% , topico atualizado só trocar o sdittomemory.lua . agora tem um cooldown de 2 segundos para trocar (configurável) e coloquei um bloqueio caso o pokemon nao esteja com o moveset 100% carregado.
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.