JS functions
Do action for every nearby enemy
for_each_nearby_enemy(entity, radius, function(entity} { .. })
-
Parameters:
- entity - An entity which we search for its enemies
- range - Maximal search range
- consumer - callback
Changes default value of a property. Must be called during pre initialization (within scripts folder) in order to have any affect.
set_property_default_value("my_property_mult", 0);
-
Parameters:
- string - property name
- float - default value
Returns a list of nearby allies
for_each_nearby_ally(entity, radius, function(ally} { ... } )
-
Parameters:
- entity - allies for the entity
- radius
- allyEntity - callback
Puts a task into a scheduled execution
delay(function() { ... }, delay)
-
Parameters:
- function - code to run later
- delay - time in milliseconds
Returns a list of nearby allies
var list = nearby_allies(entity, radius)
-
Parameters:
- entity - allies for the entity
- radius
Returns current enemy entity in crosshair
var target = targeted_enemy(entity, range)
-
Parameters:
- entity - An entity which we search for its enemies
- range - Maximal search range
- @returns - An entity instance or null
Damaging an Entity
damage(caster, target, damage, context)
-
Parameters:
- caster - Entity of damage origin
- target - Entity to be damaged
- damage - damage value
- context - skill context
- @returns - true if the damage was dealt
Returns a float value of a skill node.
The returned value is a sum of initial value X and skill level * X_levelbonus nodes
param(node, context)
-
Parameters:
- node - setting string key
- context - skill context
- @returns - float value
Applies an effect to a specifc entity, each effect has different constructor parameters
apply_effect(effect, target, context)
-
Parameters:
- effect - The effect to be applied
- target - Entity to consume the effect
- context - skill context
Sends a text message to all players on the server
broadcast_all("&4Some colored text")
-
Parameters:
Sends a text message to all players in a radius around target
broadcast_nearby(location,radius,"&4Some colored text")
-
Parameters:
- location - Origin
- radius - An integer
Spawns a lightning at a specific location
spawn_lightning(location)
-
Parameters:
- location - Origin
- radius - An integer
Heals an entity
heal(target, amount, context)
-
Parameters:
- target - Entity to be healed
- amount - Amount of HP to be healed, amount > 0
- context - skill context
Returns entity location
get_location(player_or_entity)
-
Parameters:
- entity - An entitz
- @return - location object
Adds potion effect to the entity
add_potion_effect(target, builder)
-
Parameters:
- target - An entitz
- builder - potion effect builder
Converts a time to ingame interval represented in server ticks, conversion is not taking into account server lag
to_server_ticks(100, timeunit)
-
Parameters:
- number - time to be converted
- timeunit - an enum value of TimeUnit
Returns an instance of PotionEffectBuilder
var builder = potion_effect_builder("potioneffectid")
- Parameters: