Shawak
Intermediate OT User
I decided to make it, because there was so much requestions.
You can easy add more potions .
Version:
- TFS 0.3.5pl1, tested.
Credits:
100% by me ^_^
Example:
16:18 You bought a backpack strong mana potion for 5000 gold coins.
Script:
- data/actions/actions.xml
- data/actions/scripts/potions.lua
I hope you like it :thumbup:.
Regards,
Shawak
You can easy add more potions .
Version:
- TFS 0.3.5pl1, tested.
Credits:
100% by me ^_^
Example:
16:18 You bought a backpack strong mana potion for 5000 gold coins.
Script:
- data/actions/actions.xml
Lua:
<action uniqueid="5001-5006" event="script" value="potions.lua"/>
Lua:
--[[
Potion Script v1.0
by Shawak
]]--
local config = {
[5001] = {potion = 7618, cost = 1000, backpack_id = 2000}, -- health potion
[5002] = {potion = 7588, cost = 2500, backpack_id = 2000}, -- strong health potion
[5003] = {potion = 7591, cost = 5000, backpack_id = 2000}, -- great health potion
[5004] = {potion = 7620, cost = 5000, backpack_id = 2001}, -- mana potion
[5005] = {potion = 7589, cost = 5000, backpack_id = 2001}, -- string mana potion
[5006] = {potion = 7590, cost = 5000, backpack_id = 2001}, -- great mana potion
} -- config end --
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = config[item.uid]
if isInArray({1945, 1946}, item.itemid) ~= TRUE then
return TRUE
end
if doPlayerBuyItemContainer(cid, potion.backpack_id, potion.potion, 1, potion.cost, 1) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought a backpack "..getItemNameById(potion.potion).." for "..potion.cost.." gold coins.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..potion.cost.." gold coins for a backpack "..getItemNameById(potion.potion)..".")
end
return TRUE
end
I hope you like it :thumbup:.
Regards,
Shawak