Amon_PRC8/_module/nss/hench_o0_monopt.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

64 lines
1.8 KiB
Plaintext

/*
Henchman Inventory And Battle AI
This file is used for options for the henchman ai.
The exe and hak versions are different than the erf version.
The exe and hak version still use the small scripts to control options.
The erf version can just be built directly using this file without using
the small control files, it can be changed to anything including
module properties, spawn script, etc.
*/
#include "hench_i0_options"
void main()
{
int nSel = GetLocalInt(OBJECT_SELF, "HenchOptionSel");
int nReturn = HENCH_MONAI_STEALTH | HENCH_MONAI_COMP;
if (nSel & HENCH_MONAI_WANDER)
{
if (d10() > 2)
{
nReturn = nReturn | HENCH_MONAI_WANDER;
}
}
if (nSel & HENCH_MONAI_DISTRIB)
{
// monsters distribute themselves when attacking
if (GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES)
{
nReturn = nReturn | HENCH_MONAI_DISTRIB;
}
}
/* if (nSel & HENCH_MONAI_HASTE)
{
// monsters haste themselves after being damaged
if (GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
{
nReturn = nReturn | HENCH_MONAI_HASTE;
}
} */
/* if (nSel & HENCH_MONAI_HEALPT)
{
int iChance = d10();
int iDifficulty = GetGameDifficulty();
// Self healing below 50% if enemy is far, otherwise between 20% and 50% only
if ((iDifficulty == GAME_DIFFICULTY_DIFFICULT && iChance > 2) ||
(iDifficulty == GAME_DIFFICULTY_CORE_RULES && iChance > 8))
{
nReturn = nReturn | (GetLocalInt(OBJECT_SELF, "HenchOptionReturn") & HENCH_MONAI_HEALPT);
}
} */
SetLocalInt(OBJECT_SELF, "HenchOptionReturn", nReturn);
}