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

TFS 1.X+ RunOnHealth Monster Behaviour

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,837
Solutions
18
Reaction score
614
Location
Poland
Hello there dear OTLanders!
Im looking for someone who could handle my request for changing a little bit behaviour of monsters which got RunOnHealth flag.

Now the monster behaviour with that flag is:
Monster run away from target (without attacking with melee) when they got X health. Just running and attacking with ex. fireballs or spells that have distance.

I want to change that to get their behaviour like this:
If monster have health below runOnHealth and target (monster target) for ex. player is near him (got range for melee attack) the monster should attack him with melee and run away 1 sqm [if player (target) is chasing him too] (not constant running away like in default TFS). If target is not chasing monster he could run and get behaviour like in default.

I know that in older versions of TFSes / other "engines" monsters got something like strategy attack what is working as I wrote above. But I saw that "strategy attack" don't exist at TFS 1.X+

Also...
I have found in monster.cpp
C++:
    if (sb.isMelee && isFleeing()) {
        return false;
    }
If I turned it off (commented) I enabled monster attacks with his "melee" attack but he is still moving away.

EXPLAINED IN VIDEO:

I think I must mess with isFleeing function but I don't have idea how to make that behaviour what I said above. Maybe any switch or something?

Anyone?
Thanks in advance,
Fresh.
 
Last edited:
Well, seems like on a left, "good" side, monster didnt throw any attack at all. Even melee one. Its just turning and do shit.
On a "bad" side you can see hits and black square, so that dragon is fighting back.
 
Well, seems like on a left, "good" side, monster didnt throw any attack at all. Even melee one. Its just turning and do shit.
On a "bad" side you can see hits and black square, so that dragon is fighting back.

Yeah but I want that behaviour as you can see monster is doing something like:
- Turn into the player;
- Stepback

But for now the monster is completely running like chicken from player :/
 
Back
Top