示例#1
0
文件: unregister.c 项目: Elohim/FGmud
int cmd(string str) {
    if(!member_group(previous_object(), "SECURE")) {
        if(!member_group(previous_object(), "LAW")) return 0;
    }
    if(!str) return 0;
    if(member_array(str, BANISH_D->query_registered()) == -1) {
        write("That site is not on the list of sites needing to register.\n");
        return 1;
    }
    BANISH_D->unregister_site(str);
    log_file("watch/register", previous_object()->GetKeyName()+
            " UNREGISTERED "+str+": "+ctime(time())+"\n");
    write("Site : "+str+" is now not on the registration list.\n");
    return 1;
}
示例#2
0
文件: _economy.c 项目: ehershey/pd
int cmd_economy(string str) {
    string type, key;
    float rate, infl, wt;

    if(!str)
      {
       message("info", "Currency what?", this_player());
       return 1;
      }
    if(!archp(this_player())) return 0;
    if(member_group(geteuid(previous_object()), "approval") == 0) 
      {
        message("info", "You do not have access to this..",this_player());
        return 1;
      }

    seteuid(UID_LOG);
    log_file("economy", geteuid(previous_object())+": "+str+" ("+ctime(time())+")\n");
    seteuid(getuid());
    if(sscanf(str, "add %s %f %f %f", type, rate, infl, wt) == 4) {
        seteuid(UID_APPROVAL);
        ECONOMY_D->add_currency(type, rate, infl, wt);
        seteuid(getuid());
        message("info", "Currency "+type+" added!", this_player());
    }
    else if(sscanf(str, "change %s for %s to %f", key, type, wt) == 3) {
        seteuid(UID_APPROVAL);
        ECONOMY_D->change_currency(type, key, wt);
        seteuid(getuid());
        message("info", "Changed: "+key+" for "+type+" to "+wt, this_player());
    }
    else return 0;
    return 1;
}
示例#3
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;
     }
 }
示例#4
0
文件: jade_ring.c 项目: Elohim/FGmud
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);
}
示例#5
0
文件: shop2.c 项目: 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;
        }
    }
示例#6
0
文件: _snoopers.c 项目: ehershey/pd
int cmd_snoopers(string str) {
    object *who;
    object snooper;
    int i, max;

//    if(!archp(previous_object())) return 0;
   who=users();
    if(!(max = sizeof(who))) {
        write("No one is snooping anyone.\n");
        return 1;
    }
    for (i = 0; i < sizeof(who); i++) {
        seteuid(UID_SNOOP);
	snooper = query_snoop(who[i]);
        seteuid(getuid());
        if(member_group(geteuid(snooper), "superuser") &&
          !member_group(geteuid(previous_object()), "superuser")) continue;
        write(capitalize((string)who[i]->query_name())+" is being snooped by "+capitalize((string)snooper->query_name())+".\n");
    }
    return 1;
}
示例#7
0
文件: jade_ring.c 项目: Elohim/FGmud
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;
}
示例#8
0
文件: wizlist.c 项目: arylwen/terebi
int cmd(string str){
    string *raw_array;
    string *grps = groups();
    string ret = "";
    PLAYERS_D->CompileCreList();
    raw_array = sort_array(PLAYERS_D->GetCreatorList(),1);
    foreach(string wiz in raw_array){
        string tmp = wiz;
        foreach(string group in grps){
            if(member_group(wiz, group)) tmp += " "+group+",";
        }
        if(last(tmp,1) == ",") tmp = truncate(tmp,1);
        ret += capitalize(tmp)+"\n";
    }
示例#9
0
文件: _move.c 项目: ehershey/pd
int cmd_move( string a )
{
mixed o1, o2;
  string str;
  int ret;

    if(member_group(geteuid(previous_object()), "ambassador")) return 0;
  if( !a || ( sscanf( a, "%s to %s", o1, o2 ) < 2 ) )
    { notify_fail( SYNTAX ); return 0; }

  seteuid( geteuid( previous_object() ) );

  o1 = ref_ob( o1 );
  if( !objectp( o1 ) )
  {
    notify_fail( wrap( "Could not identify " + identify( o1 ) +
      " as an object." ) );
    return 0;
  }
  o2 = ref_ob( o2 );
  if( !objectp( o2 ) )
  {
    notify_fail( wrap( "Could not identify " + identify( o2 ) +
     " as an object." ) );
    return 0;
  }
  set_ref( 0, o2 );
  write( wrap( "Moving " + identify( o1 ) + " to " + identify( o2 ) + "..." ) );
  ret = o1-> move( o2 );
  switch( ret )
  {
    case MOVE_OK:		str = "Move OK.\n"; break;
    case MOVE_NOT_ALLOWED:	str = "Move not allowed.\n"; break;
    case MOVE_NO_ROOM:		str = "No room in object2 for object1\n"; break;
    case MOVE_DESTRUCTED:	str = "Move destructed\n"; break;
    case MOVE_NO_DEST:		str = "object2 is not a destination\n"; break;
#ifdef MOVE_TOO_HEAVY
    case MOVE_TOO_HEAVY:	str = "object1 too heavy for object2\n"; break;
#endif /* MOVE_TOO_HEAVY */
#ifdef MOVE_DOOR_CLOSED
    case MOVE_DOOR_CLOSED:	str = "The door is closed.\n"; break;
#endif /* MOVE_DOOR_CLOSED */
    default: str = "Error: move return code " + ret + "\n"; break;
  }
  if( ret == MOVE_OK ) { write( str ); return 1; }
  notify_fail( str ); 
  return 0;
}
示例#10
0
string finger_user(string who) {
    object link, body;
    mixed tmp1, tmp2, tmp3, tmp4, tmp5;
    string msg;
    mapping mail_stat;
    int hibernate;

    link = restore_data(who);
    if (link) body = restore_body(who);

    if (!link || !body) {
	if (sscanf(who, "(%s)", who))
	    return finger_group(who);
	return "Finger: There is no such user.\n";
    }

    msg = LINE1;

    // Line 1: Fingerguy the Utter Novice (Chaotic Neutral)
    if (link->query("wizard")) {
	string al, title = body->getenv( "TITLE" );
	al = body->query("al_title");
	if (!al || al=="") {
	    msg += body->query_title() + "\n";
	} else {
	    if (!title) title = "$N the New Wizard ($A)";
	    title = replace_string(title, "$N", body->query("cap_name"));
	    title = replace_string(title, "$A", al);
	    msg += title + "\n";
	}
    } else
	msg += body->query_title() + "\n";

    // Line 2: Male Human Mage [Level 5]
    // or:    Male Human Necromancer [Lesser Power of Prime]
    msg += capitalize(body->query("gender"));
    msg += " "+capitalize(body->query("race"));

    mail_stat = link->query("Class");
    if (mail_stat) {
	tmp1 = (values(mail_stat))[0];
	msg += ( " " +  capitalize(tmp1) );
    }

    if (wizardp(TP)) {
	if (link->query("wizard")) {
	    if (member_group(body->query("name"), "ambassador")) {
		tmp1 = "Ambassador";
		tmp2 = body->query("ambassador");
		if ((tmp2 != 0) && (tmp2 != ""))
		    tmp1 = tmp1 + " of " + capitalize(tmp2);
	    } else {
		tmp1 = DOMAIN_D->query_domain(link);
		tmp2 = DOMAIN_D->query_domain_level(link);
		if ((tmp1 == 0) || (tmp1 == ""))
		    tmp1 = "Domainless "+tmp2;
		else
		    tmp1 = tmp2 + " of " + tmp1 + " Domain";
	    }
	} else {
	    tmp1 = "Level " + link->query("level");
	}
	tmp1 = " [" + tmp1 + "]\n";
	msg += tmp1;
    } else msg += "\n";

    // Line 3: Gang allegience: The Machiavellian Menagerie
    // or: The Admin (Leader)
    
	tmp1 = "Gang allegience: ";
	tmp2 = body->query("gang");

	if (tmp2) {
	    mail_stat = GANG_D->get_list_map();
	    if (mail_stat[tmp2] == body->query("name"))
	        tmp1 += "Leader of "+cap_all_words(tmp2);
	    else
	        tmp1 += "Member of "+cap_all_words(tmp2);
	       
	} else {
	    tmp1 += "none";
	}
	
   	msg += tmp1 + "\n";

    // Line 4 : Married to Whoever
    tmp1 = body->query("spouse");
    if (tmp1) {
	tmp1 = capitalize(tmp1);
	msg += "Married to "+tmp1+"\n";
    }

    // Line 5 : A cool line to make it all very pretty.
    msg += LINE2;

    // Line 6: In Real Life: Matthew A. Titmus
    // or: In Real Life: ?
    tmp2 = "In Real Life: ";
    if (tmp3 = (string)link->RNAME)
	tmp2 += extract(tmp3, 0, 22);
    else
	tmp2 += "?";

    msg += "Status: ";
    if (member_group(body->query("name"), "root"))
	msg += "Administrator\n";
    else if (member_group(body->query("name"), "adminaccess"))
	msg += "Elder\n";
    else if (member_group(body->query("name"), "ambassador"))
	msg += "Ambassador\n";
    else if (link->query("wizard"))
	msg += "Immortal\n";
    else
	msg += "Player\n";

    if (body->query("email_visible"))
	tmp1 = "[Public]";
    else
	tmp1 = "[Private]";

    if (adminp(TP) || 
      body->query("name")==TP->query("name")) {
	tmp1 = (string)link->query("email")+" "+tmp1;
    } else {
	if (body->query("email_visible")) {
	    tmp1 = (string)link->query("email");
	} else {
	    tmp1 = "[Private]";
	}
    }

    if (tmp1) msg += "Email address: " + tmp1 + "\n";

    tmp1 = (string)link->query("URL");
    if (tmp1) msg += "URL: " + tmp1 + "\n";

    hibernate = (int)link->query("hibernate");

    if (hibernate && time() < hibernate)
	msg += "\n\t[In hibernation until " + ctime(hibernate) + "]\n\n";

    tmp1 = find_player(who);
    if (tmp1) {
	if (!filter_users(tmp1))
	    tmp1 = 0;
    }

    if (!link->query("last_on"))
	msg += (tmp1 ? "On since: " : "Last on: ") + "Unavailable";
    else
	msg += ((tmp1 && !tmp1->query("npc")) ? "On since: " : "Last on: ") +
	ctime((int)link->query("last_on")) ;

    if (wizardp(TP)) 
	msg += ( " from " + (string)link->query("ip") + " \n" );
    else
	msg += "\n";

    if (tmp1) {
	tmp1 = query_idle_string(tmp1, 1);
	if (strlen(tmp1) > 0)
	    msg += tmp1 + "\n";
    }

    mail_stat = (mapping)MAILBOX_D->mail_status(who);
    if (mail_stat["unread"])
	msg += sprintf("%s has not read %d of their %d piece%s of mail.\n",
	  capitalize(who), mail_stat["unread"], mail_stat["total"],
	  (mail_stat["total"] == 1 ? "" : "s"));
    else {
	msg += "No unread mail" ;
	if(this_player()) {
	    if (adminp(getuid(this_player()))) {
		//  msg += " ("+mail_stat["total"]+" pieces)" ;
		msg += sprintf(" (%d piece%s)", mail_stat["total"], (mail_stat["total"] == 1 ? "" : "s"));
	    }
	}
	msg += ".\n" ;
    }

    if (link->query("wizard")) {
	tmp1 = user_path(who) + ".project";
	if (file_size(tmp1) >= 0)
	    msg += "Project: " + read_file(tmp1);

	tmp1 = user_path(who) + ".plan";
	if (file_size(tmp1) >= 0) {
	    msg += "Plan:\n" + read_file(tmp1);
	} else {
	    msg += "No Plan.\n";
	}
    } else {
	if (body->query("session"))
	    tmp1 = iwrap("Session: "+body->query("session"));
	else
	    tmp1 = "No Session.\n";

	msg += tmp1;
    }

    msg += LINE1;

    if (!find_player(who) || !interactive(find_player(who))) {
	link->remove();
	// Some names like .foo weren't getting away.
	if(link) destruct(link);
	if(link) log_file("fingerdest",sprintf("Connection of %s not "+
		"dested by finger daemon, on %s.\n", link->query("name"), 
		ctime(time())));

	if(body) destruct(body);
	if(body) log_file("fingerdest",sprintf("Connection of %s not "+
		"dested by finger daemon, on %s.\n", body->query("name"), 
		ctime(time())));
    }

    return "\n" + msg + "\n";
}
示例#11
0
int cmd_consider(string str)
{
    int comp;
    object ob;
    string subjec, objec, possess;
    if (!str || str=="")
    {
        write("Consider who?");
        return 1;
    }
    ob = present(str, environment(this_player()));
    if (!ob)
    {
        write("Consider who?");
        return 1;
    }
    if(!ob->is_living()) return 
        notify_fail("How hard would it be to beat up an inanimate object?\n");
    comp = ob->query_level()-this_player()->query_level();
    subjec = ob->query_subjective();
    objec = ob->query_objective();
    possess = ob->query_possessive();
    if(this_player()->query_level() < 8)
        comp += 5;
    comp += sizeof(ob->query_spells());
    if (comp > 35)
       switch(random(6)) {
          case 0:
            write(capitalize(subjec)+" would rip off your arm and beat you with the bloody stump!");
            break;
          case 1:
           write("You wouldn't live long enough to regret the day you decided to attack "+objec+".");
            break;
          case 2:
            write(capitalize(subjec)+" might be able to kill you just by sneezing at you.");
            break;
          case 3:
            write("You might not walk away from the fight even if "+subjec+" were already dead to begin with.");
            break;
          case 4:
            write("You would consider "+objec+", but merely looking at "+objec+" may result in your death.");
           break;
          case 5:
            write("Think of it this way. You should spend the rest of your life making sure "+subjec+" never finds out you considered attacking "+objec+".");
        } 
    else if (comp > 30)
       switch(random(3)) {
          case 0:
            write("You would be beaten into the ground in just a few swings.");
            break;
          case 1:
            write("You would be torn limb from limb!");
            break;
          case 2:
            write("If you're fast enough, you may be able to scratch "+objec+" a few times before being annihilated.");
            break;
        }
    else if (comp > 25)
       switch(random(3)) {
          case 0:
            write("You would fare better if there were three... or four... or five of you.");
            break;
          case 1:
            write("You need an army of friends to kill "+objec+".");
            break;
          case 2:
            write("It would be wiser to mark yourself up and pretend to have fought them.");
            break;
        }
    else if (comp > 20)
       switch(random(3)) {
          case 0:
            write("You would have to be extremely lucky to kill "+objec+", and even then you would be gravely injured.");
            break;
          case 1:
            write("You shouldn't try to kill "+objec+" without a friend or two.");
            break;
          case 2:
            write("You would be a fool to take "+objec+" on.");
            break;
        }
    else if (comp > 15)
      switch(random(3)) {
          case 0:
            write("Don't fight "+objec+" unless you absolutely have to.");
            break;
          case 1:
            write("You would most likely die.");
            break;
          case 2:
            write("If you're planning on taking them on alone, make sure your will is made out.");
            break;
        }
    else if (comp > 10)
        switch(random(3)) {
          case 0:
            write("Be careful if you decide to fight "+objec+", and don't be afraid to run.");
            break;
          case 1:
            write("You might die.");
            break;
          case 2:
            write("Make sure you have some first aid ready.");
            break;
        }
    else if (comp > 5)
        switch(random(3)) {
          case 0:
            write("You could probably take "+objec+" in a fair fight.");
            break;
          case 1:
            write("A perfect match!");
            break;
          case 2:
            write("Go for it.");
            break;
        }
    else if (comp > 2)
        switch(random(2)) {
          case 0:
            write("You shouldn't have a problem killing "+objec+".");
            break;
          case 1:
            write("You would most likely kill "+objec+".");
            break;
        }
    else if (comp > -5)
        switch(random(3)) {
          case 0:
            write("You should be more worried about which hand you want to tie behind your back while you're killing "+objec+".");
            break;
          case 1:
            write("You wouldn't even break a sweat.");
            break;
          case 2:
            write(capitalize(subjec)+" poses no threat to you.");
            break;
        }
    else
        switch(random(7)) {
          case 0:
            write(capitalize(subjec)+" is too weak for you to even be able to accurately compare "+possess+" strength to your own.");
            break;
          case 1:
            write("Pshaw! Why even bother considering?");
            break;
          case 2:
            write("Should you really be wasting your time beating up children?");
            break;
          case 3:
            write("Why don't you check out some anger management classes?");
            break;
          case 4:
            write("Whatever "+subjec+" did, it couldn't have been bad enough to make "+objec+" deserve such punishment.");
            break;
          case 5:
            write("You may be physically strong enough, but if you go through with it then you don't have very much inner strength.");
            break;
          case 6:
            write("You could slam "+objec+" into the ground with one finger.");
            break;
        }

    write(strip_color((string)ob->query_long_health()+""));
    if(member_group(this_player()->query_name(), "ambassador") ||
      wizardp(this_player()))
        write("HP: "+ob->query_hp()+"/"+ob->query_max_hp()+
          " Lev: "+ob->query_level());
    return 1;
}