RustTip

OnNpcConversationEnded

OxideCarbonNPC

Called when an npc conversation ends.

void OnNpcConversationEnded(NPCTalking nPCTalking, BasePlayer player)
Method changed — check — the game method differs from the one the hook is recorded for in Oxide. The hook is still called, but its place may have shifted — worth checking after an update.

Parameters

nPCTalking
NPCTalking
player
BasePlayer

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnNpcConversationEnded(NPCTalking nPCTalking, BasePlayer player)
{
    Puts("OnNpcConversationEnded");
}

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

Injection point

Rust.opj (Oxide)
void NPCTalking.Server_OnConversationEnded(BasePlayer)

Passes: NPCTalking nPCTalking, BasePlayer player

Method changed — checkReturnBehavior: ContinueArgumentBehavior: AllAssembly-CSharp.dll

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

public virtual void Server_OnConversationEnded(BasePlayer player)
{
	Interface.CallHook("OnNpcConversationEnded", this, player);
	if (player != null && conversingPlayers.Contains(player))
	{
		player.ClearActiveTalkingToNpc(this);
		conversingPlayers.Remove(player);
		player.SendConversationEnd();
		if (phoneConversingPlayers.Remove(player, out var value) && value != null)
		{
			value.OnNPCConversationEnded();
// …

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.