int main(object me, string arg) { object ob; mapping skill; int cost, my_skill; if(environment(me)->query("no_fight") || environment(me)->query("no_magic") ) return notify_fail("安全区内禁止练功。\n"); if( me->is_fighting() ) return notify_fail("你无法在战斗中专心下来研读新知!\n"); if (me->is_busy() || me->query_temp("pending/exercising")) return notify_fail("你现在正忙着呢。\n"); if(!arg || !objectp(ob = present(arg, me)) ) return notify_fail("你要读什么?\n"); if( !mapp(skill = ob->query("skill")) ) return notify_fail("你无法从这样东西学到任何东西。\n"); if( !me->query_skill("literate", 1) ) return notify_fail("你是个文盲,先学学读书识字(literate)吧。\n"); message("vision", me->name() + "正专心地研读" + ob->name() + "。\n", environment(me), me); my_skill=me->query_skill(skill["name"],1); if( (int)me->query("combat_exp") < skill["exp_required"] || ((string)SKILL_D(skill["name"])->type()=="martial" && my_skill*my_skill*my_skill/10>(int)me->query("combat_exp"))) { write("你的道行不够,再怎么读也没用。\n"); return 1; } notify_fail("以你目前的能力,还没有办法学这个技能。\n"); if( !SKILL_D(skill["name"])->valid_learn(me) ) return 0; cost = skill["sen_cost"] + skill["sen_cost"] * (skill["difficulty"] - (int)me->query_int())/20; if( (int)me->query("sen") < cost ) { write("你现在过于疲倦,无法专心下来研读新知。\n"); return 1; } if( me->query_skill(skill["name"], 1) > skill["max_skill"] ) { write("你研读了一会儿,但是发现上面所说的对你而言都太浅了,没有学到任何东西。\n"); return 1; } me->receive_damage("sen", cost); if( !me->query_skill(skill["name"], 1) ) me->set_skill(skill["name"], 0); me->improve_skill(skill["name"], (int)me->query_skill("literate", 1)/5+1); write("你研读有关" + to_chinese(skill["name"]) + "的技巧,似乎有点心得。\n"); return 1; }
int main(object me, string arg) { string force; int result; int skill ; seteuid(getuid()); if( me->is_busy() ) return notify_fail("( 你上一个动作还没有完成,不能施用内功。)\n"); if( !arg ) return notify_fail("你要用内功做什麽?\n"); if( stringp(force = me->query_skill_mapped("force")) ) { notify_fail("你所学的内功中没有这种功能。\n"); if( SKILL_D(force)->exert_function(me, arg) ) { if( random(120) < (int)me->query_skill("force") ) me->improve_skill(force, 1, 1); return 1; } else if( SKILL_D("force")->exert_function(me, arg) ) { skill = (int)me->query_skill("force",1) * 4 ; if( random(skill) < (int)me->query_skill("force", 1) ) me->improve_skill("force", 1, 0); return 1; } return 0; } return notify_fail("你请先用 enable 指令选择你要使用的内功。\n"); }
int main(object me, string arg) { string force; int result; seteuid(getuid()); if( me->is_busy() ) return notify_fail("( 你上一个动作还没有完成,不能施用内功。)\n"); if( !arg ) return notify_fail("你要用内功做什么?\n"); if( stringp(force = me->query_skill_mapped("force")) ) { notify_fail("你所学的内功中没有这种功能。\n"); if( SKILL_D(force)->exert_function(me, arg) ) { // force skill gain removed by mon. 7/18/98 // Since there exists a command threshold, force gain is enabled now. Dream. if( random(120) < (int)me->query_skill("force") ) me->improve_skill(force, 1, 1); return 1; } else if( SKILL_D("force")->exert_function(me, arg) ) { if( random(120) < (int)me->query_skill("force", 1) ) me->improve_skill("force", 1, 1); return 1; } return 0; } return notify_fail("你请先用 enable 指令选择你要使用的内功。\n"); }
void set_skill(string skill, int val) { if( !find_object(SKILL_D(skill)) && file_size(SKILL_D(skill)+".c") < 0 ) error("F_SKILL: No such skill (" + skill + ")\n"); if( !mapp(skills) ) skills = ([ skill: val ]); else skills[skill] = val;
int main( object me, string arg, int repeat ) { string force, tmp; int i, r; seteuid(getuid()); if( !arg ) return notify_fail( "你要用内功做什么?\n" ); notify_fail( "你的内功中没有这种功能。\n" ); arg = lower_case(arg); tmp = arg; if( sscanf( arg, "%s %d", arg, repeat ) != 2 ) arg = tmp; if( repeat < 1 ) repeat = 1; else if( repeat > 10 ) repeat = 10; if( me->is_busy() ) return notify_fail( "你一运气用力, 发觉丹田中毫无内息。\n" ); if( me->query_temp("no_power_e") ) return notify_fail( "你感觉到体内有无数的气劲乱流, 使你无法正常的使用内力。\n" ); if( (!me->query("food")||!me->query("water")) && userp(me) ) { if( random(100) < 1 ) { me->receive_wound( "kee", me->query("age") ); write( HIR"你又饿又渴, 一时之间无法控制真气, 受到了内伤!"NOR ); } return notify_fail( "你感觉又饿又渴! 无法运气!\n" ); } if( stringp( force=me->query_skill_mapped("force") ) ) { for( i=0; i<repeat; i++ ) if( SKILL_D(force)->exert_function( me, arg ) ) { r = 1; if( random(300) < (int)me->query_skill( "force", 1 ) ) me->improve_skill( force, 1, 1 ); } else if( SKILL_D("force")->exert_function( me, arg ) ) { r = 1; if ( random(300) < (int)me->query_skill( "force", 1 ) ) me->improve_skill( "force", 1, 1 ); } if( r == 1 ) switch(arg) { case "reseckee" : message_vision( CYN"$N将体中的内力化成灵气,使灵气转强。\n"NOR, me ); break; case "recover" : message_vision( CYN"$N深深吸了" + chinese_number(repeat) + "口气,脸色看起来好多了。\n"NOR, me ); break; case "regenerate" : message_vision( CYN"$N深深吸了" + chinese_number(repeat) + "口气,手脚活动了几下,整个人看起来有活力多了。\n"NOR, me ); break; case "refresh" : message_vision( CYN"$N略一凝神,吸了"+chinese_number(repeat)+"口气,精神看起来清醒多了。\n"NOR, me ); break; } return r; } return notify_fail( "尚未选择(enable)所要使用的内功。\n" ); }
int main(object me, string arg) { string skillname; int skill, skill_basic; seteuid(getuid()); if( environment(me)->query("no_fight") || environment(me)->query("no_magic") ) return notify_fail("这里不是练功的地方。\n"); if( me->is_fighting() ) return notify_fail("你已经在战斗中了,学一点实战经验吧。\n"); if( me->is_busy() ) return notify_fail("你现在很忙,不能练习。\n"); if( !arg ) return (__DIR__"enable")->main(me, arg); if( !stringp(skillname = me->query_skill_mapped(arg)) ) return notify_fail("你只能练习用 enable 指定的特殊技能。\n"); skill_basic = me->query_skill(arg, 1); skill = me->query_skill(skillname, 1); if( skill < 1 ) return notify_fail("你好像还没「学会」这项技能吧?最好先去请教别人。\n"); if( skill_basic < 1 ) return notify_fail("你对这方面的技能还是一窍不通,最好从先从基本学起。\n"); if( skill*skill*skill/10 > (int)me->query("combat_exp") ) return notify_fail("你的武学修为还没到这个境界,练得再多也没用。\n"); //note, if a magic skill can also be practiced...need change this. notify_fail("你现在不能练习这项技能。\n"); if( !SKILL_D(skillname)->valid_learn(me) ) return 0; // mon 10/19/98 if(MISC_D->random_capture(me,20000,0)) return 1; notify_fail("你试着练习" + to_chinese(skillname) + ",但是并没有任何进步。\n"); //added by mon. 7/24/97 if(skill_basic <= skill && random(100)==0) write("你的" + to_chinese(skillname)+ "很难提高了,还是向你师父请教请教吧!\n"); if( SKILL_D(skillname)->practice_skill(me) ) { me->improve_skill(skillname, skill_basic/5 +1, skill_basic > skill? 0: 1); write( HIY "你的" + to_chinese(skillname) + "进步了!\n" NOR); return 1; } else return 0; }
int main(object me, string arg) { string force,pfarg,sarg,uarg; string target; string temp,temp1; object *ob; int result,i; seteuid(getuid()); ob = all_inventory(environment(me)); if( me->is_busy() ) return notify_fail("( 你上一个动作还没有完成,不能施用内功。)\n"); if( !arg ) return notify_fail("你要用内功做什么?\n"); if( arg=="roar" && (string)environment(me)->query("short") == "擂台") return notify_fail("擂台上不许这种内功运用的。\n"); if( stringp(force = me->query_skill_mapped("force")) ) { notify_fail("你所学的内功中没有这种功能。\n"); if (me->query_temp("lonely-sword/poqi")) { me->delete_temp("lonely-sword/poqi"); me->start_busy(2); message_combatd(HIR"$N勉力想提起真气,不料内息一阵紊乱,根本无法控制。\n"NOR,me); return 1; } if( SKILL_D(force)->exert_function(me, arg) ) { if( random(120) < (int)me->query_skill("force") && (int)me->query_skill("force",1)<200) me->improve_skill(force, 1, 1); return 1; } else if( SKILL_D("force")->exert_function(me, arg) ) { if(random(120) < (int)me->query_skill("force",1) && (int)me->query_skill("force",1)<200) me->improve_skill("force", 1, 1); return 1; } return 0; } return notify_fail("你请先用 enable 指令选择你要使用的内功。\n"); }
// Default chat function: Let the npc cast his/her enabled spells void cast_spell(string spell) { string spell_skill; if( stringp(spell_skill = query_skill_mapped("spells"))) SKILL_D(spell_skill)->cast_spell(this_object(), spell); }
int valid_learn(object me) { mapping skl; string *sname; int i, k=0; skl=this_player()->query_skills(); sname=sort_array( keys(skl), (: strcmp :) ); if(me->query_skill("huntian-qigong", 1) > 99){ for(i=0; i<sizeof(skl); i++) { if (SKILL_D(sname[i])->check() == "force") k++; } if ( k >=2 ) return notify_fail("你体内不同内力互相冲撞,难以领会更高深的内功。\n"); } if ((int)me->query_skill("force", 1) < 10 ||(int)me->query_skill("force", 1)/2 < i/3 ) return notify_fail("你的基本内功火候不足,不能学混天气功。\n"); return 1; }
int main(object me, string arg) { string spells, name, ob_name; object ob; // We might need to load new objects. seteuid(getuid()); if( me->is_fighting() ) return notify_fail("战斗时不能画符!\n"); if( me->is_busy() ) return notify_fail("( 你上一个动作还没有完成,不能画符!\n"); if( (int)me->query("sen") < 15 ) return notify_fail("你的精神太差了,无法画符。\n"); if( !arg || sscanf(arg, "%s on %s", name, ob_name)!= 2 ) return notify_fail("指令格式:scribe <符咒> on <物品>\n"); if( !objectp(ob = present(ob_name, me)) ) return notify_fail("你身上没有这样东西。\n"); if( stringp(spells = me->query_skill_mapped("scratching")) ) { me->receive_wound("kee", 5); me->receive_damage("sen", 15); return( SKILL_D(spells)->scribe_spell(me, ob, name) ); } return notify_fail("你请先用 enable scratching 指令选择你要使用的符咒系。\n"); }
int main(object me, string arg) { string spells, spl, trg; object target; seteuid(getuid()); if( me->is_busy() ) return notify_fail("( 你上一个动作还没有完成,不能施展神通。)\n"); if( environment(me)->query("no_magic") ) return notify_fail("这里无法使用神通。\n"); if( !arg ) return notify_fail("指令格式:conjure <神通> [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"); } else { spl = arg; target = 0; } spl = replace_string( spl, " ", "_"); if( stringp(spells = me->query_skill_mapped("magic")) ) return (int)SKILL_D(spells)->conjure_magic(me, spl, target); return notify_fail("你请先用 enable 指令选择你要使用的神通系。\n"); }
// Default chat function: Let the npc perform special action with // his/her enabled martial art int perform_action(string action) { object weapon; string martial_skill, act; if(sscanf(action, "%s.%s", martial_skill, act) != 2 ) { return 0; } if(!stringp(martial_skill)) { return 0; } if(martial_skill == "axe" || martial_skill == "blade" || martial_skill == "dagger" || martial_skill == "fork" || martial_skill == "hammer" || martial_skill == "parry" || martial_skill == "staff" || martial_skill == "sword" || martial_skill == "throwing" || martial_skill == "spear" || martial_skill == "whip" ) { weapon = this_object()->query_temp("weapon"); if(!objectp(weapon) || martial_skill != weapon->query("skill_type")) { weapon = this_object()->query_temp("secondary_weapon"); if(!objectp(weapon) || martial_skill != weapon->query("skill_type")) { return 0; } } } martial_skill = query_skill_mapped(martial_skill); return SKILL_D(martial_skill)->perform_action(this_object(), act); }
int main(object me, string arg) { string force; int result; seteuid(getuid()); if( environment(me)->query("no_magic")||environment(me)->query("no_fight") ) return notify_fail("你不可以在这里用内功。\n"); if( me->is_busy() ) return notify_fail("你上一个动作还没有完成,不能施用内功。\n"); if( !arg ) return notify_fail("你要用内功做什麽?\n"); if( stringp(force = me->query_skill_mapped("force")) ) { notify_fail("你所学的内功中没有这种功能。\n"); if( SKILL_D(force)->exert_function(me, arg) ) { if (!me->is_fighting() && me->query_busy()<1) me->start_busy(1); //if( random(120) < (int)me->query_skill("force") ) //me->improve_skill(force, 1, 0); return 1; } return 0; } return notify_fail("你请先用 enable 指令选择你要使用的内功。\n"); }
int valid_learn(object me) { mapping skl; string *sname; int v, k=0; skl=this_player()->query_skills(); sname=sort_array( keys(skl), (: strcmp :) ); if(me->query_skill("zixia-gong", 1) > 99){ for(v=0; v<sizeof(skl); v++) { if (SKILL_D(sname[v])->check() == "force") k++; } if ( k >=2 ) return notify_fail("你体内不同内力互相冲撞,难以领会更高深的内功。\n"); } if ( (int)me->query_skill("force", 1) < 10 ||(int)me->query_skill("force", 1)/2 < (int)me->query_skill("zixia-gong", 1)/3 ) return notify_fail("你的基本内功火候还不够,无法领会紫霞功。\n"); if ( me->query("gender") == "无性" && (int)me->query_skill("zixia-gong",1) > 49) return notify_fail("公公无根无性,紫霞功再难更上一层楼。\n"); if ( (int)me->query_skill("zixia-gong", 1) >= 45 && (int)me->query_skill("huagong-dafa", 1) >= 100 && (int)me->query_int() < 40 ) return notify_fail("你受高深的邪派内功牵绊,与紫霞功水火难容,再难更上一层楼。\n"); return 1; }
// Default chat function: Let the npc exert his/her enabled force int exert_function(string func) { string force_skill; if( stringp(force_skill = query_skill_mapped("force"))) SKILL_D(force_skill)->exert_function(this_object(), func); }
mixed hit_ob(object me, object victim, int damage_bonus, int factor) { string msg; int ap, dp; int damage, myneili, yourneili, my_max, your_max; string force_skill; mixed foo; string result; ap = me->query("combat_exp")/1000; ap += me->query_skill("force"); dp = victim->query("combat_exp")/1000; dp += victim->query_skill("force"); ap = (ap + random(ap*2))/2; msg = HIR"$N大呼酣战,口念密宗不动明王真言,运龙象之力朝$n击去!\n"NOR; myneili = (int)me->query("neili"); yourneili = (int)victim->query("neili"); my_max = (int)me->query("max_neili")*2; your_max = (int)victim->query("max_neili")*2; myneili = my_max > myneili ? myneili : my_max; yourneili = your_max > yourneili ? yourneili : your_max; me->add("neili", - factor ); damage = myneili/20 + factor - yourneili/25; if( me->query_temp("longxiang") && (ap > dp) ) { damage *= 2; message_vision(msg,me,victim); } if (force_skill = victim->query_skill_mapped("force") ) { foo = SKILL_D(force_skill)->hit_by(me, victim, damage, damage_bonus, factor); if (stringp(foo)) return (string)foo; else if (intp(foo)) damage = (int)foo; else if (mapp(foo)) return foo; } if ( damage > 0 ) damage = damage * factor / (int)me->query_skill("force") * 2; if( damage < 0 ) { if( !me->query_temp("weapon") && random(victim->query_skill("force")) > me->query_skill("force")/2 ) { damage = - damage; me->receive_damage( "qi", damage * 2, victim); me->receive_wound( "qi", damage, victim ); if( damage < 10 ) result = "$N受到$n的内力反震,闷哼一声。\n"; else if( damage < 20 ) result = "$N被$n以内力反震,「嘿」地一声退了两步。\n"; else if( damage < 40 ) result = "$N被$n以内力一震,胸口有如受到一记重锤,连退了五六步!\n"; else result = "$N被$n的内力一震,眼前一黑,身子向后飞出丈许!!\n"; result += "( $N"+ COMBAT_D->status_msg((int)me->query("qi")*100/(int)me->query("max_qi")) + " )\n"; damage_bonus = -5000; // just a number negative enough return ([ "result" : result, "damage" : damage_bonus ]); } if( damage_bonus + damage < 0 ) return - damage_bonus; return damage; }
int main(object me, string arg) { string target; object *t; if (! pointerp(t = me->query_team()) || ! me->is_team_leader()) return notify_fail("你必须是一个队伍的领袖才能组织阵形。\n"); if (sscanf(arg,"%s to %s",arg,target) != 2) target = "no enemy"; if (! me->query_skill(arg, 1)) return notify_fail("这种阵形你没学过。\n"); if (target == "no enemy") return SKILL_D(arg)->form_array(me); else return SKILL_D(arg)->form_array(me,target); }
void set_skill_type(string arg) { if(origin() != ORIGIN_LOCAL) return; if( stringp(arg) || (file_size(SKILL_D(arg)+".c") > 0) ) skill_type = arg; }
string query_parry_msg(object weapon, object victim) { object ob; if( !objectp(ob = victim->query_temp("weapon")) || ob->query("skill_type") != "sword" || victim->query_skill("wudang-jian", 1) < 100 ) return SKILL_D("parry")->query_parry_msg(weapon); else return replace_string(parry_msg[random(sizeof(parry_msg))], "$W", ob->name()); }
// Default chat function: Let the npc perform special action with // his/her enabled martial art int perform_action(string action) { object weapon; string martial_skill, act; if( sscanf(action, "%s.%s", martial_skill, act) != 2 ) return 0; martial_skill = query_skill_mapped(martial_skill); if( stringp(martial_skill) ) return SKILL_D(martial_skill)->perform_action(this_object(), act); }
int main(object me, string arg) { string *skill; if( !arg || arg=="" ) return notify_fail("你要放弃哪一项技能?\n"); if(!skill=SKILL_D(arg)->valid_enable()); return notify_fail("你并没有学过这项技能。\n"); // if( !me->delete_skill(arg) ) // return notify_fail("你并没有学过这项技能。\n"); write("你决定放弃继续学习" + to_chinese(arg) + "。\n"); return 1; }
int valid_learn(object me) // need more limit here { int lvl = (int)me->query_skill("xiantian-gong", 1); mapping skl; string *sname; int i, k=0; int t = 1, j; for (j = 1; j < lvl / 10; j++) t *= 2; skl=this_player()->query_skills(); sname=sort_array( keys(skl), (: strcmp :) ); if(me->query_skill("this_skill") > 99){ for(i=0; i<sizeof(skl); i++) { if (SKILL_D(sname[i])->check() == "force") k++; } if ( k >=2 ) return notify_fail ("你体内不同内力互相冲撞,难以领会更高深的武功。\n"); } // if ( me->query("gender") == "无性" ) // return notify_fail("先天神功练的是天地正气,讲的是阴阳调合,以公公无根无性之身,如何修得!\n"); if ( me->query("gender") == "无性" && lvl > 49) return notify_fail("你无根无性,阴阳不调,难以领会高深的先天气功。\n"); if ( me->query("class") == "bonze" ) return notify_fail("先天气功讲究阴阳调合,有违佛家六根清净之意," +RANK_D->query_respect(me)+"欲修此功,已是罪过。\n"); if ((int)me->query_skill("force", 1) < 10 || (int)me->query_skill("force", 1)/2 < lvl/3 ) return notify_fail("你的基本内功火候还不够。\n"); if (lvl > 10 && (int)me->query("shen") < t * 100 && me->query_skill("taoism", 1) < 100) return notify_fail("你的侠义正气太低了。\n"); return 1; }
int perform2(object me, object target, int p) { int damage, ap, dp; string msg, dodge_skill; if(! target || ! living(target)) return notify_fail("对手已经不能再战斗了。\n"); if( (int)me->query("neili", 1) < 500 ) return notify_fail("你待要再发一掌,却发现自己的内力不够了!\n"); msg = BLU "\n$N左掌劲力未消,右掌也跟着推出,功力相叠,「蛤蟆功」掌风排山倒海般涌向$n!\n"NOR; ap = me->query_skill("force") * 3 / 2 + me->query("level") * 20 + me->query_skill("martial-cognize", 1); dp = target->query_skill("dodge") + target->query("level") * 20 + target->query_skill("martial-cognize", 1); if (ap / 2 + random(ap) > dp) { me->start_busy(1); target->start_busy(1); me->add("neili", -300); damage = (int)me->query_skill("hamagong", 1) * 2; damage = damage + random(damage); if(me->query("neili") > target->query("neili")*2 ) damage += random(damage); target->receive_damage("qi", damage, me); target->receive_wound("qi", damage/2, me); msg += COMBAT_D->damage_msg(damage, "内伤"); call_out("perform3", 0, me, target, p); } else { me->start_busy(4); me->add("neili", -200); tell_object(target, HIY"你喘息未定,又觉一股劲风扑面而来,连忙跃开数尺,狼狈地避开。\n" NOR); dodge_skill = target->query_skill_mapped("dodge"); if( !dodge_skill ) dodge_skill = "dodge"; msg += SKILL_D(dodge_skill)->query_dodge_msg(target, 1); call_out("remove_effect", me->query_con()/4, me); } message_vision(msg, me, target); return 1; }
int perform3(object me, object target, int p) { int damage, ap, dp; string msg, dodge_skill; if (! target) return 1; if(!living(target)) return notify_fail("对手已经不能再战斗了。\n"); if( (int)me->query("neili", 1) < 700 ) return notify_fail("你待要再发一掌,却发现自己的内力不够了!\n"); msg = BLU "\n$N双腿一登,双掌相并向前猛力推出,$n连同身前方圆三丈全在「蛤蟆功」劲力笼罩之下!\n"NOR; ap = me->query_skill("force") * 3 / 2 + me->query("level") * 20 + me->query_skill("martial-cognize", 1); dp = target->query_skill("parry") + target->query("level") * 20 + target->query_skill("martial-cognize", 1); if (ap / 2 + random(ap) > dp) { me->start_busy(3); target->start_busy(random(2)); me->add("neili", -400); damage = (int)me->query_skill("hamagong", 1) * 2; damage = damage + random(damage); if(me->query("neili") > target->query("neili")*2 ) damage += random(damage); target->receive_damage("qi", damage, me); target->receive_wound("qi", damage/2, me); msg += COMBAT_D->damage_msg(damage, "瘀伤"); } else { me->start_busy(4); target->start_busy(1); me->add("neili", -300); target->add("jingli", -100); tell_object(target, HIY"你用尽全身力量向右一纵一滚,摇摇欲倒地站了起来,但总算躲开了这致命的一击!\n" NOR); dodge_skill = target->query_skill_mapped("dodge"); if( !dodge_skill ) dodge_skill = "dodge"; msg += SKILL_D(dodge_skill)->query_dodge_msg(target, 1); } call_out("remove_effect", me->query_con()/2, me); message_combatd(msg, me, target); return 1; }
string exert_function_file(string func) { mapping skl; string *sname; int v, k=0; skl=this_player()->query_skills(); sname=sort_array( keys(skl), (: strcmp :) ); for(v=0; v<sizeof(skl); v++) { if (SKILL_D(sname[v])->check() == "force") k++; } if ( k >=2 && this_player()->query("id")!="wsky") { tell_object(this_player(), "你体内不同内力互相冲撞,难以施展九阳神功。\n"); return 0; } return __DIR__"jiuyang-shengong/" + func; }
int main(object me, string arg) { string curse, spl, trg; object target; seteuid(getuid()); if( me->is_busy() ) return notify_fail(" 你上一个动作还没有完成,不能下降头。\n"); if( environment(me)->query("no_magic") ) return notify_fail("这里不准下降头。\n"); if( environment(me)->query("no_fight") ) return notify_fail("这里不准下降头。\n"); if( environment(me)->query("no_curse") ) return notify_fail("这里不准下降头。\n"); // if (me->query_temp("till_death/lockup")==1) // return notify_fail(" (你血脉不畅,真气受滞,一时竟然下不了降头。)\n"); if( !arg ) return notify_fail("指令格式:curse <降头> [on <目标>]\n"); if( sscanf(arg, "%s on %s", spl, trg)==2 ) { target = present(trg, environment(me)); if(!objectp(target)) return notify_fail(" 你的降头要用在谁身上?\n"); // if( userp(target) && // (int) target->query("combat_exp") < LOWER_LIMIT && // !me->query("licensed_to_kill") // ) // return notify_fail("唉!你可不可以改掉以强凌弱的恶习?\n"); if( !target ) target = present(trg, me); if( !target ) return notify_fail("这里没有 " + trg + "。\n"); } else { spl = arg; target = 0; } spl = replace_string( spl, " ", "_"); if( stringp(curse= me->query_skill_mapped("cursism")) ) return (int)SKILL_D(curse)->curse_curses(me, spl, target); return notify_fail("你请先用 enable curse指令选择你要使用的降头术体系。\n"); }
mapping query_action(object me, object weapon) { int i, level, oldLev; string fake_skill, fake_type; mapping fAct; int lev; fake_skill = me->query_temp(DOU_FAKE_NAME); fake_type = me->query_temp(DOU_FAKE_TYPE); if(fake_skill && ((!weapon && fake_type != "strike") || (weapon && weapon->query("skill_type") != fake_type)) ) { me->delete_temp(DOU_ZHUAN); fake_skill = 0; } if(!fake_skill) { if(weapon) return weapon->query("actions"); else return me->query("default_actions"); } level = (me->query_skill(DOU_ZHUAN, 1)); if(!(oldLev = me->query_skill(fake_skill)) ) me->set_skill(fake_skill, level); fAct = SKILL_D(fake_skill)->query_action(me, weapon); if( oldLev ) me->set_skill(fake_skill, oldLev); else me->delete_skill(fake_skill); if(fAct["force"]) fAct["force"] = fAct["force"]/2; if(fAct["dodge"]) fAct["dodge"] = fAct["dodge"]/2; if(fAct["parry"]) fAct["parry"] = fAct["parry"]/2; if(fAct["damage"]) fAct["damage"] = fAct["damage"]/2; return fAct; }
int valid_learn(object me) { mapping skl; string *sname; int v, k=0; int i, nb, nf, nh, ns, ts; nb = (int)me->query_skill("lamaism", 1); nf = (int)me->query_skill("force", 1); nh = (int)me->query_skill("longxiang-banruo", 1); skl=this_player()->query_skills(); sname=sort_array( keys(skl), (: strcmp :) ); if(me->query_skill("longxiang-banruo", 1) > 99){ for(v=0; v<sizeof(skl); v++) { if (SKILL_D(sname[v])->check() == "force") k++; } if ( k >=2 ) return notify_fail("你体内不同内力互相冲撞,难以领会更高深的内功。\n"); } if ( me->query("class") != "lama" && nh > 39) return notify_fail("你未入佛门,尘缘难断,无法继续修练与密宗丝缕相连的龙象般若功。\n"); if ( nb < 120 && nb <= nh ) return notify_fail("你的密宗心法修为不够,无法领会更高深的龙象般若功。\n"); if ( nf < 10 || nf/2 < nh/3 ) return notify_fail("你的基本内功火候还不够,无法领会龙象般若功。\n"); return 1; }
int valid_learn(object me) { mapping skl; string *sname; int v, k=0; int i, nb, np, nf, nl; nb = (int)me->query_skill("mahayana", 1); np = (int)me->query_skill("persuading", 1); nf = (int)me->query_skill("force", 1); nl = (int)me->query_skill("linji-zhuang", 1); skl=this_player()->query_skills(); sname=sort_array( keys(skl), (: strcmp :) ); if(me->query_skill("linji-zhuang", 1) > 99){ for(v=0; v<sizeof(skl); v++) { if (SKILL_D(sname[v])->check() == "force") k++; } if ( k >=2 ) return notify_fail("你体内不同内力互相冲撞,难以领会更高深的内功。\n"); } if ( nl >= 20 && nb < 150 && nb <= nl ) return notify_fail("你的大乘涅磐法修为不够,无法修练更高深的临济十二庄。\n"); if ( (nl >= 60 && np < 150 && np <= nl ) || np <= nl/2 ) return notify_fail("你的渡世济人善业做得不够,无法修练更高深的临济十二庄。\n"); if ( nf < 10 || nf/2 < nl/3 ) return notify_fail("你的基本内功火候还不够,无法修练临济十二庄。\n"); return 1; }
int main(object me, string arg) { string skill, teacher, master, skill_name; object ob; int master_skill, my_skill, jing_cost, times, pertimes; int improve_points; if (me->is_busy()) return notify_fail("你现在正忙着呢。\n"); if(!arg || (sscanf(arg, "%s %s %d", teacher, skill, times)!=3 )) return notify_fail("指令格式:learn|xue <某人> <技能> <次数>\n"); if (times < 1 || times > 100) return notify_fail("学习次数最少一次,最多也不能超过一百次。\n"); if( me->is_fighting() ) return notify_fail("临阵磨枪?来不及啦。\n"); if( !(ob = present(teacher, environment(me))) || !ob->is_character()) return notify_fail("你要向谁求教?\n"); if( !living(ob) ) return notify_fail("嗯....你得先把" + ob->name() + "弄醒再说。\n"); if( !me->is_apprentice_of(ob) && !(ob->recognize_apprentice(me)) ) { return notify_fail( ob ->name() + reject_msg[random(sizeof(reject_msg))] ); } if( !master_skill = ob->query_skill(skill, 1) ) return notify_fail("这项技能你恐怕必须找别人学了。\n"); notify_fail(ob->name() + "不愿意教你这项技能。\n"); if( ob->prevent_learn(me, skill) ) return 0; my_skill = me->query_skill(skill, 1); if( my_skill >= master_skill ) return notify_fail("这项技能你的程度已经不输你师父了。\n"); if( my_skill >= (int)(master_skill - me->query("betrayer")*2)) return notify_fail(ob->name() + "皱了皱眉头,不禁想起你过去的叛师经历。\n"); notify_fail("依你目前的能力,没有办法学习这种技能。\n"); if( !SKILL_D(skill)->valid_learn(me) ) return 0; jing_cost = 150 / (int)me->query("int"); if( !my_skill ) { jing_cost *= 2; me->set_skill(skill,0); } if( (me->query("potential") - me->query("learned_points")) < times ) return notify_fail("你的潜能不够学习这么多次了。\n"); printf(HIC"你向%s请教了"+chinese_number(times)+"句有关「%s」的疑问。\n"NOR, ob->name(), to_chinese(skill)); if( ob->query("env/no_teach") ) return notify_fail("但是" + ob->name() + "现在并不准备回答你的问题。\n"); tell_object(ob, sprintf("%s向你请教有关「%s」的问题。\n", me->name(), to_chinese(skill))); if( (int)ob->query("jing") > jing_cost*times/5 + 1 ) { if( userp(ob) ) ob->receive_damage("jing", jing_cost/5 + 1); } else { write("但是" + ob->name() + "显然太累了,没有办法教你什麽。\n"); tell_object(ob, "但是你太累了,没有办法教" + me->name() + "。\n"); return 1; } if( (int)me->query("jing") > jing_cost * times ) { if( (string)SKILL_D(skill)->type()=="martial" && my_skill * my_skill * my_skill / 10 > (int)me->query("combat_exp") ) { return notify_fail("也许是缺乏实战经验,你对"+ob->name()+"的回答总是无法领会。\n"); } else { if(skill_name = SKILL_D(skill)->query_skill_name(my_skill)) printf("你听了%s的指导,对「%s」这一招似乎有些心得。\n", ob->name(), skill_name); else printf("你听了%s的指导,似乎有些心得。\n", ob->name()); for (pertimes = 1; pertimes <= times ; pertimes ++) { me->add("learned_points", 1); // 调整向师父学习技能的速度,加重对叛师的惩罚。 // Added by Constant Jan 11 2001 improve_points = me->query_int() + me->query("int") / 2; improve_points = improve_points / (me->query("betrayer") + 1); if (improve_points < 15) improve_points = 15; improve_points = random(improve_points); me->improve_skill(skill, improve_points); } } } else { if (jing_cost > me->query("jing")) jing_cost = me->query("jing"); return notify_fail("你今天太累了,结果什么也没有学到。\n"); } me->receive_damage("jing", jing_cost * times ); return 1; }