Here is an example of a bug script.
Carrion crawler script
Logic is simple : hold every enemies, then kill them one by one.
If I replace attackreevaluate by attackoneround, it works fine... except that reevaluate would be better if it works!
attackoneround seems to have a problem with monsters. I am not sure yet, but in my test, monsters using attackoneround seem to have a very high thac0.
I tested that a 24hd fire elemental (thac0 0) hitting something with 10 AC
with attackoneround, elemental miss 80% of time
with attackreevaluate, it works fine
Carrion crawler script:
actually, carrion attacks same target untile it dies, even after target is held.
because script is reeavaluate 6 time per second, it should change target once it is held.
I make test putting displaystring before attack, and it was displayed only one time per target
That is why I also had some problems with cast & attack and all my scripts now use attackoneround
IF
CheckStat(SixthNearestEnemyOf(Myself),0,SANCTUARY)
!CheckStatGT(SixthNearestEnemyOf(Myself),0,HELD)
See(SixthNearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END
IF
CheckStat(FifthNearestEnemyOf(Myself),0,SANCTUARY)
!CheckStatGT(FifthNearestEnemyOf(Myself),0,HELD)
See(FifthNearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END
IF
CheckStat(FourthNearestEnemyOf(Myself),0,SANCTUARY)
!CheckStatGT(FourthNearestEnemyOf(Myself),0,HELD)
See(FourthNearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END
IF
CheckStat(ThirdNearestEnemyOf(Myself),0,SANCTUARY)
!CheckStatGT(ThirdNearestEnemyOf(Myself),0,HELD)
See(ThirdNearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END
IF
CheckStat(SecondNearestEnemyOf(Myself),0,SANCTUARY)
!CheckStatGT(SecondNearestEnemyOf(Myself),0,HELD)
See(SecondNearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END
IF
CheckStat(NearestEnemyOf(Myself),0,SANCTUARY)
!CheckStatGT(NearestEnemyOf(Myself),0,HELD)
See(NearestEnemyOf(Myself))
False()
THEN
RESPONSE #100
END
IF
CheckStat(LastSeenBy(Myself),0,SANCTUARY)
!CheckStatGT(LastSeenBy(Myself),0,HELD)
See(LastSeenBy(Myself))
THEN
RESPONSE #100
AttackReevaluate(LastSeenBy(Myself),15)
END
IF
ActionListEmpty()
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),15)
END