troll.c

ds2.9a10/lib/domains/town/npc/troll.c · 1.1 KB

From the archive ds2.9a10.zip

Download the archive   « Back to the archive contents

#include <lib.h>

inherit LIB_NPC;
object gdude;


int nasty(object dude){
    gdude = dude;
    eventForce("look at "+gdude->GetKeyName());
    eventForce("drool");
    return 1;
}
int CheckHuman(mixed val){
    if(!val) return 0;
    if(!objectp(val)) return 0;
    gdude = val;
    if(val->GetRace() != "human") return 0;
    else { 
        call_out( (: nasty, gdude :) , 2);
    }
    return 1;
}
static void create() {
    npc::create();
    SetKeyName("troll");
    SetId(({"troll"}));
    SetAdjectives(({"dirty"}));
    SetShort("a mean-looking troll");
    SetLong("This is the dreaded creature of legend: a slimy, "
      "green, putrid-looking fiend with long, razor-"
      "sharp claws and fangs.");
    SetLevel(3);
    SetRace("troll");
    SetClass("fighter");
    SetGender("male");
    SetMelee(1);
    SetEncounter(  (: CheckHuman :) );
    SetSkill("melee attack",50,50,10);
    SetStat("strength",50,1);
    SetStat("agility",50,1);
    SetStat("coordination",50,1);
    SetStat("speed",50,1);
    AddCurrency("silver",221+random(157));
}
void init(){
    ::init();
}

Site Stats

Snippets: 1791
Codebases: 571