Difference between revisions of "LUA:AddProc"

(LUA Functions: AddProc())
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
= LUA Functions: AddProc() =
+
{{LUAFunction
Adds a proc to the given entity with the given chance to go off
+
|Name = AddProc
 
+
|Description = Adds a proc to the given entity with the given chance to go of
==== Syntax ====
+
|Param1 = Spawn
AddProc(param1, param2, param3, [param4], [param5])
+
|Param1Desc = is the entity who will be getting the proc
 
+
|Param2 = int8
 
+
|Param2Desc = is the type of proc we are adding
==== Parameters ====
+
|Param3 = float
; Required - ''param1'' (Spawn), ''param2'' (int8), ''param3'' (float)
+
|Param3Desc = is the chance the proc has to go off
: ''param1'' is the entity who will be getting the proc
+
|OptionalParam1 = item
: ''param2'' is the type of proc we are adding
+
|OptionalParam1Desc = is the item adding the proc
: ''param3'' is the chance the proc has to go off
+
|OptionalParam2 = int8
; Optional - ''param4'' (Item) ''param5'' (int8)
+
|OptionalParam2Desc = if set to 1 this proc applies to all spell targets (if used in spellscript)
: ''param4'' is the item adding the proc
+
|Example =
: ''param5'' if set to 1 this proc applies to all spell targets (if used in spellscript)
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function equipped(Item, Player)
 
function equipped(Item, Player)
Line 21: Line 18:
 
end
 
end
 
</pre>
 
</pre>
 +
|ExampleDesc = When an item with this script is equipped the player will get an offensive proc with a 8.5% chance to go off
 +
|Notes = This can only be used on an Entity
  
When an item with this script is equipped the player will get an offensive proc with a 8.5% chance to go off
+
This function can only be used in an item or spell script, if used in an item script then the item param must be set
  
== Notes ==
+
=== Types ===
This can only be used on an Entity
 
  
This function can only be used in an item or spell script, if used in an item script then the item param must be set
+
<pre>
 
+
1 PROC_TYPE_OFFENSIVE
;Types
+
2 PROC_TYPE_DEFENSIVE
:1 PROC_TYPE_OFFENSIVE
+
3 PROC_TYPE_PHYSICAL_OFFENSIVE
:2 PROC_TYPE_DEFENSIVE
+
4 PROC_TYPE_PHYSICAL_DEFENSIVE
:3 PROC_TYPE_PHYSICAL_OFFENSIVE
+
5 PROC_TYPE_MAGICAL_OFFENSIVE
:4 PROC_TYPE_PHYSICAL_DEFENSIVE
+
6 PROC_TYPE_MAGICAL_DEFENSIVE
:5 PROC_TYPE_MAGICAL_OFFENSIVE
+
7 PROC_TYPE_BLOCK
:6 PROC_TYPE_MAGICAL_DEFENSIVE
+
8 PROC_TYPE_PARRY
:7 PROC_TYPE_BLOCK
+
9 PROC_TYPE_RIPOSTE
:8 PROC_TYPE_PARRY
+
10 PROC_TYPE_EVADE
:9 PROC_TYPE_RIPOSTE
+
11 PROC_TYPE_HEALING
:10 PROC_TYPE_EVADE
+
12 PROC_TYPE_BENEFICIAL
:11 PROC_TYPE_HEALING
+
13 PROC_TYPE_DEATH
:12 PROC_TYPE_BENEFICIAL
+
14 PROC_TYPE_KILL
:13 PROC_TYPE_DEATH
+
15 PROC_TYPE_DAMAGED
:14 PROC_TYPE_KILL
+
16 PROC_TYPE_DAMAGED_MELEE
:15 PROC_TYPE_DAMAGED
+
17 PROC_TYPE_DAMAGED_MAGIC
:16 PROC_TYPE_DAMAGED_MELEE
+
18 PROC_TYPE_RANGED_ATTACK
:17 PROC_TYPE_DAMAGED_MAGIC
+
19 PROC_TYPE_RANGED_DEFENSE
 +
</pre>
 +
}}

Latest revision as of 12:04, 30 January 2021


LUA:AllFunctions - AddProc

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


Adds a proc to the given entity with the given chance to go of

Syntax

AddProc(param1, param2, param3, [opt param1], [opt param2])

Parameters

Required - param1 (Spawn), param2 (int8), param3 (float)
param1 is the entity who will be getting the proc
param2 is the type of proc we are adding
param3 is the chance the proc has to go off
Optional - opt param1 (item), opt param2 (int8)
opt param1 is the item adding the proc
opt param2 if set to 1 this proc applies to all spell targets (if used in spellscript)

Example

function equipped(Item, Player)
    AddProc(Player, 1, 8.5, Item)
end

When an item with this script is equipped the player will get an offensive proc with a 8.5% chance to go off

Notes

This can only be used on an Entity

This function can only be used in an item or spell script, if used in an item script then the item param must be set

Types

1 PROC_TYPE_OFFENSIVE
2 PROC_TYPE_DEFENSIVE
3 PROC_TYPE_PHYSICAL_OFFENSIVE
4 PROC_TYPE_PHYSICAL_DEFENSIVE
5 PROC_TYPE_MAGICAL_OFFENSIVE
6 PROC_TYPE_MAGICAL_DEFENSIVE
7 PROC_TYPE_BLOCK
8 PROC_TYPE_PARRY
9 PROC_TYPE_RIPOSTE
10 PROC_TYPE_EVADE
11 PROC_TYPE_HEALING
12 PROC_TYPE_BENEFICIAL
13 PROC_TYPE_DEATH
14 PROC_TYPE_KILL
15 PROC_TYPE_DAMAGED
16 PROC_TYPE_DAMAGED_MELEE
17 PROC_TYPE_DAMAGED_MAGIC
18 PROC_TYPE_RANGED_ATTACK
19 PROC_TYPE_RANGED_DEFENSE