View Single Post
Old 09-16-2001, 10:54 PM   #4
Vaskez
Takhisis Follower
 

Join Date: April 30, 2001
Location: szép Magyarország (well not right now)
Posts: 5,089
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.
Vaskez is offline   Reply With Quote