int cmd_zap(string str) { object target, targetenv; notify_fail( SYNTAX ); if(!str || str == "") return 0; #ifdef GUEST_NO_ZAP if (getuid(this_player())=="guest") { notify_fail ("Guest is not permitted to zap.\n") ; return 0 ; } #endif str = lower_case(str); targetenv = environment(this_player()); if (!targetenv) { write("A flash of lightning is consumed in the dark void.\n"); return 1; } target = present(str, targetenv); if(!target) { write("Zap: There is no such living object here.\n"); return 1; } if(!living(target)) { write("Zap: That object is not alive.\n"); return 1; } if(target->link_data("dead") || target->query_dead() || target->query("dead")) { write("Zap: That object is already dead.\n"); return 1; } if(wizardp(target) && target->query("immortal")) { write("Zap: That wizard is immortal, and cannot be killed.\n"); return 1; } // Mobydick thinks this'll be really funny. if (interactive(target) && adminp(getuid(this_player()))==0) target = this_player() ; tell_room(environment(this_player()), (string)this_player()->query("cap_name") + " summons a flash " + "of lightning from the heavens, and " + (string)target->query("cap_name") + " is\nstruck down dead by its " + "destructive power.\n", ({ this_player(), target }));
int valid_leave(object me, string dir) { object pai; if( (string)me->query("family/family_name")=="ÄϺ£ÆÕÍÓɽ" ) return 1; if( wizardp(me)) return 1; if (dir == "westup") { if (objectp(present("luo han", environment(me))) ) return notify_fail("ÂÞººÉìÊÖµ²×¡ÁËÄãµÄȥ·¡£\n"); } return ::valid_leave(me, dir); }
int flush_maze(){ object maze_room; string flush_msg; if (!wizardp(this_player())) return 0; maze_room=find_object(__DIR__"icecave-maze"); if (!maze_room) return 1; flush_msg=MAG"\n��Ȼ��һ��紵������Χ���һ�֦��Ȼ�ƶ������������� һ����ҡ��ת���㷢���Լ��ֻص����һ��ֵĽ��ڡ�\n\n"NOR, maze_room->remove_all_players(maze_room,this_object(),flush_msg); maze_room->refresh_maze(); return 1; }
void announcing (string str) { if (DEBUG) { object snowcat = find_player ("snowcat"); if (wizardp(snowcat)) tell_object (snowcat," ◇ "+str); } else { object wei = load_object (__DIR__"npc/wei"); wei->command_function("chat "+str); } }
int valid_leave(object me, string dir) { mapping myfam; myfam = (mapping)me->query("family"); if ( (!myfam || myfam["family_name"] != "华山派") && dir != "south" ) { if ( (!myfam || myfam["family_name"] != "华山派") && dir != "north" ) return notify_fail("华山不留外客,你不能住在这里!\n"); } if ( me->query("gender") == "男性" && dir == "west" && !wizardp(me) ) return notify_fail("看清楚点,男弟子休息室在东边!\n"); if ( me->query("gender") == "女性" && dir == "east" && !wizardp(me) ) return notify_fail("看清楚点,女弟子休息室在西边!\n"); if ( me->query("gender") == "无性" && (dir=="east" || dir=="west") ) return notify_fail("你不能住在这里!\n"); if (dir == "south" && objectp(present("lu dayou", environment(me)))) return notify_fail("陆大有喝道:后面是师父的寝室,这位"+RANK_D->query_respect(me)+"请止步。\n"); return ::valid_leave(me, dir); }
int main(object me, string str) { if(!block_tell(me)) return 1; if (!str) { write(CYN"你看起来表情丰富。\n"NOR); tell_room(environment(me), CYN+(string)me->name()+ "看起来表情丰富。\n" +NOR, me); return 1; } write(CYN"你"+str+"\n"NOR); tell_room(environment(me), CYN+(wizardp(me)? "":"->")+(string)me->name()+ str+"\n"+NOR, me); return 1; }
int cmd_reject(string str) { object ob; string guild, guild2; if(GUILD_D->query_locked() && !wizardp(this_player())) return notify_fail(GUILD_D->query_lock_reason()); if(!this_player()->query_guild()) return 0; guild=GUILD_D->query_guild(this_player()->query_name()); if(!str) return notify_fail("Reject who?\n"); str=lower_case(str); if(this_player()->query_name() == str) return notify_fail("You may not reject yourself. Use <resign> instead.\n"); if(!GUILD_D->check_rights(this_player()->query_name(), guild, ({"council", "leader"}) )) return notify_fail("You are not permitted to do that!\n");
int cmd_gate(string str) { object prev, whatp, wherep; string prefix, loc, what, where, tmp_where; int ret; notify_fail(SYNTAX); // Parse the input into proper command request if( !str || str == "") return 0; if( sscanf(str, "%s in %s to %s", what, loc, where) != 3 && sscanf(str, "%s to %s", what, where) != 2 && sscanf(str, "%s %s", what, where) !=2) return 0; // Locate the object to be moved if(loc && loc != "") { if(get_object(loc)) whatp = present(what, get_object(loc)); } else whatp = get_object(what); if(!whatp) { write("Gate: Could not locate \"" + what + "\""); if(loc) write(" in \"" + loc + "\""); write(".\n"); return 1; } // See if you have permission to move the object if(wizardp(whatp) && whatp != this_player() && !adminp(geteuid(this_player()))) { write("You do not have permission to move that user.\n"); return 1; } // Locate where to move the object wherep = get_object(where); // Move living objects to environment, nonliving to actual object if(wherep && living(wherep) && living(whatp)) wherep = environment(wherep); if(!wherep) { tmp_where = resolv_path( "cwd", where ); catch( call_other( tmp_where, "???" ) ); // Load the poss. location
int main(object me, string arg) { mapping map; string *types, *skill, ski, map_to; int i, modify; string check; seteuid(getuid()); if (arg) sscanf(arg, "-%s %s", check, arg); if (check=="check" && wizardp(me) && arg) { me = find_player(arg); if (!me) me = LOGIN_D->find_body(arg); if (!me) return notify_fail("没有这个人。\n"); } if( !arg || check=="check" ) { map = me->query_skill_map(); if( !mapp(map) || sizeof(map)==0 ) return notify_fail(HIR"你现在没有使用任何特殊技能。\n"NOR); skill = keys(valid_types); write( CYN "以下是你目前使用中的特殊技能。\n" NOR ); for (i=0; i<sizeof(skill); i++) { if( undefinedp(valid_types[skill[i]]) ) { map_delete(map, skill[i]); continue; } if( !me->query_skill(skill[i]) ) continue; modify = me->query_temp("apply/" + skill[i]); printf( HIC " %-20s "NOR+HIY" :"NOR+WHT" %-30s "NOR+RED"有效等级:%s%4d\n"NOR, valid_types[skill[i]] + "(" + skill[i] + ")", undefinedp(map[skill[i]]) ? "无" : to_chinese(map[skill[i]]), (modify==0 ? HIW"+"NOR+YEL"" : (modify>0 ? HIC : HIR)), me->query_skill(skill[i])); } return 1; } if( arg=="?" ) { write(CYN"以下是可以使用特殊技能的种类:\n"NOR); skill = sort_array(keys(valid_types), (: strcmp :) ); for(i=0; i<sizeof(skill); i++) { printf(" %s (%s)\n", valid_types[skill[i]], skill[i] ); } return 1; }
int valid_leave(object me, string dir) { if (dir == "south" ) { if (((string)me->query("family/family_name")=="将军府") || wizardp(me) || me->query_temp("pending/jiangjun_answer")) { return ::valid_leave(me, dir); } if(objectp(present("qin an", environment(me)))) { return notify_fail("秦安喝道:将军府岂是你乱闯之地!有何贵干(answer)?\n"); } return 1; } return 1; }
void init() { object ob; ::init(); if (interactive(ob = this_player()) && !is_fighting() && !wizardp(ob)) { if((int)ob->query("combat_exp") > 100000) return; else { remove_call_out("greeting"); call_out("greeting", 1, ob); } } add_action("do_job","job"); }
int exert(object me, object target) { if ( !wizardp(me)) return 0 ; write( HIY "你全身放松,坐下来开始运功疗伤。\n" NOR); message("vision", HIY + me->name() + "吐出一口金灿灿的血,脸色立刻恢复了正常。\n" NOR, environment(me), me); me->set("eff_qi", (int)me->query("max_qi")); me->set("qi", (int)me->query("max_qi")); me->set("eff_jing", (int)me->query("max_jing")); me->set("jing", (int)me->query("max_jing")); me->set("neili", (int)me->query("max_neili")); me->set("jingli", (int)me->query("max_jingli")); return 1; }
int valid_leave(object me, string dir) { if( wizardp(me)) return 1; if (dir == "east" ) { if(me->query("combat_exp") < 100000) { if (objectp(present("yushi jiang", environment(me)))) return notify_fail("鱼师将伸手将你拦住,说:此乃天王府,闲杂人等闪开!\n"); if (objectp(present("yaocha jiang", environment(me)))) return notify_fail("药叉将伸手将你拦住,说:此乃天王府,闲杂人等闪开!\n"); } } return ::valid_leave(me, dir); }
static void init_commands() { string path; add_action( "cmd_hook", "", 1 ); path = query("PATH"); if(!path) { if( wizardp(this_object()) ) path = NEW_WIZ_PATH; else path = USER_CMDS; set("PATH", path, MASTER_ONLY); } }
int main(object me, string arg) { mapping list, tlist; mixed *klist, *tlist2; string text,*tmp, id, spec; int loop; string tmp1,tmp2; object ob, ob1; int flag; mapping skl,map; string *sname,*mapped; string name; flag = 0; // ÊÇ·ñ¸´ÖÆÁÙʱӳÉ䣿1:¸´ÖÆ 0:²»¸´ÖÆ seteuid(geteuid(me)); if (!arg) return notify_fail ("\n[USAGE]\n¡¡¡¡cpstat <source> <destination>\n"); sscanf (arg, "%s %s", tmp1,tmp2); if (!tmp1 || !tmp2) return notify_fail ("\n[USAGE]\n¡¡¡¡cpstat <source> <destination>\n"); ob=present(tmp1, environment(me)); ob1=present(tmp2, environment(me)); if (!ob || !ob1) return notify_fail ("\n[USAGE]\n¡¡¡¡cpstat <source> <destination>\n"); if (!ob->is_character()) if (!ob1->is_character()) return notify_fail ("Cpstat£º±¾Ö¸ÁîµÄ¸´ÖÆÔ´ÓëÄ¿±êÔ´±ØÐëÊÇÉúÎï¡£"); if (!wizardp(ob1)) return notify_fail("½ûÖ¹¸´ÖƵ½·ÇÎ×ʦĿ±ê¡£\n"); name = ob1->name(); id = ob1->query("id"); tell_object(me,annie_mimic(ob,ob1)); ob1->set("name",name); ob1->set("id", id); return 1; }
void help() { message("help", "The identity manager keeps track of your characters, email address, " "LANs, and connections. It works automatically at login and you can use " "the following commands:\n" "\n" "Syntax: <identity show>\n" "\n" "This will display your identity information, including email address, " "alternate characters, and LANs.\n" "\n" " <identity email [email address]>\n" "\n" "This will change the email address registered with your identity.\n" "Note that this is only visible to immortals, not other players.\n" "\n" " <identity primary [character]>\n" "\n" "This will set an alternate character to be your primary.\n" "\n" "See also: lan", tp); if (wizardp(tp)) message("help", "\n" "Immortal only commands:\n" "\n" " <identity show [player]>\n" "\n" "Shows identity information for the named player.\n" "\n" " <identity add [primary] [alternate]>\n" " <identity remove [primary] [alternate]>\n" "\n" "Adds or removes an alternate character to a player's identity.\n" "\n" " <identity merge [primary] [alternate]>\n" "\n" "Merges the first identity into the second, and deletes the first one.\n" "\n" " <identity set [player] [setting] [value]>\n" "\n" "Changes the value of a setting. Available settings:\n" "gag - on, off, or number of seconds (gag 600)\n" "exp - percentage of exp to gain (exp 105)\n", tp); }
int calculate_damage(object me, object target, int base_damage, int damage_bonus) { int damage; int myexp, youexp; damage=base_damage+(damage_bonus+random(damage_bonus))/2; myexp=me->query("combat_exp"); youexp=target->query("combat_exp"); if(random(youexp)>myexp) { damage-=damage/3; youexp/=2; } if (wizardp(me) && me->query("env/combat")=="verbose") tell_object(me, sprintf(GRN "damage: %d\n" NOR, damage)); return damage; }
int main(object me,string arg) { int level=-1; if (!wizardp(me)) return 0; if (arg=="少侠试剑" || arg=="1") level=0; else if (arg=="名侠比剑"|| arg=="2") level=1; else if (arg=="大侠评剑"|| arg=="3") level=2; else if (arg=="宗师论剑"|| arg=="4") level=3; else return notify_fail("只能指定 少侠试剑(1)、名侠比剑(2)、大侠评剑(3)、宗师论剑(4) 中的一个。\n"); return PK_D->start_by_others(level); }
int main(object me, string arg) { string targetname, fabaoname; object obj, *inv, target, obj2,old_env, fabao; int i, amount; mixed no_get; if( !wizardp(me) && environment(me)->query("no_magic") ) return notify_fail("这里禁止祭法宝。\n"); if( !arg ) return notify_fail("你要祭哪样法宝?\n"); // Check if correct format is followed if( sscanf(arg, "%s on %s", fabaoname, targetname)>2 ) return notify_fail("指令格式 : ji <法宝名称> [on <目标>]\n"); // Check if both a fabao and a target is specified. // if so, then check 1. whether the player own's the fabao, // and 2. check whether the target is in the same environment. if( sscanf(arg, "%s on %s", fabaoname, targetname)==2 ) { fabao=present(fabaoname, me); if(!fabao) return notify_fail("你没有 "+fabaoname+" 这样法宝。\n"); target = present(targetname, environment(me)); if (me->is_busy() && !fabao->query("no_busy")) return notify_fail("你上一个动作还没有完成,无暇分身祭法宝。\n"); if(!target) return notify_fail("这里没有 " + targetname + "。\n"); if(target==me) return notify_fail("对自己祭法宝?\n"); // forbid to kill a player whose mudage <16 .here is added by vikee :P if(me->query("combat_exp")<50000 && userp(target)) return notify_fail("自己功夫没练好,就想杀人?\n"); //here is modified by vikee if(me->query("daoxing")<10000 && userp(target)) return notify_fail("自己功夫没练好,就想杀人?\n");//here is modified by vikee return fabao->ji(targetname); } fabao=present(arg, me); if(!fabao) return notify_fail("你没有" + arg +"这样法宝。\n"); if (me->is_busy() && !fabao->query("no_busy")) return notify_fail("你上一个动作还没有完成,无暇分身祭法宝。\n"); return fabao->ji(); }
int cmd_identity_show(string args) { string who, msg; mixed chars, lans, conns, settings, tmp; if (args && wizardp(tp)) who = args; else who = tp->query_primary_char() || tp->query_name(); if (!IDENTITY_D->query_identity(who)) who = IDENTITY_D->query_primary(who); if (!who) FAIL("Could not find any identity information."); chars = IDENTITY_D->query_characters(who); chars -= ({ who });
int main(object me, string arg) { object board; seteuid(getuid()); board=find_object("/clone/board/news_b"); if (!board) board=new("/clone/board/news_b"); if (! arg || arg == "" ) { tell_object(me,bshort(board)); return 1; } if (arg == "all") {//news all == l board return do_look(board); } if (sscanf(arg, "discard %s", arg)) { return board->delete_post(arg); } if (sscanf(arg, "post %s", arg)) { if (! wizardp(me) || ! interactive(me)) { tell_object(me, "只有巫师才能发布新闻。\n"); return 1; } if (replace_string(arg, " ", "") == "") arg = "无标题"; if (board->do_post(arg)) { shout(HIC "【侠客行一百】" NOR + WHT + me->name() + WHT "[" + me->query("id") + WHT "]发布了一条新闻,请用(news)命令查看。\n" NOR); tell_object(me, HIC "【侠客行一百】" NOR + WHT + me->name() + WHT "[" + me->query("id") + WHT "]发布了一条新闻。\n" NOR); tell_object(me, "新闻发布完成。\n"); return 1; } return 0; } return board->do_read(arg); }
mapping query_action(object me, object weapon) { int i, level; object victim; string *limbs, limb, msg; level = (int)me->query_skill("wudang-jian", 1); if( objectp(victim = me->select_opponent()) ) { limbs = victim->query("limbs"); limb = limbs[random(sizeof(limbs))]; } if( random(me->query_temp("wudang/raozhi")) > 50 || me->query_temp("raozhi_attack") ) { switch( me->query_temp("raozhi_attack") ) { case 1: msg = "不料铮的一声轻响,$w反弹过来,直刺向$p$l"; break; case 2: msg = HIC"谁知$N於$w"HIC"上连催两重劲,剑弯成弧,又是一弯,便如长蛇之游,奇诡不可设想"NOR; break; default: msg = HIW"突然间$N$w"HIW"破空,疾刺$n"+limb+",剑到中途,剑尖微颤,竟然弯了过去,斜刺$p$l"NOR; break; } me->add_temp("wudang/raozhi", -1); me->add("neili", -25); if( wizardp(me) ) tell_object(me, sprintf("\nap: %d", COMBAT_D->skill_power(me, "sword", SKILL_USAGE_ATTACK))); return ([ "action": msg, "force" : 350+random(100), "dodge" : 10, "damage": 100+random(50), "damage_type":"刺伤", "post_action": (: raozhi :) ]); } for( i = sizeof(action); i > 0; i-- ) if( level > action[i-1]["lvl"] ) return action[NewRandom(i, 20, level/5)]; }
int main(object me, string arg) { object who, ob; int i, j, count; string *dir, *ppls, name, address; if (!wizardp(me)) return notify_fail("你没有权力使用这个指令。\n"); if (!arg) return notify_fail("指令格式:sameip <使用者姓名> | <IP 地址>\n"); count = strlen(arg); while(count--) if( arg[count] == '.' ) { name=arg; break; } seteuid(getuid()); if (name != arg) { name=arg; if( file_size(DATA_DIR + "login/" + name[0..0] + "/" + name + __SAVE_EXTENSION__)<0 ) return notify_fail("没有这位使用者。\n"); who = new(LOGIN_OB); who->set("id", name); if (! who->restore()) return notify_fail("没有这位使用者。\n"); write(who->query("name")+"上次从 "+who->query("last_from")+" 上线。\n"); if (! who->query("last_from")) return notify_fail(""); address = ip2add((string)who->query("last_from")); } else address = arg; write("寻找从 "+address+" 上线的使用者:\n"); count = 0; dir = get_dir(DATA_DIR + "login/"); i = 0; destruct(who); call_out ("search_dir",0,count,dir,i,address,me); return 1; }
mapping query_action(object me, object weapon) { int level = me->query_skill("qianzhu-wandu", 1); int i, j, n; for (n=0; n<sizeof(action); n++) { if (level < action[n]["lvl"]) { break; } } i = random(n); j = random(n); if (wizardp(me)) tell_object(me, sprintf("lvl=%d, n=%d, i=%d, j=%d\n", level, n, i, j)); if (i>j) return action[i]; return action[j]; }
int go_down() { if((string)this_player()->query_subclass() != SUBCLASS) { if(wizardp(this_player())) { write("Your wizardlyness has allowed you to enter."); this_player()->move_player("/d/tirun/fighter/berserker/berserker_hall"); return 1; } write("You cannot penetrate the force field that blocks the passage."); say(this_player()->query_cap_name()+" tries to get into the " "berserker hall, but fails.", this_player()); return 1; } this_player()->move_player(ROOMS+""+CLASS+"/"+SUBCLASS+"/"+SUBCLASS+"_hall", "through the door"); return 1; }
int main(object me, string arg) { object ob; if (!arg) { ob = me; } else if (wizardp(me)) { ob = find_player(arg); if (!ob) ob = find_living(arg); if (!ob) ob = LOGIN_D->find_body(arg); if (!ob || !me->visible(ob)) return notify_fail("没有这个人。\n"); } else return 0; write(QUEST_D->check_quests_detail(ob, me)); return 1; }
int filter(string str) { if (query_verb() == "ascend") { if (present("girl", this_object())->query_talking()) return notify_fail("You should listen to the girl finish talking first.\n"); write("%^YELLOW%^Your body begins to float, and with a blinding flash of " "light, you find yourself in a different place."); if (this_player()->query_subclass() == "antipaladin" || this_player()->query_subclass() == "kataan" || this_player()->query_subclass() == "necromancer") this_player()->move_player("/d/nopk/tirun/square", "light"); else this_player()->move_player(ROOMS"become", "light"); return 1; } if (wizardp(this_player()) || this_player()->is_monster()) return 0; write("The dead are incapable of such acts."); return 1; }
int main(object me, string arg) { string name, id; seteuid(getuid()); if (! arg) { SHOP_D->list_shop(me); return 1; } if (! wizardp(me)) return notify_fail("你没有权力使用店铺管理指令。\n"); switch (arg) { case "all" : SHOP_D->do_listall(me); break; case "open" : SHOP_D->open_all(me); break; case "close" : SHOP_D->close_all(me); break; case "reset" : SHOP_D->reset_all(me); break; default : if (sscanf(arg, "open %s", name)) { SHOP_D->open_shop(me, name); break; } if (sscanf(arg, "close %s", name)) { SHOP_D->close_shop(me, name); break; } if (sscanf(arg, "reset %s", name)) { SHOP_D->reset_shop(me, name); break; } if (sscanf(arg, "owner %s %s", name, id)) { SHOP_D->change_owner(me, name, id); break; } else return help(me); } return 1; }
int cmd_review() { write("Your messages are:\n"); write("TITLE: " + (string) this_player()->query_title() + ""); write("MIN: " + (string) this_player()->query_min() + ""); write("MOUT: " + (string) this_player()->query_mout() + ""); if (wizardp(this_player())) { write("MMIN: " + (string) this_player()->query_mmin() + ""); write("MMOUT: " + (string) this_player()->query_mmout() + ""); write("MHOME: " + (string) this_player()->query_mhome() + ""); write("MDEST: " + (string) this_player()->query_mdest() + ""); write("MCLONE: " + (string) this_player()->query_mclone() + ""); write("MVIS: " + (string) this_player()->query_mvis() + ""); write("MINVIS: " + (string) this_player()->query_minvis() + ""); } write("See 'help title' and 'help message' for more information."); return 1; }
int main(object me, string arg) { object ob; mapping my; seteuid(getuid(me)); if(!arg) ob = me; else if (wizardp(me)) { ob = present(arg, environment(me)); if (!ob) ob = find_player(arg); if (!ob) ob = find_living(arg); if (!ob) return notify_fail("你要察看谁的状态?\n"); } else return notify_fail("只有巫师能察看别人的状态。\n"); my = ob->query_entire_dbase(); printf(" 精: %s%4d/ %4d %s(%3d%%)" NOR " 精力: %s%4d / %4d (+%d)\n" NOR, status_color(my["jing"], my["eff_jing"]), my["jing"], my["eff_jing"], status_color(my["eff_jing"], my["max_jing"]), my["eff_jing"] * 100 / my["max_jing"], status_color(my["jingli"], my["max_jingli"]), my["jingli"], my["max_jingli"], my["jiajin"] ); printf(" 气: %s%4d/ %4d %s(%3d%%)" NOR " 内力: %s%4d / %4d (+%d)\n" NOR, status_color(my["qi"], my["eff_qi"]), my["qi"], my["eff_qi"], status_color(my["eff_qi"], my["max_qi"]), my["eff_qi"] * 100 / my["max_qi"], status_color(my["neili"], my["max_neili"]), my["neili"], my["max_neili"], my["jiali"] ); printf(" 食物: %s%4d/ %4d " NOR " 潜能: %s%4d / %4d\n" NOR, status_color(my["food"], ob->max_food_capacity()), my["food"], ob->max_food_capacity(), HIY, (int)ob->query("potential"), (int)ob->query("max_potential")); printf(" 饮水: %s%4d/ %4d " NOR " 经验: %s%d\n" NOR, status_color(my["water"], ob->max_water_capacity()), my["water"], ob->max_water_capacity(), HIM, my["combat_exp"] ); return 1; }