You are viewing an old version of this page. Return to the latest version.
Difference between revisions of "LUA:AddProc"
(→LUA Functions: AddProc()) |
|||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | = | + | {{LUAFunction |
| − | Adds a proc to the given entity with the given chance to go | + | |Name = AddProc |
| − | + | |Description = Adds a proc to the given entity with the given chance to go of | |
| − | = | + | |Param1 = Spawn |
| − | + | |Param1Desc = is the entity who will be getting the proc | |
| − | + | |Param2 = int8 | |
| − | + | |Param2Desc = is the type of proc we are adding | |
| − | = | + | |Param3 = float |
| − | + | |Param3Desc = is the chance the proc has to go off | |
| − | + | |OptionalParam1 = item | |
| − | + | |OptionalParam1Desc = is the item adding the proc | |
| − | + | |OptionalParam2 = int8 | |
| − | + | |OptionalParam2Desc = if set to 1 this proc applies to all spell targets (if used in spellscript) | |
| − | + | |Example = | |
| − | |||
| − | |||
| − | |||
<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 | ||
| − | + | 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 === |
| − | |||
| − | + | <pre> | |
| − | + | 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 | |
| + | </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