Hmm a little point. The AI does not cheat. Mages cast true sight even though they can't see you because they can hear you.
There are 2 scripting triggers:
See(Object)
and Detect(Object) that are mainly used in AI scripts for detecting people.
The code to decide when true sight is cast is simple:
IF
!See(NearestEnemyOf(Myself)) //the ! means NOT
Detect(NearestEnemyOf(Myself))
HaveSpell(WIZARD_TRUE_SIGHT)
THEN
RESPONSE #100
Spell(Myself,WIZARD_TRUE_SIGHT)
END
Pretty simple I'm sure u admit. If the nearest enemy is heard but not seen, cast true sight. This is why u need thieves and rangers with high move silently skill.
|