include library.ai_lib; include library.factions; include library.chat; include ai.ai_combat; include library.pet_lib; include library.colors; include library.group; include library.healing; const string ALERT_VOLUME_NAME = "alertTriggerVolume"; trigger OnTriggerVolumeEntered( string volumeName, obj_id breacher ) { //droids ignore everything return SCRIPT_OVERRIDE; } trigger OnTriggerVolumeExited( string volumeName, obj_id breacher ) { //droids ignore everything: return SCRIPT_OVERRIDE; } trigger OnLoiterWaiting(modifiable_float time) { return SCRIPT_OVERRIDE; } trigger OnBehaviorChange( int newBehavior, int oldBehavior, int[] changeFlags ) { if ( ai_lib.isAiDead( self) ) return SCRIPT_CONTINUE; if ( ai_lib.isInCombat( self ) ) return SCRIPT_CONTINUE;//you probably don't want to do anything if you are in combat //don't put code in this trigger. Put it in doCalmerBehavior or doAgitated behavior // this is hard enough to read already: if ( newBehavior <= oldBehavior ) { if ( doCalmerBehavior( self, newBehavior, oldBehavior ) == SCRIPT_CONTINUE) return SCRIPT_CONTINUE; else return SCRIPT_OVERRIDE; } else { if ( doAgitatedBehavior( self, newBehavior, oldBehavior) == SCRIPT_CONTINUE ) return SCRIPT_CONTINUE; else return SCRIPT_OVERRIDE; } } int doCalmerBehavior( obj_id npc, int newBehavior, int oldBehavior ) { //You are now calming down. //return SCRIPT_OVERRIDE to stomp on default behaviors: switch ( newBehavior ) { case BEHAVIOR_CALM: //going from More Agitated to Calm messageTo( npc, "resumeDefaultCalmBehavior", null, 5, false ); break; case BEHAVIOR_ALERT: //going from More Agitated to Alert // Your code goes here. break; case BEHAVIOR_THREATEN: //going from More Agitated to Threaten // Your code goes here. break; case BEHAVIOR_FLEE: //going from More Agitated to Flee // Your code goes here. break; case BEHAVIOR_PANIC: //going from More Agitated to Panic // Your code goes here. break; case BEHAVIOR_ATTACK: //Going from More Agitated to Attack // Your code goes here. break; case BEHAVIOR_FRENZY: //This is impossible. break; default : // This is an error break; } return SCRIPT_OVERRIDE; } int doAgitatedBehavior( obj_id npc, int newBehavior, int oldBehavior ) { //You are becoming more Fearful or more Angry // return SCRIPT_OVERRIDE to stomp on default behaviors: switch ( newBehavior ) { case BEHAVIOR_CALM: //this is impossible break; case BEHAVIOR_ALERT: //going from Calmer to Alert // Your code goes here. break; case BEHAVIOR_THREATEN: //going from Calmer to Threaten // Your code goes here. break; case BEHAVIOR_FLEE: //going from Calmer to Flee // Your code goes here. break; case BEHAVIOR_PANIC: //Going from Calmer to Panic // Your code goes here. break; case BEHAVIOR_ATTACK: //Going from Calmer to Attack // Your code goes here. break; case BEHAVIOR_FRENZY: //going from Calmer to Frenzy break; default : // This is an error break; } return SCRIPT_OVERRIDE; } /* -----------------8/1/2002 9:42PM------------------ * COMBAT: * --------------------------------------------------*/ messageHandler lairThreatened() { return SCRIPT_OVERRIDE; }