Exemple #1
0
// This is the chat function dispatcher. If you use function type chat
// message, you can either define your own functions or use the default
// ones.
int intellgent_behavor()
{
        int enc,max;
        object *inv;
        enc = (int) query_encumbrance();
        max =  (int) query_max_encumbrance();
        if(enc * 3 < max)
        command("get all");
        return 1;
} 
Exemple #2
0
void init() {
 ::init();
   add_action("myput", "put");
   add_action("mytake", "take");
   add_action("mytake", "get");
}

void create() {
 ::create();
   set_name("magic bag");
   set_id( ({ "magic bag"}) );
   set_short("a magic bag");
   set_long("this magic bag will expand to fit anything and everyting "
            "you ever wanted.");
   set_mass(100+(int)query_encumbrance()/10);
   set_value(2343+random(100));
   set_max_encumbrance(1000+random(250)+random (175));
   set_prevent_put("I don't think you really want this in there!");
}

int move_all() {
int i,j;
object *things;
i = sizeof(things = all_inventory(this_object()));
if (i==O) return notify_fail("thre is nothing in there.\n");
for(j=O;j<i;j++) mytake(things[j]->query_name()+" from bag");
return 1;
}

int myput(string str) {