• 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++ help with void

shadowsin

New Member
Joined
Jul 26, 2011
Messages
20
Reaction score
1
Hey people!

and the following I created a void and put function of her in the creature.cpp for when I kill the monster with the right name she make the function of her

It worked out right! the problem and when the monster of a magic in area that hits the other monster of the same, when I kill that monster that hit the other crash my exe, I'm trying to make a task system! My server version is 7.9 old xml

player.cpp void

C++:
void Player::Sauron()
{    

     int32_t sauris;
     
     getStorageValue(7960, sauris);
     addStorageValue(7960, sauris+1);    
     std::stringstream Msg1;
     Msg1 << "Você já matou " << sauris+1 << " Sauron(s) parabéns!.";
     sendTextMessage(MSG_STATUS_CONSOLE_BLUE, Msg1.str());

}

call creature.cpp

C++:
void Creature::die()
{
    Creature* lastHitCreature = NULL;
    Creature* mostDamageCreature = NULL;

    if(getKillers(&lastHitCreature, &mostDamageCreature)){
        if(lastHitCreature){
            lastHitCreature->onKilledCreature(this);
        }


        if(mostDamageCreature && mostDamageCreature != lastHitCreature){
            mostDamageCreature->onKilledCreature(this);
        }
    }

    for(DamageMap::iterator it = damageMap.begin(); it != damageMap.end(); ++it){
        if(Creature* attacker = g_game.getCreatureByID((*it).first)){
            attacker->onAttackedCreatureKilled(this);
        }
    }
                         
    Player* player;
    if(getNameDescription() == "a sauron"){
       player->Sauron();
     }
   

    if(getMaster()){
        getMaster()->removeSummon(this);
    }
   
   
}
 
Back
Top