D
Deleted member 49793
Guest
Looking for a script for 1.1 TFS that boosts a players exp for X minutes, (example 2 hours)
Anyone have one made or can put one together?
Anyone have one made or can put one together?
not sure whats the protocol bump old thread like that but..
is there a way to make it show in skill window 200% exp rate?
Skill window in classic tibia client is hardcoded, so you would have to use OTC for that.
condition:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
msg.add<uint16_t>(100); // base xp gain rate
msg.add<uint16_t>(0); // xp voucher
msg.add<uint16_t>(0); // low level bonus
msg.add<uint16_t>(0); // xp boost
msg.add<uint16_t>(100); // stamina multiplier (100 = x1.0)
player->sendStats()
to update the client immediately.How to make talkaction to check how much time is left? tfs 1.2
function onSay(player, words, param)
local function showTimeLeft(number, usewords)
local number = tonumber(number)
if not number then
return "error"
end
if number < 0 then
return "expired"
end
local clocknum = os.date("!%X",number):split(":") -- h:m:s
local day = math.modf(number / 86400)
local hour = clocknum[1]
local minute = clocknum[2]
local second = clocknum[3]
if not usewords then
return table.concat({day, hour, minute, second}, ":")
end
local text = {}
if day > 0 then
table.insert(text, tonumber(day) .. " day" .. (day > 1 and "s" or ""))
end
if hour ~= "00" then
table.insert(text, tonumber(hour) .. " hour" .. (tonumber(hour) > 1 and "s" or ""))
end
if minute ~= "00" then
table.insert(text, tonumber(minute) .. " minute" .. (tonumber(minute) > 1 and "s" or ""))
end
if second ~= "00" then
table.insert(text, tonumber(second) .. " second" .. (tonumber(second) > 1 and "s" or ""))
end
countdown_text = ""
if #text > 0 then
countdown_text = text[1]
for i = 2, #text - 1 do
countdown_text = countdown_text .. ", " .. text[i]
end
if #text > 1 then
countdown_text = countdown_text .. " and " .. text[#text]
end
countdown_text = countdown_text
else
countdown_text = "expired"
end
return countdown_text
end
local storage = 1234
if player:getStorageValue(storage) >= os.time() then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have "..showTimeLeft(player:getStorageValue(storage) - os.time(), true)
return true
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "No Scroll active")
end
Great ! How to add to your script exhaust ?Something like this should work
Remember to change your storage number!
Lua:function onSay(player, words, param) local function showTimeLeft(number, usewords) local number = tonumber(number) if not number then return "error" end if number < 0 then return "expired" end local clocknum = os.date("!%X",number):split(":") -- h:m:s local day = math.modf(number / 86400) local hour = clocknum[1] local minute = clocknum[2] local second = clocknum[3] if not usewords then return table.concat({day, hour, minute, second}, ":") end local text = {} if day > 0 then table.insert(text, tonumber(day) .. " day" .. (day > 1 and "s" or "")) end if hour ~= "00" then table.insert(text, tonumber(hour) .. " hour" .. (tonumber(hour) > 1 and "s" or "")) end if minute ~= "00" then table.insert(text, tonumber(minute) .. " minute" .. (tonumber(minute) > 1 and "s" or "")) end if second ~= "00" then table.insert(text, tonumber(second) .. " second" .. (tonumber(second) > 1 and "s" or "")) end countdown_text = "" if #text > 0 then countdown_text = text[1] for i = 2, #text - 1 do countdown_text = countdown_text .. ", " .. text[i] end if #text > 1 then countdown_text = countdown_text .. " and " .. text[#text] end countdown_text = countdown_text else countdown_text = "expired" end return countdown_text end local storage = 1234 if player:getStorageValue(storage) >= os.time() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have "..showTimeLeft(player:getStorageValue(storage) - os.time(), true) return true end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "No Scroll active") end
Can you be a bit more specific? what do you mean?Great ! How to add to your script exhaust ?
Can you be a bit more specific? what do you mean?
local cfg = {
exhausted = 10, -- Time you are exhausted.
storage = 78949 -- Storage used for "exhaust."
}
function onSay(player, words, param)
if (player:getStorageValue(cfg.storage) > os.time())then
player:sendCancelMessage("You must wait another " .. player:getStorageValue(cfg.storage) - os.time() .. ' second' .. ((player:getStorageValue(cfg.storage) - os.time()) == 1 and "" or "s") .. ".")
return false
end
local function showTimeLeft(number, usewords)
local number = tonumber(number)
if not number then
return "error"
end
if number < 0 then
return "expired"
end
local clocknum = os.date("!%X",number):split(":") -- h:m:s
local day = math.modf(number / 3600)
local hour = clocknum[1]
local minute = clocknum[2]
local second = clocknum[3]
if not usewords then
return table.concat({day, hour, minute, second}, ":")
end
local text = {}
if day > 0 then
table.insert(text, tonumber(day) .. " day" .. (day > 1 and "s" or ""))
end
if hour ~= "00" then
table.insert(text, tonumber(hour) .. " hour" .. (tonumber(hour) > 1 and "s" or ""))
end
if minute ~= "00" then
table.insert(text, tonumber(minute) .. " minute" .. (tonumber(minute) > 1 and "s" or ""))
end
if second ~= "00" then
table.insert(text, tonumber(second) .. " second" .. (tonumber(second) > 1 and "s" or ""))
end
countdown_text = ""
if #text > 0 then
countdown_text = text[1]
for i = 2, #text - 1 do
countdown_text = countdown_text .. ", " .. text[i]
end
if #text > 1 then
countdown_text = countdown_text .. " and " .. text[#text]
end
countdown_text = countdown_text
else
countdown_text = "expired"
end
return countdown_text
end
local storage = 98546
player:setStorageValue(cfg.storage, os.time() + cfg.exhausted)
if player:getStorageValue(storage) >= os.time() then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your bonus will disappear in: "..showTimeLeft(player:getStorageValue(storage) - os.time(), true))
return false
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "No Exp Potion active")
end
As far as I can see there isn't any need to 'convert' it, since all of the functions used are already in TFS 1.3can this be converted in 1.3
I've this but it doesnt work ...As far as I can see there isn't any need to 'convert' it, since all of the functions used are already in TFS 1.3
Should work as-is.
local xpboost = Action()
local cfg = {
exhausted = 10, -- Time you are exhausted.
storage = 78949 -- Storage used for "exhaust."
}
function xpboost.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if (player:getStorageValue(cfg.storage) > os.time())then
player:sendCancelMessage("You must wait another " .. player:getStorageValue(cfg.storage) - os.time() .. ' second' .. ((player:getStorageValue(cfg.storage) - os.time()) == 1 and "" or "s") .. ".")
return false
end
local function showTimeLeft(number, usewords)
local number = tonumber(number)
if not number then
return "error"
end
if number < 0 then
return "expired"
end
local clocknum = os.date("!%X",number):split(":") -- h:m:s
local day = math.modf(number / 3600)
local hour = clocknum[1]
local minute = clocknum[2]
local second = clocknum[3]
if not usewords then
return table.concat({day, hour, minute, second}, ":")
end
local text = {}
if day > 0 then
table.insert(text, tonumber(day) .. " day" .. (day > 1 and "s" or ""))
end
if hour ~= "00" then
table.insert(text, tonumber(hour) .. " hour" .. (tonumber(hour) > 1 and "s" or ""))
end
if minute ~= "00" then
table.insert(text, tonumber(minute) .. " minute" .. (tonumber(minute) > 1 and "s" or ""))
end
if second ~= "00" then
table.insert(text, tonumber(second) .. " second" .. (tonumber(second) > 1 and "s" or ""))
end
countdown_text = ""
if #text > 0 then
countdown_text = text[1]
for i = 2, #text - 1 do
countdown_text = countdown_text .. ", " .. text[i]
end
if #text > 1 then
countdown_text = countdown_text .. " and " .. text[#text]
end
countdown_text = countdown_text
else
countdown_text = "expired"
end
return countdown_text
end
local storage = 65004
player:setStorageValue(cfg.storage, os.time() + cfg.exhausted)
if player:getStorageValue(storage) >= os.time() then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your bonus will disappear in: "..showTimeLeft(player:getStorageValue(storage) - os.time(), true))
return false
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "No Exp Potion active")
end
xpboost:id(40407)
xpboost:register()
local xpBoost = Action()
function xpBoost.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local xpboost = 86400
local xpvalue = 50
db.query("UPDATE `players` SET `xpboost_stamina` = `xpboost_stamina` + '" .. xpboost .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
db.query("UPDATE `players` SET `xpboost_value` = `xpboost_value` + '" .. xpvalue .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received 1 Day of 50% Xp Boost")
item:remove(1)
return true
end
xpBoost:id(40407)
xpBoost:register()
You probably overwrote the default onGainExperience:before I added these scripts, I was getting the stages exp, since adding them, I get normal tibia exp any knows why?