home *** CD-ROM | disk | FTP | other *** search
/ Informática Multimedia: Special Games (Alt) / INFESPGAMES.iso / dos / varios / dcworld / examples / jimmy.scr < prev    next >
Encoding:
Text File  |  1993-03-13  |  6.0 KB  |  165 lines

  1. !
  2. ! Jimmy's Script.  Derived from the adventurer script, but modified to
  3. ! to handle the one character.
  4. !
  5. ! DESCRIPTION:  Jimmy is a young Dwarf.  He lives near a small town 
  6. ! and works at Joe's pub.  He is the player's friend and want's to
  7. ! go have some fun.  His TEXT block shows the following keywords:
  8. !
  9. !  0 : Hello   Hi! What are you up to? Going on a trip?                
  10. !  1 : Default Have I shown you my weapons?  I'm dying to use them!    
  11. !  2 : Weapons In the chest over there.. Let's go do something..       
  12. !  3 : Join    What are we waiting for.. Let's get the weapons..       
  13. !  4 : Chest   I keep the weapons in the chest.  We could get them!    
  14. !  5 : Get     If we go on a quest, we should get them.                
  15. !  6 : Quest   You know.. Go kill some monsters or something..         
  16. !  7 : King    I heard he was missing!  That might be a worthy quest!  
  17. !  8 : Queen   We could go talk to her in the Castle!                  
  18. !  9 : Castle  Where the King and the Queen live!                      
  19. ! 10 : Trip    You're not thinking of leaving without me, are you?     
  20. ! 11 : AdventurIt's a good time of the year to go look for adventure!  
  21. ! 12 : Job     Joe can find another bus boy.  Let's go questing!       
  22. ! 13 : Joe     You know I work at Joe's Pub during the summer!         
  23. ! 14 : Pub     Yes!                                                    
  24. ! 15 : Ship    I don't have one, but the Queen might lend us one!      
  25. !
  26. ! - V0 is TRUE when we've talked before.
  27. ! - V1 is TRUE if we've JOINED the group
  28. !
  29. ! (c) DC Software, 1992
  30. !
  31.  
  32. !------------------------------------------------------------------------!
  33. :@TALK ! START HERE WHEN YOU 'TALK' TO THIS CHARACTER !
  34. !------------------------------------------------------------------------!
  35.  
  36. ! First, say hello.. !
  37.  
  38.   if NPC.V0 > 0 then
  39.     ! We've spoken before, so don't give the standard greeting..
  40.     writeln( "Hello again!  I thought you were gone.." );
  41.   else
  42.     ! First time we talk, so give the standard greeting..
  43.     if not dotext( "Hello" ) then
  44.       ! If the text block didn't have one, the following would be used..
  45.       writeln( "Hello ", player.name, ". What are you up to?" );
  46.     endif;
  47.   endif;
  48.   NPC.V0 = 1; ! This variable indicates we've talked before (see above)
  49.  
  50. :CHAT
  51.   L3 = getstr("Name","Job","Join","Bye");
  52.   if L3 = -1 goto CSTOP; 
  53.  
  54. ! Handle JOIN differently..
  55.   if L3 = 2 then 
  56.     if group.size = 6 then
  57.       writeln( "Hey! Your party is full! There's no place for me!" );
  58.       goto CHAT;
  59.     endif;
  60.     if npc.level > player.level + 4 then
  61.       ! Normal behaviour would be to decline until adventurer has more
  62.       ! experience, but Jimmy is a friend, so it doesn't apply
  63.       writeln( "Ok.  But you are inexperienced, so let me handle the tough" );
  64.       writeln( "problems.  You'd better take the better armor too.." );
  65.     endif;
  66.     if npc.level < player.level - 6 then
  67.       ! Normal behaviour would be to decline because the adventurer
  68.       ! has too much experience.  Encounters tend to be more serious
  69.       ! and inexperienced members get killed easily.  Again, since
  70.       ! Jimmy is a friend, we wave the restriction..
  71.       writeln( "You mean it?!  I don't have a lot of experience, but I learn" );
  72.       writeln( "very fast..  Thanks!" );
  73.     endif;
  74.     if NOT dotext( "join" ) then
  75.       writeln( "What are we waiting for.. Let's get the weapons!" );
  76.     endif;
  77.     ! If were at the original location, and haven't joined yet.. !
  78.     if npc.v1 = FALSE and npc.x = 3 and npc.y = 7 then
  79.       L1 = 1; ! walk to the right.. !
  80.       for L0 = 1 to 4 do
  81.         gosub MOVEJIMMY;
  82.       endfor;
  83.       L2 = 0;
  84.       L1 = find( object, "Jimmy's Chest", CHEST );
  85.       if success then
  86.         object.index = L1;
  87.         writeln( "I have ", $object.value, " saved from my summer job.." );
  88.         inc( group.gold, object.value );
  89.         vanish(object);
  90.         pause(1); ! Use PAUSE instead of WAIT !
  91.       else
  92.         writeln( "I could have sworn I had some money in here.." );
  93.         inc(L2);
  94.       endif;
  95.       L1 = find( object, "Chain Mail", armor );
  96.       if success then
  97.         object.index = L1;
  98.         writeln( "This Chain Mail is worn, but functional!" );
  99.         move( object, npc ); pause(1); ! Use PAUSE instead of WAIT !
  100.       else
  101.         writeln( "My chain mail is missing..  Hmm.." );
  102.         inc(L2);
  103.       endif;
  104.       L1 = find( object, "Dwarf's Axe", weapon );
  105.       if success then
  106.         object.index = L1;
  107.         writeln( "This Axe belonged to my brother..  It's heavy!" );
  108.         move( object, npc ); pause(1); ! Use PAUSE instead of WAIT !
  109.       else
  110.         writeln( "Where did I put that Axe?" );
  111.         inc(L2);
  112.       endif;
  113.       if L2 > 0 then
  114.         if L2 = 3 then
  115.           writeln( "I assume you already got my stuff" );
  116.         else
  117.           writeln( "Some of my stuff is missing, I assume you got it?" );
  118.         endif;
  119.         pause(1); ! Use PAUSE instead of WAIT !
  120.       endif;
  121.       L1 = -1; ! Walk to the left.. !
  122.       for L0 = 1 to 4 do
  123.         gosub MOVEJIMMY;
  124.       endfor;
  125.       npc.v1 = TRUE;
  126.     endif;
  127.     JOIN; 
  128.     STOP; ! We are done.. !
  129.  
  130. :MOVEJIMMY ! Subroutine to move jimmy left or right..
  131.     if group.y = npc.y and group.x = npc.x + L1 then
  132.       group.x = npc.x; ! Trade places with the group !
  133.     endif;
  134.     inc( npc.x, L1 );
  135.     pause(1); ! Use PAUSE instead of WAIT !
  136.     return;
  137.  
  138.   endif; ! End of JOIN !
  139.  
  140. ! First, see if the keyword typed is in the character's text block !
  141.   if dotext( S0 ) goto CHAT;
  142.  
  143. ! It didn't, so try the predefined ones..
  144.   on L3 goto CNAME, CJOB, CHAT, CSTOP;
  145.  
  146. ! Nope, try a 'DEFAULT' line
  147.   if not dotext( "DEFAULT" ) then
  148.     writeln( "I don't know anything about that!" );
  149.   endif;
  150.   goto CHAT;
  151.  
  152. :CNAME
  153.   writeln( "My name is ", NPC.name, "." );
  154.   GOTO CHAT;
  155.  
  156. :CJOB
  157.   writeln( "I am a ", npc.type );
  158.   GOTO CHAT;
  159.  
  160. :CSTOP
  161.   writeln( "Nice talking to you.." );
  162.   STOP;
  163.  
  164. ! Feel free to expand on this list.. !
  165.