Added support for NPCs with Combat Feats

Added support for NPCs with Charge, Pounce, Trample, Overrun, Awesome Blow & Bull Rush.  Full compile.  Updated release archive.
This commit is contained in:
Jaysyn904
2024-12-13 18:40:31 -05:00
parent 582b9dbb49
commit b0a9d7abac
22 changed files with 642 additions and 2 deletions

View File

@@ -16,7 +16,7 @@
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
#include "prc_inc_spells"
#include "nw_i0_generic"
void main()
@@ -44,6 +44,37 @@ void main()
}
}
//:: Declare major variables
object oNPC = OBJECT_SELF;
object oArea = GetArea(oNPC);
string sResRef = GetResRef(oNPC);
string sAreaResRef = GetResRef(oArea);
int nTrampleScore = (GetLocalInt(oNPC, "TRAMPLER") + GetHasFeat(FEAT_CENTAUR_TRAMPLE, oNPC));
int nChargeScore = (GetLocalInt(oNPC, "CHARGER") +
GetLocalInt(oNPC, "POUNCER") +
GetHasFeat(FEAT_MINOTAUR_CHARGE, oNPC) +
GetHasFeat(FEAT_ACROBATIC_CHARGE, oNPC) +
GetHasFeat(FEAT_SHIELD_CHARGE ,oNPC) +
GetHasFeat(FEAT_POWERFUL_CHARGE, oNPC) +
GetHasFeat(FEAT_GREATER_POWERFUL_CHARGE, oNPC) +
GetHasFeat(FEAT_RHINO_TRIBE_CHARGE, oNPC) +
GetHasFeat(FEAT_FURIOUS_CHARGE, oNPC) +
GetHasFeat(FEAT_RECKLESS_CHARGE, oNPC) +
GetHasFeat(FEAT_COBALT_CHARGE, oNPC));
int nBullRushScore = (GetLocalInt(oNPC, "BULLRUSHER") +
GetHasFeat(FEAT_IMPROVED_BULLRUSH, oNPC) +
GetHasFeat(FEAT_RAMPAGING_BULL_RUSH, oNPC) +
GetHasFeat(5241, oNPC) + //:: Expert Bull Rush
GetHasFeat(5247, oNPC)); //:: Superior Bull Rush
int iAwesomeBlow = GetHasFeat(FEAT_AWESOME_BLOW, oNPC);
int iOverrun = GetHasFeat(FEAT_IMPROVED_OVERRUN, oNPC);
if(GetHasEffect(EFFECT_TYPE_SLEEP))
{
@@ -97,6 +128,58 @@ void main()
}
}
//:: Run Various Combat Maneuver Heartbeats
if(iOverrun)
{
if (GetLocalInt(oNPC, "OverrrunCooldown") != 1)
{
if(DEBUG) DoDebug( "x2_def_heartbeat: Creature w/ Overrun Detected");
DelayCommand(0.0f, ExecuteScript("overrunner_hb", oNPC));
}
else
if(DEBUG) DoDebug("x2_def_heartbeat: Overrun is on cooldown.");
}
if(iAwesomeBlow)
{
if (GetLocalInt(oNPC, "AwesomeBlowCooldown") != 1)
{
if(DEBUG) DoDebug("x2_def_heartbeat: Creature w/ Awesome Blow Detected");
DelayCommand(0.0f, ExecuteScript("awesomeblow_hb", oNPC));
}
else
if(DEBUG) DoDebug("x2_def_heartbeat: Awesome Blow is on cooldown.");
}
if(nTrampleScore)
{
if (GetLocalInt(oNPC, "TrampleCooldown") != 1)
{
if(DEBUG) DoDebug("x2_def_heartbeat: Trampler Detected");
DelayCommand(0.0f, ExecuteScript("trampler_hb", oNPC));
}
else
if(DEBUG) DoDebug("x2_def_heartbeat: Trample is on cooldown.");
}
if(nChargeScore)
{
if (GetLocalInt(oNPC, "ChargeCooldown") != 1)
{
if(DEBUG) DoDebug("x2_def_heartbeat: Charger Detected");
DelayCommand(0.0f, ExecuteScript("charger_hb", oNPC));
}
else
if(DEBUG) DoDebug("x2_def_heartbeat: Charge is on cooldown.");
}
if(nBullRushScore)
{
if (GetLocalInt(oNPC, "BullRushCooldown") != 1)
{
if(DEBUG) DoDebug("x2_def_heartbeat: Bull Rusher Detected");
DelayCommand(0.0f, ExecuteScript("bullrusher_hb", oNPC));
}
else
if(DEBUG) DoDebug("x2_def_heartbeat: Bull Rush is on cooldown.");
}
// Send the user-defined event signal if specified
if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT))
{