Setnpctimer

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

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

Syntax

  • setnpctimer <tick>{,"NPC Name"};

Description

The 'setnpctimer' is a command that will explicitly set a NPC timer to a given tick.

Example

This section may need to be updated. Please update this section to reflect recent events or newly available information, and remove this template when finished. Please see the talk page for more information.

Here is an example which will help you to understand how the setnpctimer command works.

OnTimer15000:
set $quote,rand(5);
if($quote == 0) goto Lquote0;
if($quote == 1) goto Lquote1;
if($quote == 2) goto Lquote2;
if($quote == 3) goto Lquote3;
if($quote == 4) goto Lquote4;
     Lquote0:
     npctalk "If 0 is randomly picked you will see this";
     setnpctimer 0;
     end;
     Lquote1:
     npctalk "If 1 is randomly picked you will see this";
     setnpctimer 0;
     end;
     Lquote2:
     npctalk "If 2 is randomly picked you will see this";
     setnpctimer 0;
     end;
     Lquote3:
     npctalk "If 3 is randomly picked you will see this";
     setnpctimer 0;
     end;
     Lquote4: 
     npctalk "If 4 is randomly picked you will see this";
     setnpctimer 0;
     end;