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

TFS 1.X+ I have weird Health/Mana bug with transforms

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
989
Solutions
5
Reaction score
54
Hi
so i dont exactly know how this bug works, but i noticed couple thinks so lets say my vocation has four transformations every transformation increase health and mana bar so the problem is when i die my health somehow increase randomly and mana drops to zero, and second think i'm not sure about this one. Its really hard to explain so i'll try my best lets say you have 200Hp with default and then you take some items that adds +100hp so now we have 300hp and then i type transform and transform add +200 so now i have 500hp, right? So now when i'm transformed lets say i want to take my item off so now it should be -100 and i should have 400 but the problem that i have 500 so its like if i add items that gives me hp i can bug my health. So i suppose i should show my transform system
Code:
function onSay(player, words, param)
    local kurwa_gdzie_jest_efekt = Position(player:getPosition().x + 1, player:getPosition().y, player:getPosition().z)
    local pid = player:getId()

    local TRANS = transform[player:getVocation():getId()]
   
    if not TRANS then
        player:sendCancelMessage("TRANSFORM ERROR 11. Vocation = " .. player:getVocation():getId() .. "") -- VOCATION NOT IN GLOBAL TABLE
        return false
    end
   
    if TRANS.newVoc == 0 then
        player:sendCancelMessage("You cannot transform.")
        return false
    end
   
    if player:getLevel() < TRANS.level then
        player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.")
        return false
    end
    if player:getSoul() < TRANS.rage then
        player:sendCancelMessage("You need "..TRANS.rage.." to transform.")
        return false
    end

    local outfit = player:getOutfit()
    outfit.lookType = TRANS.looktype

    if TRANS.constant then
        player:setOutfit(outfit)
    else
        player:setOutfit(outfit, true)
    end

    player:addSoul(-TRANS.rage)
    player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
    player:setMaxMana(player:getMaxMana() + TRANS.addMana)
    kurwa_gdzie_jest_efekt:sendMagicEffect(TRANS.effect)
    player:setVocation(TRANS.newVoc)
    player:save()
    return false
end
This is revert
Code:
local function removeExhaust(pid)
    exhaust_transform[pid] = nil
end

function onSay(player, words, param, channel)
    local pid = player:getId()
   
    if exhaust_transform[pid] ~= nil then
        return false
    end
   
    local TRANS = transform[player:getVocation():getId()]
   
    if not TRANS then
        player:sendCancelMessage("TRANSFORM ERROR 11. Vocation = " .. player:getVocation():getId() .. "") -- VOCATION NOT IN GLOBAL TABLE
        return false
    end
   
    if TRANS.fromVoc == 0 then
        player:sendCancelMessage("You cannot revert.")
        return false
    end

    for i = 1, TRANS.transform do
        player:setVocation(TRANS.fromVoc)
        TRANS = transform[player:getVocation():getId()]
        local outfit = player:getOutfit()
        outfit.lookType = TRANS.from_looktype
        if TRANS.constant then
            player:setOutfit(outfit)
        else
            player:setOutfit(outfit, false)
        end
        player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth)
        player:setMaxMana(player:getMaxMana() - TRANS.addMana)
    end
    player:save()
   
    exhaust_transform[pid] = 1   
    addEvent(removeExhaust, 5 * 1000, pid)
    return false
end

bump

bump

bump

upupupup

bump

bump

bump
 
Last edited by a moderator:
Solution
Code:
1>..\src\luascript.cpp(2053): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2053): error C2065: 'luaPlayerGetBaseMaxHealth': undeclared identifier
1>..\src\luascript.cpp(2054): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2054): error C2065: 'luaPlayerGetBaseMaxMana': undeclared identifier
1>..\src\luascript.cpp(7461): error C2039: 'luaPlayerGetBaseMaxHealth': is not a...
I know in these days logic thinking is not so popular but how you dont get it already? the level required for transform getting from the transform(tovoc) vocation id, same with stats/effect/looktype
Code:
Transformations = {

[1] = { toVoc = 5, effect = CONST_ME_HITAREA, lookType = 5 },
[5] = { fromVoc = 1, toVoc = 26, effect = CONST_ME_FIREATTACK, lookType = 6, addHp = 100, addMana = 100, level = 50 },
[26] = { fromVoc = 5, toVoc = 27, effect = CONST_ME_GIANTICE, lookType = 7, addHp = 1000, addMana = 1000, level = 100 }

}
Is it really so stupid then? "getting from the transform(tovoc) vocation id, same with stats/effect/looktype"? Or your english is just bad and i just understood your comment in the different way so you mean
Code:
Transformations = {

[1] = { toVoc = 5, effect = CONST_ME_HITAREA, lookType = 5 }, this line is getting level
[5] = { fromVoc = 1, toVoc = 26, effect = CONST_ME_FIREATTACK, lookType = 6, addHp = 100, addMana = 100, level = 50 }, from this line?
[26] = { fromVoc = 5, toVoc = 27, effect = CONST_ME_GIANTICE, lookType = 7, addHp = 1000, addMana = 1000, level = 100 }

}
 
grammar has nothing to do with understanding, beside that the whole subject is based on the lack of basic mathematical concepts, why you should check the level of the character you currently are, when you have the last transform, you check lvl of vocation that dont exist? When you buy food in a market, do you pay after eating? every thinking human beeing after seeing that 100 lvl is required and looking at config would deduce what the "problem" is
 
Last edited:
Well i dont know where you live but in my country and other countrys you can take the stuff and eat in line because it doesnt matter you still have to pay so you can pay before or after. Who knows maybe it was a bug. But anyway it took couple mins to understand this messy config structure. But lets go to the point this transform system has the same Health/Mana Bug
 
of course you can do it like this, no one will punish you for lack of culture, but still you show with this behavior that you are potential thief. if you have problem with elementary math you can do something like @gudan garam said that is calculate your max health instead of using function getMaxHealth. I dont know 1.2 structure well but it should looks like
Code:
function CalculateMaxHealth()
local beginerHealth = 1000
local healthpoints = (beginerHealth+(player:getVocation():getHealthGain() * player:getLevel()))
for slot = CONST_SLOT_FIRST,CONST_SLOT_LAST do
local item = player:getSlotItem(slot)
if item.uid > 0 then
if ItemType(item).getAbilities().stats[STAT_MAXHITPOINTS] then
healthpoints = healthpoints + ItemType(item).getAbilities().stats[STAT_MAXHITPOINTS]
end
end
end
return healthpoints
end
function CalculateMaxMana()
local beginerMana = 1000
local manapoints = (beginerMana+(player:getVocation():getManaGain() * player:getLevel()))
for slot = CONST_SLOT_FIRST,CONST_SLOT_LAST do
local item = player:getSlotItem(slot)
if item.uid > 0 then
if ItemType(item).getAbilities().stats[STAT_MAXMANAPOINTS] then
manapoints = manapoints + ItemType(item).getAbilities().stats[STAT_MAXMANAPOINTS]
end
end
end
return manapoints
end
and now use it in death/login in creaturescripts
Code:
player:setMaxHealth(CalculateMaxHealth())
player:setMaxHealth(CalculateMaxMana())
you can also add this to transform/revert but you must sum up all previous transform stats, if the transform 1 will add +100 and transform 2 +200 transform 3 + 400 so in config transform 1 addhp=100 transform 2 addhp = 300 transform 3 addhp =700
Code:
player:setMaxHealth(CalculateMaxHealth() + (newTrans.addHp or 0))
player:setMaxHealth(CalculateMaxMana() + (newTrans.addMana or 0))
 
Last edited:
The problem is that "setMaxHealth" change only your character health while "getMaxHealth" gets your character health+temporary health.
If you're using TFS 1.2+ you can use "getBaseMaxHealth" and "getBaseMaxMana" to remove this "bug" otherwise you might need to use calculation(might be inaccurate if you use in other places "setMaxHealth") or just copy-paste to your source these functions.

Example:
Code:
player:setMaxHealth(player:getBaseMaxHealth() + TRANS.addHealth)
player:setMaxMana(player:getBaseMaxMana() + TRANS.addMana)
 
The problem is that "setMaxHealth" change only your character health while "getMaxHealth" gets your character health+temporary health.
If you're using TFS 1.2+ you can use "getBaseMaxHealth" and "getBaseMaxMana" to remove this "bug" otherwise you might need to use calculation(might be inaccurate if you use in other places "setMaxHealth") or just copy-paste to your source these functions.

Example:
Code:
player:setMaxHealth(player:getBaseMaxHealth() + TRANS.addHealth)
player:setMaxMana(player:getBaseMaxMana() + TRANS.addMana)
image.png


in your sources:
luascript.cpp:

First:

Below
C++:
registerMethod("Player", "addManaSpent", LuaScriptInterface::luaPlayerAddManaSpent);

Add
C++:
registerMethod("Player", "getBaseMaxHealth", LuaScriptInterface::luaPlayerGetBaseMaxHealth);
registerMethod("Player", "getBaseMaxMana", LuaScriptInterface::luaPlayerGetBaseMaxMana);

Second:

Below:
C++:
int LuaScriptInterface::luaPlayerAddManaSpent(lua_State* L)
{
    // player:addManaSpent(amount)
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        player->addManaSpent(getNumber<uint64_t>(L, 2));
        pushBoolean(L, true);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

Add:
C++:
int LuaScriptInterface::luaPlayerGetBaseMaxHealth(lua_State* L)
{
    // player:getBaseMaxHealth()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->healthMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

int LuaScriptInterface::luaPlayerGetBaseMaxMana(lua_State* L)
{
    // player:getBaseMaxMana()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->manaMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}
Ammm
Code:
1>..\src\luascript.cpp(2053): error C2065: 'luaPlayerGetBaseMaxHealth': undeclared identifier
1>..\src\luascript.cpp(2054): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2054): error C2065: 'luaPlayerGetBaseMaxMana': undeclared identifier
1>..\src\luascript.cpp(7461): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7464): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7464): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7466): error C2248: 'Creature::healthMax': cannot access protected member declared in class 'Creature'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\creature.h(511): note: see declaration of 'Creature::healthMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\monster.h(26): note: see declaration of 'Creature'
1>..\src\luascript.cpp(7473): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7476): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7476): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7478): error C2248: 'Player::manaMax': cannot access protected member declared in class 'Player'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\player.h(1146): note: see declaration of 'Player::manaMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'

in your sources:
luascript.cpp:

First:

Below
C++:
registerMethod("Player", "addManaSpent", LuaScriptInterface::luaPlayerAddManaSpent);

Add
C++:
registerMethod("Player", "getBaseMaxHealth", LuaScriptInterface::luaPlayerGetBaseMaxHealth);
registerMethod("Player", "getBaseMaxMana", LuaScriptInterface::luaPlayerGetBaseMaxMana);

Second:

Below:
C++:
int LuaScriptInterface::luaPlayerAddManaSpent(lua_State* L)
{
    // player:addManaSpent(amount)
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        player->addManaSpent(getNumber<uint64_t>(L, 2));
        pushBoolean(L, true);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

Add:
C++:
int LuaScriptInterface::luaPlayerGetBaseMaxHealth(lua_State* L)
{
    // player:getBaseMaxHealth()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->healthMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

int LuaScriptInterface::luaPlayerGetBaseMaxMana(lua_State* L)
{
    // player:getBaseMaxMana()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->manaMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}
Code:
1>..\src\luascript.cpp(2053): error C2065: 'luaPlayerGetBaseMaxHealth': undeclared identifier
1>..\src\luascript.cpp(2054): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2054): error C2065: 'luaPlayerGetBaseMaxMana': undeclared identifier
1>..\src\luascript.cpp(7461): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7464): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7464): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7466): error C2248: 'Creature::healthMax': cannot access protected member declared in class 'Creature'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\creature.h(511): note: see declaration of 'Creature::healthMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\monster.h(26): note: see declaration of 'Creature'
1>..\src\luascript.cpp(7473): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7476): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7476): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7478): error C2248: 'Player::manaMax': cannot access protected member declared in class 'Player'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\player.h(1146): note: see declaration of 'Player::manaMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
 
Last edited by a moderator:

in your sources:
luascript.cpp:

First:

Below
C++:
registerMethod("Player", "addManaSpent", LuaScriptInterface::luaPlayerAddManaSpent);

Add
C++:
registerMethod("Player", "getBaseMaxHealth", LuaScriptInterface::luaPlayerGetBaseMaxHealth);
registerMethod("Player", "getBaseMaxMana", LuaScriptInterface::luaPlayerGetBaseMaxMana);

Second:

Below:
C++:
int LuaScriptInterface::luaPlayerAddManaSpent(lua_State* L)
{
    // player:addManaSpent(amount)
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        player->addManaSpent(getNumber<uint64_t>(L, 2));
        pushBoolean(L, true);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

Add:
C++:
int LuaScriptInterface::luaPlayerGetBaseMaxHealth(lua_State* L)
{
    // player:getBaseMaxHealth()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->healthMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

int LuaScriptInterface::luaPlayerGetBaseMaxMana(lua_State* L)
{
    // player:getBaseMaxMana()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->manaMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}
 
in your sources:
luascript.cpp:

First:

Below
C++:
registerMethod("Player", "addManaSpent", LuaScriptInterface::luaPlayerAddManaSpent);

Add
C++:
registerMethod("Player", "getBaseMaxHealth", LuaScriptInterface::luaPlayerGetBaseMaxHealth);
registerMethod("Player", "getBaseMaxMana", LuaScriptInterface::luaPlayerGetBaseMaxMana);

Second:

Below:
C++:
int LuaScriptInterface::luaPlayerAddManaSpent(lua_State* L)
{
    // player:addManaSpent(amount)
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        player->addManaSpent(getNumber<uint64_t>(L, 2));
        pushBoolean(L, true);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

Add:
C++:
int LuaScriptInterface::luaPlayerGetBaseMaxHealth(lua_State* L)
{
    // player:getBaseMaxHealth()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->healthMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}

int LuaScriptInterface::luaPlayerGetBaseMaxMana(lua_State* L)
{
    // player:getBaseMaxMana()
    Player* player = getUserdata<Player>(L, 1);
    if (player) {
        lua_pushnumber(L, player->manaMax);
    } else {
        lua_pushnil(L);
    }
    return 1;
}
Code:
1>..\src\luascript.cpp(2053): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2053): error C2065: 'luaPlayerGetBaseMaxHealth': undeclared identifier
1>..\src\luascript.cpp(2054): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2054): error C2065: 'luaPlayerGetBaseMaxMana': undeclared identifier
1>..\src\luascript.cpp(7461): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7464): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7464): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7466): error C2248: 'Creature::healthMax': cannot access protected member declared in class 'Creature'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\creature.h(511): note: see declaration of 'Creature::healthMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\monster.h(26): note: see declaration of 'Creature'
1>..\src\luascript.cpp(7473): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7476): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7476): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7478): error C2248: 'Player::manaMax': cannot access protected member declared in class 'Player'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\player.h(1146): note: see declaration of 'Player::manaMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
 
Code:
1>..\src\luascript.cpp(2053): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2053): error C2065: 'luaPlayerGetBaseMaxHealth': undeclared identifier
1>..\src\luascript.cpp(2054): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(2054): error C2065: 'luaPlayerGetBaseMaxMana': undeclared identifier
1>..\src\luascript.cpp(7461): error C2039: 'luaPlayerGetBaseMaxHealth': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7464): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7464): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7466): error C2248: 'Creature::healthMax': cannot access protected member declared in class 'Creature'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\creature.h(511): note: see declaration of 'Creature::healthMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\monster.h(26): note: see declaration of 'Creature'
1>..\src\luascript.cpp(7473): error C2039: 'luaPlayerGetBaseMaxMana': is not a member of 'LuaScriptInterface'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\luascript.h(199): note: see declaration of 'LuaScriptInterface'
1>..\src\luascript.cpp(7476): error C2065: 'getUserdata': undeclared identifier
1>..\src\luascript.cpp(7476): error C2275: 'Player': illegal use of this type as an expression
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'
1>..\src\luascript.cpp(7478): error C2248: 'Player::manaMax': cannot access protected member declared in class 'Player'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\player.h(1146): note: see declaration of 'Player::manaMax'
1>  c:\users\animal\desktop\dragon ball nuo nulio\server\src\bed.h(26): note: see declaration of 'Player'


I'm sorry, I forgot. You must add the declartion of thoose methods:

luascript.h

below:

C++:
static int luaPlayerAddManaSpent(lua_State* L);

add:

C++:
static int luaPlayerGetBaseMaxHealth(lua_State* L);
static int luaPlayerGetBaseMaxMana(lua_State* L);


My bad on that.
 
Solution
Yeeeeeeeeeee finally works
I'm sorry, I forgot. You must add the declartion of thoose methods:

luascript.h

below:

C++:
static int luaPlayerAddManaSpent(lua_State* L);

add:

C++:
static int luaPlayerGetBaseMaxHealth(lua_State* L);
static int luaPlayerGetBaseMaxMana(lua_State* L);


My bad on that.
Thanks so you deserve the best answer because your first post was about getbasemaxhealth. So i have last question about that health/mana problem when you die. Can you explain it more detailed how to fix it?
 
Back
Top