Difference between revisions of "GetLastAttacker"

From NWN Lexicon
Jump to: navigation, search
(Created page with " =GetLastAttacker(object)= Determine who last attacked a creature, door or placeable object. object  GetLastAttacker(     [[object | object ]...")
 
Line 7: Line 7:
 
Determine who last attacked a creature, door or placeable object.
 
Determine who last attacked a creature, door or placeable object.
  
 +
<nwscript>
 
  [[object | object ]] GetLastAttacker(
 
  [[object | object ]] GetLastAttacker(
 
      [[object | object ]] oAttackee = OBJECT_SELF
 
      [[object | object ]] oAttackee = OBJECT_SELF
 
  );
 
  );
 +
</nwscript>
  
 
====Parameters====
 
====Parameters====

Revision as of 20:42, 25 August 2012



GetLastAttacker(object)

Determine who last attacked a creature, door or placeable object.

 [[object | object ]] GetLastAttacker(
     [[object | object ]] oAttackee = OBJECT_SELF
 );

Parameters

oAttackee

Attacked object. (Default: OBJECT_SELF)


Description

Returns the last attacker of oAttackee. This should be used ONLY in the OnPhysicalAttacked events for creatures, placeables and doors.
Return OBJECT_INVALID on error.



Remarks

Remarks: I cannot for the life of me figure out why the description for this function says it should only be called from OnPhysicalAttacked. I’ve tried calling it from all sorts of events, even some not owned by the creature, and all of them work just fine, even a while after I’ve stopped attacking oAttackee.


Version

1.30

See Also

functions: 

GetTotalDamageDealt

events: 

OnPhysicalAttacked Event



 author: Jason Harris, editor: Lilac Soul, additional contributor(s): Lilac Soul