onGive2.c

grendel-1.0.0a7/progs/examples/onGive2.c · 461 B

From the archive grendel-1.0.0a7.zip

Download the archive   « Back to the archive contents

require "glib.c"

void onGive(external ch, external target, external obj)
{
  int x;
  int value;
  string objname;

  x = random(4);
  value = obj.Ocost;
  objname = obj.Oname;

  if(x == 1)
  {
    sleep(1);

    do("say most interesting...");
  }
  else
  {
    sleep(1);
   
    do("hmm");
  }

  sleep(1);

  do("say I would give " + value + " coins for it.");

  sleep(1);

  do("give '" + objname + "' " + target.Pname);
}

Site Stats

Snippets: 1791
Codebases: 571