unction doSleep(target, rounds, first)local cid = target if not isCreature(target) then return true end if getPlayerStorageValue(target, 9778981) >= 1 then return true end -- Insomnia storage if getPlayerStorageValue(target, 21099) >= 1 then return true end --edited reflect if getPlayerStorageValue(target, 98271) >= 1 and rounds ~= 0 then return true end --edited pra nao contar os efeitos if not isSleeping(target) then addEvent(doSendSleepEffect, 500, target) end if isSleeping(target) and first then setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) + rounds) return true end local outfits = {366, 912, 1317, 952, 909, 910} if isInArray(outfits, getCreatureOutfit(target).lookType) then setPlayerStorageValue(target, 98654, getCreatureOutfit(target).lookType) --edited pra da passivas ms quando esta durmindo!! end if isPlayer(target) then mayNotMove(target, true) else doChangeSpeed(target, -getCreatureSpeed(target)) endif not isPlayer(cid) then passivaOutfit = {652, 878, 496, 918, 849, 1193, 1194, 1192} Info = getMonsterInfo(getCreatureName(target)).lookCorpse --edited pra da passivas ms quando esta durmindo!! look = getCreatureOutfit(target) end if isMonster(target) then if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then local InfoDitto = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse if InfoDitto ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getPlayerStorageValue(target, 1010)).lookCorpse}, -1) end else --edited pra da passivas ms quando esta durmindo!! if Info ~= 0 and look.lookType ~= 0 and not isInArray(passivaOutfit, look.lookType) then doSetCreatureOutfit(target, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(target)).lookCorpse}, -1) end end end if rounds and rounds > 0 then setPlayerStorageValue(target, 98271, rounds) if isSummon(target) then doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", rounds) end end setPlayerStorageValue(target, 98271, getPlayerStorageValue(target, 98271) - 1) if getPlayerStorageValue(target, 98271) <= 0 then if isPlayer(target) then mayNotMove(target, false) else doRegainSpeed(target) end if not isPlayer(target) then if getCreatureName(target) == "Ditto" and isSummon(target) and getPlayerStorageValue(target, 1010) ~= "Ditto" then doSetCreatureOutfit(target, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(target), 8).uid, "transOutfit")}, -1) else doRemoveCondition(target, CONDITION_OUTFIT) end if getPlayerStorageValue(target, 98654) >= 1 then setPlayerStorageValue(target, 98654, -1) end end return true end if isSummon(target) then doItemSetAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep", getPlayerStorageValue(cid, 98271)) end addEvent(doSleep, 1100, target, 0, false) -- /// EARLY BIRD /// if getPlayerStorageValue(target, 9778982) >= 1 thenEarlyBirdTime = 2*1000 -- Tempo (em segundos) que o pokemon acordará antes, ex: Sleep dura 5 segundos, se tiver a passiva vai durar 3 segundos (5-2) -- mudar, colocar o tempo como porcentagem, ex, sleep dura 5 segundos, com a passiva vai dura tempo do sleep - 40% ? if isSummon(cid) then addEvent(doCureBallStatus, EarlyBirdTime, getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "sleep") --doCureBallStatus(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "all")endaddEvent(doCureStatus, EarlyBirdTime, cid, "sleep") --doCureStatus(cid, "all") end -- /// FIM EARLY BIRD /// return trueend