Cara não sei se e possivel mas queria um sistema de regen fora o base que o proprio game ja tem né no vactions quando ta de barriga cheia. queria que o food tivesse um regen dele mesmo tipo por exemplo a Pizza dar 10 de vida /s e o hotdog dar 7.5. a ideia é usar esses numeros do proprio feed de cada item como regen base
local pos = getThingPos(cid)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local food = FOODS[item.itemid]
if(not food) then
return false
end
local thing = getCreatureSummons(cid)[1] or cid
if isPlayer(thing) then
if((getPlayerFood(cid) + food[1]) >= 1000) then
doPlayerSendCancel(cid, "You are full.")
return true
end
Pergunta
IOWeenI 0
Cara não sei se e possivel mas queria um sistema de regen fora o base que o proprio game ja tem né no vactions quando ta de barriga cheia. queria que o food tivesse um regen dele mesmo tipo por exemplo a Pizza dar 10 de vida /s e o hotdog dar 7.5. a ideia é usar esses numeros do proprio feed de cada item como regen base
local FOODS =
{
[2362] = {80, "Crunch."},
[2666] = {150, "Munch."},
[2667] = {120, "Munch."},
[2668] = {100, "Mmmm."},
[2669] = {170, "Munch."},
[2670] = {40, "Gulp."},
[2671] = {300, "Chomp."},
[2672] = {600, "Chomp."},
[2673] = {50, "Yum."},
[2674] = {60, "Yum."},
[2675] = {130, "Yum."},
[2676] = {80, "Yum."},
[2677] = {10, "Yum."},
[2678] = {180, "Slurp."},
[2679] = {10, "Yum."},
[2680] = {20, "Yum."},
[2681] = {90, "Yum."},
[2682] = {200, "Yum."},
[2683] = {170, "Munch."},
[2684] = {80, "Crunch."},
[2685] = {60, "Munch."},
[2686] = {90, "Crunch."},
[2687] = {20, "Crunch."},
[2688] = {90, "Munch."},
[2689] = {100, "Crunch."},
[2690] = {30, "Crunch."},
[2691] = {80, "Crunch."},
[2792] = {60, "Munch."},
[2793] = {90, "Munch."},
[2695] = {60, "Gulp."},
[2696] = {90, "Smack."},
[2787] = {90, "Munch."},
[2788] = {40, "Munch."},
[2789] = {220, "Munch."},
[2790] = {300, "Munch."},
[2791] = {300, "Munch."},
[2792] = {60, "Munch."},
[2794] = {30, "Munch."},
[2795] = {360, "Munch."},
[2796] = {50, "Munch."},
[2793] = {90, "Munch."},
[5097] = {40, "Yum."},
[6125] = {80, "Gulp."},
[6278] = {100, "Mmmm."},
[6279] = {150, "Mmmm."},
[6393] = {120, "Mmmm."},
[6394] = {150, "Mmmm."},
[6501] = {200, "Mmmm."},
[6541] = {60, "Gulp."},
[6542] = {60, "Gulp."},
[6543] = {60, "Gulp."},
[6544] = {60, "Gulp."},
[6545] = {60, "Gulp."},
--[6569] = {100, "Mmmm."}, Retirado para script de rare candy
[6574] = {40, "Mmmm."},
[7158] = {150, "Munch."},
[7159] = {130, "Munch."},
[7372] = {70, "Yum."},
[7373] = {70, "Yum."},
[7374] = {70, "Yum."},
[7375] = {70, "Yum."},
[7376] = {70, "Yum."},
[7377] = {70, "Yum."},
[7909] = {40, "Crunch."},
[8838] = {70, "Gulp."},
[8839] = {50, "Yum."},
[8840] = {20, "Yum."},
[8841] = {30, "Urgh."},
[8842] = {30, "Munch."},
[8843] = {30, "Crunch."},
[8844] = {30, "Gulp."},
[8845] = {20, "Munch."},
[8847] = {110, "Yum."},
[12211] = {180, "Mmmm."},
[12213] = {130, "Munch."},
[12214] = {80, "Crunch."},
[12215] = {100, "Munch."},
[12216] = {60, "Gulp."},
[12217] = {50, "Yum."},
[12218] = {150, "Crunch."},
[12219] = {70, "Mmmm."},
[12220] = {70, "Mmmm."},
[12221] = {70, "Mmmm."},
[12222] = {240, "Crunch."},
}
local pos = getThingPos(cid)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local food = FOODS[item.itemid]
if(not food) then
return false
end
local thing = getCreatureSummons(cid)[1] or cid
if isPlayer(thing) then
if((getPlayerFood(cid) + food[1]) >= 1000) then
doPlayerSendCancel(cid, "You are full.")
return true
end
doPlayerFeed(cid, food[1] * 4)
doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
elseif isSummon(thing) then
local feed = food[1]
if getPlayerStorageValue(thing, 1009) - feed < 0 then
doSendMagicEffect(getThingPos(thing), 169)
doSendMagicEffect(pos, 169)
local newh = getPlayerStorageValue(thing, 1008) - math.ceil(feed / 😎
if newh <= 1 then newh = 1 end
setPlayerStorageValue(thing, 1008, newh)
return true
end
setPlayerStorageValue(thing, 1009, getPlayerStorageValue(thing, 1009) - feed)
setPlayerStorageValue(thing, 1008, getPlayerStorageValue(thing, 1008) + 1)
doCreatureSay(thing, food[2], TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
end
return true
end
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados