Detachnpctimer

From Hercules Wiki
Revision as of 08:12, 9 June 2013 by Via (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Syntax

  • detachnpctimer {"<NPC name>"};

Description

Use to remove the RID attached to an NPC used by "attachnpctimer {"<character name>"};" You can only use this when the NPC Timer is not running, use "stopnpctimer" to stop the NPC Timer.

Examples

<NPC Header> {
	// We need to use attachnpctimer because the mes command below needs RID attach
	attachnpctimer;
	initnpctimer;
	npctalk "I cant talk right now, give me 10 seconds";
	end;
OnTimer5000:
	npctalk "Ok 5 seconds more";
	end;
OnTimer6000:
	npctalk "4";
	end;
OnTimer7000:
	npctalk "3";
	end;
OnTimer8000:
	npctalk "2";
	end;
OnTimer9000:
	npctalk "1";
	end;
OnTimer10000:
	stopnpctimer;
	mes "[Man]";
	mes "Ok we can talk now";
	detachnpctimer;
	// and remember attachnpctimer and detachnpctimer can only use while the NPC timer is not running !
}