Example #1
0
mixed do_reload_obj(object ob) {
    string s1,s2, foo = "Null object: ";
    if(ob && ob->GetDoor()) ob = load_object(ob->GetDoor());
    if(!creatorp(this_player()) && strsrch(base_name(ob), homedir(this_player()))){
        write("Builders can only reload things that belong to them.");
        return 1;
    }
    if(!ob || userp(ob)) {
        if(ob) foo = base_name(ob)+": ";
        if(!quiet){
            write(foo+"Invalid for reloading.");
        }
        return -1;
    }
    if(ob && ob->GetDirectionMap()){
        write(base_name(ob)+" is a virtual room, and not subject to normal reloading.");
        return 1;
    }
    if(!strsrch(base_name(ob),"/open") ||
            sscanf(base_name(ob),"/realms/%s/tmp/%s",s1,s2) == 2){
        write(base_name(ob)+" is a temp file and not subject to reloading.");
        return 1;
    }
    reload(ob, 0, quiet);
    if(ob && inherits(LIB_DOOR,ob)){
        string *doors = environment(this_player())->GetDoors();
        if(!sizeof(doors)) return 1;
        foreach(string dir in doors){
            string substr = environment(this_player())->GetDoor(dir);
            if(last(substr,2) == ".c") substr = truncate(substr,2);
            if(substr == base_name(ob)){
                reload(load_object(environment(this_player())->GetExit(dir)));
                reload(environment(this_player()));
            }
        }
Example #2
0
varargs mixed do_codesay_str(string str) {
    string filename = DIR_TMP + "/" + this_player()->GetKeyName() + ".codesay";
    if( !str ) {
        write("Huh?");
        return 1;
    }
    if(!creatorp(this_player())) {
        write("This is a command for creators.");
        return 1;
    }
    if(strsrch(str,";") == -1){
        write("You codesay: "+"%^BOLD%^CYAN%^"+str+"%^RESET%^");
        say(this_player()->GetCapName()+" codesays: "+
                "%^BOLD%^CYAN%^"+str+"%^RESET%^");
    }
    else {
        str = replace_string(str, ";", ";\n");
        str = replace_string(str, "{", "{\n");
        str = replace_string(str, "}", "}\n");
        write_file(filename,str,1);
        write_file(filename+"_rule","I",1);
        load_object(CMD_LSED)->cmd(filename+"_rule "+filename);
        write("You codesay: ");
        say(this_player()->GetCapName()+" codesays: ");
        tell_room(environment(this_player()),"\n"+
                "%^BOLD%^CYAN%^"+read_file(filename)+"%^RESET%^");
    }
    return 1;
}
Example #3
0
mixed cmd(string args) {
    string *lines, *arr, *limbs;
    object ob, *candidates;
    string tmp1, tmp2, gold;
    int i, x, y, cols;

    if( args == "" || !args || args == "me" ) ob = this_player();
    else if(args && !creatorp(this_player())) {
        write("You can only stat yourself.");
        return 1;
    }
    if(!environment(this_player())){
        write("You have no environment. Stats are the least of your worries.");
        return 1;
    }
    gargs = args;
    candidates = filter(get_livings(environment(this_player())),
            (: answers_to(gargs, $1) :) );
    if(!ob && sizeof(candidates)) ob = candidates[0];
    else if( !ob && !(ob = present(args, environment(this_player()))) )
        if( !(ob = find_player(convert_name(args))) &&
                !(ob = find_living(lower_case(args))) &&
                !(ob = find_object(args)) )
            return capitalize(args) + " is nowhere to be found.";
    if(!living(ob)) return capitalize(args) + " is not alive.";
    cols = (this_player()->GetScreen())[0];
    tmp1 = ob->GetCapName() + " aka " + ob->GetShort() +
        ", level " + ob->GetLevel() + " " + ob->GetGender();
    if( !(tmp2 = ob->GetRace()) ) tmp2 = "blob";
    tmp1 += " " + tmp2;
    if( !(tmp2 = ob->GetClass())  || !stringp(tmp2)) tmp2 = "drifter";
    tmp1 += " " + capitalize(tmp2);
    if( tmp2 = ob->GetSpouse() )
        tmp1 += " (spouse: " + tmp2 + ")";
    lines = ({ center(tmp1, cols) });
Example #4
0
 foreach(object ob in living_stack){
     if(playerp(ob) && !creatorp(ob) && !present("testchar badge",ob) &&
       !member_group(ob,"TEST")) {
         message("info","Putcri Brothers' back room is for authorized personnel only.", ob); 
         return 0;
     }
 }
Example #5
0
string GetHelp() {
    string cre = "$P shows current working directory\n"+
        "To have your creator character's name "+
        "and current dir show up:\nprompt $N $P >\nIn yellow:\n"+
        "prompt %%^^YELLOW%%^^$N $P >%%^^RESET%%^^";
    if(!creatorp(this_player())) cre = "";
    return ("Syntax: prompt [options]\n\n"
            "This command allows you to customize your prompt. You may use a static prompt:\n"
            "prompt >\n"
            "Or you may choose special tokens for an active prompt. The tokens available are:\n"
            "$V shows invis status\n"
            "$D shows the date (for the server, not the game)\n"
            "$T shows the time (for the server, not the game)\n"
            "$C shows the command number\n"
            "$H shows maximum health points\n"
            "$h shows current health points\n"
            "$G shows maximum magic points\n"
            "$g shows current magic points\n"
            "$I shows maximum stamina points\n"
            "$i shows current stamina points\n"
            "$M shows the mud name\n"
            "$N shows the player's name\n"
            +cre+
            "\nFor tactical info as a player:\n" 
            "prompt hp:$h/$H mp:$g/$G sp:$i/$I > \n"
            "or: prompt status\n\n"
            "You can colorize elements of the prompt with the "
            "appropriate color tags, for example:\n"
            "prompt %%^^RED%%^^$M %%^^RESET%%^^ >\n"
            "\nSee also: reprompt, env, colors");
}
Example #6
0
mixed CanEquip(object who, string array limbs){
    if(who && !creatorp(who) && !member_group(who,"TEST")){
        return "Somehow it just won't go on. Strange, isn't it?";
        return 0;
    }
    else return armor::CanEquip(who, limbs);
}
Example #7
0
mixed cmd(string str) {
    object target;

    if(!str || str == "") str = "me";

    if(str == "me") str = this_player()->GetKeyName();
    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(creatorp(target) && !archp(this_player()) &&
            target != this_player()){
        write("That's impolite.");
        tell_player(target,capitalize(this_player()->GetKeyName())+
                " just tried to anglicize you.");
        return 1;
    }

    target->SetNativeLanguage("English");
    if(target == this_player()) str = "yourself";
    else str = capitalize(str);
    write("You anglicize "+str+".");
    if(target != this_player()) 
        tell_object(target, capitalize(this_player()->GetKeyName())+" anglicizes you.");
    return 1;
}
Example #8
0
File: env.c Project: Elohim/FGmud
mixed cmd(string args) {
    object player = this_player();
    mixed replee = player->GetProperty("reply");
    string ret = "";
    string *tmp;
    ret += "Screen: \t\t"+identify(this_player()->GetScreen())+"\n";
    ret += "Terminal: \t\t"+this_player()->GetTerminal()+"\n";
    ret += "Brief mode: \t\t"+ ( (this_player()->GetBriefMode()) ? "on" : "off" )+"\n";
    ret += "Cursefilter: \t\t"+ ( (this_player()->GetParanoia("cursefilter")) ? "on" : "off" )+"\n";
    ret += "Channel message colors: "+ ( (this_player()->GetNoChanColors()) ? "off" : "on" )+"\n";
    ret += "Playerkiller mode: \t"+ ( (this_player()->GetPK()) ? "on" : "off" )+"\n";
    ret += "Mute mode: \t\t"+ GetMuted()+" \n";
    ret += "Gag mode: \t\t"+ GetGagged()+" \n";
    ret += "Wimpy mode: \t\t"+ ( (this_player()->GetWimpy()) ? "on" : "off" )+"\n";
#if efun_defined(compressedp)
    ret += "MCCP mode: \t\t"+(compressedp(this_player()) ? "on" : "off")+"\n";
#endif
#if MINIMAP
    ret += "Minimap mode: \t\t"+ ( this_player()->GetProperty("minimapping") ? "on" : "off" )+"\n";
#endif
    ret += "Annoyblock: \t\t"+ ( (this_player()->GetAnnoyblock()) ? "on" : "off" )+"\n";
    ret += "Reprompt mode: \t\t"+ ( this_player()->GetProperty("reprompt") ? "on" : "off" )+"\n";
    ret += "Screenlock mode: \t"+ ( this_player()->GetProperty("screenlock") ? "on" : "off" )+"\n";
    ret += "Timezone: \t\t"+ ( this_player()->GetProperty("timezone") ? 
            this_player()->GetProperty("timezone") : "None specified" )+"\n";
#ifdef __GET_CHAR_IS_BUFFERED__
    ret += "Charmode: \t\t"+ 
        //( (query_charmode(player) > 0) ? "on" : "off" )+"\n";
        ( (player->GetCharmode()) ? "on" : "off" )+"\n";
#endif
    ret += "Commandecho: \t\t"+ ( this_player()->GetProperty("commandecho") ? this_player()->GetProperty("commandecho") : "off" )+"\n";
#ifdef __DSLIB__
    ret += "Keepalive mode: \t"+ ( this_player()->GetProperty("keepalive") 
            ? this_player()->GetProperty("keepalive") : "off" )+"\n";
#endif

    if(creatorp(this_player())){ 
        ret += "Homedir: \t\t"+user_path(this_player())+"\n";
        if(this_player()->GetParanoia("homeroom")){
            ret += "Homeroom: \t\t"+this_player()->GetParanoia("homeroom")+"\n";
        }
        ret += "Debug mode: \t\t"+ ( (this_player()->GetProperty("debug")) ? "on" : "off" )+"\n";
        ret += "Godmode: \t\t"+ ( (this_player()->GetGodMode()) ? "on" : "off" )+"\n";
        ret += "Wizvision: \t\t"+ ( (this_player()->GetWizVision()) ? "on" : "off" )+"\n";
#if GRID
        ret += "Showgrid: \t\t"+ ( (this_player()->GetVisibleGrid()) ? "on" : "off" )+"\n";
        ret += "Wizmap mode: \t\t"+ ( this_player()->GetProperty("wizmapping") ? "on" : "off" )+"\n";
        ret += "Noclip mode: \t\t"+ ( this_player()->GetProperty("noclip") ? "on" : "off" )+"\n";
        ret += "Anchor: \t\t"+ ( this_player()->GetAnchored() ? "on" : "off" )+"\n";
#endif
    }
    if(replee){
        ret += "Reply target: \t\t"+replee+"\n";
    }
    tmp = sort_array(explode(ret, "\n"),1);
    ret = implode(tmp, "\n");
    write(ret);
    return 1;
}
Example #9
0
File: sleep.c Project: Elohim/FGmud
mixed can_sleep() {
    if( !creatorp(this_player()) && this_player()->GetCaffeine() > 10 ) {
        return "You are too wired to sleep right now.";
    }
    if(this_player()->GetRace()=="elf") return "Elves don't sleep.";

    return 1;
}
Example #10
0
mixed cmd(string args) {
    if( !creatorp(this_player()) && !avatarp(this_player()) ) {
        if( (int)this_player()->GetStaminaPoints() < 1 )
            return "You are too tired.";
    }
    if( !args || args == "" ) {
        message("my_action", "You are feeling emotional.", this_player());
        message("other_action", (string)this_player()->GetName() +
          " looks emotional.", environment(this_player()),
          ({ this_player() }));
Example #11
0
File: shop2.c Project: Elohim/FGmud
    foreach(object ob in living_stack){
        if(living(ob) && !creatorp(ob) &&
          !member_group(ob,"TEST")) {
            message("info",
              "Otik's back room is for authorized personnel only.", 

              ob); 
            return 0;
        }
    }
Example #12
0
varargs void eventEdit(string file, function callback){
    EditCallback = callback;
#ifdef __DSLIB__
    if(this_object()->GetCharmode()){
        this_object()->erase_prompt();
        this_object()->CancelCharmode();
        this_object()->SetProperty("was_charmode", 1);
    }
    else this_object()->CancelCharmode();
#endif
#if efun_defined(remove_get_char)
    //remove_get_char(this_object());
#endif
#if efun_defined(remove_charmode)
    //remove_charmode(this_object());
#endif
    //this_object()->SetNoEcho(0);
    ed_start(file, !creatorp());
    if( !creatorp() || file_size(file) < 1 ) ed_cmd("$a");
}
Example #13
0
string LongRet(mixed whom){
    string ret = "A green ring, glowing with unearthly power.";
    if(!whom || !objectp(whom) || !living(whom)) whom = this_player();
    if(creatorp(whom) ||
            member_group(whom,"TEST")){
        ret += "\nTo enable damage protection, type: protection on";
        ret += "\nTo enable damage reporting, type: reporting on";
        ret += "\nTo make a creature report its damage: enablereport <name>";
        ret += "\nTo make it stop reporting its damage: disablereport <name>\n";
    }
    return ret;
}
Example #14
0
mixed can_mail_str(string str) {
    if(GUEST_CHECK == "guest") return "You can't do that.";
    if( !str ) return 0;
    else if( str == "" ) str = 0;
    if( !creatorp(this_player()) ) {
        mixed tmp;

        tmp = environment(this_player())->CanMail(this_player(), str);
        if( !tmp ) return "Does this place look like a post office?";
        else return tmp;
    }
    return 1;
}
Example #15
0
int CanReceive(object ob){
    int ret, level;
    level = ob->GetLevel();
    if((creatorp(ob) && !archp(ob)) || (userp(ob) && level > 20)){
        write("Sorry. This area is for normal players.");
        return 0;
    }
    ret = room::CanReceive(ob);
    if(ret){
        object *inv = deep_inventory(ob);
        foreach(object element in inv){
            string name = base_name(element);
            level = element->GetLevel();
            if(creatorp(element) && !archp(element)
              || (userp(element) && level > 20)){
                write("Sorry. This is a player-only area.");
                return 0;
            }
            if(!strsrch(name,"/realms/") || !strsrch(name,"/open/")){
                element->eventMove(ROOM_FURNACE);
            }
        }
    }
Example #16
0
mixed do_mail_str(string str) {
    object ob;

    if( !creatorp(this_player()) )
        return environment(this_player())->eventMail(this_player(), str);
    if( !(ob = new(OBJ_POST)) ) {
        this_player()->eventPrint("Failed to load postal object!");
        return 1;
    }
    if( !(ob->eventMove(this_player())) ) {
        this_player()->eventPrint("You can't seem to carry the postal "
                "object.");
        return 1;
    }
    this_player()->eventPrint("%^RED%^Remember!%^RESET%^ To end a post, enter a single period on an otherwise blank line, and then hit return.");
    ob->start_post(str);
    return 1;
}
Example #17
0
File: home.c Project: Elohim/FGmud
mixed GoHome(string str) {
    object ob, prev;
    string who, room;

    prev = environment(this_player());
    if( !str || str == "" || !creatorp(this_player())){
        who = this_player()->GetKeyName();
    }
    else who = lower_case(str);
    if(!user_exists(who)) return "There's no such user.";
    room = PLAYERS_D->GetHomeRoom(who);
    if(!room || !strsrch(room, "/tmp/")){
        str = user_path(who, 1);
        if(!directory_exists(str)) return "That person has no home dir.";
        str = user_path(who, 1)+"workroom.c";
        arg = str;
        if(!unguarded((: file_exists(arg) :)))
            return capitalize(who)+" has no active workroom.";
    }
Example #18
0
mixed do_dest_obj(object ob){
    string name;
    if(base_name(ob) == LIB_DUMMY) {
        write(capitalize(ob->GetShort())+" isn't a normal destable item. It remains in place.");
        return 1;
    }
    if(archp(ob) && !archp(this_player())){
        write("You can't dest an admin.");
        tell_player(ob, this_player()->GetName()+" just tried to dest you.");
        return 1;
    }
    if(!creatorp(this_player()) && strsrch(base_name(ob), homedir(this_player()))){
        write("As a builder, you can only dest items that you created.");
        return 1;
    }
    if(!living(ob)) name = ob->GetShort();
    else name = ob->GetName();
    write("You dest "+name+".");
    say( this_player()->GetMessage( "dest", ob ) );
    ob->eventDestruct();
    if(ob) destruct(ob);
    return 1;
}
Example #19
0
string *query_custom_path(){
    string custom_path;
    if(!creatorp(this_player())) return ({  DIR_PLAYER_CMDS, DIR_SECURE_PLAYER_CMDS }) ;
Example #20
0
File: xyzzy.c Project: Elohim/FGmud
mixed cmd(string str) {
    if(!creatorp(this_player())) write("Nothing happens.");
    else tell_room(environment(this_player()),"A hollow voice says: \"%^CYAN%^Fool!%^RESET%^\"");
    return 1;
}
Example #21
0
 mixed can_resurrect_obj(string str) { 
     if(!creatorp(this_player())) 
         return "This command is only available to creators.";
     else return 1;
 }
Example #22
0
varargs int make_workroom(mixed dude, int cre) {
    string tdir, dir_line, bakdata;
    int creator;

    if(!dude) return 0;

    if(objectp(dude)){
        cdir = homedir(dude, cre);
        creator = (cre || creatorp(dude));
        if(sizeof(get_dir(REALMS_DIRS+"/")) ==1) creator = 1;
        nom = dude->GetKeyName();
    }

    if(stringp(dude)){
        dude = lower_case(dude);
        if(cre ||  member_array(dude, PLAYERS_D->GetCreatorList()) != -1){
            creator = 1;
            cdir = REALMS_DIRS + "/" + dude;
        }
        else {
            cdir = ESTATES_DIRS + "/" + dude[0..0] + "/" + dude;
        }
        nom = dude;
    } 

    if(unguarded( (: file_size("/realms/template/") :) ) == -1) return 4;

    if(unguarded( (: file_size(cdir+"/area") :) ) == -1){
        tdir = "/realms/template/";
        dir_line = "#define MY_DIR          \""+cdir+"\"";
        bakdata = "workroom.orig : "+cdir+"/workroom.c\n";
        mkdir(cdir);
        mkdir(cdir+"/log");
        mkdir(cdir+"/log/archive");
        mkdir(cdir+"/bak");
        mkdir(cdir+"/tmp");
        mkdir(cdir+"/area");
        mkdir(cdir+"/adm");
        mkdir(cdir+"/area/room");
        mkdir(cdir+"/area/save");
        mkdir(cdir+"/area/weap");
        mkdir(cdir+"/area/obj");
        mkdir(cdir+"/area/npc");
        mkdir(cdir+"/area/armor");
        mkdir(cdir+"/area/etc");
        mkdir(cdir+"/area/doors");
        mkdir(cdir+"/area/meals");

        if(creator){
            mkdir(cdir+"/cmds");
            mkdir(cdir+"/public_html");
            cp(tdir+"plan", cdir+"/.plan");
            cp(tdir+"evaldefs.h", cdir+"/evaldefs.h");
            cp(tdir+"profile", cdir+"/.profile");
            cp(tdir+"cmds/custom.c", cdir+"/cmds/custom.c");
            cp(tdir+"workroom.c", cdir+"/workroom.c");
            cp(tdir+"workroom.c", cdir+"/workroom.bak");
            cp(tdir+"workroom.c", cdir+"/bak/workroom.orig");
            cp(tdir+"area/obj/chest.c", cdir+"/area/obj/chest.c");
        }

        else {
            cp(tdir+"workroom_builder.c", cdir+"/workroom.c");
            cp(tdir+"workroom_builder.c", cdir+"/workroom.bak");
            cp(tdir+"workroom_builder.c", cdir+"/bak/workroom.orig");
            cp(tdir+"area/obj/builder_chest.c", cdir+"/area/obj/builder_chest.c");
        }

        cp(tdir+"adm/remote.c",cdir+"/adm/remote.c");
        write_file(cdir+"/bak/bk.db",bakdata);
        cp(tdir+"area/customdefs.part1", cdir+"/area/customdefs.h");
        write_file(cdir+"/area/customdefs.h","\n"+dir_line+"\n");
        write_file(cdir+"/area/customdefs.h",read_file(tdir+"area/customdefs.part2"));
        cp(tdir+"area/room/sample_room.c", cdir+"/area/room/sample_room.c");
        cp(tdir+"area/room/sample_two.c", cdir+"/area/room/sample_two.c");
        cp(tdir+"area/weap/sword.c", cdir+"/area/weap/sword.c");
        cp(tdir+"area/obj/table.c", cdir+"/area/obj/table.c");
        cp(tdir+"area/obj/key.c", cdir+"/area/obj/key.c");
        cp(tdir+"area/obj/case.c", cdir+"/area/obj/case.c");
        cp(tdir+"area/obj/cup.c", cdir+"/area/obj/cup.c");
        cp(tdir+"area/obj/pitcher.c", cdir+"/area/obj/pitcher.c");
        cp(tdir+"area/obj/watch.c", cdir+"/area/obj/watch.c");
        cp(tdir+"area/npc/fighter.c", cdir+"/area/npc/fighter.c");
        cp(tdir+"area/armor/chainmail.c", cdir+"/area/armor/chainmail.c");
        cp(tdir+"area/armor/leather_boot_r.c", cdir+"/area/armor/leather_boot_r.c");
        cp(tdir+"area/armor/leather_boot_l.c", cdir+"/area/armor/leather_boot_l.c");
        return 1;
    }

    else {
        //write("That person already has a homedir.");
        return 5;