Esempio n. 1
0
int do_push(string arg)
{
  	object me = this_player();

  	if (!arg) return 0;

        if ( (int)me->query_str() < 28 ) {
                return notify_fail("你没那么大力气搬动墓碑。\n");
        }  
  	
	if (arg == "left") {
    	add_temp("left",1);
    	write("墓碑摇晃了一阵,再不见动静...\n");
  	}

  	if ((arg == "right") && ((int)query_temp("left")==3)) {
    	add_temp("right",1);
    	write("墓碑摇晃了一阵,再不见动静...\n");
  	}

  	if ((arg == "front") && ((int)query_temp("right")==3) && ((int)query_temp("left")==3)) {
    	write("墓碑摇晃了一阵,缓缓向后倒去,露出一个入口。\n");
    	set("exits/enter", __DIR__"didao");
    	remove_call_out("close_door");
    	call_out("close_door",15,me);
  	}

  	return 1;
}
Esempio n. 2
0
/*
 * Replacement for unlink() of kLIBC not supporting to remove files used by
 * another processes.
 */
int
unlink(const char *name)
{
	int rc;

	rc = _std_unlink(name);
	if (rc == -1 && errno != ENOENT)
		add_temp(name);

	return (rc);
}
Esempio n. 3
0
void init()
{
	object ob=this_player();
	if((int)query_temp("full")==7)
	{
		message_vision("$N一见房间里已经有人了,只好退了出去。\n",ob);
		ob->move(__DIR__"liangong");
		return;
	}
	add_temp("full" ,1);
	return;
}
Esempio n. 4
0
void create()
{
        NPC_D->generate_cn_name(this_object());

        if (random(2))
                set("gender", "男性");
        else
                set("gender", "女性");

        set("no_get", 1);
        set("title", HIW "无辜百姓" NOR);
        set("waiting", "lonely");   
        set_skill("force", 60);
        set_skill("dodge", 60);
        set_skill("parry", 60);
        set_skill("unarmed", 60);
        set_skill("taiji-shengong", 60);
        map_skill("force", "taiji-shengong"); 
        
        add_temp("apply/defense", 500);
        add_temp("apply/armor", 500);

        set("no_suck", 1);
        set_temp("quest_ob", 1);
        
        set("max_neili", 1000);
        set("neili", 1000);     
        set("max_qi", 1000);
        set("max_jing", 1000);  
        set("combat_exp", 50000); 
        
        setup();
        
        carry_object("/clone/misc/cloth")->wear();
        remove_call_out("escape_me");
        call_out("escape_me", 120, this_object());
}
Esempio n. 5
0
int do_cut(string arg)
{
	object me=this_player();
	object ob;
	if (!arg||arg!="wood") return notify_fail("��Ҫ��ʲô��\n");
	if (present("chai dao",me)) return notify_fail("û�в���ô����\n");
	if (query_temp("times")==0) return notify_fail("������������\n");
	if(me->query("qi")<20) return notify_fail("�����̫���������ܿ���\n");
	ob=new(__DIR__"obj/chai");
	ob->move(environment(me));
	me->receive_wound("qi", 20);
	add_temp("times",-1);
	message_vision("$N����һ�����۵ù�Ǻ��\n" , me);
	return 1;
}
Esempio n. 6
0
/* make a response file to pass a very long command line */
static char *
make_response_file(char * const *argv)
{
	char rsp_name_arg[] = "@mksh-rsp-XXXXXX";
	char *rsp_name = &rsp_name_arg[1];
	int arg_len = 0;
	int i;

	for (i = 0; argv[i]; i++)
		arg_len += strlen(argv[i]) + 1;

	/*
	 * If a length of command line is longer than MAX_CMD_LINE_LEN, then
	 * use a response file. OS/2 cannot process a command line longer
	 * than 32K. Of course, a response file cannot be recognised by a
	 * normal OS/2 program, that is, neither non-EMX or non-kLIBC. But
	 * it cannot accept a command line longer than 32K in itself. So
	 * using a response file in this case, is an acceptable solution.
	 */
	if (arg_len > MAX_CMD_LINE_LEN) {
		int fd;
		char *result;

		if ((fd = mkstemp(rsp_name)) == -1)
			return (NULL);

		/* write all the arguments except a 0th program name */
		for (i = 1; argv[i]; i++) {
			write(fd, argv[i], strlen(argv[i]));
			write(fd, "\n", 1);
		}

		close(fd);
		add_temp(rsp_name);
		strdupx(result, rsp_name_arg, ATEMP);
		return (result);
	}

	return (NULL);
}
Esempio n. 7
0
int random_move()
{
        mapping exits;
        string *dirs, direction, to_go_place, my_birth_place;
        object env; 
        string userid;
        int x,y;
         
        if( !mapp(exits = environment()->query("exits")) ) return 0;
        
        dirs = keys (exits);
        direction = dirs[random(sizeof(dirs))];
        env = environment(this_object());
        to_go_place = env->query("exits/"+direction);
        my_birth_place = file_name(this_object());
        
        //ccommand("say "+to_go_place);
        if(sscanf(to_go_place,"/data/maze/%s/maze/%d/%d",userid,x,y)!=3)
                        return 1;
        command("go " + direction);
        add_temp("random_move",1);
        return 1;
}   
Esempio n. 8
0
int valid_leave(object who, string dir)
{
	add_temp("full",-1);
	return 1;
}
Esempio n. 9
0
void create()
{
        int skill, nl, lvl;
        mixed exp;		

	NPC_D->generate_cn_name(this_object());
        set("gender", "男性");
        set("long", "这是一名大宋将军,正威风凛凛地巡视着自己的队伍。\n");

        set("int", 30);
        set("str", 30 + random(20));
        set("con", 20 + random(20));
        set("dex", 20 + random(20));
        set("age", 20 + random(30));
        set("per", 15 + random(15)); 
        set("age", 20 + random(30));
        set("per", 15 + random(15));                                         
        set("no_get",1);
        
        exp = UPDATE_D->query_max_exp();
        exp = count_div(exp, 10);
        skill = to_int(pow(to_float(atoi(count_div(exp, 100))), 1.0 / 3)) * 10;
        if (skill < 100) skill = 100; 
        nl = skill * 10 + atoi(count_div(exp, 10000));
        
  	set("combat_exp", exp);
        set("max_neili", nl);
        set("neili", query("max_neili") * 3 / 2); 
        set("max_jingli", nl);
        set("jingli", query("max_jingli"));
        set("max_qi", nl * 5);
        set("qi",  query("max_qi"));
        set("eff_qi", query("max_qi"));
        set("max_jing", nl);
        set("eff_jing", query("max_jing"));
        set("jiali", skill / 2); 

        set_skill("taiji-shengong", skill);
        set_skill("wuhu-duanmendao", skill);
        set_skill("tiyunzong", skill);
        set_skill("taiji-quan", skill);
        set_skill("cuff", skill);
        set_skill("force", skill);
        set_skill("dodge", skill);
        set_skill("blade", skill);
        set_skill("parry", skill);
        set_skill("arrow", skill*2/3);

        map_skill("force", "taiji-shengong");
        map_skill("dodge", "tiyunzong");
        map_skill("cuff", "taiji-quan");
        map_skill("parry", "taiji-quan");
        map_skill("blade", "wuhu-duanmendao");   
        prepare_skill("cuff", "taiji-quan");
  
        set_temp("warquest/party", "song"); 
        add_temp("apply/armor", 400);
        add_temp("apply/damage", 100);
        setup();
        
        lvl = (query("str") + skill / 10) / 10 - 1;
        if (lvl > 8) lvl = 8;
        lvl = lvl - 2;
        if (lvl < 3) lvl = 3;
        carry_object("/clone/weapon/bow" + lvl);
        carry_object("/clone/weapon/bow" + lvl);
        carry_object("/clone/weapon/bow" + lvl);
        carry_object("/clone/weapon/bow" + lvl);
        carry_object(__DIR__"obj/wandao");
        carry_object(__DIR__"obj/wandao");
        carry_object(__DIR__"obj/wandao")->wield();
        carry_object(__DIR__"obj/tiejia")->wear();   
        carry_object(__DIR__"obj/pifeng")->wear();  
}