WRFan Posted July 9, 2009 Share Posted July 9, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.