Hello I use TFS 1.5 by Nekiro, on my ots Trainers are made as monsters. I added a house trainer and I edited source code to allow interactions with it inside PZ. Everything works as excepted but not one thing. If i spawn the trainer in house it keeps switching targets if they are standing away from trainer it alternates between 2 targets. (if the hug the trainer its fine it keeps the target on 1 person)
but when I spawn this trainer for test not in PZ it properly sticks to one target from all ranges. Maybe something is wrong here? I would also like to make so that monster dont grant CONDITION_ONFIGHT to players.
bump
but when I spawn this trainer for test not in PZ it properly sticks to one target from all ranges. Maybe something is wrong here? I would also like to make so that monster dont grant CONDITION_ONFIGHT to players.
C++:
bool Monster::isTarget(const Creature* creature) const
{
// Check if the creature is removed, not attackable, or not visible
if (creature->isRemoved() || !creature->isAttackable() || !canSeeCreature(creature)) {
return false;
}
// Check if the creature is in a protection zone
if (creature->getZone() == ZONE_PROTECTION) {
// Allow the House Training Dummy to bypass this check
if (getName() != "House Training Dummy") {
return false; // Only disallow targeting in PZ for other monsters
}
}
// Check if the creature is on the same z-coordinate (floor level)
if (creature->getPosition().z != getPosition().z) {
return false;
}
return true; // The creature can be targeted
}
Post automatically merged:
bump
Last edited: