• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Bless

xTremoxx

domasturb(cid, genital)
Joined
Aug 11, 2007
Messages
418
Reaction score
6
Location
Brazil
Hello friends, who i chage this script for actionid and add price for each type of bless? Tks.

Lua:
local items = {
    [11260] = {text = "Spiritual Shielding", id = 1},
    [11259] = {text = "Embrace of Tibia", id = 2},
    [11261] = {text = "Fire of the Suns", id = 3},
    [11262] = {text = "Wisdom of Solitude", id = 4},
    [11258] = {text = "Spark of the Phoenix", id = 5}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local blessItem = items[item.itemid]
    if blessItem then
        if getPlayerBlessing(cid, blessItem.id) then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have this bless!")
            return true
        end
        doPlayerAddBlessing(cid, blessItem.id)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have recieved the bless: ".. blessItem.text .. "!")
        doSendMagicEffect(getCreaturePosition(cid), 2)
    end
    return true
end
 
Solution
change item.itemid for item.actionid
Lua:
local items = {
    [actionid here] = {text = "Spiritual Shielding", id = 1, cost = 10000},
add cost to each table in the items table
under
Lua:
if getPlayerBlessing(cid, blessItem.id) then
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have this bless!")
end
add
Lua:
if not doPlayerRemoveMoney(cid, blessItem.cost) then
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enough money")
end
change item.itemid for item.actionid
Lua:
local items = {
    [actionid here] = {text = "Spiritual Shielding", id = 1, cost = 10000},
add cost to each table in the items table
under
Lua:
if getPlayerBlessing(cid, blessItem.id) then
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have this bless!")
end
add
Lua:
if not doPlayerRemoveMoney(cid, blessItem.cost) then
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enough money")
end
 
Solution
Back
Top