Ir para conteúdo

Featured Replies

Postado
  • Este é um post popular.

Bom, já tem um ditto system(meu) aqui no TK, mas ele é meio chato, ao transformar tem que puxar e botar o pokemon novamente, esse novo não precisa de nada disso.

 

Primeiramente, vá no some functions.lua - Localizado na pasta lib.

E adicione isto no final(depois do ultimo end):

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)
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 

 

Bom, essas são as funções de transformar e destransformar.

 

Agora, vá no order.lua - Localizado no actions/scripts.

E procure por:

-------- TRANSFORM ----------

Apague tudo aqui dentro, até o:

-------- LIGHT --------------

Ali dentro, bote: 

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 = {"Mew_", "Mewtwo_", "Unown Legion", "Ho-oh", "Moltres", "Celebi", "Moltres", "Zapdos", "Suicune", "Entei", "Raikou", "Articuno", "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 outpokes = {"Magnet Electabuzz","Elder Tyranitar","Hard Golem","Brute Rhydon","Iron Steelix","Brave Charizard","Elder Charizard","Lava Magmar","Enraged Typhlosion","Capoeira Hitmontop","Boxer Hitmonchan","Taekwondo Hitmonlee","Dragon Machamp","Undefeated Machamp","Wardog Arcanine","Elder Arcanine","Furious Mantine","War Gyarados","Brave Blastoise","Brave Venusaur","Ancient Meganium","Tribal Feraligatr","Elder Dragonite","Elder Pinsir","Elder Raichu","Charged Raichu","Tribal Xatu","Enigmatic Girafarig","Ancient Alakazam","Master Alakazam","Furious Ampharos","Elder Electabuzz","Furious Scyther","Tribal Scyther","War Heracross","Metal Scizor","Brave Nidoking","Brave Nidoqueen","Elder Muk","Dark Crobat","Trickmaster Gengar"                              ,"Elder Gengar"                              ,"Banshee Misdreavus","Hungry Snorlax","Brute Ursaring","War Granbull","Singer Wigglytuff","Aviator Pidgeot","Metal Skarmory","Brave Noctowl","Elder Pidgeot","Ancient Dragonite","Milch-Miltank","Ancient Kingdra","Psy Jynx","Elder Venusaur","Elder Jynx","Evil Cloyster","Freezing Dewgong","Elder Tangela","Furious Sandslash","Roll Donphan","Bone Marowak","Octopus Octillery","Moon Clefable","Heavy Piloswine","Elder Blastoise","Elder Tentacruel","Elder Marowak","Master Stantler"}
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(outpokes, getCreatureName(item2.uid)) then
doPlayerSendCancel(cid, "Your ditto can't transform into this pokemon.")
markPos(mysum, unfix)
return true
end
if getPlayerLevel(cid) < pokes[getCreatureName(item2.uid)].level then
doPlayerSendCancel(cid, "You haven't level to transform into that pokemon.")
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
markPos(mysum, unfix)
doFaceCreature(mysum, getThingPos(item2.uid))
doDittoTransform(mysum, getCreatureName(item2.uid))
return true
end
----------------------------- 

 

Pronto, ditto ja está tranformando, agora falta o !revert, para isso vá em talkactions/scripts e crie um arquivo(.lua) com nome de dittorevert, e dentro coloque:

function onSay(cid, words, param, channel)
local thisball = getPlayerSlotItem(cid, 8)
if thisball and getItemAttribute(thisball.uid, "ehditto") then
doDittoRevert(cid)
end
return true
end 

 

Agora, no talkactions.xml adicione esta linha:

<talkaction words = "!revert;/revert" hide="yes" event = "script" value = "dittorevert.lua"/>

Se fizer tudo corretamente, funcionará normalmente.

 

Gif:

Hi9PcI.gif

 

Créditos: 

Gabrielbsales(sou op faço tudo solo)

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

Att. Featzen.

  • Respostas 14
  • Visualizações 4.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • data/actions/scripts, evolution.lua: Acima de: local minlevel = 0 Adicione: if getItemAttribute(pokeball.uid, "ehditto") then     return true end Ficando: if getItemAttribute(pokeball.uid, "ehdit

  • estou com a mesma duvida como eu tiro a parte que ele muda a portrait e muda o nome da pokeball? isto ai e que seu distro não tem a função 'doDittoTransform'

Postado
  • Autor

Não, mas isso é simples, no goback.lua do Actions, em baixo do adjustStatus... bota:

if getItemAttribute(item.uid, "ehditto") then
doCreatureSetNick(pk, "Ditto")
end

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

Att. Featzen.

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.6k

Informação Importante

Confirmação de Termo