------------------------------------------------ -- Use food/pots/items and check for its buff with table support -- JDuarteDJ & Giram ------------------------------------------------ -- I suggest we use the buff effect as name in every pot/food -- like 'speed' instead of 'unbrindledenthusiasm' -- also replaced potID with just ID, not all are pots :P function useGoodie(_itemName,_buffName) --ofc I came up with a silly name local itemTable ={ --potions --lvl 1+ giant = {ID = 207199, buffName = GetIdName(506683), castTime = 0}, -- Fullness speed = {ID = 207200, buffName = GetIdName(506684), castTime = 0}, -- Unbridled Enthusiasm frog = {ID = 207201, buffName = GetIdName(506685), castTime = 1000}, -- Princely Look --lvl 31+ casting = {ID = 207202, buffName = GetIdName(506686), castTime = 0}, -- Clear Thought --lvl 41+ luck = {ID = 207203, buffName = GetIdName(506687), castTime = 0}, --Turn of Luck Powder Dust --lvl 51+ riding = {ID = 207204, buffName = GetIdName(506688), castTime = 0}, --Galloping Gale --lvl 61+ jump = {ID = 207205, buffName = "", castTime = 1000}, --crazy breakout --lvl 71+ defense = {ID = 207206, buffName = GetIdName(506690), castTime = 2000}, --Scarlet Love --lvl 81+ aggro = {ID = 207207, buffName = GetIdName(506691), castTime = 0}, --Pungent Vileness --lvl 91+ godspeed = {ID = 207208, buffName = GetIdName(506692), castTime = 0}, --Godspeed. Instant cast. 1 min CD. --foods --lvl 1-20 pdmg = {ID = 207209, buffName = GetIdName(506673), castTime = 0}, --501131, 506673. Salted Fish with Sauce mdmg = {ID = 207210, buffName = GetIdName(506674), castTime = 0}, -- 501132, 506674. Smoked Bacon with Herbs --lvl 21-40 critp = {ID = 207211, buffName = GetIdName(506675), castTime = 0}, -- 501138, 506675. Caviar Sandwich matt = {ID = 207212, buffName = GetIdName(506676), castTime = 0}, -- 501143, 506676. Deluxe Seafood --lvl 41-80 matt2 = {ID = 207213, buffName = GetIdName(506677), castTime = 0}, -- Spicy Meatsauce Burrito mdmg2 = {ID = 207214, buffName = GetIdName(506678), castTime = 0}, -- Delicious Swamp Mix --lvl 81-100 patt3 = {ID = 207215, buffName = GetIdName(506679), castTime = 0}, -- 501150, 506679. Unimaginable Salad matt3 = {ID = 207216, buffName = GetIdName(506680), castTime = 0} -- 501145, 506680. Cheese Fishcake } local option = itemTable[_itemName] if not option then if not _buffName then option.buffName = _itemName --Assume both have same name like in mounts else option.buffName = _buffName end option.ID = _itemName --luckily the inventory functions use Name Or ID option.castTime = 0 end if inventory:itemTotalCount(option.ID) >= 1 and not player:hasBuff(option.buffName) then inventory:useItem(option.ID); cprintf(cli.yellow,"Yum! Had %s.\n",_itemName) if option.castTime > 0 then yrest(option.castTime); end inventory:update(); yrest(750); end end