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

../monsters.cpp:93: error: 'getPlayer' was not declared in this scope

Exedion

Active Member
Joined
Jun 11, 2007
Messages
629
Reaction score
30
well how i can declare "getPlayer" in monster.cpp?

i try to compile this custom function

Code:
uint16_t Monsters::getLootRandom()
{
	return (uint16_t)std::ceil((double)random_range(0, MAX_LOOTCHANCE) / g_config.getDouble(ConfigManager::RATE_LOOT) * getPlayer()->getExtraLootRate());
}
 
PHP:
reinterpret_cast<Creature*>(this)->getPlayer();
(it will return a NULL pointer, since its in monster class which means it's 100% monster, not a player).

But lets think for a moment how retarted it is, you don't even know what you are doing, since obviously you want to get player with last hit who killed monsters but you are doing it wrong, I'm not going to explain you since it's waste of my time, you should learn something before doing copy and paste thing.
 
PHP:
reinterpret_cast<Creature*>(this)->getPlayer();
(it will return a NULL pointer, since its in monster class which means it's 100% monster, not a player).

But lets think for a moment how retarted it is, you don't even know what you are doing, since obviously you want to get player with last hit who killed monsters but you are doing it wrong, I'm not going to explain you since it's waste of my time, you should learn something before doing copy and paste thing.

:O thanks, but... because people like you are like truly retards, no wash and no provide the bath! because if i finish this code, will help to many people, but you? only answered my question to imply you know more than I of the subject... that is the really stupidity
 
:O thanks, but... because people like you are like truly retards, no wash and no provide the bath! because if i finish this code, will help to many people, but you? only answered my question to imply you know more than I of the subject... that is the really stupidity

No, you are stupid, you're retard trying to copy/paste and do something, there is no point in helping you, since you obviously don't now what you are doing.

Once you learn something, I will show you the way.
 
No, you are stupid, you're retard trying to copy/paste and do something, there is no point in helping you, since you obviously don't now what you are doing.

Once you learn something, I will show you the way.
not like u know it anyway
 
No, you are stupid, you're retard trying to copy/paste and do something, there is no point in helping you, since you obviously don't now what you are doing.

Once you learn something, I will show you the way.

man you're acting like a fool, insulting and provoking others, if you're not going to help, do not post anything

and honestly do you not know if i have idea of what i do or not, show off with some attempt to try to learn how to declare "GETPLAYER" where I need it, just not been fully published the code, you need not think i want to put "getExtraLootRate" from scratch, i get the base from other code.

thanks anyway, but come back when you improve your attitude.
 
First of all, you don't even know who killed monster, but somehow you are trying to get a player from monster.
You need to get killers using for example Creature::getKillers(Creature** _lastHitCreature, Creature** _mostDamageCreature) function which will provide Creatures which killed this monster.

Fallon
I know you don't know anything about that, thats sad.
 
First of all, you don't even know who killed monster, but somehow you are trying to get a player from monster.
You need to get killers using for example Creature::getKillers(Creature** _lastHitCreature, Creature** _mostDamageCreature) function which will provide Creatures which killed this monster.

Fallon
I know you don't know anything about that, thats sad.

Ok i see, if you whant, i post the custom code and you see how can i add this to make the extraLootRate for players... is wanted for long time ago for many players...
 
Heh.. Lot is set to a monster while it spawn, not in a moment player kill it, so u can't make such function getLootRandom() heh

Well in real Tibia servers yes, not in otservers (they are generated after monster dies, unless they changed it).
 
Back
Top