Nottinghster
Tibia World RPG Developer
- Joined
- Oct 24, 2007
- Messages
- 1,575
- Solutions
- 6
- Reaction score
- 438
- Location
- Brazil - Rio de Janeiro
- GitHub
- Nottinghster
Well, since the original repository of TFS didn't have the special foods until today, I decided to convert them to TFS 1.x.
They are from OTServ_SVN 0.6.4 (opentibia/server (https://github.com/opentibia/server/tree/legacy/src/data/actions/scripts/foods))
I know it can be shortened to a single file, but I was too lazy for it
In folder actions > lib > actions.lua, paste this
In actions.xml, paste this:
Now in folder actions > scripts, create a folder called special_foods and then, create those files inside it:
blessed_steak.lua
carrot_cake.lua
filled_jalapeno_peppers.lua
hydra_tongue_salad.lua
fried_tropical_terrorbird.lua
northem_fishburguer.lua
roasted_dragon_wings.lua
rotworm_stew.lua
veggie_casserole.lua
Hope you all enjoy it![/B][/B]
They are from OTServ_SVN 0.6.4 (opentibia/server (https://github.com/opentibia/server/tree/legacy/src/data/actions/scripts/foods))
I know it can be shortened to a single file, but I was too lazy for it
In folder actions > lib > actions.lua, paste this
Lua:
SPECIAL_FOODS = {
[9992] = {"Gulp."}, [9993] = {"Chomp."}, [9994] = {"Chomp."}, [9995] = {"Chomp."}, [9997] = {"Yum."},
[9998] = {"Munch."}, [9999] = {"Chomp."}, [10000] = {"Mmmm."}, [10001] = {"Smack."}
}
In actions.xml, paste this:
XML:
<!-- Special Foods -->
<action itemid="9992" script="special_foods/rotworm_stew.lua"/>
<action itemid="9993" script="special_foods/hydra_tongue_salad.lua"/>
<action itemid="9994" script="special_foods/roasted_dragon_wings.lua"/>
<action itemid="9995" script="special_foods/fried_tropical_terrorbird.lua"/>
<action itemid="9997" script="special_foods/veggie_casserole.lua"/>
<action itemid="9998" script="special_foods/filled_jalapeno_peppers.lua"/>
<action itemid="9999" script="special_foods/blessed_steak.lua"/>
<action itemid="10000" script="special_foods/carrot_cake.lua"/>
<action itemid="10001" script="special_foods/northern_fishburger.lua"/>
Now in folder actions > scripts, create a folder called special_foods and then, create those files inside it:
blessed_steak.lua
Lua:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
local playerMaxMana = player:getMaxMana()
local playerMana = player:getMana()
if not (player:addCondition(exhaust)) then
return false
end
player:addManaSpent(playerMaxMana - playerMana)
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
carrot_cake.lua
Lua:
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 10)
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(condition) or player:addCondition(exhaust)) then
return false
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
filled_jalapeno_peppers.lua
Lua:
local condition = Condition(CONDITION_HASTE)
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
condition:setParameter(CONDITION_PARAM_SPEED, 40)
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(condition) or player:addCondition(exhaust)) then
return false
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
hydra_tongue_salad.lua
Lua:
local conditions = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED}
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(exhaust)) then
return false
end
for i, v in ipairs(conditions) do
if (player:hasCondition(v) ) then
player:removeCondition(v)
end
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
fried_tropical_terrorbird.lua
Lua:
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
condition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 5)
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(condition) or player:addCondition(exhaust)) then
return false
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
northem_fishburguer.lua
Lua:
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
condition:setParameter(CONDITION_PARAM_SKILL_FISHING, 50)
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(condition) or player:addCondition(exhaust)) then
return false
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
roasted_dragon_wings.lua
Lua:
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 10)
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(condition) or player:addCondition(exhaust)) then
return false
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
rotworm_stew.lua
Lua:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
local playerMaxHealth = player:getMaxHealth()
local playerHealth = player:getHealth()
if not (player:addCondition(exhaust)) then
return false
end
player:addHealth(playerMaxHealth - playerHealth)
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
veggie_casserole.lua
Lua:
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, 150)
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenActions'))
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if SPECIAL_FOODS[item.itemid] == nil then
return false
end
local sound = SPECIAL_FOODS[item.itemid][1]
if not (player:addCondition(condition) or player:addCondition(exhaust)) then
return false
end
item:remove(1)
player:say(sound, TALKTYPE_MONSTER_SAY)
return true
end
Hope you all enjoy it![/B][/B]
Attachments
-
special_foods.7z1.1 KB · Views: 12 · VirusTotal
Last edited: