Editing NPC Aggression Values

I’m trying to find out where in the files I can find the values for whether or not the NPCs attack you and I’m pretty sure it’s tied to Aggression but I can’t find where I can edit so all NPCs become aggressive enough to kill you on sight

    if( op_of_u.fear < personality.bravery + 10 &&
        op_of_u.fear - personality.aggression > -10 && op_of_u.trust > -8 ) {
        set_attitude( NPCATT_TALK );
    } else if( op_of_u.fear - 2 * personality.aggression - personality.bravery < -30 ) {
        set_attitude( NPCATT_KILL );
    } else if( my_fac != nullptr && my_fac->likes_u < -10 ) {
        set_attitude( NPCATT_KILL );
    }

Setting all NPC aggression to 10 should help, as well as giving your character the DEFORMED trait.

2 Likes

Thanks! Where do I put that code at though?

That’s the existing code from src/npc.cpp. I’m just showing you how the game actually decides to kill you.

If you’re up to a little coding and compiling, you could just replace that entire block with

        set_attitude( NPCATT_KILL );

and then all NPCs would be hostile.

So that’s what Order 66 looks like.