forked from teamnwah/openmw-tes3coop
Implement iCrimeThresholdMultiplier
This commit is contained in:
parent
fc618cb3ea
commit
7ae9bbb1a5
1 changed files with 6 additions and 2 deletions
|
@ -860,7 +860,7 @@ namespace MWMechanics
|
|||
if (ptr.getClass().isClass(ptr, "Guard") && creatureStats.getAiSequence().getTypeId() != AiPackage::TypeIdPursue && !creatureStats.isHostile())
|
||||
{
|
||||
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
|
||||
float cutoff = float(esmStore.get<ESM::GameSetting>().find("iCrimeThreshold")->getInt());
|
||||
int cutoff = esmStore.get<ESM::GameSetting>().find("iCrimeThreshold")->getInt();
|
||||
// Force dialogue on sight if bounty is greater than the cutoff
|
||||
// In vanilla morrowind, the greeting dialogue is scripted to either arrest the player (< 5000 bounty) or attack (>= 5000 bounty)
|
||||
if ( player.getClass().getNpcStats(player).getBounty() >= cutoff
|
||||
|
@ -868,6 +868,10 @@ namespace MWMechanics
|
|||
&& MWBase::Environment::get().getWorld()->getLOS(ptr, player)
|
||||
&& MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, ptr))
|
||||
{
|
||||
static int iCrimeThresholdMultiplier = esmStore.get<ESM::GameSetting>().find("iCrimeThresholdMultiplier")->getInt();
|
||||
if (player.getClass().getNpcStats(player).getBounty() >= cutoff * iCrimeThresholdMultiplier)
|
||||
MWBase::Environment::get().getMechanicsManager()->startCombat(ptr, player);
|
||||
else
|
||||
creatureStats.getAiSequence().stack(AiPursue(player), ptr);
|
||||
creatureStats.setAlarmed(true);
|
||||
npcStats.setCrimeId(MWBase::Environment::get().getWorld()->getPlayer().getNewCrimeId());
|
||||
|
|
Loading…
Reference in a new issue