81 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
//::///////////////////////////////////////////////
 | 
						|
//:: Associate: On Percieve
 | 
						|
//:: 69_hen_percep
 | 
						|
//:: Copyright (c) 2001 Bioware Corp.
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Created By: Preston Watamaniuk
 | 
						|
//:: Created On: Nov 19, 2001
 | 
						|
//:: Modified: 69MEH69  Sep2004
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
 | 
						|
#include "69_INC_HENAI"
 | 
						|
#include "69_hench_lib"
 | 
						|
 | 
						|
void main()
 | 
						|
{
 | 
						|
    //This is the equivalent of a force conversation bubble, should only be used if you want an NPC
 | 
						|
    //to say something while he is already engaged in combat.
 | 
						|
    if(GetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION))
 | 
						|
    {
 | 
						|
        ActionStartConversation(OBJECT_SELF);
 | 
						|
    }
 | 
						|
 | 
						|
    // * July 2003
 | 
						|
    // * If in Stealth mode, don't attack enemies. Wait for player to attack or
 | 
						|
    // * for you to be attacked. (No point hiding anymore if you've been detected)
 | 
						|
    if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND) && GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH)== FALSE)
 | 
						|
    {
 | 
						|
        //Do not bother checking the last target seen if already fighting
 | 
						|
        if(!GetIsObjectValid(GetAttemptedAttackTarget()) &&
 | 
						|
           !GetIsObjectValid(GetAttackTarget()) &&
 | 
						|
           !GetIsObjectValid(GetAttemptedSpellTarget()))
 | 
						|
        {
 | 
						|
            //Check if the last percieved creature was actually seen
 | 
						|
            if(GetLastPerceptionSeen())
 | 
						|
            {
 | 
						|
                if(GetIsEnemy(GetLastPerceived()))
 | 
						|
                {
 | 
						|
                    SetFacingPoint(GetPosition(GetLastPerceived()));
 | 
						|
                    if(d4(1) == 1)
 | 
						|
                    {
 | 
						|
                     BattleCry(); //In 69_hench_lib
 | 
						|
                    }
 | 
						|
                    HenchmenCombatRound(OBJECT_INVALID);
 | 
						|
                }
 | 
						|
                //Linked up to the special conversation check to initiate a special one-off conversation
 | 
						|
                //to get the PCs attention
 | 
						|
                else if(GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION) && GetIsPC(GetLastPerceived()))
 | 
						|
                {
 | 
						|
                    ActionStartConversation(OBJECT_SELF);
 | 
						|
                }
 | 
						|
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
    else if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND) && GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH))
 | 
						|
    {
 | 
						|
      if(GetLastPerceptionSeen())
 | 
						|
      {
 | 
						|
       object oPC = GetMaster();
 | 
						|
       object oSeen =GetLastPerceived();
 | 
						|
       if(GetIsEnemy(oSeen) && GetLocalInt(OBJECT_SELF,"Scouting") && !GetLocalInt(OBJECT_SELF,"ScoutingReport"))
 | 
						|
       {
 | 
						|
        //ClearAllActions();
 | 
						|
       //SendMessageToPC(oPC, "HenchScout69");
 | 
						|
        HenchScout69(oSeen);
 | 
						|
       }
 | 
						|
       else if((oPC == oSeen) && GetLocalInt(OBJECT_SELF,"ScoutingReport"))
 | 
						|
       {
 | 
						|
        //SendMessageToPC(oPC, "HenchReport69");
 | 
						|
        HenchReport69(oPC);
 | 
						|
       }
 | 
						|
      }
 | 
						|
    }
 | 
						|
    if(GetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT))
 | 
						|
    {
 | 
						|
        SignalEvent(OBJECT_SELF, EventUserDefined(1002));
 | 
						|
    }
 | 
						|
}
 | 
						|
 |