Maybe, however it’s showing in the ToolSet, so it might be something else.
See scripts I use and leave blank the other part on creature (see orange circle on ToolSet picture). Just tested in a black studio test area and all seem to work. At least for me.
// ankheg_ondamage script
#include "ginc_ai"
#include "x0_i0_position"
#include "ginc_behavior"
void PlayCustomAnimationWrapper(object oMember, string sAnim, int bLoop)
{
PlayCustomAnimation(oMember,sAnim,bLoop);
}
void Burrow(object oTarget)
{
SetLocalInt(OBJECT_SELF, "Underground", 1);
ClearAllActions(TRUE);
// Make it ethereal to disengage existing attackers
effect eVis = EffectNWN2SpecialEffectFile("fx_global_earth_elemental_arise.sef");
effect eBurrow = EffectEthereal();
// eBurrow = EffectLinkEffects(EffectBlindness(), eBurrow);
eBurrow = SupernaturalEffect(SetEffectSpellId(eBurrow, 100));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBurrow, OBJECT_SELF));
// Down we go
DelayCommand(0.1, PlayCustomAnimationWrapper(OBJECT_SELF, "Disappear", 0));
DelayCommand(0.2, ActionWait(1.8));
DelayCommand(1.0, SetPlotFlag(OBJECT_SELF, 1));
DelayCommand(1.9, SetScriptHidden(OBJECT_SELF, 1, 0));
DelayCommand(1.99, PlayCustomAnimationWrapper(OBJECT_SELF, "DisappearIdle", 1));
if (!GetIsObjectValid(oTarget)) return;
//If damage was from a distance, pop up behind our enemy
location lDestination = GetBehindLocation(oTarget, 2.5);
if (!GetIsLocationValid(lDestination))
CalcSafeLocation(OBJECT_SELF, lDestination, 2.0, FALSE, FALSE);
AssignCommand(OBJECT_SELF, DelayCommand(2.5, ActionJumpToLocation(lDestination)));
effect eListen = EffectSkillIncrease(SKILL_LISTEN, 20);
DelayCommand(2.51, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eListen, OBJECT_SELF, 6.5));
}
void main()
{
object oSelf = OBJECT_SELF;
object oDamager = GetLastDamager(oSelf);
SetLocalObject(oSelf, "LastDamager", oDamager);
int iUnderground = GetLocalInt(oSelf, "Underground");
object oTarget = OBJECT_INVALID;
float fDist = GetDistanceBetween(oSelf, oDamager);
int iHPPercent = GetHealthPercent(oSelf);
// Attack was from a distance
if (fDist > 5.0) oTarget = oDamager;
// If dead, don't burrow
if (GetCurrentHitPoints(oSelf) < 1)
return;
//If less than 50% hit points, always burrow
if (iUnderground == 0)
{
if ( iHPPercent < 50 || d4(1) == 1)
{
Burrow(oTarget);
return;
}
}
ExecuteScript("nw_c2_default6", oSelf);
}
//////////////////////////////////////////////////////////
// ankheg_ondeath script
void CreateObjectWrapper(location lLoc)
{
CreateObject(OBJECT_TYPE_PLACEABLE, "plc_ankheg", lLoc);
}
void main()
{
location lLoc = GetLocation(OBJECT_SELF);
DelayCommand(4.0, CreateObjectWrapper(lLoc));
ExecuteScript("nw_c2_default7", OBJECT_SELF);
}
////////////////////////////////////////////////////////
// ankheg_hb heartbeat script
#include "NW_I0_SPELLS"
#include "ginc_cutscene"
#include "x0_i0_position"
#include "ginc_ai"
void AcidSpit();
void PlayCustomAnimationWrapper(object oMember, string sAnim, int bLoop)
{
PlayCustomAnimation(oMember,sAnim,bLoop);
}
void main()
{
object oMyArea = GetArea(OBJECT_SELF);
object oPCArea = GetArea(GetFirstPC());
if (oMyArea != oPCArea)// If no players in area, abort
return;
int iHidden = GetScriptHidden(OBJECT_SELF);
if (iHidden == 0)// We're above ground
{
//If not in combat or underground, turn to face last attacker
int iUnderground = GetLocalInt(OBJECT_SELF, "Underground");
object oLastDamager = GetLocalObject(OBJECT_SELF, "LastDamager");
if (GetCurrentAction(OBJECT_SELF) != 3 && !IsFacingWithin(20.0, oLastDamager)
&& !GetIsDead(oLastDamager) && iUnderground == 0)
TurnToFaceObject(oLastDamager, OBJECT_SELF);
//Fall through to default script
ExecuteScript("nw_c2_default1", OBJECT_SELF);
return;
}
else// We're underground & listening
{
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oTarget))
{
int iMoveSilent = GetSkillRank(SKILL_MOVE_SILENTLY, oTarget, FALSE)+d20(1);
int iHeard = GetIsSkillSuccessful(OBJECT_SELF, SKILL_LISTEN, iMoveSilent, FALSE);
int iHPPercent = GetHealthPercent(OBJECT_SELF);
int iAcid = GetLocalInt(OBJECT_SELF, "Acid");
if(oTarget != OBJECT_SELF
&& spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)
&& iHeard )// We heard an enemy
{
location lDestination = GetBehindLocation(oTarget, 2.5);
if (!GetIsLocationValid(lDestination))
CalcSafeLocation(OBJECT_SELF, lDestination, 2.0, FALSE, FALSE);
float fDelay = 2.0;
ClearAllActions(TRUE);
AssignCommand(OBJECT_SELF, ActionJumpToLocation(lDestination));
effect eVis = EffectNWN2SpecialEffectFile("fx_global_earth_elemental_arise.sef");
DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF));
DelayCommand(0.5, SetScriptHidden(OBJECT_SELF, 0, 0));
DelayCommand(0.5, PlayCustomAnimationWrapper(OBJECT_SELF, "Appear", 0));
DelayCommand(0.51, ActionWait(1.48));
DelayCommand(1.0, RemoveEffectsFromSpell(OBJECT_SELF, 100));
DelayCommand(1.1, SetPlotFlag(OBJECT_SELF, 0));
DelayCommand(1.9, PlayCustomAnimationWrapper(OBJECT_SELF, "%", 1));
if (iHPPercent < 50 && iAcid == 0)
{//Spit acid once if badly injured
AssignCommand(OBJECT_SELF, DelayCommand(2.0, ClearAllActions(TRUE)));
AssignCommand(OBJECT_SELF, DelayCommand(2.5, PlayCustomAnimationWrapper(OBJECT_SELF, "gen_cast", 0)));
AssignCommand(OBJECT_SELF, DelayCommand(2.6, AcidSpit()));
SetLocalInt(OBJECT_SELF, "Acid", 1);
fDelay = 5.0;
}
else
AssignCommand(OBJECT_SELF, DelayCommand(2.0, ActionAttack(oTarget)));
DelayCommand(fDelay, SetLocalInt(OBJECT_SELF, "Underground", 0));
return;
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_CREATURE);
}//end while
}//end else
}
void AcidSpit()
{
effect eAcidBeam = EffectVisualEffect(VFX_BEAM_GREEN_DRAGON_ACID);
location lLocation = GetLocation(OBJECT_SELF);
location lNewLocation = GetAheadLocation(OBJECT_SELF, 60.0f);
object oEndTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_ipoint ", lNewLocation);
DelayCommand(1.0f, DestroyObject(oEndTarget));
DelayCommand(0.5f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAcidBeam, oEndTarget, 3.0f));
float fDelay;
// Use hit dice to determine damage & DC
int nDC = 10 + GetHitDice(OBJECT_SELF);
int nDamStrike;
effect eVis = EffectVisualEffect(VFX_IMP_ACID_L);
object oTarget = GetFirstObjectInShape(SHAPE_SPELLCYLINDER, 9.0, lNewLocation, TRUE, OBJECT_TYPE_CREATURE, GetPosition(OBJECT_SELF));
while(GetIsObjectValid(oTarget))
{
if(oTarget != OBJECT_SELF && spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
//Reset the damage to full
nDamStrike = d4(GetHitDice(OBJECT_SELF));
// calc delay based on distance
fDelay = GetDistanceBetween(oTarget, OBJECT_SELF)/20;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_DRAGON_BREATH_ACID));
//Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
if(MySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_ACID))
{
nDamStrike = nDamStrike/2;
if(GetHasFeat(FEAT_EVASION, oTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamStrike = 0;
}
}
else if(GetHasFeat(FEAT_IMPROVED_EVASION, oTarget))
{
nDamStrike = nDamStrike/2;
}
effect eBreath = EffectDamage(nDamStrike, DAMAGE_TYPE_ACID);
if (nDamStrike > 0)
{
//Apply the VFX impact and effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 3.0f));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eBreath, oTarget));
}
}
//Get next target in spell area
oTarget = GetNextObjectInShape(SHAPE_SPELLCYLINDER, 9.0, lNewLocation, TRUE, OBJECT_TYPE_CREATURE, GetPosition(OBJECT_SELF));
}
}
///////////////////////////////////////////////////
// ankheg_onspawn script
void PlayCustomAnimationWrapper(object oMember, string sAnim, int bLoop)
{
PlayCustomAnimation(oMember,sAnim,bLoop);
}
//Starts ankheg underground
void main()
{
DelayCommand(1.0, PlayCustomAnimationWrapper(OBJECT_SELF, "DisappearIdle", 1));
SetPlotFlag(OBJECT_SELF, 1);
SetLocalInt(OBJECT_SELF, "Underground", 1);
DelayCommand(0.1, SetScriptHidden(OBJECT_SELF, 1, 0));
}