// This function returns the target for this combat round.
// Normally, this will be the same target as the last round.
// The only time this changes is if the target is gone/killed
// or they are in dying mode.
object bkAcquireTarget()
{
object oLastTarget = GetAttackTarget();
int n;
// * for now no 'target switching' other
// * than what occurs in the OnDamaged and OnPerceived events
// * (I may roll their functionality into this function
if (GetIsObjectValid(oLastTarget) == TRUE
&& !GetAssociateState(NW_ASC_MODE_DYING, oLastTarget))
{
// ajout d'un test sur la perception qui semble absent ailleurs...
if( GetObjectSeen(oLastTarget) ){
n=0; //SpeakString("see Target") ;
}else{ if( GetObjectHeard(oLastTarget) ){
n=0; //SpeakString("hear Target") ;
}else{
SendMessageToAllDMs(GetName(OBJECT_SELF)+"do not see/hear Target") ;
if( GetIsPC(oLastTarget) ) SendMessageToPC(oLastTarget,GetName(OBJECT_SELF)+" vous a perdu de vue.");
ClearAllActions(TRUE) ;
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.5);
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.5);
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 0.5);
ActionMoveToLocation(GetLocation(oLastTarget));
oLastTarget = ChooseNewTarget();
}
}
// fin de l'ajout
return oLastTarget;
} else {
oLastTarget = ChooseNewTarget();
}
// * If no valid target it means no enemies are nearby, resume normal behavior
// Normally, this will be the same target as the last round.
// The only time this changes is if the target is gone/killed
// or they are in dying mode.
object bkAcquireTarget()
{
object oLastTarget = GetAttackTarget();
int n;
// * for now no 'target switching' other
// * than what occurs in the OnDamaged and OnPerceived events
// * (I may roll their functionality into this function
if (GetIsObjectValid(oLastTarget) == TRUE
&& !GetAssociateState(NW_ASC_MODE_DYING, oLastTarget))
{
// ajout d'un test sur la perception qui semble absent ailleurs...
if( GetObjectSeen(oLastTarget) ){
n=0; //SpeakString("see Target") ;
}else{ if( GetObjectHeard(oLastTarget) ){
n=0; //SpeakString("hear Target") ;
}else{
SendMessageToAllDMs(GetName(OBJECT_SELF)+"do not see/hear Target") ;
if( GetIsPC(oLastTarget) ) SendMessageToPC(oLastTarget,GetName(OBJECT_SELF)+" vous a perdu de vue.");
ClearAllActions(TRUE) ;
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.5);
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.5);
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 0.5);
ActionMoveToLocation(GetLocation(oLastTarget));
oLastTarget = ChooseNewTarget();
}
}
// fin de l'ajout
return oLastTarget;
} else {
oLastTarget = ChooseNewTarget();
}
// * If no valid target it means no enemies are nearby, resume normal behavior