
int valid_enable(string usage) { return usage == info["type"] || usage == "parry"; }
int valid_learn(object me)
{
	object weapon;

	if((int)me->query("level") < 50)
		return notify_fail("以你目前的能力，无法学习这种技能。\n");

	if(info["type"] == "sword" || info["type"] == "blade" || info["type"] == "spear"
	|| info["type"] == "club"  || info["type"] == "whip"  || info["type"] == "axe"
	|| info["type"] == "hammer")
	{
		if(!objectp(weapon = me->query_temp("weapon"))
			|| weapon->query("skill_type") != info["type"])
			return notify_fail("你所使用的武器类型不对，无法学习"+ info["cnname"] +"。\n");
	}
	else
		if(objectp(me->query_temp("weapon")))
			return notify_fail("学习"+ info["cnname"] +"时必须空手。\n");
	return 1;
}
int practice_skill(object me)
{
	object weapon;

	if ((int)me->query("jing") < 50)
		return notify_fail("你的精力太低了。\n");

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

	if(info["type"] == "sword" || info["type"] == "blade" || info["type"] == "spear"
	|| info["type"] == "club"  || info["type"] == "whip"  || info["type"] == "axe"
	|| info["type"] == "hammer")
	{
		if(!objectp(weapon = me->query_temp("weapon"))
			|| weapon->query("skill_type") != info["type"])
			return notify_fail("你所使用的武器类型不对，无法练习"+ info["cnname"] +"。\n");
	}
	else
		if(objectp(me->query_temp("weapon")))
			return notify_fail("练习"+ info["cnname"] +"时必须空手。\n");

	me->receive_damage("jing",50);
	me->add("neili",-50);
	return 1;
}
mapping query_action(object me, object weapon)
{
	int i,level;
	level = (int) me->query_skill(info["name"],1);
	for(i = sizeof(action); i > 0; i--)
		if(level > action[i-1]["lvl"])
			return action[NewRandom(i, 20, level/5)];
}
int double_attack()
{
	object me;
	me = this_player();

	if((int)me->query_skill(info["name"],1) > 100
		&& me->query("id") == info["master_id"])
		return 1;
	else
		return 0;
}
// 学习难度
int learn_hard() { return 5;}
// 技能类型
string type() { return "sponsor"; }
// 信息查询
mapping query_info(){ return info;}