Jump to content

Can you please

Closed 2.5.5

MrLiquid
MrLiquid

Posted

Calling hook CanEntityTakeDamage resulted in a conflict between the following plugins: JetEvent - True (Boolean), NpcSpawn (False (Boolean))

 

can you please add support for JetEvent?

 

 

image.png

KpucTaJl

Posted

Hi, which object does damage to which object when you get this conflict?

MrLiquid

Posted

I have no idea. I can only assume the npc's from the Jet event and your NPC Spawn plugin?

Razor

Posted

private object CanEntityTakeDamage(BuildingBlock block, HitInfo hitInfo)
        {
            if (hitInfo == null || hitInfo.WeaponPrefab == null || hitInfo.HitEntity == null || hitInfo.HitEntity.OwnerID == 0)
                return null;

            if (hitInfo.WeaponPrefab.name.Contains("rocket_mlrs"))
            {
                if (hitInfo.HitEntity.OwnerID == 1309)
                    return true;
                else if (hitInfo.HitEntity.OwnerID == 13099)
                    return false;
            }

            return null;
        }



        private object CanEntityTakeDamage(ScientistNPC scientist, HitInfo hitInfo)
        {
            if (scientist == null || !_allNpc.Contains(scientist) || hitInfo == null)
                return null;

            if (hitInfo.damageTypes != null && hitInfo.damageTypes.Get(DamageType.Heat) > 0 && hitInfo.WeaponPrefab == null)
            {
                return false;
            }

            if (hitInfo.InitiatorPlayer != null)
            {
                if (hitInfo.InitiatorPlayer is JetPilot)
                    return false;
                if (hitInfo.InitiatorPlayer is BasePlayer)
                    return true;
            }

            return null;
        }

        private object CanEntityTakeDamage(JetPilot scientist, HitInfo hitInfo)
        {
            if (scientist == null || !_allNpc.Contains(scientist) || hitInfo == null)
                return null;

            if (hitInfo.damageTypes != null && hitInfo.damageTypes.Get(DamageType.Heat) > 0 && hitInfo.WeaponPrefab == null)
            {
                return false;
            }

            if (hitInfo.InitiatorPlayer != null)
            {
                if (hitInfo.InitiatorPlayer is JetPilot)
                    return false;
                if (hitInfo.InitiatorPlayer is BasePlayer)
                    return true;
            }

            return null;
        }

 

KpucTaJl

Posted

Thank you @Razor, later I will study this and update the plugin

KpucTaJl

Posted

@MrLiquid Hello everyone, sorry for the long answer, I was away, I studied the Razor code and I think this happens when an Npc from NpcSpawn deals damage to an Npc from the current event. If this is the case and you want the damage to be done, then NpcSpawn has the CanTargetOtherNpc parameter, which then should have the value true, if you do not want the damage to be done then you need to make changes to the code in the event plugin

KpucTaJl

Posted

Changed Status from Pending to Closed

1.7m

Downloads

Total number of downloads.

7.2k

Customers

Total customers served.

108.2k

Files Sold

Total number of files sold.

2.2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.