|
- //wuxiang-jian.c
- // Write By LSXK's System on 2013/8/20 星期二 18:34:02
- #include
- inherit SKILL;
- mixed* actions;
- mapping user;
- mapping *action = ({
- ([
- "action" : "$N使一招“相即无相”,手中$w随意挥舞,突然一剑朝$n刺去",
- "force" : 300,
- "dodge" : 0,
- "parry" : 50,
- "lvl" : 0,
- "damage" : 300,
- "skill_name" : "相即无相",
- "damage_type" : "刺伤"
- ]),
- });
- int valid_enable(string usage) { return usage == "parry" || usage == "sword"; }
- int practice_skill(object me)
- {
- if ((int)me->query("jingli") < 1000)
- return notify_fail("你的体力太低了。\n");
- if ((int)me->query("neili") < 1000)
- return notify_fail("你的内力不够练习该技能。\n");
- me->receive_damage("jingli", 100);
- me->add("neili", -100);
- return 1;
- }
- void add_actions(object me,mixed act){
- int i;
- string id = me->query("id");
- if(!intp(me->query("wuxiang")) || me->query("wuxiang")==0){
- user[id] = sizeof(user)+1;
- me->set("wuxiang",1);
- }
- i = sizeof(actions[user[id]]);
- actions[user[id]][i]= act;
- }
- string query_skill_name(int level)
- {
- int i;
- for(i = sizeof(action); i > 0; i--)
- if(level >= action[i-1]["lvl"])
- return action[i-1]["skill_name"];
- }
- mapping query_action(object me, object weapon)
- {
- int i;
- string id = me->query("id");
- if(sizeof(actions[user[id]])==0){
- for(i = sizeof(action); i > 0; i--)
- if(me->query("level") >= action[i-1]["lvl"])
- return action[random(i)];
- }
- i = sizeof(actions[user[id]]);
- return actions[user[id]][random(i)];
- }
- string perform_action_file(string action)
- {
- return __DIR__"wuxiang-jian/" + action;
- }
复制代码-
- #include
- #include
- #define LEARN "「" MAG "无相之术" NOR "」"
- inherit F_SSERVER;
- int perform(object me, object target)
- {
- string msg1;
- string msg2;
- mapping action;
- string name;
- if (! target || ! me->is_fighting(target))
- return notify_fail(LEARN "只能对战斗中的对手使用。\n");
- if(me->query_skill("wuxiang-jian",1)<200)
- return notify_fail("你的无相剑法运用的不是很娴熟,无法了解“无相”之意\n");
- if(me->query_skill("martial-cognize",1)<200)
- return notify_fail("武学修养乃是武学之本,像你这般本末倒置,岂不怪哉?\n");
- if(me->query("neili")<1000)
- return notify_fail("没有内力就是半个废人,废人就算习得高深的剑术又有何用?\n");
- if(me->query_int()<40)
- return notify_fail("像你这般悟性奇低之人,又怎能习得高深剑术?\n");
- if(me->query_con()<40)
- return notify_fail("根骨不够,纵使习得高深技巧,不得其运用之法,那不是等于无用?\n");
- if(!objectp(me->query_temp("weapon")))
- return notify_fail("你必须装备武器才能使用" LEARN "。\n");
- if(!objectp(target->query_temp("weapon")))
- return notify_fail("你也真是有趣,你难道想用兵器学来拳脚功夫?\n");
- msg1 = HIC "只见$N突然苦思冥想,对$n的攻击视而不见!\n"NOR
- HIR "$n见有机可乘,立即对$N发动了攻击!\n"NOR;
- message_combatd(msg1, me, target);
- COMBAT_D->do_attack(target,me,target->query_temp("weapon"),0);
- msg2 = HIB "$N嘿嘿一笑,仿佛摸清了$n的来路,默默将其记载脑海中\n"
- HIR "$n被这一笑吓得毛骨悚然。\n"NOR;
- message_combatd(msg2, me, target);
- action = target->query_action();
- me->set("wuxiang",1);
- "/kungfu/skill/wuxiang-jian"->add_actions(me,action);
- name=action->query("name");
- tell_object(me,HIR"你成功习得对手的武功招式"+name+"!"NOR);
- return 1;
- }
复制代码
大家帮我看看错在哪里好吗?错误显示:
执行时段错误:*Value being indexed is zero.
程式:/kungfu/skill/wuxiang-jian.c 第 57 行
物件:/kungfu/skill/wuxiang-jian
呼叫来自:/inherit/char/char.c 的 heart_beat() 第 180 行,物件: /clone/user/user#3784 ("修炼神功")
呼叫来自:/feature/attack.c 的 attack() 第 527 行,物件: /clone/user/user#3784 ("修炼神功")
呼叫来自:/adm/daemons/combatd.c 的 fight() 第 1707 行,物件: /adm/daemons/combatd
呼叫来自:/adm/daemons/combatd.c 的 do_attack() 第 576 行,物件: /adm/daemons/combatd
呼叫来自:/feature/attack.c 的 query_action() 第 429 行,物件: /clone/user/user#3784 ("修炼神功")
呼叫来自: 的 () 第 0 行,物件: /clone/user/user#3784 ("修炼神功")
呼叫来自:/kungfu/skill/wuxiang-jian.c 的 query_action() 第 57 行,物件: /kungfu/skill/wuxiang-jian
北大侠客行MUD,中国最好的MUD |
|