# Editing NPC Aggression Values

**URL:** <https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203>\
**Category:** The Toolbox\
**Created:** [January 4, 2019, 5:29pm UTC](https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203 "2019-01-04T17:29:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gunpowder17](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/gunpowder17/32/5265_2.png) [@Gunpowder17](https://discourse.cataclysmdda.org/u/Gunpowder17)\
**Post date:** [January 4, 2019, 5:29pm UTC](https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203/1 "2019-01-04T17:29:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [January 4, 2019, 6:44pm UTC](https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203/2 "2019-01-04T18:44:00Z")

</div>

```auto
    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.

---

<div class="post-metadata">

**Author:** ![Gunpowder17](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/gunpowder17/32/5265_2.png) [@Gunpowder17](https://discourse.cataclysmdda.org/u/Gunpowder17)\
**Post date:** [January 4, 2019, 7:49pm UTC](https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203/3 "2019-01-04T19:49:40Z")

</div>

Thanks! Where do I put that code at though?

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [January 4, 2019, 8:28pm UTC](https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203/4 "2019-01-04T20:28:46Z")

</div>

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

```auto
        set_attitude( NPCATT_KILL );

```

and then all NPCs would be hostile.

---

<div class="post-metadata">

**Author:** ![ecchi\_squid](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/ecchi_squid/32/6386_2.png) [@ecchi\_squid](https://discourse.cataclysmdda.org/u/ecchi_squid)\
**Post date:** [January 4, 2019, 8:43pm UTC](https://discourse.cataclysmdda.org/t/editing-npc-aggression-values/18203/5 "2019-01-04T20:43:23Z")

</div>

So that’s what Order 66 looks like.
