#include <ansi.h>

inherit F_SSERVER;
int perform(object me, object target)
{
    int damage;
    string msg;

    if( !target ) target = offensive_target(me);

    if( !target || !target->is_character() || !me->is_fighting(target) )
        return notify_fail("「"+HIW"龙啸在天"NOR+"」只能对战斗中的对手使用。\n");


    if( (int)me->query_skill("fengxiao-zhang", 1) < 100 )
          return notify_fail("你的风啸掌法不够熟练，不会使用「"+HIW"龙啸在天"NOR+"」。\n");

    if( (int)me->query("max_neili") < 1200 )
           return notify_fail("你的内力修为还不够高。\n");

    if( (int)me->query("neili") < 800 )
           return notify_fail("你的内力不够了。\n");

    if( me->query_temp("weapon"))
                return notify_fail("你先放下手中的武器再说吧？！\n");     

    msg = HIW "
$N施展出风啸掌法的绝学"HIW+"「龙啸在天」"+HIC"，身体突然拔起，\n接着龙吟一声，$N掌力已撞向$n。\n"NOR;  

    if( random(me->query("combat_exp")) > target->query("combat_exp")/2) { 
      me->start_busy(3);
   target->start_busy(random(2));

   damage = (int)me->query_skill("fengxiao-zhang", 1)*2+(int)me->query_skill("force",1);

   damage = damage + random(damage);

   target->receive_damage("qi", damage);
   target->receive_wound("qi", damage/2);
   me->add("neili", -damage-200);
   msg += HIY"$n只见上空的迷雾中出现$N的身影，$n眼睛一花，
  就中了$N的一招"HIW+"「龙啸在天」"+HIC"！！！\n"NOR;
                message_vision(msg, me, target);
      COMBAT_D->report_status(target);    
        return 1;

 } else
    {
       me->start_busy(3);
           me->add("neili",-200);        
       msg += HIG"$n脑中灵光一闪，爬在地下，以躲过了$N的掌力。\n"NOR;
    }
    message_vision(msg, me, target);

    if(!target->is_fighting(me)) target->fight_ob(me);
    return 1;
}
