Sherlok
Active Member
Hello,
I've remade Potion Lever v1.0 script by Shawak to sell runes with charges.
Version:
- TFS 0.3.5pl1, tested.
Credits:
80% Shawak
20% Sherlok & Renusek
Example:
17:18 You bought a backpack sudden death rune for 6500 gold coins.
Script:
- data/actions/actions.xml
- data/actions/scripts/potions.lua
Post form by Shawak.
Yours,
Sherlok
I've remade Potion Lever v1.0 script by Shawak to sell runes with charges.
Version:
- TFS 0.3.5pl1, tested.
Credits:
80% Shawak
20% Sherlok & Renusek
Example:
17:18 You bought a backpack sudden death rune for 6500 gold coins.
Script:
- data/actions/actions.xml
Lua:
<action uniqueid="1248-1256" event="script" value="runes.lua"/>
- data/actions/scripts/potions.lua
Lua:
--[[
Runes Script v1.3
by Shawak, Sherlok & Renusek
]]--
local config = {
[1248] = {potion = 2268, cost = 6500, backpack_id = 2003, charges = 3}, -- sudden death rune
[1249] = {potion = 2269, cost = 6400, backpack_id = 2002, charges = 2}, -- wild growth rune
[1250] = {potion = 2274, cost = 3600, backpack_id = 2002, charges = 4}, -- avalanche rune
[1251] = {potion = 2305, cost = 7000, backpack_id = 2000, charges = 2}, -- fire bomb rune
[1252] = {potion = 2308, cost = 4200, backpack_id = 2000, charges = 3}, -- soulfire rune
[1253] = {potion = 2278, cost = 14000, backpack_id = 5949, charges = 1}, -- paralyze rune
[1254] = {potion = 2273, cost = 3500, backpack_id = 2002, charges = 1}, -- ultimate healing rune
[1255] = {potion = 2261, cost = 900, backpack_id = 2003, charges = 3}, -- destroy field rune
[1256] = {potion = 2293, cost = 7000, backpack_id = 2004, charges = 3}, -- magic wall rune
} -- 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, potion.charges) == 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
Post form by Shawak.
Yours,
Sherlok