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

Summon Monsters GIVE EXP and LOOT TFS 1.3

Grillo1995

New Member
Joined
Feb 8, 2018
Messages
21
Solutions
1
Reaction score
1
Location
Brazil
I have a very annoying problem, when a player summons a waste on the server, when killing the summom he gains EXP and Loot, the summon's body does not SOME !!!

I have already reviewed data / lib / core / creature.lua

Magic script

Here is the source code C++: Dont work POFF :/

C++:
bool Creature::dropCorpse(Creature* lastHitCreature, Creature* mostDamageCreature, bool lastHitUnjustified, bool mostDamageUnjustified)
{
    if (!lootDrop && getMonster()) {
        if (master) {
            //scripting event - onDeath
            const CreatureEventList& deathEvents = getCreatureEvents(CREATURE_EVENT_DEATH);
            for (CreatureEvent* deathEvent : deathEvents) {
                deathEvent->executeOnDeath(this, nullptr, lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
            }
        }

        g_game.addMagicEffect(getPosition(), CONST_ME_POFF);
    } else {
        Item* splash;
        switch (getRace()) {
            case RACE_VENOM:
                splash = Item::CreateItem(ITEM_FULLSPLASH, FLUID_SLIME);
                break;

            case RACE_BLOOD:
                splash = Item::CreateItem(ITEM_FULLSPLASH, FLUID_BLOOD);
                break;

            default:
                splash = nullptr;
                break;
        }

        Tile* tile = getTile();

        if (splash) {
            g_game.internalAddItem(tile, splash, INDEX_WHEREEVER, FLAG_NOLIMIT);
            g_game.startDecay(splash);
        }

        Item* corpse = getCorpse(lastHitCreature, mostDamageCreature);
        if (corpse) {
            g_game.internalAddItem(tile, corpse, INDEX_WHEREEVER, FLAG_NOLIMIT);
            g_game.startDecay(corpse);
        }

        //scripting event - onDeath
        for (CreatureEvent* deathEvent : getCreatureEvents(CREATURE_EVENT_DEATH)) {
            deathEvent->executeOnDeath(this, corpse, lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
        }

        if (corpse) {
            dropLoot(corpse->getContainer(), lastHitCreature);
        }
    }

    return true;
}



EDIT:

for fix this bug go to in your source : /src/creature.h

And edit

Code:
        void setDropLoot(bool lootDrop) {
lootDrop = lootDrop;
}
void setSkillLoss(bool skillLoss) {
skillLoss = skillLoss;
}

Change to:

Code:
        void setDropLoot(bool lootDrop) {
this->lootDrop = lootDrop;
}
void setSkillLoss(bool skillLoss) {
this->skillLoss = skillLoss;
}

Goodbye.
 
Last edited:
Back
Top