• 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++ Nostalrius Bug

gohamvsgoku

Member
Joined
Aug 21, 2017
Messages
151
Reaction score
9
Hello, anyone that work with nostalrius engine fixed this issue?

There is a fix for this, but it doesn't work very well, the monsters continue with the effect once.

if someone found the correct solution, I thank you for sharing.
 
not happens if apply the "fix"
but the fix is not working properly, the effect should never appear once


combat.cpp

Lua:
Find:
void MagicField::onStepInField(Creature* creature)

before:
"creature->addCondition(conditionCopy);"

add:
if (creature && creature->isImmune(conditionCopy->getType())) {
    return;
}
 
before - effect every tick until last damage
nekiro - 1 effect tick after monster steps out of field
panther - completely removes any effect

tested on Realots.org - News (http://experimental.realots.org) and this is the result:
if creature is immun to fire/energy/poison, it should only display the effect one time as it steps in on the field.
the effect depends on what element it steps on, example (fire and energy will display "spark" and poison will display "poison"
 
before - effect every tick until last damage
nekiro - 1 effect tick after monster steps out of field
panther - completely removes any effect

tested on Realots.org - News (http://experimental.realots.org) and this is the result:
if creature is immun to fire/energy/poison, it should only display the effect one time as it steps in on the field.
the effect depends on what element it steps on, example (fire and energy will display "spark" and poison will display "poison"


So picky 😂

Lua:
        auto combatType = conditionCopy->getType();
        if (creature && creature->isImmune(combatType)) {
            uint8_t hitEffect = 0;
            switch (combatType) {
                case CONDITION_ENERGY:
                case CONDITION_FIRE: {
                    hitEffect = CONST_ME_BLOCKHIT;
                    break;
                }
                case CONDITION_POISON: {
                    hitEffect = CONST_ME_GREEN_RINGS;
                    break;
                }
                default: {
                    hitEffect = CONST_ME_POFF;
                    break;
                }
            }

            g_game.addMagicEffect(getPosition(), hitEffect);
            return;
        }



Put that above "creature->addCondition(conditionCopy);" instead
 
Back
Top