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

C++ Spells Exhaustion Issue (TFS 0.3.7 rev5)

sowber

New Member
Joined
Sep 30, 2016
Messages
35
Reaction score
0
Yo, as many of you already know, this revision has an annoying bug related to spells exhaustion. Since this rev is made for 8.6, and in this version you can spam healing + attack spells (e.g: exura gran + exori vis). I acctually can't, because the exhaustion is pretty much the same for every spell. It's like all's in the same "group". After a real LONG search, I didn't found any solution for this problem.

What I already tried according to the threads i visited:
  1. Using "groups" in spells.xml - Don't work in this release;
  2. Using another spells.cpp from rev3777 - Didn't manage to compile it, got code error;
  3. Changing spells folder - Didn't work cause the problem seems to be on the src(?);
Additional Information:

spells.xml
spells.xml - Pastebin.com

034-exhaustion.lua
Lua:
exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getPlayerStorageValue(cid, storage) >= os.time()
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time()
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time() + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}

Can someone help me please? It would help a lot of people, cause' this is not the first post about it here. I know it's kind of selfish just asking for help without contribuing with anything, but i'm don't have enough experience in C++ and lua to solve my problems on my own. I promise that i will try to learn and help other people in future. Thanks in advance.

bump

bump

bump
 
Last edited by a moderator:
Back
Top