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

I'm pissed on tfs (I dont know whats going on)

Stanos

Veteran OT User
Joined
Jun 12, 2018
Messages
587
Solutions
4
Reaction score
315
Location
Europe
Hi
this stuff is so stupid it should work perfectly 111111110000% and funny think couple days ago this stuff worked perfectly and now its not working properly for no reason. So my point is with spell effects
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
So lets talk about game.cpp now. So i changed all energy hit effect with CONST_ME_NONE so if i dont apply setcombatparam it shouldn't send any effect right? But it sends effect CONST_ME_DRAWBLOOD or CONST_ME_BLOCKHIT because they look the same so i'm not sure which one of them but yea why dafuq does my energy hiteffect applies them?

Code:
bool Game::combatBlockHit(CombatDamage& damage, Creature* attacker, Creature* target, bool checkDefense, bool checkArmor, bool field)
{
    if (damage.primary.type == COMBAT_NONE && damage.secondary.type == COMBAT_NONE) {
        return true;
    }

    if (target->getPlayer() && target->isInGhostMode()) {
        return true;
    }

    if (damage.primary.value > 0) {
        return false;
    }

    static const auto sendBlockEffect = [this](BlockType_t blockType, CombatType_t combatType, const Position& targetPos) {
        if (blockType == BLOCK_DEFENSE) {
            addMagicEffect(targetPos, CONST_ME_POFF);
        } else if (blockType == BLOCK_ARMOR) {
            addMagicEffect(targetPos, CONST_ME_BLOCKHIT);
        } else if (blockType == BLOCK_IMMUNITY) {
            uint8_t hitEffect = 0;
            switch (combatType) {
                case COMBAT_UNDEFINEDDAMAGE: {
                    return;
                }
                case COMBAT_ENERGYDAMAGE:
                case COMBAT_FIREDAMAGE:
                case COMBAT_PHYSICALDAMAGE:
                case COMBAT_ICEDAMAGE:
                case COMBAT_DEATHDAMAGE: {
                    hitEffect = CONST_ME_BLOCKHIT;
                    break;
                }
                case COMBAT_EARTHDAMAGE: {
                    hitEffect = CONST_ME_GREEN_RINGS;
                    break;
                }
                case COMBAT_HOLYDAMAGE: {
                    hitEffect = CONST_ME_HOLYDAMAGE;
                    break;
                }
                default: {
                    hitEffect = CONST_ME_POFF;
                    break;
                }
            }
            addMagicEffect(targetPos, hitEffect);
        }
    };

    BlockType_t primaryBlockType, secondaryBlockType;
    if (damage.primary.type != COMBAT_NONE) {
        damage.primary.value = -damage.primary.value;
        primaryBlockType = target->blockHit(attacker, damage.primary.type, damage.primary.value, checkDefense, checkArmor, field);

        damage.primary.value = -damage.primary.value;
        sendBlockEffect(primaryBlockType, damage.primary.type, target->getPosition());
    } else {
        primaryBlockType = BLOCK_NONE;
    }

    if (damage.secondary.type != COMBAT_NONE) {
        damage.secondary.value = -damage.secondary.value;
        secondaryBlockType = target->blockHit(attacker, damage.secondary.type, damage.secondary.value, false, false, field);

        damage.secondary.value = -damage.secondary.value;
        sendBlockEffect(secondaryBlockType, damage.secondary.type, target->getPosition());
    } else {
        secondaryBlockType = BLOCK_NONE;
    }
    return (primaryBlockType != BLOCK_NONE) && (secondaryBlockType != BLOCK_NONE);
}

Everything worked but when couple days passed tfs started to send this effect for no reason. Any ideas whats going on?
 
Back
Top