Jump to content

Home

How I can make NPC attackable target?


Recommended Posts

Originally posted by Greatstar

Can you show me? How I can make NPC attackable target (red) that will attack player.

 

If I want one NPC turn to attackable target, then how?

 

Also, how I can make entire NPC in area turn to attackable target?

 

Did I need notepad to make script then rename to file type?

 

I think this should turn all creatures in the area hostile. Needless to say running this in the wrong area will mess up your game. :)

 

void main() {
   object oCre = GetFirstObjectInArea();

   while (GetIsObjectValid(oCre)) {
       if (!GetIsEnemy(oCre, GetFirstPC()) 
           && !IsObjectPartyMember(oCre)) 
       {
           ChangeToStandardFaction(oCre, STANDARD_FACTION_HOSTILE_1);
       }
       oCre = GetNextObjectInArea();
   }
}

 

To just make a single creature hostile, pass them as a parameter to a ChangeToStandardFaction() function call.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...