vena
New Member
- Joined
- Jun 21, 2017
- Messages
- 65
- Reaction score
- 2
Hello forum members,
I have source Evolutons 7.8.9 SQL and I would like to do that when a player kills a monster, he displays the Text that loot is in the monster. I have already made a loot but I can not do it to show to the player. It only displays me in the engine console. He does not know for which player to display it. I do not have a corpse-type function from tfsa-> getOwnerID and getCorpseOwner and so ...
sorry for English Google!
Here's part of the code
I have source Evolutons 7.8.9 SQL and I would like to do that when a player kills a monster, he displays the Text that loot is in the monster. I have already made a loot but I can not do it to show to the player. It only displays me in the engine console. He does not know for which player to display it. I do not have a corpse-type function from tfsa-> getOwnerID and getCorpseOwner and so ...
sorry for English Google!
Here's part of the code
C++:
void MonsterType::createLoot(Container* corpse)
{
std::stringstream ss;
//int count = 0;
Player* owner = g_game.getPlayerByID(1);
if(g_config.getNumber(ConfigManager::SHOW_MONSTERS_LOOT)){
ss << "Loot of " << nameDescription << ": ";
owner->sendTextMessage(MSG_INFO_DESCR, ss.str());
}
for(LootItems::const_iterator it = lootItems.begin(); it != lootItems.end() && (corpse->capacity() - corpse->size() > 0); it++){
Item* tmpItem = createLootItem(*it);
if(tmpItem){
//check containers
if(Container* container = tmpItem->getContainer()){
createLootContainer(container, *it);
if(container->size() == 0){
delete container;
}
else{
corpse->__internalAddThing(tmpItem);
count++;
if(g_config.getNumber(ConfigManager::SHOW_MONSTERS_LOOT)){
if(count == 0){
ss << "nothing.";
owner->sendTextMessage(MSG_INFO_DESCR, ss.str());
} else {
ss << tmpItem->getDescription(tmpItem->getID()) << ", ";
owner->sendTextMessage(MSG_INFO_DESCR, ss.str());
}
}
}
}
else{
corpse->__internalAddThing(tmpItem);
count++;
if(g_config.getNumber(ConfigManager::SHOW_MONSTERS_LOOT)){
if(count == 0){
ss << "nothing.";
owner->sendTextMessage(MSG_INFO_DESCR, ss.str());
} else {
ss << tmpItem->getDescription(tmpItem->getID()) << ", ";
owner->sendTextMessage(MSG_INFO_DESCR, ss.str());
}
}
}
}
}
corpse->__startDecaying();
}