2025/12/05 Update
Fixed overlong hak name (abilities -> ability). Updated PEPS Updated NWNxEE libraries. Updated readme Updated nim tools.
This commit is contained in:
@@ -8,16 +8,21 @@
|
||||
// Programmer: Philos
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "0i_actions"
|
||||
void ai_DoActions(object oCreature, int nForm)
|
||||
void main()
|
||||
{
|
||||
object oCreature = OBJECT_SELF;
|
||||
int nInMelee = ai_GetNumOfEnemiesInRange(oCreature);
|
||||
object oNearestEnemy = GetLocalObject(oCreature, AI_ENEMY_NEAREST);
|
||||
if(ai_TryHealingTalent(oCreature, nInMelee)) return;
|
||||
if(ai_TryCureConditionTalent(oCreature, nInMelee)) return;
|
||||
if(GetPercentageHPLoss(oCreature) <= AI_HEALTH_BLOODY)
|
||||
{
|
||||
//ai_Debug("ai_a_polymorphed", "24", "We are wounded and are transforming back!");
|
||||
if(AI_DEBUG) ai_Debug("ai_a_polymorphed", "20", "We are wounded and are transforming back!");
|
||||
ai_RemoveASpecificEffect(oCreature, EFFECT_TYPE_POLYMORPH);
|
||||
DeleteLocalInt(oCreature, AI_POLYMORPHED);
|
||||
// We need to create the creatures normal forms talent list.
|
||||
DelayCommand(0.0, ai_ClearTalents(oCreature));
|
||||
DelayCommand(0.1, ai_SetCreatureTalents(oCreature, FALSE, TRUE));
|
||||
return;
|
||||
}
|
||||
int nDifficulty = ai_GetDifficulty(oCreature);
|
||||
@@ -51,20 +56,3 @@ void ai_DoActions(object oCreature, int nForm)
|
||||
if(oTarget != OBJECT_INVALID) ai_ActionAttack(oCreature, AI_LAST_ACTION_MELEE_ATK, oTarget);
|
||||
else ai_SearchForHiddenCreature(oCreature, FALSE);
|
||||
}
|
||||
void main()
|
||||
{
|
||||
object oCreature = OBJECT_SELF;
|
||||
// Need to know who we are so we can use thier abilities.
|
||||
int nForm = GetAppearanceType(oCreature);
|
||||
// Check to see if we are back to our normal form?(-1 to get the actual form #)
|
||||
if(nForm == GetLocalInt(oCreature, AI_NORMAL_FORM) - 1)
|
||||
{
|
||||
// If we are transformed back then go back to our primary ai.
|
||||
ai_SetCreatureAIScript(oCreature);
|
||||
DeleteLocalInt(oCreature, AI_NORMAL_FORM);
|
||||
string sAI = GetLocalString(oCreature, AI_COMBAT_SCRIPT);
|
||||
if(sAI == "ai_a_polymorphed" || sAI == "") sAI = "ai_a_default";
|
||||
ExecuteScript(sAI, oCreature);
|
||||
}
|
||||
else ai_DoActions(oCreature, nForm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user