# # file:: cmd_summon.rb # # This source code copyright (C) 2009 Craig Smith # All rights reserved. # # Released under the terms of the TeensyMUD Public License # See LICENSE file for additional information. # module Cmd bindtextdomain("cmd") # Priv. command that allows teleporting # Can teleport to a room number or to a players name def cmd_summon(args) case args when /(\w+)/ # Player name whom = $1 world.all_characters.each do |cid| plyr = get_object(cid) if plyr.name=~/^#{whom}$/i if plyr.location == location sendto _("%{pronoun} is already here." % {:pronoun => plyr.pronoun}) elsif world.is_admin? plyr.id sendto _("You can not summon a god.") else msg = Msg.new _("^p1 mumbles some words and waves %{pos} hands." % {:pos => pos_pronoun}) msg.p1 = name sendroom(msg) add_event(id, cid, :show, _("The room spins and dissolves in front of you!")) loc = get_object(plyr.location) if loc loc.delete_contents(cid) add_event(loc.id, location, :arrive, cid) else add_event(nil, location, :arrive, cid) end end return end end sendto(_("Player %{whom} not found." % {:whom => whom})) else sendto _("Usage: @summon playerName") end end end