Exemple #1
0
int main(object me, string arg)
{
	string what, who;
	object ob, obj, victim;
	int sp, dp;

	if( !wizardp(me) && environment(me)->query("no_fight") )
		return notify_fail("这里禁止行窃。\n");

	if( !wizardp(me) && environment(me)->query("no_steal") )
               return notify_fail(HIR"这里禁止行窃 \n"NOR);
       //By waiwai@mszj 2000/10/30

	if( !wizardp(me) && environment(me)->query("no_kill") )
               return notify_fail(HIR"这里禁止行窃 \n"NOR);
       //By waiwai@mszj 2000/10/30

	if( me->query_temp("stealing") )
		return notify_fail("你已经在找机会下手了!\n");

      if(me->query("combat_exp") <= 500000)
       return notify_fail(HIR"功夫这么差就想学着偷东西吗?\n"NOR);
       //By waiwai@mszj 2000/10/30

	if( !arg || sscanf(arg, "%s from %s", what, who)!=2 ) return
		notify_fail("指令格式:steal <物品> from <人物>\n");

	victim = present(who, environment(me));
	if( !victim || victim==me) return notify_fail("你想行窃的对象不在这里。\n");
        if(!valid_kill(me,victim,0)) return 0;

	if( !wizardp(me) && wizardp(victim) )
		return notify_fail("玩家不能偷巫师身上的东西。\n");

	if( !ob = present(what, victim) ) {
		object *inv;
		inv = all_inventory(victim);
		if( !sizeof(inv) )
			return notify_fail( victim->name() + "身上看起来没有什么值钱的东西好偷。\n");
		ob = inv[random(sizeof(inv))];
	}
	sp = (int)me->query_skill("stealing",1) * 5 +((int)me->query("kar")+(int)me->query("age"))*2
		- (int)me->query("thief") * 20;
	if( sp < 1 ) sp = 1;
	if( me->is_fighting() ) {
		sp /= 2;
//		me->start_busy(3);
	}
	dp = ((int)victim->query("sen")+(int)victim->query("age")+(int)victim->query_kar())*2+(int)ob->weight()/25;
	if( victim->is_fighting() ) dp *= 10;
	if( ob->query("equipped") ) dp *= 10;

	write("你不动声色地慢慢靠近" + victim->name() + ",等待机会下手 ...\n\n");

	me->set_temp("stealing", 1);
	me->add("steal_times",1);
	call_out( "complete_steal", 3, me, victim, ob, sp, dp);

	return 1;
}
Exemple #2
0
int main(object me, string arg)
{
        object obj, guard_ob;
        string *killer, callname;
        int just_issued=0;

        if( !wizardp(me) && environment(me)->query("no_fight")  )
                return notify_fail("这里不准战斗。\n");

        if( !arg )
                return notify_fail("你想杀谁?\n");

        if( !objectp(obj = present(arg, environment(me))))
                return notify_fail("这里没有这个人。\n");

        
 	
 //   if( userp(obj) && (int)me->query("nopk") || (int)obj->query("nopk"))
//       return notify_fail(HIG"已经受到保护,不能杀人?\n"NOR)
 		
        if( !obj->is_character() || obj->is_corpse() )
                return notify_fail("看清楚一点,那并不是活物。\n");
        if( obj->query("nowinsleep") ) 
                return notify_fail("趁人之危?不许的! \n");
                 if( !environment(me)->query("can_kill") )
 	 {
 	   if( userp(obj) && (int)me->query("PKS",1)/2 > me->query("age") - 14)
 		return notify_fail("你杀的人还不够多吗?\n");	
           if(userp(obj) && obj->query("age")<16)
             return notify_fail("本站暂时保护新手。\n");

           if(me->query("combat_exp")<250000 && userp(obj))
                return notify_fail("自己功夫没练好就想杀人?\n");
          if(me->query("daoxing")<250000 && userp(obj))
                return notify_fail("自己功夫没练好就想杀人?\n");       
            }
    if(wizardp(obj)&&!wizardp(me)) 
       return notify_fail("杀巫师?还是考虑清楚吧!不想混拉!\n");
        if( obj==me)
                return notify_fail("用 suicide 指令会比较快:P。\n");

        if(!valid_kill(me,obj,0)) return 0;
        set_to_killer(me,obj);

        callname = RANK_D->query_rude(obj);

        //mon 5/29/99
        if(userp(me)) {
          string myid=me->query("id");
          string objid=obj->query("id");

          if(undefinedp(kill[myid])) {
            just_issued=0;
            kill+=([myid:({objid})]);
            call_out("remove_list",1,myid,objid);
          } else {
Exemple #3
0
int main(object me, string arg)
{
	string item, targ;
	object ob, victim, ob2;
	int success, found, ap, dp, level, damage,damage_bonus, wound, lucky;
	mixed foo;
	string msg;

	if(environment(me)->query("no_fight") || 
           environment(me)->query("no_magic") )
              return notify_fail("安全区内射箭可是会引起公愤的噢!\n");

    	if( this_player()->is_busy() )
		return notify_fail("你现在正忙着呢。\n");

	if( !arg || sscanf(arg, "%s on %s", item, targ)!=2 )
		return notify_fail("指令格式:shoot <某物> on <某人>\n");

	if(targ == me->query("id"))
		return notify_fail("想自杀应该用suicide吧?\n");
	if( !objectp(ob = present(item, me)))
		return notify_fail("你身上没有 "+item+"\n");

	if(ob->query("skill_type")!="sword" || ob->query("apply/skill_type")!="archery")
		return notify_fail(ob->query("name")+"不是箭!\n");
	

	success=0;
	if(ob2=me->query_temp("weapon")) {
		if(ob2->query("skill_type")=="blade" && ob2->query("apply/skill_type")=="archery") 
			success=1;
		else {
			if(ob2=me->query_temp("secondary_weapon")) {
				if(ob2->query("skill_type")=="blade" && ob2->query("apply/skill_type")=="archery") 
					success=1;
			}
		}
	}
	if(!success)
		return notify_fail("你必须先弄张弓。\n");
			
	if( !objectp(victim = present(targ, environment(me))) )
		return notify_fail("你想向射谁?\n");

	if( !living(victim)) 
                return notify_fail("什么你都想杀?\n");

	if(!valid_kill(me,victim,0)) return 0;

	success=0;
	found=0;
	lucky=0;
	damage=0;
	wound=0;
	ap=COMBAT_D->skill_power(me, "archery", SKILL_USAGE_ATTACK);
	dp=COMBAT_D->skill_power(victim, "dodge", SKILL_USAGE_DEFENSE);
	dp/=2;			// 弓箭难防 
	if(random(ap+dp) > dp) {
		success=1;
		if(ap<dp) lucky=1;
	}
	msg="$N伸手从怀里掏出一"+ob->query("base_unit")+ob->query("name")+",搭在"+ob2->query("name")+"上。\n";
	msg+="一松手,只见一道寒光飞向$n的面门,";

	if(success) {
		msg+="$n想躲却没躲开。\n";
		damage=ob->query("weapon_prop/damage");
		damage+=random(damage);
		damage_bonus=me->query_str();
		foo=ob->hit_ob(me, victim, damage);
		if(stringp(foo)) msg+=foo;
		else if(intp(foo)) damage_bonus+=foo;
		wound=random(damage-(int)victim->query_temp("apply/armor"));
		damage+=(damage_bonus+random(damage_bonus))/2;
		ap=me->query("force");
		dp=victim->query("force");
		while(random(dp)>ap) {
			damage-=damage/3;
			dp/=2;
		}
		if (wizardp(me) && me->query("env/combat")=="verbose")
			tell_object(me, sprintf(GRN "damage: %d, wound: %d\n" NOR, damage, wound));
		if(damage>0) {
			victim->receive_damage("kee", damage, me);
			if(wound >0) victim->receive_wound("kee", wound, me);
			msg+=COMBAT_D->damage_msg(damage,"伤害");
		}
		if(random(me->query("sen")*100/me->query("max_sen") + me->query_int()*me->query_cps()) > 150) {
			if(lucky) {
				me->improve_skill("archery", 1);
				me->set("combat_exp",me->query("combat_exp")+1);
	                	if(me->query("potential")-me->query("learned_points")<100)
       	                 		me->set("potential",me->query("potential")+1);
			}
		}
	}
	else 
		msg+="但是被$n躲开了。\n";

	if((int)ob->query_amount()==1) {
		if(stringp(ob->query("equipped"))) ob->unequip();
		tell_object(me, "你的" + ob->query("name") + "用完了!\n");
	}
	ob->add_amount(-1);

	message_vision(msg, me, victim);
	if(damage > 0) COMBAT_D->report_status(victim);

	if(living(victim)) {
		msg="$n怒视$N,大声喝道:小兔崽子敢放冷箭!\n";
		message_vision(msg, me, victim);
		if(userp(victim)) victim->fight_ob(me);
		else victim->kill_ob(me);
		me->kill_ob(victim);
	}

	me->start_busy(1+random(2));
	return 1;
}
Exemple #4
0
int main(object me, string arg)
{
	object weapon, target;
	string martial, skill, perf;
	
	seteuid(getuid());

	if ((int)me->query_temp("in_qingwang")==1)
		return notify_fail(MAG"你眼前出现那个熟悉的身影,搅的你心烦气燥,似离情,剪不断,理还乱。\n"NOR);

	if( me->is_busy() )
		return notify_fail("( 你上一个动作还没有完成,不能施用外功。)\n");

	if( !arg ) return notify_fail("你要用外功做什么?\n");
	if ( !wizardp(me) && environment(me)->query("no_fight")) 
		return notify_fail("这里不能施用外功。\n");

        if( sscanf(arg, "%s on %s", perf, arg)==2 ) {
                target = present(arg, environment(me));
                if( !target ) target = present(arg, me);
                if( !target ) return notify_fail("这里没有 " + arg + "。\n");

                if(!valid_kill(me,target,0)) return 0;
		//Add by beeby. Check ghost.
		if (target->is_ghost())
		 return notify_fail("对方已经是鬼了.....\n");
                if( userp(me) && userp(target) && 
                    target->query_temp("netdead") )
                   return notify_fail("对方正在断线中,不能对其施用外功。\n");

                arg=perf+" "+arg;
        } else if(sscanf(arg, "%s %s", perf, arg)==2 ) {
	  //so can't use: perform vision id
	  //but have to use: perform vision on id
	  arg=perf;
        }

	if( weapon = me->query_temp("weapon") )
            martial = weapon->query("skill_type");
        else
            martial = "unarmed";

//	write(martial+" "+me->query_skill_mapped(martial)+"\n");

	if( stringp(skill = me->query_skill_mapped(martial)) ) {
//	write(arg+" "+SKILL_D(skill)->perform_action(me, arg)+
//		SKILL_D(martial)->perform_action(me, arg)+"\n");
		notify_fail("你所使用的外功中没有这种功能。\n");
		if( SKILL_D(skill)->perform_action(me, arg) ) {
			if( random(120) < (int)me->query_skill(skill) )
				me->improve_skill(skill, 1, 1);
			return 1;
		} else if( SKILL_D(martial)->perform_action(me, arg) ) {
			if( random(120) < (int)me->query_skill(martial, 1) )
				me->improve_skill(martial, 1, 1);
			return 1;
		}
		return 0;
	}

	return notify_fail("你请先用 enable 指令选择你要使用的外功。\n");
}
Exemple #5
0
int main(object me, string arg)
{
	string spells, spl, trg;
	object target;
	
	seteuid(getuid());

        if((int)me->query_temp("no_cast")==1)
	        return notify_fail("你现在不能用魔法!\n");

	if( me->is_busy() )
		return notify_fail("( 你上一个动作还没有完成,不能念咒文。)\n");

	if( me->is_ghost() )
		return notify_fail("你现在不能用魔法!\n");

	if( !wizardp(me) && environment(me)->query("no_magic") )
		return notify_fail("这里不准念咒文。\n");

	if( !arg ) return notify_fail("指令格式:cast <法术> [on <目标>]\n");
	if( sscanf(arg, "%s on %s", spl, trg)==2 ) {
		target = present(trg, environment(me));
		if( !target ) target = present(trg, me);
		if( !target ) return notify_fail("这里没有 " + trg + "。\n");
		
	// modified by xfile@bjxyj
	// There were some peaceful casts should be valid in any case.
	if( !valid_kill(me,target,0) && member_array( spl, peaceful_cast ) == -1 )
		return 0;

		if( userp(me) && userp(target) && 
		    target->query_temp("netdead") )
		   return notify_fail("对方正在断线中,不能对其施法。\n");
	} else {
		spl = arg;
		target = 0;
	}

	spl = replace_string( spl, " ", "_");

	if( stringp(spells = me->query_skill_mapped("spells")) ) {
	        int nocast;
		notify_fail("你所学的法术中没有这种功能。\n");
		nocast=(int)SKILL_D(spells)->cast_spell(me, spl, target);
		//cast_spell should return an integer as the no_cast time.
		if (!nocast) 
		  nocast=(int)SKILL_D("spells")->cast_spell(me, spl, target);
                if (nocast) {
                  me->set_temp("no_cast", 1);
		  //each cast should return an integer which is
		  //the no_cast time fot this cast.
		  //also, in each cast, can set busy or no_move
		  //time individually.   --mon 8/24/97
		  call_out("destruct_flag", nocast, me);
		  return 1;
		}
		return 0;
		}
		
	return notify_fail("你请先用 enable 指令选择你要使用的咒文系。\n");
}
Exemple #6
0
int main(object me, string arg)
{
	string spells, spl, trg;
	object target;
	
	seteuid(getuid());

        if((int)me->query_temp("no_cast")==1)
	        return notify_fail("你现在不能用魔法!\n");

	if( me->is_busy() )
		return notify_fail("( 你上一个动作还没有完成,不能念咒文。)\n");

	if( !wizardp(me) && environment(me)->query("no_magic") )
		return notify_fail("这里不准念咒文。\n");
		
	if( !arg ) return notify_fail("指令格式:cast <法术> [on <目标>]\n");
	if( sscanf(arg, "%s on %s", spl, trg)==2 ) {
		target = present(trg, environment(me));
		if( !target ) target = present(trg, me);
		if( !target ) return notify_fail("这里没有 " + trg + "。\n");
		
		if(!valid_kill(me,target,0)) return 0;

//add by yudian for prevent pk

set_to_killer(me,target);
        if(me->query("combat_exp")<250000 && userp(target))
                return notify_fail("自己功夫没练好就想杀人?\n");

        if(me->query("daoxing")<200000 && userp(target))
                return notify_fail("自己功夫没练好就想杀人?\n");  

        if(userp(target) && target->query("age")<17)
                return notify_fail("本站暂时保护新手。\n");

//        if( userp(target) && (int)me->query("nopk") || (int)target->query("nopk"))
//        	return notify_fail(HIG"已经受到保护,不能杀人?\n"NOR);	

		if( userp(me) && userp(target) && 
		    target->query_temp("netdead") )
		   return notify_fail("对方正在断线中,不能对其施法。\n");
	} else {
		spl = arg;
		target = 0;
	}

	spl = replace_string( spl, " ", "_");

	if( stringp(spells = me->query_skill_mapped("spells")) ) {
	        int nocast;
		notify_fail("你所学的法术中没有这种功能。\n");
		nocast=(int)SKILL_D(spells)->cast_spell(me, spl, target);
		//cast_spell should return an integer as the no_cast time.
		if (!nocast) 
		  nocast=(int)SKILL_D("spells")->cast_spell(me, spl, target);
                if (nocast) {
                  me->set_temp("no_cast", 1);
		  //each cast should return an integer which is
		  //the no_cast time fot this cast.
		  //also, in each cast, can set busy or no_move
		  //time individually.   --mon 8/24/97
		  call_out("destruct_flag", nocast, me);
		  return 1;
		}
		return 0;
		}
		
	return notify_fail("你请先用 enable 指令选择你要使用的咒文系。\n");
}
Exemple #7
0
int main(object me, string arg)
{
        object weapon, target;
        mapping smap, pmap, prepare;
        string martial, skill, perf;
string action,file,target_ob;
        seteuid(getuid());
        smap = me->query_skill_map();
        pmap = me->query_skill_prepare();
        if( me->is_busy() )
                return notify_fail("( 你上一个动作还没有完成,不能施用外功。)\n");

        if( !arg ) return notify_fail("你要用外功做什么?\n");
        if ( !wizardp(me) && environment(me)->query("no_fight")) 
                return notify_fail("这里不能施用外功。\n");
	//if( me->query("anger")< 30 )
//		return notify_fail("你怒气不足以使出特殊攻击!\n");
        if( sscanf(arg, "%s on %s", perf, arg)==2 ) {
                target = present(arg, environment(me));
                if( !target ) target = present(arg, me);
                if( !target ) return notify_fail("这里没有 " + arg + "。\n");

                if(!valid_kill(me,target)) return 0;

                if( userp(me) && userp(target) && 
                    target->query_temp("netdead") )
                   return notify_fail("对方正在断线中,不能对其施用外功。\n");

                arg=perf+" "+arg;
        } else if(sscanf(arg, "%s %s", perf, arg)==2 ) {
          //so can't use: perform vision id
          //but have to use: perform vision on id
          arg=perf;
        }
        if( sscanf(arg, "%s.%s", martial, arg)!=2 ) {
                if( weapon = me->query_temp("weapon") )
                        martial = weapon->query("skill_type");
                else if( weapon = me->query_temp("secondary_weapon") )
                       martial = weapon->query("skill_type");
                else if ( sizeof(pmap) == 0) martial = "unarmed";
                else if ( sizeof(pmap) == 1) martial = (keys(pmap))[0];
                else if ( sizeof(pmap) == 2) martial = (keys(pmap))[me->query_temp("action_flag")];
//else
  //                      martial = "unarmed";
        }
 else{
 if( martial == "axe" ||
     martial == "blade" ||
            martial == "dagger" ||
            martial == "fork" ||
            martial == "hammer" ||
            martial == "parry" ||
            martial == "unarmed" ||
            martial == "staff" ||
            martial == "sword" ||
            martial == "throwing" ||
            martial == "spear" ||
            martial == "whip" )
   return notify_fail("这种外功不需指定武功种类!\n");
 }
  //      if( weapon = me->query_temp("weapon") )
    //        martial = weapon->query("skill_type");
    //    else
      //      martial = "unarmed";


        if( stringp(skill = me->query_skill_mapped(martial)) ) {
notify_fail("你所使用的外功中没有这种功能。\n");
                if( SKILL_D(skill)->perform_action(me, arg) ) {
                        if( random(120) < (int)me->query_skill(skill) )
                                me->improve_skill(skill, 1, 1);
                        return 1;
                } else if( SKILL_D(martial)->perform_action(me, arg) ) {
                        if( random(120) < (int)me->query_skill(martial, 1) )
                                me->improve_skill(martial, 1, 1);
                        return 1;
                }
else {
if( sscanf(arg, "%s %s", action, target_ob)==2 )
                            {
target = present(target_ob, environment(me));
if( !target )
                                  return notify_fail("这里没有 " + target_ob + "。\n");
                            }
                            else
                            {
                                action = arg;
                            }

file = CLASS_D("fuqiperform/")+action;
if( !stringp(file) || file_size(file + ".c") <= 0 )
                            return 0;

return (int)call_other( file, "perform", me, target);
                       }
return 0;
        }
        return notify_fail("你请先用 enable 指令选择你要使用的外功。\n");
}