=====================================================
  NPC WEAPON REACTIONS V2.2  -  by Sujal
  Grand Theft Auto V (single player)
=====================================================

Pedestrians in Los Santos now react like real people when you pull out a
weapon. They notice you, back away, run, put their hands up, film you, call
the police, or in rare cases fight back. Security guards warn you before they
attack, and shop clerks can be robbed.


-----------------------------------------------------
  REQUIREMENTS
-----------------------------------------------------
- Grand Theft Auto V (PC, single player)
- Script Hook V
- Script Hook V .NET 3.x (tested on 3.7)
- Microsoft .NET Framework 4.8


-----------------------------------------------------
  INSTALLATION
-----------------------------------------------------
1. If you have V1 of this mod, delete its .cs / .dll and .ini first.
   Running V1 and V2.2 together will make NPCs behave strangely.
   (The files are still named NPCWeaponReactionsV2.* so they replace V2.)
2. Copy these two files into  GTA V\scripts\
      NPCWeaponReactionsV2.cs
      NPCWeaponReactionsV2.ini
3. Start the game. After a few seconds a message shows that the mod loaded.

To uninstall, delete both files from the scripts folder.


-----------------------------------------------------
  CONTROLS
-----------------------------------------------------
F10   Turn the mod on / off
F11   Debug mode: shows each reacting NPC's type, personality and stage

Keys can be changed in the .ini ([General] section).


-----------------------------------------------------
  FEATURES
-----------------------------------------------------
DETECTION
- NPCs only notice you inside their field of view, with a clear line of sight.
  Walls and cover block detection, and NPCs behind you notice you late.
- Weapon type matters: a knife scares people less than a rifle or RPG.
- Darkness shortens how far you are noticed. Suppressed weapons draw less
  attention and suppressed shots are heard from much less far.
- Gunshots alert nearby NPCs even if they cannot see you.

NPC PERSONALITIES
- Coward, Normal, Curious, Frozen and Hero (a rare brave NPC who shouts and
  tries to fight you, and gives up if hurt).

STAGED REACTIONS
- Notice and look at you, then walk away while looking back, then jog, then
  run in full panic as you get closer.
- Other reactions: freeze, faint, hide behind cover, film you with a phone,
  call the police, hands up, and kneel to surrender.
- Panic spreads to nearby NPCs.
- NPCs calm down and return to normal after you put the weapon away.

ROBBERY AND SHOPS
- Keep aiming at an NPC with hands up and they drop real cash (money pickup,
  normal collect sound) and sometimes their phone.
- Shop clerks use the register animation and pay more. They may trigger an
  alarm or pull a shotgun from under the counter.

LAW AND CONSEQUENCES
- Witnesses can call the police. Police can also be sent to where the witness
  stood (experimental).
- Witnesses remember you for a few minutes and can point you out later.
- Security guards warn you, draw their gun, then attack and call backup.
- Gun-free zones (hospital, airport, police station, prison by default): keep
  a weapon drawn there and you get a wanted level. You can add your own zones.

VEHICLES AND ANIMALS
- Drivers honk and shout, drive away, or get out with hands up when you aim
  at them.
- Dogs growl and bark, then run if you get close. Other animals flee.

EXTRAS
- Armed NPCs (anyone carrying a weapon, plus a few random armed civilians)
  never surrender: they attack you.
- Fear meter: the more you scare people, the farther NPCs notice you. It
  cools down over time.
- Area behavior: rural NPCs are braver and more often armed, hood NPCs call
  the police less, wealthy-area NPCs call more and drop more cash.

NPCs the mod does NOT touch: police, gangs, mission NPCs, and NPCs spawned by
other mods or scripts.


-----------------------------------------------------
  CONFIGURATION
-----------------------------------------------------
Everything is in NPCWeaponReactionsV2.ini and every setting has a comment.
Common ones:

[Detection]  SightDistance, JogDistance, RunDistance, FieldOfView
[Chances]    Film, CallPolice, ArmedCivilian, Kneel, Faint, Hide ...
[Robbery]    AimSeconds, MinCash, MaxCash
[Police]     WantedLevel (0 = no wanted level), Recognition
[Weapons]    IgnoredWeapons, OnlyWeapons, per-group threat multipliers
[GunFreeZones]  Zone1=x,y,z,radius,name   (up to Zone20)
[Speech]     ambient speech line for each reaction

Chances go from 0.0 (never) to 1.0 (always).


-----------------------------------------------------
  TROUBLESHOOTING
-----------------------------------------------------
- Nothing happens: check ScriptHookVDotNet.log in the game folder for errors.
  Make sure Script Hook V .NET is installed and the .cs file is in scripts\.
- NPCs do not react to a holstered weapon: that is intended. Set
  RequireWeaponInHand=false if you want them to react anyway.
- Police are not sent to the witness: DispatchToWitnessLocation is
  experimental. The wanted-level report still works without it.
- A speech line is silent: not every line exists for every ped voice. Change
  it in the [Speech] section.
- Game stutters: raise ScanIntervalMs (for example 300) in [General].
- Conflicts with another NPC-behavior mod are possible. Try turning one off.


-----------------------------------------------------
  CHANGELOG
-----------------------------------------------------
V2.2  Bug fix: pulling out your phone no longer makes NPCs panic. The mod used to treat
      "something is in the player's hand" as "a weapon is in the player's hand", and a
      phone is also something in the hand. Now the object in the hand has to be the
      selected weapon itself, and using the phone is never treated as drawing a weapon.
      New setting: [Detection] StrictWeaponCheck=true.
V2.1  Fixes and tweaks:
    - Compiles on Script Hook V .NET 3.7 (removed obsolete commands).
    - Dropped phones now land on the ground instead of hanging in the air.
    - NPCs carrying a weapon attack instead of surrendering or running.
    - Script now writes scripts\NPCWeaponReactionsV2.log if something goes wrong.
V2  Full rewrite: field of view and line of sight, personalities, staged
    movement, panic spreading, gunshot reactions, fear meter, area behavior,
    armed civilians, hero NPCs, filming, police witnesses and recognition,
    guard escalation, gun-free zones, shop robbery, vehicle reactions,
    animals, and fixes for the hands-up flicker, wrong-way filming and NPCs
    ignoring the script while busy.
V1  Original release: weapon reactions, configurable sight distance.


-----------------------------------------------------
  AI DISCLOSURE
-----------------------------------------------------
This mod was developed with AI assistance (Claude by Anthropic). The concept,
features, in-game testing and tuning are by Sujal.


-----------------------------------------------------
  CREDITS AND PERMISSIONS
-----------------------------------------------------
Made by Sujal.
Script Hook V by Alexander Blade. Script Hook V .NET by crosire and contributors.

Do not re-upload this mod without permission. Please do not claim it as your
own. You may use it in videos and streams.
