Difference between revisions of "ATTACKER"
(→Examples) |
(→Properties and Functions) |
||
(One intermediate revision by the same user not shown) | |||
Line 22: | Line 22: | ||
|- | |- | ||
| [[TARGET]] || R || Returns the UID of this character's best target with this priorities (Threat -> Distance -> LOS). | | [[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''.[[DAMAGE]] || RW || Gets or Sets the amount of damage that the nth opponent has dealt to the character. (zero-based) | ||
Line 30: | Line 34: | ||
|- | |- | ||
| ''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''.[[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. | ||
|} | |} | ||
Latest revision as of 09:49, 2 May 2014
Contents
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.
This parameters must use with ATTACKER. For examples, please go Examples.
ATTACKER.key | Read/Write | Description |
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. |
Examples
The following examples are about attacker.
ATTACKER
[Events e_example] On=@Death SERV.LOG Number Of Attacker: <attacker>
You will see number of attacker output to the console.
'ATTACKER[.ID]
[EVENTS e_example] ON=@GetHit Serv.Log <src.name> is the attacker number '<attacker.id <src>>' on my list.
ATTACKER.n[.UID]
[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.
OR
[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.
ATTACKER.LAST
[Events e_example] On=@Death SERV.LOG Last Attacker: <uid.<attacker.last>.name>
You will see last attacker output to the console.
ATTACKER.MAX
[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.
ATTACKER.TARGET
[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.
ATTACKER.n.DAMAGE
[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.
ATTACKER.n.ELAPSED
[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.