查看单个帖子
旧 2005-03-13   #1
dayu
初级会员
级别:3 | 在线时长:36小时 | 升级还需:14小时级别:3 | 在线时长:36小时 | 升级还需:14小时级别:3 | 在线时长:36小时 | 升级还需:14小时
 
dayu 的头像
 
注册: 05年03月12日
来自: 青岛
帖子: 35
声望力: 0
声望: 10 dayu 闻道则喜
现金:54两梁山币
资产:141两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0
【转帖】QN卡制作

qn卡的制作

#include <ansi.h>



inherit ITEM;
int help(object me);



int create()



{



..............



}



void init()



{



add_action("do_withdraw","quchu");



add_action("do_deposit","cunru");



add_action("do_check","check");



}



int do_deposit(string arg)



{



string what;
int amount;
object me;



me = this_player();



if( me->is_busy()||me->is_fight())
return notify_fail("你现在正忙着呢...。\n");
if(arg && sscanf(arg, "%d %s", amount, what)==2 && what=="qn")
{
if ( me->query("b_potential")>=1000000000 )
if ( me->query("b_potential")>=2000000000 )
return notify_fail("你卡里的潜能已经够多了,赶紧去学习吧。\n");
if (amount < 1||me->query("potential")-me->query("learned_points") < 1)
return notify_fail("你想存多少潜能?\n");
if (amount>me->query("potential")-me->query("learned_points"))
return notify_fail("你的潜能不够存。\n");
if ( amount>=99999999 )
return notify_fail("你最多能存"HIY+chinese_number(99999999)+NOR"点潜能,赶紧去学习吧。\n");
message_vision(sprintf("$N拿出%s点潜能,存进了"HIY"卡"NOR"。\n",chinese_number(amount)), me);
me->add("b_potential", amount/100 * 99);
me->add("potential",-amount);
me->save();
return 1;
}
else



return help(me);
}



int do_withdraw(string arg)



{



int amount, v, rv;
string what;
object me;



me = this_player();

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



if (arg && sscanf(arg, "%d %s", amount, what) == 2 )
{
if (amount < 1)
return notify_fail("你想取多少?\n");
if(what=="qn")
{
if (amount > me->query("b_potential"))
return notify_fail("你卡里的潜能不够取。\n");

me->add("b_potential",-amount);
me->add("potential",amount);
me->save();
message_vision(sprintf("$N从"HIY"卡"NOR"里取出%s点潜能。\n",chinese_number(amount)),me);
return 1;
}



}
return help(me);
}




int do_check()



{
int total = (int)this_player()->query("b_potential");
if(!total || total < 0)
{
this_player()->set("b_potential", 0);
return notify_fail("您这张卡上没有任何潜能余额。\n");
}
write("您"HIY"卡"NOR"中目前还有" + chinese_number(total)+ "点"CYN"潜能"NOR"余额。\n");
return 1;




}



int help(object me)
{
write(@HELP

提取潜能:命令格式:quchu <数量> 潜能
存入潜能:命令格式:cunru <数量> 潜能
查询余额:命令格式:check
HELP
);
return 1;
}

此帖于 2005-03-13 05:58 被 dayu 编辑.

]. . NIKO钢琴 .
音乐 .

1942的葡萄酒 .

会秀的女人 .

放纵歌唱 . . .

http://wpa.qq.com/pa?p=1:100072036:11点这里可以给我直接发QQ信息哦!
帅哥 dayu 当前离线  
回复时引用此帖