# around, comes around. import game_utils import interp import merc # noinspection PyUnusedLocal def cmd_relevel(ch, argument): if game_utils.str_cmp(ch.name, ["List", "of", "imps"]): ch.level = merc.MAX_LEVEL ch.trust = merc.MAX_LEVEL ch.send("Done.\n") elif game_utils.str_cmp(ch.name, ["List", "of", "HJs"]): ch.level = merc.MAX_LEVEL - 1 ch.trust = merc.MAX_LEVEL - 1 ch.send("Done.\n") else: ch.huh() interp.register_command( interp.CmdType( name="relevel", cmd_fun=cmd_relevel, position=merc.POS_DEAD, level=0, log=merc.LOG_NORMAL, show=False, default_arg="" ) )
ch.send("Not with all this sticky webbing on.\n") return item_index = instance.item_templates[ch.powers[merc.DPOWER_OBJ_VNUM]] if not item_index: ch.send("You don't have the ability to change into a weapon.\n") return item = object_creator.create_item(item_index, 60) ch.in_room.put(item) handler_game.act("$n transforms into $p and falls to the ground.", ch, item, None, merc.TO_ROOM) handler_game.act("You transform into $p and fall to the ground.", ch, item, None, merc.TO_CHAR) ch.obj_vnum = ch.powers[merc.DPOWER_OBJ_VNUM] item.chobj = ch ch.chobj = item ch.affected_by.set_bit(merc.AFF_POLYMORPH) ch.extra.set_bit(merc.EXTRA_OSWITCH) ch.morph = item.short_descr interp.register_command( interp.CmdType(name="weaponform", cmd_fun=cmd_weaponform, position=merc.POS_STANDING, level=2, log=merc.LOG_NORMAL, show=True, default_arg=""))
# Much time and thought has gone into this software, and you are # benefiting. We hope that you share your changes too. What goes # around, comes around. import interp import merc # noinspection PyUnusedLocal def cmd_save(ch, argument): if ch.is_npc(): return if ch.level < 2: ch.send("You must kill at least 5 mobs before you can save.\n") return # save_char_obj_backup(ch) ch.save(force=True) ch.send("Saved.\n") interp.register_command( interp.CmdType(name="save", cmd_fun=cmd_save, position=merc.POS_DEAD, level=0, log=merc.LOG_NORMAL, show=True, default_arg=""))
ch.send("It can't be locked.\n") return if not ch.valid_key(pexit.key): ch.send("You lack the key.\n") return if pexit.exit_info.is_set(merc.EX_LOCKED): ch.send("It's already locked.\n") return pexit.exit_info.set_bit(merc.EX_LOCKED) ch.send("*Click*\n") handler_game.act("$n locks the $d.", ch, None, pexit.keyword, merc.TO_ROOM) # lock the other side to_room = instance.rooms[pexit.to_room] if to_room and to_room.exit[merc.rev_dir[door]] != 0 and to_room.exit[merc.rev_dir[door]].to_room == ch.in_room: to_room.exit[merc.rev_dir[door]].exit_info.set_bit(merc.EX_LOCKED) interp.register_command( interp.CmdType( name="lock", cmd_fun=cmd_lock, position=merc.POS_SITTING, level=0, log=merc.LOG_NORMAL, show=True, default_arg="" ) )
import interp import merc # noinspection PyUnusedLocal def cmd_south(ch, argument): if ch.is_affected(merc.AFF_WEBBED): ch.send("You are unable to move with all this sticky webbing on.\n") return in_room = ch.in_room handler_ch.move_char(ch, merc.DIR_SOUTH) if not ch.is_npc() and ch.in_room != in_room: old_room = ch.in_room ch.in_room.get(ch) in_room.put(ch) handler_ch.add_tracks(ch, merc.DIR_SOUTH) ch.in_room.get(ch) old_room.put(ch) interp.register_command( interp.CmdType(name="south", cmd_fun=cmd_south, position=merc.POS_STANDING, level=0, log=merc.LOG_NORMAL, show=True, default_arg=""))
return if ch.blood < 100: ch.send("You have insufficient blood.\n") return ch.blood -= 100 ch.send("You rip your heart from your body and toss it to the ground.\n") handler_game.act("$n rips $s heart out and tosses it to the ground.", ch, None, None, merc.TO_ROOM) object_creator.make_part(ch, "heart") ch.hit -= game_utils.number_range(10, 20) fight.update_pos(ch) if ch.position == merc.POS_DEAD and not ch.is_hero(): ch.send("You have been KILLED!!\n\n") fight.raw_kill(ch) return ch.immune.set_bit(merc.IMM_STAKE) interp.register_command( interp.CmdType(name="darkheart", cmd_fun=cmd_darkheart, position=merc.POS_STANDING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
# Much time and thought has gone into this software, and you are # benefiting. We hope that you share your changes too. What goes # around, comes around. import instance import interp import merc # noinspection PyUnusedLocal def cmd_users(ch, argument): count = 0 for d in instance.descriptor_list: if d.character and ch.can_see(d.character): count += 1 ch.send("[{:3}] {}@{}\n".format( d.fileno, d.original.name if d.original else d.character.name if d.character else "(none)", d.address)) ch.send("{} user{}\n".format(count, "" if count == 1 else "s")) interp.register_command( interp.CmdType(name="users", cmd_fun=cmd_users, position=merc.POS_DEAD, level=8, log=merc.LOG_NORMAL, show=True, default_arg=""))
return fight.check_killer(ch, victim) ch.wait_state(const.skill_table["backstab"].beats) if not victim.is_npc() and victim.immune.is_set(merc.IMM_BACKSTAB): fight.damage(ch, victim, 0, "backstab") elif not victim.is_npc() or ch.is_npc( ) or game_utils.number_percent() < ch.learned["backstab"]: fight.multi_hit(ch, victim, "backstab") else: fight.damage(ch, victim, 0, "backstab") interp.register_command( interp.CmdType(name="backstab", cmd_fun=cmd_backstab, position=merc.POS_STANDING, level=0, log=merc.LOG_NORMAL, show=True, default_arg="")) interp.register_command( interp.CmdType(name="bs", cmd_fun=cmd_backstab, position=merc.POS_STANDING, level=0, log=merc.LOG_NORMAL, show=True, default_arg=""))
merc.DEMON_CURRENT] < 5000: ch.send( "It costs 5000 points of power to create a piece of demon armour.\n" ) return item_index = instance.item_templates[vnum] if not item_index: ch.send("Missing object, please inform an Immortal.\n") return ch.powers[merc.DEMON_TOTAL] -= 5000 ch.powers[merc.DEMON_CURRENT] -= 5000 item = object_creator.create_item(item_index, 50) ch.put(item) handler_game.act("$p appears in your hands in a blast of flames.", ch, item, None, merc.TO_CHAR) handler_game.act("$p appears in $n's hands in a blast of flames.", ch, item, None, merc.TO_ROOM) interp.register_command( interp.CmdType(name="demonarmor", cmd_fun=cmd_demonarmor, position=merc.POS_STANDING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
if victim.act.is_set( merc.PLR_GODLESS ) and ch.trust < merc.NO_GODLESS and not ch.extra.is_set( merc.EXTRA_ANTI_GODLESS): ch.send("You failed.\n") return victim.hit = victim.max_hit victim.mana = victim.max_mana victim.move = victim.max_move victim.head.erase() victim.arm_left.erase() victim.arm_right.erase() victim.body.erase() victim.leg_left.erase() victim.leg_right.erase() victim.bleeding.erase() fight.update_pos(victim) handler_game.act("$n has restored you.", ch, None, victim, merc.TO_VICT) ch.send("Ok.\n") interp.register_command( interp.CmdType(name="restore", cmd_fun=cmd_restore, position=merc.POS_DEAD, level=8, log=merc.LOG_ALWAYS, show=True, default_arg=""))
import interp import merc def cmd_allow(ch, argument): argument, arg = game_utils.read_word(argument) if not arg: ch.send("Remove which site from the ban list?\n") return for ban in instance.ban_list: if game_utils.str_cmp(ban.name, arg): instance.ban_list.remove(ban) del ban ch.send("Ok.\n") return ch.send("Site is not banned.\n") interp.register_command( interp.CmdType( name="allow", cmd_fun=cmd_allow, position=merc.POS_DEAD, level=11, log=merc.LOG_ALWAYS, show=True, default_arg="" ) )
victim, merc.TO_VICT) ch.save(force=True) victim.save(force=True) comm.info("{} and {} are now engaged!".format(ch.name, victim.name)) return ch.send("I don't think that would be a very good idea...\n") # noinspection PyUnusedLocal def cmd_accep(ch, argument): ch.huh() interp.register_command( interp.CmdType(name="accept", cmd_fun=cmd_accept, position=merc.POS_STANDING, level=2, log=merc.LOG_NORMAL, show=True, default_arg="")) interp.register_command( interp.CmdType(name="accep", cmd_fun=cmd_accep, position=merc.POS_STANDING, level=2, log=merc.LOG_NORMAL, show=True, default_arg=""))
"$p vanishes from the ground in an explosion of energy.", ch, item, None, merc.TO_ROOM) if chroom == objroom: handler_game.act( "$p vanishes from the ground in an explosion of energy.", ch, item, None, merc.TO_CHAR) ch.in_room.get(ch) chroom.put(ch) item.in_room.get(item) else: ch.send("You were unable to get it.\n") return victim.put(item) handler_game.act("$p appears in your hands in an explosion of energy.", victim, item, None, merc.TO_CHAR) handler_game.act("$p appears in $n's hands in an explosion of energy.", victim, item, None, merc.TO_ROOM) interp.register_command( interp.CmdType(name="otransfer", cmd_fun=cmd_otransfer, position=merc.POS_DEAD, level=8, log=merc.LOG_ALWAYS, show=True, default_arg=""))
ch.send("You can only do this if you are dying.\n") return location = instance.rooms[merc.ROOM_VNUM_TEMPLE] if not location: ch.send("You are completely lost.\n") return if ch.in_room == location: return ch.move = 0 ch.mana = 0 handler_game.act("$n fades out of existance.", ch, None, None, merc.TO_ROOM) ch.in_room.get(ch) location.put(ch) handler_game.act("$n fades into existance.", ch, None, None, merc.TO_ROOM) ch.cmd_look("auto") comm.info("{} has escaped defenceless from a fight.".format(ch.name)) interp.register_command( interp.CmdType( name="escape", cmd_fun=cmd_escape, position=merc.POS_DEAD, level=3, log=merc.LOG_NORMAL, show=True, default_arg="" ) )
if ch.powers[merc.WPOWER_WOLF] < 2: ch.huh() return elif not ch.is_vampire(): ch.huh() return if ch.is_vampire() and ch.powers[merc.UNI_RAGE] > 0: ch.send("Your beast won't let you retract your fangs.\n") return ch.vampaff.tog_bit(merc.VAM_FANGS) if ch.vampaff.is_set(merc.VAM_FANGS): ch.send("Your fangs extend out of your gums.\n") handler_game.act("A pair of razor sharp fangs extend from $n's mouth.", ch, None, None, merc.TO_ROOM) else: ch.send("Your fangs slide back into your gums.\n") handler_game.act("$n's fangs slide back into $s gums.", ch, None, None, merc.TO_ROOM) interp.register_command( interp.CmdType(name="fangs", cmd_fun=cmd_fangs, position=merc.POS_SITTING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
ch.quest = 0 item = object_creator.create_item(obj_index, 1) item.value[0] = value item.cost = value * 1000 item.item_type = merc.ITEM_QUEST item.questmaker = ch.name item.name = "quest token" item.short_descr = "a {:,} point quest token".format(value) item.description = "A {:,} point quest token lies on the floor.".format(value) ch.put(item) if victim and victim != ch: handler_game.act("You reach behind $N's ear and produce $p.", ch, item, victim, merc.TO_CHAR) handler_game.act("$n reaches behind $N's ear and produces $p.", ch, item, victim, merc.TO_NOTVICT) handler_game.act("$n reaches behind your ear and produces $p.", ch, item, victim, merc.TO_VICT) else: handler_game.act("You snap your fingers and reveal $p.", ch, item, None, merc.TO_CHAR) handler_game.act("$n snaps $s fingers and reveals $p.", ch, item, None, merc.TO_ROOM) interp.register_command( interp.CmdType( name="token", cmd_fun=cmd_token, position=merc.POS_STANDING, level=2, log=merc.LOG_NORMAL, show=True, default_arg="" ) )
ch.huh() return if not item.chobj or item.chobj != ch: ch.huh() return if not ch.head.is_set(merc.LOST_HEAD): ch.send("You cannot change your lifespan in this form.\n") return if game_utils.str_cmp(arg, ["l", "long"]): item.timer = 0 elif game_utils.str_cmp(arg, ["s", "short"]): item.timer = 1 else: ch.send("Do you wish to have a long or short lifespan?\n") return ch.send("Ok.\n") interp.register_command( interp.CmdType(name="lifespan", cmd_fun=cmd_lifespan, position=merc.POS_RESTING, level=2, log=merc.LOG_NORMAL, show=True, default_arg=""))
if not arg: if ch.incog_level: ch.incog_level = 0 handler_game.act("$n is no longer cloaked.", ch, None, None, merc.TO_ROOM) ch.send("You are no longer cloaked.\n") else: ch.incog_level = ch.trust handler_game.act("$n cloaks $s presence.", ch, None, None, merc.TO_ROOM) ch.send("You cloak your presence.\n") else: level = int(arg) if arg.isdigit() else -1 if level not in merc.irange(2, ch.level): ch.send("Incog level must be between 2 and your level.\n") return ch.reply = None ch.incog_level = level handler_game.act("$n cloaks $s presence.", ch, None, None, merc.TO_ROOM) ch.send("You cloak your presence.\n") interp.register_command( interp.CmdType( name="incog", cmd_fun=cmd_incognito, position=merc.POS_DEAD, level=7, log=merc.LOG_NORMAL, show=True, default_arg="" ) )
elif victim.is_affected(merc.AFF_POLYMORPH): victim.affected_by.bits = merc.AFF_POLYMORPH elif victim.is_affected(merc.AFF_ETHEREAL): victim.affected_by.bits = merc.AFF_ETHEREAL else: victim.affected_by.clear() victim.armor = 100 victim.hit = max(1, victim.hit) victim.mana = max(1, victim.mana) victim.move = max(1, victim.move) victim.hitroll = 0 victim.damroll = 0 victim.saving_throw = 0 victim.mod_stat = [0 for _ in merc.MAX_STATS] victim.followers = 0 victim.save(force=True) victim.send( "Your stats have been cleared. Please rewear your equipment.\n") ch.send("Ok.\n") interp.register_command( interp.CmdType(name="mclear", cmd_fun=cmd_mclear, position=merc.POS_DEAD, level=9, log=merc.LOG_ALWAYS, show=True, default_arg=""))
# Gabrielle Taylor ([email protected]), and Brian Moore ([email protected]). # # Ported to Python by Davion of MudBytes.net using Miniboa # (https://code.google.com/p/miniboa/). # # In order to use any part of this Merc Diku Mud, you must comply with # both the original Diku license in 'license.doc' as well the Merc # license in 'license.txt'. In particular, you may not remove either of # these copyright notices. # # Much time and thought has gone into this software, and you are # benefiting. We hope that you share your changes too. What goes # around, comes around. import interp import merc def cmd_question(ch, argument): ch.talk_channel(argument, merc.CHANNEL_QUESTION, "question") interp.register_command( interp.CmdType(name="question", cmd_fun=cmd_question, position=merc.POS_SLEEPING, level=0, log=merc.LOG_NORMAL, show=True, default_arg=""))
("stab", merc.WPN_STAB), ("slash", merc.WPN_SLASH), ("whip", merc.WPN_WHIP), ("claw", merc.WPN_CLAW), ("blast", merc.WPN_BLAST), ("pound", merc.WPN_POUND), ("crush", merc.WPN_CRUSH), ("grep", merc.WPN_GREP), ("bite", merc.WPN_BITE), ("pierce", merc.WPN_PIERCE), ("suck", merc.WPN_SUCK) ] for (aa, bb) in wpn_list: if game_utils.str_cmp(arg3, aa): victim.wpn[bb] = value ch.send("Ok.\n") return else: ch.send("No such weapon skill exists.\n") else: ch.send("Sorry, no can do...\n") return # Generate usage message. ch.cmd_pset("") interp.register_command( interp.CmdType(name="pset", cmd_fun=cmd_pset, position=merc.POS_DEAD, level=10, log=merc.LOG_ALWAYS, show=True, default_arg=""))
buf += "Alignment:{}.\n".format(victim.alignment) if not victim.is_npc() and victim.is_vampire(): buf += "Disciplines:" disc_list = [(merc.VAM_PROTEAN, "Protean"), (merc.VAM_CELERITY, "Celerity"), (merc.VAM_FORTITUDE, "Fortitude"), (merc.VAM_POTENCE, "Potence"), (merc.VAM_OBFUSCATE, "Obfuscate"), (merc.VAM_OBTENEBRATION, "Obtenebration"), (merc.VAM_SERPENTIS, "Serpentis"), (merc.VAM_AUSPEX, "Auspex"), (merc.VAM_DOMINATE, "Dominate"), (merc.VAM_PRESENCE, "Presence")] for (aa, bb) in disc_list: if victim.vampaff.is_set(aa): buf += " " + bb buf += ".\n" ch.send("".join(buf)) interp.register_command( interp.CmdType(name="readaura", cmd_fun=cmd_readaura, position=merc.POS_STANDING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
ch.mana -= mana // 2 ch.improve_spl(sn.target) else: ch.mana -= mana if ch.is_npc(): sn.spell_fun(sn.name, int(ch.level), ch, vo, target) else: sn.spell_fun(sn.name, int(ch.spl[sn.target] * 0.25), ch, vo, target) ch.improve_spl(sn.target) if sn.target == merc.TAR_CHAR_OFFENSIVE and victim != ch and ( victim.master and instance.characters[victim.master] != ch): for vch_id in ch.in_room.people[:]: vch = instance.characters[vch_id] if victim == vch and not victim.fighting: fight.multi_hit(victim, ch, merc.TYPE_UNDEFINED) break interp.register_command( interp.CmdType(name="cast", cmd_fun=cmd_cast, position=merc.POS_FIGHTING, level=0, log=merc.LOG_NORMAL, show=True, default_arg=""))
handler_game.act("$n places a blindfold over your eyes.", ch, None, victim, merc.TO_VICT) victim.extra.set_bit(merc.EXTRA_BLINDFOLDED) return if ch == victim: handler_game.act("You remove the blindfold from your eyes.", ch, None, victim, merc.TO_CHAR) handler_game.act("$n removes the blindfold from $s eyes.", ch, None, victim, merc.TO_ROOM) victim.extra.rem_bit(merc.EXTRA_BLINDFOLDED) return handler_game.act("You remove the blindfold from $N's eyes.", ch, None, victim, merc.TO_CHAR) handler_game.act("$n removes the blindfold from $N's eyes.", ch, None, victim, merc.TO_NOTVICT) handler_game.act("$n removes the blindfold from your eyes.", ch, None, victim, merc.TO_VICT) victim.extra.rem_bit(merc.EXTRA_BLINDFOLDED) interp.register_command( interp.CmdType(name="blindfold", cmd_fun=cmd_blindfold, position=merc.POS_STANDING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
# around, comes around. import handler_game import interp import merc # noinspection PyUnusedLocal def cmd_rest(ch, argument): pos = ch.position if pos == merc.POS_SLEEPING: ch.send("You are already sleeping.\n") elif pos == merc.POS_RESTING: ch.send("You are already resting.\n") elif pos in [merc.POS_MEDITATING, merc.POS_SITTING, merc.POS_STANDING]: ch.send("You rest.\n") handler_game.act("$n rests.", ch, None, None, merc.TO_ROOM) ch.position = merc.POS_RESTING elif pos == merc.POS_FIGHTING: ch.send("You are already fighting!\n") interp.register_command( interp.CmdType(name="rest", cmd_fun=cmd_rest, position=merc.POS_MEDITATING, level=0, log=merc.LOG_NORMAL, show=True, default_arg=""))
return if victim.trust >= ch.trust: ch.send("You failed.\n") return if victim.act.is_set( merc.PLR_GODLESS ) and ch.trust < merc.NO_GODLESS and not ch.extra.is_set( merc.EXTRA_ANTI_GODLESS): ch.send("You failed.\n") return victim.sentances.tog_bit(merc.SENT_NO_TELL) if victim.sentances.is_set(merc.SENT_NO_TELL): victim.send("You can't tell!\n") ch.send("NO_TELL set.\n") else: victim.send("You can tell again.\n") ch.send("NO_TELL removed.\n") interp.register_command( interp.CmdType(name="notell", cmd_fun=cmd_notell, position=merc.POS_DEAD, level=9, log=merc.LOG_NORMAL, show=True, default_arg=""))
rch.name if not rch.is_npc() else rch.short_descr) buf += ".\nObjects: " for obj_id in location.inventory[:]: obj = instance.global_instances[obj_id] buf += "'{}' ".format(obj.name) buf += ".\n" for door, pexit in enumerate(location.exit): if pexit: ch.send( "Door: {}. To: {}. Key: {}. Exit flags: {}.\nKeyword: '{}'. Description: {}" .format( door, # TODO: come back and fix this -1 if pexit.to_room is None else instance.rooms[pexit.to_room].vnum, -1 if pexit.key is None else pexit.key, pexit.exit_info, pexit.keyword, pexit.description if pexit.description else "(none).\n")) interp.register_command( interp.CmdType(name="rstat", cmd_fun=cmd_rstat, position=merc.POS_DEAD, level=7, log=merc.LOG_NORMAL, show=True, default_arg=""))
return if ch.years_old() < 75 and ch.powers[merc.UNI_GEN] > 2: ch.send("You must be at least an Elder to become an Inconnu.\n") return if ch.special.is_set(merc.SPC_INCONNU): ch.send("But you are already an Inconnu!\n") return if ch.exp < 1000000: ch.send("It costs 1000000 exp to become an Inconnu.\n") return ch.special.rem_bit(merc.SPC_ANARCH) ch.clan = "" ch.exp -= 1000000 ch.send("You are now an Inconnu.\n") comm.info("{} is now an Inconnu!".format(ch.name)) ch.special.set_bit(merc.SPC_INCONNU) interp.register_command( interp.CmdType(name="inconnu", cmd_fun=cmd_inconnu, position=merc.POS_STANDING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
return if not ch.vampaff.is_set(merc.VAM_OBTENEBRATION): ch.send("You are not trained in the Obtenebration discipline.\n") return if ch.is_affected(merc.AFF_SHADOWSIGHT): ch.send("You can no longer see between planes.\n") ch.affected_by.rem_bit(merc.AFF_SHADOWSIGHT) return if ch.is_vampire(): if ch.blood < 10: ch.send("You have insufficient blood.\n") return ch.blood -= game_utils.number_range(5, 10) ch.send("You can now see between planes.\n") ch.affected_by.set_bit(merc.AFF_SHADOWSIGHT) interp.register_command( interp.CmdType(name="shadowsight", cmd_fun=cmd_shadowsight, position=merc.POS_SITTING, level=3, log=merc.LOG_NORMAL, show=True, default_arg=""))
handler_game.act("You slay $M in cold blood!", ch, None, victim, merc.TO_CHAR) handler_game.act("$n slays you in cold blood!", ch, None, victim, merc.TO_VICT) handler_game.act("$n slays $N in cold blood!", ch, None, victim, merc.TO_NOTVICT) fight.raw_kill(victim) # noinspection PyUnusedLocal def cmd_sla(ch, argument): ch.send("If you want to SLAY, spell it out.\n") interp.register_command( interp.CmdType(name="slay", cmd_fun=cmd_slay, position=merc.POS_DEAD, level=10, log=merc.LOG_ALWAYS, show=True, default_arg="")) interp.register_command( interp.CmdType(name="sla", cmd_fun=cmd_sla, position=merc.POS_DEAD, level=10, log=merc.LOG_NORMAL, show=False, default_arg=""))