Check monsters leaving through an area transition in NW_G0_Transition.nss and run a function like this on all transition-ers that aren't a PC, henchmen, summon etc..
object oCritter = GetEnteringObject();
object oTarget = GetTransitionTarget(OBJECT_SELF);
effect eDamage;
if( *REQUIREMENTS HERE* ){
{
eDamage = EffectDamage(GetCurrentHitPoints(oCritter)+15 , DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY);
eDamage = SupernaturalEffect(eDamage);
ApplyEffectToObject (DURATION_TYPE_INSTANT, eDamage,oCritter);
}
else
{
AssignCommand(oCritter,JumpToObject(oTarget));
}
If you don't put requirements, this will kill anyone who tries to make a transition anywhere in the game. If you only want this idea applying to certain exits, apply them to triggers instead of adding them to NW_G0_Transition.nss
Alternatively, you could set a localvariable on spawning enemies, and use that local variable as the check in the IF statement. That way it would only apply to monsters with this variable (in which case make sure NPCs dont get this variable too)
Modifié par EzRemake, 06 avril 2011 - 04:45 .