Rather than place this information in the actual database, use a database variable (aka record variable).
#TRIGGER {(*) ~((%d): *~) who is {flanking|facing|behind} you at {melee|missile range}.} {
#ADDKEY critters "%1" %2
}
#TRIGGER {The * begins to advance on you!} {
#VAR critters %null
assess combat
}
The keys in the @critters record variable will be the names; the corresponding values will be the number present.
Troubadour 