The getZoneWithFlags native AI script function is used to retrieve the name of a randomly chosen zone that matches specified flags.
(Zone: s)getZoneWithFlags(OneOf: s, Mandatory: s, ExceptZone: s) // getZoneWithFlags_sss_s
(Zone: s)getZoneWithFlags(OneOf: s, Mandatory: s, ExceptZone: s, ExceptProperties: s) // getZoneWithFlags_ssss_s
($zone)getZoneWithFlags("food|rest", "invasion|outpost", $oldzone); // Get a zone which matches invasion, outpost and either food or rest flags with the best score except $oldzone.
($zone)getZoneWithFlags("boss", "", $oldzone); // Get a zone which matches boss flag with the best score except the $oldzone.
In these examples, the getZoneWithFlags
function is called to retrieve the name of a zone. The first example retrieves a zone that matches at least one of the 'food' or 'rest' flags, and all of the 'invasion' or 'outpost' flags. The returned zone cannot be the zone named $oldzone
. The second example retrieves a zone that matches the 'boss' flag. The returned zone cannot be the zone named $oldzone
.
If the ExceptProperties
parameter is specified, the selected zone cannot have any of the flags listed.