Avorion Script API Documentation

Durability

function Durability(var id)

Parameters

id The id of the entity this component belongs to, or the entity itself, must be an id of an existing entity or nil for the entity in the current script context

Returns

A new instance of Durability

property double damageFactor
property double durability
property Entity entity[read-only]
property uuid entityId[read-only]
property float filledPercentage[read-only]
property float invincibility
property bool invincible
property bool logoutInvincible[read-only]
property float maxDurabilityFactor
property double maximum
property float respawnInvincibilityTime
property bool respawnInvincible[read-only]

function var addFactionImmunity(int index)

Adds a temporary immunity to a faction. This immunity will be not be saved to database for security reasons. When an entity is immune to a faction, it can't be healed or damaged by shots or damage that can be traced back to that faction.

Parameters

index Index of the faction the immunity should apply to

Returns

nothing

function var, var getWeakness()

function var healDamage(double amount, Uuid inflictorId)

Returns

nothing

function var inflictDamage(double amount, DamageSource damageSource, DamageType damageType, Uuid inflictorId)

Returns

nothing

function bool isImmuneToEntity(Uuid index)

Checks if the Entity is immune to another entity. This is true if the other entity belongs to a faction that the When an entity is immune to a faction, it can't be healed or damaged by shots or damage that can be traced back to that faction.

Parameters

index Index of the faction the immunity should apply to

function bool isImmuneToFaction(int index)

Checks if the Entity is immune to a faction.

Parameters

index Index of the faction

function var removeFactionImmunity(int index)

Removes a temporary immunity to a faction. When an entity is immune to a faction, it can't be healed or damaged by shots or damage that can be traced back to that faction.

Parameters

index Index of the faction the immunity should apply to

Returns

nothing

function var resetMalus()

Returns

nothing

function var resetWeakness()

Returns

nothing

function var setMalusFactor(float in, DurabilityMalusReason reason)

Returns

nothing

function var setWeakness(DamageType damageType, float factor)

Returns

nothing

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7