Eai Gente, Estarei postando uma Action simplizinha, + um pouco diferente.
Vou falar sobre a função dela no final abaixo da imagem.
+ Basicamente eh fazer seu char e o Pokemon dormir ao dar use em uma Cama.
.
Actions/Script crie 1 arquivo LUA chamado Sleep e adicione isso dentro:
function onUse(cid, item, frompos, item2, topos) if #getCreatureSummons(cid) == 0 then doPlayerSendCancel(cid, "You need a pokemon to use this command.") return true end if exhaustion.check(cid, 25680) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You just sleep, wait ".. exhaustion.get(cid, 25680) .." seconds to sleep again.") return true end if getCreatureHealth(getCreatureSummons(cid)[1]) == getCreatureMaxHealth(getCreatureSummons(cid)[1]) and getCreatureHealth(cid) == getCreatureMaxHealth(cid) then doPlayerSay(cid, "Sleepless..", 2) doSendMagicEffect(getPlayerPosition(cid), 182) return true end local out = { [36] = {36}, -- Rattata [21] = {21}, -- Weedle [20] = {537}, -- Hitmonlee } local pokemon = out[getCreatureOutfit(getCreatureSummons(cid)[1]).lookType] for i = 1,25 do function sleep() if #getCreatureSummons(cid) == 1 then doSetCreatureOutfit(getCreatureSummons(cid)[1], {lookType = pokemon[1]}, -1) doCreatureSay(getCreatureSummons(cid)[1], ""..getCreatureName(getCreatureSummons(cid)[1]).." !", 2) return true end end function sleep2() if #getCreatureSummons(cid) == 1 and getCreatureHealth(getCreatureSummons(cid)[1]) < getCreatureMaxHealth(getCreatureSummons(cid)[1]) and getPlayerStorageValue(cid, 17181) >= 1 or getCreatureHealth(cid) < getCreatureMaxHealth(cid) and getPlayerStorageValue(cid, 17181) >= 1 and #getCreatureSummons(cid) == 1 then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/20) doCreatureAddHealth(getCreatureSummons(cid)[1],getCreatureMaxHealth(getCreatureSummons(cid)[1])/20) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 32) doSendMagicEffect(getPlayerPosition(cid), 32) doPlayerSay(cid, "ZzZ..", 2) doCreatureSay(getCreatureSummons(cid)[1], "ZzZ..", 2) else if #getCreatureSummons(cid) == 1 and getCreatureHealth(getCreatureSummons(cid)[1]) == getCreatureMaxHealth(getCreatureSummons(cid)[1]) and getCreatureHealth(cid) == getCreatureMaxHealth(cid) and getPlayerStorageValue(cid, 17181) >= 1 then doRemoveCondition(cid, CONDITION_OUTFIT) doRemoveCondition(getCreatureSummons(cid)[1], CONDITION_OUTFIT) doCreatureSetNoMove(cid, 0) doChangeSpeed(getCreatureSummons(cid)[1], getCreatureBaseSpeed(getCreatureSummons(cid)[1])) doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 183) doSendMagicEffect(getPlayerPosition(cid), 170) setPlayerStorageValue(cid, 17181, -1) end end end addEvent(sleep2,1500*i,cid) end local random = math.random(1,4) if random == 1 then doCreatureSay(cid, "Will Sleep "..getCreatureName(getCreatureSummons(cid)[1]).."!", TALKTYPE_SAY) elseif random == 2 then doCreatureSay(cid, "It's Time To Sleep "..getCreatureName(getCreatureSummons(cid)[1]).."!", TALKTYPE_SAY) elseif random == 3 then doCreatureSay(cid, "Will Rest "..getCreatureName(getCreatureSummons(cid)[1]).."!", TALKTYPE_SAY) elseif random == 4 then doCreatureSay(cid, "Time To Rest "..getCreatureName(getCreatureSummons(cid)[1]).."!", TALKTYPE_SAY) end if getPlayerSex(cid) == 1 then doSetItemOutfit(cid, 6080, -1) end if getPlayerSex(cid) == 0 then doSetItemOutfit(cid, 6081, -1) end doCreatureSetNoMove(cid, 1) doTeleportThing(cid, topos) setPlayerStorageValue(cid, 17181, 1) exhaustion.make(cid, 25680, 6000) doChangeSpeed(getCreatureSummons(cid)[1], -getCreatureSpeed(getCreatureSummons(cid)[1])) addEvent(sleep,000) return true end
Agora em Actions.Xml adicione
<action itemid="7114;7815-7816;7817-7818;7819-7820;1754-1755;1760-1761;7821-7821" event="script" value="sleep.lua" allowfaruse="1"/>
Agora uma coisinha para evitar que o player deslogue ou puxe o Pokemon enquanto dorme.
Adicione a linha abaixo nos arquivos Goback.lua em Actions e em CreatureScripts
if getPlayerStorageValue(cid, 17181) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while sleeping.") end
> Como Adicionar + Pokemons.<
Bem no começo tem essa tabelinha:
local out = { [36] = {36}, -- Rattata [21] = {21}, -- Weedle [20] = {537}, -- Hitmonlee }
Basta copiar uma das linha, coloca em baixo e modificar da seguinte forma.
(Ex:Hitmonlee) [20] = ( eh o Look type original do Pokemon. )
(Ex:Hitmonlee) = {537} ( Eh o Outfit que ira ficar apos durmir. )
Basta fazer isso e Pronto.
> Imagem <

> Algumas Coisas <
.
Trava a Posição do Player e do Pokemon quando der use na Cama.
Troca o Outfit dos 2.
Heala uma certa quantidade de HP do Player e do Pokemon.
Usa exhaustion.make ( Tempo pode ser configurado normalmente ) para oque o player não fique dormindo toda hora.
Não deixa vc se deitar se seu HP e do seu Pokemon estiver Full.
Ele acorda automaticamente quando o seu HP e do seu Pokemon estiver Full.
e uns magic effect brisado xD.