Jump to content

Home

Only one casting of Mind, Beast, Droid Trick


WRFan

Recommended Posts

It shouldn't be allowed to cast the force powers Mind Trick, Beast Trick, Droid Trick more than once. If you want the game to check if the power is already active, tell the game engine to check if the effect is already active on someone in the area. If affirmative, don't apply the effect to anybody else. Here's an example for Mind Trick:

 

object oObject = GetFirstObjectInArea(OBJECT_SELF,OBJECT_TYPE_CREATURE);
   while(GetIsObjectValid(oObject))
   {
if(GetHasSpellEffect(FORCE_POWER_MIND_TRICK, oObject))
        {
CancelCombat(oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectForceResisted(OBJECT_SELF), oTarget);
return;
}
        oObject = GetNextObjectInArea(OBJECT_SELF,OBJECT_TYPE_CREATURE);
   }

 

CancelCombat is needed to correct a weird bug that triggers defensive scripts On Spell Cast At Event, even if the enemy can't see you, since Mind Trick etc. don't cancel stealth mode (enemies start running around, activate shields etc.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...