Properties and Functions
Here is a list of all attacker properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples.
|R||Gets the number of opponents who have damaged the character.|
|n||R||Gets the UID of the nth opponent who has damaged the character. (zero-based)|
|CLEAR||R||Clears the attacker list|
|LAST||R||Gets the UID of the opponent who most recently damaged the character.|
|MAX||R||Gets the UID of the opponent who has dealt the most damage to the character.|
|ID||R||Gets the Attacker.number of the specified character, -1 if its not in the attacker list for this character.|
|TARGET||R||Returns the UID of this character's best target with this priorities (Threat -> Distance -> LOS).|
|ADD||W||Add this uid to the attacker list.|
|DELETE||W||Removes this uid from the attacker list|
|n.DAMAGE||RW||Gets or Sets the amount of damage that the nth opponent has dealt to the character. (zero-based)|
|n.ELAPSED||RW||Gets or Sets the length of time since the nth opponent has damaged the character, in seconds. (zero-based)|
|n.UID||R||Gets the UID of the nth opponent who has damaged the character. (zero-based)|
|n.THREAT||RW||Gets or Sets the Threat generated by the enemy to this character, NPCs will attack the character with most Threat in certain Distance when in LOS (Check for TARGET).|
|n.DELETE||W||Remove this opponet from the list.|
The following examples are about attacker.
[Events e_example] On=@Death SERV.LOG Number Of Attacker: <attacker>
You will see number of attacker output to the console.
[EVENTS e_example] ON=@GetHit Serv.Log <src.name> is the attacker number '<attacker.id <src>>' on my list.
[Events e_example] On=@Death SERV.LOG First Attacker: <uid.<attacker.0>.name> SERV.LOG Fourth Attacker: <uid.<attacker.3.uid>.name>
You will see first and fourth attackers output to the concole.
[Events e_example] On=@Death for 0 <eval <ATTACKER>-1> SERV.LOG <eval <DLOCAL._FOR>+1>. Attacker: <uid.<attacker.<dlocal._for>>.name> endfor
You will see all attackers output to the console.
[Events e_example] On=@Death SERV.LOG Last Attacker: <uid.<attacker.last>.name>
You will see last attacker output to the console.
[Events e_example] On=@Death SERV.LOG Max Attacker: <uid.<attacker.max>.name>
You will see the attacker who dealt the most damage to the character output to the console.
[Events e_example] On=@Death ref1=<attacker.target> SERV.LOG My current target is: <ref1.name>
This will output in the console the name of the current best target.
Note: Enabling NPC_AI_THREAT in the ini's npc_ai settings will make characters to check for Threat when looking for targets.
[Events e_example] On=@Death SERV.LOG Damage from first player: <attacker.0.dam>
You will see amount of damage which first attacker has dealt output to the console.
[Events e_example] On=@Death SERV.LOG Attack time of the first player: <attacker.0.elapsed>
You will see the length of time since the first opponent has damaged output to the console.