This is our script that declares the functions of our stunner.
But there is a problem I am not able to find...I'm sure the problem is pretty simple but still I can't see it :angry2:
The script is divided into two parts
if (GetTag (oItem) == "SpielerStunner")
{
object oTarget = GetItemActivatedTarget();
int iStunner = GetLocalInt(oSpieler, "Stunned");
int iChanged02 = GetLocalInt(oTarget, "AppChanged");
if (iChanged02 == 1) return;
if(GetIsDM(oTarget))return;
if (iStunner == 0)
{
effect eVisual1 = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
effect eVisual2 = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
effect eVisual3 = EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION);
effect eVisual4 = EffectVisualEffect(VFX_DUR_ICESKIN);
effect eVisual5 = EffectVisualEffect(VFX_DUR_PARALYZE_HOLD);
effect eHold = EffectStunned();
effect eHold2 = EffectParalyze();
effect eHold3 = EffectDominated();
effect eHold4 = EffectPetrify();
effect eHold5 = EffectFrightened();
AssignCommand(oTarget,ClearAllActions());
SetLocalInt(oTarget, "DM_Hold_Flag", 1);
SetLocalInt(oTarget, "DM_No_Magic", 1);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual1, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual2, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual3, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual4, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVisual5, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold2, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold3, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold4, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHold5, oTarget);
SetCommandable(FALSE, oTarget);
SetCutsceneMode(oTarget, TRUE);
DelayCommand(0.2, SetPlotFlag(oTarget,TRUE));
SetLocalInt(oTarget, "Stunned", 1);
}
if (iStunner == 1)
{
// object oTarget = GetItemActivatedTarget();
// int iFlag = GetLocalInt(oTarget, "DM_Hold_Flag");
effect eEffect = GetFirstEffect(oTarget);
effect eVisual = EffectVisualEffect(VFX_IMP_HEALING_L);
effect eVisual2 = EffectVisualEffect(VFX_IMP_HEAD_HEAL);
AssignCommand(oTarget, ClearAllActions());
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual2, oTarget);
while (GetIsEffectValid(eEffect))
{
RemoveEffect(oTarget, eEffect);
eEffect = GetNextEffect(oTarget);
}
SetLocalInt(oTarget, "DM_Hold_Flag", 0);
SetLocalInt(oTarget, "DM_No_Magic", 0);
SetCommandable(TRUE, oTarget);
SetCutsceneMode(oTarget, FALSE);
DelayCommand(0.2, SetPlotFlag(oTarget,FALSE));
SetLocalInt(oTarget, "Stunned", 0);
}
}
As it is right now it only stuns the target
This is how it is supposed to work:
The first time you activate the stunner on a player the player will be stunned and can't do anything...most of us know this effect I suppose
Then when you activate the item a second time on the stunned player the effect is supposed to be undone with some effects.
For Mel:
When you read this please could you simplify this script a little? That would be really great...I tend to do most things a little too complicated
Thanks a lot!
A happy new year to everyone!!!