Author Topic: Buzzzzzz.....  (Read 3795 times)

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Buzzzzzz.....
« on: March 13, 2009, 11:47:59 pm »
This is my old mosquito NPC from Nightmare 3.3, back in 1995.  It was amusing.  My co-wizards didn't like it much...

Code: [Select]
inherit "/std/monster";

create() {
  set_name("mosquito");
  set_id( ({ "mosquito", "bug" }) );
  set_short("A bloodsucking mosquito");
  set_long("She is a nasty little bug, out for blood!\n");
  set("race", "bug");
  set_gender("female");
  set_alignment(-100);
  set("aggressive", 100);
  set_speed(30);
  set_moving(1);
  set_level(1);
  set_max_hp(15);
  set_hp(15);
  set_max_mp(100);
  set_mp(100);
  set_overall_ac(1);
  set_skill("defense", 60);
  set_stats("dexterity", 40);
  add_limb("head", "FATAL", query_max_hp()/2, 0, query_level());
  add_limb("torso", "FATAL", query_max_hp()+5, 0, query_level());
  add_limb("left front leg", "left front pincer", query_max_hp()/3, 0, query_level());
  add_limb("left front pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("right front leg", "right front pincer", query_max_hp()/3, 0, query_level());
  add_limb("right front pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("left centre leg", "left centre pincer", query_max_hp()/3, 0, query_level());
  add_limb("left centre pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("right centre leg", "right centre pincer", query_max_hp()/3, 0, query_level());
  add_limb("right centre pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("left rear leg", "left rear pincer", query_max_hp()/3, 0, query_level());
  add_limb("left rear pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("right rear leg", "right rear pincer", query_max_hp()/3, 0, query_level());
  add_limb("right rear pincer", "", query_max_hp()/4, 0, query_level());
  add_limb("beak", "", query_max_hp()/4, 0, (query_level() + query_level()/4));
  add_limb("stinger", "", query_max_hp()/4, 0, query_level());
  set_fingers(2);
  set_wielding_limbs( ({ "front left pincer", "centre left pincer",
                         "front right pincer", "centre right pincer",
                         "beak", "stinger" }) );
  set_spell_chance(5);
  set_spells( ({ "missile", "shock" }) );
  set_chats( 15, ({ "Buzz.\n", "BUZZ!\n", "Hmmmmmmmm\n", "BZZZZZZZZZZ!!!\n" }));
}

void init() {
  if((int)this_player()->query_level() < 10 ) {
    if((string)this_player()->query_name() == "mosquito") return;
    this_object()->kill_ob(this_player(), 0);
  } else {
    switch((string)this_player()->query_position()) {
      case "arch":
      case "wizard":
        if(!random(20)) {
          call_out("god_death_1", 1, this_player());
        }
      break;
      default:
        say("An annoying mosquito dodges away from "+
            this_player()->query_cap_name()+".\n", this_player());
    }
  }
}

void god_death_1(object pl) {
  tell_room(environment(this_object()),
            "The nasty mosquito looks hungrily at the immortal "+
            pl->query_cap_name()+ ".\n");
  call_out("god_death_2", 5, pl);
}

void god_death_2(object pl) {
  tell_room(environment(this_object()),
            "The little bug imagines the sweet taste of "+
            pl->query_cap_name()+ "'s blood...\n");
  call_out("god_death_3", 4, pl);
}

void god_death_3(object pl) {
  tell_room(environment(this_object()),
            "The evil mosquito performs a kamakazi attack on the immortal "+
            pl->query_cap_name()+ "\nand gets a critical hit, "+
            "slaying the mighty god even as she dies in agony!\n",
            pl);
  tell_player(pl, "Bad luck for you!  The tiny mosquito "+
                  "commits suicide, but she gets a critical hit\nand "+
                  "takes you with her!\n");
  pl->quit();
  this_object()->remove();
}

void catch_tell(string str) {
  object ob;
  string who;

  if(!interact("enters", str)) return;
  sscanf(str, "%s enters%*s", who);
  who = lower_case(who);
  ob= present(who, environment(this_object()));
  if(!ob) {
    if(!interact("appears", str)) return;
    sscanf(str, "%s appears%*s", who);
    who = lower_case(who);
    ob= present(who, environment(this_object()));
  }
  if(!ob) return;
  if((int)ob->query_level() < 10 ) {
    if((string)ob->query_name() == "mosquito") return;
    this_object()->kill_ob(ob, 0);
  } else {
    switch((string)this_player()->query_position()) {
      case "arch":
      case "wizard":
        if(!random(20)) {
          call_out("god_death_1", 1, this_player());
        }
        break;
      default:
        say("An annoying mosquito dodges away from "+
            this_player()->query_cap_name()+".\n", this_player());
    }
  }
}

Offline shadyman

  • Friend
  • **
  • Posts: 50
    • View Profile
Re: Buzzzzzz.....
« Reply #1 on: May 28, 2009, 09:42:54 pm »
They didn't like THAT? I can't imagine why.  ::)