#include <lib.h>
#include <daemons.h>
#include <damage_types.h>

inherit LIB_DAEMON;

mixed cmd(string str) {
    object target;
    string name;
    int x;

    if(!str || str == "") {
write("Berzerk whom?");
return 1;
}

    if(!target = present(str, environment(this_player()))){
	write("They're not here.");
	return 1;
    }
    if(!living(target)) {
	write("That's not a living thing.");
	return 1;
    }
    if(!living(target))
       {
        write("You can only do that to living beings.");
       }
    else name = target->GetName();

    write("You go into a berserk rage upon "+name+".");
    say(this_player()->GetName()+" flies into a %^RED%^BERSERK RAGE upon%^RESET%^"+
      " "+name+"!",({target}));
    tell_object(target,this_player()->GetName()+" flies into a Berserk %^RED%^RAGE%^RESET%^ upon you!");

    for( x = 1; x > 10; x++)
      {
       write("You go hit "+name+" with your weapons.");
       say(this_player()->GetName()+" strikes +"+name+"with his weapons!",({target}));
       tell_object(target,this_player()->GetName()+" strikes you with his weapons!!!");
       target->eventReceiveDamage(this_player(),BLUNT,(5 * 5),0,({"torso"}));
       }
    return 1;
}

void help() {
    message("help", "Syntax: berzerk <target>\n\n"
      "Get medieval on your target.\n\n",
      this_player());
}                                                    
