Roleplay Redux
This library will not function if your server doesn't have the Roleplay Redux mod installed.
Roll function
Syntax:
int RPR.Roll( Character player, string skill [, int modifier = 0, bool show = false, string comment = "" ] )GetSkill function
Syntax:
int, int RPR.GetSkill( Character player, string skill )GetStat function
Syntax:
int, int RPR.GetStat( Character player, string stat )HasPerk function
Syntax:
bool RPR.HasPerk( Character player, string perk )AddPerk function
Syntax:
bool RPR.AddPerk( Character player, string perk )RemovePerk function
Syntax:
bool RPR.RemovePerk( Character player, string perk )ModifySkill function
Syntax:
bool RPR.ModifySkill( Character player, string skill, int modifier )ModifyStat function
Syntax:
bool RPR.ModifyStat( Character player, string stat, int modifier )SetStat function
Syntax:
bool RPR.SetStat( Character player, string stat, int value )SetStatMax function
Syntax:
bool RPR.SetStatMax( Character player, string stat, int value )HasRune function
Syntax:
bool RPR.HasRune( Character player, int itemId )HasBuff function
Syntax:
bool RPR.HasBuff( Character player, string category )RemoveBuff function
Syntax:
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:
bool RPR.GiveBuff( Character player, string category, int buffType [, string target = category, int modifier = 0, int duration = -1, int delay = 0 ] )BuffSkill function
Syntax:
bool RPR.BuffSkill( Character player, string category, string skill, int modifier [, int duration = -1 ] )BuffStat function
Syntax:
bool RPR.BuffStat( Character player, string category, string stat, int modifier [, int duration = -1 ] )BuffPerk function
Syntax:
bool RPR.BuffPerk( Character player, string category, string perk [, int duration = -1 ] )BuffAbility function
Syntax:
bool RPR.BuffAbility( Character player, string category, string ability [, int duration = -1 ] )BuffStatus function
Syntax:
bool RPR.BuffStatus( Character player, string category, string status [, int duration = -1 ] )HasItem function
Syntax:
bool RPR.HasItem( Character player, int itemId [, int quantity = 1 ] )TakeItem function
Syntax:
void RPR.TakeItem( Character player, int itemId [, int quantity = 1 ] )GiveItem function
Syntax:
void RPR.GiveItem( Character player, int itemId [, int quantity = 1 ] )GetBuffs function
Syntax:
table<string> RPR.GetBuffs( Character player )GetSheet function
Syntax:
CharacterSheet RPR.GetSheet( Character player )ResetSheet function
Syntax:
bool RPR.ResetSheet( Character player )ExportSheet function
Syntax:
string RPR.ExportSheet( Character player )ImportSheet function
Syntax:
bool RPR.ImportSheet( Character player, string data )HasSpell function
Syntax:
bool RPR.HasSpell( Character player, string spell )LearnSpell function
Syntax:
bool RPR.LearnSpell( Character player, string spell )ForgetSpell function
Syntax:
bool RPR.ForgetSpell( Character player, string spell )Refresh function
Force RPR side panel to refresh for specific player.
Syntax:
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:
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:
table<int>, table<int> RPR.GetEquippedRunes( Character player )SetEquippedRunes function
Forces a list of rune IDs to be equipped, replacing currently equipped runes.
Syntax:
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.
GetUserStatus function
Retrieves the custom status set by a user in RPR's Bio tab.
Syntax:
string, Color RPR.GetUserStatus( Character player )SetUserStatus function
Replaces the custom status in RPR's Bio tab and on nameplate.
Syntax:
void RPR.SetUserStatus( Character player, string name, Color color )GetBio function
Syntax:
table RPR.GetBio( Character player )| Field | Type |
|---|---|
shortDesc | string |
longDesc | string |
renown | string |
portrait | string |
GetConsents function
Syntax:
table RPR.GetConsents( Character player )| Field | Type |
|---|---|
answers | table<string> |
choices | table<table<int>> |
Both fields are tables indexed by IDs, they might not be sequential.