!Inkeeper script..
!   Copyright (c)1997 AbyssWare
!   By: AbyssDragon
!       abyssdragon@juno.com   http://www.geocities.com/TimesSquare/2795
! Modified from civilian.scr by DCSoftware
!
! This creates an inkeeper where the player can stay the night. It restores
! all statistics to full. If you've ever played the Final Fantasy series of
! games, this will be familiar. This shouldn't be too hard to figure out.
! Npc.value contains the cost for 1 night
!
!------------------------------------------------------------------------!
:@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;


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

  if NPC.V0 > 0 then
    S1 = swriteln( "Hello ", player.name, "." );
    L0 = msgbox( EXCLAMATION, 1, "Okay", S1 );
  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
  S1 = swriteln( "Rooms cost ", npc.value, ". Do you want to buy one?");
  L0 = MSGBOX( EXCLAMATION, 2, "Yes", "No", S1 );
  on L0 goto INNROOM, CSTOP;

! ESCape and BYE get's us out of here..
:CSTOP
  L0 = msgbox( EXCLAMATION, 1, "Okay", "Good bye. Come back again!");
  stats(-1); ! Refresh Statistics !
  goto XSTOP;

:INNROOM
if group.gold < npc.value then
 L0 = msgbox( EXCLAMATION, 1, "Okay", "You don't have enough money to pay for a room!");
 goto CSTOP;
endif;
dec( group.gold, npc.value );
! music( "sleep.mid" ):
wait( 3 );
foreach player do ! Refresh stats
 player.hp = player.mhp;
 player.man = player.mman;
 player.ac = player.mac + player.armor.ac + player.shield.ac;
 player.str = player.mstr;
 player.dex = player.mdex;
 player.int = player.mint;
endfor;
inc( minute, 480); ! 8 hours of sleep
inc(G150, 480);    ! This probably means nothing to you, in my script this
                   ! represents how long it has been since the player ate.
goto CSTOP;

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


    Source: geocities.com/timessquare/2795

               ( geocities.com/timessquare)