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

Lua Blessing problem.

Bonnen888

Member
Joined
Oct 19, 2008
Messages
99
Reaction score
7
Location
Sweden
I got this problem that i cant find any blessing that work for The Forgotten Server v0.2.11pl2 (Mystic Spirit). Because i have tried alot of diffrent blessings. And noone have worked so far. Even if it says "You already have all the blessings!". But still it doesnt protect against any exp/loot drop. Dunno what the problem is because my blessings have allways worked b4. And now it doesnt.

So is there any blessings that works for this kind of server?? Please any feedback about to fix or to do.
 
Just one example i have tried

Code:
function onSay(cid, words, param) 
local fail = 0 

    if getPlayerLevel(cid) < 31 then 
        cost = 2000 
    else 
        cost = ((getPlayerLevel(cid) - 30) * 200) + 2000 
    end 
     
    if cost > 6000 then 
        cost = 6000 
    end 

    for i = 1, 5 do 
        if getPlayerBlessing(cid, i) then 
            fail = fail + 1 
        else 
            if doPlayerRemoveMoney(cid, cost) == TRUE then 
                doPlayerAddBlessing(cid, i) 
                if i == 5 and not(fail == 5) then 
                    doSendMagicEffect(getPlayerPosition(cid),14) 
                                  doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"You have purchased full bless.") 
                end 
            else 
                doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!") 
                break 
            end 
        end 
    end 
    if fail == 5 then 
        doPlayerSendCancel(cid, "You already have all the blessings!") 
    end 
return TRUE 
end
 
Try this.

-- [( Script edited by: www.ChaitoSoft.com )] --
function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
end
end
return TRUE
end
 
PHP:
UPDATE `players` SET `loss_experience` = 100;
UPDATE `players` SET `loss_mana` = 100;
UPDATE `players` SET `loss_skills` = 100;
UPDATE `players` SET `loss_containers` = 100;
UPDATE `players` SET `loss_items` = 100;

execute this in your DB.
 
Code:
Error

SQL query:

 UPDATE`players`SET`loss_containers`=100;


 
MySQL said: 
#1054 - Unknown column 'loss_containers' in 'field list'

???
I used the Schema from forgottenserver.sql
 
/mods/bless-system.xml
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="bless-system" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
        <description><![CDATA[
                This modification adds two new commands: !bless and !blesscheck.
                Also, action script is included (it uses unique id 32001 - can be used with items).
        ]]></description>

        <config name="bless-system-config"><![CDATA[
                blessSystem = {}
                blessSystem.config = {
                        baseCost = 2000,
                        levelCost = 200,
                        startLevel = 30,
                        endLevel = 120
                }

                blessSystem.needPremium = getBooleanFromString(getConfigValue('blessingsOnlyPremium'))
        ]]></config>

        <lib name="bless-system-lib"><![CDATA[
                domodlib('bless-system-config')

                function blessSystem.buyAllBlessings(cid)
                        local price = blessSystem.config.baseCost
                        if(getPlayerLevel(cid) > blessSystem.config.startLevel) then
                                price = (price + ((math.min(blessSystem.config.endLevel, getPlayerLevel(cid)) - blessSystem.config.startLevel) * blessSystem.config.levelCost))
                        end

                        price = price * 5 * 1.2
                        if(blessSystem.needPremium and not isPremium(cid)) then
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need a premium account to use blessings.")
                                return false
                        end

                        for i = 1, 5 do
                                if(getPlayerBlessing(cid, i)) then
                                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have all blessings.")
                                        return false
                                end
                        end

                        if(not doPlayerRemoveMoney(cid, price)) then
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enough money for blessings. (You need " .. price .. " gp's)")
                                return false
                        end

                        for i = 1, 5 do
                                doPlayerAddBlessing(cid, i)
                        end

                        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been blessed by the gods!")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_BIGCLOUDS)
                        return true
                end
        ]]></lib>

        <talkaction words="!blesscheck;!blesstest" event="script"><![CDATA[
                domodlib('bless-system-config')

                local blessNames = {"first", "second", "third", "fourth", "fifth"}
                function onSay(cid, words, param)
                        local str = ""
                        local b = 0
                        for i = 1, 5 do
                                if(getPlayerBlessing(cid, i)) then
                                        if(b ~= 0) then
                                                str = str .. ", "
                                        end
                                        str = str .. blessNames[i]
                                        b = b + 1
                                end
                        end

                        if(b > 0) then
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have " .. str .. " blessing" .. (b > 0 and "s" or "") .. ". (Total: " .. b .. ")")
                        else
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have any blessings.")
                        end
                        return TRUE
                end
        ]]></talkaction>

        <talkaction words="!bless" event="script"><![CDATA[
                domodlib('bless-system-config')
                domodlib('bless-system-lib')

                function onSay(cid, words, param, channel)
                        blessSystem.buyAllBlessings(cid)
                        return true
                end
        ]]></talkaction>

        <action uniqueid="32001" event="script"><![CDATA[
                domodlib('bless-system-config')
                domodlib('bless-system-lib')

                function onUse(cid, item, fromPosition, itemEx, toPosition)
                        blessSystem.buyAllBlessings(cid)
                        return true
                end
        ]]></action>

</mod>
 
Go at PHPMYADMIN > YOURSERVERDB > PLAYERS > EDITAPLAYER > so:
search for "blessings" and put the value: 31.

Then go in the edited character and DIE.

REPORT THE RESULTS HERE.
 
Back
Top