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

Player Loot Rate

zexus

Member
Joined
Oct 1, 2016
Messages
133
Reaction score
18
The only way i know and found about change loot rates is to change global loot rate
On config.lua (rateLoot = 1.0)

Is this possible to edit in a OT to change player loot rate for just one player?
There is a lot system a want to do with this...

Is anybody know how to do it?

---
obs1: I'm already know about this mod [MOD] Loot Ring
But i want to change original loot rate, not create another loot system to every kill...
obs2: Sources i'm using? Fir3element/3777
 
Solution
Since I have not worked with older tfs versions for a while, I don't have the tools set up to compile and test it, so I'd assume you will get compile errors, if you do, let me know.

As you can see, I'm not very good at styiling my posts, so take care when following the steps to minimize the possibility of silly errors.


Start:


Add this on player.h (Fir3element/3777):
C++:
uint8_t specialLootRate;


and this (Fir3element/3777):
C++:
uint8_t getSpecialLootRate() const {
    return specialLootRate;
}

void setSpecialLootRate(uint8_t newRate) {
    specialLootRate= newRate;
}


In monsters.h line 91 (Fir3element/3777) change the createChildLoot signature to this:...
Did i done something wrong?
Code:
monsters.cpp: In static member function ‘static uint16_t Monsters::getLootRandom(Player*)’:
monsters.cpp:93:98: error: ‘SPECIAL_RATE_LOOT’ is not a member of ‘ConfigManager’
         return (uint16_t)std::ceil((double)random_range(0, MAX_LOOTCHANCE) / (g_config.getDouble(ConfigManager::SPECIAL_RATE_LOOT) + owner->getSpecialLootRate()));
                                                                                                  ^~~~~~~~~~~~~
iologindata.cpp: In member function ‘bool IOLoginData::loadPlayer(Player*, const string&, bool)’:
iologindata.cpp:424:13: error: ‘class Player’ has no member named ‘setHasSpecialLootRate’; did you mean ‘setSpecialLootRate’?
     player->setHasSpecialLootRate(result->getDataInt("special_rate_loot"));
             ^~~~~~~~~~~~~~~~~~~~~
In file included from luascript.h:33:0,
                 from luascript.cpp:18:
luascript.cpp: In member function ‘virtual void LuaInterface::registerFunctions()’:
luascript.cpp:2247:60: error: ‘luaDoPlayerSetSpecialRateLoot’ is not a member of ‘LuaInterface’
     lua_register(m_luaState, "doPlayerSetSpecialRateLoot", LuaInterface::luaDoPlayerSetSpecialRateLoot);
                                                            ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2247:5: note: in expansion of macro ‘lua_register’
     lua_register(m_luaState, "doPlayerSetSpecialRateLoot", LuaInterface::luaDoPlayerSetSpecialRateLoot);
     ^
luascript.cpp: At global scope:
luascript.cpp:9529:65: error: no ‘int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State*)’ member function declared in class ‘LuaInterface’
 int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State* L)
                                                                 ^
Makefile:33: recipe for target 'monsters.o' failed
make: *** [monsters.o] Error 1
make: *** Waiting for unfinished jobs....
Makefile:33: recipe for target 'iologindata.o' failed
make: *** [iologindata.o] Error 1
Makefile:33: recipe for target 'luascript.o' failed
make: *** [luascript.o] Error 1
 
My bad, in Monsters::getLootRandom change

from:
C++:
g_config.getDouble(ConfigManager::SPECIAL_RATE_LOOT)

to:
C++:
g_config.getDouble(ConfigManager::RATE_LOOT)


The IOLoginData::loadPlayer should be

C++:
 player->setSpecialLootRate(result->getDataInt("special_rate_loot"));

instead of

C++:
 player->setHasSpecialLootRate(result->getDataInt("special_rate_loot"));


The errors regarding luascript.cpp, are you sure you put everything in my post? I'm pretty sure if you do it exactly like mine it works.
 
My bad, in Monsters::getLootRandom change

from:
C++:
g_config.getDouble(ConfigManager::SPECIAL_RATE_LOOT)

to:
C++:
g_config.getDouble(ConfigManager::RATE_LOOT)


The IOLoginData::loadPlayer should be

C++:
 player->setSpecialLootRate(result->getDataInt("special_rate_loot"));

instead of

C++:
 player->setHasSpecialLootRate(result->getDataInt("special_rate_loot"));


The errors regarding luascript.cpp, are you sure you put everything in my post? I'm pretty sure if you do it exactly like mine it works.

Thank you for all your help to us..
Did a made something wrong?
Code:
In file included from luascript.h:33:0,
                 from luascript.cpp:18:
luascript.cpp: In member function ‘virtual void LuaInterface::registerFunctions()’:
luascript.cpp:2247:60: error: ‘luaDoPlayerSetSpecialRateLoot’ is not a member of ‘LuaInterface’
     lua_register(m_luaState, "doPlayerSetSpecialRateLoot", LuaInterface::luaDoPlayerSetSpecialRateLoot);
                                                            ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2247:5: note: in expansion of macro ‘lua_register’
     lua_register(m_luaState, "doPlayerSetSpecialRateLoot", LuaInterface::luaDoPlayerSetSpecialRateLoot);
     ^
luascript.cpp: At global scope:
luascript.cpp:9529:65: error: no ‘int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State*)’ member function declared in class ‘LuaInterface’
 int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State* L)
                                                                 ^
 
Thank you for all your help to us..
Did a made something wrong?
Code:
In file included from luascript.h:33:0,
                 from luascript.cpp:18:
luascript.cpp: In member function ‘virtual void LuaInterface::registerFunctions()’:
luascript.cpp:2247:60: error: ‘luaDoPlayerSetSpecialRateLoot’ is not a member of ‘LuaInterface’
     lua_register(m_luaState, "doPlayerSetSpecialRateLoot", LuaInterface::luaDoPlayerSetSpecialRateLoot);
                                                            ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2247:5: note: in expansion of macro ‘lua_register’
     lua_register(m_luaState, "doPlayerSetSpecialRateLoot", LuaInterface::luaDoPlayerSetSpecialRateLoot);
     ^
luascript.cpp: At global scope:
luascript.cpp:9529:65: error: no ‘int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State*)’ member function declared in class ‘LuaInterface’
 int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State* L)
                                                                 ^

can you post your luascript.h and luascript.cpp code?
 
You didn't put the methods signature in luascript.h. (the last step on my post)

Opps, sorry...
Thank you again...

To return the special loot rates, to make scripts more complexes
How to make the function get?
Code:
int32_t LuaInterface::luaDoPlayerGetSpecialRateLoot(lua_State* L)
{
    //doPlayerGetSpecialRateLoot(cid, newRate)
   
    return 1;
}
 
Opps, sorry...
Thank you again...

To return the special loot rates, to make scripts more complexes
How to make the function get?
Code:
int32_t LuaInterface::luaDoPlayerGetSpecialRateLoot(lua_State* L)
{
    //doPlayerGetSpecialRateLoot(cid, newRate)
  
    return 1;
}

C++:
    ScriptEnviroment* env = getEnv();
    if(const Player* player = env->getPlayerByUID(popNumber(L)))
        lua_pushnumber(L, player->getSpecialLootRate());
    else
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }

    return 1;

This should work, remember you have to do the last 3 steps on my post for this method aswell, on the header file and register it to the luainterface.
 
C++:
    ScriptEnviroment* env = getEnv();
    if(const Player* player = env->getPlayerByUID(popNumber(L)))
        lua_pushnumber(L, player->getSpecialLootRate());
    else
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }

    return 1;

This should work, remember you have to do the last 3 steps on my post for this method aswell, on the header file and register it to the luainterface.

The system looks working, thats amazing, now we can create a lot scripts with this functions
Many people said that was impossible and now u made it work

But now i got a problem to save players, console:
Code:
[18:28:55.228] Zexus has logged out.
[18:28:55.229] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1537738103, `lastip` = 16777343, `level` = 50, `group_id` = 1, `health` = 815, `healthmax` = 815, `experience` = 1847300, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 245, `manamax` = 245, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 1485, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1537738135, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[18:28:55.229] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1537738103, `lastip` = 16777343, `level` = 50, `group_id` = 1, `health` = 815, `healthmax` = 815, `experience` = 1847300, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 245, `manamax` = 245, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 1485, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1537738135, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[18:28:55.230] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1537738103, `lastip` = 16777343, `level` = 50, `group_id` = 1, `health` = 815, `healthmax` = 815, `experience` = 1847300, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 245, `manamax` = 245, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 1485, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1537738135, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[18:28:55.230] Error while saving player: Zexus.
[18:29:18.595] Zexus has logged in.
 
The system looks working, thats amazing, now we can create a lot scripts with this functions
Many people said that was impossible and now u made it work

But now i got a problem to save players, console:
Code:
[18:28:55.228] Zexus has logged out.
[18:28:55.229] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1537738103, `lastip` = 16777343, `level` = 50, `group_id` = 1, `health` = 815, `healthmax` = 815, `experience` = 1847300, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 245, `manamax` = 245, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 1485, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1537738135, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[18:28:55.229] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1537738103, `lastip` = 16777343, `level` = 50, `group_id` = 1, `health` = 815, `healthmax` = 815, `experience` = 1847300, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 245, `manamax` = 245, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 1485, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1537738135, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[18:28:55.230] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1537738103, `lastip` = 16777343, `level` = 50, `group_id` = 1, `health` = 815, `healthmax` = 815, `experience` = 1847300, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 245, `manamax` = 245, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 1485, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1537738135, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[18:28:55.230] Error while saving player: Zexus.
[18:29:18.595] Zexus has logged in.


Code:
`special_rate_loot` = ,

We are not getting anything from player->getSpecialLootRate() I've had that happen before to me where a getter method that should return a uint8_t didn't return anything, IDK how to fix it though.

Perhaps try changig the types from specialLootRate to uint16_t and the getter method (getSpecialLootRate()) from uint8_t to uint16_t, you'd also need to change the type from tinyint to int in your database.
 
I did changed the
players.h
Code:
       // change loot rates per player 1
       uint16_t specialLootRate;
       // change loot rates per player 2
       uint16_t getSpecialLootRate() const {
           return specialLootRate;
       }
       void setSpecialLootRate(uint16_t newRate) {
           specialLootRate= newRate;
       }

luascript.cpp
Code:
// change loot rates per player 1
int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State* L)
{
    //doPlayerSetSpecialRateLoot(cid, newRate)
    uint16_t newRate = (uint16_t)popNumber(L);
    ScriptEnviroment* env = getEnv();
    if(Player* player = env->getPlayerByUID(popNumber(L)))
    {
        player->setSpecialLootRate(newRate);
        lua_pushboolean(L, true);
    }
    else
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }
    return 1;
}

and
Code:
ALTER TABLE `players` CHANGE `special_rate_loot` `special_rate_loot` INT(11) NOT NULL DEFAULT '0';


And still sending this error
Code:
[11:22:14.112] Zexus has logged in.
[11:22:18.071] Zexus has logged out.
[11:22:18.155] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538317334, `lastip` = 16777343, `level` = 20, `group_id` = 1, `health` = 365, `healthmax` = 365, `experience` = 99394, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 95, `manamax` = 95, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 735, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538317338, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[11:22:18.156] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538317334, `lastip` = 16777343, `level` = 20, `group_id` = 1, `health` = 365, `healthmax` = 365, `experience` = 99394, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 95, `manamax` = 95, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 735, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538317338, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[11:22:18.156] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538317334, `lastip` = 16777343, `level` = 20, `group_id` = 1, `health` = 365, `healthmax` = 365, `experience` = 99394, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 95, `manamax` = 95, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 735, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538317338, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[11:22:18.156] Error while saving player: Zexus.
 
I did changed the
players.h
Code:
       // change loot rates per player 1
       uint16_t specialLootRate;
       // change loot rates per player 2
       uint16_t getSpecialLootRate() const {
           return specialLootRate;
       }
       void setSpecialLootRate(uint16_t newRate) {
           specialLootRate= newRate;
       }

luascript.cpp
Code:
// change loot rates per player 1
int32_t LuaInterface::luaDoPlayerSetSpecialRateLoot(lua_State* L)
{
    //doPlayerSetSpecialRateLoot(cid, newRate)
    uint16_t newRate = (uint16_t)popNumber(L);
    ScriptEnviroment* env = getEnv();
    if(Player* player = env->getPlayerByUID(popNumber(L)))
    {
        player->setSpecialLootRate(newRate);
        lua_pushboolean(L, true);
    }
    else
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
        lua_pushboolean(L, false);
    }
    return 1;
}

and
Code:
ALTER TABLE `players` CHANGE `special_rate_loot` `special_rate_loot` INT(11) NOT NULL DEFAULT '0';


And still sending this error
Code:
[11:22:14.112] Zexus has logged in.
[11:22:18.071] Zexus has logged out.
[11:22:18.155] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538317334, `lastip` = 16777343, `level` = 20, `group_id` = 1, `health` = 365, `healthmax` = 365, `experience` = 99394, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 95, `manamax` = 95, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 735, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538317338, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[11:22:18.156] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538317334, `lastip` = 16777343, `level` = 20, `group_id` = 1, `health` = 365, `healthmax` = 365, `experience` = 99394, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 95, `manamax` = 95, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 735, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538317338, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[11:22:18.156] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1538317334, `lastip` = 16777343, `level` = 20, `group_id` = 1, `health` = 365, `healthmax` = 365, `experience` = 99394, `lookbody` = 20, `lookfeet` = 57, `lookhead` = 87, `looklegs` = 114, `looktype` = 128, `lookaddons` = 0, `maglevel` = 0, `mana` = 95, `manamax` = 95, `manaspent` = 40, `soul` = 99, `town_id` = 1, `posx` = 1068, `posy` = 1018, `posz` = 6, `cap` = 735, `sex` = 1, `balance` = 0, `stamina` = 201600000, `special_rate_loot` = , `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_experience` = 200, `loss_mana` = 10, `loss_skills` = 10, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1538317338, `blessings` = 0, `marriage` = 0, `vocation` = 4 WHERE `id` = 13 LIMIT 1; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ', `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '', `loss_exper' at line 1 (1064)
[11:22:18.156] Error while saving player: Zexus.

Did you make the getSpecialLootRate method public or private? It has to be public.
 
Did you make the getSpecialLootRate method public or private? It has to be public.

I was setting on luascript.h in protected, changed for public and back to save...
What do u recommend? Come back with changes to _8 or still using _16 and int instead of tinyint

???
 
Back
Top