Skip to content

Roleplay Redux

This library will not function if your server doesn't have the Roleplay Redux mod installed.

Roll function

Syntax:

lua
int RPR.Roll( Character player, string skill [, int modifier = 0, bool show = false, string comment = "" ] )

GetSkill function

Syntax:

lua
int, int RPR.GetSkill( Character player, string skill )

GetStat function

Syntax:

lua
int, int RPR.GetStat( Character player, string stat )

HasPerk function

Syntax:

lua
bool RPR.HasPerk( Character player, string perk )

AddPerk function

Syntax:

lua
bool RPR.AddPerk( Character player, string perk )

RemovePerk function

Syntax:

lua
bool RPR.RemovePerk( Character player, string perk )

ModifySkill function

Syntax:

lua
bool RPR.ModifySkill( Character player, string skill, int modifier )

ModifyStat function

Syntax:

lua
bool RPR.ModifyStat( Character player, string stat, int modifier )

SetStat function

Syntax:

lua
bool RPR.SetStat( Character player, string stat, int value )

SetStatMax function

Syntax:

lua
bool RPR.SetStatMax( Character player, string stat, int value )

HasRune function

Syntax:

lua
bool RPR.HasRune( Character player, int itemId )

HasBuff function

Syntax:

lua
bool RPR.HasBuff( Character player, string category )

RemoveBuff function

Syntax:

lua
bool RPR.RemoveBuff( Character player, string category )

GiveBuff function

To understand buff types and other arguments, please refer to Tot API docs.

Alternatively you can use BuffSkill, BuffStat, BuffPerk, BuffAbility, BuffStatus.

All of those are aliases for this function.

Syntax:

lua
bool RPR.GiveBuff( Character player, string category, int buffType [, string target = category, int modifier = 0, int duration = -1, int delay = 0 ] )

BuffSkill function

Syntax:

lua
bool RPR.BuffSkill( Character player, string category, string skill, int modifier [, int duration = -1 ] )

BuffStat function

Syntax:

lua
bool RPR.BuffStat( Character player, string category, string stat, int modifier [, int duration = -1 ] )

BuffPerk function

Syntax:

lua
bool RPR.BuffPerk( Character player, string category, string perk [, int duration = -1 ] )

BuffAbility function

Syntax:

lua
bool RPR.BuffAbility( Character player, string category, string ability [, int duration = -1 ] )

BuffStatus function

Syntax:

lua
bool RPR.BuffStatus( Character player, string category, string status [, int duration = -1 ] )

HasItem function

Syntax:

lua
bool RPR.HasItem( Character player, int itemId [, int quantity = 1 ] )

TakeItem function

Syntax:

lua
bool RPR.TakeItem( Character player, int itemId [, int quantity = 1 ] )

GiveItem function

Syntax:

lua
bool RPR.GiveItem( Character player, int itemId [, int quantity = 1 ] )

GetBuffs function

Syntax:

lua
table<string> RPR.GetBuffs( Character player )

GetSheet function

Syntax:

lua
CharacterSheet RPR.GetSheet( Character player )

ResetSheet function

Syntax:

lua
bool RPR.ResetSheet( Character player )

ExportSheet function

Syntax:

lua
string RPR.ExportSheet( Character player )

ImportSheet function

Syntax:

lua
bool RPR.ImportSheet( Character player, string data )

HasSpell function

Syntax:

lua
bool RPR.HasSpell( Character player, string spell )

LearnSpell function

Syntax:

lua
bool RPR.LearnSpell( Character player, string spell )

ForgetSpell function

Syntax:

lua
bool RPR.ForgetSpell( Character player, string spell )

Refresh function

Force RPR side panel to refresh for specific player.

Syntax:

lua
void RPR.Refresh( Character player )

GetAbilities function

Retrieves a list of all abilities in the RPR system.

A table is returned, containing ReduxAbility objects. If the keyed argument is set to true, then ability IDs will be used as table keys, otherwise the table is sequential by default.

Syntax:

lua
table<ReduxAbility> RPR.GetAbilities( [ bool keyed = false ] )

GetEquippedRunes function

Returns two tables. First one corresponds to item template IDs of the equipped runes while the other one corresponds to RPR rune IDs. Both tables are sequential and their indexes should correspond to each other, however this is not guaranteed.

Syntax:

lua
table<int>, table<int> RPR.GetEquippedRunes( Character player )

SetEquippedRunes function

Forces a list of item IDs to be equipped, replacing currently equipped runes.

Syntax:

lua
void RPR.SetEquippedRunes( Character player, table<int> runes )

WARNING

Be super careful with this function when using it inside RPR_updateRunes event, as that could easily lead into infinite loop and slow down or even crash the server.