• 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!

blessings avesta 0.6.5

Sebastian Ching

New Member
Joined
Dec 26, 2007
Messages
314
Reaction score
4
Location
Rio grande, rs, Brazil
Greetings, im trying add blessings to my avesta, and dont look any working system,, please i need it cuz my players are losing around 7 levels in level 200 +.
Thanks and blessings
 
Talkaction:
Lua:
function onSay(cid, words, param)

    local price = 50000
    local n = isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE and 7 or 10
 
    if getPlayerLossPercent(cid, 0) >= n then
        if doPlayerRemoveMoney(cid, price) == TRUE then
            for i=0,2 do
                doPlayerSetLossPercent(cid, i, getPlayerLossPercent(cid, i) - 5)
            end
            doPlayerSendTextMessage(cid, 22, "You have been blessed.")
            doSendMagicEffect(getThingPos(cid), 12)
        else
            doPlayerSendTextMessage(cid, 22, "Sorry, you don't have enough gold.")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You have already been blessed.")
    end
    return FALSE
end

Code:
<talkaction words="!blessing" filter="first words" script="blessing.lua"/>

Creaturescripts:
Lua:
function onLogin(cid)
    if isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE and getPlayerLossPercent(cid, 0) > 7 then
        for i=0,2 do
           doPlayerSetLossPercent(cid, i, 7)
        end
    end
    registerCreatureEvent(cid, "blessings")
    return TRUE
end

function onDie(cid, corpse)

    local n = isInArray({5,6,7,8}, getPlayerVocation(cid)) == TRUE and 7 or 10
 
    if getPlayerLossPercent(cid, 0) < n then
        for i=0,2 do
            doPlayerSetLossPercent(cid, i, n)
        end
    end
    return TRUE
end

Code:
<event name="blessings" type="login" script="blessings.lua"/>
<event name="blessings" type="die" script="blessings.lua"/>
 
Last edited:
how did you add gamemaster and characters to the avesta database?
You have to create groups for both players and gamemaster, then alter flags of the gamemaster group. perhaps this would be fine: 272730398714
then you change group_id in the database on the player you want to become a gamemaster
 
Back
Top