public static short GetHitPointsPNP(NWN2CreatureTemplate creature) { int maxHP = CalcMaxHitpointsFromHitDice(creature) / 2; int newHP = (int)((float)maxHP / (float)creature.GetStatsCore().GetLevel() / 2); newHP += creature.GetStatsCore().CalcHitPointModsFromFeats(1); newHP += CalcHitPointModsFromStats(creature); return (short)newHP; }
public static short GetHitPointsMax(NWN2CreatureTemplate creature) { int newHP = CalcMaxHitpointsFromHitDice(creature); newHP += creature.GetStatsCore().CalcHitPointModsFromFeats(1); newHP += CalcHitPointModsFromStats(creature); return (short)newHP; }
public static bool GetIsConstruct(NWN2CreatureTemplate creature) { if (creature.Variables.GetVariable("ACR_CRE_ISCONSTRUCT").ValueInt == 1) return true; if (creature.Variables.GetVariable("ACR_CRE_ISCONSTRUCT").ValueInt == 2) return false; if (creature.Race.Row == 10) return true; if (creature.GetStatsCore().GetHasClass(13) == 1) return true; return false; }
public static bool GetIsUndead(NWN2CreatureTemplate creature) { if (creature.Variables.GetVariable("ACR_CRE_ISUNDEAD").ValueInt == 1) return true; if (creature.Variables.GetVariable("ACR_CRE_ISUNDEAD").ValueInt == 2) return false; if (creature.Race.Row == 24) return true; if (creature.GetStatsCore().GetHasClass(19) == 1) return true; return false; }
public static int CalcHitPointModsFromStats(NWN2CreatureTemplate creature) { if (GetIsUndead(creature)) return 0; if (GetIsConstruct(creature)) return 0; return creature.GetStatsCore().CalcHitPointModsFromStats(); }
public static int CalcMaxHitpointsFromHitDice(NWN2CreatureTemplate creature) { if (GetIsUndead(creature)) return creature.GetStatsCore().GetLevel() * 12; return creature.GetStatsCore().CalcMaxHitpointsFromHitDice(); }