• 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++] monster::doAttack

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,775
Solutions
25
Reaction score
483
Location
Sweden
Hello, I wonder if someone could help me with editing this code. The thing I want to achieve is that when a monster who is on distance (mage-monsters; warlocks, necromancers, orc shamans etc~) attacks,

they should attack the closest target all the time.

Thanks in advance!

Edit:
Never found a solution for this, but I remember I lacked TARGETSEARCH_NEAREST.

Perhaps that was the issue. Not sure.
 
Last edited:
Well no, that's not where the target searching is at.

If you were using TFS, you would have to edit void Monster::eek:nThinkTarget(uint32_t interval):
Code:
	if(mType->targetDistance <= [B][COLOR="red"]3[/COLOR][/B])
		searchTarget(TARGETSEARCH_RANDOM);
	else
		searchTarget(TARGETSEARCH_NEAREST);
 
Back
Top