Hi, I`m developing a plugin where players can run a command to spawn a NpcSpawn's NPC that will serve as allies, will follow them and defend.
Here is a sneak peak of the plugin:
Even though NpcSpawn allow CustomScientists to target and damage regular Npcs
I noticed NpcSpawn prevents any damage between two NpcSpawns in this line where it compares the SkinID of the victim and forces a return true in this hook.
private object OnEntityTakeDamage(BaseCombatEntity victim, HitInfo info)
{
if (victim == null || info == null) return null;
BaseEntity attacker = info.Initiator;
if (IsCustomScientist(victim))
{
if (attacker == null || attacker.skinID == 11162132011012) return true;
...
if (IsCustomScientist(attacker))
{
if (victim.skinID == 11162132011012) return true;
...
The problem is I want recruits from different factions to be able to target and damage each other so players can have bot wars.
Can you add an additional optional flag in NpcConfig, let's say NpcConfig.CanDamageNpcSpawns? (default false so it does not break any current plugins using NpcSpawn)
And then, make this skinId checks only for CustomScientists with the flag set to false so I can spawn my bots with this flag = true and have the ability to damage other NpcSpawns since in my plugin they act as player allies that should be able to fight other player recruits.
Thanks!