C++ display for the player loot from monsters EVO!

vena

Member
Joined
Jun 21, 2017
Messages
42
Reaction score
0
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

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();
}
 

Diarreamental

Member
Joined
Jul 6, 2015
Messages
110
Reaction score
11
do not misundertand my words im not tryong to offend you but, why are you using such old distribution in first place bro,change to something new
what does that distribution has that you won't change it?
 
OP
vena

vena

Member
Joined
Jun 21, 2017
Messages
42
Reaction score
0
Well, unfortunately I would use tfsa if it was to follow the player as on Evolutions. At Evolutions, skill counts everything fast SD and Manaruna to exhaust 1sec, etc. I know that in tfs you can also set the exhaust 1sec but then if someone marks you on follow or 2 people then you have no chance. If the TFS was able to slow down the so-called tfs so that you could escape the player I would use and so far Evolutions 0.7.8 is the best engine at 7.92.
 

Steve Albert

Banned User
Joined
Dec 9, 2018
Messages
267
Reaction score
102
C++:
Player* owner = g_game.getPlayerByID(corpse->getCorpseOwner());
Sorry i don't have access to that source so getCorpseOwner may not exist in your sources. But it doesn't hurt to try.
 
Top