RustTip

OnFireBallDamage

OxideCarbonWeapon

Called when a fire ball is damaged.

void OnFireBallDamage(FireBall fireBall, BaseCombatEntity local4, HitInfo local2)
Works — the game method in this build is the one the hook was written for.

Parameters

fireBall
FireBall
local4
BaseCombatEntity
local2
HitInfo

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnFireBallDamage(FireBall fireBall, BaseCombatEntity local4, HitInfo local2)
{
    Puts("OnFireBallDamage");
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point

Rust.opj (Oxide)
void FireBall.DoRadialDamage()

Passes: FireBall fireBall, BaseCombatEntity local4, HitInfo local2

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, l4, l2)Assembly-CSharp.dll

Where it is called (this branch's game code)

// …
			float num = damagePerSecond * tickRate;
			if (item is BaseSiegeWeapon || item is BallistaGun)
			{
				num *= siegeWeaponDamageScale;
			}
			hitInfo.PointEnd = item.transform.position;
			hitInfo.HitPositionWorld = item.transform.position;
			hitInfo.damageTypes.Set(DamageType.Heat, num);
			Interface.CallHook("OnFireBallDamage", this, local4, hitInfo);
			item.OnAttacked(hitInfo);
		}
	}
	Pool.FreeUnmanaged(ref obj);
}

Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.