! My Banker Script.
!
! (c) Wolfpack Software, 1997
!

!------------------------------------------------------------------------!
:@TALK ! Talk to the character !
!------------------------------------------------------------------------!

  if player.hp = 0 then
    writeln( player.name, " is dead!" );
    STOP;
  endif;

  if npc.count = 0 then
    L0 = msgbox( ERROR, 1, "Ok", "ERROR: NPC Script called with no NPC selected!" );
    STOP;
  endif;

  loadtext( npc.text ); ! Get the NPC's text block !
  loadvfl( npc.voice ); ! Get the NPC's voice block !

! First, say hello.. !
  if npc.picture >= 0 then
    viewpcx(npc);
  endif;


  if NPC.V0 > 0 then
      view_pcx(  "ANYFRAM3.PCX" );
      set_frame( "ANYFRAM3.PCX", 10, 10, 10, 10, 0 );
      pwriteln("Hello, ", player.name, "!");
      pause;
      paint(window);
  else
    G78 = 0;

      view_pcx(  "ANYFRAM2.PCX" );
      set_frame( "ANYFRAM2.PCX", 10, 10, 10, 10, 0 );
      pwriteln("Monsters take your money when you are defeated.");
      pause;
      paint(window);
      view_pcx(  "ANYFRAM3.PCX" );
      set_frame( "ANYFRAM3.PCX", 10, 10, 10, 10, 0 );
      pwriteln("Leave it here for safe keeping.");
      pause;
      paint(window);

    endif;


! Now, set some variables..
  NPC.V0 = 1; ! From know on, remember we've been here
  
! Then start a loop and show a menu..
:LOOP
  L3 = select( "Deposit", "Withdraw" );
  on L3 goto BUY, WDRAW;

! ESCape and BYE get's us out of here..
:CSTOP
  writeln( "Oh. You changed your mind." );
  stats(-1); ! Refresh Statistics !
  goto XSTOP;

!-------------------------------------------------!
! Player want's to buy something from us..        !
!-------------------------------------------------!
:BUY
  writeln( "How many gold pieces do you wish to deposit?");
  L0 = getnum( "How much?");
  if L0 * 10 > group.gold or L0 < 1 then
  writeln ("That transaction is invalid! Please try again.");
  timeck(18);
  goto BUY;
  endif;
  inc (G78, L0);
  dec (group.gold, L0 * 10) ;
  writeln("Thank you for your deposit.");
  pause;
  writeln("It will be here for you when you need it.");
  goto XSTOP;
  
:WDRAW

 if G78 = 0 then
 writeln("You have none deposited!");
 goto LOOP;
 endif;

 writeln("Your current balance is: ", G78, " gold pieces.");
 pause;
 writeln("How many GP do you wish to withdraw?");
 L1 = getnum("How much?");
 if L1 < 0 or L1 > G78 then
 writeln("That transaction is invalid. Please try again.");
 goto XSTOP;
 endif;
 dec (G78, L1);
 inc (group.gold, L1 * 10);
 writeln("Thank you for your business!");

 goto XSTOP;
 

  
!-----------------------------------------------------------------!
! All STOPs now lead here so the screen can be restored if needed !
!-----------------------------------------------------------------!
:XSTOP
  paint( large );
  STOP;




!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Now following Procedures included by DCGLink
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Source: geocities.com/timessquare/2795

               ( geocities.com/timessquare)