// OnEnter - Expell NPCS // This will possess a nearby NPC with the tag EXPELLER who will // do visual effects sending NPCS who enter to nearby waypoint tagged EXPELL_NPCS // they will be set not to follow. #include "antistuck_h" void fnDisableFollow(object oNPC); // make not follow master void main() { object oNPC=GetEnteringObject(); object oExpeller=GetNearestObjectByTag("EXPELLER"); object oDest=GetNearestObjectByTag("EXPELL_NPCS"); object oExpellerAct=GetNearestObjectByTag("EXPELLER_ACT"); effect eBeam=EffectBeam(VFX_BEAM_ODD,oExpeller,BODY_NODE_HAND); if (GetIsPC(oNPC)!=TRUE) { // NPC if(GetLocalInt(oExpeller,"nGNBDisabled")!=TRUE) { // Disable NPC ACTIVITIES SetLocalInt(oExpeller,"nGNBDisabled",TRUE); AssignCommand(oExpeller,ASActionMoveToObject(oExpellerAct,TRUE,1.0)); DelayCommand(30.0,SetLocalInt(oExpeller,"nGNBDisabled",FALSE)); // reactivate NPC ACTIVITIES } // Disable NPC ACTIVITIES ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oNPC,2.0); DelayCommand(1.0,AssignCommand(oNPC,ClearAllActions(TRUE))); DelayCommand(1.1,AssignCommand(oNPC,JumpToObject(oDest))); DelayCommand(1.2,fnDisableFollow(oNPC)); } // NPC } void fnDisableFollow(object oNPC) { // make not follow master SetLocalInt(oNPC,"nMState",7); SetLocalInt(oNPC,"nSState",0); } // fnDisableFollow()