Difference between revisions of "LlDamage"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{LSL_Function |func_id=|func_sleep=0.0|func_energy=10.0 |func=llDamage|return_type= |p1_type=key|p1_name=target|p1_desc=The key for the task or avatar that will receive damag...")
 
m
Line 4: Line 4:
|p1_type=key|p1_name=target|p1_desc=The key for the task or avatar that will receive damage.
|p1_type=key|p1_name=target|p1_desc=The key for the task or avatar that will receive damage.
|p2_type=float|p2_name=damage|p2_desc=The amount of damage to deliver to the targeted task or avatar.
|p2_type=float|p2_name=damage|p2_desc=The amount of damage to deliver to the targeted task or avatar.
|p3_type=integer|p3_name=damage_tipe|p3_desc=The type of damage to deliver to the targeted task or avatar.
|p3_type=integer|p3_name=damage_type|p3_desc=The type of damage to deliver to the targeted task or avatar.
|func_desc=This function delivers damage to tasks and agent in the same region.
|func_desc=This function delivers damage to tasks and agent in the same region.
|return_text
|return_text

Revision as of 16:59, 22 March 2024

Summary

Function: llDamage( key target, float damage, integer damage_type );

This function delivers damage to tasks and agent in the same region.

• key target The key for the task or avatar that will receive damage.
• float damage The amount of damage to deliver to the targeted task or avatar.
• integer damage_type The type of damage to deliver to the targeted task or avatar.

Specification

KBwarning.png Warning: This function or parameter is part of the Combat2 project and is only available on parts of the beta grid.

The llDamage function triggers a damage event on the targeted task. If any scripts in the target process the on_damage event, they will be fired before the damage is applied or distributed.

Flag Description
DAMAGE_TYPE_GENERIC 0 Generic or legacy damage.
DAMAGE_TYPE_ACID 1 Damage caused by a caustic substance, such as acid.
DAMAGE_TYPE_BLUDGEONING 2 Damage caused by a blunt object, such as a club.
DAMAGE_TYPE_COLD 3 Damage inflicted by exposure to extreme cold.
DAMAGE_TYPE_ELECTRIC 4 Damage caused by electricity.
DAMAGE_TYPE_FIRE 5 Damage inflicted by exposure to heat or flames.
DAMAGE_TYPE_FORCE 6 Damage inflicted by a great force or impact.
DAMAGE_TYPE_NECROTIC 7 Damage caused by a direct assault on life-force.
DAMAGE_TYPE_PIERCING 8 Damage caused by a piercing object such as a bullet, spear, or arrow.
DAMAGE_TYPE_POISON 9 Damage caused by poison.
DAMAGE_TYPE_PSYCHIC 10 Damage caused by a direct assault on the mind.
DAMAGE_TYPE_RADIANT 11 Damage caused by radiation or extreme light.
DAMAGE_TYPE_SLASHING 12 Damage caused by a slashing object such as a sword or axe.
DAMAGE_TYPE_SONIC 13 Damage caused by loud noises, like a Crash Worship concert.
DAMAGE_TYPE_EMOTIONAL 14

Damage types are provided as a convenience and a suggestion. Scripters are free to add custom ones for their own combat systems or repurpose the damage type fields.

Caveats

  • Triggering the damage throttle will shout an error to the debug channel and the script will continue running.
  • The prim containing the script and the prim receiving the damage must both be in damage enable parcels.
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Events

•  on_damage

Functions

•  llDetectedDamage
•  llAdjustDamage

Deep Notes

Search JIRA for related Issues

Signature

function void llDamage( key target, float damage, integer damage_type );