skullwarn.c

skylib_mudos_v1/mudlib/cmds/admin/skullwarn.c · 6.0 KB

From the archive skylib_mudos_v1.tar.gz

Download the archive   « Back to the archive contents

/*
 * Skullwarn - Shaydz
 *
 */

#include <playerinfo.h>

inherit COMMAND_BASE;

string reason;
object ob, Skull;

mixed cmd( string words ) {
    string player;
    
    if ( !words )
        return notify_fail( "Usage: skullwarn <player> (for) <reason>\n" );
    if (sscanf( words, "%s for %s", player, reason ) != 2)
        if (sscanf( words, "%s %s", player, reason ) != 2)
            return notify_fail( "Usage: skullwarn <player> (for) <reason>\n" );
    words = lower_case( words );
    ob = find_player( this_player()->expand_nickname( player ) );
    if(!ob) ob = find_living(this_player()->expand_nickname(player));
    if ( !ob )
        return notify_fail( player +" not found!\n" );
    
    if (ob->query_property("flaming skulled"))
        return notify_fail("This player is already being warned!\n");
    if(ob->query_name() == "death") {
        "/cmds/admin/swat"->cmd(this_player()->query_name()+" safer "
        "alternative than warning Death :P");
        /* VERY evil cackle */
        return notify_fail("Maybe that wasn't such a good idea.\n");
    }
  PLAYERINFO_HANDLER->add_entry(TP,
                                ob->query_name(),
                                "skullwarn",
                                reason);

    log_file( "WARNED", ctime( time() )+": "+this_player()->query_short()+
      " warned "+ob->query_short()+": "+reason+"\n");
    write("Warning player "+ob->query_name()+".\n");
    ob->add_property("flaming skulled",1);
    call_out("Lair_time", 5, 0);
    return 1;
}

varargs void pimp_shout( string words, object avoid ) {
    object thing, *things;
    things = users();
    foreach( thing in things ) {
        if ( ( thing != avoid ) && !thing->check_earmuffs( "shout" ) )
            thing->event_say( previous_object(), words, ({ }) );
    }
} /* pimp_shout() */

void Lair_time(int iteration) {
    switch (iteration) {
    case 0    : pimp_shout("You notice an extremely large %^BOLD%^%^RED%^flaming skull"
          "%^RESET%^ peek out from Shaydz's workroom.\n");
        break;
        
    case 1    : pimp_shout("The %^BOLD%^%^RED%^flaming skull%^RESET%^ starts "
          "moving downward toward the ground.\n");
        break;
        
    case 2    : pimp_shout("The %^BOLD%^%^RED%^flaming skull%^RESET%^ stops "
          "descending and hovers around twenty feet above the ground, skimming quickly "
          "over the ground.\n");
        tell_object(ob, "You get the feeling that it is watching you.\n");
        break;
        
    case 3    : pimp_shout("The %^BOLD%^%^RED%^flaming skull%^RESET%^ glides "
          "swiftly above the ground.\n");
        Skull = clone_object( NPC_OBJ );
        Skull->set_name("skull");
        Skull->set_short("enormously large %^BOLD%^%^RED%^flaming skull%^RESET%^");
        Skull->set_long("An insanely huge %^BOLD%^%^RED%^"
          "flaming skull%^RESET%^.  It appears to be focusing "
          "entirely on "+ob->query_cap_name()+
          " with great severity.\n");
        Skull->add_property("there","floating in mid-air");
        Skull->set_race("demon");
        Skull->add_skill_level("general.health",999);
        Skull->add_skill_level("general.language.common.spoken",1000);
        Skull->set_level(5000);
        break;
        
    case 4 : pimp_shout("The %^BOLD%^%^RED%^flaming skull%^RESET%^ coasts for "
          "a moment, finally stopping directly over "+
          ob->query_cap_name()+"'s head.  You think "
          "you can see "+ob->query_cap_name()+
          " pissing "+ob->query_possessive()+
          " pants.\n",ob);
        tell_object(ob,"The %^BOLD%^%^RED%^"
          "flaming skull%^RESET%^ lurches forward, coming to rest "
          "an arms-length over your head.  It is staring "
          "menacingly at you, and you can feel a warm "
          "dribbling going down your leg.\n");
        Skull->move(environment(ob));
        break;
        
    case 5    : Skull->move(environment(ob));
        Skull->do_command("glare "+ob->query_name());
        pimp_shout("The %^RED%^%^BOLD%^flaming skull%^RESET%^ glares at "
          +ob->query_cap_name()+", who, amazingly, "
          "has not passed out yet.\n",ob);
        break;
        
    case 6    : pimp_shout("The %^RED%^%^BOLD%^flaming skull%^RESET%^ appears "
          "to be shouting at "+ob->query_cap_name()+".\n",ob);
        
        Skull->move(environment(ob));
        Skull->do_command("scream %^BOLD%^YOU KNOW, YOU REALLY "
          "SHOULDN'T HAVE DONE WHAT YOU DID.%^RESET%^");
        break;
        
    case 7    : Skull->move(environment(ob));
        Skull->do_command("scream %^BOLD%^IN FACT, YOU "
          "PROBABLY WOULD HAVE BEEN PUNISHED MORE SEVERELY.%^RESET%^");
        break;
        
    case 8    : Skull->move(environment(ob));
        Skull->do_command("scream %^BOLD%^HOWEVER, THIS TIME "
          "YOU SEEM TO HAVE GOTTEN OFF WITH JUST A WARNING.");
        pimp_shout("The %^RED%^%^BOLD%^flaming skull%^RESET%^ gives "
          +ob->query_cap_name()+" a good lecture.%^RESET%^\n",ob);
        break;
        
    case 9    : Skull->move(environment(ob));
        Skull->do_command("scream %^BOLD%^IF I WERE YOU, I'D "
          "NEVER GET CAUGHT FOR '"+reason+"' AGAIN.  CONSIDER "
          "YOURSELF LUCKY THIS TIME.%^RESET%^");
        break;
        
    case 10   : pimp_shout("The enormously large %^RED%^%^BOLD%^flaming skull"
          "%^RESET%^ loses the ferocious glare in its eyes, its "
          "piece having been said.  It ascends back into the "
          "sky.%^RESET%^\n",ob);
        tell_object(ob,"As the enormously large %^BOLD%^%^RED%^"
          "flaming skull%^RESET%^ ascends back into the "
          "sky, you find yourself unable to stand and collapse "
          "onto the ground.%^RESET%^\n");
        Skull->move("/room/rubbish");
/*  DO NOT UNCOMMENT THESE ON PAIN OF DEATH - Shaydz
        ob->adjust_tmp_dex(-5);
        ob->adjust_tmp_con(-5);
        ob->adjust_tmp_wis(-5);
        ob->adjust_tmp_int(-5);
        ob->adjust_tmp_str(-5);
*/
        ob->remove_property("flaming skulled");
        break;
    }
    if (iteration < 10) call_out("Lair_time",5,iteration + 1);
}

Site Stats

Snippets: 1791
Codebases: 571