Difference between revisions of "LUA:AddSkillBonus"

(Created page with "= LUA Functions: AddSkillBonus() = Adds a bonus to the given skill ==== Syntax ==== AddSkillBonus(param1, param2, param3) ==== Parameters ==== ; Required - ''param1'' (Spawn)...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
= LUA Functions: AddSkillBonus() =
+
{{LUAFunction
Adds a bonus to the given skill
+
|Name = AddSkillBonus
 
+
|Description = Adds a bonus to the given skill
 
+
|Param1 = Spawn
==== Syntax ====
+
|Param1Desc = is the spawn receiving the bonus
AddSkillBonus(param1, param2, param3)
+
|Param2 = int32
 
+
|Param2Desc = is the skill id
 
+
|Param3 = sint32
==== Parameters ====
+
|Param3Desc = is the bonus value
; Required - ''param1'' (Spawn), ''param2'' (int32), ''param3'' (sint32)
+
|Example =
: ''param1'' is the spawn receiving the bonus
 
: ''param2'' is the skill id
 
: ''param3'' is the bonus value
 
 
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function cast(Caster, Target)
 
function cast(Caster, Target)
Line 20: Line 14:
 
end
 
end
 
</pre>
 
</pre>
 +
|ExampleDesc = Adds 15 points to skill 1 to the caster of the spell.
 +
|Notes = param2 refers to the skills table in the DB.
  
Adds 15 points to skill 1 to the caster of the spell.
+
If this function is used in a spell script the target param (param1) will be overwritten by the code to use the spells targets.
 
+
}}
 
 
== Notes ==
 
''param2'' refers to the skills table in the DB.
 

Latest revision as of 12:14, 30 January 2021


LUA:AllFunctions - AddSkillBonus

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


Adds a bonus to the given skill

Syntax

AddSkillBonus(param1, param2, param3)

Parameters

Required - param1 (Spawn), param2 (int32), param3 (sint32)
param1 is the spawn receiving the bonus
param2 is the skill id
param3 is the bonus value


Example

function cast(Caster, Target)
    AddSkillBonus(Caster, 1, 15)
end

Adds 15 points to skill 1 to the caster of the spell.

Notes

param2 refers to the skills table in the DB.

If this function is used in a spell script the target param (param1) will be overwritten by the code to use the spells targets.