Ir para conteúdo

Quanto mais alto o level mais food o player poderá comer


warcraftzz

Posts Recomendados

Fui tentando e acabou que conseguir fazer isso.. é simples..



Vá até data\actions\scripts\foods\food.lua apague tudo e coloque isso:



local FOODS, MAX_FOOD = {
[2328] = {84, "Gulp."}, [2362] = {48, "Yum."}, [2666] = {180, "Munch."}, [2667] = {144, "Munch."},
[2668] = {120, "Mmmm."}, [2669] = {204, "Munch."}, [2670] = {48, "Gulp."}, [2671] = {360, "Chomp."},
[2672] = {720, "Chomp."}, [2673] = {60, "Yum."}, [2674] = {72, "Yum."}, [2675] = {156, "Yum."},
[2676] = {96, "Yum."}, [2677] = {12, "Yum."}, [2678] = {216, "Slurp."}, [2679] = {12, "Yum."},
[2680] = {24, "Yum."}, [2681] = {108, "Yum."}, [2682] = {240, "Yum."}, [2683] = {204, "Munch."},
[2684] = {60, "Crunch."}, [2685] = {72, "Munch."}, [2686] = {108, "Crunch."}, [2687] = {24, "Crunch."},
[2688] = {24, "Mmmm."}, [2689] = {120, "Crunch."}, [2690] = {72, "Crunch."}, [2691] = {96, "Crunch."},
[2695] = {72, "Gulp."}, [2696] = {108, "Smack."}, [8112] = {108, "Urgh."}, [2769] = {60, "Crunch."}, [2787] = {108, "Crunch."},
[2788] = {48, "Munch."}, [2789] = {264, "Munch."}, [2790] = {360, "Crunch."}, [2791] = {108, "Crunch."},
[2792] = {72, "Crunch."}, [2793] = {144, "Crunch."}, [2794] = {36, "Crunch."}, [2795] = {432, "Crunch."},
[2796] = {300, "Crunch."}, [5097] = {48, "Yum."}, [5678] = {96, "Gulp."}, [6125] = {96, "Mmmm."},
[6278] = {120, "Mmmm."}, [6279] = {180, "Mmmm."}, [6393] = {144, "Mmmm."}, [6394] = {180, "Mmmm."},
[6501] = {240, "Mmmm."}, [6541] = {72, "Gulp."}, [6542] = {72, "Gulp."}, [6543] = {72, "Gulp."},
[6544] = {72, "Gulp."}, [6545] = {72, "Gulp."}, [6569] = {12, "Mmmm."}, [6574] = {60, "Mmmm."},
[7158] = {300, "Munch."}, [7159] = {180, "Munch."}, [7372] = {0, "Yummy."}, [7373] = {0, "Yummy."},
[7374] = {0, "Yummy."}, [7375] = {0, "Yummy."}, [7376] = {0, "Yummy."}, [7377] = {0, "Yummy."},
[7963] = {720, "Munch."}, [8838] = {120, "Gulp."}, [8839] = {60, "Yum."}, [8840] = {12, "Yum."},
[8841] = {12, "Urgh."}, [8842] = {84, "Munch."}, [8843] = {60, "Crunch."}, [8844] = {12, "Gulp."},
[8845] = {60, "Munch."}, [8847] = {132, "Yum."}, [9114] = {60, "Crunch."}, [9005] = {88, "Slurp."},
[7245] = {84, "Munch."}, [9996] = {0, "Slurp."},
[10454] = {0, "Your head begins to feel better."}
}, 1200

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 6280) then
if(fromPosition.x == CONTAINER_POSITION) then
fromPosition = getThingPosition(cid)
end

doCreatureSay(cid, getPlayerName(cid) .. " blew out the candle.", TALKTYPE_MONSTER)
doTransformItem(item.uid, item.itemid - 1)

doSendMagicEffect(fromPosition, CONST_ME_POFF)
return true
end

local food = FOODS[item.itemid]
if(food == nil) then
return false
end

local size = food[1]
if(getPlayerFood(cid) + size > (getPlayerLevel(cid)*5+MAX_FOOD)) then
doPlayerSendCancel(cid, "You are full.")
return true
end

doPlayerFeed(cid, size)
doRemoveItem(item.uid, 1)

doCreatureSay(cid, food[2], TALKTYPE_MONSTER)
return true
end

O script funciona assim existe um limite de 1200 em que cada comida que você come te da uma quantidade..


o maximo que vc consegue comer é 1200...


Então o script pega seu level..


Nessa parte:



(getPlayerLevel(cid)*5+MAX_FOOD)) then



multiplica por 5 e soma aos 1200 ( QUE NO CASO É O MAX_FOOD ).


Se vc é level 2 vc vai poder comer 1210 de food


Se vc é level 100 vc vai poder comer 1700.



Qualquer dúvida me pergunta.. não sou bom pra explicar as coisas..

Editado por warcraftzz
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...