• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    COLOCAR STORAGE AQUÍ

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1default COLOCAR STORAGE AQUÍ el Vie Abr 05, 2019 4:01 pm

    milos333

    milos333
    Nuevo Miembro
    Nuevo Miembro
    local FOODS =
    {
    [2362] = {8, "Crunch."},
    [2666] = {15, "Munch."},
    [2667] = {12, "Munch."},
    [2668] = {10, "Mmmm."},
    [2669] = {17, "Munch."},
    [2670] = {4, "Gulp."},
    [2671] = {30, "Chomp."},
    [2672] = {60, "Chomp."},
    [2673] = {5, "Yum."},
    [2674] = {6, "Yum."},
    [2675] = {13, "Yum."},
    [2676] = {8, "Yum."},
    [2677] = {1, "Yum."},
    [2678] = {18, "Slurp."},
    [2679] = {1, "Yum."},
    [2680] = {2, "Yum."},
    [2681] = {9, "Yum."},
    [2682] = {20, "Yum."},
    [2683] = {17, "Munch."},
    [2684] = {8, "Crunch."},
    [2685] = {6, "Munch."},
    [2686] = {9, "Crunch."},
    [2687] = {2, "Crunch."},
    [2688] = {9, "Munch."},
    [2689] = {10, "Crunch."},
    [2690] = {3, "Crunch."},
    [2691] = {8, "Crunch."},
    [2792] = {6, "Munch."},
    [2793] = {9, "Munch."},
    [2695] = {6, "Gulp."},
    [2696] = {9, "Smack."},
    [2787] = {9, "Munch."},
    [2788] = {4, "Munch."},
    [2789] = {22, "Munch."},
    [2790] = {30, "Munch."},
    [2791] = {30, "Munch."},
    [2792] = {6, "Munch."},
    [2794] = {3, "Munch."},
    [2795] = {36, "Munch."},
    [2796] = {5, "Munch."},
    [2793] = {9, "Munch."},
    [5097] = {4, "Yum."},
    [6125] = {8, "Gulp."},
    [6278] = {10, "Mmmm."},
    [6279] = {15, "Mmmm."},
    [6393] = {12, "Mmmm."},
    [6394] = {15, "Mmmm."},
    [6501] = {20, "Mmmm."},
    [6541] = {6, "Gulp."},
    [6542] = {6, "Gulp."},
    [6543] = {6, "Gulp."},
    [6544] = {6, "Gulp."},
    [6545] = {6, "Gulp."},
    [6569] = {1, "Mmmm."},
    [6574] = {4, "Mmmm."},
    [7158] = {15, "Munch."},
    [7159] = {13, "Munch."},
    [7372] = {7, "Yum."},
    [7373] = {7, "Yum."},
    [7374] = {7, "Yum."},
    [7375] = {7, "Yum."},
    [7376] = {7, "Yum."},
    [7377] = {7, "Yum."},
    [7909] = {4, "Crunch."},
    [8838] = {7, "Gulp."},
    [8839] = {5, "Yum."},
    [8840] = {2, "Yum."},
    [8841] = {3, "Urgh."},
    [8842] = {3, "Munch."},
    [8843] = {3, "Crunch."},
    [8844] = {3, "Gulp."},
    [8845] = {2, "Munch."},
    [8847] = {11, "Yum."}
    }

    function onUse(cid, item, fromPosition, itemEx, toPosition)
    local food = FOODS[item.itemid]
    if(not food) then
    return false
    end

    if((getPlayerFood(cid) + food[1]) >= 400) 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)
    return true
    end

    Ver perfil de usuario

    2default Re: COLOCAR STORAGE AQUÍ el Vie Abr 05, 2019 6:27 pm

    ralke

    ralke
    Nuevo Miembro
    Nuevo Miembro
    Script de food con storages

    Código:
    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."}, [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, "Gulp."},
     [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."}, [7245] = {84, "Munch."}, [7372] = {0, "Slurp."},
     [7373] = {0, "Slurp."}, [7374] = {0, "Slurp."},  [7375] = {0, "Slurp."}, [7376] = {0, "Slurp."},
     [7377] = {0, "Slurp."}, [7909] = {48, "Crunch."}, [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."}, [9005] = {88, "Slurp."},
     [9114] = {60, "Crunch."}, [10454] = {0, "Your head begins to feel better."},
     [11246] = {310, "Yum."}, [11429] = {150, "Mmmm."}, [12415] = {360, "Yum."}, [12416] = {130, "Munch."},
     [12417] = {60, "Crunch."}, [12418] = {80, "Crunch."}, [12637] = {660, "Gulp."}, [12638] = {260, "Yum."},
     [12639] = {18, "Munch."}
    }, 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 > 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

    Y añadir lo siguiente al actions.xml

    Código:

    <action itemid="2328;2362;2666-2691;2695-2696;2787-2796;5097;5678;6125;6278-6279;6393-6394;6501;6541-6545;6569;6574;7158-7159;7245;7372-7377;7909;7963;8112;8838-8845;8847;9005;9114;10454;11246;11429;12415-12418;12637-12639" event="script" value="foods/food.lua"/>


    Para otros tipos de food tambien estan los siguientes scripts
    Primero ir a actions.xml y colocar


    Código:
    <action itemid="9992" event="script" value="foods/rotworm_stew.lua"/>
     <action itemid="9993" event="script" value="foods/hydra_tongue_salad.lua"/>
     <action itemid="9994" event="script" value="foods/roasted_dragon_wings.lua"/>
     <action itemid="9995" event="script" value="foods/fried_tropical_terrorbird.lua"/>
     <action itemid="9996" event="script" value="foods/banana_chocolate_shake.lua"/>
     <action itemid="9997" event="script" value="foods/veggie_casserole.lua"/>
     <action itemid="9998" event="script" value="foods/filled_jalapeno_peppers.lua"/>
     <action itemid="9999" event="script" value="foods/blessed_steak.lua"/>
     <action itemid="10000" event="script" value="foods/carrot_cake.lua"/>
     <action itemid="10001" event="script" value="foods/northern_fishburger.lua"/>
     <action itemid="12540" event="script" value="foods/coconut_shrimp_bake.lua"/>
     <action itemid="12542" event="script" value="foods/pot_of_blackjack.lua"/>
     <action itemid="12543" event="script" value="foods/demonic_candy_ball.lua"/>
     <action itemid="12544" event="script" value="foods/sweet_mangonaise_elixir.lua"/>

    sweet_magonaise_elixir.lua

    Código:
    local config = {
     amount = 10
    }
    function onUse(cid, item, fromPosition, itemEx, toPosition)
     local food = SPECIAL_FOODS[item.itemid]
     local ring = getPlayerSlotItem(cid, CONST_SLOT_RING)
     if(food == nil) then
     return false
     end

     if(ring.itemid == 0) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You may want to equip a ring before eating this.")
     doSendMagicEffect(fromPosition, CONST_ME_POFF)
     return true
     end

     if(getItemInfo(ring.itemid).showDuration) then
     local capRequired, pFreeCap = (getItemInfo(ring.itemid).weight * config.amount), getPlayerFreeCap(cid)

     if(pFreeCap < capRequired) then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You may want to free some capacity before doing this.")
     doSendMagicEffect(fromPosition, CONST_ME_POFF)
     return true
     end

     for i=1,config.amount do
     doPlayerAddItemEx(cid, doCopyItem(ring).uid, true)
     end
     else
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You may want to equip the correct type of ring before eating this.")
     doSendMagicEffect(fromPosition, CONST_ME_POFF)
     return true
     end

     doRemoveItem(item.uid, 1)
     doCreatureSay(cid, food, TALKTYPE_MONSTER)
     return true
    end

    rotworm_stew.lua

    Código:
    function onUse(cid, item, fromPosition, itemEx, toPosition)
     local food = SPECIAL_FOODS[item.itemid]
     if(food == nil) then
     return false
     end

     doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
     doRemoveItem(item.uid, 1)

     doCreatureSay(cid, food, TALKTYPE_MONSTER)
     return true
    end

    roasted_dragon_wings.lua

    Código:
    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 60 * 60 * 1000)
    setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, 10)

    function onUse(cid, item, fromPosition, itemEx, toPosition)
     local food = SPECIAL_FOODS[item.itemid]
     if(food == nil) then
     return false
     end

     if(not doAddCondition(cid, condition)) then
     return true
     end

     doRemoveItem(item.uid, 1)
     doCreatureSay(cid, food, TALKTYPE_MONSTER)
     return true
    end

    pot_of_backjack.lua

    Código:
    local config = {
     MSG_EAT = "You take a gulp from the large bowl, but there's still some blackjack in it.",
     MSG_GONE = "You take the last gulp from the large bowl. No leftovers!"
    }

    function onUse(cid, item, fromPosition, itemEx, toPosition)
     local food = SPECIAL_FOODS[item.itemid]
     if(food == nil) then
     return false
     end

     local addHealth = getCreatureMaxHealth(cid) - getCreatureHealth(cid)

     if(item.actionid < 3500) then
     doSetItemActionId(item.uid, 3500)
     if(addHealth > 0) then
     doCreatureAddHealth(cid, addHealth)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, config.MSG_EAT)

     elseif(item.actionid >= 3500 and item.actionid <= 3501) then
     doSetItemActionId(item.uid, item.actionid + 1)
     if(addHealth > 0) then
     doCreatureAddHealth(cid, addHealth)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, config.MSG_EAT)

     elseif(item.actionid == 3502) then
     doSetItemActionId(item.uid, item.actionid + 1)
     if(addHealth > 0) then
     doCreatureAddHealth(cid, addHealth)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, config.MSG_GONE)
     doRemoveItem(item.uid, 1)
     end

     doCreatureSay(cid, food, TALKTYPE_MONSTER)
     return true
    end

    northern_fishburger.lua

    Código:
    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 60 * 60 * 1000)
    setConditionParam(condition, CONDITION_PARAM_SKILL_FISHING, 50)

    function onUse(cid, item, fromPosition, itemEx, toPosition)
     local food = SPECIAL_FOODS[item.itemid]
     if(food == nil) then
     return false
     end

     if(not doAddCondition(cid, condition)) then
     return true
     end

     doRemoveItem(item.uid, 1)
     doCreatureSay(cid, food, TALKTYPE_MONSTER)
     return true
    end

    hydra_tongue_salad.lua
    Código:
    local conditions = {
     CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY,
     CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN,
     CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED
    }

    function onUse(cid, item, fromPosition, itemEx, toPosition)
     local food = SPECIAL_FOODS[item.itemid]
     if(food == nil) then
     return false
     end

     for _, condition in ipairs(conditions) do
     if(getCreatureCondition(cid, condition)) then
     doRemoveCondition(cid, condition)
     end
     end

     doRemoveItem(item.uid, 1)
     doCreatureSay(cid, food, TALKTYPE_MONSTER)
     return true
    end

    Espero que te sirva
    Smile

    Ver perfil de usuario http://greedisland.ml/index.php

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

    Temas Recomendados×+

       

      BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).