#include "nw_i0_2q4luskan" void main() { object oTarget; effect eVFX; object oActor; // If running the lowest AI, abort for performance reasons. if ( GetAILevel() == AI_LEVEL_VERY_LOW ) return; // If busy with combat or conversation, skip this heartbeat. if ( IsInConversation(OBJECT_SELF) || GetIsInCombat() ) return; // Get the PC who will be referenced in this event. object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN); // Only fire if a PC is seen. if ( OBJECT_INVALID == oPC ) return; // Have us say something. SpeakString("ATTACK! OUR TIME IS HERE!"); // Have "Erastus2" perform a sequence of actions. oActor = GetObjectByTag("Erastus2"); AssignCommand(oActor, ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1)); // Spawn "erastus". eVFX = EffectVisualEffect(VFX_IMP_POLYMORPH); oTarget = GetWaypointByTag("WP_Erastus2x"); DelayCommand(2.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "erastus", GetLocation(oTarget))); DelayCommand(2.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVFX, GetLocation(oTarget))); // Destroy an object (not fully effective until this script ends). oTarget = GetObjectByTag("Erastus2"); DelayCommand(2.7, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget)); DelayCommand(2.7, DestroyObject(oTarget, 3.3)); }