Giant Graffiti Posted March 19, 2009 Share Posted March 19, 2009 Is there a way to kill all the enemies in an area? I've found a script to kill the nearest enemy, but that's not really what I'm looking for. Link to comment Share on other sites More sharing options...
Star Admiral Posted March 19, 2009 Share Posted March 19, 2009 Assuming this is for TSL, you can try this: void main() { object oTarget = GetFirstObjectInArea( OBJECT_INVALID, OBJECT_TYPE_CREATURE ); while( GetIsObjectValid( oTarget ) ) { if( GetIsEnemy( oTarget ) ) { AssignCommand( oTarget, ClearAllActions() ); SetCommandable( FALSE, oTarget ); ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDeath( FALSE, TRUE, TRUE ), oTarget, 0.00 ); } oTarget = GetNextObjectInArea( OBJECT_INVALID, OBJECT_TYPE_CREATURE ); } } - Star Admiral Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.