• 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++ Making monsters move when far from respawn

thomson9292

New Member
Joined
Feb 28, 2017
Messages
97
Solutions
1
Reaction score
2
Issue:
Normally when player is near monster and it can't reach the player it run all over the place (monster never stay in one spot). Problem appears after I removed condition which were teleporting monsters back in case when they run too far from spawn.
When monsters are far from spawn they didn't act like they did when they were next to their spawn spot. When player enters unreachable zone (eg. protection zone, +1 level) monsters stay in one spot and don't move unless they are able to attack player - it doesn't happen when monsters are near respawn (if they are next to spawn they walk around).

Code I deleted:
Code:
if (!isInSpawnRange(position)) {
g_game.internalTeleport(this, masterPos);
setIdle(true);
}

Expect solution:
It would be much better when monsters act the some no matter how far from spawn they are (I don't want to make monsters move when player is not nearby and I don't need to make monsters walk back to spawn point - just walking around like they do when player is near and they can't reach him).

I'm using tfs 1.3, client 10.98.

I guess it is probably more challenging than I expect but could you guys at least tell me what kind of changes are needed to make this change possible?
 
Back
Top