! Mercanary Script
!   Copyright (c)1997 AbyssWare
!   By: AbyssDragon
!       abyssdragon@juno.com   http://www.geocities.com/TimesSquare/2795
! Modified from civilian.scr by DCSoftware
!
! This is the script I use for mercanaries in my game. It's pretty basic.
! If you don't understand it, then you need to practice in DCGames Scripting
! some more.
! Npc.value contains the cost to hire
!------------------------------------------------------------------------!
:@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;

  if npc.picture >= 0 then
    viewpcx(npc);
  endif;


! Introduction.... Give options
  loadtext(npc.text);
  readtext( npc.text );
  pause;
  paint(window);
  S1 = swriteln( "If you need my services, then I go for ", npc.value, " gold.");
  L0 = msgbox( EXCLAMATION, 2, "Hire", "Cancel", S1);
  pause;
  paint(window);
  on L0 goto HIRE, XSTOP;
  goto XSTOP;
:HIRE
if group.gold < npc.value then
 L0 = msgbox( EXCLAMATION, 1, "Okay", "I don't work for free. Come back when you have the money.");   
 goto XSTOP;
else
 dec( group.gold, npc.value);
 JOIN;
endif;

!-----------------------------------------------------------------!
! All STOPs now lead here so the screen can be restored if needed !
!-----------------------------------------------------------------!
:XSTOP
  if npc.picture >= 0 then
    paint(window); ! Assumes the picture fits in the window !
  endif;
  stats(-1); ! Refresh Statistics !
  STOP;

    Source: geocities.com/timessquare/2795

               ( geocities.com/timessquare)