"Dance Of Doom" spell-script woes...
#1
Posté 05 mars 2012 - 07:00
///////////////////////////////////////////////////
// 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
#2
Posté 05 mars 2012 - 07:14
EmoteDance(object oTarget);
put:
EmoteDance(oTarget);
and replace oPC with oTarget in EmoteDance() function.
#3
Posté 10 mars 2012 - 01:45
However, I have found that the targeted PC can simply click the screen and end the dance animation. Is there some way to force the animations to play out?
If this means using cut-scene stuff then I'm going to die inside, since I don't understand all that stuff!
Here's hoping for an easier answer, if you or anyone else on the forum would be so kind!
If it's any help, perhaps I should say that this is an NPC-only spell.
Thanks again,
PT
#4
Posté 10 mars 2012 - 03:59
// Set whether oTarget's action stack can be modified
void SetCommandable(int bCommandable, object oTarget=OBJECT_SELF)
You just have to remember to make them commandable at the end with an ~ ActionDoCommand (SetCommandable(TRUE, oPC)); ~ or such.
#5
Posté 10 mars 2012 - 05:58
///////////////////////////////////////////////////
// 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 ActionEmoteDance()
{
object oTarget = OBJECT_SELF;
object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget);
object oLeftHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTarget);
ClearAllActions(TRUE);
ActionUnequipItem(oLeftHand);
ActionUnequipItem(oRightHand);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0);
//ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH));
ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0);
ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0);
ActionPlayAnimation( ANIMATION_LOOPING_TALK_FORCEFUL,1.0);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0);
//ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH));
ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0);
ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH));
ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0);
ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0);
ActionEquipItem(oRightHand,INVENTORY_SLOT_RIGHTHAND);
ActionEquipItem(oLeftHand,INVENTORY_SLOT_LEFTHAND);
ActionDoCommand(SetCommandable(TRUE));
SetCommandable(FALSE);
}
/// 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));
AssignCommand(oTarget,ActionEmoteDance());
}
EDIT:Corrected my error of the action que being locked before it was filled.
EDIT2: Corrected the equip order per Faild bards observation.
EDIT3: *hangs head*
Modifié par Lightfoot8, 11 mars 2012 - 12:56 .
#6
Posté 10 mars 2012 - 08:02
You need to equip the right hand again before the left hand, in case both were weapons.ActionEquipItem(oLeftHand,INVENTORY_SLOT_LEFTHAND);
ActionEquipItem(oRightHand,INVENTORY_SLOT_RIGHTHAND);
#7
Posté 10 mars 2012 - 08:21
#8
Posté 10 mars 2012 - 11:35
Still not quite right, inventory slot constants are reversed now.ActionEquipItem(oRightHand,INVENTORY_SLOT_LEFTHAND);
ActionEquipItem(oLeftHand,INVENTORY_SLOT_RIGHTHAND);
#9
Posté 11 mars 2012 - 12:57
Failed.Bard wrote...
Still not quite right, inventory slot constants are reversed now.ActionEquipItem(oRightHand,INVENTORY_SLOT_LEFTHAND);
ActionEquipItem(oLeftHand,INVENTORY_SLOT_RIGHTHAND);
#10
Posté 26 mars 2012 - 02:54
Massive thanks to Lightfoot8 & Failed.Bard !!!!!
This spell now works like...well....a charm!!!
Thanks so much again for all your help.
T.





Retour en haut






