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

setPlayerLootRate/SetPlayerRegeneration

wizzar

New Member
Joined
Aug 21, 2009
Messages
90
Reaction score
0
I really need help developing these codes:
-A code setPlayerLootRate(cid,rate)
setPlayerRegeneration(cid,hpticks,hpamount,manaticks,manaamount)

I really need it for VIP accounts, if it is impossible to make, just tell me.

Thx!
 
Any help? Cmon Im trying but Im not that good in sources, please?
Code:
uint16_t Monsters::getLootRandom()
{
	return (uint16_t)std::ceil(((double)random_range(0, MAX_LOOTCHANCE) / g_config.getDouble(ConfigManager::RATE_LOOT) * lootExtraRate);
}
I added lootExtraRate here, I think that here is where the chance is calculated, is that right?
Asyou can see I multplyed the whole math for lootExtraRate
 
static int32_t luaDoCreatureSetExtraLootRate(lua_State* L);
added to luascript.h

//doCreatureSetExtraLootRate(cid, value)
lua_register(m_luaState, "doCreatureSetExtraLootRate", LuaScriptInterface::luaDoCreatureSetExtraLootRate);
luascript.cpp
 
Last edited:
It just came to me, i could ADD in //doPlayerSetRate(cid, type, value), a type named "lootrate" or something like that, would make it a lot shorter i guess.
 
Back
Top