
Prototype: GemRB.ApplyEffect(PartyID, opcode, param1, param2[, resref])

Description: Creates a basic effect and applies it on the player character
marked by PartyID.
This function could be used to add stats that are stored in effect blocks.

Parameters:
PartyID           - the player character's index in the party
opcode            - the effect opcode (for values see effects.ids)
param1            - parameter 1 for the opcode
param2            - parameter 2 for the opcode
resref            - optional resource reference to set in effect

Return value: N/A

Example:
        for i in range(ProfCount-8):
                StatID = GemRB.GetTableValue(TmpTable, i+8, 0)
                Value = GemRB.GetVar ("Prof "+str(i) )
                if Value:
                        GemRB.ApplyEffect (MyChar, "Proficiency", Value, StatID )

The above example sets the weapon proficiencies in a bg2's CharGen9.py script.

See also: SpellCast, SetPlayerStat, GetPlayerStat, CountEffects

