home *** CD-ROM | disk | FTP | other *** search
- # Droids COG Script
- #
- # 00_HelptextTimer.cog
- #
- # Displays Help messages with optional timeouts
- #
- # Desc (original):
- # Two sectors, startsector and startsecotr2 will trigger the message number
- # specified by messagenumber. The stopsectors display message 0, effectively
- # turning it off.
- #
- # Desc (Timer version):
- # There are now two new variables, displaytime and show_once.
- # Displaytime, if set to a number larger than 0, will only
- # display the message for the number of seconds it's set to.
- # Show_once, if set to 1, will display the message only once then never
- # display it again.
- #
- # [MT] Created
- # 11/03/97 [DGS] Added Printtext commands for debugging
- # 11/04/97 [DGS] Added two more start and stop sectors
- # 12/03/97 [DGS] Modified "Helptext" to add timeouts and one-offs (see desc. above).
- # 03/10/98 [JP] Modified to add 2nd message.
- # ========================================================================================
-
- symbols
- message entered
- message timer
- message startup
-
-
- sector startsector linkid=1
- sector stopsector linkid=2
-
- int messagenumber
- int displaytime=0
- int show_once=0
-
- cog cammy
-
- end
-
-
- code
-
-
- startup:
- player=getlocalplayerthing();
- if (!GetInv(GetLocalPlayerThing(), 21))
- {
- //Player hasn't visited the training ground before
- SetInv(GetLocalPlayerThing(), 21, 1);
- dwplaycammyspeech(16000, "TGCA001.wav", 5, 2);
- settimer(8);
- }
-
- else
- {
- randx=rand();
- if (randx> 0.75)
- {
- dwplaycammyspeech(16111, "TGCA005.wav", 3, 2);
- sleep(2);
- sendmessage(cammy, user1);
- }
-
- else if (randx> 0.5)
- {
- dwplaycammyspeech(16002, "TGCA006.wav", 3, 2);
- sleep(2);
- sendmessage(cammy, user1);
- }
-
- else if (randx> 0.25)
- {
- dwplaycammyspeech(16003, "TGCA007.wav", 3, 2);
- sleep(2);
- sendmessage(cammy, user1);
- }
-
- else
- {
- dwplaycammyspeech(16004, "TGCA008.wav", 3, 2);
- sleep(2);
- sendmessage(cammy, user1);
- }
- }
-
- return;
-
- timer:
- dwplaycammyspeech(16100, "TGCA020.wav", 3, 2);
- sleep(22);
- sendmessage(cammy, user1);
- print("sent");
- return;
-
-
- end
-
-
-
-
-