I wonder if anyone would be kind enough to take a look at the mess I've made of a custom spell script, and show me why I get an "Unknown State In Compiler" error, or if the script is so bad that it's unusable.
///////////////////////////////////////////////////
// Dance Of Doom
// pt_dancedoom.nss
//
// The victim loses 3pts of Con for 2 minutes and
// has to perform a very silly dance.
//
///////////////////////////////////////////////////
/// The Unequip-Dance-Equip Function (taken from ShadowM's hr_speak file)
void EmoteDance(object oTarget)
{
object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget);
object oLeftHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTarget);
AssignCommand(oTarget,ActionUnequipItem(oRightHand));
AssignCommand(oTarget,ActionUnequipItem(oLeftHand));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0));
//AssignCommand(oTarget,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC)));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_LOOPING_TALK_FORCEFUL,1.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0));
//AssignCommand(oTarget,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC)));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0));
//AssignCommand(oTarget,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC)));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0));
AssignCommand(oTarget,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0));
AssignCommand(oPC,ActionDoCommand(ActionEquipItem(oLeftHand,INVENTORY_SLOT_LEFTHAND)));
AssignCommand(oPC,ActionDoCommand(ActionEquipItem(oRightHand,INVENTORY_SLOT_RIGHTHAND)));
}
/// The main function for the spell's impact script
void main()
{
//Declare major variables
object oTarget = GetSpellTargetObject();
int nDuration = 2;
int nLoss = 3;
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
effect eFeeb = EffectAbilityDecrease(ABILITY_CONSTITUTION, nLoss);
effect eVis1 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
// maybe add a knockdown later on
//effect eTrip = EffectKnockdown();
effect eLink1 = EffectLinkEffects(eFeeb, eVis1);
//Fire cast spell at event for the specified target
//1536 is spells 2da number for Dance of Doom
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 1536));
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, oTarget, TurnsToSeconds(nDuration));
EmoteDance(object oTarget);
}
Any help will be very much appreciated,
Many thanks,
PT