• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • 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!

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

vena

New Member
Joined
Jun 21, 2017
Messages
44
Best answers
0
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
177
Best answers
0
Reaction score
17
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

New Member
Joined
Jun 21, 2017
Messages
44
Best answers
0
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
Best answers
13
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.
 

middley

New Member
Joined
Oct 2, 2019
Messages
11
Best answers
0
Reaction score
0
Code:
155 C:\Users `count' was not declared in this scope
??
 
Top