• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

How can i make traders killable?

Bestia

Refugee
I have been modding the traders on my server. The traders on my server is wandering around instead of beeing stuck in the trader area. They also kill bandits, zombies and animals. To make this game more realistic i need to make traders "killable".

I have gone through all my xml's to find a way to modify this, but i cant find it. Max health is set, but they simply wont die.

Does anyone know how to make traders killable?

Thanks in advance.

:smile-new:

 
You can't while keeping the game EAC friendly. Modifying one of the dll files is where you can change that afaik. But doing so breaks EAC

 
The zeds can kill traders, just leave the doors open. They don't respawn though, so that location will be closed unless you spawn in a replacement.

 
You can't while keeping the game EAC friendly. Modifying one of the dll files is where you can change that afaik. But doing so breaks EAC
Thanks. EAC is not activated on ny server. Do you know which .DLL must be edited?

- - - Updated - - -

- - - Updated - - -

 
assembly-csharp.dll

its possible this is involved with why traders cant be killed

Code:
	// Token: 0x06002F72 RID: 12146 RVA: 0x001611F5 File Offset: 0x0015F5F5
public override int DamageEntity(DamageSource _damageSource, int _strength, bool _criticalHit, float _impulseScale)
{
	if (this.NPCInfo != null && this.NPCInfo.TraderID > 0)
	{
		return 0;
	}
	return base.DamageEntity(_damageSource, _strength, _criticalHit, _impulseScale);
}

// Token: 0x06002F73 RID: 12147 RVA: 0x00161220 File Offset: 0x0015F620
public override void ProcessDamageResponseLocal(DamageResponse _dmResponse)
{
	if (this.NPCInfo != null && this.NPCInfo.TraderID > 0)
	{
		return;
	}
	base.SetAttackTarget((EntityAlive)GameManager.Instance.World.GetEntity(_dmResponse.Source.getEntityId()), 600);
	base.ProcessDamageResponseLocal(_dmResponse);
}

// Token: 0x06002F74 RID: 12148 RVA: 0x0016127C File Offset: 0x0015F67C
public override void AwardKill(EntityAlive killer)
{
	if (this.NPCInfo != null && this.NPCInfo.TraderID > 0)
	{
		return;
	}
	base.AwardKill(killer);
}
 
Back
Top