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

[1.2] Summon experience

Shitobu

displays under your name in your posts.
Joined
Apr 24, 2016
Messages
25
Reaction score
1
I was trying to find on sources where I could change how summons receive experience when killing monsters with a player, but I didn't.
What I want to do is make summons receive 0 experience and not share any experience even though they did the damage. What am I supposed to do? Q_Q
 
It's for otx2 tfs 0.4 (if i'm correct) You can try something similar, good luck

Code:
NO SHARE EXP WITH SUMMON
creature.cpp
////////////////////////
void Creature::addDamagePoints(Creature* attacker, int32_t damagePoints)
{
    if(damagePoints < 0)
        return;

    uint32_t attackerId = 0;
    if(attacker)
    {
            if(Creature* master = attacker->getMaster())
                attacker = master;

            attackerId = attacker->getID();
        }

    CountMap::iterator it = damageMap.find(attackerId);
    if(it != damageMap.end())
    {
        it->second.ticks = OTSYS_TIME();
        if(damagePoints > 0)
            it->second.total += damagePoints;
    }
    else
        damageMap[attackerId] = CountBlock_t(damagePoints);

    if(damagePoints > 0)
        lastHitCreature = attackerId;
}
//////////////////////////////////////
 
It's for otx2 tfs 0.4 (if i'm correct) You can try something similar, good luck

Code:
NO SHARE EXP WITH SUMMON
creature.cpp
////////////////////////
void Creature::addDamagePoints(Creature* attacker, int32_t damagePoints)
{
    if(damagePoints < 0)
        return;

    uint32_t attackerId = 0;
    if(attacker)
    {
            if(Creature* master = attacker->getMaster())
                attacker = master;

            attackerId = attacker->getID();
        }

    CountMap::iterator it = damageMap.find(attackerId);
    if(it != damageMap.end())
    {
        it->second.ticks = OTSYS_TIME();
        if(damagePoints > 0)
            it->second.total += damagePoints;
    }
    else
        damageMap[attackerId] = CountBlock_t(damagePoints);

    if(damagePoints > 0)
        lastHitCreature = attackerId;
}
//////////////////////////////////////
Thanks for the code, Imma check and write here if it worked.
 
Back
Top