Difference between revisions of "LUA:AddSpellBonus"

 
Line 1: Line 1:
= LUA Functions: AddSpellBonus() =
+
{{LUAFunction
Adds to the stats of the given spawn.
+
|Name = AddSpellBonus
 
+
|Description = Adds to the stats of the given spawn.
 
+
|Param1 = Spawn
==== Syntax ====
+
|Param1Desc = is the spawn to receive the stat boost
AddSpellBonus(param1, param2, param3, [...])
+
|Param2 = int16
 
+
|Param2Desc = is the type (id) of the stat
 
+
|Param3 = sint32
==== Parameters ====
+
|Param3Desc = is the amount to add
; Required - ''param1'' (Spawn), ''param2'' (int16), ''param3'' (sint32)
+
|OptionalParam1 = int32
: ''param1'' is the spawn to receive the stat boost
+
|OptionalParam1Desc = is a list of class id's that the bonus can apply to
: ''param2'' is the type (id) of the stat
+
|Example =
: ''param3'' is the amount to add
 
; Optional - ''...'' (int32)
 
: ''...'' is a list of class id's that the bonus can apply to
 
 
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function cast(Caster, Target)
 
function cast(Caster, Target)
Line 22: Line 16:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Adds 12 str to the caster.
Adds 12 str to the caster.
+
|Notes = If used in a spell script the target param (param1) will be overwritten with the spells targets.
 
 
 
 
== Notes ==
 
If used in a spell script the target param (''param1'') will be overwritten with the spells targets.
 
  
 
To give a buff to all but fighters it would be AddSpellBonus(Target, 0, 12, 11, 21, 31), 11 is priests, 21 is mages, and 31 is scouts
 
To give a buff to all but fighters it would be AddSpellBonus(Target, 0, 12, 11, 21, 31), 11 is priests, 21 is mages, and 31 is scouts
 +
}}

Latest revision as of 12:09, 30 January 2021


LUA:AllFunctions - AddSpellBonus

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


Adds to the stats of the given spawn.

Syntax

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

Parameters

Required - param1 (Spawn), param2 (int16), param3 (sint32)
param1 is the spawn to receive the stat boost
param2 is the type (id) of the stat
param3 is the amount to add
Optional - opt param1 (int32)
opt param1 is a list of class id's that the bonus can apply to

Example

function cast(Caster, Target)
    AddSpellBonus(Caster, 0, 12)
end

Adds 12 str to the caster.

Notes

If used in a spell script the target param (param1) will be overwritten with the spells targets.

To give a buff to all but fighters it would be AddSpellBonus(Target, 0, 12, 11, 21, 31), 11 is priests, 21 is mages, and 31 is scouts