Battledale_PRC8/_module/nss/fr_dice_iniative.nss

25 lines
599 B
Plaintext
Raw Permalink Normal View History

void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetAbilityModifier(ABILITY_DEXTERITY,oPC);
if (GetHasFeat(FEAT_IMPROVED_INITIATIVE,oPC))
{
nRank+=4;
}
if (GetHasFeat(FEAT_BLOODED,oPC))
{
nRank+=2;
}
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Initiative";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}