#GENERAL
*name        = "paint dealer";
*faction     = "good";

*rad         = 1.0;
*mass        = 10000000000.0;
*elasticity  = 0.1;
*drag        = 0.5;
*friction    = 8.5;
*hardness    = 0.0;

*model       = "npc_eyegang_c_01";
*model_col   = colorRGB( 0.7, 0.7, 1.0 );
*model_rot   = 180;
*model_scale = 1.0;



#ATTRIBUTE "attract";
#BASE      20.0;
#ATTRIBUTE "leak";
#BASE      0.0;
#ATTRIBUTE "speed";
#BASE      0.0;
#ATTRIBUTE "health";
#BASE      1000000000000000.0;
#ATTRIBUTE "res";
#BASE      1.0;
#ATTRIBUTE "rot_speed";
#BASE      100.0;
#ATTRIBUTE "exp";
#BASE      0.0;
#ATTRIBUTE "display damage";
#BASE      0;



#INTERACTION

#EVENT
##BEGIN

#PROMPT  "START";
#TEXT     avar("pd_opening_text");
#RESPONSE avar("pd_opening_target");
#GUARD    geq( char_get_attribute("player","money"), avar("pd_cost") );
#TEXT     avar("pd_opening_response");
#RESPONSE "";
#GUARD    and(
            less( char_get_attribute("player","paint max"), 1000 ),
            geq( char_get_attribute("player","money"), avar("pd_cost") )
            );
#TEXT     "No thanks.";
#RESPONSE "";
#GUARD    less( char_get_attribute("player","money"), avar("pd_cost") );
#TEXT     "Shucks, I don't have enough money.";
#RESPONSE "";
#GUARD    geq( char_get_attribute("player","paint max"), 1000 );
#TEXT     "Shucks.";


#PROMPT  "BUY1";
#TEXT     "Pleasure doing business with you.";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Set the new conversation text.
  avar( "pd_opening_text",     "Looking for some more paint?" );
  avar( "pd_opening_response", "You betcha. Here's 50" );
  avar( "pd_opening_target",   "BUY2a" );
#TEXT "Likewise.";


#PROMPT  "BUY2a";
#TEXT     "Whoa, not so fast. Fifty's just for first time customers. If you want another dose, it'll cost you 100.";
          avar( "pd_cost", 100 );
          avar( "pd_opening_text",     "100 bucks. Take it or leave it." );
          avar( "pd_opening_response", "Fine. Here's 100." );
          avar( "pd_opening_target",   "BUY2b" );
#RESPONSE "";
#GUARD    less( char_get_attribute("player","money"), avar("pd_cost") );
#TEXT     "Sorry, I don't have that kind of cash.";
#RESPONSE "";
#GUARD    geq( char_get_attribute("player","money"), avar("pd_cost") );
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Boost the price.
  avar( "pd_cost", 200 );
  // Set the new conversation text.
  avar( "pd_opening_text",     "Supply and demand. Paint'll cost you 200." );
  avar( "pd_opening_response", "Fine. Here's 200." );
  avar( "pd_opening_target",   "BUY3" );
#TEXT "Fine. Here's 100.";
#RESPONSE "";
#GUARD    geq( char_get_attribute("player","money"), avar("pd_cost") );
#TEXT     "Hmf, I don't need your stupid paint anyway.";


#PROMPT  "BUY2b";
#TEXT     "It's been a pleasure.";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Boost the price.
  avar( "pd_cost", 200 );
  // Set the new conversation text.
  avar( "pd_opening_text",     "Supply and demand. Paint'll cost you 200." );
  avar( "pd_opening_response", "Fine. Here's 200." );
  avar( "pd_opening_target",   "BUY3" );
#TEXT "Gimme.";


#PROMPT  "BUY3";
#TEXT     "I live to serve the customer.";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Boost the price.
  avar( "pd_cost", 400 );
  // Set the new conversation text.
  avar( "pd_opening_text",     "Do you know how much it costs to run a legitimate business in this town? Paint's 400." );
  avar( "pd_opening_response", "Whatever. Here's your money, where's my paint?" );
  avar( "pd_opening_target",   "BUY4" );
#TEXT "Mmmm...";


#PROMPT  "BUY4";
#TEXT     "Here you go.";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Boost the price.
  avar( "pd_cost", 800 );
  // Set the new conversation text.
  avar( "pd_opening_text",     "It's tough putting three eyelings through college. Paint's 800." );
  avar( "pd_opening_response", "It's worth it. Here's 800." );
  avar( "pd_opening_target",   "BUY5" );
#TEXT "Paint!!!";


#PROMPT  "BUY5";
#TEXT     "You know, you're my number one customer? Well, since Patches arrived, you've been my only customer.";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Boost the price.
  avar( "pd_cost", 1400 );
  // Set the new conversation text.
  avar( "pd_opening_text",     "Would you look at that, I'm almost out. That'll be 1400 bucks." );
  avar( "pd_opening_response", "Money means nothing!" );
  avar( "pd_opening_target",   "BUY6" );
#TEXT "Less talk, more paint!";


#PROMPT  "BUY6";
#TEXT     "Hey, don't waste that now.";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // Boost the price.
  avar( "pd_cost", 2000 );
  // Set the new conversation text.
  avar( "pd_opening_text",     "I've only got one tube left, and at this point I don't think I even need a reason to raise the price. It'll cost you 2000." );
  avar( "pd_opening_response", "I have no shame." );
  avar( "pd_opening_target",   "BUY7" );
#TEXT "Oh yeahhh...";


#PROMPT  "BUY7";
#TEXT     "That's it. You've eaten all my paint. I'm going to Eye-ruba!";
#RESPONSE "";
#ACTION
  // Give the player more health and take his money.
  char_set_attribute( "player", "paint max", add( char_get_attribute("player","paint max"), 100 ) );
  char_set_paint( "player", char_get_attribute("player","paint max") );
  char_set_attribute( "player", "money", sub( char_get_attribute("player","money"), avar("pd_cost") ) );
  // The dealer's done.
  char_kill( "paint dealer" );
#TEXT "I was thinking about quitting anyway.";


##END



#CONTROL "script";
##BEGIN

#SEQUENCE "base";
# wait( .15 );
# wait( .15 );
# // We just need to setup some global vars, here.
  avar( "pd_opening_text",     "Wanna buy some paint? This stuff is so strong it won't only fill you up, it'll actually boost your maximum capacity. So, how 'bout it? Fifty bucks a tube." );
  avar( "pd_opening_response", "Sure. Here's 50." );
  avar( "pd_opening_target",   "BUY1" );
  avar( "pd_cost", 50 );
# // We're done.
  this_control_jump(
    "range faction",
    "
      *faction = \"player\";
	",
    1
    );


##END
