• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Reply to thread

Thanks for the quick response however it seems like its the same issue as shown in the video before so I wont record another one; one thing I should note is that these monsters are set to always flee. (Max Health 80, <flag runonhealth="80"/>)


Another key note is that when the player stops moving, they act the exact same as if you stand in PZ, 1 sqm every 1 second. So I almost think it might be an issue that it's not running on health correctly when the player isnt moving.


Full code block from tested compile:

[code]

void Creature::onWalk()

{

    const Position& targetPos = attackedCreature->getPosition();

    if (attackedCreature && followPosition == targetPos) {

        FindPathParams fpp;

        getPathSearchParams(attackedCreature, fpp);


        const Position& creaturePos = getPosition();

        if (Position::getDistanceX(creaturePos, targetPos) + Position::getDistanceY(creaturePos, targetPos) < fpp.maxTargetDist) {

            forceUpdateFollowPath = true;

        }

    }

 

    if (getWalkDelay() <= 0) {

        Direction dir;

        uint32_t flags = FLAG_IGNOREFIELDDAMAGE;

        if (getNextStep(dir, flags)) {

            ReturnValue ret = g_game.internalMoveCreature(this, dir, flags);

            if (ret != RETURNVALUE_NOERROR) {

                if (Player* player = getPlayer()) {

                    player->sendCancelMessage(ret);

                    player->sendCancelWalk();

                }


                forceUpdateFollowPath = true;

            }

        } else {

            stopEventWalk();


            if (listWalkDir.empty()) {

                onWalkComplete();

            }

        }

    }


    if (cancelNextWalk) {

        listWalkDir.clear();

        onWalkAborted();

        cancelNextWalk = false;

    }


    if (eventWalk != 0) {

        eventWalk = 0;

        addEventWalk();

    }

}


[/code]


Back
Top