Something like this?
int AbilityCheck(object oPC,int iAbility, int iDC)
{
int iABResult =FALSE;
int iRoll = d20(1);
int iAb_mod =GetAbilityModifier(iAbility,oPC);
int iResult = iRoll+iAb_mod;
if(iResult>=iDC)iABResult=TRUE;
return iABResult;
}
/*
int ABILITY_STRENGTH = 0; // should be the same as in nwseffectlist.cpp
int ABILITY_DEXTERITY = 1;
int ABILITY_CONSTITUTION = 2;
int ABILITY_INTELLIGENCE = 3;
int ABILITY_WISDOM = 4;
int ABILITY_CHARISMA = 5;
Use these for variable type
*/
int StartingConditional()
{
int iResult;
int iAb_type = GetLocalInt(OBJECT_SELF,"AbilityCheckTyp");
//Fix for 0
if(iAb_type==-1)iAb_type=ABILITY_STRENGTH;
int iDC = GetLocalInt(OBJECT_SELF,"AbilityCheck");
iResult = AbilityCheck(GetPCSpeaker(),iAb_type,iDC);
return iResult;
}
Modifié par ShadowM, 20 mai 2012 - 09:47 .