Luga03 333 Postado Julho 9, 2015 Share Postado Julho 9, 2015 (editado) Eae pessoal blz?? eu peguei o ditto system postado pelo Wend e feito pelo Gabrielbsales(Featzen), então só mudei algumas tags e modifiquei um pouco e dei umas melhorias, bem pequenas só que vão ajudar, creio eu Então vamos parar de blábláblá em começar o tutorial!Primeiramente vá em Data/actions/scripts/order.lua e Procure por: -------- TRANSFORM ---------- Apague tudo aqui dentro, até o: -------- LIGHT ------------ Ai dentro ditto coloque isto: if (getCreatureName(mysum) == "Ditto") and getItemAttribute(thisball.uid, "ehditto") ~= -1 and isMonster(item2.uid) and pokes[getCreatureName(item2.uid)] then local m = getCreatureMaster(cid) local p = getPlayerSlotItem(m, 8) local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon"} -- Nunca permitir local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50 local boost = getItemAttribute(thisball.uid, "boost") or 0 if getCreatureName(item2.uid) == "Ditto" or getCreatureName(item2.uid) == "Shiny Ditto" then doPlayerSendCancel(cid, "Your ditto can't transform into another ditto.") markPos(mysum, unfix) return true end if isInArray(proibidossempre, getCreatureName(item2.uid)) then --Checa a lista doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.") markPos(mysum, unfix) return true end if isInArray(proibidosboost, getCreatureName(item2.uid)) and boost < 50 then --Checa a lista doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.") markPos(mysum, unfix) return true end if getCreatureName(item2.uid) == getPlayerStorageValue(mysum, 1010) then doPlayerSendCancel(cid, "Your ditto is already transformed into that pokemon.") markPos(mysum, unfix) return true end markPos(mysum, unfix) local name = getCreatureName(item2.uid) setPlayerStorageValue(mysum, 1010, getCreatureName(item2.uid)) doItemSetAttribute(thisball.uid, "ehditto", 1) doItemSetAttribute(thisball.uid, "poke", getCreatureName(item2.uid)) doUpdateMoves(cid) doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1) doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER) doFaceCreature(mysum, getThingPos(item2.uid)) doSendMagicEffect(getThingPos(mysum), 184) doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1) return true end ----------------------------- -------- TRANSFORM Shiny Ditto ---------- --alterado v1.7 if (getCreatureName(mysum) == "Shiny Ditto") and getItemAttribute(thisball.uid, "ehshinyditto") ~= -1 and isMonster(item2.uid) and pokes[getCreatureName(item2.uid)] then local m = getCreatureMaster(cid) local p = getPlayerSlotItem(m, 8) local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon"} -- Nunca permitir local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50 local boost = getItemAttribute(thisball.uid, "boost") or 0 if getCreatureName(item2.uid) == "Ditto" or getCreatureName(item2.uid) == "Shiny Ditto" then doPlayerSendCancel(cid, "Your ditto can't transform into another ditto.") markPos(mysum, unfix) return true end if isInArray(proibidossempre, getCreatureName(item2.uid)) then --Checa a lista doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.") markPos(mysum, unfix) return true end if isInArray(proibidosboost, getCreatureName(item2.uid)) and boost < 50 then --Checa a lista doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.") markPos(mysum, unfix) return true end if getCreatureName(item2.uid) == getPlayerStorageValue(mysum, 1010) then doPlayerSendCancel(cid, "Your ditto is already transformed into that pokemon.") markPos(mysum, unfix) return true end markPos(mysum, unfix) local name = getCreatureName(item2.uid) setPlayerStorageValue(mysum, 1010, getCreatureName(item2.uid)) doItemSetAttribute(thisball.uid, "ehshinyditto", 1) doItemSetAttribute(thisball.uid, "poke", getCreatureName(item2.uid)) doUpdateMoves(cid) doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1) doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER) doFaceCreature(mysum, getThingPos(item2.uid)) doSendMagicEffect(getThingPos(mysum), 184) --doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1) doCreatureSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", TALKTYPE_ORANGE_1) return true end Pronto Agora esta transformando e copiando as habilidades e tudo! Agora Para o ditto e shiny ditto reverter a transformação .Crie um arquivo chamado dittorevert.lua em data/talkactions e coloque isto dentro: function onSay(cid, words, param, channel) local thisball = getPlayerSlotItem(cid, 8) if getItemAttribute(thisball.uid, "ehditto") then doItemSetAttribute(thisball.uid, "poke", "Ditto") doItemSetAttribute(thisball.uid, "ehditto", 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Puxe o ditto para terminar a reversão do ditto.') elseif getItemAttribute(thisball.uid, "ehshinyditto") then doItemSetAttribute(thisball.uid, "poke", "Shiny Ditto") doItemSetAttribute(thisball.uid, "ehshinyditto", 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Puxe o Shiny Ditto para terminar a reversão do Shiny Ditto.') else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você Não Está Usando Um Ditto ou Shiny Ditto.') end end e em talkactions.xml coloque isto: <talkaction words="!revert" event="script" value="dittorevert.lua"/> Pronto sistema 100% só que ele está com nome, poder, força tudo igual! para resolver isto vamos em lib/level system.luaabra e procure por isto: setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack) e substitua por isto: if (getItemAttribute(item, "ehditto") == 1) then setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense * 0.75) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense * 0.75) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility * 0.75) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack * 0.75) elseif (getItemAttribute(item, "ehshinyditto") == 1) then setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense * 0.50) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense * 0.50) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility * 0.50) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack * 0.50) else setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack) end Pronto Agora o Shiny ditto ta com 75% de força do poke transformado e o ditto com 50% de força do pokemon transformadoAgora para identificar que é um ditto/shiny ditto vamos em creaturescript/scripts/look.lua, abra e procure por: table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") substitua por: if getItemAttribute(thing.uid, "ehditto") == 1 then table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n") elseif getItemAttribute(thing.uid, "ehshinyditto") == 1 then table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Shiny Ditto).\n") else table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") end Em actions/scripts/goback.lua procure por: if getCreatureName(pk) == "Ditto" or getCreatureName(pk) == "Shiny Ditto" then --edited local left = getItemAttribute(item.uid, "transLeft") local name = getItemAttribute(item.uid, "transName") if left and left > 0 then setPlayerStorageValue(pk, 1010, name) doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1) addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn")) doItemSetAttribute(item.uid, "transBegin", os.clock()) else setPlayerStorageValue(pk, 1010, getCreatureName(pk) == "Ditto" and "Ditto" or "Shiny Ditto") --edited end end e apague!em lib/Some Functions.lua procure por: function doAppear(cid) --Faz um poke q tava invisivel voltar a ser visivel... if not isCreature(cid) then return true end doRemoveCondition(cid, CONDITION_INVISIBLE) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetHideHealth(cid, false) if getCreatureName(cid) == "Ditto" and pokes[getPlayerStorageValue(cid, 1010)] and getPlayerStorageValue(cid, 1010) ~= "Ditto" then if isSummon(cid) then local item = getPlayerSlotItem(getCreatureMaster(cid), 8) doSetCreatureOutfit(cid, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1) --alterado v1.6.1 end end end e substitua por: function doAppear(cid) --Faz um poke q tava invisivel voltar a ser visivel... if not isCreature(cid) then return true end doRemoveCondition(cid, CONDITION_INVISIBLE) doRemoveCondition(cid, CONDITION_OUTFIT) doCreatureSetHideHealth(cid, false) end Ainda em Some functions procure por: if getCreatureName(pokemon) == "Ditto" then if isTransformed(pokemon) then local left = getItemAttribute(pokeball.uid, "transLeft") - (os.clock() - getItemAttribute(pokeball.uid, "transBegin")) doItemSetAttribute(pokeball.uid, "transLeft", left) end end e apaguee para finalizar procure por: if getCreatureName(pokemon) == "Shiny Ditto" then if isTransformed(pokemon) then local left = getItemAttribute(pokeball.uid, "transLeft") - (os.clock() - getItemAttribute(pokeball.uid, "transBegin")) doItemSetAttribute(pokeball.uid, "transLeft", left) end end e Apague!!!!!!!Pronto Agora sim Sistema 100% Esta Copiando Habilidades, força diminuida do pokemon normal e identificação do Ditto e Shiny Ditto! Acredito que vai ajudar a muitos!CréditosGabrielbsales Por criar o ScriptWend por fazer um tutorial mais completoZet0N0Murmurou (Summer Slyer) por adaptar e melhorar o script para o Shiny Ditto! UP Editado Julho 7, 2015 por Zet0N0Murmurouu raulcdj e Sudoudo reagiu a isso 1 1 Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/ Compartilhar em outros sites More sharing options...
samlecter 133 Postado Dezembro 21, 2015 Share Postado Dezembro 21, 2015 Opa, depois quando tiver tempo eu testo, pois já tenho um ditto system no meu ot que modifiquei para poder ter Slots de memoria pro ditto, tenho medo de ter que perder o memory system pra por o shiny ditto Acho que tem um erro, na parte do status do ditto e shiny ditto, acho que está invertido, não? if (getItemAttribute(item, "ehditto") == 1) then setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense * 0.75) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense * 0.75) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility * 0.75) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack * 0.75) elseif (getItemAttribute(item, "ehshinyditto") == 1) then setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense * 0.50) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense * 0.50) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility * 0.50) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack * 0.50) else setPlayerStorageValue(pk, 1000, getItemAttribute(item, "level")) setPlayerStorageValue(pk, 1001, getItemAttribute(item, "offense") + bonusoffense) setPlayerStorageValue(pk, 1002, getItemAttribute(item, "defense") + bonusdefense) setPlayerStorageValue(pk, 1003, getItemAttribute(item, "speed") + bonusagility) setPlayerStorageValue(pk, 1005, getItemAttribute(item, "specialattack") + bonussattack) end Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1678718 Compartilhar em outros sites More sharing options...
Luga03 333 Postado Dezembro 22, 2015 Autor Share Postado Dezembro 22, 2015 Você está utilizando aquele da Talkactions né? do zipter... se sim, nós fizemos algumas adaptações que funciona com este ditto e com o ditto Memory por slot! Caso sim da um salve ai que eu mando o código. Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1678727 Compartilhar em outros sites More sharing options...
samlecter 133 Postado Dezembro 22, 2015 Share Postado Dezembro 22, 2015 Você está utilizando aquele da Talkactions né? do zipter... se sim, nós fizemos algumas adaptações que funciona com este ditto e com o ditto Memory por slot! Caso sim da um salve ai que eu mando o código. Sim, do zipter mesmo, só que vi em outro forum, pode mandar o link aqui ? se possivel posta ai o código para ditto e shiny ditto com memory :lolz: Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1678764 Compartilhar em outros sites More sharing options...
Luga03 333 Postado Dezembro 22, 2015 Autor Share Postado Dezembro 22, 2015 Apenas Substitua o código lá da talkactions por este: local maxSlots = 3 --Quantia máxima de slots. function getDittoSlots(item) if not item or item < 1 then return false elseif not getItemAttribute(item, "ehditto") and getItemAttribute(item, "poke") ~= "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, "ehditto") and getItemAttribute(item, "poke") ~= "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, "ehditto") and getItemAttribute(item, "poke") ~= "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("forget") then local slot = tonumber(param:match("forget (.+)")) 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 ~= "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] 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 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) if useKpdoDlls then doUpdateMoves(cid) end end end end end end return true end Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1678766 Compartilhar em outros sites More sharing options...
Josegvb 87 Postado Janeiro 5, 2016 Share Postado Janeiro 5, 2016 valeu pela contribuçao, gostaria de testar porem só tenho 2 duvidas 1º eu gostaria com o ditto memmory junto ue (pode esquecer) 2º o importante é tipo qndo tinha ditto no meu ot, quando voce transformaba o ditto em x pokemon ele pegaba o nome de este pokemon (sim vi q vc ja resolveu pra falar Ditto) porem alem de pegar o nome ele tb se tornaba na Ball (icone) do pokemon que ele copeiaba entao os negos estabam virando megas e vendendo falando q eram megas entao a pergunta é com esse sistema ai a ball ainda vira o icone do pokemon copeiado? obs (acho q isso só acontece quando voce desloga e volta, ai a ball é quando se torna em icone do pokemon copiado) Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680078 Compartilhar em outros sites More sharing options...
Bluester 206 Postado Janeiro 5, 2016 Share Postado Janeiro 5, 2016 valeu pela contribuçao, gostaria de testar porem só tenho 2 duvidas 1º eu gostaria com o ditto memmory junto ue (pode esquecer) 2º o importante é tipo qndo tinha ditto no meu ot, quando voce transformaba o ditto em x pokemon ele pegaba o nome de este pokemon (sim vi q vc ja resolveu pra falar Ditto) porem alem de pegar o nome ele tb se tornaba na Ball (icone) do pokemon que ele copeiaba entao os negos estabam virando megas e vendendo falando q eram megas entao a pergunta é com esse sistema ai a ball ainda vira o icone do pokemon copeiado? obs (acho q isso só acontece quando voce desloga e volta, ai a ball é quando se torna em icone do pokemon copiado) Usei esse sistema em meu servidor, e não, não cópia aqui. Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680081 Compartilhar em outros sites More sharing options...
Luga03 333 Postado Janeiro 5, 2016 Autor Share Postado Janeiro 5, 2016 Este sistema, eu complementei com vários que achei na net, como o do Wend (Anna Feeh) e com o do zipter ... Então, se quiser que não mude o nome só me avisar que eu tento modificar Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680089 Compartilhar em outros sites More sharing options...
Administrador Administrador 1437 Postado Janeiro 5, 2016 Administrador Share Postado Janeiro 5, 2016 Belo sistema! Reputado Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680103 Compartilhar em outros sites More sharing options...
Josegvb 87 Postado Janeiro 5, 2016 Share Postado Janeiro 5, 2016 Este sistema, eu complementei com vários que achei na net, como o do Wend (Anna Feeh) e com o do zipter ... Então, se quiser que não mude o nome só me avisar que eu tento modificar aew mano eu testei no meu server e deu um bug horrivel q foi q qndo vc daba click no pokemon pra chamar-lo ele nao saia da ball só aparescia assim do lado e se voce clicaba dnovo veio +1 e assim daba pra colocar infinitos. nem sou scrpiter pra nada sou um lixo e nem entendo nada de scripts mas fikei olhando no sistema antigo q nem daba bug (o bug tava no levelsystem), ai eu so adicionei o shiny ditto no antigo e funfou dahora. e sim eu gostaria q o ditto parace de pegar o nome do pokemon original pq qndo vc da transform ele muda o nome pra o do pokemon q vc deu transform mas quero q ainda fike o (ditto) 15:10 You see a Icone.. It contains a Shiny Mantine (Ditto). It is genderless. reputado tb Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680107 Compartilhar em outros sites More sharing options...
Luga03 333 Postado Janeiro 5, 2016 Autor Share Postado Janeiro 5, 2016 (editado) Blz, vou rever o code e vê oque dá pra fazer, quando conseguir te aviso Dei uma otmizada no script e coloquei para fazer oque o Josegvb pediu... então faça o seguinte Na parte que vc mudou no Order.lua, substitua por isto: if isDitto(mysum) and isMonster(item2.uid) and pokes[np] then local m = getCreatureMaster(cid) local p = getPlayerSlotItem(m, 8) local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon"} -- Nunca permitir local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50 local boost = getItemAttribute(thisball.uid, "boost") or 0 local np = getCreatureName(item2.uid) if np == "Ditto" or np == "Shiny Ditto" then doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." can't transform into another ".. np ..".") markPos(mysum, unfix) return true end if isInArray(proibidossempre, np) then --Checa a lista doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." can't transform into that pokemon.") markPos(mysum, unfix) return true end if isInArray(proibidosboost, np) and boost < 50 then --Checa a lista doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." can't transform into that pokemon.") markPos(mysum, unfix) return true end if np == getPlayerStorageValue(mysum, 1010) then doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." is already transformed into that pokemon.") markPos(mysum, unfix) return true end markPos(mysum, unfix) setPlayerStorageValue(mysum, 1010, np) if getCreatureName(mysum) == "Ditto" then doItemSetAttribute(thisball.uid, "ehditto", 1) elseif getCreatureName(mysum) == "Shiny Ditto" then doItemSetAttribute(thisball.uid, "ehshinyditto", 1) end doItemSetAttribute(thisball.uid, "poke", np) doUpdateMoves(cid) doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1) doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER) doFaceCreature(mysum, getThingPos(item2.uid)) doSendMagicEffect(getThingPos(mysum), 184) doCreatureSetNick(cid, getPokeName(mysum)) doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1) return true end E no final de somes function.lua adicione isto: function isDitto(cid) if (getCreatureName(mysum) == "Ditto") or (getCreatureName(mysum) == "Shiny Ditto") then if getItemAttribute(thisball.uid, "ehditto") ~= -1 or getItemAttribute(thisball.uid, "ehshinyditto") ~= -1 then return true end end return true end Não testei, mas se der algum problema avisa ai, se funcionar tbm avisa kkk Editado Janeiro 5, 2016 por Drazyn1291 Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680108 Compartilhar em outros sites More sharing options...
Josegvb 87 Postado Janeiro 6, 2016 Share Postado Janeiro 6, 2016 (editado) Blz, vou rever o code e vê oque dá pra fazer, quando conseguir te aviso Dei uma otmizada no script e coloquei para fazer oque o Josegvb pediu... então faça o seguinte Na parte que vc mudou no Order.lua, substitua por isto: if isDitto(mysum) and isMonster(item2.uid) and pokes[np] then local m = getCreatureMaster(cid) local p = getPlayerSlotItem(m, 8) local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon"} -- Nunca permitir local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50 local boost = getItemAttribute(thisball.uid, "boost") or 0 local np = getCreatureName(item2.uid) if np == "Ditto" or np == "Shiny Ditto" then doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." can't transform into another ".. np ..".") markPos(mysum, unfix) return true end if isInArray(proibidossempre, np) then --Checa a lista doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." can't transform into that pokemon.") markPos(mysum, unfix) return true end if isInArray(proibidosboost, np) and boost < 50 then --Checa a lista doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." can't transform into that pokemon.") markPos(mysum, unfix) return true end if np == getPlayerStorageValue(mysum, 1010) then doPlayerSendCancel(cid, "Your ".. getPokeName(mysum) .." is already transformed into that pokemon.") markPos(mysum, unfix) return true end markPos(mysum, unfix) setPlayerStorageValue(mysum, 1010, np) if getCreatureName(mysum) == "Ditto" then doItemSetAttribute(thisball.uid, "ehditto", 1) elseif getCreatureName(mysum) == "Shiny Ditto" then doItemSetAttribute(thisball.uid, "ehshinyditto", 1) end doItemSetAttribute(thisball.uid, "poke", np) doUpdateMoves(cid) doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1) doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER) doFaceCreature(mysum, getThingPos(item2.uid)) doSendMagicEffect(getThingPos(mysum), 184) doCreatureSetNick(cid, getPokeName(mysum)) doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1) return true end E no final de somes function.lua adicione isto: function isDitto(cid) if (getCreatureName(mysum) == "Ditto") or (getCreatureName(mysum) == "Shiny Ditto") then if getItemAttribute(thisball.uid, "ehditto") ~= -1 or getItemAttribute(thisball.uid, "ehshinyditto") ~= -1 then return true end end return true end Não testei, mas se der algum problema avisa ai, se funcionar tbm avisa kkk não sou scripter + pelo que percebi voce fusou a lista do Ditto e Shiny Ditto em 1 a lista dos pokes prohibidos mas ai ferrou pra min ja que eu irei liberar alguns pokes no shiny ditto q o ditto normal nem tem como copiar no ditto normal ;x o sistema ta perfeito parabens mano, ainda nao testei esse ai por ter ditto e shiny ditto em 1 tb queria perguntar se tiver o link de 1 sistema de ditto memmory compativel com esse sistema ai disponivilizar pra min pfv ^^ edit: tentei modificar-lo sem tirar a lista de bloqueio do ditto e shiny ditto ficando assim if (getCreatureName(mysum) == "Shiny Ditto") and getItemAttribute(thisball.uid, "ehshinyditto") ~= -1 and isMonster(item2.uid) and pokes[getCreatureName(item2.uid)] then local m = getCreatureMaster(cid) local p = getPlayerSlotItem(m, 8) local proibidossempre = {"Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Suicune", "Lugia", "Mewtwo", "Mew", "Shiny Rhydon", "Shiny Ariados", "Shiny Magneton", "Shiny Ninetales", "Shiny Politoed", "Shiny Stantler", "Shiny Dodrio", "Shiny Espeon", "Shiny Umbreon", "Mega Blaziken", "Mega Sceptile", "Mega Sableye", "Mega Alakazam", "Gardevoir", "Mega Gardevoir", "Mega Charizard X", "Mega Charizard Y", "Mega Alakazam", "Dark Mega Alakazam", "Dark Mega Blaziken", "Mega Tangrowth", "Mega Blastoise", "Dark Mega Alakazam", "Dark Mega Ampharos", "Dark Mega Blaziken", "Dark Mega Charizard", "Dark Mega Gengar", "Dark Mega Gyarados", "Dark Mega Sceptile", "Dark Mega Tyranitar", "Deus caterpie", "Maromba", "Mega Absol", "Mega Aerodactyl", "Mega Aggron", "Mega Alakazam", "Mega Ampharos", "Mega Blastoise", "Mega Blaziken", "Mega Charizard X", "Mega Charizard Y", "Mega Gardevoir", "Mega Gengar", "Mega Glalie", "Mega Gyarados", "Mega Kabutops", "Mega Kangaskhan", "Mega Lucario", "Mega Manectric", "Mega Mawile", "Mega Sableye", "Mega Sceptile", "Mega Slowking", "Mega Swampert", "Mega Tangrowth", "Mega Tyranitar", "Mega Venusaur", "Mega Volt", "Mega Wobbuffet", "Pardao", "Pensador", "Piaozinho", "Senencio", "Shiny Mega Blaziken", "Shiny Mega Lucario", "Tyrantrum", "Ancient Alakazam", "Ancient Dragonite", "Ancient Kingdra", "Ancient Meganium", "Ancient Scyther", "Ancient Snorlax", "Aviator Pidgeot", "Banshee Misdreavus", "Bone Marowak", "Boxer Hitmonchan", "Brave Blastoise", "Brave Charizard", "Brave Nidoking", "Brave Nidoqueen", "Brave Noctowl", "Brave Venusaur", "Brute Farfetch'd", "Brute Rhydon", "Brute Ursaring", "Capoeira Hitmontop", "Charged Raichu", "Dark Crobat", "Dragon Machamp", "Elder Arcanine", "Elder Blastoise", "Elder Charizard", "Elder Dragonite", "Elder Electabuzz", "Elder Gengar", "Elder Jynx", "Elder Marowak", "Elder Muk", "Elder Pidgeot", "Elder Pinsir", "Elder Raichu", "Elder Tangela", "Elder Tentacruel", "Elder Tyranitar", "Elder Venusaur", "Enigmatic Girafarig", "Enraged Typhlosion", "Evil Cloyster", "Freezing Dewgong", "Furios Ampharos", "Furios Mantine", "Furios Murkrow", "Furious Sandslash", "Furious Scyther", "Hard Golem", "Heavy Piloswine", "Iron Steelix", "Lava Magmar", "Magnet Electabuzz", "Master Abra", "Master Alakazam", "Master Stantler", "Metal Scizor", "Metal Skarmory", "Milch-Miltank", "Moon Clefable", "Octopus Octillery", "Psy Jynx", "Roll Donphan", "Singer Wigglytuff", "Taekwondo Hitmonlee", "Tribal Feraligatr", "Tribal Scyther", "Tribal Xatu", "Undefted Machamp", "War Farfetch'd", "War Granbull", "War Gyarados", "War Heracross", "Wardog Arcanine", "Agata Abra", "Agata Gengar", "Agata Houndoom", "Agata Misdreavus", "Agata Murkrow", "Agata Umbreon", "Ash Blastoise", "Ash Charizard", "Ash Pidgeot", "Ash Pikachu", "Ash Snorlax", "Ash Venusaur", "Bruno Hitmonchan", "Bruno Hitmonlee", "Bruno Hitmontop", "Bruno Machamp", "Bruno Onix", "Clan Blastoise", "Clan Gyarados", "Clan Jynx", "Clan Kabutops", "Gardestriker Shiny Hitmonchan", "Gardestriker Shiny Hitmonlee", "Gardestriker Shiny Hitmontop", "Gardestriker Shiny Snorlax", "Lance Aerodactyl", "Lance Charizard", "Lance Dragonair", "Lance Dragonite", "Lance Gyarados", "Lance Shiny Dragonair", "Lorelei Cloyster", "Lorelei Delibird", "Lorelei Dewgong", "Lorelei Jynx", "Lorelei Lapras", "Lorelei Piloswine", "Malefic Gengar", "Malefic Misdreavus", "Malefic Shiny Gengar", "Malefic Shiny Muk", "Malefic Umbreon", "Orebound Aerodactyl", "Orebound Golden Rhydon", "Orebound Golem", "Orebound Shiny Golem", "Orebound Shiny Marowak", "Piaonzinho", "Psycraft Alakazam", "Psycraft Shiny Abra", "Psycraft Shiny Alakazam", "Psycraft Shiny Hypno", "Psycraft Slowking", "Raibolt Electabuzz", "Raibolt Raichu", "Raibolt Shiny Electabuzz", "Raibolt Shiny Jolteon", "Raibolt Shiny Raichu", "Seavell Blastoise", "Seavell Gyarados", "Seavell Jynx", "Seavell Lapras", "Seavell Shiny Blastoise", "Seavell Shiny Seadra", "Seavell Shiny Tentacruel", "Seavell Tentacruel", "Volcanic Charizard", "Volcanic Magmar", "Volcanic Shiny Arcanine", "Volcanic Shiny Charizard", "Volcanic Typhlosion", "Wingeon Dragonite", "Wingeon Shiny Dragonite", "Wingeon Shiny Farfetch'd", "Wingeon Shiny Fearow", "Wingeon Shiny Pidgeot", "Super Magneton", "Super Poliwrath", "Super Primeape", "Super Salamence", "Super Victreebel", "Bixo Papao", "Maromba"} -- Nunca permitir local proibidosboost = {"Shiny Dragonite", "Shiny Snorlax", "Shiny Gyarados", "Shiny Scyther"} -- Permitir se ditto for +50 local boost = getItemAttribute(thisball.uid, "boost") or 0 if getCreatureName(item2.uid) == "Ditto" or getCreatureName(item2.uid) == "Shiny Ditto" then doPlayerSendCancel(cid, "Your ditto can't transform into another ditto.") markPos(mysum, unfix) return true end if isInArray(proibidossempre, getCreatureName(item2.uid)) then --Checa a lista doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.") markPos(mysum, unfix) return true end if isInArray(proibidosboost, getCreatureName(item2.uid)) and boost < 50 then --Checa a lista doPlayerSendCancel(cid, "Your ditto can't transform into that pokemon.") markPos(mysum, unfix) return true end if getCreatureName(item2.uid) == getPlayerStorageValue(mysum, 1010) then doPlayerSendCancel(cid, "Your ditto is already transformed into that pokemon.") markPos(mysum, unfix) return true end markPos(mysum, unfix) setPlayerStorageValue(mysum, 1010, np) if getCreatureName(mysum) == "Ditto" then doItemSetAttribute(thisball.uid, "ehditto", 1) elseif getCreatureName(mysum) == "Shiny Ditto" then doItemSetAttribute(thisball.uid, "ehshinyditto", 1) end doItemSetAttribute(thisball.uid, "poke", np) doUpdateMoves(cid) doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1) doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER) doFaceCreature(mysum, getThingPos(item2.uid)) doSendMagicEffect(getThingPos(mysum), 184) doCreatureSetNick(cid, getPokeName(mysum)) doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 1) return true end e coloquei o outro la no some funtions (só fiz pro o shiny ditto) e agora quando vc volta o shiny pra a ball ele volta pro o poke original (shiny ditto) tb tava mundando o nome do jogador pra Ditto KPASOKAPOK Editado Janeiro 6, 2016 por josegvb Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680203 Compartilhar em outros sites More sharing options...
Luga03 333 Postado Janeiro 6, 2016 Autor Share Postado Janeiro 6, 2016 mds, eu fazer as coisas sem testar n dá certo aeuhuehe, vou editar aqui Usa o ditto Memory do Zipter, substitua o codigo que o zipter mandou, por este: local maxSlots = 3 --Quantia máxima de slots. function getDittoSlots(item) if not item or item < 1 then return false elseif not getItemAttribute(item, "ehditto") and getItemAttribute(item, "poke") ~= "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, "ehditto") and getItemAttribute(item, "poke") ~= "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, "ehditto") and getItemAttribute(item, "poke") ~= "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("forget") then local slot = tonumber(param:match("forget (.+)")) 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 ~= "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] 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 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) if useKpdoDlls then doUpdateMoves(cid) end end end end end end return true end tenta usar este code: http://pastebin.com/e3j83Fx9 Este code é o do order.lua ... Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680208 Compartilhar em outros sites More sharing options...
Josegvb 87 Postado Janeiro 8, 2016 Share Postado Janeiro 8, 2016 [07/01/2016 22:14:49] [Error - LuaScriptInterface::loadFile] data/actions/scripts/order.lua:332: unexpected symbol near ',' [07/01/2016 22:14:49] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/order.lua) [07/01/2016 22:14:49] data/actions/scripts/order.lua:332: unexpected symbol near ',' Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680393 Compartilhar em outros sites More sharing options...
lSainty 82 Postado Janeiro 12, 2016 Share Postado Janeiro 12, 2016 É possível fazer atualizar os status sem ter que voltar o Ditto para a ball, aqui eu tenho que voltar ele para a ball para atualizar o status Link para o comentário https://xtibia.com/forum/topic/235361-ditto-e-shiny-ditto-system-100/#findComment-1680994 Compartilhar em outros sites More sharing options...
Posts Recomendados