/** * * Title: antagonist.script * Description: antagonist object script: POI = gangwar */ //------------------------------------------------ // Includes //------------------------------------------------ include library.ai_lib; include library.scenario; include library.poi; include library.pclib; include ai.ai_combat; //----------------------------------------------- // Inherits //----------------------------------------------- inherits poi.base.scenario_actor; //------------------------------------------------ // Constants //------------------------------------------------ const string SCRIPT_CONVERSE = "npc.converse.npc_converse_menu"; const string LOG_NAME = "poiTuskenAttack Antagonist"; //------------------------------------------------ // Methods //------------------------------------------------ //------------------------------------------------ // OnAttach //------------------------------------------------ trigger OnAttach() { detachScript( self, SCRIPT_CONVERSE ); return SCRIPT_CONTINUE; } //------------------------------------------------ // OnIncapacitated //------------------------------------------------ trigger OnIncapacitated( obj_id killer ) { // Get reference to base. obj_id poiMaster = poi.getBaseObject( self ); if ( (poiMaster == null) || (poiMaster == obj_id.NULL_ID) ) return SCRIPT_CONTINUE; messageTo( poiMaster, scenario.HANDLER_ACTOR_DEATH, null, 0, false ); return SCRIPT_CONTINUE; } //------------------------------------------------ // OnTriggerVolumeEntered //------------------------------------------------ trigger OnTriggerVolumeEntered( string volumeName, obj_id breacher ) { return SCRIPT_OVERRIDE; } //------------------------------------------------ // vocalizeEndCombat // // Find a new target once ours is dead. //------------------------------------------------ messageHandler vocalizeEndCombat() { // Don't do this if dead or in combat. if ( ai_lib.isDead( self ) || ai_lib.isInCombat( self )) return SCRIPT_OVERRIDE; // Kill players that are down. obj_id[] players = getPlayerCreaturesInRange(self, 80f); for ( int i = 0; i < players.length; i++ ) { if ( isIncapacitated( players[i] ) && getPosture( players[i] ) != POSTURE_DEAD ) { pclib.coupDeGrace( players[i], self ); return SCRIPT_OVERRIDE; } } // Get base object reference. obj_id poiMaster = poi.getBaseObject(self); if ( (poiMaster == null) || (poiMaster == obj_id.NULL_ID) ) return SCRIPT_CONTINUE; // Find a new target. obj_id[] mediators = scenario.getTeamMembers( poiMaster, "mediator" ); for ( int i=0; i