Jump to content

Can you please

Closed 2.5.5

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

Share this comment


Link to comment
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;
        }

 

Share this comment


Link to comment

@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

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.7k

Customers

Total customers served.

82.4k

Files Sold

Total number of files sold.

1.6m

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.