90 lines
2.8 KiB
Plaintext
90 lines
2.8 KiB
Plaintext
#include "nwnx_creature"
|
|
#include "nwnx_object"
|
|
#include "dbg_inc"
|
|
//const int RACIAL_TYPE_WEMIC = 51;
|
|
//const int RACIAL_TYPE_BROWNIE = 53;
|
|
int cheat_Validate(object oPC)
|
|
{
|
|
|
|
/* switch (GetRacialType(oPC))
|
|
{
|
|
case RACIAL_TYPE_BROWNIE:
|
|
case RACIAL_TYPE_WEMIC:
|
|
BootPC(oPC, "Sorry, invalid racial type. Please remake using one of the 7 standard races.\nUnfortunately, we can't disable the buttons for the CEP races.");
|
|
return FALSE;
|
|
}
|
|
|
|
int nHitDice = GetHitDice(oPC);
|
|
if (nHitDice > 20)
|
|
{
|
|
BootPC(oPC, "Illegal character");
|
|
dbg_Warning("Illegal character - Hit dice over 20", oPC);
|
|
return FALSE;
|
|
}
|
|
|
|
int i;
|
|
int nTotalAbilities = 0;
|
|
int nHighestPossible = 18 + 2; // Base + Racial Modifier
|
|
nHighestPossible += FloatToInt(IntToFloat(nHitDice) / 4.0f); // Level Bonus
|
|
if (GetLevelByClass(CLASS_TYPE_DRAGON_DISCIPLE, oPC) > 0)
|
|
nHighestPossible += 8; // Max RDD Strength
|
|
|
|
for (i = 0; i < 6; i++)
|
|
{
|
|
int nAbility = NWNX_Creature_GetRawAbilityScore(oPC, i);
|
|
if (nAbility > nHighestPossible && GetRacialType(oPC) < 7)
|
|
{
|
|
//BootPC(oPC, "Illegal character");
|
|
dbg_Warning("Illegal character - ability " + IntToString(i) + " is " + IntToString(nAbility), oPC);
|
|
return TRUE; // TO FIX
|
|
}
|
|
nTotalAbilities += nAbility;
|
|
}
|
|
|
|
if (nTotalAbilities > 100)
|
|
{
|
|
//BootPC(oPC, "Illegal character");
|
|
dbg_Warning("Illegal character - total abilities are " + IntToString(nTotalAbilities), oPC);
|
|
return TRUE; // TO FIX
|
|
}
|
|
|
|
if (NWNX_Creature_GetFeatCount(oPC) > 80)
|
|
{
|
|
//BootPC(oPC, "Illegal character");
|
|
dbg_Warning("Illegal character - too many feats", oPC);
|
|
return TRUE; // TO FIX
|
|
}
|
|
/*
|
|
if (NWNX_Creature_GetKnownSpellCount(oPC) > 160)
|
|
{
|
|
BootPC(oPC, "Illegal character");
|
|
dbg_Warning("Illegal character - too many known spells", oPC);
|
|
return FALSE;
|
|
}
|
|
*/
|
|
/*if (NWNX_Creature_GetAttacksPerRound(oPC) > 6)
|
|
{
|
|
//BootPC(oPC, "Illegal character");
|
|
dbg_Warning("Illegal character - too many attacks", oPC);
|
|
return TRUE; // TO FIX
|
|
}
|
|
|
|
for (i = EVENT_SCRIPT_CREATURE_ON_HEARTBEAT; i <= EVENT_SCRIPT_CREATURE_ON_BLOCKED_BY_DOOR; i++)
|
|
{
|
|
string script = GetEventScript(oPC, i);
|
|
if (script != "" && script != "default" && GetStringLeft(script, 3) != "pc_")
|
|
{
|
|
dbg_Warning("Illegal character - Has a script", oPC);
|
|
return TRUE;
|
|
}
|
|
}
|
|
|
|
if (NWNX_Object_GetDialogResref(oPC) != "")
|
|
{
|
|
dbg_Warning("Illegal character - has dialog " + NWNX_Object_GetDialogResref(oPC), oPC);
|
|
}
|
|
*/
|
|
|
|
return TRUE;
|
|
}
|